#[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
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>ws and non-target_family=wasm only.WebSocket-specific configuration.
Implementations§
Source§impl ConnectionConfig
impl ConnectionConfig
Sourcepub const fn new() -> ConnectionConfig
pub const fn new() -> ConnectionConfig
Create a new empty configuration.
Sourcepub fn with_auth(self, auth: Authorization) -> ConnectionConfig
pub fn with_auth(self, auth: Authorization) -> ConnectionConfig
Set the authorization header.
Sourcepub const fn with_max_retries(self, max_retries: u32) -> ConnectionConfig
pub const fn with_max_retries(self, max_retries: u32) -> ConnectionConfig
Set the maximum number of retries.
Sourcepub const fn with_retry_interval(
self,
retry_interval: Duration,
) -> ConnectionConfig
pub const fn with_retry_interval( self, retry_interval: Duration, ) -> ConnectionConfig
Set the retry interval.
Sourcepub const fn with_ws_config(self, config: WebSocketConfig) -> ConnectionConfig
Available on crate feature ws and non-target_family=wasm only.
pub const fn with_ws_config(self, config: WebSocketConfig) -> ConnectionConfig
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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
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> 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 moreSource§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