pub trait EventType {
const EVENT_TYPE: &'static str;
// Provided method
fn event_type(&self) -> &str { ... }
}Expand description
A trait for event contents to define their event type.
Required Associated Constants§
Sourceconst EVENT_TYPE: &'static str
const EVENT_TYPE: &'static str
The event type of the event content.
Provided Methods§
Sourcefn event_type(&self) -> &str
fn event_type(&self) -> &str
Get the event type of the event content.
Note: This usually doesn’t need to be implemented. The default
implementation will take the event type from the
EventType::EVENT_TYPE constant.
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.
Implementations on Foreign Types§
Implementors§
Source§impl EventType for ForwardedRoomKeyContent
impl EventType for ForwardedRoomKeyContent
const EVENT_TYPE: &'static str = "m.forwarded_room_key"
Source§impl EventType for ToDeviceEncryptedEventContent
impl EventType for ToDeviceEncryptedEventContent
const EVENT_TYPE: &'static str = "m.room.encrypted"
Source§impl EventType for RoomKeyContent
impl EventType for RoomKeyContent
const EVENT_TYPE: &'static str = "m.room_key"
Source§impl EventType for RoomKeyWithheldContent
impl EventType for RoomKeyWithheldContent
const EVENT_TYPE: &'static str = "m.room_key.withheld"
Source§impl EventType for DummyEventContent
impl EventType for DummyEventContent
const EVENT_TYPE: &'static str = "m.dummy"
Source§impl EventType for RoomEncryptedEventContent
impl EventType for RoomEncryptedEventContent
const EVENT_TYPE: &'static str = "m.room.encrypted"
Source§impl EventType for RoomKeyBundleContent
impl EventType for RoomKeyBundleContent
const EVENT_TYPE: &'static str = "m.room_key_bundle"
Source§impl EventType for RoomKeyRequestContent
impl EventType for RoomKeyRequestContent
const EVENT_TYPE: &'static str = "m.room_key_request"
Source§impl EventType for SecretPushContent
Available on crate feature experimental-push-secrets only.
impl EventType for SecretPushContent
Available on crate feature
experimental-push-secrets only.