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.
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.
ResponseSent
A Marker showing that the response has been sent.
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?

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

Functions§

serve
Serve app with incoming requests. App has no state.
serve_with_state
Serve app with incoming requests. App has a state of State.

Type Aliases§

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