Struct TcpKeepalive
struct TcpKeepalive { ... }
Configures a socket's TCP keepalive parameters.
Implementations
impl TcpKeepalive
const fn new() -> TcpKeepaliveReturns a new, empty set of TCP keepalive parameters.
const fn with_time(self: Self, time: Duration) -> SelfSet the amount of time after which TCP keepalive probes will be sent on idle connections.
This will set
TCP_KEEPALIVEon macOS and iOS, andTCP_KEEPIDLEon 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 thetcp_keepalivestruct'skeepalivetimefield.Some platforms specify this value in seconds, so sub-second specifications may be omitted.
const fn with_interval(self: Self, interval: Duration) -> SelfSet the value of the
TCP_KEEPINTVLoption. On Windows, this sets the value of thetcp_keepalivestruct'skeepaliveintervalfield.Sets the time interval between TCP keepalive probes.
Some platforms specify this value in seconds, so sub-second specifications may be omitted.
impl Clone for TcpKeepalive
fn clone(self: &Self) -> TcpKeepalive
impl Debug for TcpKeepalive
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Freeze for TcpKeepalive
impl RefUnwindSafe for TcpKeepalive
impl Send for TcpKeepalive
impl Sync for TcpKeepalive
impl Unpin for TcpKeepalive
impl UnwindSafe for TcpKeepalive
impl<T> Any for TcpKeepalive
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for TcpKeepalive
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for TcpKeepalive
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for TcpKeepalive
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for TcpKeepalive
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for TcpKeepalive
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for TcpKeepalive
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for TcpKeepalive
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for TcpKeepalive
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>