pub struct AvatarCache { /* private fields */ }Expand description
A cache for keeping track of avatar changes in sync responses.
Implementations§
Source§impl AvatarCache
impl AvatarCache
Sourcepub fn new(store: SaveLockedStateStore) -> Self
pub fn new(store: SaveLockedStateStore) -> Self
Creates a new AvatarCache.
Sourcepub async fn handle_event(
&mut self,
state_changes: &StateChanges,
room_id: &RoomId,
member_event: &SyncRoomMemberEvent,
) -> Result<(), StoreError>
pub async fn handle_event( &mut self, state_changes: &StateChanges, room_id: &RoomId, member_event: &SyncRoomMemberEvent, ) -> Result<(), StoreError>
Processes the room member event and checks if there was any change in the avatar URL for the room member.
Sourcepub fn remove_changes(
&mut self,
room_id: &RoomId,
) -> Option<BTreeMap<OwnedUserId, Option<OwnedMxcUri>>>
pub fn remove_changes( &mut self, room_id: &RoomId, ) -> Option<BTreeMap<OwnedUserId, Option<OwnedMxcUri>>>
Removes and returns the avatar changes associated with the RoomId,
if any.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AvatarCache
impl !RefUnwindSafe for AvatarCache
impl Send for AvatarCache
impl Sync for AvatarCache
impl Unpin for AvatarCache
impl UnsafeUnpin for AvatarCache
impl !UnwindSafe for AvatarCache
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> 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>
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 more