Struct matrix_sdk::sliding_sync::SlidingSyncBuilder
source · pub struct SlidingSyncBuilder { /* private fields */ }
Expand description
Configuration for a Sliding Sync instance.
Get a new builder with methods like crate::Client::sliding_sync
, or
crate::SlidingSync::builder
.
Implementations§
source§impl SlidingSyncBuilder
impl SlidingSyncBuilder
sourcepub fn version(self, version: Version) -> Self
pub fn version(self, version: Version) -> Self
Set a specific version that will override the one from the Client
.
sourcepub fn add_list(self, list_builder: SlidingSyncListBuilder) -> Self
pub fn add_list(self, list_builder: SlidingSyncListBuilder) -> Self
Add the given list to the lists.
Replace any list with the same name.
sourcepub async fn add_cached_list(self, list: SlidingSyncListBuilder) -> Result<Self>
pub async fn add_cached_list(self, list: SlidingSyncListBuilder) -> Result<Self>
Enroll the list in caching, reloads it from the cache if possible, and adds it to the list of lists.
This will raise an error if there was a I/O error reading from the cache.
Replace any list with the same name.
sourcepub fn with_all_extensions(self) -> Self
pub fn with_all_extensions(self) -> Self
Activate e2ee, to-device-message, account data, typing and receipt extensions if not yet configured.
Will leave any extension configuration found untouched, so the order does not matter.
sourcepub fn with_e2ee_extension(self, e2ee: E2EE) -> Self
pub fn with_e2ee_extension(self, e2ee: E2EE) -> Self
Set the E2EE extension configuration.
sourcepub fn without_e2ee_extension(self) -> Self
pub fn without_e2ee_extension(self) -> Self
Unset the E2EE extension configuration.
sourcepub fn with_to_device_extension(self, to_device: ToDevice) -> Self
pub fn with_to_device_extension(self, to_device: ToDevice) -> Self
Set the ToDevice extension configuration.
sourcepub fn without_to_device_extension(self) -> Self
pub fn without_to_device_extension(self) -> Self
Unset the ToDevice extension configuration.
sourcepub fn with_account_data_extension(self, account_data: AccountData) -> Self
pub fn with_account_data_extension(self, account_data: AccountData) -> Self
Set the account data extension configuration.
sourcepub fn without_account_data_extension(self) -> Self
pub fn without_account_data_extension(self) -> Self
Unset the account data extension configuration.
sourcepub fn with_typing_extension(self, typing: Typing) -> Self
pub fn with_typing_extension(self, typing: Typing) -> Self
Set the Typing extension configuration.
sourcepub fn without_typing_extension(self) -> Self
pub fn without_typing_extension(self) -> Self
Unset the Typing extension configuration.
sourcepub fn with_receipt_extension(self, receipt: Receipts) -> Self
pub fn with_receipt_extension(self, receipt: Receipts) -> Self
Set the Receipt extension configuration.
sourcepub fn without_receipt_extension(self) -> Self
pub fn without_receipt_extension(self) -> Self
Unset the Receipt extension configuration.
sourcepub fn poll_timeout(self, timeout: Duration) -> Self
pub fn poll_timeout(self, timeout: Duration) -> Self
Sets a custom timeout duration for the sliding sync polling endpoint.
This is the maximum time to wait before the sliding sync server returns the long-polling request. If no events (or other data) become available before this time elapses, the server will a return a response with empty fields.
There’s an additional network timeout on top of that that can be
configured with Self::network_timeout
.
sourcepub fn network_timeout(self, timeout: Duration) -> Self
pub fn network_timeout(self, timeout: Duration) -> Self
Sets a custom network timeout for the sliding sync polling.
This is not the polling timeout that can be configured with
Self::poll_timeout
, but an additional timeout that will be
added to the former.
Should the sliding sync instance share its sync position through storage?
In general, sliding sync instances will cache the sync position (pos
field in the request) in internal memory. It can be useful, in
multi-process scenarios, to save it into some shared storage so that one
sliding sync instance running across two different processes can
continue with the same sync position it had before being stopped.
sourcepub async fn build(self) -> Result<SlidingSync>
pub async fn build(self) -> Result<SlidingSync>
Build the Sliding Sync.
If self.storage_key
is Some(_)
, load the cached data from cold
storage.
Trait Implementations§
source§impl Clone for SlidingSyncBuilder
impl Clone for SlidingSyncBuilder
source§fn clone(&self) -> SlidingSyncBuilder
fn clone(&self) -> SlidingSyncBuilder
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 SlidingSyncBuilder
impl !RefUnwindSafe for SlidingSyncBuilder
impl Send for SlidingSyncBuilder
impl Sync for SlidingSyncBuilder
impl Unpin for SlidingSyncBuilder
impl !UnwindSafe for SlidingSyncBuilder
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
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>
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