pub struct VerificationRequest { /* private fields */ }
Expand description
The verificatoin request object which then can transition into some concrete verification method
Implementations§
Source§impl VerificationRequest
impl VerificationRequest
Sourcepub fn other_user_id(&self) -> String
pub fn other_user_id(&self) -> String
The id of the other user that is participating in this verification request.
Sourcepub fn other_device_id(&self) -> Option<String>
pub fn other_device_id(&self) -> Option<String>
The id of the other device that is participating in this verification.
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_done(&self) -> bool
pub fn is_done(&self) -> bool
Has the verification flow that was started with this request finished.
Sourcepub fn we_started(&self) -> bool
pub fn we_started(&self) -> bool
Did we initiate the verification request
Sourcepub fn is_passive(&self) -> bool
pub fn is_passive(&self) -> bool
Has the verification request been answered by another device.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Has the verification flow that been cancelled.
Sourcepub fn cancel_info(&self) -> Option<CancelInfo>
pub fn cancel_info(&self) -> Option<CancelInfo>
Get info about the cancellation if the verification request has been cancelled.
Sourcepub fn their_supported_methods(&self) -> Option<Vec<String>>
pub fn their_supported_methods(&self) -> Option<Vec<String>>
Get the supported verification methods of the other side.
Will be present only if the other side requested the verification or if we’re in the ready state.
Sourcepub fn our_supported_methods(&self) -> Option<Vec<String>>
pub fn our_supported_methods(&self) -> Option<Vec<String>>
Get our own supported verification methods that we advertised.
Will be present only we requested the verification or if we’re in the ready state.
Sourcepub fn accept(
&self,
methods: Vec<String>,
) -> Option<OutgoingVerificationRequest>
pub fn accept( &self, methods: Vec<String>, ) -> Option<OutgoingVerificationRequest>
Accept a verification requests that we share with the given user with the given flow id.
This will move the verification request into the ready state.
§Arguments
-
user_id
- The ID of the user for which we would like to accept the verification requests. -
flow_id
- The ID that uniquely identifies the verification flow. -
methods
- A list of verification methods that we want to advertise as supported.
Sourcepub fn cancel(&self) -> Option<OutgoingVerificationRequest>
pub fn cancel(&self) -> Option<OutgoingVerificationRequest>
Cancel a verification for the given user with the given flow id using the given cancel code.
Sourcepub fn start_sas_verification(
&self,
) -> Result<Option<StartSasResult>, CryptoStoreError>
pub fn start_sas_verification( &self, ) -> Result<Option<StartSasResult>, CryptoStoreError>
Transition from a verification request into short auth string based verification.
§Arguments
-
user_id
- The ID of the user for which we would like to start the SAS verification. -
flow_id
- The ID of the verification request that initiated the verification flow.
Sourcepub fn start_qr_verification(
&self,
) -> Result<Option<Arc<QrCode>>, CryptoStoreError>
pub fn start_qr_verification( &self, ) -> Result<Option<Arc<QrCode>>, CryptoStoreError>
Transition from a verification request into QR code verification.
This method should be called when one wants to display a QR code so the other side can scan it and move the QR code verification forward.
§Arguments
-
user_id
- The ID of the user for which we would like to start the QR code verification. -
flow_id
- The ID of the verification request that initiated the verification flow.
Sourcepub fn scan_qr_code(&self, data: String) -> Option<ScanResult>
pub fn scan_qr_code(&self, data: String) -> Option<ScanResult>
Pass data from a scanned QR code to an active verification request and transition into QR code verification.
This requires an active VerificationRequest
to succeed, returns None
if no VerificationRequest
is found or if the QR code data is invalid.
§Arguments
-
user_id
- The ID of the user for which we would like to start the QR code verification. -
flow_id
- The ID of the verification request that initiated the verification flow. -
data
- The data that was extracted from the scanned QR code as an base64 encoded string, without padding.
Sourcepub fn set_changes_listener(
&self,
listener: Box<dyn VerificationRequestListener>,
)
pub fn set_changes_listener( &self, listener: Box<dyn VerificationRequestListener>, )
Set a listener for changes in the verification request
The given callback will be called whenever the state changes.
Sourcepub fn state(&self) -> VerificationRequestState
pub fn state(&self) -> VerificationRequestState
Get the current state of the verification request.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for VerificationRequest
impl<UT> LiftRef<UT> for VerificationRequest
type LiftType = Arc<VerificationRequest>
Source§impl<UT> LowerError<UT> for VerificationRequest
impl<UT> LowerError<UT> for VerificationRequest
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for VerificationRequest
impl<UT> LowerReturn<UT> for VerificationRequest
Source§type ReturnType = <Arc<VerificationRequest> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<VerificationRequest> 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 VerificationRequest
impl<UT> TypeId<UT> for VerificationRequest
const TYPE_ID_META: MetadataBuffer = _
Auto Trait Implementations§
impl Freeze for VerificationRequest
impl !RefUnwindSafe for VerificationRequest
impl Send for VerificationRequest
impl Sync for VerificationRequest
impl Unpin for VerificationRequest
impl !UnwindSafe for VerificationRequest
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