pub struct ConnectionConfig {
pub idle_timeout: Duration,
pub keep_alive_interval: Duration,
pub max_connections: usize,
pub handshake_timeout: Duration,
pub retries: u32,
pub retry_delay: Duration,
}Available on crate feature
quic only.Expand description
Connection lifecycle configuration.
Fields§
§idle_timeout: DurationIdle timeout before closing a connection.
Default: 30 seconds.
keep_alive_interval: DurationKeep-alive interval to prevent idle timeout.
Default: 10 seconds.
max_connections: usizeMaximum number of concurrent connections.
Default: 256.
handshake_timeout: DurationHandshake timeout duration.
Default: 10 seconds.
retries: u32Number of connection retry attempts.
Default: 3.
retry_delay: DurationDelay between retry attempts.
Default: 1 second.
Implementations§
Source§impl ConnectionConfig
impl ConnectionConfig
Sourcepub fn with_idle_timeout(self, timeout: Duration) -> Self
pub fn with_idle_timeout(self, timeout: Duration) -> Self
Builder method to set idle timeout.
Sourcepub fn with_keep_alive_interval(self, interval: Duration) -> Self
pub fn with_keep_alive_interval(self, interval: Duration) -> Self
Builder method to set keep-alive interval.
Sourcepub fn with_max_connections(self, max: usize) -> Self
pub fn with_max_connections(self, max: usize) -> Self
Builder method to set max connections.
Sourcepub fn with_handshake_timeout(self, timeout: Duration) -> Self
pub fn with_handshake_timeout(self, timeout: Duration) -> Self
Builder method to set handshake timeout.
Sourcepub fn with_retries(self, retries: u32) -> Self
pub fn with_retries(self, retries: u32) -> Self
Builder method to set retries.
Sourcepub fn with_retry_delay(self, delay: Duration) -> Self
pub fn with_retry_delay(self, delay: Duration) -> Self
Builder method to set retry delay.
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
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> 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> ⓘ
Converts
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> ⓘ
Converts
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 more