Skip to main content

Module client

Module client 

Source
Expand description

A typed client over a document, and the two steps every call is made of.

Client holds one document and hands out Calls by operationId. Call knows what its answer deserialises into, so sending is one expression in each flavour and a caller never names a response type twice.

Nothing here is specific to one API. A generated wrapper is the typed door onto Client::call: it names the operationId, names the arguments under the document’s own names, and holds no path template, no query rule and no encoder.

Structs§

BodyError
A request body that does not deserialise into the type the document describes for it.
Call
One request, built and waiting, that knows what its answer deserialises into.
Client
One document, one server, and a typed way to call anything in it.
NoContent
A response the document promises no body for.

Enums§

Error
Anything that stops a call short of a typed answer.

Functions§

fits
Does body deserialise into T?
to_json
The request body of a typed wrapper, as JSON.