Struct fractal::session::model::room_list::room_list_metainfo::RoomListMetainfoInner
source · pub struct RoomListMetainfoInner {
rooms_metainfo: Mutex<BTreeMap<OwnedRoomId, RoomMetainfo>>,
pending_rooms_metainfo_updates: RefCell<HashSet<OwnedRoomId>>,
room_list: WeakRef<RoomList>,
}
Fields§
§rooms_metainfo: Mutex<BTreeMap<OwnedRoomId, RoomMetainfo>>
The rooms metainfos.
This is in a Mutex because persisting the data in the store is async and we only want one operation at a time.
pending_rooms_metainfo_updates: RefCell<HashSet<OwnedRoomId>>
Set of room IDs for which the metainfo should be updated.
This list is kept to avoid queuing the same room several times in a row while we wait for the async operation to finish.
room_list: WeakRef<RoomList>
The parent RoomList|.
Implementations§
source§impl RoomListMetainfoInner
impl RoomListMetainfoInner
sourceasync fn persist(&self, rooms_metainfo: &BTreeMap<OwnedRoomId, RoomMetainfo>)
async fn persist(&self, rooms_metainfo: &BTreeMap<OwnedRoomId, RoomMetainfo>)
Persist the metainfo in the store.
sourceasync fn update_rooms_metainfo_for_room(&self, room_id: OwnedRoomId)
async fn update_rooms_metainfo_for_room(&self, room_id: OwnedRoomId)
Update the room metainfo for the room with the given ID.
sourceasync fn try_update_rooms_metainfo(&self) -> bool
async fn try_update_rooms_metainfo(&self) -> bool
Update the rooms metainfo if a lock can be acquired.
Returns true
if the lock could be acquired.
Trait Implementations§
source§impl Debug for RoomListMetainfoInner
impl Debug for RoomListMetainfoInner
source§impl Default for RoomListMetainfoInner
impl Default for RoomListMetainfoInner
source§fn default() -> RoomListMetainfoInner
fn default() -> RoomListMetainfoInner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RoomListMetainfoInner
impl !RefUnwindSafe for RoomListMetainfoInner
impl !Send for RoomListMetainfoInner
impl !Sync for RoomListMetainfoInner
impl Unpin for RoomListMetainfoInner
impl !UnwindSafe for RoomListMetainfoInner
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
Mutably borrows from an owned value. Read more
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,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
Converts
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>
Converts
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 moresource§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.