pub struct SasVerification { /* private fields */ }
Available on crate feature e2e-encryption only.
Expand description

An object controlling the short auth string verification flow.

Implementations

Accept the interactive verification flow.

Accept the interactive verification flow with specific settings.

Arguments
  • settings - specific customizations to the verification flow.
Examples
use matrix_sdk::{
    encryption::verification::{AcceptSettings, SasVerification},
    ruma::events::key::verification::ShortAuthenticationString,
};

let sas = client
    .encryption()
    .get_verification(&user_id, flow_id)
    .await
    .and_then(|v| v.sas());

if let Some(sas) = sas {
    let only_decimal = AcceptSettings::with_allowed_methods(vec![
        ShortAuthenticationString::Decimal,
    ]);

    sas.accept_with_settings(only_decimal).await?;
}

Confirm that the short auth strings match on both sides.

Cancel the interactive verification flow because the short auth strings didn’t match on both sides.

Cancel the interactive verification flow.

Get the emoji version of the short auth string.

Examples
use matrix_sdk::{
    encryption::verification::{AcceptSettings, SasVerification},
    ruma::events::key::verification::ShortAuthenticationString,
};

let sas_verification = client
    .encryption()
    .get_verification(&user_id, flow_id)
    .await
    .and_then(|v| v.sas());

if let Some(emojis) = sas_verification.and_then(|s| s.emoji()) {
    let emoji_string = emojis
        .iter()
        .map(|e| format!("{:^12}", e.symbol))
        .collect::<Vec<_>>()
        .join("");

    let description = emojis
        .iter()
        .map(|e| format!("{:^12}", e.description))
        .collect::<Vec<_>>()
        .join("");

    println!("Do the emojis match?\n{emoji_string}\n{description}");
}

Get the decimal version of the short auth string.

Does this verification flow support emoji for the short authentication string.

Is the verification process done.

Are we in a state where we can show the short auth string.

Did we initiate the verification flow.

Get info about the cancellation if the verification flow has been cancelled.

Is the verification process canceled.

Get the other users device that we’re verifying.

Did this verification flow start from a verification request.

Is this a verification that is veryfying one of our own devices.

Get our own user id.

Get the user id of the other user participating in this verification flow.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more