tuwunel_core/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
7pub mod event;
8pub mod event_id;
9pub mod pdu;
10pub mod room_version;
11
12pub use event::{Event, StateKey, TypeExt as EventTypeExt, TypeStateKey, state_key};
13pub use pdu::{EventHash, Pdu, PduBuilder, PduCount, PduEvent, PduId, RawPduId};
14pub use room_version::{RoomVersion, RoomVersionRules};
15
16/// Compact database identifier for an event type and state-key pair.
17///
18/// Values are allocated by the short-state-key service and have meaning only
19/// within the local database. They are not Matrix protocol identifiers.
20pub type ShortStateKey = ShortId;
21
22/// Compact database identifier for a Matrix event ID.
23///
24/// Values are allocated by the short-event-ID service and have meaning only
25/// within the local database. They are not Matrix protocol identifiers.
26pub type ShortEventId = ShortId;
27
28/// Compact database identifier for a Matrix room ID.
29///
30/// Values are allocated by the short-room-ID service and have meaning only
31/// within the local database. They are not Matrix protocol identifiers.
32pub type ShortRoomId = ShortId;
33
34/// Integer storage shared by the database's compact Matrix identifiers.
35///
36/// The allocation services draw from one global counter. Each alias selects the
37/// database mapping in which a value is interpreted.
38pub type ShortId = u64;