pub struct TimelineEvent {
pub kind: TimelineEventKind,
pub push_actions: Option<Vec<Action>>,
}
Expand description
Represents a matrix room event that has been returned from a Matrix
client-server API endpoint such as /messages
, after initial processing.
The “initial processing” includes an attempt to decrypt encrypted events, so
the main thing this adds over AnyTimelineEvent
is information on
encryption.
Previously, this differed from SyncTimelineEvent
by wrapping an
AnyTimelineEvent
instead of an AnySyncTimelineEvent
, but nowadays
they are essentially identical, and one of them should probably be removed.
Fields§
§kind: TimelineEventKind
The event itself, together with any information on decryption.
push_actions: Option<Vec<Action>>
The push actions associated with this event, if we had sufficient context to compute them.
Implementations§
Source§impl TimelineEvent
impl TimelineEvent
Sourcepub fn new(event: Raw<AnyTimelineEvent>) -> Self
pub fn new(event: Raw<AnyTimelineEvent>) -> Self
Create a new TimelineEvent
from the given raw event.
This is a convenience constructor for a plaintext event when you don’t
need to set push_action
, for example inside a test.
Sourcepub fn new_utd_event(
event: Raw<AnySyncTimelineEvent>,
utd_info: UnableToDecryptInfo,
) -> Self
pub fn new_utd_event( event: Raw<AnySyncTimelineEvent>, utd_info: UnableToDecryptInfo, ) -> Self
Create a new TimelineEvent
to represent the given decryption failure.
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 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
.
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.
Trait Implementations§
Source§impl Clone for TimelineEvent
impl Clone for TimelineEvent
Source§fn clone(&self) -> TimelineEvent
fn clone(&self) -> TimelineEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more