Crate susanoo [] [src]

A micro Web framework based on Hyper, Futures and Tokio.

Example

extern crate susanoo;

use susanoo::prelude::*;

fn hello(ctx: Context) -> Outcome<Response> {
    ctx.respond("Hello, world")
}

fn main() {
    let s = Susanoo::default()
        .with_route(Route::get("/", hello));
    s.run().unwrap()
}

Reexports

pub extern crate futures;
pub extern crate hyper;
pub extern crate typemap;

Modules

body
context
errors
handler
header

Headers container, and common header fields.

outcome
prelude
request
response
router
susanoo

Macros

try_f

Structs

Body
Context

A context during handling.

Request

HTTP request, reconstructed from hyper::Request.

Response

[unstable] A response which contains all information to construct

Route

A route endpoint, which contains the instance of handler and middlewares

Susanoo

Root instance of Web application.

Enums

HandleError

Error type thrown during handling

Outcome

Returned future from middlewares/handlers.

StatusCode

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

Traits

FromBody
FromForm
Handler

Represents a handler

Middleware

Represents a middleware.

Responder

Represents a "responder", which converted to hyper::Response.