pub enum RoomLoadSettings {
All,
One(OwnedRoomId),
}Expand description
Configure how many rooms will be restored when restoring the session with
BaseStateStore::load_rooms.
§⚠️ Be careful!
When loading a single room with RoomLoadSettings::One, the in-memory
state may not reflect the store state (in the databases). Thus, when one
will get a room that exists in the store state but not in the in-memory
state, it will be created from scratch and, when saved, will override the
data in the store state (in the databases). This can lead to weird
behaviours.
This option is expected to be used as follows:
- Create a
BaseStateStorewith aStateStorebased on SQLite for example, - Restore a session and load one room from the
StateStore(in the case of dealing with a notification for example), - Derive the
BaseStateStore, withBaseStateStore::derive_from_other, into another one with an in-memoryStateStore, such asMemoryStore, - Work on this derived
BaseStateStore.
Now, all operations happen in the MemoryStore, not on the original store
(SQLite in this example), thus protecting original data.
From a higher-level point of view, this is what
BaseClient::clone_with_in_memory_state_store does.
Variants§
All
Load all rooms from the StateStore into the in-memory state store
BaseStateStore.
This is the default variant.
One(OwnedRoomId)
Load a single room from the StateStore into the in-memory state
store BaseStateStore.
Please, be careful with this option. Read the documentation of
RoomLoadSettings.
Trait Implementations§
Source§impl Clone for RoomLoadSettings
impl Clone for RoomLoadSettings
Source§fn clone(&self) -> RoomLoadSettings
fn clone(&self) -> RoomLoadSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RoomLoadSettings
impl Debug for RoomLoadSettings
Source§impl Default for RoomLoadSettings
impl Default for RoomLoadSettings
Source§fn default() -> RoomLoadSettings
fn default() -> RoomLoadSettings
Auto Trait Implementations§
impl Freeze for RoomLoadSettings
impl RefUnwindSafe for RoomLoadSettings
impl Send for RoomLoadSettings
impl Sync for RoomLoadSettings
impl Unpin for RoomLoadSettings
impl UnwindSafe for RoomLoadSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more