[][src]Crate saphir

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 cookie;
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

controller

Modules for the controllers

error

Modules for the error handling into saphir

header

Headers types re-export

middleware

Modules for the middlewares

router

Modules for the router

server

Modules for the http server

Macros

reg

Convert a str to a regex

Structs

Body

A stream of Chunks, used when receiving bodies.

Cookies

A Wrapper around the CookieJar Struct

CookiesMut

A Mutable Wrapper around the CookieJar Struct

Extensions

A type map of protocol extensions.

Method

The Request Method (VERB)

Request

Represents an HTTP request.

Response

Represents an HTTP response

StatusCode

An HTTP status code (status-code in RFC 7230 et al.).

SyncRequest

A Structure which represent an http request with a fully loaded body

SyncResponse

A Structure which represent a fully mutable http response

Uri

The URI component of a request.

Version

Represents a version of the HTTP spec.

Enums

RequestContinuation

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

Traits

LoadBody

A trait allowing the implicit conversion of a Hyper::Request into a SyncRequest

Payload

This trait represents a streaming body of a Request or Response.

ToBody
ToRegex

Trait to convert string type to regular expressions