Skip to main content

Module pdu

Module pdu 

Source

Re-exportsยง

pub use self::Count as PduCount;
pub use self::Id as PduId;
pub use self::Pdu as PduEvent;
pub use self::RawId as RawPduId;

Modulesยง

builder ๐Ÿ”’
count ๐Ÿ”’
format ๐Ÿ”’
hashes ๐Ÿ”’
id ๐Ÿ”’
raw_id ๐Ÿ”’
unsigned ๐Ÿ”’

Structsยง

Builder
Build the start of a PDU in order to add it to the Database.
EventHash
Content hashes of a PDU.
Id
Pdu
Persistent Data Unit (Event)
PduBuilder
Build the start of a PDU in order to add it to the Database.

Enumsยง

Count
RawId

Constantsยง

MAX_AUTH_EVENTS
The [maximum length allowed] for the auth_events array of a PDU. [maximum length allowed]: https://spec.matrix.org/latest/rooms/v1/#event-format
MAX_PDU_BYTES
The [maximum size allowed] for a PDU. [maximum size allowed]: https://spec.matrix.org/latest/client-server-api/#size-limits
MAX_PREV_EVENTS
The [maximum length allowed] for the prev_events array of a PDU. [maximum length allowed]: https://spec.matrix.org/latest/rooms/v1/#event-format

Functionsยง

check_room_id
check_rules
Check that the given canonicalized PDU respects the event format of the room version and the size limits from the Matrix specification.
from_incoming_federation
into_outgoing_federation

Type Aliasesยง

AuthEvents
Tuned auth_events vector. Average events have three auth events. It is debatable whether this could be an ArrayVec but the realistic upper-bound is too high and non-deterministic in the era of restricted-type rooms.
Content
Tuned content buffer. This was chosen empirically based on a significantly high-rate modality in the 96-112B size class reported by jemalloc. With two additional words (hopefully) for the SmallVec it puts us squarely at 128B.
PrevEvents
Tuned prev_events vector. Most events have one prev_event. Many events have more but allocations for all of those cases still beats allocations for all cases.