Skip to main content

Crate m4a_matrix_core

Crate m4a_matrix_core 

Source
Expand description

Matrix event layer, spike stage (F3.0).

What it does: builds room events of room version 11 the way a foreign Matrix server expects them: no event_id on the wire, a content hash, an ed25519 signature over the redacted form, and an event id that is COMPUTED ($ + url-safe unpadded base64 of the reference hash). It checks every new event against the room’s auth rules before accepting it, and wraps ruma-state-res for state resolution over forked state.

What it is not: no HTTP, no storage, no federation transport. Keys come in through a closure, so the crate does not care which ed25519 implementation the caller uses. All ruma types stay behind this crate’s own small surface.

Modules§

dag
The event DAG of one room, over any store that can answer DagRead.

Structs§

EventId
A Matrix event ID.
OwnedEventId
Owned variant of EventId.
OwnedRoomId
Owned variant of RoomId.
OwnedUserId
Owned variant of UserId.
Pdu
A persistent data unit with the fields state resolution and the auth rules read.
RoomBuilder
Builds the timeline of one NEW room, event by event: fills prev_events, depth and the auth_events the spec selects from the current state, hashes and signs, computes the id, and refuses an event the auth rules would reject.
RoomVersionRules
The rules applied to a room version.
SignedEvent
A finished event: its computed id and the signed wire JSON (no event_id inside).
Signer
An ed25519 signer: server name, key id (ed25519:<version>) and a signing closure. The closure signs the exact bytes it is given and returns the 64-byte signature.

Enums§

BuildError
CanonicalJsonValue
Represents a canonical JSON value as per the Matrix specification.
IdError
An error encountered when trying to parse an invalid ID string.
ResolveError
RoomVersionId
A Matrix room version ID.
StateEventType
The type of StateEvent this is.

Constants§

ROOM_VERSION
The room version this spike emits.

Functions§

auth_chain
The full recursive set of auth events of ids (the ids themselves included).
auth_chain_with
auth_chain over any event source.
key_from_b64
A signing key as ruma wants it, from standard base64 (padded or not).
key_to_b64
Standard base64 of public key bytes.
resolve_state
Resolves forked room states (state resolution v2) over a set of known events.
resolve_state_with
resolve_state over any event source (a store lookup).

Type Aliases§

CanonicalJsonObject
The inner type of CanonicalJsonValue::Object.
PublicKeyMap
A map from entity names to sets of public keys for that entity.
StateMap
A mapping of event type and state_key to some value T, usually an EventId.