Files
synapse/rust
Erik Johnston 6135aaca11 Add Event pyclass to Rust
Adds a single `Event` Rust pyclass that replaces the Python EventBase /
FrozenEventV{1,2,3,4,VMSC4242} hierarchy. The class is added but not yet
wired into Python — callers continue to use the existing Python classes
in this commit; the migration follows in the next commit.

The internals use an `FormattedEvent` over
`EventFormatV{1,2V3,4,VMSC4242}` structs sharing an `EventCommonFields`.
Format-specific behaviour (prev_event_ids, auth_event_ids, room_id
derivation for v12 create events, etc) is encapsulated per variant.
Event IDs are computed in the constructor for v3+ formats; v1/v2 use the
`event_id` field as-is.

Two supporting Rust modules are added at the same time:

- `events::constants` — string constants for event types, top-level
  fields, and per-event-type content fields, used to keep the redaction
  rules and field accessors readable.
- `events::utils` — `redact()`, `compute_event_reference_hash()`, and
  `calculate_event_id()`, ported from `synapse.crypto.event_signing` /
  `synapse.events.utils`.
2026-05-15 15:59:55 +01:00
..
2026-05-15 15:59:55 +01:00