pub struct Config {
pub initial_stream_window: u32,
pub max_frame_size: u32,
pub max_streams: usize,
pub keepalive_interval: Option<Duration>,
pub keepalive_timeout: Duration,
pub open_timeout: Duration,
}Expand description
Tunable parameters for a Session.
Build via Config::builder or take Config::default for sensible
defaults. Once a Session is constructed the configuration is immutable.
Fields§
§initial_stream_window: u32Initial credit (in bytes) granted to each newly-opened receive stream. Doubles as the maximum amount of pending unread data the session will buffer per stream before exerting back-pressure on the peer.
max_frame_size: u32Hard upper bound on the payload of a single Data frame. Larger user
writes are transparently fragmented.
max_streams: usizeHard cap on concurrently open streams. Attempts to exceed this raise
Error::TooManyStreams.
keepalive_interval: Option<Duration>Interval between automatic Ping frames. None disables keepalive.
keepalive_timeout: DurationHow long to wait for a Ping reply before declaring the session dead.
open_timeout: DurationMaximum time Session::open will wait for the peer’s ACK.
Implementations§
Source§impl Config
impl Config
Sourcepub const DEFAULT_INITIAL_STREAM_WINDOW: u32
pub const DEFAULT_INITIAL_STREAM_WINDOW: u32
Default initial per-stream window: 256 KiB.
Sourcepub const DEFAULT_MAX_FRAME_SIZE: u32
pub const DEFAULT_MAX_FRAME_SIZE: u32
Default maximum single-frame payload: 64 KiB.
Sourcepub const DEFAULT_MAX_STREAMS: usize = 1024
pub const DEFAULT_MAX_STREAMS: usize = 1024
Default maximum concurrent streams: 1024.
Sourcepub const DEFAULT_KEEPALIVE_INTERVAL: Duration
pub const DEFAULT_KEEPALIVE_INTERVAL: Duration
Default keepalive interval: 30 seconds.
Sourcepub const DEFAULT_KEEPALIVE_TIMEOUT: Duration
pub const DEFAULT_KEEPALIVE_TIMEOUT: Duration
Default keepalive timeout: 30 seconds.
Sourcepub const DEFAULT_OPEN_TIMEOUT: Duration
pub const DEFAULT_OPEN_TIMEOUT: Duration
Default open timeout: 10 seconds.
Sourcepub fn builder() -> ConfigBuilder
pub fn builder() -> ConfigBuilder
Start a new builder using the default configuration.