#[non_exhaustive]pub struct TcpOptions {
pub keepalive_idle: Option<Duration>,
pub keepalive_interval: Option<Duration>,
pub keepalive_count: Option<u32>,
}
Expand description
A container of TCP settings to be applied to the sockets created by the hyper client.
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.keepalive_idle: Option<Duration>
This sets TCP_KEEPIDLE and SO_KEEPALIVE.
keepalive_interval: Option<Duration>
This sets TCP_KEEPINTVL and SO_KEEPALIVE.
keepalive_count: Option<u32>
This sets TCP_KEEPCNT and SO_KEEPALIVE.
Implementations§
Source§impl TcpOptions
impl TcpOptions
Sourcepub fn keepalive_timeout(dur: Duration) -> Self
pub fn keepalive_timeout(dur: Duration) -> Self
keepalive_timeout returns a TCP keepalive policy that times out after the specified duration. The keepalive policy returned waits for half of the supplied duration before sending keepalive packets, and attempts to keep the connection alive three times for the remaining period.
If the supplied duration does not contain at least one whole second, no TCP keepalive policy is returned.
Trait Implementations§
Source§impl Clone for TcpOptions
impl Clone for TcpOptions
Source§fn clone(&self) -> TcpOptions
fn clone(&self) -> TcpOptions
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 TcpOptions
impl Debug for TcpOptions
Source§impl Default for TcpOptions
impl Default for TcpOptions
Source§fn default() -> TcpOptions
fn default() -> TcpOptions
Returns the “default value” for a type. Read more
Source§impl PartialEq for TcpOptions
impl PartialEq for TcpOptions
impl Copy for TcpOptions
impl Eq for TcpOptions
impl StructuralPartialEq for TcpOptions
Auto Trait Implementations§
impl Freeze for TcpOptions
impl RefUnwindSafe for TcpOptions
impl Send for TcpOptions
impl Sync for TcpOptions
impl Unpin for TcpOptions
impl UnwindSafe for TcpOptions
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,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoAny for T
impl<T> IntoAny for T
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
Source§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.