Trait ruma_state_res::Event

source ·
pub trait Event {
    type Id: Clone + Debug + Display + Eq + Ord + Hash + Borrow<EventId>;

    // Required methods
    fn event_id(&self) -> &Self::Id;
    fn room_id(&self) -> &RoomId;
    fn sender(&self) -> &UserId;
    fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch;
    fn event_type(&self) -> &TimelineEventType;
    fn content(&self) -> &RawJsonValue;
    fn state_key(&self) -> Option<&str>;
    fn prev_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>;
    fn auth_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>;
    fn redacts(&self) -> Option<&Self::Id>;
}
Expand description

Abstraction of a PDU so users can have their own PDU types.

Required Associated Types§

Required Methods§

source

fn event_id(&self) -> &Self::Id

The EventId of this event.

source

fn room_id(&self) -> &RoomId

The RoomId of this event.

source

fn sender(&self) -> &UserId

The UserId of this event.

source

fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch

The time of creation on the originating server.

source

fn event_type(&self) -> &TimelineEventType

The event type.

source

fn content(&self) -> &RawJsonValue

The event’s content.

source

fn state_key(&self) -> Option<&str>

The state key for this event.

source

fn prev_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>

The events before this event.

source

fn auth_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>

All the authenticating events for this event.

source

fn redacts(&self) -> Option<&Self::Id>

If this event is a redaction event this is the event it redacts.

Implementations on Foreign Types§

source§

impl<T: Event> Event for &T

source§

type Id = <T as Event>::Id

source§

fn event_id(&self) -> &Self::Id

source§

fn room_id(&self) -> &RoomId

source§

fn sender(&self) -> &UserId

source§

fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch

source§

fn event_type(&self) -> &TimelineEventType

source§

fn content(&self) -> &RawJsonValue

source§

fn state_key(&self) -> Option<&str>

source§

fn prev_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>

source§

fn auth_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>

source§

fn redacts(&self) -> Option<&Self::Id>

source§

impl<T: Event> Event for Arc<T>

source§

type Id = <T as Event>::Id

source§

fn event_id(&self) -> &Self::Id

source§

fn room_id(&self) -> &RoomId

source§

fn sender(&self) -> &UserId

source§

fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch

source§

fn event_type(&self) -> &TimelineEventType

source§

fn content(&self) -> &RawJsonValue

source§

fn state_key(&self) -> Option<&str>

source§

fn prev_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>

source§

fn auth_events(&self) -> Box<dyn DoubleEndedIterator<Item = &Self::Id> + '_>

source§

fn redacts(&self) -> Option<&Self::Id>

Implementors§