pub struct ServeConfig {
pub bridge: BridgeConfig,
pub idle_timeout: Option<Duration>,
}Expand description
Configuration for serve_h2_with_config: the WebSocket BridgeConfig
plus an optional HTTP/2 idle timeout.
Fields§
§bridge: BridgeConfigWebSocket bridge configuration (keepalive, control frames, close hooks).
ServeConfig::default uses BridgeConfig::default — keepalive on.
idle_timeout: Option<Duration>If Some, gracefully close the connection — an HTTP/2 GOAWAY, then the
WebSocket close — once it has had no open HTTP/2 streams for this long,
reaping a tunnel that is healthy but idle.
This is distinct from keepalive (BridgeConfig::keepalive), which
detects a dead peer: a client that dutifully answers keepalive pings but
opens no streams for idle_timeout is still reaped. WebSocket and HTTP/2
pings are not activity — only streams reset the timer. None (the
default) never reaps on idle, matching hyper.
Trait Implementations§
Source§impl Default for ServeConfig
impl Default for ServeConfig
Source§fn default() -> ServeConfig
fn default() -> ServeConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ServeConfig
impl !Sync for ServeConfig
impl !UnwindSafe for ServeConfig
impl Freeze for ServeConfig
impl Send for ServeConfig
impl Unpin for ServeConfig
impl UnsafeUnpin for ServeConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more