[][src]Struct spirit_tokio::net::TcpConfig

#[non_exhaustive]pub struct TcpConfig {
    pub nodelay: Option<bool>,
    pub recv_buf_size: Option<usize>,
    pub send_buf_size: Option<usize>,
    pub keepalive: MaybeDuration,
    pub accepted_ttl: Option<u32>,
}

An implementation of the StreamConfig trait to configure TCP connections.

This is an implementation that allows the user configure several options of accepted TCP connections.

This is also the default implementation if none is specified for TcpListen.

Fields

Fields (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.
nodelay: Option<bool>

The TCP_NODELAY option.

If set to true, packets are sent as soon as there are some data queued by the application. This is faster, but may create more (undersized) packets in some circumstances.

Setting this to false sends the first undersized packet, but then it waits to either receive ACK from the other side or for enough data to fill a whole packet before sending another.

Left to OS default if not set.

recv_buf_size: Option<usize>

The receive buffer size of the connection, in bytes.

Left to OS default if not set.

send_buf_size: Option<usize>

The send buffer size of the connection, in bytes.

Left to the OS default if not set.

keepalive: MaybeDuration

The TCP keepalive time.

If set to interval (for example 5m or 30s), a TCP keepalive packet will be sent every this often. If set to false, TCP keepalive will be turned off.

Left to the OS default if not set.

accepted_ttl: Option<u32>

The IP TTL field of packets sent through an accepted connection.

Left to the OS default if not set.

Trait Implementations

impl Clone for TcpConfig[src]

impl Debug for TcpConfig[src]

impl Default for TcpConfig[src]

impl<'de> Deserialize<'de> for TcpConfig[src]

impl Eq for TcpConfig[src]

impl Hash for TcpConfig[src]

impl Ord for TcpConfig[src]

impl PartialEq<TcpConfig> for TcpConfig[src]

impl PartialOrd<TcpConfig> for TcpConfig[src]

impl Serialize for TcpConfig[src]

impl StreamConfig<TcpStream> for TcpConfig[src]

impl StructDoc for TcpConfig[src]

impl StructuralEq for TcpConfig[src]

impl StructuralPartialEq for TcpConfig[src]

Auto Trait Implementations

impl RefUnwindSafe for TcpConfig

impl Send for TcpConfig

impl Sync for TcpConfig

impl Unpin for TcpConfig

impl UnwindSafe for TcpConfig

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.