#[non_exhaustive]pub struct ConnectionConfig {
pub auth: Option<Authorization>,
pub max_retries: Option<u32>,
pub retry_interval: Option<Duration>,
pub ws_config: Option<WebSocketConfig>,
}Expand description
Configuration for connecting to built-in transports.
Provides a flexible way to configure various aspects of the connection, including authentication, retry behavior, and transport-specific settings.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.auth: Option<Authorization>Authorization header for authenticated connections.
max_retries: Option<u32>Maximum number of connection retries.
retry_interval: Option<Duration>Interval between connection retries.
ws_config: Option<WebSocketConfig>Available on crate feature
ws and non-target_family=wasm only.WebSocket-specific configuration.
Implementations§
Source§impl ConnectionConfig
impl ConnectionConfig
Sourcepub fn with_auth(self, auth: Authorization) -> Self
pub fn with_auth(self, auth: Authorization) -> Self
Set the authorization header.
Sourcepub const fn with_max_retries(self, max_retries: u32) -> Self
pub const fn with_max_retries(self, max_retries: u32) -> Self
Set the maximum number of retries.
Sourcepub const fn with_retry_interval(self, retry_interval: Duration) -> Self
pub const fn with_retry_interval(self, retry_interval: Duration) -> Self
Set the retry interval.
Sourcepub const fn with_ws_config(self, config: WebSocketConfig) -> Self
Available on crate feature ws and non-target_family=wasm only.
pub const fn with_ws_config(self, config: WebSocketConfig) -> Self
ws and non-target_family=wasm only.Set the WebSocket configuration.
Trait Implementations§
Source§impl Clone for ConnectionConfig
impl Clone for ConnectionConfig
Source§fn clone(&self) -> ConnectionConfig
fn clone(&self) -> ConnectionConfig
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 ConnectionConfig
impl Debug for ConnectionConfig
Source§impl Default for ConnectionConfig
impl Default for ConnectionConfig
Source§fn default() -> ConnectionConfig
fn default() -> ConnectionConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConnectionConfig
impl RefUnwindSafe for ConnectionConfig
impl Send for ConnectionConfig
impl Sync for ConnectionConfig
impl Unpin for ConnectionConfig
impl UnwindSafe for ConnectionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 120 bytes