pub type InitialRoomAvatarEvent = InitialStateEvent<RoomAvatarEventContent>;
events
only.Expand description
An m.room.avatar
event for creating a room.
Aliased Type§
struct InitialRoomAvatarEvent {
pub content: RoomAvatarEventContent,
pub state_key: EmptyStateKey,
}
Fields§
§content: RoomAvatarEventContent
Data specific to the event type.
state_key: EmptyStateKey
A unique key which defines the overwriting semantics for this piece of room state.
This is often an empty string, but some events send a UserId
to show which user the event
affects.
Defaults to the empty string.
Implementations
Source§impl<C> InitialStateEvent<C>where
C: StaticStateEventContent,
impl<C> InitialStateEvent<C>where
C: StaticStateEventContent,
Sourcepub fn new(content: C) -> InitialStateEvent<C>where
C: StaticStateEventContent<StateKey = EmptyStateKey>,
Available on crate feature unstable-msc3489
only.
pub fn new(content: C) -> InitialStateEvent<C>where
C: StaticStateEventContent<StateKey = EmptyStateKey>,
unstable-msc3489
only.Create a new InitialStateEvent
for an event type with an empty state key.
For cases where the state key is not empty, use a struct literal to create the event.
Sourcepub fn to_raw(&self) -> Raw<InitialStateEvent<C>>
Available on crate feature unstable-msc3489
only.
pub fn to_raw(&self) -> Raw<InitialStateEvent<C>>
unstable-msc3489
only.Shorthand for Raw::new(self).unwrap()
.
Since none of the content types in Ruma ever return an error in serialization, this will
never panic with C
being a type from Ruma. However, if you use a custom content type
with a Serialize
implementation that can error (for example because it contains an
enum
with one or more variants that use the #[serde(skip)]
attribute), this method
can panic.
Sourcepub fn to_raw_any(&self) -> Raw<AnyInitialStateEvent>
Available on crate feature unstable-msc3489
only.
pub fn to_raw_any(&self) -> Raw<AnyInitialStateEvent>
unstable-msc3489
only.Shorthand for self.to_raw().cast::<AnyInitialStateEvent>()
.
Since none of the content types in Ruma ever return an error in serialization, this will
never panic with C
being a type from Ruma. However, if you use a custom content type
with a Serialize
implementation that can error (for example because it contains an
enum
with one or more variants that use the #[serde(skip)]
attribute), this method
can panic.
Trait Implementations
Source§impl<C> Clone for InitialStateEvent<C>
impl<C> Clone for InitialStateEvent<C>
Source§fn clone(&self) -> InitialStateEvent<C>
fn clone(&self) -> InitialStateEvent<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more