Crate luminal_handler [] [src]

This create wraps hyper::server::Service with a slightly more convenient interface.

The request is wrapped with a new enum that helps provide additional information along with the request and uses a more liberal error type to allow users to map their own error to an actual http response.

Structs

HandlerFn

Holds a function to dispatch to via its impl of Handler<E>.

HandlerService

An impl of hyper::Service that consumes an impl of Handler.

Enums

HttpRequest

Wraps a hyper::Request so that luminal can add additional information alongside the request.

Traits

Handler

Trait for handling a request, returning a response or an error that can be converted into a hyper::Response.

IntoResponse

Trait to implement on errors so that a caller's error type can be converted into a response.

Functions

handler_fn

Accepts a function or closure that takes an HttpRequest and returns a compatible Result.