[][src]Trait matrix_sdk::StateStore

pub trait StateStore: AsyncTraitDeps {
#[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
;
#[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
;
#[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
;
#[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
;
#[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
; }

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]

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]

Load the state of all Rooms.

This will be mapped over in the client in order to store Rooms 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]

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]

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]

Remove state for a room.

This is used when a user leaves a room or rejects an invitation.

Loading content...

Implementors

impl StateStore for JsonStore[src]

Loading content...