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) -> Bound
pub fn timeline_limit(&self) -> Bound
Get the timeline limit.
Sourcepub fn set_timeline_limit(&self, timeline: Bound)
pub fn set_timeline_limit(&self, timeline: Bound)
Set timeline limit.
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 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.
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 Freeze for SlidingSyncList
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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>
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