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.
Re-exportsΒ§
use std::collections::BTreeSet;πuse std::collections::HashMap;πuse std::fmt::Debug;πuse std::fmt::Debug;πuse std::fmt::Write;πuse std::sync::Arc;πuse std::sync::Mutex;πuse async_trait::async_trait;πuse futures::Stream;πuse futures::StreamExt;πuse lru_cache::LruCache;πuse ruma::EventId;πuse ruma::RoomId;πuse tuwunel_core::Result;πuse tuwunel_core::arrayvec::ArrayVec;πuse tuwunel_core::at;πuse tuwunel_core::checked;πuse tuwunel_core::err;πuse tuwunel_core::expected;πuse tuwunel_core::implement;πuse tuwunel_core::utils;πuse tuwunel_core::utils::bytes;πuse tuwunel_core::utils::math::usize_from_f64;πuse tuwunel_core::utils::stream::IterStream;πuse tuwunel_database::Map;πuse tuwunel_database::Txn;πuse crate::rooms::short::ShortEventId;πuse crate::rooms::short::ShortId;πuse crate::rooms::short::ShortStateHash;πuse crate::rooms::short::ShortStateKey;π
StructsΒ§
- Data π
- Hash
SetCompress State Event - Reports a saved snapshot and its change from the roomβs previous state.
- Service
- Persists, reconstructs, and caches compressed room state snapshots.
- Short
State Info - Describes one materialized frame in a compressed state chain.
- State
Diff π - 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Β§
- Compressed
State - Ordered set of compressed state-key and event-ID pairs.
- Compressed
State Event - Fixed-width encoding of one short state key and short event ID.
- Parent
States πVec - Short
State πInfo Vec - State
Info πLruCache