pub enum TimelineItemContent {
Message(Message),
RedactedMessage,
Sticker(Sticker),
UnableToDecrypt(EncryptedMessage),
MembershipChange(RoomMembershipChange),
ProfileChange(MemberProfileChange),
OtherState(OtherState),
FailedToParseMessageLike {
event_type: MessageLikeEventType,
error: Arc<Error>,
},
FailedToParseState {
event_type: StateEventType,
state_key: String,
error: Arc<Error>,
},
Poll(PollState),
CallInvite,
CallNotify,
}Expand description
The content of an EventTimelineItem.
Variants§
Message(Message)
An m.room.message event or extensible event, including edits.
RedactedMessage
A redacted message.
Sticker(Sticker)
An m.sticker event.
UnableToDecrypt(EncryptedMessage)
An m.room.encrypted event that could not be decrypted.
MembershipChange(RoomMembershipChange)
A room membership change.
ProfileChange(MemberProfileChange)
A room member profile change.
OtherState(OtherState)
Another state event.
FailedToParseMessageLike
A message-like event that failed to deserialize.
FailedToParseState
A state event that failed to deserialize.
Fields
§
event_type: StateEventTypeThe event type.
Poll(PollState)
An m.poll.start event.
CallInvite
An m.call.invite event
CallNotify
An m.call.notify event
Implementations§
Source§impl TimelineItemContent
impl TimelineItemContent
Sourcepub fn as_message(&self) -> Option<&Message>
pub fn as_message(&self) -> Option<&Message>
Sourcepub fn as_unable_to_decrypt(&self) -> Option<&EncryptedMessage>
pub fn as_unable_to_decrypt(&self) -> Option<&EncryptedMessage>
If self is of the UnableToDecrypt variant,
return the inner EncryptedMessage.
Sourcepub fn is_unable_to_decrypt(&self) -> bool
pub fn is_unable_to_decrypt(&self) -> bool
Check whether this item’s content is a
UnableToDecrypt.
Sourcepub fn reactions(&self) -> ReactionsByKeyBySender
pub fn reactions(&self) -> ReactionsByKeyBySender
Return the reactions, grouped by key and then by sender, for a given content.
Some content kinds can’t hold reactions; for these, this function will
return None.
pub fn with_reactions(&self, reactions: ReactionsByKeyBySender) -> Self
Trait Implementations§
Source§impl Clone for TimelineItemContent
impl Clone for TimelineItemContent
Source§fn clone(&self) -> TimelineItemContent
fn clone(&self) -> TimelineItemContent
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TimelineItemContent
impl !RefUnwindSafe for TimelineItemContent
impl Send for TimelineItemContent
impl Sync for TimelineItemContent
impl Unpin for TimelineItemContent
impl !UnwindSafe for TimelineItemContent
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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