Enum ruma_common::events::MessageLikeEvent
source · [−]pub enum MessageLikeEvent<C: MessageLikeEventContent + RedactContent> where
C::Redacted: MessageLikeEventContent + RedactedEventContent, {
Original(OriginalMessageLikeEvent<C>),
Redacted(RedactedMessageLikeEvent<C::Redacted>),
}
Expand description
A possibly-redacted message-like event.
MessageLikeEvent
implements the comparison traits using only the event_id
field, a sorted
list would be sorted lexicographically based on the event’s EventId
.
Variants
Original(OriginalMessageLikeEvent<C>)
Original, unredacted form of the event.
Redacted(RedactedMessageLikeEvent<C::Redacted>)
Redacted form of the event with minimal fields.
Implementations
sourceimpl<C> MessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
impl<C> MessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
sourcepub fn event_type(&self) -> MessageLikeEventType
pub fn event_type(&self) -> MessageLikeEventType
Returns the type
of this event.
sourcepub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
pub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
Returns this event’s origin_server_ts
field.
sourcepub fn as_original(&self) -> Option<&OriginalMessageLikeEvent<C>>
pub fn as_original(&self) -> Option<&OriginalMessageLikeEvent<C>>
Get the inner OriginalMessageLikeEvent
if this is an unredacted event.
Trait Implementations
sourceimpl<C: Clone + MessageLikeEventContent + RedactContent> Clone for MessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C::Redacted: Clone,
impl<C: Clone + MessageLikeEventContent + RedactContent> Clone for MessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C::Redacted: Clone,
sourcefn clone(&self) -> MessageLikeEvent<C>
fn clone(&self) -> MessageLikeEvent<C>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<C: Debug + MessageLikeEventContent + RedactContent> Debug for MessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C::Redacted: Debug,
impl<C: Debug + MessageLikeEventContent + RedactContent> Debug for MessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C::Redacted: Debug,
sourceimpl<'de, C> Deserialize<'de> for MessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
impl<'de, C> Deserialize<'de> for MessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<C> From<MessageLikeEvent<C>> for SyncMessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
impl<C> From<MessageLikeEvent<C>> for SyncMessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
sourcefn from(full: MessageLikeEvent<C>) -> Self
fn from(full: MessageLikeEvent<C>) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<CallAnswerEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallAnswerEventContent>> for AnyMessageLikeEvent
sourcefn from(c: CallAnswerEvent) -> Self
fn from(c: CallAnswerEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<CallCandidatesEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallCandidatesEventContent>> for AnyMessageLikeEvent
sourcefn from(c: CallCandidatesEvent) -> Self
fn from(c: CallCandidatesEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<CallHangupEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallHangupEventContent>> for AnyMessageLikeEvent
sourcefn from(c: CallHangupEvent) -> Self
fn from(c: CallHangupEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<CallInviteEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallInviteEventContent>> for AnyMessageLikeEvent
sourcefn from(c: CallInviteEvent) -> Self
fn from(c: CallInviteEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<KeyVerificationAcceptEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationAcceptEventContent>> for AnyMessageLikeEvent
sourcefn from(c: KeyVerificationAcceptEvent) -> Self
fn from(c: KeyVerificationAcceptEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<KeyVerificationCancelEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationCancelEventContent>> for AnyMessageLikeEvent
sourcefn from(c: KeyVerificationCancelEvent) -> Self
fn from(c: KeyVerificationCancelEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<KeyVerificationDoneEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationDoneEventContent>> for AnyMessageLikeEvent
sourcefn from(c: KeyVerificationDoneEvent) -> Self
fn from(c: KeyVerificationDoneEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<KeyVerificationKeyEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationKeyEventContent>> for AnyMessageLikeEvent
sourcefn from(c: KeyVerificationKeyEvent) -> Self
fn from(c: KeyVerificationKeyEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<KeyVerificationMacEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationMacEventContent>> for AnyMessageLikeEvent
sourcefn from(c: KeyVerificationMacEvent) -> Self
fn from(c: KeyVerificationMacEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<KeyVerificationReadyEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationReadyEventContent>> for AnyMessageLikeEvent
sourcefn from(c: KeyVerificationReadyEvent) -> Self
fn from(c: KeyVerificationReadyEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<KeyVerificationStartEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationStartEventContent>> for AnyMessageLikeEvent
sourcefn from(c: KeyVerificationStartEvent) -> Self
fn from(c: KeyVerificationStartEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<ReactionEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<ReactionEventContent>> for AnyMessageLikeEvent
sourcefn from(c: ReactionEvent) -> Self
fn from(c: ReactionEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<RoomEncryptedEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<RoomEncryptedEventContent>> for AnyMessageLikeEvent
sourcefn from(c: RoomEncryptedEvent) -> Self
fn from(c: RoomEncryptedEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<RoomMessageEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<RoomMessageEventContent>> for AnyMessageLikeEvent
sourcefn from(c: RoomMessageEvent) -> Self
fn from(c: RoomMessageEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<RoomMessageFeedbackEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<RoomMessageFeedbackEventContent>> for AnyMessageLikeEvent
sourcefn from(c: RoomMessageFeedbackEvent) -> Self
fn from(c: RoomMessageFeedbackEvent) -> Self
Converts to this type from the input type.
sourceimpl From<MessageLikeEvent<StickerEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<StickerEventContent>> for AnyMessageLikeEvent
sourcefn from(c: StickerEvent) -> Self
fn from(c: StickerEvent) -> Self
Converts to this type from the input type.
sourceimpl<C> Redact for MessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
impl<C> Redact for MessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
type Redacted = MessageLikeEvent<C>
type Redacted = MessageLikeEvent<C>
The redacted form of the event.
sourcefn redact(
self,
redaction: SyncRoomRedactionEvent,
version: &RoomVersionId
) -> Self
fn redact(
self,
redaction: SyncRoomRedactionEvent,
version: &RoomVersionId
) -> Self
Transforms self
into a redacted form (removing most fields) according to the spec. Read more
sourceimpl<C: MessageLikeEventContent + RedactContent> Serialize for MessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C: Serialize,
impl<C: MessageLikeEventContent + RedactContent> Serialize for MessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C: Serialize,
Auto Trait Implementations
impl<C> RefUnwindSafe for MessageLikeEvent<C> where
C: RefUnwindSafe,
<C as RedactContent>::Redacted: RefUnwindSafe,
impl<C> Send for MessageLikeEvent<C> where
C: Send,
<C as RedactContent>::Redacted: Send,
impl<C> Sync for MessageLikeEvent<C> where
C: Sync,
<C as RedactContent>::Redacted: Sync,
impl<C> Unpin for MessageLikeEvent<C> where
C: Unpin,
<C as RedactContent>::Redacted: Unpin,
impl<C> UnwindSafe for MessageLikeEvent<C> where
C: UnwindSafe,
<C as RedactContent>::Redacted: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more