pub enum TimelineEventKind {
Decrypted(DecryptedRoomEvent),
UnableToDecrypt {
event: Raw<AnySyncTimelineEvent>,
utd_info: UnableToDecryptInfo,
},
PlainText {
event: Raw<AnySyncTimelineEvent>,
},
}Expand description
The event within a TimelineEvent, 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: UnableToDecryptInfoInformation 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§
Source§impl TimelineEventKind
impl TimelineEventKind
Sourcepub fn raw(&self) -> &Raw<AnySyncTimelineEvent>
pub fn raw(&self) -> &Raw<AnySyncTimelineEvent>
Returns a reference to the (potentially decrypted) Matrix event inside
this TimelineEvent.
Sourcepub 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.
Sourcepub fn encryption_info(&self) -> Option<&Arc<EncryptionInfo>>
pub fn encryption_info(&self) -> Option<&Arc<EncryptionInfo>>
If the event was a decrypted event that was successfully decrypted, get
its encryption info. Otherwise, None.
Sourcepub fn unsigned_encryption_map(
&self,
) -> Option<&BTreeMap<UnsignedEventLocation, UnsignedDecryptionResult>>
pub fn unsigned_encryption_map( &self, ) -> Option<&BTreeMap<UnsignedEventLocation, UnsignedDecryptionResult>>
If the event was a decrypted event that was successfully decrypted, get the map of decryption metadata related to the bundled events.
Sourcepub 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.
Sourcepub fn session_id(&self) -> Option<&str>
pub fn session_id(&self) -> Option<&str>
The Megolm session ID that was used to send this event, if it was encrypted.
Sourcepub fn event_type(&self) -> Option<String>
pub fn event_type(&self) -> Option<String>
Get the event type of this event.
Returns None if there isn’t an event type or if the event failed to be
deserialized.
Trait Implementations§
Source§impl Clone for TimelineEventKind
impl Clone for TimelineEventKind
Source§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 moreSource§impl Debug for TimelineEventKind
Available on non-tarpaulin_include only.
impl Debug for TimelineEventKind
tarpaulin_include only.Source§impl<'de> Deserialize<'de> for TimelineEventKind
impl<'de> Deserialize<'de> for TimelineEventKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more