Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/quic"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
io |
std/io |
quic.dodo |
ErrorKind
Enum · Source
Portable QUIC vocabulary shared by backends. No cryptography, sockets, clock, entropy, allocation or execution provider is imported here.
pub enum ErrorKind {
InvalidInput, AllocationFailed, VerificationFailed, Protocol, Closed,
StreamReset, ConnectionClosed, Network, Cancelled, TimedOut, Backend, LimitExceeded
}
MAX_CODE
Constant · Source
Largest QUIC variable-length integer, the range of every QUIC error code.
pub const MAX_CODE: u64 = 4611686018427387903
Error
Struct · Source
pub struct Error {
pub kind: ErrorKind
// Numeric backend, verification or operating-system code only.
pub code: i32
// The peer's RESET_STREAM/STOP_SENDING code for StreamReset, or the
// CONNECTION_CLOSE code for ConnectionClosed; zero otherwise.
pub application: u64
pub transferred: usize
}
Error.format
Function · Source
Only fixed kind names and numeric metadata; never input or native messages.
pub fn format<F>(&self, output: &mut F) -> void!io.Error
failure
Function · Source
pub fn failure(kind: ErrorKind, code: i32) -> Error
State
Enum · Source
Ready: the operation completed. Pending: retry after processing network events. Finished: the peer ended the stream, or the connection has closed.
pub enum State {
Ready, Pending, Finished
}
Progress
Struct · Source
pub struct Progress {
pub state: State
pub transferred: usize
}
CloseInfo
Struct · Source
Why a connection ended.
localis set when this endpoint closed it, including idle timeout;transportmarks a QUIC transport error code rather than an application code.
pub struct CloseInfo {
pub code: u64
pub local: bool
pub transport: bool
}
io_error
Function · Source
pub fn io_error(reason: &Error) -> io.Error
poll
Function · Source
pub fn poll(progress: Progress) -> io.Poll