Skip to main content

Module pdu

Module pdu 

Source
Expand description

Persistent data unit storage and federation-format utilities.

The module contains the stored event representation, sequence identifiers, builders, and validation helpers. Its wire-format adapters account for room-version rules.

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
Collects the initial fields needed to build and append a PDU.
EventHash
Content hashes of a PDU.
Id
Typed components of a PDU database key.
Pdu
Stores a Matrix persistent data unit in typed form.
PduBuilder
Collects the initial fields needed to build and append a PDU.

EnumsΒ§

Count
Sequence number locating a PDU in a room timeline.
RawId
Packed database key for a room’s normal or backfilled PDU.

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
Verifies that a parsed PDU belongs to the expected room.
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
Normalizes a federation PDU object into the stored representation.
into_outgoing_federation
Converts a stored PDU object to its federation wire representation.

Type AliasesΒ§

AuthEvents
Inline storage for the typical three-entry auth_events case.
Content
Raw event-content storage with 112 bytes of inline capacity.
PrevEvents
Inline storage for the common single-entry prev_events case.
Unsigned
Raw unsigned storage with 112 bytes of inline capacity.