Skip to main content

Module event

Module event 

Source
Expand description

Event access, conversion, filtering, and state-key utilities.

The module defines the common event trait and adapters for client and federation representations. It also exposes helpers for inspecting event data.

Re-exports§

pub use self::state_key::StateKey;
pub use self::state_key::TypeStateKey;

Modules§

content 🔒
filter 🔒
format 🔒
id 🔒
redact 🔒
relation 🔒
state_key
State-event key types and ordering helpers.
type_ext 🔒
unsigned 🔒

Structs§

Owned
Owns an event for conversion into a Ruma event envelope.
Ref
Borrows an event for conversion into a Ruma event envelope.

Traits§

Event
Abstraction of a PDU so users can have their own PDU types.
Matches
Tests values against a Matrix filter.
RelationTypeEqual
Compares an event’s relation type with a requested relation type.
TypeExt
Convenience trait for adding event type plus state key to state maps.

Functions§

gen_event_id
Generates a correct eventId for the PDU. For v1/v2 incoming PDU’s the value’s event_id is passed through. For all outgoing PDU’s and for v3+ incoming PDU’s it is generated.
gen_event_id_canonical_json
Generates a correct eventId for the incoming pdu.
trim_event_fields
Restrict a serialized event to the requested event_fields per MSC3980, returning it unchanged when no filter is set so the common sync pays nothing.