Skip to main content

TransactedRoomKeysQueries

Trait TransactedRoomKeysQueries 

Source
pub trait TransactedRoomKeysQueries: RoomKeysQueries {
    // Provided methods
    async fn fetch_user_backup(
        &mut self,
        user_id: &UserId,
        version: Option<i64>,
        room_id: Option<OwnedRoomId>,
        session_id: Option<String>,
    ) -> Result<Option<DbRoomKeysBackup>, DatabaseError> { ... }
    async fn upsert_backup_data(
        &mut self,
        user_id: &UserId,
        version: i64,
        new_backup_data: BTreeMap<OwnedRoomId, BTreeMap<String, Value>>,
    ) -> Result<(i64, u64), DatabaseError> { ... }
}
Expand description

SQL queries related to room keys that must occur in a database transaction.

Provided Methods§

Source

async fn fetch_user_backup( &mut self, user_id: &UserId, version: Option<i64>, room_id: Option<OwnedRoomId>, session_id: Option<String>, ) -> Result<Option<DbRoomKeysBackup>, DatabaseError>

Fetches a specific user’s backup.

If version is Some(), it will filter using this version, otherwise it will take the highest version one (i.e. the latest backup).

If room_id and/or session_id are Some(), fetched keys will be filtered by these values.

Source

async fn upsert_backup_data( &mut self, user_id: &UserId, version: i64, new_backup_data: BTreeMap<OwnedRoomId, BTreeMap<String, Value>>, ) -> Result<(i64, u64), DatabaseError>

Upserts keys in an existing backup.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'c> TransactedRoomKeysQueries for TransactedDb<'c>

Implementors§