Skip to main content

Crate quic

Crate quic 

Available on crate features quic and std only.
Expand description

QUIC v1 (RFC 9000) transport for Rama.

The deterministic protocol engine lives in the private proto module and the asynchronous connection driver in driver; only Rama-owned types are part of this crate’s public API.

UDP I/O is provided by rama_udp; TLS 1.3 comes from the common [rama_tls] configuration converted through rama-tls-rustls.

§Rama

Crate used by the end-user rama crate and rama crate authors alike.

Learn more about rama:

Modules§

qlog
Typed QUIC diagnostics with optional async recording.
tlsrustls and (aws-lc or ring)
TLS for QUIC: how a connection’s identity and application protocol are configured.

Structs§

Accept
Future produced by Endpoint::accept
AcceptBi
Future produced by Connection::accept_bi
AcceptUni
Future produced by Connection::accept_uni
AckFrequencyConfig
Parameters for controlling the peer’s acknowledgement frequency
AddressTokenKeyaws-lc or ring
The key a server seals address-validation tokens with (RFC 9000 §8.1).
ApplicationClose
Reason given by an application for closing the connection
BloomTokenLog
Bloom filter-based TokenLog
Chunk
A chunk of data from the receive stream
ClientConfig
Configuration for outgoing connections
ClosedStream
Error indicating that a stream has not been opened or has already been finished or reset. closed stream
Connecting
In-progress connection attempt future
Connection
A QUIC connection.
ConnectionClose
Reason given by the transport for closing the connection
ConnectionId
Protocol-level identifier for a connection.
ConnectionStats
Connection statistics
DriverStats
Socket and receive-queue statistics for one connection, counted by the driver around the protocol engine. What the engine itself counts is ConnectionStats.
Endpoint
A QUIC endpoint.
EndpointBuilder
An endpoint being built: the runtime it will live on, what it is configured with, and the socket it will bind.
EndpointConfig
Global configuration for the endpoint, affecting all connections
EndpointStats
Statistics on Endpoint activity
ExportKeyingMaterialError
The requested output length exceeds the exporter’s limit. failed to export keying material
FrameStats
Number of frames transmitted or received of each frame type
FrameType
A QUIC frame type
HandshakeSummary
Negotiated ALPN and received server name reported by the TLS backend.
HashedConnectionIdGenerator
Generates 8-byte connection IDs that can be efficiently validated
IdleTimeout
Maximum duration of inactivity to accept before timing out the connection
Incoming
An incoming connection for which the server has not yet begun its part of the handshake
IncomingFuture
Basic adapter to let Incoming be await-ed like a Connecting
InvalidCid
connection ID was not recognized by the connection ID generator
MtuDiscoveryConfig
Parameters governing MTU discovery.
NoneTokenLog
Null implementation of TokenLog, which never accepts tokens
NoneTokenStore
Null implementation of TokenStore, which does not store any tokens
OpenBi
Future produced by Connection::open_bi
OpenUni
Future produced by Connection::open_uni
PacketQueueStats
Occupancy and drop counters of a queue of received packets.
PathStats
Statistics related to a transmission path
RandomConnectionIdGenerator
Generates purely random connection IDs of a specified length
ReadDatagram
Future produced by Connection::read_datagram
ReceiveQueueLimits
Bounds for received packets queued between the endpoint driver and a connection driver.
RecvStream
A stream that can only be used to receive data
RetryError
Error for a Retry that was not sent; the Incoming is handed back for another decision
SendDatagram
Future produced by Connection::send_datagram_wait
SendStream
A stream that can only be used to send data
ServerConfig
Parameters governing incoming connections
StatelessResetKey
The key an endpoint derives the stateless reset tokens it issues from (RFC 9000 §10.3).
StdSystemTime
Default implementation of TimeSource
StreamId
Identifier for a stream within a particular connection
TokenMemoryCache
TokenStore implementation that stores up to N tokens per server name for up to a limited number of server names, in-memory
TokenReuseError
validation token may have been reused
TransportConfig
Parameters governing the core QUIC state machine
TransportError
Transport-level errors occur when a peer violates the protocol specification
TransportErrorCode
Transport-level error code
UdpStats
Statistics about UDP datagrams transmitted or received on a connection
ValidationTokenConfig
Configuration for sending and handling validation tokens in incoming connections
VarInt
An integer less than 2^62
VarIntBoundsExceeded
Error returned when constructing a VarInt from a value >= 2^62. value too large for varint encoding
Written
Indicates how many bytes and chunks had been transferred in a write operation
ZeroRttAccepted
Future that completes when a connection is fully established

Enums§

ConfigError
Errors in the configuration of an endpoint
CongestionControl
Which congestion controller a connection’s paths use.
ConnectError
Errors in the parameters being used to create a new connection
ConnectionError
Reasons why a connection might be lost
Dir
Whether a stream communicates data in both directions or only from the initiator
EcnCodepoint
Explicit congestion notification codepoint
PreferredAddressPolicy
How a client answers a server’s preferred address (RFC 9000 §9.6).
ReadError
Errors that arise from reading from a stream.
ReadExactError
Errors that arise from reading from a stream.
ReadToEndError
Errors from RecvStream::read_to_end
ResetError
Errors that arise while waiting for a stream to be reset
RetryRefused
Why a Retry was not sent
SendDatagramError
Errors that can arise when sending a datagram
ShutdownOutcome
Side
Whether an endpoint was the initiator of a connection
StoppedError
Errors that arise while monitoring for a send stream stop from the peer
WriteError
Errors that arise from writing to a stream

Constants§

DEFAULT_SHUTDOWN_BUDGET
How long a shutdown gives drivers to finish before it stops waiting and forces them.
DEFAULT_SUPPORTED_VERSIONS
The QUIC protocol versions advertised and accepted by default: QUIC v1 only.
KEY_MATERIAL_SIZE
Bytes of secret material accepted by the fixed-size key constructors.
MAX_CID_SIZE
The longest connection ID QUIC version 1 carries, in bytes (RFC 9000 §17.2).
MIN_INITIAL_CONGESTION_WINDOW
The smallest initial congestion window this crate accepts: two datagrams of the size every QUIC path carries (RFC 9000 §14.1). It is a policy floor, not a protocol one; a window of zero was measured to leave a connection unable to complete its handshake.

Traits§

ConnectionIdGenerator
Generates connection IDs for incoming connections
TimeSource
Object to get current SystemTime
TokenLog
Responsible for limiting clients’ ability to reuse validation tokens
TokenStore
Responsible for storing validation tokens received from servers and retrieving them for use in subsequent connections

Type Aliases§

ConnectionIdGeneratorFactory
How an endpoint makes a connection ID generator: one call per endpoint, so each has its own state.