Struct matrix_sdk::event_cache::RoomEventCache
source · pub struct RoomEventCache { /* private fields */ }
Expand description
A subset of an event cache, for a room.
Cloning is shallow, and thus is cheap to do.
Implementations§
source§impl RoomEventCache
impl RoomEventCache
sourcepub async fn subscribe(
&self
) -> Result<(Vec<SyncTimelineEvent>, Receiver<RoomEventCacheUpdate>)>
pub async fn subscribe( &self ) -> Result<(Vec<SyncTimelineEvent>, Receiver<RoomEventCacheUpdate>)>
Subscribe to room updates for this room, after getting the initial list
of events. XXX: Could/should it use some kind of Observable
instead? Or not something async, like explicit handlers as our event
handlers?
sourcepub async fn oldest_backpagination_token(
&self,
max_wait: Option<Duration>
) -> Result<Option<PaginationToken>>
pub async fn oldest_backpagination_token( &self, max_wait: Option<Duration> ) -> Result<Option<PaginationToken>>
Returns the oldest back-pagination token, that is, the one closest to the beginning of the timeline as we know it.
Optionally, wait at most for the given duration for a back-pagination token to be returned by a sync.
sourcepub async fn backpaginate(
&self,
batch_size: u16,
token: Option<PaginationToken>
) -> Result<BackPaginationOutcome>
pub async fn backpaginate( &self, batch_size: u16, token: Option<PaginationToken> ) -> Result<BackPaginationOutcome>
Back-paginate with the given token, if provided.
If no token has been provided, it will back-paginate from the end of the room.
If a token has been provided, but it was unknown to the event cache (i.e. it’s not associated to any gap in the timeline stored by the event cache), then an error result will be returned.
Trait Implementations§
source§impl Clone for RoomEventCache
impl Clone for RoomEventCache
source§fn clone(&self) -> RoomEventCache
fn clone(&self) -> RoomEventCache
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RoomEventCache
impl Send for RoomEventCache
impl Sync for RoomEventCache
impl Unpin for RoomEventCache
impl !UnwindSafe for RoomEventCache
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§fn clone_handle(handle: Handle) -> Handle
fn clone_handle(handle: Handle) -> Handle
§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>