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§
§impl TimelineEvent
impl TimelineEvent
pub fn new(event: Raw<AnyTimelineEvent>) -> TimelineEvent
pub fn new(event: Raw<AnyTimelineEvent>) -> TimelineEvent
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.
pub fn new_utd_event(
event: Raw<AnySyncTimelineEvent>,
utd_info: UnableToDecryptInfo,
) -> TimelineEvent
pub fn new_utd_event( event: Raw<AnySyncTimelineEvent>, utd_info: UnableToDecryptInfo, ) -> TimelineEvent
Create a new TimelineEvent
to represent the given decryption failure.
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 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 TimelineEvent
impl Clone for TimelineEvent
§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§impl Debug for TimelineEvent
impl Debug for TimelineEvent
§impl From<DecryptedRoomEvent> for TimelineEvent
impl From<DecryptedRoomEvent> for TimelineEvent
§fn from(decrypted: DecryptedRoomEvent) -> TimelineEvent
fn from(decrypted: DecryptedRoomEvent) -> TimelineEvent
§impl From<TimelineEvent> for SyncTimelineEvent
impl From<TimelineEvent> for SyncTimelineEvent
§fn from(o: TimelineEvent) -> SyncTimelineEvent
fn from(o: TimelineEvent) -> SyncTimelineEvent
Auto Trait Implementations§
impl Freeze for TimelineEvent
impl RefUnwindSafe for TimelineEvent
impl Send for TimelineEvent
impl Sync 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,
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