Enum ruma_common::events::SyncMessageLikeEvent
source · [−]pub enum SyncMessageLikeEvent<C: MessageLikeEventContent + RedactContent> where
C::Redacted: MessageLikeEventContent + RedactedEventContent, {
Original(OriginalSyncMessageLikeEvent<C>),
Redacted(RedactedSyncMessageLikeEvent<C::Redacted>),
}
Expand description
A possibly-redacted message-like event without a room_id
.
SyncMessageLikeEvent
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(OriginalSyncMessageLikeEvent<C>)
Original, unredacted form of the event.
Redacted(RedactedSyncMessageLikeEvent<C::Redacted>)
Redacted form of the event with minimal fields.
Implementations
sourceimpl<C> SyncMessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
impl<C> SyncMessageLikeEvent<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<&OriginalSyncMessageLikeEvent<C>>
pub fn as_original(&self) -> Option<&OriginalSyncMessageLikeEvent<C>>
Get the inner OriginalSyncMessageLikeEvent
if this is an unredacted event.
sourcepub fn into_full_event(self, room_id: OwnedRoomId) -> MessageLikeEvent<C>
pub fn into_full_event(self, room_id: OwnedRoomId) -> MessageLikeEvent<C>
Convert this sync event into a full event (one with a room_id
field).
Trait Implementations
sourceimpl<C: Clone + MessageLikeEventContent + RedactContent> Clone for SyncMessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C::Redacted: Clone,
impl<C: Clone + MessageLikeEventContent + RedactContent> Clone for SyncMessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C::Redacted: Clone,
sourcefn clone(&self) -> SyncMessageLikeEvent<C>
fn clone(&self) -> SyncMessageLikeEvent<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 SyncMessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C::Redacted: Debug,
impl<C: Debug + MessageLikeEventContent + RedactContent> Debug for SyncMessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C::Redacted: Debug,
sourceimpl<'de, C> Deserialize<'de> for SyncMessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
impl<'de, C> Deserialize<'de> for SyncMessageLikeEvent<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<SyncMessageLikeEvent<CallAnswerEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<CallAnswerEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncCallAnswerEvent) -> Self
fn from(c: SyncCallAnswerEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<CallCandidatesEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<CallCandidatesEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncCallCandidatesEvent) -> Self
fn from(c: SyncCallCandidatesEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<CallHangupEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<CallHangupEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncCallHangupEvent) -> Self
fn from(c: SyncCallHangupEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<CallInviteEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<CallInviteEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncCallInviteEvent) -> Self
fn from(c: SyncCallInviteEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<KeyVerificationAcceptEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<KeyVerificationAcceptEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncKeyVerificationAcceptEvent) -> Self
fn from(c: SyncKeyVerificationAcceptEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<KeyVerificationCancelEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<KeyVerificationCancelEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncKeyVerificationCancelEvent) -> Self
fn from(c: SyncKeyVerificationCancelEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<KeyVerificationDoneEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<KeyVerificationDoneEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncKeyVerificationDoneEvent) -> Self
fn from(c: SyncKeyVerificationDoneEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<KeyVerificationKeyEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<KeyVerificationKeyEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncKeyVerificationKeyEvent) -> Self
fn from(c: SyncKeyVerificationKeyEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<KeyVerificationMacEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<KeyVerificationMacEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncKeyVerificationMacEvent) -> Self
fn from(c: SyncKeyVerificationMacEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<KeyVerificationReadyEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<KeyVerificationReadyEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncKeyVerificationReadyEvent) -> Self
fn from(c: SyncKeyVerificationReadyEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<KeyVerificationStartEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<KeyVerificationStartEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncKeyVerificationStartEvent) -> Self
fn from(c: SyncKeyVerificationStartEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<ReactionEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<ReactionEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncReactionEvent) -> Self
fn from(c: SyncReactionEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<RoomEncryptedEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<RoomEncryptedEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncRoomEncryptedEvent) -> Self
fn from(c: SyncRoomEncryptedEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<RoomMessageEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<RoomMessageEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncRoomMessageEvent) -> Self
fn from(c: SyncRoomMessageEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<RoomMessageFeedbackEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<RoomMessageFeedbackEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncRoomMessageFeedbackEvent) -> Self
fn from(c: SyncRoomMessageFeedbackEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncMessageLikeEvent<StickerEventContent>> for AnySyncMessageLikeEvent
impl From<SyncMessageLikeEvent<StickerEventContent>> for AnySyncMessageLikeEvent
sourcefn from(c: SyncStickerEvent) -> Self
fn from(c: SyncStickerEvent) -> Self
Converts to this type from the input type.
sourceimpl<C> Redact for SyncMessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
impl<C> Redact for SyncMessageLikeEvent<C> where
C: MessageLikeEventContent + RedactContent,
C::Redacted: MessageLikeEventContent + RedactedEventContent,
type Redacted = SyncMessageLikeEvent<C>
type Redacted = SyncMessageLikeEvent<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 SyncMessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C: Serialize,
impl<C: MessageLikeEventContent + RedactContent> Serialize for SyncMessageLikeEvent<C> where
C::Redacted: MessageLikeEventContent + RedactedEventContent,
C: Serialize,
Auto Trait Implementations
impl<C> RefUnwindSafe for SyncMessageLikeEvent<C> where
C: RefUnwindSafe,
<C as RedactContent>::Redacted: RefUnwindSafe,
impl<C> Send for SyncMessageLikeEvent<C> where
C: Send,
<C as RedactContent>::Redacted: Send,
impl<C> Sync for SyncMessageLikeEvent<C> where
C: Sync,
<C as RedactContent>::Redacted: Sync,
impl<C> Unpin for SyncMessageLikeEvent<C> where
C: Unpin,
<C as RedactContent>::Redacted: Unpin,
impl<C> UnwindSafe for SyncMessageLikeEvent<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