Skip to main content

Module account_data

Module account_data 

Source
Expand description

User and room account data storage.

The service stores raw account data events behind monotonic update counters and maintains a secondary index by room, user, and event type. Its streams expose changes for incremental sync.

Re-exportsยง

use std::sync::Arc; ๐Ÿ”’
use futures::Stream; ๐Ÿ”’
use futures::StreamExt; ๐Ÿ”’
use futures::TryFutureExt; ๐Ÿ”’
use futures::pin_mut; ๐Ÿ”’
use ruma::OwnedUserId; ๐Ÿ”’
use ruma::RoomId; ๐Ÿ”’
use ruma::UserId; ๐Ÿ”’
use ruma::events::AnyGlobalAccountDataEvent; ๐Ÿ”’
use ruma::events::AnyRawAccountDataEvent; ๐Ÿ”’
use ruma::events::AnyRoomAccountDataEvent; ๐Ÿ”’
use ruma::events::GlobalAccountDataEventType; ๐Ÿ”’
use ruma::events::RoomAccountDataEventType; ๐Ÿ”’
use ruma::push::RuleKind; ๐Ÿ”’
use ruma::push::Ruleset; ๐Ÿ”’
use ruma::serde::Raw; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde_json::json; ๐Ÿ”’
use tuwunel_core::Err; ๐Ÿ”’
use tuwunel_core::Result; ๐Ÿ”’
use tuwunel_core::at; ๐Ÿ”’
use tuwunel_core::err; ๐Ÿ”’
use tuwunel_core::implement; ๐Ÿ”’
use tuwunel_core::utils::MutexMap; ๐Ÿ”’
use tuwunel_core::utils::ReadyExt; ๐Ÿ”’
use tuwunel_core::utils::TryReadyExt; ๐Ÿ”’
use tuwunel_core::utils::result::LogErr; ๐Ÿ”’
use tuwunel_core::utils::stream::TryIgnore; ๐Ÿ”’
use tuwunel_database::Deserialized; ๐Ÿ”’
use tuwunel_database::Handle; ๐Ÿ”’
use tuwunel_database::Ignore; ๐Ÿ”’
use tuwunel_database::Interfix; ๐Ÿ”’
use tuwunel_database::Json; ๐Ÿ”’
use tuwunel_database::Map; ๐Ÿ”’

Modulesยง

direct ๐Ÿ”’
Direct-room account data helpers.
push_rules ๐Ÿ”’
Room push-rule migration helpers.
room_tags ๐Ÿ”’
Room tag account data helpers.

Structsยง

Data ๐Ÿ”’
Service
Stores and queries global and room-scoped account data.

Constantsยง

MAX_RULES
Maximum number of push rules one account may hold.
MAX_RULE_BYTES
Largest match and action data stored for one rule, in bytes.
MAX_RULE_ID_BYTES
Longest rule ID stored, in bytes.

Functionsยง

admits_rule
Whether a ruleset has room for the rule with the given kind and ID.