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/hosting"
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 |
|---|---|---|
connection |
std/http/connection |
hosting.dodo |
http |
std/http |
hosting.dodo |
io |
std/io |
hosting.dodo |
mem |
core/mem |
hosting.dodo |
native |
std/net/native |
hosting.dodo |
net |
std/net |
hosting.dodo |
thread |
std/thread |
hosting.dodo |
tls |
std/tls |
hosting.dodo |
web |
std/web |
hosting.dodo |
ErrorKind
Enum · Source
Shared hosted driving primitives. Portable HTTP never imports this module.
pub enum ErrorKind {
InvalidInput, Workspace, Resolve, Connect, Transport, Protocol, Tls,
BodyLimit, HeaderLimit, TimedOut, Cancelled, Redirect, Handler
}
Error
Struct · Source
pub struct Error {
pub kind: ErrorKind
pub network: net.Error
pub protocol: http.Error
pub transport: io.Error
pub security: tls.Error
// Response bytes accepted by the client sink before success/failure.
pub delivered: u64
pub application: Option<web.Failure>
pub responded: bool
}
Error.format
Function · Source
pub fn format<F>(&self, output: &mut F) -> void!io.Error
failure
Function · Source
pub fn failure(kind: ErrorKind) -> Error
web_error
Function · Source
pub fn web_error(reason: web.Failure, kind: ErrorKind) -> Error
network_error
Function · Source
pub fn network_error(reason: net.Error, kind: ErrorKind) -> Error
protocol_error
Function · Source
pub fn protocol_error(reason: http.Error) -> Error
io_error
Function · Source
pub fn io_error(reason: io.Error) -> Error
connection_error
Function · Source
pub fn connection_error(reason: connection.Error) -> Error
tls_error
Function · Source
pub fn tls_error(reason: tls.Error) -> Error
deadline
Function · Source
Zero is never an implicit infinite timeout in the hosted layer.
pub fn deadline(now: u64, milliseconds: u64) -> u64
earlier
Function · Source
pub fn earlier(a: u64, b: u64) -> u64
check
Function · Source
pub fn check<C, X>(clock: &mut C, cancel: &X, until: u64) -> void!Error
pause
Function · Source
pub fn pause<C, X>(clock: &mut C, cancel: &X, until: u64) -> void!Error
wait
Function · Source
pub fn wait<S, C, X>(stream: &mut S, writing: bool, clock: &mut C, cancel: &X, until: u64) -> void!Error
flush
Function · Source
pub fn flush<S, C, X>(driver: &mut connection.Connection, stream: &mut S, clock: &mut C, cancel: &X, until: u64) -> void!Error
send
Function · Source
pub fn send<S, C, X>(driver: &mut connection.Connection, stream: &mut S, body: &[u8], clock: &mut C, cancel: &X, until: u64) -> void!Error
write
Function · Source
pub fn write<S, C, X>(stream: &mut S, data: &[u8], clock: &mut C, cancel: &X, until: u64) -> void!Error
Plain
Struct · Source
pub struct Plain {
// Private implementation fields omitted.
}
Plain.new
Function · Source
pub fn new(socket: &mut native.TcpConnection) -> Plain from(socket)
Plain.poll_read
Function · Source
pub fn poll_read(&mut self, data: &mut[u8]) -> io.Poll!io.Error
Plain.poll_write
Function · Source
pub fn poll_write(&mut self, data: &[u8]) -> io.Poll!io.Error
Plain.flush
Function · Source
pub fn flush(&mut self) -> bool!Error
Plain.wait
Function · Source
pub fn wait(&mut self, writing: bool, milliseconds: u32) -> void!Error