Rocket/codegen/tests/run-pass/complete-decorator.rs

27 lines
516 B
Rust
Raw Normal View History

#![feature(plugin, custom_derive)]
#![plugin(rocket_codegen)]
extern crate rocket;
use rocket::http::{Cookies, RawStr};
use rocket::request::Form;
#[derive(FromForm)]
2016-12-21 08:09:22 +00:00
struct User<'a> {
name: &'a RawStr,
2016-12-21 08:09:22 +00:00
nickname: String,
}
#[post("/<name>?<query>", format = "application/json", data = "<user>", rank = 2)]
2016-12-21 08:09:22 +00:00
fn get<'r>(name: &str,
query: User<'r>,
user: Form<'r, User<'r>>,
cookies: Cookies)
2016-12-21 08:09:22 +00:00
-> &'static str {
"hi"
}
fn main() {
let _ = routes![get];
}