Skip to main content

Module state_compressor

Module state_compressor 

Source
Expand description

Encodes room state snapshots as compact parent-linked deltas.

Each state entry combines a short state key with a short event ID in a fixed-width record. Reconstructed parent chains are cached to make repeated state resolution inexpensive while bounding persistent diff depth.

StructsΒ§

Data πŸ”’
HashSetCompressStateEvent
Reports a saved snapshot and its change from the room’s previous state.
Service
Persists, reconstructs, and caches compressed room state snapshots.
ShortStateInfo
Describes one materialized frame in a compressed state chain.
StateDiff πŸ”’
One state as a delta against a parent state.

FunctionsΒ§

compress_state_event πŸ”’
Packs a short state key and short event ID into one compressed record.
compressed_state_size πŸ”’
parse_compressed_state_event πŸ”’
Unpacks a compressed state record into its two short IDs.

Type AliasesΒ§

CompressedState
Ordered set of compressed state-key and event-ID pairs.
CompressedStateEvent
Fixed-width encoding of one short state key and short event ID.
ParentStatesVec πŸ”’
ShortStateInfoVec πŸ”’
StateInfoLruCache πŸ”’