Crate picoserve

Crate picoserve 

Source
Expand description

An async no_std HTTP server suitable for bare-metal environments, heavily inspired by axum.

It was designed with embassy on the Raspberry Pi Pico W in mind, but should work with other embedded runtimes and hardware.

For examples on how to use picoserve, see the examples directory.

Re-exports§

pub use routing::Router;
pub use time::Timer;

Modules§

extract
Types and traits for extracting data from requests.
futures
io
IO Utility
request
HTTP request types.
response
HTTP response types.
routing
Route requests to the appropriate handler.
time
Timer for creating timeouts during request parsing and request handling.
url_encoded
UrlEncodedString and related types.

Macros§

from_request
Extract a value from a request. $name must implement FromRequest, but may borrow from the request. If extraction is rejected, the rejection is written to $response_writer and the function returns.
from_request_parts
Extract values from Request Parts. Each $name must implement FromRequestParts, but may borrow from the request. If extraction is rejected, the rejection is written to $response_writer and the function returns.
make_static
Replacement for static_cell::make_static for use cases when the type is known.

Structs§

Config
Server Configuration.
DisconnectionInfo
Information gathered once a Server has disconnection, such as how many requests were handled and the shutdown reason if the server has graceful shutdown enabled.
ResponseSent
A Marker showing that the response has been sent.
Server
A HTTP Server.
Timeouts
How long to wait before timing out for different operations. If set to None, the operation never times out.

Enums§

Error
Errors arising while handling a request.
KeepAlive
After the response has been sent, should the connection be kept open to allow the client to make further requests on the same TCP connection?
NoGracefulShutdown
Indicates that graceful shutdown is not enabled, so the Server cannot report a graceful shutdown reason.

Traits§

AppBuilder
A helper trait which simplifies creating a static Router with no state.
AppWithStateBuilder
A helper trait which simplifies creating a static Router with a declared state.
LogDisplay

Type Aliases§

AppRouter
The Router for the app constructed from the Props (which implement AppBuilder).