Skip to main content

Config

Struct Config 

pub struct Config {
Show 17 fields pub early_requests: bool, pub observation: Option<Box<ObservationLimits>>, pub settings_profile: Option<Arc<Settings>>, pub critical_streams: Preferences, pub client_control: Option<Arc<ClientControlPreferences>>, pub decoder: DecoderConfig, pub encoder: EncoderConfig, pub max_requests: usize, pub header_read_timeout: Option<HeaderReadTimeout>, pub idle_timeout: Option<IdleTimeout>, pub max_pushes: usize, pub max_frame_size: usize, pub read_chunk_size: usize, pub max_pending_uni_streams: usize, pub extended_connect: bool, pub datagrams: Option<DatagramConfig>, pub strict_connect_framing: bool,
}
Available on crate features http-backend and http and std only.
Expand description

Local HTTP/3 connection budgets. Peer limits are negotiated independently.

Fields§

§early_requests: bool

Send safe client requests without a body using TLS early keys, before confirmation.

Applies to client connections taken through Connecting::into_0rtt; other requests still wait for handshake confirmation. Early requests use default peer SETTINGS (RFC 9114 section 7.2.4.2). A server rejecting early data fails the connection with Error::is_early_data_rejected: none of its requests were processed. Rama’s HTTP/3 connector always completes the handshake first. Servers ignore this: they always hold request dispatch until the client’s Finished is verified. Disabled by default.

§observation: Option<Box<ObservationLimits>>

Optional independent budgets for wire observation; disabled by default.

§settings_profile: Option<Arc<Settings>>

Optional literal SETTINGS order, including unknown and reserved identifiers.

QPACK values must match decoder; an omitted QPACK setting means zero. An explicit field-section limit must match the decoder’s local limit. Server Extended CONNECT must match the application’s capability; datagrams must match negotiated transport support. Client ENABLE_CONNECT_PROTOCOL values are preserved but grant no permission. Incompatible profiles fail before HTTP/3 control bytes are emitted. Ordinary connections allocate no profile.

§critical_streams: Preferences

QPACK stream allocation order and whether idle type prefixes are sent.

§client_control: Option<Arc<ClientControlPreferences>>

Additional client frames after SETTINGS; disabled by default.

§decoder: DecoderConfig

Local QPACK decoder limits, advertised where the protocol defines settings.

§encoder: EncoderConfig

Local encoder budgets. Peer capacity/blocked-stream settings override those fields.

§max_requests: usize

Maximum concurrent application requests retained by the engine.

§header_read_timeout: Option<HeaderReadTimeout>

Deadline for incomplete server request heads, including blocked QPACK sections. None disables the deadline.

§idle_timeout: Option<IdleTimeout>

Server connection idle budgets. None disables the deadline.

§max_pushes: usize

Lifetime push quota; zero disables push. Bounds reordered push state.

§max_frame_size: usize

Maximum buffered encoded non-DATA frame.

This local wire-memory budget is independent of the decoded field-section size advertised in SETTINGS. QPACK literals can expand on the wire, so exceeding this bound is excessive load even for an otherwise valid field section (RFC 9114 §10.5.1). Increase both limits for large-header peers.

§read_chunk_size: usize

Maximum QUIC chunk held by a stream reader.

§max_pending_uni_streams: usize

Maximum unclassified peer unidirectional streams retained simultaneously.

§extended_connect: bool

Accept Extended CONNECT (RFC 9220) as a server, advertising SETTINGS_ENABLE_CONNECT_PROTOCOL. The service decides which :protocol tokens it serves; RFC 9220 §3 recommends 501 for others.

§datagrams: Option<DatagramConfig>

Receive HTTP/3 datagrams (RFC 9297). When QUIC DATAGRAM is negotiated this advertises SETTINGS_H3_DATAGRAM, as RFC 9297 §2.1.1 recommends for every endpoint able to receive them; None never advertises nor delivers them. A request only has datagram semantics once declared with HttpDatagrams.

§strict_connect_framing: bool

Reject, rather than drop, Content-Length or Transfer-Encoding on a successful response to CONNECT, which RFC 9110 §9.3.6 forbids as a tunnel follows the response.

Implementations§

§

impl Config

pub fn try_with_client_settings( &self, settings: Arc<Settings>, ) -> Result<Config, Error>

Apply literal client SETTINGS within this configuration’s receive budgets.

Omitted QPACK values mean zero. The profile can lower configured limits; larger values are lowered to them and a datagram grant this configuration disables is dropped, keeping the order of every other entry. An omitted field-section limit keeps the local finite resource budget. Client ENABLE_CONNECT_PROTOCOL values are retained without enabling Extended CONNECT: only the server’s setting grants that permission.

pub fn try_with_server_settings( &self, settings: Arc<Settings>, ) -> Result<Config, Error>

Apply literal server SETTINGS within existing receive budgets and capabilities.

Omitted QPACK values mean zero. An Extended CONNECT grant without the local capability is dropped; a false or omitted value disables it. Datagram policy and receive budgets cannot be enabled or raised by the supplied settings. The native handshake also drops grants the QUIC transport cannot carry.

pub fn try_set_client_controls( &mut self, preferences: Option<Arc<ClientControlPreferences>>, ) -> Result<(), Error>

Set optional client control frames, dropping trailing frames past this configuration’s frame-count and byte budgets with a trace. An invalid frame leaves the existing configuration unchanged.

pub fn configure_transport( &self, transport: &mut TransportConfig, ) -> Result<(), Error>

Apply finite HTTP/3 receive budgets to a QUIC transport configuration. Configure the endpoint before establishing connections.

Trait Implementations§

§

impl Clone for Config

§

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
§

impl Debug for Config

§

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

Formats the value using the given formatter. Read more
§

impl Default for Config

§

fn default() -> Config

Returns the “default value” for a type. Read more

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a rama_grpc::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
§

impl<T, U> RamaFrom<T> for U
where U: From<T>,

§

fn rama_from(value: T) -> U

§

impl<T, U, CrateMarker> RamaInto<U, CrateMarker> for T
where U: RamaFrom<T, CrateMarker>,

§

fn rama_into(self) -> U

§

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

§

type Error = <U as TryFrom<T>>::Error

§

fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>

§

impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for T
where U: RamaTryFrom<T, CrateMarker>,

§

type Error = <U as RamaTryFrom<T, CrateMarker>>::Error

§

fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<V, F> ValueFormatter<&V> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &&V)

Write value to writer
§

impl<V, F> ValueFormatter<Arc<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &Arc<V>)

Write value to writer
§

impl<V, F> ValueFormatter<Box<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &Box<V>)

Write value to writer
§

impl<V, F> ValueFormatter<Cow<'_, V>> for F
where V: ToOwned + ?Sized, F: ValueFormatter<V> + ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)

Write value to writer
§

impl<V, F> ValueFormatter<Option<V>> for F
where F: ValueFormatter<V> + ?Sized,

§

const SHAPE: FieldShape<'static>

Available on non-metrique_require_explicit_impls only.
The shape of values produced by this formatter. Read more
§

fn format_value(writer: impl ValueWriter, value: &Option<V>)

Write value to writer
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more