Module net

Module net 

Source
Expand description

Outbound HTTP, as a thing that is supplied rather than a thing that is ambient.

docs/14-review-findings.md F11 names three resources that cannot be retrofitted — clock, network and disk. crate::clock is the first of them. This is the second, and it arrives with the feature that first needs it rather than after: a program’s outbound call goes through this trait, so a simulator, a recorder and a refusal are all the same shape.

§What is on the seam

One request/response exchange, which is what the http_fetch primitive is. Not connection reuse, not a pool, not a redirect policy, not retries — those are decisions of an implementation, and an implementation is what this trait is for.

§Transport security is a field, not a mode

Request::tls says whether the exchange is over TLS, and it is a field of the request rather than a property of the client, because a program that calls two peers may reach one of them over a plaintext hop inside a cluster and the other across the internet. What a name is verified against is the implementation’s business; that the caller asked for TLS is the program’s (docs/adr/0023).

Structs§

Canned
A canned client: replies decided in advance, requests kept.
Refusing
The default: every request fails, and says why in a sentence a program can print.
Reply
What came back. A status is a reply, not a failure — including a 500.
Request
One outbound request.

Enums§

Failure
Why no reply came back.

Traits§

Outbound
Somewhere for an outbound request to go.

Functions§

is_nameable_host
Is this a host the net.out(host) atom can name?
process_outbound
The process’s outbound client — read by the evaluator, which has no other way to reach one.
set_process_outbound
Install it. Returns false if one has already been read or installed.