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
reg |
Structs
BasicController |
An helper struct embedding a |
Body |
A stream of |
BodyGuard |
RequestGuard ensuring that a request has a body |
ControllerDispatch |
Struct to delegate a request to a registered function matching booth a |
Extensions |
A type map of protocol extensions. |
HeaderMap |
A set of HTTP headers |
HeaderName |
Represents an HTTP header field name |
HeaderValue |
Represents an HTTP header field value. |
HyperServer |
A listening HTTP server. |
Method |
The Request Method (VERB) |
MiddlewareStack |
Struct representing the layering of middlewares in the server |
ReqParts |
Component parts of an HTTP |
Request |
Represents an HTTP request. |
RequestGuardCollection | |
ResParts |
Component parts of an HTTP |
Response |
Represents an HTTP response |
ResponseBuilder |
An HTTP response builder |
Router |
A Struct responsible of dispatching request towards controllers |
Server |
The http server |
StatusCode |
An HTTP status code ( |
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 |
ServerError |
Potential server errors |
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 |
Payload |
This trait represents a streaming body of a |
RequestGuard |
A trait to provide an other layer of validation before allowing a request into a controller |
Service |
An asynchronous function from |
ToBody | |
ToRegex |
Trait to convert string type to regular expressions |
Functions
service_fn |
Create a |