pub(crate) enum SessionIntent {
ShowMatrixId(MatrixIdUri),
ShowIdentityVerification(VerificationKey),
}
Expand description
Intents that can be handled by a session.
It cannot be cloned intentionnally, 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) 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 to_variant_with_session_id(&self, session_id: &str) -> Variant
pub(crate) fn to_variant_with_session_id(&self, session_id: &str) -> Variant
Convert this intent to a GVariant
with the given session ID.
Sourcepub(crate) fn from_variant_with_session_id(
intent_type: SessionIntentType,
variant: &Variant,
) -> Option<(String, Self)>
pub(crate) fn from_variant_with_session_id( intent_type: SessionIntentType, variant: &Variant, ) -> Option<(String, Self)>
Convert a GVariant
to a SessionIntent
and session ID, given the
intent type.
Returns an (session_id, intent)
tuple on success. Returns None
if
the payload could not be parsed successfully.
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
Converts to this type from the input type.
Source§impl From<VerificationKey> for SessionIntent
impl From<VerificationKey> for SessionIntent
Source§fn from(value: VerificationKey) -> Self
fn from(value: VerificationKey) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SessionIntent
impl RefUnwindSafe for SessionIntent
impl Send for SessionIntent
impl Sync for SessionIntent
impl Unpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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