Struct matrix_sdk::sliding_sync::SlidingSyncList
source · pub struct SlidingSyncList { /* private fields */ }
experimental-sliding-sync
only.Expand description
Holding a specific filtered list within the concept of sliding sync.
It is OK to clone this type as much as you need: cloning it is cheap.
Implementations§
source§impl SlidingSyncList
impl SlidingSyncList
sourcepub fn builder(name: impl Into<String>) -> SlidingSyncListBuilder
pub fn builder(name: impl Into<String>) -> SlidingSyncListBuilder
Create a new SlidingSyncListBuilder
with the given name.
sourcepub fn set_sync_mode<M>(&self, sync_mode: M)where
M: Into<SlidingSyncMode>,
pub fn set_sync_mode<M>(&self, sync_mode: M)where
M: Into<SlidingSyncMode>,
Change the sync-mode.
It is sometimes necessary to change the sync-mode of a list on-the-fly.
This will change the sync-mode but also the request generator. A new
request generator is generated. Since requests are calculated based on
the request generator, changing the sync-mode is equivalent to
“resetting” the list. It’s actually not calling Self::reset
, which
means that the state is not reset purposely. The ranges and the
state will be updated when the next request will be sent and a
response will be received. The maximum number of rooms won’t change.
sourcepub fn state(&self) -> SlidingSyncListLoadingState
pub fn state(&self) -> SlidingSyncListLoadingState
Get the current state.
sourcepub fn state_stream(
&self
) -> (SlidingSyncListLoadingState, impl Stream<Item = SlidingSyncListLoadingState>)
pub fn state_stream( &self ) -> (SlidingSyncListLoadingState, impl Stream<Item = SlidingSyncListLoadingState>)
Get a stream of state updates.
If this list has been reloaded from a cache, the initial value read from the cache will be published.
There’s no guarantee of ordering between items emitted by this stream and those emitted by other streams exposed on this structure.
The first part of the returned tuple is the actual loading state, and
the second part is the Stream
to receive updates.
sourcepub fn timeline_limit(&self) -> Option<Bound>
pub fn timeline_limit(&self) -> Option<Bound>
Get the timeline limit.
sourcepub fn set_timeline_limit(&self, timeline: Option<Bound>)
pub fn set_timeline_limit(&self, timeline: Option<Bound>)
Set timeline limit.
sourcepub fn room_list<R>(&self) -> Vec<R>where
R: for<'a> From<&'a RoomListEntry>,
pub fn room_list<R>(&self) -> Vec<R>where
R: for<'a> From<&'a RoomListEntry>,
Get the current room list.
sourcepub fn room_list_stream(
&self
) -> (Vector<RoomListEntry>, impl Stream<Item = Vec<VectorDiff<RoomListEntry>>>)
pub fn room_list_stream( &self ) -> (Vector<RoomListEntry>, impl Stream<Item = Vec<VectorDiff<RoomListEntry>>>)
Get a stream of room list.
If this list has been reloaded from a cache, the initial value read from the cache will be published.
There’s no guarantee of ordering between items emitted by this stream and those emitted by other streams exposed on this structure.
The first part of the returned tuple is the actual room list entries,
and the second part is the Stream
to receive updates on the room list
entries.
sourcepub fn maximum_number_of_rooms(&self) -> Option<u32>
pub fn maximum_number_of_rooms(&self) -> Option<u32>
Get the maximum number of rooms. See Self::maximum_number_of_rooms
to learn more.
sourcepub fn maximum_number_of_rooms_stream(&self) -> Subscriber<Option<u32>>
pub fn maximum_number_of_rooms_stream(&self) -> Subscriber<Option<u32>>
Get a stream of rooms count.
If this list has been reloaded from a cache, the initial value is published too.
There’s no guarantee of ordering between items emitted by this stream and those emitted by other streams exposed on this structure.
sourcepub fn get_room_id(&self, index: usize) -> Option<OwnedRoomId>
pub fn get_room_id(&self, index: usize) -> Option<OwnedRoomId>
Return the room_id
at the given index.
sourcepub fn maybe_commit_sticky(&mut self, txn_id: &TransactionId)
pub fn maybe_commit_sticky(&mut self, txn_id: &TransactionId)
Commit the set of sticky parameters for this list.
sourcepub fn invalidate_sticky_data(&self)
pub fn invalidate_sticky_data(&self)
Manually invalidate the sticky data, so the sticky parameters are re-sent next time.
Trait Implementations§
source§impl Clone for SlidingSyncList
impl Clone for SlidingSyncList
source§fn clone(&self) -> SlidingSyncList
fn clone(&self) -> SlidingSyncList
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 SlidingSyncList
impl Send for SlidingSyncList
impl Sync for SlidingSyncList
impl Unpin for SlidingSyncList
impl !UnwindSafe for SlidingSyncList
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<>