Enum ruma_events::MessageLikeEvent
source · pub enum MessageLikeEvent<C: MessageLikeEventContent + RedactContent>where
C::Redacted: RedactedMessageLikeEventContent,{
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§
source§impl<C> MessageLikeEvent<C>
impl<C> MessageLikeEvent<C>
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§
source§impl<C: Clone + MessageLikeEventContent + RedactContent> Clone for MessageLikeEvent<C>
impl<C: Clone + MessageLikeEventContent + RedactContent> Clone for MessageLikeEvent<C>
source§fn clone(&self) -> MessageLikeEvent<C>
fn clone(&self) -> MessageLikeEvent<C>
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 moresource§impl<C: Debug + MessageLikeEventContent + RedactContent> Debug for MessageLikeEvent<C>
impl<C: Debug + MessageLikeEventContent + RedactContent> Debug for MessageLikeEvent<C>
source§impl<'de, C> Deserialize<'de> for MessageLikeEvent<C>
impl<'de, C> Deserialize<'de> for MessageLikeEvent<C>
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<MessageLikeEvent<BeaconEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<BeaconEventContent>> for AnyMessageLikeEvent
source§fn from(c: BeaconEvent) -> Self
fn from(c: BeaconEvent) -> Self
Converts to this type from the input type.
source§impl<C> From<MessageLikeEvent<C>> for SyncMessageLikeEvent<C>
impl<C> From<MessageLikeEvent<C>> for SyncMessageLikeEvent<C>
source§fn from(full: MessageLikeEvent<C>) -> Self
fn from(full: MessageLikeEvent<C>) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallAnswerEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallAnswerEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallAnswerEvent) -> Self
fn from(c: CallAnswerEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallCandidatesEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallCandidatesEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallCandidatesEvent) -> Self
fn from(c: CallCandidatesEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallHangupEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallHangupEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallHangupEvent) -> Self
fn from(c: CallHangupEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallInviteEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallInviteEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallInviteEvent) -> Self
fn from(c: CallInviteEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallNegotiateEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallNegotiateEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallNegotiateEvent) -> Self
fn from(c: CallNegotiateEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallNotifyEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallNotifyEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallNotifyEvent) -> Self
fn from(c: CallNotifyEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallRejectEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallRejectEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallRejectEvent) -> Self
fn from(c: CallRejectEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallSdpStreamMetadataChangedEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallSdpStreamMetadataChangedEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallSdpStreamMetadataChangedEvent) -> Self
fn from(c: CallSdpStreamMetadataChangedEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<CallSelectAnswerEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<CallSelectAnswerEventContent>> for AnyMessageLikeEvent
source§fn from(c: CallSelectAnswerEvent) -> Self
fn from(c: CallSelectAnswerEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<KeyVerificationAcceptEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationAcceptEventContent>> for AnyMessageLikeEvent
source§fn from(c: KeyVerificationAcceptEvent) -> Self
fn from(c: KeyVerificationAcceptEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<KeyVerificationCancelEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationCancelEventContent>> for AnyMessageLikeEvent
source§fn from(c: KeyVerificationCancelEvent) -> Self
fn from(c: KeyVerificationCancelEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<KeyVerificationDoneEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationDoneEventContent>> for AnyMessageLikeEvent
source§fn from(c: KeyVerificationDoneEvent) -> Self
fn from(c: KeyVerificationDoneEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<KeyVerificationKeyEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationKeyEventContent>> for AnyMessageLikeEvent
source§fn from(c: KeyVerificationKeyEvent) -> Self
fn from(c: KeyVerificationKeyEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<KeyVerificationMacEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationMacEventContent>> for AnyMessageLikeEvent
source§fn from(c: KeyVerificationMacEvent) -> Self
fn from(c: KeyVerificationMacEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<KeyVerificationReadyEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationReadyEventContent>> for AnyMessageLikeEvent
source§fn from(c: KeyVerificationReadyEvent) -> Self
fn from(c: KeyVerificationReadyEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<KeyVerificationStartEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<KeyVerificationStartEventContent>> for AnyMessageLikeEvent
source§fn from(c: KeyVerificationStartEvent) -> Self
fn from(c: KeyVerificationStartEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<LocationEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<LocationEventContent>> for AnyMessageLikeEvent
source§fn from(c: LocationEvent) -> Self
fn from(c: LocationEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<MessageEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<MessageEventContent>> for AnyMessageLikeEvent
source§fn from(c: MessageEvent) -> Self
fn from(c: MessageEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<PollEndEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<PollEndEventContent>> for AnyMessageLikeEvent
source§fn from(c: PollEndEvent) -> Self
fn from(c: PollEndEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<PollResponseEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<PollResponseEventContent>> for AnyMessageLikeEvent
source§fn from(c: PollResponseEvent) -> Self
fn from(c: PollResponseEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<PollStartEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<PollStartEventContent>> for AnyMessageLikeEvent
source§fn from(c: PollStartEvent) -> Self
fn from(c: PollStartEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<ReactionEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<ReactionEventContent>> for AnyMessageLikeEvent
source§fn from(c: ReactionEvent) -> Self
fn from(c: ReactionEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<RoomEncryptedEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<RoomEncryptedEventContent>> for AnyMessageLikeEvent
source§fn from(c: RoomEncryptedEvent) -> Self
fn from(c: RoomEncryptedEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<RoomMessageEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<RoomMessageEventContent>> for AnyMessageLikeEvent
source§fn from(c: RoomMessageEvent) -> Self
fn from(c: RoomMessageEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<StickerEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<StickerEventContent>> for AnyMessageLikeEvent
source§fn from(c: StickerEvent) -> Self
fn from(c: StickerEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<UnstablePollEndEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<UnstablePollEndEventContent>> for AnyMessageLikeEvent
source§fn from(c: UnstablePollEndEvent) -> Self
fn from(c: UnstablePollEndEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<UnstablePollResponseEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<UnstablePollResponseEventContent>> for AnyMessageLikeEvent
source§fn from(c: UnstablePollResponseEvent) -> Self
fn from(c: UnstablePollResponseEvent) -> Self
Converts to this type from the input type.
source§impl From<MessageLikeEvent<UnstablePollStartEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<UnstablePollStartEventContent>> for AnyMessageLikeEvent
source§fn from(c: UnstablePollStartEvent) -> Self
fn from(c: UnstablePollStartEvent) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<C> Freeze for MessageLikeEvent<C>
impl<C> RefUnwindSafe for MessageLikeEvent<C>
impl<C> Send for MessageLikeEvent<C>
impl<C> Sync for MessageLikeEvent<C>
impl<C> Unpin for MessageLikeEvent<C>
impl<C> UnwindSafe for MessageLikeEvent<C>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)