Trait matrix_sdk::StateStore

source ·
pub trait StateStore: AsyncTraitDeps {
    type Error: Debug + Into<StoreError> + From<Error>;

Show 34 methods // Required methods fn get_kv_data<'life0, 'life1, 'async_trait>( &'life0 self, key: StateStoreDataKey<'life1>, ) -> Pin<Box<dyn Future<Output = Result<Option<StateStoreDataValue>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn set_kv_data<'life0, 'life1, 'async_trait>( &'life0 self, key: StateStoreDataKey<'life1>, value: StateStoreDataValue, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn remove_kv_data<'life0, 'life1, 'async_trait>( &'life0 self, key: StateStoreDataKey<'life1>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn save_changes<'life0, 'life1, 'async_trait>( &'life0 self, changes: &'life1 StateChanges, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_presence_event<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<PresenceEvent>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_presence_events<'life0, 'life1, 'async_trait>( &'life0 self, user_ids: &'life1 [OwnedUserId], ) -> Pin<Box<dyn Future<Output = Result<Vec<Raw<PresenceEvent>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_state_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: StateEventType, state_key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<RawAnySyncOrStrippedState>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn get_state_events<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: StateEventType, ) -> Pin<Box<dyn Future<Output = Result<Vec<RawAnySyncOrStrippedState>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_state_events_for_keys<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: StateEventType, state_keys: &'life2 [&'life3 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<RawAnySyncOrStrippedState>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait; fn get_profile<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, user_id: &'life2 UserId, ) -> Pin<Box<dyn Future<Output = Result<Option<MinimalStateEvent<RoomMemberEventContent>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn get_profiles<'a, 'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, user_ids: &'a [OwnedUserId], ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<&'a UserId, MinimalStateEvent<RoomMemberEventContent>>, Self::Error>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_user_ids<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, memberships: RoomMemberships, ) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedUserId>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_room_infos<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<RoomInfo>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_users_with_display_name<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, display_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<BTreeSet<OwnedUserId>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn get_users_with_display_names<'a, 'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, display_names: &'a [String], ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<&'a str, BTreeSet<OwnedUserId>>, Self::Error>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_account_data_event<'life0, 'async_trait>( &'life0 self, event_type: GlobalAccountDataEventType, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<AnyGlobalAccountDataEvent>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_room_account_data_event<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: RoomAccountDataEventType, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<AnyRoomAccountDataEvent>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_user_room_receipt_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, receipt_type: ReceiptType, thread: ReceiptThread, user_id: &'life2 UserId, ) -> Pin<Box<dyn Future<Output = Result<Option<(OwnedEventId, Receipt)>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn get_event_room_receipt_events<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, receipt_type: ReceiptType, thread: ReceiptThread, event_id: &'life2 EventId, ) -> Pin<Box<dyn Future<Output = Result<Vec<(OwnedUserId, Receipt)>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn get_custom_value<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn set_custom_value<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], value: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn remove_custom_value<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn remove_room<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn save_send_queue_request<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, transaction_id: OwnedTransactionId, request: QueuedRequestKind, priority: usize, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn update_send_queue_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, transaction_id: &'life2 TransactionId, content: QueuedRequestKind, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn remove_send_queue_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, transaction_id: &'life2 TransactionId, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn load_send_queue_requests<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<Vec<QueuedRequest>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn update_send_queue_request_status<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, transaction_id: &'life2 TransactionId, error: Option<QueueWedgeError>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn load_rooms_with_unsent_requests<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedRoomId>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn save_dependent_queued_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, parent_txn_id: &'life2 TransactionId, own_txn_id: ChildTransactionId, content: DependentQueuedRequestKind, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn update_dependent_queued_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, parent_txn_id: &'life2 TransactionId, sent_parent_key: SentRequestKey, ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn remove_dependent_queued_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room: &'life1 RoomId, own_txn_id: &'life2 ChildTransactionId, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn load_dependent_queued_requests<'life0, 'life1, 'async_trait>( &'life0 self, room: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<Vec<DependentQueuedRequest>, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; // Provided method fn set_custom_value_no_read<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], value: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... }
}
Expand description

An abstract state store trait that can be used to implement different stores for the SDK.

Required Associated Types§

source

type Error: Debug + Into<StoreError> + From<Error>

The error type used by this state store.

Required Methods§

source

fn get_kv_data<'life0, 'life1, 'async_trait>( &'life0 self, key: StateStoreDataKey<'life1>, ) -> Pin<Box<dyn Future<Output = Result<Option<StateStoreDataValue>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get key-value data from the store.

§Arguments
  • key - The key to fetch data for.
source

fn set_kv_data<'life0, 'life1, 'async_trait>( &'life0 self, key: StateStoreDataKey<'life1>, value: StateStoreDataValue, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Put key-value data into the store.

§Arguments
  • key - The key to identify the data in the store.

  • value - The data to insert.

Panics if the key and value variants do not match.

source

fn remove_kv_data<'life0, 'life1, 'async_trait>( &'life0 self, key: StateStoreDataKey<'life1>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Remove key-value data from the store.

§Arguments
  • key - The key to remove the data for.
source

fn save_changes<'life0, 'life1, 'async_trait>( &'life0 self, changes: &'life1 StateChanges, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Save the set of state changes in the store.

source

fn get_presence_event<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<PresenceEvent>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get the stored presence event for the given user.

§Arguments
  • user_id - The id of the user for which we wish to fetch the presence event for.
source

fn get_presence_events<'life0, 'life1, 'async_trait>( &'life0 self, user_ids: &'life1 [OwnedUserId], ) -> Pin<Box<dyn Future<Output = Result<Vec<Raw<PresenceEvent>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get the stored presence events for the given users.

§Arguments
  • user_ids - The IDs of the users to fetch the presence events for.
source

fn get_state_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: StateEventType, state_key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<RawAnySyncOrStrippedState>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Get a state event out of the state store.

§Arguments
  • room_id - The id of the room the state event was received for.

  • event_type - The event type of the state event.

source

fn get_state_events<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: StateEventType, ) -> Pin<Box<dyn Future<Output = Result<Vec<RawAnySyncOrStrippedState>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get a list of state events for a given room and StateEventType.

§Arguments
  • room_id - The id of the room to find events for.

  • event_type - The event type.

source

fn get_state_events_for_keys<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: StateEventType, state_keys: &'life2 [&'life3 str], ) -> Pin<Box<dyn Future<Output = Result<Vec<RawAnySyncOrStrippedState>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Get a list of state events for a given room, StateEventType, and the given state keys.

§Arguments
  • room_id - The id of the room to find events for.

  • event_type - The event type.

  • state_keys - The list of state keys to find.

source

fn get_profile<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, user_id: &'life2 UserId, ) -> Pin<Box<dyn Future<Output = Result<Option<MinimalStateEvent<RoomMemberEventContent>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Get the current profile for the given user in the given room.

§Arguments
  • room_id - The room id the profile is used in.

  • user_id - The id of the user the profile belongs to.

source

fn get_profiles<'a, 'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, user_ids: &'a [OwnedUserId], ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<&'a UserId, MinimalStateEvent<RoomMemberEventContent>>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get the current profiles for the given users in the given room.

§Arguments
  • room_id - The ID of the room the profiles are used in.

  • user_ids - The IDs of the users the profiles belong to.

source

fn get_user_ids<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, memberships: RoomMemberships, ) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedUserId>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get the user ids of members for a given room with the given memberships, for stripped and regular rooms alike.

source

fn get_room_infos<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<RoomInfo>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get all the pure RoomInfos the store knows about.

source

fn get_users_with_display_name<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, display_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<BTreeSet<OwnedUserId>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Get all the users that use the given display name in the given room.

§Arguments
  • room_id - The id of the room for which the display name users should be fetched for.

  • display_name - The display name that the users use.

source

fn get_users_with_display_names<'a, 'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, display_names: &'a [String], ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<&'a str, BTreeSet<OwnedUserId>>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get all the users that use the given display names in the given room.

§Arguments
  • room_id - The ID of the room to fetch the display names for.

  • display_names - The display names that the users use.

source

fn get_account_data_event<'life0, 'async_trait>( &'life0 self, event_type: GlobalAccountDataEventType, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<AnyGlobalAccountDataEvent>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get an event out of the account data store.

§Arguments
  • event_type - The event type of the account data event.
source

fn get_room_account_data_event<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: RoomAccountDataEventType, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<AnyRoomAccountDataEvent>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get an event out of the room account data store.

§Arguments
  • room_id - The id of the room for which the room account data event should be fetched.

  • event_type - The event type of the room account data event.

source

fn get_user_room_receipt_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, receipt_type: ReceiptType, thread: ReceiptThread, user_id: &'life2 UserId, ) -> Pin<Box<dyn Future<Output = Result<Option<(OwnedEventId, Receipt)>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Get an event out of the user room receipt store.

§Arguments
  • room_id - The id of the room for which the receipt should be fetched.

  • receipt_type - The type of the receipt.

  • thread - The thread containing this receipt.

  • user_id - The id of the user for who the receipt should be fetched.

source

fn get_event_room_receipt_events<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, receipt_type: ReceiptType, thread: ReceiptThread, event_id: &'life2 EventId, ) -> Pin<Box<dyn Future<Output = Result<Vec<(OwnedUserId, Receipt)>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Get events out of the event room receipt store.

§Arguments
  • room_id - The id of the room for which the receipts should be fetched.

  • receipt_type - The type of the receipts.

  • thread - The thread containing this receipt.

  • event_id - The id of the event for which the receipts should be fetched.

source

fn get_custom_value<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get arbitrary data from the custom store

§Arguments
  • key - The key to fetch data for
source

fn set_custom_value<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], value: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Put arbitrary data into the custom store, return the data previously stored

§Arguments
  • key - The key to insert data into

  • value - The value to insert

source

fn remove_custom_value<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Remove arbitrary data from the custom store and return it if existed

§Arguments
  • key - The key to remove data from
source

fn remove_room<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Remove a room and all elements associated from the state store.

§Arguments
  • room_id - The RoomId of the room to delete.
source

fn save_send_queue_request<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, transaction_id: OwnedTransactionId, request: QueuedRequestKind, priority: usize, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Save a request to be sent by a send queue later (e.g. sending an event).

§Arguments
  • room_id - The RoomId of the send queue’s room.
  • transaction_id - The unique key identifying the event to be sent (and its transaction). Note: this is expected to be randomly generated and thus unique.
  • content - Serializable event content to be sent.
source

fn update_send_queue_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, transaction_id: &'life2 TransactionId, content: QueuedRequestKind, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Updates a send queue request with the given content, and resets its error status.

§Arguments
  • room_id - The RoomId of the send queue’s room.
  • transaction_id - The unique key identifying the request to be sent (and its transaction).
  • content - Serializable event content to replace the original one.

Returns true if a request has been updated, or false otherwise.

source

fn remove_send_queue_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, transaction_id: &'life2 TransactionId, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Remove a request previously inserted with Self::save_send_queue_request from the database, based on its transaction id.

Returns true if something has been removed, or false otherwise.

source

fn load_send_queue_requests<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<Vec<QueuedRequest>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Loads all the send queue requests for the given room.

The resulting vector of queued requests should be ordered from higher priority to lower priority, and respect the insertion order when priorities are equal.

source

fn update_send_queue_request_status<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, transaction_id: &'life2 TransactionId, error: Option<QueueWedgeError>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Updates the send queue error status (wedge) for a given send queue request.

source

fn load_rooms_with_unsent_requests<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedRoomId>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Loads all the rooms which have any pending requests in their send queue.

source

fn save_dependent_queued_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, parent_txn_id: &'life2 TransactionId, own_txn_id: ChildTransactionId, content: DependentQueuedRequestKind, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Add a new entry to the list of dependent send queue requests for a parent request.

source

fn update_dependent_queued_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, parent_txn_id: &'life2 TransactionId, sent_parent_key: SentRequestKey, ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Update a set of dependent send queue requests with a key identifying the homeserver’s response, effectively marking them as ready.

⚠ Beware! There’s no verification applied that the parent key type is compatible with the dependent event type. The invalid state may be lazily filtered out in load_dependent_queued_requests.

Returns the number of updated requests.

source

fn remove_dependent_queued_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room: &'life1 RoomId, own_txn_id: &'life2 ChildTransactionId, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Remove a specific dependent send queue request by id.

Returns true if the dependent send queue request has been indeed removed.

source

fn load_dependent_queued_requests<'life0, 'life1, 'async_trait>( &'life0 self, room: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<Vec<DependentQueuedRequest>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

List all the dependent send queue requests.

This returns absolutely all the dependent send queue requests, whether they have a parent event id or not. As a contract for implementors, they must be returned in insertion order.

Provided Methods§

source

fn set_custom_value_no_read<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], value: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Put arbitrary data into the custom store, do not attempt to read any previous data

Optimization option for set_custom_values for stores that would perform better withouts the extra read and the caller not needing that data returned. Otherwise this just wraps around set_custom_data and discards the result.

§Arguments
  • key - The key to insert data into

  • value - The value to insert

Implementors§