pub struct EventCache { /* private fields */ }
Expand description
An event cache, providing lots of useful functionality for clients.
Cloning is shallow, and thus is cheap to do.
See also the module-level comment.
Implementations§
Source§impl EventCache
impl EventCache
Sourcepub fn subscribe(&self) -> Result<()>
pub fn subscribe(&self) -> Result<()>
Starts subscribing the EventCache
to sync responses, if not done
before.
Re-running this has no effect if we already subscribed before, and is cheap.
Sourcepub async fn clear_all_rooms(&self) -> Result<()>
pub async fn clear_all_rooms(&self) -> Result<()>
Cleanly clear all the rooms’ event caches.
This will notify any live observers that the room has been cleared.
Sourcepub fn subscribe_to_room_generic_updates(
&self,
) -> Receiver<RoomEventCacheGenericUpdate>
pub fn subscribe_to_room_generic_updates( &self, ) -> Receiver<RoomEventCacheGenericUpdate>
Subscribe to room generic updates.
If one wants to listen what has changed in a specific room, the
RoomEventCache::subscribe
is recommended. However, the
RoomEventCacheSubscriber
type triggers side-effects.
If one wants to get a high-overview, generic, updates for rooms, and
without side-effects, this method is recommended. For example, it
doesn’t provide a list of new events, but rather a
RoomEventCacheGenericUpdate::UpdateTimeline
update. Also, dropping
the receiver of this channel will not trigger any side-effect.
Trait Implementations§
Source§impl Clone for EventCache
impl Clone for EventCache
Source§fn clone(&self) -> EventCache
fn clone(&self) -> EventCache
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for EventCache
impl !RefUnwindSafe for EventCache
impl Send for EventCache
impl Sync for EventCache
impl Unpin for EventCache
impl !UnwindSafe for EventCache
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,
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>
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