Home / Docs / Standard library
std.host
Release v0.4.0
The items of std.host for serving HTTP, one page each. A module imports them by name, as import std.host (HttpServer, Request, Reply): unlike the host capabilities of spec/14 §3, the prelude does not put them in scope (spec/31 §1).
Operators, comparisons, equality and interpolation are built in and not listed here (spec/14 §2). The built-in methods, .len and those of maps and of fixed-width integers, are on Built-in methods.
Types
Method: The methods a request may have (spec/31 §1, ADR 0123 rule 1). (0.4, 0.5 preview)Param: One decoded query parameter of a request, asname=value(spec/31 §4 rule 4). (0.4, 0.5 preview)Request: A request, as the host read it (spec/31 §3,§4): its target in origin-form as received, its path split on/and percent-decoded segment by segment, the parameters of its query decoded in order, its headers with names in ASCII lower case in the order received, its whole body, the peer's IP address without its port, and the grant's address as the grant writes it. (0.4, 0.5 preview)Exchange: A request and the reply right to answer it once (spec/31 §1, ADR 0123 rule 4). (0.4, 0.5 preview)Status: The status of a reply: a1xxstatus is the host's alone (spec/31 §5). (0.4, 0.5 preview)Reply: A reply to a request (spec/31 §5): the host writes its framing headers itself. (0.4, 0.5 preview)ServeError: Why an operation ofHttpServerfails (spec/31 §1):Interruptedat a host stop,TimedOutwhen a deadline of the program cuts the wait ofnext,Closedafterclose,NotHeldfor a reply right the task does not hold or answered already, andBadReplyfor a reply the host refuses to send. (0.4, 0.5 preview)
Capabilities
HttpServer: The server side of HTTP/1.1, on the addresses thatservegrants allow (spec/31 §1, ADR 0123 rules 1 to 5). (0.4, 0.5 preview)
Generated from the standard modules of una v0.4.0 (docs/std/listing.json, which is not part of the specification). The specification governs: spec/14 §1.