pub struct ClientConfig {
pub channel_capacity: usize,
pub max_retry_attempts: i32,
pub retry_connection: Duration,
pub request_timeout: Duration,
pub bearer_token: Option<String>,
pub ws_config: WebSocketConfig,
}Expand description
The config used for Client.
Controls the timeout Durations, max retry attempts, etc.
Also contains the WebSocketConfig for the underlying socket.
Fields§
§channel_capacity: usizeHow many messages can be in any of the internal channels at once.
max_retry_attempts: i32How many reconnection attempts the client will attempt at most when connection is lost.
retry_connection: DurationThe delay between each reconnection attempt.
request_timeout: DurationThe timeout for each request to the server.
bearer_token: Option<String>An optional bearer token that will be added into a Authorization header on connection.
ws_config: WebSocketConfigConfig for the underlying websocket.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn with_bearer(bearer: &str) -> ClientConfig
pub fn with_bearer(bearer: &str) -> ClientConfig
Creates a default ClientConfig but with a bearer_token supplied.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClientConfig
impl Debug for ClientConfig
Source§impl Default for ClientConfig
impl Default for ClientConfig
Source§fn default() -> ClientConfig
fn default() -> ClientConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnwindSafe for ClientConfig
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
Mutably borrows from an owned value. Read more