Crate saphir

source ·
Expand description

Saphir

Saphir is a progressive http server framework based on Hyper-rs that aims to reduce the time spent on playing with futures and limiting the amount of copied code amongst request matching.

Saphir provide what’s needed to easily start with your own server with middleware, controllers and request routing.

Futures version will comes with more macro and a nightly experiment is currently being tested to reproduces decorator in rust.

Re-exports

pub use regex;
pub use hyper;
pub use crate::middleware::Middleware;
pub use crate::middleware::MiddlewareStack;
pub use crate::controller::Controller;
pub use crate::controller::BasicController;
pub use crate::controller::ControllerDispatch;
pub use crate::controller::RequestGuard;
pub use crate::controller::RequestGuardCollection;
pub use crate::controller::BodyGuard;
pub use crate::router::Router;
pub use crate::server::Server;
pub use crate::server::ServerSpawn;
pub use crate::error::ServerError;

Modules

Modules for the controllers
Modules for the error handling into saphir
Headers types re-export
Modules for the middlewares
Modules for the router
Modules for the http server

Macros

Structs

A stream of Chunks, used when receiving bodies.
A type map of protocol extensions.
The Request Method (VERB)
Represents an HTTP request.
A convenience class to contains RequestParams
Represents an HTTP response
An HTTP status code (status-code in RFC 7230 et al.).
A Structure which represent an http request with a fully loaded body
A Structure which represent a fully mutable http response
The URI component of a request.
Represents a version of the HTTP spec.

Enums

Enum representing whether or not a request should continue to be processed be the server

Traits

A trait allowing the implicit conversion of a Hyper::Request into a SyncRequest
This trait represents a streaming body of a Request or Response.
Trait to convert string type to regular expressions