Skip to main content

tuwunel_matrix/
mod.rs

1//! Core Matrix event and room-version types.
2//!
3//! The module exposes the shared event model, PDU storage types, and
4//! room-version rule lookup used throughout the server. Short identifiers are
5//! compact database surrogates for Matrix identifiers.
6#![deny(missing_docs)]
7
8tuwunel_core::rustc_flags_capture! {}
9
10pub mod event;
11pub mod event_id;
12pub mod pdu;
13
14/// Matrix room types and state operations.
15///
16/// Room state resolution is available through the state module.
17pub mod room;
18
19pub mod room_version;
20
21pub use event::{Event, StateKey, TypeExt as EventTypeExt, TypeStateKey, state_key};
22use log as _;
23pub use pdu::{EventHash, Pdu, PduBuilder, PduCount, PduEvent, PduId, RawPduId};
24pub use room_version::{RoomVersion, RoomVersionRules};
25
26/// Compact database identifier for an event type and state-key pair.
27///
28/// Values are allocated by the short-state-key service and have meaning only
29/// within the local database. They are not Matrix protocol identifiers.
30pub type ShortStateKey = ShortId;
31
32/// Compact database identifier for a Matrix event ID.
33///
34/// Values are allocated by the short-event-ID service and have meaning only
35/// within the local database. They are not Matrix protocol identifiers.
36pub type ShortEventId = ShortId;
37
38/// Compact database identifier for a Matrix room ID.
39///
40/// Values are allocated by the short-room-ID service and have meaning only
41/// within the local database. They are not Matrix protocol identifiers.
42pub type ShortRoomId = ShortId;
43
44/// Integer storage shared by the database's compact Matrix identifiers.
45///
46/// The allocation services draw from one global counter. Each alias selects the
47/// database mapping in which a value is interpreted.
48pub type ShortId = u64;