[−][src]Trait matrix_sdk::StateStore
Abstraction around the data store to avoid unnecessary request on client initialization.
Required methods
#[must_use]pub fn load_client_state<'life0, 'life1, 'async_trait>(
&'life0 self,
__arg1: &'life1 Session
) -> Pin<Box<dyn Future<Output = Result<Option<ClientState>, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
__arg1: &'life1 Session
) -> Pin<Box<dyn Future<Output = Result<Option<ClientState>, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Loads the state of BaseClient
through ClientState
type.
An Option::None
should be returned only if the StateStore
tries to
load but no state has been stored.
#[must_use]pub fn load_all_rooms<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AllRooms, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AllRooms, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Self: 'async_trait,
Load the state of all Room
s.
This will be mapped over in the client in order to store Room
s in an async safe way.
#[must_use]pub fn store_client_state<'life0, 'async_trait>(
&'life0 self,
__arg1: ClientState
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
__arg1: ClientState
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Self: 'async_trait,
Save the current state of the BaseClient
using the StateStore::Store
type.
#[must_use]pub fn store_room_state<'life0, 'life1, 'async_trait>(
&'life0 self,
__arg1: RoomState<&'life1 Room>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
__arg1: RoomState<&'life1 Room>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Save the state a single Room
.
#[must_use]pub fn delete_room_state<'life0, 'life1, 'async_trait>(
&'life0 self,
_room: RoomState<&'life1 RoomId>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
_room: RoomState<&'life1 RoomId>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Remove state for a room.
This is used when a user leaves a room or rejects an invitation.
Implementors
impl StateStore for JsonStore
[src]
pub fn load_client_state<'life0, 'life1, 'async_trait>(
&'life0 self,
sess: &'life1 Session
) -> Pin<Box<dyn Future<Output = Result<Option<ClientState>, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
JsonStore: 'async_trait,
[src]
&'life0 self,
sess: &'life1 Session
) -> Pin<Box<dyn Future<Output = Result<Option<ClientState>, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
JsonStore: 'async_trait,
pub fn load_all_rooms<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AllRooms, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
JsonStore: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AllRooms, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
JsonStore: 'async_trait,
pub fn store_client_state<'life0, 'async_trait>(
&'life0 self,
state: ClientState
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
JsonStore: 'async_trait,
[src]
&'life0 self,
state: ClientState
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
JsonStore: 'async_trait,
pub fn store_room_state<'life0, 'life1, 'async_trait>(
&'life0 self,
room: RoomState<&'life1 Room>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
JsonStore: 'async_trait,
[src]
&'life0 self,
room: RoomState<&'life1 Room>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
JsonStore: 'async_trait,
pub fn delete_room_state<'life0, 'life1, 'async_trait>(
&'life0 self,
room: RoomState<&'life1 RoomId>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
JsonStore: 'async_trait,
[src]
&'life0 self,
room: RoomState<&'life1 RoomId>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
JsonStore: 'async_trait,