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) -> &RawValue;
    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>;
}
Available on crate feature state-res only.
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) -> &RawValue

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 for &T
where T: Event,

§

type Id = <T as Event>::Id

source§

fn event_id(&self) -> &<&T as Event>::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) -> &RawValue

source§

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

source§

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

source§

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

source§

fn redacts(&self) -> Option<&<&T as Event>::Id>

source§

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

§

type Id = <T as Event>::Id

source§

fn event_id(&self) -> &<Arc<T> as Event>::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) -> &RawValue

source§

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

source§

fn prev_events( &self ) -> Box<dyn DoubleEndedIterator<Item = &<Arc<T> as Event>::Id> + '_>

source§

fn auth_events( &self ) -> Box<dyn DoubleEndedIterator<Item = &<Arc<T> as Event>::Id> + '_>

source§

fn redacts(&self) -> Option<&<Arc<T> as Event>::Id>

Implementors§