Trait ruma_events::EventContent [−][src]
pub trait EventContent: Sized + Serialize { fn event_type(&self) -> &str; fn from_parts(event_type: &str, content: &RawJsonValue) -> Result<Self>; }
Expand description
The base trait that all event content types implement.
Implementing this trait allows content types to be serialized as well as deserialized.
Required methods
fn event_type(&self) -> &str
fn event_type(&self) -> &str
A matrix event identifier, like m.room.message
.
fn from_parts(event_type: &str, content: &RawJsonValue) -> Result<Self>
fn from_parts(event_type: &str, content: &RawJsonValue) -> Result<Self>
Constructs the given event content.
Implementors
impl EventContent for DoneToDeviceEventContent
This is supported on crate feature
unstable-pre-spec
only.impl EventContent for RedactedDoneEventContent
This is supported on crate feature
unstable-pre-spec
only.impl EventContent for ReadyToDeviceEventContent
This is supported on crate feature
unstable-pre-spec
only.impl EventContent for RedactedReadyEventContent
This is supported on crate feature
unstable-pre-spec
only.impl EventContent for ReactionEventContent
This is supported on crate feature
unstable-pre-spec
only.impl EventContent for RedactedReactionEventContent
This is supported on crate feature
unstable-pre-spec
only.impl EventContent for RedactedChildEventContent
This is supported on crate feature
unstable-pre-spec
only.impl EventContent for RedactedParentEventContent
This is supported on crate feature
unstable-pre-spec
only.