pub struct Config {
pub supported_versions: Vec<u16>,
pub features: Features,
pub open_timeout: Duration,
pub stream_bind_timeout: Duration,
pub negotiation_timeout: Duration,
pub max_inflight_opens: usize,
pub max_concurrent_streams: usize,
pub ping_interval: Option<Duration>,
pub ping_timeout: Duration,
pub agent: Option<String>,
}Expand description
Configuration for a quic-reverse session.
Fields§
§supported_versions: Vec<u16>Protocol versions supported by this session, in preference order.
The highest mutually supported version will be selected during negotiation.
features: FeaturesFeature flags to advertise during negotiation.
The intersection of both peers’ features will be used.
open_timeout: DurationTimeout for open requests awaiting a response.
If no OpenResponse is received within this duration, the request fails.
stream_bind_timeout: DurationTimeout for binding a stream after receiving an accepted OpenResponse.
If no stream with the matching logical stream ID arrives within this duration, the request fails.
negotiation_timeout: DurationTimeout for the entire negotiation handshake.
If negotiation doesn’t complete within this duration, the session fails.
max_inflight_opens: usizeMaximum number of pending open requests.
Attempts to open more streams than this limit will block until existing requests complete.
max_concurrent_streams: usizeMaximum number of concurrent active streams.
New open requests will be rejected if this limit is reached.
ping_interval: Option<Duration>Optional ping interval for keep-alive.
If set, Ping messages will be sent at this interval when no
other traffic is occurring. Requires the PING_PONG feature.
ping_timeout: DurationTimeout for ping responses.
If a Pong is not received within this duration after sending a Ping,
the ping is considered failed. Defaults to 10 seconds.
agent: Option<String>Agent identifier sent in Hello messages.
This is optional and used for debugging and diagnostics.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_versions(self, versions: Vec<u16>) -> Self
pub fn with_versions(self, versions: Vec<u16>) -> Self
Sets the supported protocol versions.
Sourcepub const fn with_features(self, features: Features) -> Self
pub const fn with_features(self, features: Features) -> Self
Sets the feature flags.
Sourcepub const fn with_open_timeout(self, timeout: Duration) -> Self
pub const fn with_open_timeout(self, timeout: Duration) -> Self
Sets the open request timeout.
Sourcepub const fn with_stream_bind_timeout(self, timeout: Duration) -> Self
pub const fn with_stream_bind_timeout(self, timeout: Duration) -> Self
Sets the stream binding timeout.
Sourcepub const fn with_negotiation_timeout(self, timeout: Duration) -> Self
pub const fn with_negotiation_timeout(self, timeout: Duration) -> Self
Sets the negotiation timeout.
Sourcepub const fn with_max_inflight_opens(self, max: usize) -> Self
pub const fn with_max_inflight_opens(self, max: usize) -> Self
Sets the maximum number of inflight open requests.
Sourcepub const fn with_max_concurrent_streams(self, max: usize) -> Self
pub const fn with_max_concurrent_streams(self, max: usize) -> Self
Sets the maximum number of concurrent streams.
Sourcepub fn with_ping_interval(self, interval: Duration) -> Self
pub fn with_ping_interval(self, interval: Duration) -> Self
Sets the ping interval for keep-alive.
Sourcepub const fn with_ping_timeout(self, timeout: Duration) -> Self
pub const fn with_ping_timeout(self, timeout: Duration) -> Self
Sets the ping timeout.
Sourcepub fn with_agent(self, agent: impl Into<String>) -> Self
pub fn with_agent(self, agent: impl Into<String>) -> Self
Sets the agent identifier.