Struct matrix_sdk_base::store::Store
source · [−]pub struct Store { /* private fields */ }
Expand description
A state store wrapper for the SDK.
This adds additional higher level store functionality on top of a
StateStore
implementation.
Implementations
sourceimpl Store
impl Store
sourcepub fn open_memory_store() -> Self
pub fn open_memory_store() -> Self
Create a new Store with the default MemoryStore
sourceimpl Store
impl Store
sourcepub fn new(inner: Arc<dyn StateStore>) -> Self
pub fn new(inner: Arc<dyn StateStore>) -> Self
Create a new store, wrappning the given StateStore
sourcepub async fn restore_session(&self, session: Session) -> Result<()>
pub async fn restore_session(&self, session: Session) -> Result<()>
Restore the access to the Store from the given Session
, overwrites any
previously existing access to the Store.
sourcepub fn session(&self) -> Option<&Session>
pub fn session(&self) -> Option<&Session>
The current Session
containing our user id, device ID and access
token.
sourcepub fn get_rooms(&self) -> Vec<Room>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_rooms(&self) -> Vec<Room>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get all the rooms this store knows about.
sourcepub fn get_stripped_rooms(&self) -> Vec<Room>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_stripped_rooms(&self) -> Vec<Room>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get all the rooms this store knows about.
sourcepub fn get_stripped_room(&self, room_id: &RoomId) -> Option<Room>
pub fn get_stripped_room(&self, room_id: &RoomId) -> Option<Room>
Get the stripped room with the given room id.
sourcepub async fn get_or_create_stripped_room(&self, room_id: &RoomId) -> Room
pub async fn get_or_create_stripped_room(&self, room_id: &RoomId) -> Room
Lookup the stripped Room for the given RoomId, or create one, if it didn’t exist yet in the store
sourcepub async fn get_or_create_room(
&self,
room_id: &RoomId,
room_type: RoomType
) -> Room
pub async fn get_or_create_room(
&self,
room_id: &RoomId,
room_type: RoomType
) -> Room
Lookup the Room for the given RoomId, or create one, if it didn’t exist yet in the store
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl !UnwindSafe for Store
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more