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/http/server"
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 |
|---|---|---|
http |
std/http |
server.dodo |
Error
Enum · Source
pub enum Error {
Capacity, ShuttingDown, InvalidState, Deadline
}
Limits
Struct · Source
pub struct Limits {
pub protocol: http.Limits
pub connections: usize
pub requests_per_connection: usize
pub header_timeout_ms: u64
pub body_timeout_ms: u64
pub write_timeout_ms: u64
pub idle_timeout_ms: u64
pub shutdown_timeout_ms: u64
}
Limits.defaults
Function · Source
pub fn defaults() -> Limits
Server
Struct · Source
Execution is selected by the caller. An accepted connection consumes one admission slot; the owner must release it exactly once on every exit path.
pub struct Server {
// Private implementation fields omitted.
}
Server.new
Function · Source
pub fn new(maximum: usize) -> Server
Server.admit
Function · Source
pub fn admit(&mut self) -> void!Error
Server.release
Function · Source
pub fn release(&mut self) -> void!Error
Server.begin_shutdown
Function · Source
pub fn begin_shutdown(&mut self, deadline_ms: u64)
Server.accepting
Function · Source
pub fn accepting(&self) -> bool
Server.active
Function · Source
pub fn active(&self) -> usize
Server.drained
Function · Source
pub fn drained(&self) -> bool
Server.must_close
Function · Source
pub fn must_close(&self, now_ms: u64) -> bool
Phase
Enum · Source
pub enum Phase {
Headers, Body, Response, Idle, Closed
}
Budget
Struct · Source
pub struct Budget {
pub phase: Phase
pub deadline_ms: u64
pub requests: usize
}
Budget.new
Function · Source
pub fn new() -> Budget
Budget.enter
Function · Source
pub fn enter(&mut self, phase: Phase, now_ms: u64, duration_ms: u64)
Budget.check
Function · Source
pub fn check(&mut self, now_ms: u64, cancelled: bool) -> void!Error
Budget.completed
Function · Source
pub fn completed(&mut self, maximum: usize) -> bool