Struct matrix_sdk::sliding_sync::SlidingSyncBuilder
source · pub struct SlidingSyncBuilder { /* private fields */ }
experimental-sliding-sync
only.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 sliding_sync_proxy(self, value: Url) -> Self
pub fn sliding_sync_proxy(self, value: Url) -> Self
Set the sliding sync proxy URL.
Note you might not need that in general, since the client uses the
.well-known
endpoint to automatically find the sliding sync proxy
URL. This method should only be called if the proxy is at a
different URL than the one publicized in the .well-known
endpoint.
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: E2EEConfig) -> Self
pub fn with_e2ee_extension(self, e2ee: E2EEConfig) -> 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: ToDeviceConfig) -> Self
pub fn with_to_device_extension(self, to_device: ToDeviceConfig) -> 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: AccountDataConfig
) -> Self
pub fn with_account_data_extension( self, account_data: AccountDataConfig ) -> 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: TypingConfig) -> Self
pub fn with_typing_extension(self, typing: TypingConfig) -> 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: ReceiptsConfig) -> Self
pub fn with_receipt_extension(self, receipt: ReceiptsConfig) -> 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.
Available on crate feature e2e-encryption
only.
e2e-encryption
only.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 !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
§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<>