Skip to main content

Module api

Module api 

Source
Expand description

The HTTP API, served over TLS only.

Structs§

App
What the API serves from.
ConnectionLimits
How long a connection may take over each step before it is closed, and how long the listener waits after it could take no connection.
Limits
The limits from configuration that the API applies to every request.
ReportGate
One listener’s count of the reports of the current minute.
ReportLimits
How many reports a listener takes.

Enums§

AfterFailure
What the listener does after it could take no connection.
TlsError
Why the TLS configuration could not be made.

Constants§

OPENAPI
The OpenAPI description of every route, as GET /openapi.json serves it and the website publishes it.

Traits§

Accept
Where connections come from: a bound socket, or in a test one that fails first.

Functions§

after_failure
What follows a failed accept. A connection that ended before it was taken is its own failure; anything else is the system’s.
router
The routes, served from app.
serve
Serves app on listener over TLS until shutdown completes, within the default ConnectionLimits. A connection whose handshake fails, such as plain HTTP, is dropped; the server goes on.
serve_observed
serve_within, calling full each time the listener finds every one of its places held: once for each time it fills, however long it stays full and however many connections wait. The listener also logs a warning then, at most once a minute.
serve_within
serve, within limits. A failed accept never ends serving: the listener goes on, after limits.accept_pause when the failure is the system’s (after_failure). A connection is closed when its handshake is not done within limits.handshake, when no request head has arrived within limits.first_head of the handshake, when an HTTP/1.1 request head takes longer than limits.head from its first bytes, and when it has waited limits.idle for its next request. The listener holds at most limits.max connections at once.
tls_config
The server’s TLS configuration from a PEM certificate chain and a PEM private key, the files tls.cert and tls.key name.
tls_config_named
tls_config, for a key file that the configuration key named names, so a refusal of the file says which key to look at.