pub trait SecretFromQrCode {
    // Required methods
    fn from_file<P: AsRef<Path>>(
        qr: P,
        pin_read_mode: PinReadMode
    ) -> Result<Secret, Error>;
    fn from_bytes(
        bytes: Vec<u8>,
        pin_read_mode: PinReadMode
    ) -> Result<Secret, Error>;
    fn to_bech32(self) -> Result<String, Error>;
    fn from_payload_file<P: AsRef<Path>>(
        payload_file: P,
        pin_read_mode: PinReadMode
    ) -> Result<Secret, Error>;
}
Expand description

Trait for converting qr code into secret key

Required Methods§

source

fn from_file<P: AsRef<Path>>( qr: P, pin_read_mode: PinReadMode ) -> Result<Secret, Error>

Convert to secret from qr code file

Errors

On incorrect format

source

fn from_bytes( bytes: Vec<u8>, pin_read_mode: PinReadMode ) -> Result<Secret, Error>

Convert to secret from bytes

Errors

On illegal bytes length

source

fn to_bech32(self) -> Result<String, Error>

Convert secret to bech32 format

Errors

On converting to bech32 error

source

fn from_payload_file<P: AsRef<Path>>( payload_file: P, pin_read_mode: PinReadMode ) -> Result<Secret, Error>

Convert from qr code payload

Errors

Read from payload file

Implementors§