Struct matrix_sdk::event_cache::EventCache
source · 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 event(&self, event_id: &EventId) -> Option<SyncTimelineEvent>
pub async fn event(&self, event_id: &EventId) -> Option<SyncTimelineEvent>
Try to find an event by its ID in all the rooms.
sourcepub async fn add_initial_events(
&self,
room_id: &RoomId,
events: Vec<SyncTimelineEvent>,
prev_batch: Option<String>,
) -> Result<()>
pub async fn add_initial_events( &self, room_id: &RoomId, events: Vec<SyncTimelineEvent>, prev_batch: Option<String>, ) -> Result<()>
Add an initial set of events to the event cache, reloaded from a cache.
TODO: temporary for API compat, as the event cache should take care of its own store.
Trait Implementations§
source§impl Clone for EventCache
impl Clone for EventCache
source§fn clone(&self) -> EventCache
fn clone(&self) -> EventCache
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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 more