Skip to main content

TransportConfig

Struct TransportConfig 

pub struct TransportConfig { /* private fields */ }
Available on crate features quic and std only.
Expand description

Parameters governing the core QUIC state machine

Default values should be suitable for most internet applications. Applications protocols which forbid remotely-initiated streams should set max_concurrent_bidi_streams and max_concurrent_uni_streams to zero.

In some cases, performance or resource requirements can be improved by tuning these values to suit a particular application and/or network connection. In particular, data window sizes can be tuned for a particular expected round trip time, link capacity, and memory availability. Tuning for higher bandwidths and latencies increases worst-case memory consumption, but does not impair performance at lower bandwidths and latencies. The default configuration is tuned for a 100Mbps link with a 100ms round trip time.

Implementations§

§

impl TransportConfig

pub fn with_max_concurrent_bidi_streams(self, value: VarInt) -> TransportConfig

Maximum number of incoming bidirectional streams that may be open concurrently

Must be nonzero for the peer to open any bidirectional streams.

Worst-case memory use is directly proportional to max_concurrent_bidi_streams * stream_receive_window, with an upper bound proportional to receive_window.

pub fn set_max_concurrent_bidi_streams( &mut self, value: VarInt, ) -> &mut TransportConfig

Maximum number of incoming bidirectional streams that may be open concurrently

Must be nonzero for the peer to open any bidirectional streams.

Worst-case memory use is directly proportional to max_concurrent_bidi_streams * stream_receive_window, with an upper bound proportional to receive_window.

pub fn with_max_concurrent_uni_streams(self, value: VarInt) -> TransportConfig

Variant of max_concurrent_bidi_streams affecting unidirectional streams

pub fn set_max_concurrent_uni_streams( &mut self, value: VarInt, ) -> &mut TransportConfig

Variant of max_concurrent_bidi_streams affecting unidirectional streams

pub fn maybe_with_max_idle_timeout( self, value: Option<IdleTimeout>, ) -> TransportConfig

Maximum duration of inactivity to accept before timing out the connection.

The true idle timeout is the minimum of this and the peer’s own max idle timeout. None represents an infinite timeout. Defaults to 30 seconds.

WARNING: If a peer or its network path malfunctions or acts maliciously, an infinite idle timeout can result in permanently hung futures!

let mut config = TransportConfig::default();

// Set the idle timeout as `VarInt`-encoded milliseconds
config.set_max_idle_timeout(VarInt::from(10_000u32).into());

// Set the idle timeout as a `Duration`
config.set_max_idle_timeout(Duration::from_secs(10).try_into()?);

pub fn maybe_set_max_idle_timeout( &mut self, value: Option<IdleTimeout>, ) -> &mut TransportConfig

Maximum duration of inactivity to accept before timing out the connection.

The true idle timeout is the minimum of this and the peer’s own max idle timeout. None represents an infinite timeout. Defaults to 30 seconds.

WARNING: If a peer or its network path malfunctions or acts maliciously, an infinite idle timeout can result in permanently hung futures!

let mut config = TransportConfig::default();

// Set the idle timeout as `VarInt`-encoded milliseconds
config.set_max_idle_timeout(VarInt::from(10_000u32).into());

// Set the idle timeout as a `Duration`
config.set_max_idle_timeout(Duration::from_secs(10).try_into()?);

pub fn with_max_idle_timeout(self, value: IdleTimeout) -> TransportConfig

Maximum duration of inactivity to accept before timing out the connection.

The true idle timeout is the minimum of this and the peer’s own max idle timeout. None represents an infinite timeout. Defaults to 30 seconds.

WARNING: If a peer or its network path malfunctions or acts maliciously, an infinite idle timeout can result in permanently hung futures!

let mut config = TransportConfig::default();

// Set the idle timeout as `VarInt`-encoded milliseconds
config.set_max_idle_timeout(VarInt::from(10_000u32).into());

// Set the idle timeout as a `Duration`
config.set_max_idle_timeout(Duration::from_secs(10).try_into()?);

pub fn set_max_idle_timeout( &mut self, value: IdleTimeout, ) -> &mut TransportConfig

Maximum duration of inactivity to accept before timing out the connection.

The true idle timeout is the minimum of this and the peer’s own max idle timeout. None represents an infinite timeout. Defaults to 30 seconds.

WARNING: If a peer or its network path malfunctions or acts maliciously, an infinite idle timeout can result in permanently hung futures!

let mut config = TransportConfig::default();

// Set the idle timeout as `VarInt`-encoded milliseconds
config.set_max_idle_timeout(VarInt::from(10_000u32).into());

// Set the idle timeout as a `Duration`
config.set_max_idle_timeout(Duration::from_secs(10).try_into()?);

pub fn without_max_idle_timeout(self) -> TransportConfig

Maximum duration of inactivity to accept before timing out the connection.

The true idle timeout is the minimum of this and the peer’s own max idle timeout. None represents an infinite timeout. Defaults to 30 seconds.

WARNING: If a peer or its network path malfunctions or acts maliciously, an infinite idle timeout can result in permanently hung futures!

let mut config = TransportConfig::default();

// Set the idle timeout as `VarInt`-encoded milliseconds
config.set_max_idle_timeout(VarInt::from(10_000u32).into());

// Set the idle timeout as a `Duration`
config.set_max_idle_timeout(Duration::from_secs(10).try_into()?);

pub fn unset_max_idle_timeout(&mut self) -> &mut TransportConfig

Maximum duration of inactivity to accept before timing out the connection.

The true idle timeout is the minimum of this and the peer’s own max idle timeout. None represents an infinite timeout. Defaults to 30 seconds.

WARNING: If a peer or its network path malfunctions or acts maliciously, an infinite idle timeout can result in permanently hung futures!

let mut config = TransportConfig::default();

// Set the idle timeout as `VarInt`-encoded milliseconds
config.set_max_idle_timeout(VarInt::from(10_000u32).into());

// Set the idle timeout as a `Duration`
config.set_max_idle_timeout(Duration::from_secs(10).try_into()?);

pub fn with_stream_receive_window(self, value: VarInt) -> TransportConfig

Maximum number of bytes the peer may transmit without acknowledgement on any one stream before becoming blocked.

This should be set to at least the expected connection latency multiplied by the maximum desired throughput. Setting this smaller than receive_window helps ensure that a single stream doesn’t monopolize receive buffers, which may otherwise occur if the application chooses not to read from a large stream for a time while still requiring data on other streams.

pub fn set_stream_receive_window( &mut self, value: VarInt, ) -> &mut TransportConfig

Maximum number of bytes the peer may transmit without acknowledgement on any one stream before becoming blocked.

This should be set to at least the expected connection latency multiplied by the maximum desired throughput. Setting this smaller than receive_window helps ensure that a single stream doesn’t monopolize receive buffers, which may otherwise occur if the application chooses not to read from a large stream for a time while still requiring data on other streams.

pub fn with_receive_window(self, value: VarInt) -> TransportConfig

Maximum number of bytes the peer may transmit across all streams of a connection before becoming blocked.

This should be set to at least the expected connection latency multiplied by the maximum desired throughput. Larger values can be useful to allow maximum throughput within a stream while another is blocked.

pub fn set_receive_window(&mut self, value: VarInt) -> &mut TransportConfig

Maximum number of bytes the peer may transmit across all streams of a connection before becoming blocked.

This should be set to at least the expected connection latency multiplied by the maximum desired throughput. Larger values can be useful to allow maximum throughput within a stream while another is blocked.

pub fn with_send_window(self, value: u64) -> TransportConfig

Maximum number of bytes to transmit to a peer without acknowledgment

Provides an upper bound on memory when communicating with peers that issue large amounts of flow control credit. Endpoints that wish to handle large numbers of connections robustly should take care to set this low enough to guarantee memory exhaustion does not occur if every connection uses the entire window.

pub fn set_send_window(&mut self, value: u64) -> &mut TransportConfig

Maximum number of bytes to transmit to a peer without acknowledgment

Provides an upper bound on memory when communicating with peers that issue large amounts of flow control credit. Endpoints that wish to handle large numbers of connections robustly should take care to set this low enough to guarantee memory exhaustion does not occur if every connection uses the entire window.

pub fn with_send_fairness(self, value: bool) -> TransportConfig

Whether to implement fair queuing for send streams having the same priority.

When enabled, connections schedule data from outgoing streams having the same priority in a round-robin fashion. When disabled, streams are scheduled in the order they are written to.

Note that this only affects streams with the same priority. Higher priority streams always take precedence over lower priority streams.

Disabling fairness can reduce fragmentation and protocol overhead for workloads that use many small streams.

pub fn set_send_fairness(&mut self, value: bool) -> &mut TransportConfig

Whether to implement fair queuing for send streams having the same priority.

When enabled, connections schedule data from outgoing streams having the same priority in a round-robin fashion. When disabled, streams are scheduled in the order they are written to.

Note that this only affects streams with the same priority. Higher priority streams always take precedence over lower priority streams.

Disabling fairness can reduce fragmentation and protocol overhead for workloads that use many small streams.

pub fn with_packet_threshold(self, value: u32) -> TransportConfig

Maximum reordering in packet number space before FACK style loss detection considers a packet lost. Should not be less than 3, per RFC5681.

pub fn set_packet_threshold(&mut self, value: u32) -> &mut TransportConfig

Maximum reordering in packet number space before FACK style loss detection considers a packet lost. Should not be less than 3, per RFC5681.

pub fn try_with_time_threshold( self, value: f32, ) -> Result<TransportConfig, ConfigError>

Maximum reordering in time space before time based loss detection considers a packet lost, as a factor of RTT. Must be finite and nonnegative; the resulting duration is at least the timer granularity. Defaults to 9/8.

pub fn try_set_time_threshold( &mut self, value: f32, ) -> Result<&mut TransportConfig, ConfigError>

Maximum reordering in time space before time based loss detection considers a packet lost, as a factor of RTT. Must be finite and nonnegative; the resulting duration is at least the timer granularity. Defaults to 9/8.

pub fn with_initial_rtt(self, value: Duration) -> TransportConfig

The RTT used before an RTT sample is taken

pub fn set_initial_rtt(&mut self, value: Duration) -> &mut TransportConfig

The RTT used before an RTT sample is taken

pub fn with_initial_mtu(self, value: u16) -> TransportConfig

The initial value to be used as the maximum UDP payload size before running MTU discovery (see TransportConfig::mtu_discovery_config).

Must be at least 1200, which is the default, and known to be safe for typical internet applications. Larger values are more efficient, but increase the risk of packet loss due to exceeding the network path’s IP MTU. If the provided value is higher than what the network path actually supports, packet loss will eventually trigger black hole detection and bring it down to TransportConfig::min_mtu.

pub fn set_initial_mtu(&mut self, value: u16) -> &mut TransportConfig

The initial value to be used as the maximum UDP payload size before running MTU discovery (see TransportConfig::mtu_discovery_config).

Must be at least 1200, which is the default, and known to be safe for typical internet applications. Larger values are more efficient, but increase the risk of packet loss due to exceeding the network path’s IP MTU. If the provided value is higher than what the network path actually supports, packet loss will eventually trigger black hole detection and bring it down to TransportConfig::min_mtu.

pub fn with_min_mtu(self, value: u16) -> TransportConfig

The maximum UDP payload size guaranteed to be supported by the network.

Must be at least 1200, which is the default, and lower than or equal to TransportConfig::set_initial_mtu.

Real-world MTUs can vary according to ISP, VPN, and properties of intermediate network links outside of either endpoint’s control. Extreme care should be used when raising this value outside of private networks where these factors are fully controlled. If the provided value is higher than what the network path actually supports, the result will be unpredictable and catastrophic packet loss, without a possibility of repair. Prefer TransportConfig::set_initial_mtu together with TransportConfig::mtu_discovery_config to set a maximum UDP payload size that robustly adapts to the network.

pub fn set_min_mtu(&mut self, value: u16) -> &mut TransportConfig

The maximum UDP payload size guaranteed to be supported by the network.

Must be at least 1200, which is the default, and lower than or equal to TransportConfig::set_initial_mtu.

Real-world MTUs can vary according to ISP, VPN, and properties of intermediate network links outside of either endpoint’s control. Extreme care should be used when raising this value outside of private networks where these factors are fully controlled. If the provided value is higher than what the network path actually supports, the result will be unpredictable and catastrophic packet loss, without a possibility of repair. Prefer TransportConfig::set_initial_mtu together with TransportConfig::mtu_discovery_config to set a maximum UDP payload size that robustly adapts to the network.

pub fn maybe_with_mtu_discovery_config( self, value: Option<MtuDiscoveryConfig>, ) -> TransportConfig

Specifies the MTU discovery config (see MtuDiscoveryConfig for details).

Enabled by default.

pub fn maybe_set_mtu_discovery_config( &mut self, value: Option<MtuDiscoveryConfig>, ) -> &mut TransportConfig

Specifies the MTU discovery config (see MtuDiscoveryConfig for details).

Enabled by default.

pub fn with_mtu_discovery_config( self, value: MtuDiscoveryConfig, ) -> TransportConfig

Specifies the MTU discovery config (see MtuDiscoveryConfig for details).

Enabled by default.

pub fn set_mtu_discovery_config( &mut self, value: MtuDiscoveryConfig, ) -> &mut TransportConfig

Specifies the MTU discovery config (see MtuDiscoveryConfig for details).

Enabled by default.

pub fn without_mtu_discovery_config(self) -> TransportConfig

Specifies the MTU discovery config (see MtuDiscoveryConfig for details).

Enabled by default.

pub fn unset_mtu_discovery_config(&mut self) -> &mut TransportConfig

Specifies the MTU discovery config (see MtuDiscoveryConfig for details).

Enabled by default.

pub fn with_pad_to_mtu(self, value: bool) -> TransportConfig

Pad UDP datagrams carrying application data to current maximum UDP payload size

Disabled by default. UDP datagrams containing loss probes are exempt from padding.

Enabling this helps mitigate traffic analysis by network observers, but it increases bandwidth usage. Without this mitigation precise plain text size of application datagrams as well as the total size of stream write bursts can be inferred by observers under certain conditions. This analysis requires either an uncongested connection or application datagrams too large to be coalesced.

pub fn set_pad_to_mtu(&mut self, value: bool) -> &mut TransportConfig

Pad UDP datagrams carrying application data to current maximum UDP payload size

Disabled by default. UDP datagrams containing loss probes are exempt from padding.

Enabling this helps mitigate traffic analysis by network observers, but it increases bandwidth usage. Without this mitigation precise plain text size of application datagrams as well as the total size of stream write bursts can be inferred by observers under certain conditions. This analysis requires either an uncongested connection or application datagrams too large to be coalesced.

pub fn maybe_with_ack_frequency_config( self, value: Option<AckFrequencyConfig>, ) -> TransportConfig

Specifies the ACK frequency config (see AckFrequencyConfig for details)

The provided configuration will be ignored if the peer does not support the acknowledgement frequency QUIC extension.

Defaults to None, which disables controlling the peer’s acknowledgement frequency. Even if set to None, the local side still supports the acknowledgement frequency QUIC extension and may use it in other ways.

pub fn maybe_set_ack_frequency_config( &mut self, value: Option<AckFrequencyConfig>, ) -> &mut TransportConfig

Specifies the ACK frequency config (see AckFrequencyConfig for details)

The provided configuration will be ignored if the peer does not support the acknowledgement frequency QUIC extension.

Defaults to None, which disables controlling the peer’s acknowledgement frequency. Even if set to None, the local side still supports the acknowledgement frequency QUIC extension and may use it in other ways.

pub fn with_ack_frequency_config( self, value: AckFrequencyConfig, ) -> TransportConfig

Specifies the ACK frequency config (see AckFrequencyConfig for details)

The provided configuration will be ignored if the peer does not support the acknowledgement frequency QUIC extension.

Defaults to None, which disables controlling the peer’s acknowledgement frequency. Even if set to None, the local side still supports the acknowledgement frequency QUIC extension and may use it in other ways.

pub fn set_ack_frequency_config( &mut self, value: AckFrequencyConfig, ) -> &mut TransportConfig

Specifies the ACK frequency config (see AckFrequencyConfig for details)

The provided configuration will be ignored if the peer does not support the acknowledgement frequency QUIC extension.

Defaults to None, which disables controlling the peer’s acknowledgement frequency. Even if set to None, the local side still supports the acknowledgement frequency QUIC extension and may use it in other ways.

pub fn without_ack_frequency_config(self) -> TransportConfig

Specifies the ACK frequency config (see AckFrequencyConfig for details)

The provided configuration will be ignored if the peer does not support the acknowledgement frequency QUIC extension.

Defaults to None, which disables controlling the peer’s acknowledgement frequency. Even if set to None, the local side still supports the acknowledgement frequency QUIC extension and may use it in other ways.

pub fn unset_ack_frequency_config(&mut self) -> &mut TransportConfig

Specifies the ACK frequency config (see AckFrequencyConfig for details)

The provided configuration will be ignored if the peer does not support the acknowledgement frequency QUIC extension.

Defaults to None, which disables controlling the peer’s acknowledgement frequency. Even if set to None, the local side still supports the acknowledgement frequency QUIC extension and may use it in other ways.

pub fn with_persistent_congestion_threshold(self, value: u32) -> TransportConfig

Number of consecutive PTOs after which network is considered to be experiencing persistent congestion.

pub fn set_persistent_congestion_threshold( &mut self, value: u32, ) -> &mut TransportConfig

Number of consecutive PTOs after which network is considered to be experiencing persistent congestion.

pub fn maybe_with_keep_alive_interval( self, value: Option<Duration>, ) -> TransportConfig

Period of inactivity before sending a keep-alive packet

Keep-alive packets prevent an inactive but otherwise healthy connection from timing out.

None to disable, which is the default. Only one side of any given connection needs keep-alive enabled for the connection to be preserved. Must be set lower than the idle_timeout of both peers to be effective.

pub fn maybe_set_keep_alive_interval( &mut self, value: Option<Duration>, ) -> &mut TransportConfig

Period of inactivity before sending a keep-alive packet

Keep-alive packets prevent an inactive but otherwise healthy connection from timing out.

None to disable, which is the default. Only one side of any given connection needs keep-alive enabled for the connection to be preserved. Must be set lower than the idle_timeout of both peers to be effective.

pub fn with_keep_alive_interval(self, value: Duration) -> TransportConfig

Period of inactivity before sending a keep-alive packet

Keep-alive packets prevent an inactive but otherwise healthy connection from timing out.

None to disable, which is the default. Only one side of any given connection needs keep-alive enabled for the connection to be preserved. Must be set lower than the idle_timeout of both peers to be effective.

pub fn set_keep_alive_interval( &mut self, value: Duration, ) -> &mut TransportConfig

Period of inactivity before sending a keep-alive packet

Keep-alive packets prevent an inactive but otherwise healthy connection from timing out.

None to disable, which is the default. Only one side of any given connection needs keep-alive enabled for the connection to be preserved. Must be set lower than the idle_timeout of both peers to be effective.

pub fn without_keep_alive_interval(self) -> TransportConfig

Period of inactivity before sending a keep-alive packet

Keep-alive packets prevent an inactive but otherwise healthy connection from timing out.

None to disable, which is the default. Only one side of any given connection needs keep-alive enabled for the connection to be preserved. Must be set lower than the idle_timeout of both peers to be effective.

pub fn unset_keep_alive_interval(&mut self) -> &mut TransportConfig

Period of inactivity before sending a keep-alive packet

Keep-alive packets prevent an inactive but otherwise healthy connection from timing out.

None to disable, which is the default. Only one side of any given connection needs keep-alive enabled for the connection to be preserved. Must be set lower than the idle_timeout of both peers to be effective.

pub fn with_crypto_buffer_size(self, value: usize) -> TransportConfig

Maximum quantity of out-of-order crypto layer data to buffer

pub fn set_crypto_buffer_size(&mut self, value: usize) -> &mut TransportConfig

Maximum quantity of out-of-order crypto layer data to buffer

pub fn with_allow_spin(self, value: bool) -> TransportConfig

Whether the implementation is permitted to set the spin bit on this connection

This allows passive observers to easily judge the round trip time of a connection, which can be useful for network administration but sacrifices a small amount of privacy.

pub fn set_allow_spin(&mut self, value: bool) -> &mut TransportConfig

Whether the implementation is permitted to set the spin bit on this connection

This allows passive observers to easily judge the round trip time of a connection, which can be useful for network administration but sacrifices a small amount of privacy.

pub fn maybe_with_datagram_receive_buffer_size( self, value: Option<usize>, ) -> TransportConfig

Maximum number of incoming application datagram bytes to buffer, or None to disable incoming datagrams

The peer is forbidden to send single datagrams larger than this size. If the aggregate size of all datagrams that have been received from the peer but not consumed by the application exceeds this value, old datagrams are dropped until it is no longer exceeded.

The amount of payload data buffered may be smaller than value due to overhead.

pub fn maybe_set_datagram_receive_buffer_size( &mut self, value: Option<usize>, ) -> &mut TransportConfig

Maximum number of incoming application datagram bytes to buffer, or None to disable incoming datagrams

The peer is forbidden to send single datagrams larger than this size. If the aggregate size of all datagrams that have been received from the peer but not consumed by the application exceeds this value, old datagrams are dropped until it is no longer exceeded.

The amount of payload data buffered may be smaller than value due to overhead.

pub fn with_datagram_receive_buffer_size(self, value: usize) -> TransportConfig

Maximum number of incoming application datagram bytes to buffer, or None to disable incoming datagrams

The peer is forbidden to send single datagrams larger than this size. If the aggregate size of all datagrams that have been received from the peer but not consumed by the application exceeds this value, old datagrams are dropped until it is no longer exceeded.

The amount of payload data buffered may be smaller than value due to overhead.

pub fn set_datagram_receive_buffer_size( &mut self, value: usize, ) -> &mut TransportConfig

Maximum number of incoming application datagram bytes to buffer, or None to disable incoming datagrams

The peer is forbidden to send single datagrams larger than this size. If the aggregate size of all datagrams that have been received from the peer but not consumed by the application exceeds this value, old datagrams are dropped until it is no longer exceeded.

The amount of payload data buffered may be smaller than value due to overhead.

pub fn without_datagram_receive_buffer_size(self) -> TransportConfig

Maximum number of incoming application datagram bytes to buffer, or None to disable incoming datagrams

The peer is forbidden to send single datagrams larger than this size. If the aggregate size of all datagrams that have been received from the peer but not consumed by the application exceeds this value, old datagrams are dropped until it is no longer exceeded.

The amount of payload data buffered may be smaller than value due to overhead.

pub fn unset_datagram_receive_buffer_size(&mut self) -> &mut TransportConfig

Maximum number of incoming application datagram bytes to buffer, or None to disable incoming datagrams

The peer is forbidden to send single datagrams larger than this size. If the aggregate size of all datagrams that have been received from the peer but not consumed by the application exceeds this value, old datagrams are dropped until it is no longer exceeded.

The amount of payload data buffered may be smaller than value due to overhead.

pub fn with_datagram_send_buffer_size(self, value: usize) -> TransportConfig

Maximum number of outgoing application datagram bytes to buffer

While datagrams are sent ASAP, it is possible for an application to generate data faster than the link, or even the underlying hardware, can transmit them. This limits the amount of memory that may be consumed in that case. When the send buffer is full and a new datagram is sent, older datagrams are dropped until sufficient space is available.

The amount of payload data buffered may be smaller than value due to overhead.

pub fn set_datagram_send_buffer_size( &mut self, value: usize, ) -> &mut TransportConfig

Maximum number of outgoing application datagram bytes to buffer

While datagrams are sent ASAP, it is possible for an application to generate data faster than the link, or even the underlying hardware, can transmit them. This limits the amount of memory that may be consumed in that case. When the send buffer is full and a new datagram is sent, older datagrams are dropped until sufficient space is available.

The amount of payload data buffered may be smaller than value due to overhead.

pub fn with_congestion_control( self, value: CongestionControl, ) -> TransportConfig

Which congestion controller connections use.

Defaults to CongestionControl::Cubic.

pub fn set_congestion_control( &mut self, value: CongestionControl, ) -> &mut TransportConfig

Which congestion controller connections use.

Defaults to CongestionControl::Cubic.

pub fn try_maybe_with_initial_congestion_window( self, value: Option<u64>, ) -> Result<TransportConfig, ConfigError>

Limit on the data in flight before the first acknowledgement, in bytes.

None, the default, leaves each controller the window it computes from the 1200-byte datagram size QUIC guarantees (RFC 9000 §14.1), not from the configured MTU: CUBIC and NewReno start from the value RFC 9002 §7.2 recommends for that size, and BBR starts higher.

Fails below MIN_INITIAL_CONGESTION_WINDOW, which includes zero.

pub fn try_maybe_set_initial_congestion_window( &mut self, value: Option<u64>, ) -> Result<&mut TransportConfig, ConfigError>

Limit on the data in flight before the first acknowledgement, in bytes.

None, the default, leaves each controller the window it computes from the 1200-byte datagram size QUIC guarantees (RFC 9000 §14.1), not from the configured MTU: CUBIC and NewReno start from the value RFC 9002 §7.2 recommends for that size, and BBR starts higher.

Fails below MIN_INITIAL_CONGESTION_WINDOW, which includes zero.

pub fn try_with_initial_congestion_window( self, value: u64, ) -> Result<TransportConfig, ConfigError>

Limit on the data in flight before the first acknowledgement, in bytes.

None, the default, leaves each controller the window it computes from the 1200-byte datagram size QUIC guarantees (RFC 9000 §14.1), not from the configured MTU: CUBIC and NewReno start from the value RFC 9002 §7.2 recommends for that size, and BBR starts higher.

Fails below MIN_INITIAL_CONGESTION_WINDOW, which includes zero.

pub fn try_set_initial_congestion_window( &mut self, value: u64, ) -> Result<&mut TransportConfig, ConfigError>

Limit on the data in flight before the first acknowledgement, in bytes.

None, the default, leaves each controller the window it computes from the 1200-byte datagram size QUIC guarantees (RFC 9000 §14.1), not from the configured MTU: CUBIC and NewReno start from the value RFC 9002 §7.2 recommends for that size, and BBR starts higher.

Fails below MIN_INITIAL_CONGESTION_WINDOW, which includes zero.

pub fn try_without_initial_congestion_window( self, ) -> Result<TransportConfig, ConfigError>

Limit on the data in flight before the first acknowledgement, in bytes.

None, the default, leaves each controller the window it computes from the 1200-byte datagram size QUIC guarantees (RFC 9000 §14.1), not from the configured MTU: CUBIC and NewReno start from the value RFC 9002 §7.2 recommends for that size, and BBR starts higher.

Fails below MIN_INITIAL_CONGESTION_WINDOW, which includes zero.

pub fn try_unset_initial_congestion_window( &mut self, ) -> Result<&mut TransportConfig, ConfigError>

Limit on the data in flight before the first acknowledgement, in bytes.

None, the default, leaves each controller the window it computes from the 1200-byte datagram size QUIC guarantees (RFC 9000 §14.1), not from the configured MTU: CUBIC and NewReno start from the value RFC 9002 §7.2 recommends for that size, and BBR starts higher.

Fails below MIN_INITIAL_CONGESTION_WINDOW, which includes zero.

pub fn with_enable_segmentation_offload(self, enabled: bool) -> TransportConfig

Whether to use “Generic Segmentation Offload” to accelerate transmits, when supported by the environment

Defaults to true.

GSO dramatically reduces CPU consumption when sending large numbers of packets with the same headers, such as when transmitting bulk data on a connection. However, it is not supported by all network interface drivers or packet inspection tools. The UDP layer will attempt to disable GSO automatically when unavailable, but this can lead to spurious packet loss at startup, temporarily degrading performance.

pub fn set_enable_segmentation_offload( &mut self, enabled: bool, ) -> &mut TransportConfig

Whether to use “Generic Segmentation Offload” to accelerate transmits, when supported by the environment

Defaults to true.

GSO dramatically reduces CPU consumption when sending large numbers of packets with the same headers, such as when transmitting bulk data on a connection. However, it is not supported by all network interface drivers or packet inspection tools. The UDP layer will attempt to disable GSO automatically when unavailable, but this can lead to spurious packet loss at startup, temporarily degrading performance.

pub fn maybe_with_qlog_recorder( self, recorder: Option<QlogRecorder>, ) -> TransportConfig

Attach an explicitly started recorder. Call QlogConfig::start first to handle configuration/runtime errors. Replaces the previously configured sink. Retain a handle to inspect failures, trigger history, or await completion.

pub fn maybe_set_qlog_recorder( &mut self, recorder: Option<QlogRecorder>, ) -> &mut TransportConfig

Attach an explicitly started recorder. Call QlogConfig::start first to handle configuration/runtime errors. Replaces the previously configured sink. Retain a handle to inspect failures, trigger history, or await completion.

pub fn with_qlog_recorder(self, recorder: QlogRecorder) -> TransportConfig

Attach an explicitly started recorder. Call QlogConfig::start first to handle configuration/runtime errors. Replaces the previously configured sink. Retain a handle to inspect failures, trigger history, or await completion.

pub fn set_qlog_recorder( &mut self, recorder: QlogRecorder, ) -> &mut TransportConfig

Attach an explicitly started recorder. Call QlogConfig::start first to handle configuration/runtime errors. Replaces the previously configured sink. Retain a handle to inspect failures, trigger history, or await completion.

pub fn without_qlog_recorder(self) -> TransportConfig

Attach an explicitly started recorder. Call QlogConfig::start first to handle configuration/runtime errors. Replaces the previously configured sink. Retain a handle to inspect failures, trigger history, or await completion.

pub fn unset_qlog_recorder(&mut self) -> &mut TransportConfig

Attach an explicitly started recorder. Call QlogConfig::start first to handle configuration/runtime errors. Replaces the previously configured sink. Retain a handle to inspect failures, trigger history, or await completion.

pub fn maybe_with_qlog_sink( self, sink: Option<Arc<dyn QlogSink>>, ) -> TransportConfig

Observe borrowed events inline. Sink callbacks run inside the transport state machine and must be cheap and nonblocking. Use qlog_recorder for background output, or compose a recorder with a lightweight sink as (recorder, sink). Replaces the previously configured sink; unset_qlog_sink detaches diagnostics.

pub fn maybe_set_qlog_sink( &mut self, sink: Option<Arc<dyn QlogSink>>, ) -> &mut TransportConfig

Observe borrowed events inline. Sink callbacks run inside the transport state machine and must be cheap and nonblocking. Use qlog_recorder for background output, or compose a recorder with a lightweight sink as (recorder, sink). Replaces the previously configured sink; unset_qlog_sink detaches diagnostics.

pub fn with_qlog_sink(self, sink: Arc<dyn QlogSink>) -> TransportConfig

Observe borrowed events inline. Sink callbacks run inside the transport state machine and must be cheap and nonblocking. Use qlog_recorder for background output, or compose a recorder with a lightweight sink as (recorder, sink). Replaces the previously configured sink; unset_qlog_sink detaches diagnostics.

pub fn set_qlog_sink(&mut self, sink: Arc<dyn QlogSink>) -> &mut TransportConfig

Observe borrowed events inline. Sink callbacks run inside the transport state machine and must be cheap and nonblocking. Use qlog_recorder for background output, or compose a recorder with a lightweight sink as (recorder, sink). Replaces the previously configured sink; unset_qlog_sink detaches diagnostics.

pub fn without_qlog_sink(self) -> TransportConfig

Observe borrowed events inline. Sink callbacks run inside the transport state machine and must be cheap and nonblocking. Use qlog_recorder for background output, or compose a recorder with a lightweight sink as (recorder, sink). Replaces the previously configured sink; unset_qlog_sink detaches diagnostics.

pub fn unset_qlog_sink(&mut self) -> &mut TransportConfig

Observe borrowed events inline. Sink callbacks run inside the transport state machine and must be cheap and nonblocking. Use qlog_recorder for background output, or compose a recorder with a lightweight sink as (recorder, sink). Replaces the previously configured sink; unset_qlog_sink detaches diagnostics.

Trait Implementations§

§

impl Debug for TransportConfig

§

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

Formats the value using the given formatter. Read more
§

impl Default for TransportConfig

§

fn default() -> TransportConfig

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a rama_grpc::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
§

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

§

fn rama_from(value: T) -> U

§

impl<T, U, CrateMarker> RamaInto<U, CrateMarker> for T
where U: RamaFrom<T, CrateMarker>,

§

fn rama_into(self) -> U

§

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

§

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

§

fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>

§

impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for T
where U: RamaTryFrom<T, CrateMarker>,

§

type Error = <U as RamaTryFrom<T, CrateMarker>>::Error

§

fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.
§

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

§

fn vzip(self) -> V

§

impl<V, F> ValueFormatter<&V> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &&V)

Write value to writer
§

impl<V, F> ValueFormatter<Arc<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &Arc<V>)

Write value to writer
§

impl<V, F> ValueFormatter<Box<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &Box<V>)

Write value to writer
§

impl<V, F> ValueFormatter<Cow<'_, V>> for F
where V: ToOwned + ?Sized, F: ValueFormatter<V> + ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)

Write value to writer
§

impl<V, F> ValueFormatter<Option<V>> for F
where F: ValueFormatter<V> + ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &Option<V>)

Write value to writer
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more