pub(crate) enum SessionIntent {
ShowMatrixId(MatrixIdUri),
ShowIdentityVerification(VerificationKey),
}Expand description
Intents that can be handled by a session.
It cannot be cloned intentionally, so it is handled only once.
Variants§
ShowMatrixId(MatrixIdUri)
Show the target of a Matrix ID URI.
ShowIdentityVerification(VerificationKey)
Show an ongoing identity verification.
Implementations§
Source§impl SessionIntent
impl SessionIntent
Sourcepub(crate) const SHOW_MATRIX_ID_APP_ACTION_NAME: &str = "app.show-matrix-id"
pub(crate) const SHOW_MATRIX_ID_APP_ACTION_NAME: &str = "app.show-matrix-id"
The application action name for the SessionIntent::ShowMatrixId
variant.
Sourcepub(crate) const SHOW_MATRIX_ID_ACTION_NAME: &str
pub(crate) const SHOW_MATRIX_ID_ACTION_NAME: &str
The action name without the app. prefix for the
SessionIntent::ShowMatrixId variant.
Sourcepub(crate) const SHOW_IDENTITY_VERIFICATION_APP_ACTION_NAME: &str = "app.show-identity-verification"
pub(crate) const SHOW_IDENTITY_VERIFICATION_APP_ACTION_NAME: &str = "app.show-identity-verification"
The application action name for the
SessionIntent::ShowIdentityVerification variant.
Sourcepub(crate) const SHOW_IDENTITY_VERIFICATION_ACTION_NAME: &str
pub(crate) const SHOW_IDENTITY_VERIFICATION_ACTION_NAME: &str
The action name without the app. prefix for the
SessionIntent::ShowIdentityVerification variant.
Sourcepub(crate) fn app_action_name(&self) -> &'static str
pub(crate) fn app_action_name(&self) -> &'static str
Get the application action name for this session intent type.
Sourcepub(crate) fn show_matrix_id_from_variant(
variant: &Variant,
) -> Option<(String, Self)>
pub(crate) fn show_matrix_id_from_variant( variant: &Variant, ) -> Option<(String, Self)>
Convert the given GVariant to a SessionIntent::ShowMatrixId and
session ID, given the intent type.
Returns a (session_id, intent) tuple on success. Returns None if
the GVariant could not be parsed successfully.
Sourcepub(crate) fn show_identity_verification_from_variant(
variant: &Variant,
) -> Option<(String, Self)>
pub(crate) fn show_identity_verification_from_variant( variant: &Variant, ) -> Option<(String, Self)>
Convert the given GVariant to a
SessionIntent::ShowIdentityVerification and session ID, given the
intent type.
Returns a (session_id, intent) tuple on success. Returns None if
the GVariant could not be parsed successfully.
Sourcepub(crate) fn to_variant_with_session_id(&self, session_id: String) -> Variant
pub(crate) fn to_variant_with_session_id(&self, session_id: String) -> Variant
Convert this intent to a GVariant with the given session ID.
Trait Implementations§
Source§impl Debug for SessionIntent
impl Debug for SessionIntent
Source§impl From<MatrixIdUri> for SessionIntent
impl From<MatrixIdUri> for SessionIntent
Source§fn from(value: MatrixIdUri) -> Self
fn from(value: MatrixIdUri) -> Self
Source§impl From<VerificationKey> for SessionIntent
impl From<VerificationKey> for SessionIntent
Source§fn from(value: VerificationKey) -> Self
fn from(value: VerificationKey) -> Self
Source§impl StaticVariantType for SessionIntent
impl StaticVariantType for SessionIntent
Source§fn static_variant_type() -> Cow<'static, VariantTy>
fn static_variant_type() -> Cow<'static, VariantTy>
VariantType corresponding to Self.Auto Trait Implementations§
impl Freeze for SessionIntent
impl RefUnwindSafe for SessionIntent
impl Send for SessionIntent
impl Sync for SessionIntent
impl Unpin for SessionIntent
impl UnsafeUnpin for SessionIntent
impl UnwindSafe for SessionIntent
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
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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