Skip to main content

EventType

Trait EventType 

Source
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§

Source

const EVENT_TYPE: &'static str

The event type of the event content.

Provided Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl<T: EventType> EventType for Raw<T>

Source§

const EVENT_TYPE: &'static str = T::EVENT_TYPE

Implementors§

Source§

impl EventType for DummyEventContent

Source§

const EVENT_TYPE: &'static str = "m.dummy"

Source§

impl EventType for ForwardedRoomKeyContent

Source§

const EVENT_TYPE: &'static str = "m.forwarded_room_key"

Source§

impl EventType for RoomEncryptedEventContent

Source§

const EVENT_TYPE: &'static str = "m.room.encrypted"

Source§

impl EventType for RoomKeyBundleContent

Source§

const EVENT_TYPE: &'static str = "m.room_key_bundle"

Source§

impl EventType for RoomKeyContent

Source§

const EVENT_TYPE: &'static str = "m.room_key"

Source§

impl EventType for RoomKeyRequestContent

Source§

const EVENT_TYPE: &'static str = "m.room_key_request"

Source§

impl EventType for RoomKeyWithheldContent

Source§

const EVENT_TYPE: &'static str = "m.room_key.withheld"

Source§

impl EventType for SecretPushContent

Available on crate feature experimental-push-secrets only.
Source§

const EVENT_TYPE: &'static str = "io.element.msc4385.secret.push"

Source§

impl EventType for SecretSendContent

Source§

const EVENT_TYPE: &'static str = "m.secret.send"

Source§

impl EventType for ToDeviceEncryptedEventContent

Source§

const EVENT_TYPE: &'static str = "m.room.encrypted"