pub struct TimelineEvent {
pub kind: TimelineEventKind,
pub thread_summary: ThreadSummaryStatus,
pub bundled_latest_thread_event: Option<Box<TimelineEvent>>,
/* private fields */
}
Expand description
Represents a Matrix room event that has been returned from /sync
,
after initial processing.
Previously, this differed from TimelineEvent
by wrapping an
[AnySyncTimelineEvent
] instead of an [AnyTimelineEvent
], 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.
thread_summary: ThreadSummaryStatus
If the event is part of a thread, a thread summary.
bundled_latest_thread_event: Option<Box<TimelineEvent>>
The bundled latest thread event, if it was provided in the unsigned relations of this event.
Not serialized.
Implementations§
Source§impl TimelineEvent
impl TimelineEvent
Sourcepub fn from_plaintext(event: Raw<AnySyncTimelineEvent>) -> Self
pub fn from_plaintext(event: Raw<AnySyncTimelineEvent>) -> 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 from_decrypted(
decrypted: DecryptedRoomEvent,
push_actions: Option<Vec<Action>>,
) -> Self
pub fn from_decrypted( decrypted: DecryptedRoomEvent, push_actions: Option<Vec<Action>>, ) -> Self
Create a new TimelineEvent
from a decrypted event.
Sourcepub fn from_utd(
event: Raw<AnySyncTimelineEvent>,
utd_info: UnableToDecryptInfo,
) -> Self
pub fn from_utd( event: Raw<AnySyncTimelineEvent>, utd_info: UnableToDecryptInfo, ) -> Self
Create a new TimelineEvent
to represent the given decryption
failure.
Sourcepub fn push_actions(&self) -> Option<&[Action]>
pub fn push_actions(&self) -> Option<&[Action]>
Read the current push actions.
Returns None
if they were never computed, or if they could not be
computed.
Sourcepub fn set_push_actions(&mut self, push_actions: Vec<Action>)
pub fn set_push_actions(&mut self, push_actions: Vec<Action>)
Set the push actions for this event.
Sourcepub fn event_id(&self) -> Option<OwnedEventId>
pub fn event_id(&self) -> Option<OwnedEventId>
Get the event id of this TimelineEvent
if the event has any valid
id.
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 replace_raw(&mut self, replacement: Raw<AnyTimelineEvent>)
pub fn replace_raw(&mut self, replacement: Raw<AnyTimelineEvent>)
Replace the raw event included in this item by another one.
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 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 moreSource§impl Debug for TimelineEvent
impl Debug for TimelineEvent
Source§impl<'de> Deserialize<'de> for TimelineEvent
impl<'de> Deserialize<'de> for TimelineEvent
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>,
Custom deserializer for TimelineEvent
, to support older formats.
Ideally we might use an untagged enum and then convert from that; however, that doesn’t work due to a serde bug.
Instead, we first deserialize into an unstructured JSON map, and then inspect the json to figure out which format we have.
Source§impl IndexableItem for TimelineEvent
impl IndexableItem for TimelineEvent
Source§impl Serialize for TimelineEvent
impl Serialize for TimelineEvent
impl Send for TimelineEvent
impl Sync for TimelineEvent
Auto Trait Implementations§
impl Freeze for TimelineEvent
impl RefUnwindSafe for TimelineEvent
impl Unpin for TimelineEvent
impl UnwindSafe for TimelineEvent
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
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<>