Be aware: Foundation will NEVER ask for your seed words, device PIN, or call you unexpectedly. If anyone does, it's a scam.

Enum

ScanQrResult

pub enum ScanQrResult {
    Qr {
        data: Vec<u8>,
        matching_apps: Option<Vec<ScanQrMatchingApp>>,
    },
    Ur2 {
        ur_type: String,
        data: Vec<u8>,
        matching_apps: Option<Vec<ScanQrMatchingApp>>,
    },
    LeftClicked,
    RightClicked,
    ButtonClicked,
}

Variants

Qr

Fields

data: Vec<u8>
matching_apps: Option<Vec<ScanQrMatchingApp>>

Ur2

Fields

ur_type: String
data: Vec<u8>
matching_apps: Option<Vec<ScanQrMatchingApp>>

LeftClicked

RightClicked

ButtonClicked

Implementations

impl ScanQrResult

pub fn new_qr(data: &[u8]) -> Self

Permission: not needed

pub fn new_ur2(ur_type: String, data: &[u8]) -> Self

Permission: not needed

pub fn with_matching_apps(self, matching_apps: Vec<ScanQrMatchingApp>) -> Self

Permission: not needed

pub fn new_cancelled() -> Self

Permission: not needed

pub fn from_slice(data: &[u8]) -> Option<Self>

Permission: not needed

pub fn serialize(&self) -> Vec<u8> ⓘ

Permission: not needed

Trait Implementations

impl Archive for ScanQrResult
where Vec<u8>: Archive, Option<Vec<ScanQrMatchingApp>>: Archive, String: Archive,

type Archived = ArchivedScanQrResult

The archived representation of this type. Read more

type Resolver = ScanQrResultResolver

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.

fn resolve( &self, resolver: <Self as Archive>::Resolver, out: Place<<Self as Archive>::Archived>, )

Creates the archived version of this value at the given position and writes it to the given output. Read more

const COPY_OPTIMIZATION: CopyOptimization<Self> = _

An optimization flag that allows the bytes of this type to be copied directly to a writer instead of calling serialize. Read more

impl Clone for ScanQrResult

fn clone(&self) -> ScanQrResult

Returns a duplicate of the value. Read more
1.0.0

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

impl Debug for ScanQrResult

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

impl<__D: Fallible + ?Sized> Deserialize<ScanQrResult, __D> for Archived<ScanQrResult>
where Vec<u8>: Archive, <Vec<u8> as Archive>::Archived: Deserialize<Vec<u8>, __D>, Option<Vec<ScanQrMatchingApp>>: Archive, <Option<Vec<ScanQrMatchingApp>> as Archive>::Archived: Deserialize<Option<Vec<ScanQrMatchingApp>>, __D>, String: Archive, <String as Archive>::Archived: Deserialize<String, __D>,

fn deserialize( &self, deserializer: &mut __D, ) -> Result<ScanQrResult, <__D as Fallible>::Error>

Deserializes using the given deserializer

impl<__S: Fallible + ?Sized> Serialize<__S> for ScanQrResult
where Vec<u8>: Serialize<__S>, Option<Vec<ScanQrMatchingApp>>: Serialize<__S>, String: Serialize<__S>,

fn serialize( &self, serializer: &mut __S, ) -> Result<<Self as Archive>::Resolver, <__S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.

Auto Trait Implementations

impl Freeze for ScanQrResult

impl RefUnwindSafe for ScanQrResult

impl Send for ScanQrResult

impl Sync for ScanQrResult

impl Unpin for ScanQrResult

impl UnsafeUnpin for ScanQrResult

impl UnwindSafe for ScanQrResult