ruma_events::call::member

Type Alias InitialCallMemberEvent

Source
pub type InitialCallMemberEvent = InitialStateEvent<CallMemberEventContent>;
Expand description

An org.matrix.msc3401.call.member event for creating a room.

Aliased Type§

struct InitialCallMemberEvent {
    pub content: CallMemberEventContent,
    pub state_key: CallMemberStateKey,
}

Fields§

§content: CallMemberEventContent

Data specific to the event type.

§state_key: CallMemberStateKey

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: StaticStateEventContent> InitialStateEvent<C>

Source

pub fn new(content: C) -> Self

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.

Source

pub fn to_raw(&self) -> Raw<Self>

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.

Source

pub fn to_raw_any(&self) -> Raw<AnyInitialStateEvent>

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 + StaticStateEventContent> Clone for InitialStateEvent<C>
where C::StateKey: Clone,

Source§

fn clone(&self) -> InitialStateEvent<C>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: Debug + StaticStateEventContent> Debug for InitialStateEvent<C>
where C::StateKey: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C> Default for InitialStateEvent<C>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, C> Deserialize<'de> for InitialStateEvent<C>

Source§

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<C: StaticStateEventContent> Serialize for InitialStateEvent<C>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more