Struct s2n_quic::provider::io::tokio::Builder

source ·
pub struct Builder { /* private fields */ }

Implementations§

source§

impl Builder

source

pub fn with_handle(self, handle: Handle) -> Builder

source

pub fn with_receive_address(self, addr: SocketAddr) -> Result<Builder, Error>

Sets the local address for the runtime to listen on. If no send address or tx socket is specified, this address will also be used for transmitting from.

NOTE: this method is mutually exclusive with with_rx_socket

source

pub fn with_send_address(self, addr: SocketAddr) -> Result<Builder, Error>

Sets the local address for the runtime to transmit from. If no send address or tx socket is specified, the receive_address will be used for transmitting.

NOTE: this method is mutually exclusive with with_tx_socket

source

pub fn with_rx_socket(self, socket: UdpSocket) -> Result<Builder, Error>

Sets the socket used for receiving for the runtime. If no tx_socket or send address is specified, this socket will be used for transmitting.

NOTE: this method is mutually exclusive with with_receive_address

source

pub fn with_tx_socket(self, socket: UdpSocket) -> Result<Builder, Error>

Sets the socket used for transmitting on for the runtime. If no tx_socket or send address is specified, the rx_socket will be used for transmitting.

NOTE: this method is mutually exclusive with with_send_address

source

pub fn with_send_buffer_size( self, send_buffer_size: usize ) -> Result<Builder, Error>

Sets the size of the operating system’s send buffer associated with the tx socket

source

pub fn with_recv_buffer_size( self, recv_buffer_size: usize ) -> Result<Builder, Error>

Sets the size of the operating system’s receive buffer associated with the rx socket

source

pub fn with_internal_send_buffer_size( self, send_buffer_size: usize ) -> Result<Builder, Error>

Sets the size of the send buffer associated with the transmit side (internal to s2n-quic)

source

pub fn with_internal_recv_buffer_size( self, recv_buffer_size: usize ) -> Result<Builder, Error>

Sets the size of the send buffer associated with the receive side (internal to s2n-quic)

source

pub fn with_max_mtu(self, max_mtu: u16) -> Result<Builder, Error>

Sets the largest maximum transmission unit (MTU) that can be sent on a path (default: 1500)

MTU is the size of the largest IP packet that can be transmitted on a path. This includes the size of the IP header, the size of the UDP header, and the size of the UDP payload containing the QUIC packet(s).

Most networks can support the Ethernet II framing MTU of 1500 bytes. If your network supports Ethernet jumbo frames, you can set max_mtu to a higher value (~9000). This will enable s2n-quic to send probe packets at larger sizes to validate the MTU the network can support, giving a significant throughput improvement if a large MTU is confirmed.

Note: max_mtu must be >= initial_mtu and base_mtu

source

pub fn with_initial_mtu(self, initial_mtu: u16) -> Result<Builder, Error>

Sets the maximum transmission unit (MTU) to use when initiating a connection (default: 1228)

MTU is the size of the largest IP packet that can be transmitted on a path. This includes the size of the IP header, the size of the UDP header, and the size of the UDP payload containing the QUIC packet(s).

By default, s2n-quic will complete the QUIC handshake using packets limited to the base_mtu (default: 1228). Following the handshake, s2n-quic will send probe packets at larger sizes to validate the MTU the network can support, up to the max_mtu (default: 1500).

If you have high confidence your network can support an MTU larger than the default initial_mtu, you can set this to a higher value and immediately start using a larger MTU before the handshake completes. Any packet loss during the handshake suspected of being caused by this initial_mtu setting will cause the MTU to drop back to the base_mtu to allow the handshake to complete. MTU probing will then begin as usual when the handshake completes.

Note: initial_mtu must be >= base_mtu and <= max_mtu

source

pub fn with_base_mtu(self, base_mtu: u16) -> Result<Builder, Error>

Sets the smallest maximum transmission unit (MTU) to use when transmitting (default: 1228)

MTU is the size of the largest IP packet that can be transmitted on a path. This includes the size of the IP header, the size of the UDP header, and the size of the UDP payload containing the QUIC packet(s).

QUIC requires that a network path support at least a 1200 byte datagram size, which translates to 1228 bytes including the minimum IP header size (20 bytes) + UDP header size (8 bytes).

If you have high confidence your network can support an MTU larger than the default base_mtu, you can set this to a higher value. This will allow every packet s2n-quic transmits to reach this MTU, even if packet loss results in MTU probing failing. Only configure this value if it is certain the network path and peer can support the given base_mtu, as if it cannot support the base_mtu, connections will not be able to opened to or from the endpoint.

Note: base_mtu must be >= 1228 and <= initial_mtu and max_mtu

source

pub fn with_gso_disabled(self) -> Result<Builder, Error>

Disables Generic Segmentation Offload (GSO)

By default, GSO will be used unless the platform does not support it or an attempt to use GSO fails. If it is known that GSO is not available, set this option to explicitly disable it.

source

pub fn with_gso(self, enabled: bool) -> Result<Builder, Error>

Configures Generic Segmentation Offload (GSO)

By default, GSO will be used unless the platform does not support it or an attempt to use GSO fails. If it is known that GSO is not available, set this option to explicitly disable it.

source

pub fn with_gro_disabled(self) -> Result<Builder, Error>

Disables Generic Receive Offload (GRO)

By default, GRO will be used unless the platform does not support it. If it is known that GRO is not available, set this option to explicitly disable it.

source

pub fn with_gro(self, enabled: bool) -> Result<Builder, Error>

Configures Generic Receive Offload (GRO)

By default, GRO will be used unless the platform does not support it. If it is known that GRO is not available, set this option to explicitly disable it.

source

pub fn with_reuse_address(self, enabled: bool) -> Result<Builder, Error>

Enables the address reuse (SO_REUSEADDR) socket option

source

pub fn with_reuse_port(self) -> Result<Builder, Error>

Enables the port reuse (SO_REUSEPORT) socket option

source

pub fn build(self) -> Result<Io, Error>

Trait Implementations§

source§

impl Debug for Builder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Builder

source§

fn default() -> Builder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, U> Upcast<T> for U
where T: UpcastFrom<U>,

source§

fn upcast(self) -> T

source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

source§

fn upcast_from(value: Counter<T, B>) -> T

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V