pub struct QrCode { /* private fields */ }
Expand description
The m.qr_code.scan.v1
, m.qr_code.show.v1
, and m.reciprocate.v1
verification flow.
Implementations§
Source§impl QrCode
impl QrCode
Sourcepub fn other_user_id(&self) -> String
pub fn other_user_id(&self) -> String
Get the user id of the other side.
Sourcepub fn other_device_id(&self) -> String
pub fn other_device_id(&self) -> String
Get the device ID of the other side.
Sourcepub fn flow_id(&self) -> String
pub fn flow_id(&self) -> String
Get the unique ID that identifies this QR code verification flow.
Sourcepub fn room_id(&self) -> Option<String>
pub fn room_id(&self) -> Option<String>
Get the room id if the verification is happening inside a room.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Has the verification flow been cancelled.
Sourcepub fn we_started(&self) -> bool
pub fn we_started(&self) -> bool
Did we initiate the verification flow.
Sourcepub fn cancel_info(&self) -> Option<CancelInfo>
pub fn cancel_info(&self) -> Option<CancelInfo>
Get the CancelInfo of this QR code verification object.
Will be None
if the flow has not been cancelled.
Sourcepub fn has_been_scanned(&self) -> bool
pub fn has_been_scanned(&self) -> bool
Has the QR verification been scanned by the other side.
When the verification object is in this state it’s required that the user confirms that the other side has scanned the QR code.
Sourcepub fn reciprocated(&self) -> bool
pub fn reciprocated(&self) -> bool
Have we successfully scanned the QR code and are able to send a reciprocation event.
Sourcepub fn cancel(&self, cancel_code: String) -> Option<OutgoingVerificationRequest>
pub fn cancel(&self, cancel_code: String) -> Option<OutgoingVerificationRequest>
Sourcepub fn confirm(&self) -> Option<ConfirmVerificationResult>
pub fn confirm(&self) -> Option<ConfirmVerificationResult>
Confirm a verification was successful.
This method should be called if we want to confirm that the other side has scanned our QR code.
Sourcepub fn generate_qr_code(&self) -> Option<String>
pub fn generate_qr_code(&self) -> Option<String>
Generate data that should be encoded as a QR code.
This method should be called right before a QR code should be displayed, the returned data is base64 encoded (without padding) and needs to be decoded on the other side before it can be put through a QR code generator.
Sourcepub fn set_changes_listener(&self, listener: Box<dyn QrCodeListener>)
pub fn set_changes_listener(&self, listener: Box<dyn QrCodeListener>)
Set a listener for changes in the QrCode verification process.
The given callback will be called whenever the state changes.
Sourcepub fn state(&self) -> QrCodeState
pub fn state(&self) -> QrCodeState
Get the current state of the QrCode verification process.
Trait Implementations§
Source§impl<UT> LowerError<UT> for QrCode
impl<UT> LowerError<UT> for QrCode
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for QrCode
impl<UT> LowerReturn<UT> for QrCode
Source§type ReturnType = <Arc<QrCode> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<QrCode> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
Source§impl<UT> TypeId<UT> for QrCode
impl<UT> TypeId<UT> for QrCode
const TYPE_ID_META: MetadataBuffer = _
Auto Trait Implementations§
impl Freeze for QrCode
impl !RefUnwindSafe for QrCode
impl Send for QrCode
impl Sync for QrCode
impl Unpin for QrCode
impl !UnwindSafe for QrCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more