mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-08 10:42:37 +00:00
8c0d11feab
Summary of changes: * Request no longer has a lifetime parameter. * Handler type now includes a `Data` parameter. * Response is now an enum that is either `Complete` or `Forward`. * Outcome enum is now one of: Success, Failure, Forward. * Outcome::Foward for Responses must include StatusCode. * Responders are now final: they cannot forward to requests. (!!) * Responsers may only forward to catchers. (!!) * Response no longer provides wrapping methods. * Route is now cloneable. This change is fundamental to enabling streaming requests.
26 lines
451 B
Rust
26 lines
451 B
Rust
#![feature(plugin)]
|
|
#![plugin(rocket_codegen)]
|
|
|
|
extern crate rocket;
|
|
|
|
use rocket::{Error, Request};
|
|
|
|
#[error(404)]
|
|
fn err0() -> &'static str { "hi" }
|
|
|
|
#[error(404)]
|
|
fn err1a(_err: Error) -> &'static str { "hi" }
|
|
|
|
#[error(404)]
|
|
fn err1b(_req: &Request) -> &'static str { "hi" }
|
|
|
|
#[error(404)]
|
|
fn err2a(_err: Error, _req: &Request) -> &'static str { "hi" }
|
|
|
|
#[error(404)]
|
|
fn err2b<'a>(_err: Error, _req: &'a Request) -> &'a str { "hi" }
|
|
|
|
fn main() {
|
|
}
|
|
|