Crate saphir [] [src]

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.

Macros

hset
reg
scrypt
scrypt_check

Structs

BasicController

An helper struct embedding a ControllerDispatch.

Body

A Stream for Chunks used in requests and responses.

BodyGuard

RequestGuard ensuring that a request has a body

ControllerDispatch

Struct to delegate a request to a registered function matching booth a method and a path

Headers

A map of header fields on requests and responses.

Http

A configuration of the HTTP protocol.

MiddlewareStack

Struct representing the layering of middlewares in the server

Request

An HTTP Request

RequestGuardCollection
Response

An HTTP Response

Router

A Struct responsible of dispatching request towards controllers

Server

The http server

SyncRequest

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

Uri

The Request-URI of a Request's StartLine.

Enums

HttpVersion

Represents a version of the HTTP spec.

Method

The Request Method (VERB)

RequestContinuation

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

ServerError

Potential server errors

StatusCode

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

Traits

Controller

Trait representing a controller

LoadBody

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

Middleware

The trait a struct need to impl to be considered as a middleware

RequestGuard

A trait to provide an other layer of validation before allowing a request into a controller

Service

An asynchronous function from Request to a Response.

ToRegex

Trait to convert string type to regular expressions