pub struct Config {
pub scheme: &'static str,
pub default_port: u16,
pub handshake: Handshake,
pub hello_style: HelloStyle,
pub push: PushPolicy,
pub max_frame_bytes: usize,
pub max_in_flight: usize,
pub error_codes: ErrorConvention,
pub tls: TlsPolicy,
}Expand description
One application’s protocol configuration (PRO-001).
Configs are data, never behavior: no config may alter wire bytes
(PRO-003) — it selects among behaviors Thunder already implements.
Construct with Config::standard and the builder, or as a plain
struct literal; both are supported and neither requires a Thunder
release.
Fields§
§scheme: &'static strURL scheme the endpoint parser registers for this application (PRO-012). Identity — Thunder has no default for it.
default_port: u16Default RPC port for the scheme (PRO-012). Identity — Thunder has no default for it.
handshake: HandshakeHandshake style.
hello_style: HelloStyleHELLO payload style.
push: PushPolicyServer-push policy.
max_frame_bytes: usizeFrame cap (WIRE-020).
max_in_flight: usizePer-connection in-flight request bound (CLT-012 / SRV-003).
error_codes: ErrorConventionError-string conventions the client parses.
tls: TlsPolicyTransport-security policy.
Implementations§
Source§impl Config
impl Config
Sourcepub const fn standard() -> Self
pub const fn standard() -> Self
The family standard (pinned by conformance/standard.yaml).
Mandatory HELLO map with proto negotiation and a capabilities
reply; the [CODE] error superset; 64 MiB frames; 256 in-flight;
push reserved; TLS off.
scheme is "" and default_port is 0 — identity is the
application’s to supply, and a Config that never sets them is only
usable with an explicit host:port endpoint.
Sourcepub const fn scheme(self, scheme: &'static str) -> Self
pub const fn scheme(self, scheme: &'static str) -> Self
Set the URL scheme this application answers on (PRO-012).
Sourcepub const fn hello_style(self, hello_style: HelloStyle) -> Self
pub const fn hello_style(self, hello_style: HelloStyle) -> Self
Override the HELLO payload style.
Sourcepub const fn push(self, push: PushPolicy) -> Self
pub const fn push(self, push: PushPolicy) -> Self
Override the server-push policy.
Sourcepub const fn max_frame_bytes(self, max_frame_bytes: usize) -> Self
pub const fn max_frame_bytes(self, max_frame_bytes: usize) -> Self
Override the frame cap (WIRE-020).
Sourcepub const fn max_in_flight(self, max_in_flight: usize) -> Self
pub const fn max_in_flight(self, max_in_flight: usize) -> Self
Override the per-connection in-flight bound.
Sourcepub const fn error_codes(self, error_codes: ErrorConvention) -> Self
pub const fn error_codes(self, error_codes: ErrorConvention) -> Self
Override the error-string conventions parsed.