Skip to main content

TransactedSyncV4Queries

Trait TransactedSyncV4Queries 

Source
pub trait TransactedSyncV4Queries: Database {
Show 14 methods // Provided methods async fn insert_syncv4_connection( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, ) -> Result<(), DatabaseError> { ... } async fn reset_connection( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, ) -> Result<(), DatabaseError> { ... } async fn fetch_syncv4_connection( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, ) -> Result<Option<DbSyncV4Connection>, DatabaseError> { ... } async fn fetch_syncv4_position( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, position: i64, ) -> Result<(), DatabaseError> { ... } async fn new_syncv4_position( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, prev_position: Option<i64>, ) -> Result<StreamId, DatabaseError> { ... } async fn fetch_max_stream_ids( &mut self, ) -> Result<DbMaxStreamIds, DatabaseError> { ... } async fn fetch_user_room_info( &mut self, user_id: &UserId, ) -> Result<HashMap<OwnedRoomId, RoomInfo>, DatabaseError> { ... } async fn fetch_syncv4_joined_rooms_timelines( &mut self, user_id: &UserId, rooms: &HashMap<OwnedRoomId, (StreamId, i64)>, last_sync_stream_id: StreamId, to_stream_id: StreamId, ) -> Result<HashMap<OwnedRoomId, SyncedRoomTimeline>, DatabaseError> { ... } async fn fetch_room_membership_counts( &mut self, room_id: &RoomId, ) -> Result<(u64, u64), DatabaseError> { ... } async fn fetch_rooms_stripped_state( &mut self, rooms: &[OwnedRoomId], ) -> Result<HashMap<OwnedRoomId, Vec<Raw<AnyStrippedStateEvent>>>, DatabaseError> { ... } async fn fetch_rooms_required_states( &mut self, room_id: &RoomId, required_state_config: &Vec<(StateEventType, String)>, from_stream_id: StreamId, to_stream_id: StreamId, ) -> Result<Vec<RoomEvent<Verified>>, DatabaseError> { ... } async fn fetch_events_room_streams( &mut self, position: i64, ) -> Result<HashMap<OwnedRoomId, StreamUpperBound>, DatabaseError> { ... } async fn update_rooms_events_streams_to_previously( &mut self, position: i64, rooms_to_update: Vec<OwnedRoomId>, new_up_to: StreamId, ) -> Result<(), DatabaseError> { ... } async fn insert_rooms_events_streams( &mut self, new_position: i64, rooms_streams: HashMap<OwnedRoomId, StreamUpperBound>, ) -> Result<(), DatabaseError> { ... }
}
Expand description

All the syncv4 related queries

Provided Methods§

Source

async fn insert_syncv4_connection( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, ) -> Result<(), DatabaseError>

Inserts a new sync v4 connection given its (user ID, device ID, connection ID) triplet.

Source

async fn reset_connection( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, ) -> Result<(), DatabaseError>

Deletes all the data associated to a connection.

Source

async fn fetch_syncv4_connection( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, ) -> Result<Option<DbSyncV4Connection>, DatabaseError>

Tries to fetch a user’s connection given its (user ID, device ID, connection ID) triplet.

Source

async fn fetch_syncv4_position( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, position: i64, ) -> Result<(), DatabaseError>

Fetches a position that belongs to a specific connection.

Errors if the position was not found.

Source

async fn new_syncv4_position( &mut self, user_id: &UserId, device_id: &DeviceId, conn_id: Option<&str>, prev_position: Option<i64>, ) -> Result<StreamId, DatabaseError>

Inserts a new position in the database, after having deleted any sibling of its previous position, as well as the parent of that previous position.

Source

async fn fetch_max_stream_ids( &mut self, ) -> Result<DbMaxStreamIds, DatabaseError>

Fetches all the maximum stream IDs of the various streams of Arminius.

This is used to compute the next-pos of sliding sync.

Source

async fn fetch_user_room_info( &mut self, user_id: &UserId, ) -> Result<HashMap<OwnedRoomId, RoomInfo>, DatabaseError>

Fetches all the RoomInfo for all the rooms the user has a membership event in.

Source

async fn fetch_syncv4_joined_rooms_timelines( &mut self, user_id: &UserId, rooms: &HashMap<OwnedRoomId, (StreamId, i64)>, last_sync_stream_id: StreamId, to_stream_id: StreamId, ) -> Result<HashMap<OwnedRoomId, SyncedRoomTimeline>, DatabaseError>

Fetches rooms timelines for the given user.

Parameters:

  • user_id: The user for whom to fetch the visible timeline events.
  • rooms: A map from room ID to (start, limit) where start is the stream ID to start fetching events from, and limit is the maximum number of events to fetch for that room.
  • last_sync_stream_id: The last sync’s highest events stream ID. This is used to compute num_live for each room.
  • to_stream_id: The maximum stream ID to not go past by when fetching events.

Returns a mapping from room IDs to SyncedRoomTimeline.

Source

async fn fetch_room_membership_counts( &mut self, room_id: &RoomId, ) -> Result<(u64, u64), DatabaseError>

Fetches the counts of ‘join’ and ‘invite’ users for a single room.

Source

async fn fetch_rooms_stripped_state( &mut self, rooms: &[OwnedRoomId], ) -> Result<HashMap<OwnedRoomId, Vec<Raw<AnyStrippedStateEvent>>>, DatabaseError>

Fetches the list of stripped state events consisting the state of all the given rooms.

Source

async fn fetch_rooms_required_states( &mut self, room_id: &RoomId, required_state_config: &Vec<(StateEventType, String)>, from_stream_id: StreamId, to_stream_id: StreamId, ) -> Result<Vec<RoomEvent<Verified>>, DatabaseError>

Fetches the list of required state events for a room.

Source

async fn fetch_events_room_streams( &mut self, position: i64, ) -> Result<HashMap<OwnedRoomId, StreamUpperBound>, DatabaseError>

Fetches all of a user’s stored room streams, but only for the ‘events’ stream.

Source

async fn update_rooms_events_streams_to_previously( &mut self, position: i64, rooms_to_update: Vec<OwnedRoomId>, new_up_to: StreamId, ) -> Result<(), DatabaseError>

Updates the given room’s syncv4_room_streams entries where stream_name='events' to become PREVIOUSLY(up_to).

Source

async fn insert_rooms_events_streams( &mut self, new_position: i64, rooms_streams: HashMap<OwnedRoomId, StreamUpperBound>, ) -> Result<(), DatabaseError>

Insert all the room streams associated to a position.

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> TransactedSyncV4Queries for TransactedDb<'c>

Implementors§