Struct TcpKeepAlive
pub struct TcpKeepAlive {
pub time: Option<Duration>,
pub interval: Option<Duration>,
pub retries: Option<u32>,
}
Expand description
Configures a Socket
’s TCP keepalive parameters.
See [SocketOptions::tcp_keepalive
].
Fields§
§time: Option<Duration>
Set the amount of time after which TCP keepalive probes will be sent on idle connections.
This will set TCP_KEEPALIVE
on macOS and iOS, and
TCP_KEEPIDLE
on all other Unix operating systems, except
OpenBSD and Haiku which don’t support any way to set this
option. On Windows, this sets the value of the tcp_keepalive
struct’s keepalivetime
field.
Some platforms specify this value in seconds, so sub-second specifications may be omitted.
interval: Option<Duration>
Set the value of the TCP_KEEPINTVL
option. On Windows, this sets the
value of the tcp_keepalive
struct’s keepaliveinterval
field.
Sets the time interval between TCP keepalive probes.
Some platforms specify this value in seconds, so sub-second specifications may be omitted.
retries: Option<u32>
Set the value of the TCP_KEEPCNT
option.
Set the maximum number of TCP keepalive probes that will be sent before
dropping a connection, if TCP keepalive is enabled on this Socket
.
Implementations§
§impl TcpKeepAlive
impl TcpKeepAlive
pub fn into_socket_keep_alive(self) -> TcpKeepalive
Trait Implementations§
§impl Clone for TcpKeepAlive
impl Clone for TcpKeepAlive
§fn clone(&self) -> TcpKeepAlive
fn clone(&self) -> TcpKeepAlive
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for TcpKeepAlive
impl Debug for TcpKeepAlive
§impl Default for TcpKeepAlive
impl Default for TcpKeepAlive
§fn default() -> TcpKeepAlive
fn default() -> TcpKeepAlive
§impl<'de> Deserialize<'de> for TcpKeepAlive
impl<'de> Deserialize<'de> for TcpKeepAlive
§fn deserialize<D>(
deserializer: D,
) -> Result<TcpKeepAlive, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<TcpKeepAlive, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl From<TcpKeepAlive> for TcpKeepalive
impl From<TcpKeepAlive> for TcpKeepalive
§fn from(value: TcpKeepAlive) -> TcpKeepalive
fn from(value: TcpKeepAlive) -> TcpKeepalive
§impl Serialize for TcpKeepAlive
impl Serialize for TcpKeepAlive
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TcpKeepAlive
impl RefUnwindSafe for TcpKeepAlive
impl Send for TcpKeepAlive
impl Sync for TcpKeepAlive
impl Unpin for TcpKeepAlive
impl UnwindSafe for TcpKeepAlive
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> ⓘ
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more