Struct TcpKeepalive
pub struct TcpKeepalive { /* private fields */ }
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, 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, 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.
const fn with_retries(self, retries: u32) -> SelfSet the value of the
TCP_KEEPCNToption.Set the maximum number of TCP keepalive probes that will be sent before dropping a connection, if TCP keepalive is enabled on this socket.
Trait Implementations
impl Clone for TcpKeepalive
fn clone(&self) -> TcpKeepalive
impl Debug for TcpKeepalive
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl Freeze for TcpKeepalive
impl RefUnwindSafe for TcpKeepalive
impl Send for TcpKeepalive
impl Sync for TcpKeepalive
impl Unpin for TcpKeepalive
impl UnsafeUnpin for TcpKeepalive
impl UnwindSafe for TcpKeepalive
Blanket Implementations
impl<T> Any for TcpKeepalive
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for TcpKeepalive
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for TcpKeepalive
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for TcpKeepalive
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for TcpKeepalive
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for TcpKeepalive
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for TcpKeepalive
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for TcpKeepalive
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for TcpKeepalive
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>