Skip to main content

ClientOptions

Struct ClientOptions 

Source
pub struct ClientOptions {
    pub credential_provider: CredentialProvider,
    pub base_url: Option<String>,
    pub allow_insecure_loopback: bool,
    pub connect_timeout: Option<Duration>,
    pub reconnect_timeout: Option<Duration>,
    pub presence_query_timeout: Option<Duration>,
    pub publish_queue_size: Option<usize>,
    pub deduplication_window_size: Option<usize>,
    pub maximum_reconnect_attempts: Option<u32>,
}
Expand description

Configures a Client. Only the credential provider is required; None keeps an option’s default (CONFIG-01).

use std::time::Duration;
use useceleris_client::{ClientOptions, CredentialProvider, Credentials};

let options = ClientOptions {
    connect_timeout: Some(Duration::from_secs(5)),
    ..ClientOptions::new(provider)
};

Fields§

§credential_provider: CredentialProvider

Fetches fresh credentials for every connection attempt.

§base_url: Option<String>

Defaults to the production endpoint. Set it only for local, CI or self-hosted targets.

§allow_insecure_loopback: bool

Permits a ws:// base URL for a loopback host.

§connect_timeout: Option<Duration>

Covers credential acquisition and the handshake together: 1 ms to 15 minutes, 15 seconds by default.

§reconnect_timeout: Option<Duration>

The same deadline for each reconnect attempt: 1 ms to 15 minutes, the connect timeout by default.

§presence_query_timeout: Option<Duration>

Bounds each presence query: 1 ms to 15 minutes, 10 seconds by default.

§publish_queue_size: Option<usize>

Caps the publishes that wait for room in the writer: at least 1, 64 by default.

§deduplication_window_size: Option<usize>

How many delivered message ids each channel remembers, to drop replayed duplicates: at least 1, 1024 by default.

§maximum_reconnect_attempts: Option<u32>

How many failed reconnect attempts, in one retry budget, end recovery in ChannelState::Failed: 1 to 100, 10 by default.

Implementations§

Source§

impl ClientOptions

Source

pub fn new(credential_provider: CredentialProvider) -> ClientOptions

Options with every default and the given provider.

Trait Implementations§

Source§

impl Clone for ClientOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.