pub trait EventContent: Sized + Serialize {
type EventType;
// Required method
fn event_type(&self) -> Self::EventType;
}
Available on crate feature
events
only.Expand description
The base trait that all event content types implement.
Use macros::EventContent
to derive this traits. It is not meant to be implemented manually.
Required Associated Types§
Required Methods§
Sourcefn event_type(&self) -> Self::EventType
fn event_type(&self) -> Self::EventType
Get the event’s type, like m.room.message
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.