Skip to main content

Config

Struct Config 

Source
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 str

URL scheme the endpoint parser registers for this application (PRO-012). Identity — Thunder has no default for it.

§default_port: u16

Default RPC port for the scheme (PRO-012). Identity — Thunder has no default for it.

§handshake: Handshake

Handshake style.

§hello_style: HelloStyle

HELLO payload style.

§push: PushPolicy

Server-push policy.

§max_frame_bytes: usize

Frame cap (WIRE-020).

§max_in_flight: usize

Per-connection in-flight request bound (CLT-012 / SRV-003).

§error_codes: ErrorConvention

Error-string conventions the client parses.

§tls: TlsPolicy

Transport-security policy.

Implementations§

Source§

impl Config

Source

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.

Source

pub const fn scheme(self, scheme: &'static str) -> Self

Set the URL scheme this application answers on (PRO-012).

Source

pub const fn port(self, port: u16) -> Self

Set the default RPC port for the scheme (PRO-012).

Source

pub const fn handshake(self, handshake: Handshake) -> Self

Override the handshake style.

Source

pub const fn hello_style(self, hello_style: HelloStyle) -> Self

Override the HELLO payload style.

Source

pub const fn push(self, push: PushPolicy) -> Self

Override the server-push policy.

Source

pub const fn max_frame_bytes(self, max_frame_bytes: usize) -> Self

Override the frame cap (WIRE-020).

Source

pub const fn max_in_flight(self, max_in_flight: usize) -> Self

Override the per-connection in-flight bound.

Source

pub const fn error_codes(self, error_codes: ErrorConvention) -> Self

Override the error-string conventions parsed.

Source

pub const fn tls(self, tls: TlsPolicy) -> Self

Override the transport-security policy.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

The standard (see Config::standard).

Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Config) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Config

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.