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<AudioEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<AudioEventContent>> for AnyMessageLikeEvent
Source§fn from(c: AudioEvent) -> Self
fn from(c: AudioEvent) -> Self
Converts to this type from the input type.
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<EmoteEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<EmoteEventContent>> for AnyMessageLikeEvent
Source§fn from(c: EmoteEvent) -> Self
fn from(c: EmoteEvent) -> Self
Converts to this type from the input type.
Source§impl From<MessageLikeEvent<EncryptedEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<EncryptedEventContent>> for AnyMessageLikeEvent
Source§fn from(c: EncryptedEvent) -> Self
fn from(c: EncryptedEvent) -> Self
Converts to this type from the input type.
Source§impl From<MessageLikeEvent<ImageEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<ImageEventContent>> for AnyMessageLikeEvent
Source§fn from(c: ImageEvent) -> Self
fn from(c: ImageEvent) -> 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.
Source§impl From<MessageLikeEvent<VideoEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<VideoEventContent>> for AnyMessageLikeEvent
Source§fn from(c: VideoEvent) -> Self
fn from(c: VideoEvent) -> Self
Converts to this type from the input type.
Source§impl From<MessageLikeEvent<VoiceEventContent>> for AnyMessageLikeEvent
impl From<MessageLikeEvent<VoiceEventContent>> for AnyMessageLikeEvent
Source§fn from(c: VoiceEvent) -> Self
fn from(c: VoiceEvent) -> 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