pub enum TimelineEventKind {
Decrypted(DecryptedRoomEvent),
UnableToDecrypt {
event: Raw<AnySyncTimelineEvent>,
utd_info: UnableToDecryptInfo,
},
PlainText {
event: Raw<AnySyncTimelineEvent>,
},
}
Expand description
The event within a TimelineEvent
or SyncTimelineEvent
, together with
encryption data.
Variants§
Decrypted(DecryptedRoomEvent)
A successfully-decrypted encrypted event.
UnableToDecrypt
An encrypted event which could not be decrypted.
Fields
event: Raw<AnySyncTimelineEvent>
The m.room.encrypted
event. Depending on the source of the event,
it could actually be an AnyTimelineEvent
(i.e., it may
have a room_id
property).
utd_info: UnableToDecryptInfo
Information on the reason we failed to decrypt
PlainText
An unencrypted event.
Fields
event: Raw<AnySyncTimelineEvent>
The actual event. Depending on the source of the event, it could
actually be a AnyTimelineEvent
(which differs from
AnySyncTimelineEvent
by the addition of a room_id
property).
Implementations§
§impl TimelineEventKind
impl TimelineEventKind
pub fn raw(&self) -> &Raw<AnySyncTimelineEvent>
pub fn raw(&self) -> &Raw<AnySyncTimelineEvent>
Returns a reference to the (potentially decrypted) Matrix event inside
this TimelineEvent
.
pub fn event_id(&self) -> Option<OwnedEventId>
pub fn event_id(&self) -> Option<OwnedEventId>
Get the event id of this TimelineEventKind
if the event has any valid
id.
pub fn encryption_info(&self) -> Option<&EncryptionInfo>
pub fn encryption_info(&self) -> Option<&EncryptionInfo>
If the event was a decrypted event that was successfully decrypted, get
its encryption info. Otherwise, None
.
pub fn into_raw(self) -> Raw<AnySyncTimelineEvent>
pub fn into_raw(self) -> Raw<AnySyncTimelineEvent>
Takes ownership of this TimelineEvent
, returning the (potentially
decrypted) Matrix event within.
Trait Implementations§
§impl Clone for TimelineEventKind
impl Clone for TimelineEventKind
§fn clone(&self) -> TimelineEventKind
fn clone(&self) -> TimelineEventKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for TimelineEventKind
Available on non-tarpaulin_include
only.
impl Debug for TimelineEventKind
tarpaulin_include
only.§impl<'de> Deserialize<'de> for TimelineEventKind
impl<'de> Deserialize<'de> for TimelineEventKind
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimelineEventKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimelineEventKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for TimelineEventKind
impl Serialize for TimelineEventKind
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TimelineEventKind
impl RefUnwindSafe for TimelineEventKind
impl Send for TimelineEventKind
impl Sync for TimelineEventKind
impl Unpin for TimelineEventKind
impl UnwindSafe for TimelineEventKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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