Declaraciones públicas de zig/http.zig (conduit-zig (SDK consumido)).
apps/docs/generated/zig/conduit.jsonPágina generada desde
conduit@conduit-0.1.0-f7J_7zg5DwCsHBHItwdOz9ZVq8cvH7ceFsk7-m3-T61t (zig/root.zig). No se edita a mano:bun run docs:genla regenera ybun run docs:checkfalla si difiere.
HTTP/1.1 bindings of the wire over std.http + std.Io:
serveConnection: one connection of the reference server (CLI
serve, interop tests with the TS codec and the C-ABI). styx serves
the same server.Server over HTTP/3 from its daemon instead.ClientTransport: a driver.Transport over std.http.Client (CLI
upload), thread-safe, keep-alive, TLS when the URL is https.http.max_head_bytesconst · línea 24
pub const max_head_bytes = 16 * 1024Sin ///.
http.serveConnectionfn · línea 133
pub fn serveConnection(srv: *server.Server, io: Io, stream: Io.net.Stream) voidServe requests on stream until the peer closes or a protocol error.
Blocking; run one per thread. No admission control of its own: exposed
servers run Service, which supervises every connection.
http.ServeOptionstype · línea 343
pub const ServeOptions = structOptions of Service (and serve). Every limit is on: there is no value
that switches admission control off (Service.init refuses zeros),
except the per-address cap, which a server behind a proxy cannot use.
A connection is in one of two pools:
Server.begin accepts the credential
of a request that has a body until its response is written. Bounded
in total and per Grant.subject, with a minimum body rate and an
absolute deadline proportional to the body length; over the bounds
the request is answered 429 too_many_connections (retryable).http.ServeOptions.Errorconst · línea 381
pub const Error = error{InvalidServeOptions}Sin ///.
http.ServeOptions.validatefn · línea 383
pub fn validate(o: ServeOptions) Error!voidSin ///.
http.TrustedProxytype · línea 412
pub const TrustedProxy = structThe proxy in front of a Service (ServeOptions.trusted_proxy).
http.TrustedProxy.min_proof_lenconst · línea 422
pub const min_proof_len = 32Sin ///.
http.TrustedProxy.max_header_lenconst · línea 423
pub const max_header_len = 64Sin ///.
http.Statstype · línea 431
pub const Stats = structAdmission counters of a Service (tests, metrics).
http.Servicetype · línea 451
pub const Service = structAccept loop with one thread per connection (bounded), admission control
per pool, subject and address (ServeOptions), and the idle-session
sweeper; a consumer can stop it: stop wakes the accept, shuts every
open connection down and run returns once every connection thread has
finished — so the Server can be deinitialized right after (no thread
outlives it).
http.Service.Identitytype · línea 490
pub const Identity = enumWhat identify decided about the request just read.
http.Service.InitErrorconst · línea 518
pub const InitError = ServeOptions.Error || std.mem.Allocator.ErrorSin ///.
http.Service.initfn · línea 520
pub fn init(gpa: std.mem.Allocator, srv: *server.Server, io: Io, listener: *Io.net.Server, opts: ServeOptions) InitError!ServiceSin ///.
http.Service.deinitfn · línea 538
pub fn deinit(self: *Service) voidAfter run returned.
http.Service.statsfn · línea 544
pub fn stats(self: *Service) StatsSin ///.
http.Service.runfn · línea 558
pub fn run(self: *Service) voidBlocks until stop. Returns only when no connection thread is left.
http.Service.stopfn · línea 595
pub fn stop(self: *Service) voidIdempotent; callable from any thread (a signal-driven shutdown, a test).
http.servefn · línea 899
pub fn serve(srv: *server.Server, io: Io, listener: *Io.net.Server, opts: ServeOptions) !voidService until the listener fails (CLI serve).
http.ClientTransporttype · línea 907
pub const ClientTransport = structSin ///.
http.ClientTransport.transportfn · línea 914
pub fn transport(self: *ClientTransport) driver.TransportSin ///.