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
Ur2
LeftClicked
RightClicked
ButtonClicked
Implementations
impl ScanQrResult
impl ScanQrResult
pub fn new_qr(data: &[u8]) -> Self
pub fn new_ur2(ur_type: String, data: &[u8]) -> Self
pub fn with_matching_apps(self, matching_apps: Vec<ScanQrMatchingApp>) -> Self
pub fn new_cancelled() -> Self
pub fn from_slice(data: &[u8]) -> Option<Self>
pub fn serialize(&self) -> Vec<u8> ⓘ
Trait Implementations
impl Archive for ScanQrResult
impl Archive for ScanQrResult
type Archived = ArchivedScanQrResult
type Archived = ArchivedScanQrResult
The archived representation of this type. Read more
type Resolver = ScanQrResultResolver
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>,
)
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> = _
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 moreimpl Clone for ScanQrResult
impl Clone for ScanQrResult
fn clone(&self) -> ScanQrResult
fn clone(&self) -> ScanQrResult
Returns a duplicate of the value. Read more
1.0.0fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Debug for ScanQrResult
impl Debug for ScanQrResult
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>,
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>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<ScanQrResult, <__D as Fallible>::Error>
Deserializes using the given deserializer
impl<__S: Fallible + ?Sized> Serialize<__S> for ScanQrResultwhere
Vec<u8>: Serialize<__S>,
Option<Vec<ScanQrMatchingApp>>: Serialize<__S>,
String: Serialize<__S>,
impl<__S: Fallible + ?Sized> Serialize<__S> for ScanQrResultwhere
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>
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.