pub struct Event<C>{
pub sender: OwnedUserId,
pub event_id: OwnedEventId,
pub content: C,
pub origin_server_ts: MilliSecondsSinceUnixEpoch,
pub unsigned: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Generic room event with a known type and content.
Fields§
§sender: OwnedUserId
Contains the fully-qualified ID of the user who sent this event.
event_id: OwnedEventId
The globally unique identifier for this event.
content: C
The body of this event, as created by the client which sent it.
origin_server_ts: MilliSecondsSinceUnixEpoch
Timestamp (in milliseconds since the unix epoch) on originating homeserver when this event was sent.
unsigned: BTreeMap<String, Value>
Contains optional extra information about the event.
Implementations§
source§impl Event<RoomEncryptedEventContent>
impl Event<RoomEncryptedEventContent>
sourcepub fn room_key_info(&self, room_id: &RoomId) -> Option<SupportedKeyInfo>
pub fn room_key_info(&self, room_id: &RoomId) -> Option<SupportedKeyInfo>
Get the unique info about the room key that was used to encrypt this event.
Returns None
if we do not understand the algorithm that was used to
encrypt the event.
Trait Implementations§
source§impl<'de, C> Deserialize<'de> for Event<C>
impl<'de, C> Deserialize<'de> for Event<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
Auto Trait Implementations§
impl<C> Freeze for Event<C>where
C: Freeze,
impl<C> RefUnwindSafe for Event<C>where
C: RefUnwindSafe,
impl<C> Send for Event<C>where
C: Send,
impl<C> Sync for Event<C>where
C: Sync,
impl<C> Unpin for Event<C>where
C: Unpin,
impl<C> UnwindSafe for Event<C>where
C: UnwindSafe,
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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