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 |
Body |
A |
ControllerDispatch |
Struct to delegate a request to a registered function matching booth a |
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 |
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 ( |
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 |
Service |
An asynchronous function from |
ToRegex |
Trait to convert string type to regular expressions |