Skip to main content

Module app

Module app 

Source
Expand description

The Links Notation REST API application.

The application is a framework-independent request handler: it takes a RawRequest — a method, a path, a query string, headers and body bytes — and answers with ResponseParts. Everything the specification requires happens in between: content negotiation, Links Notation bodies, problem details, automatic HEAD, automatic OPTIONS, 405 Method Not Allowed with Allow, CORS and a machine-readable service description.

crate::serve runs it over HTTP; anything else that can build a RawRequest can run it too.

Structs§

LinoApp
An application that speaks Links Notation.
RawRequest
One HTTP request as it arrives from a server, before it is decoded.

Constants§

DESCRIPTION_PATH
Where the native service description lives (specification section 9).
EMPTY
A body that carries no value, for handlers that answer with a status alone.
HTTP_METHODS
Methods a handler can be registered for.
OPENAPI_PATH
Where the generated OpenAPI 3.1 document lives (specification section 9).

Functions§

create_lino_app
Create a new application, for symmetry with the other packages.

Type Aliases§

Handler
A registered route handler.
HandlerFuture
What a handler returns: a future resolving to a result or a problem.