Skip to main content

Module gate

Module gate 

Available on crate feature net only.
Expand description

Gates that pace the streams of a multiplexed connection, such as a QUIC one.

A connection that carries many streams opens a StreamGate per stream direction through the StreamGates added to it, and moves that direction’s bytes only as the gate admits them; the throttle layers throttle such connections with gates.

A gate is consulted only when there is data to read or the stream may still send; a write blocked by flow control settles zero. It is never called while the transport holds a lock, and it is dropped with the handle of its stream direction.

Only QUIC opens gates today. HTTP/2 could open them per stream too, should it need per-stream budgets: when sending in PipeToSendStream (rama-http-core proto/h2/mod.rs), when receiving where Incoming releases window capacity (rama-http-core body/incoming.rs).

Structs§

GatedStream
The stream direction a gate is opened for.

Enums§

GateDirection
Which side of a stream a gate paces.
Initiator
Which end of a connection opened a stream.

Traits§

StreamGate
Paces one direction of one stream.
StreamGates
Opens the gates of a multiplexed connection’s streams.