Created
February 8, 2019 23:43
-
-
Save pop/09b464dd60b0fde7e19dc77713008f01 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(proc_macro_hygiene, decl_macro)] | |
#[macro_use] extern crate serde_derive; | |
#[macro_use] extern crate rocket; | |
extern crate rocket_contrib; | |
use rocket::State; | |
#[derive(Debug)] | |
pub struct Foo { | |
a: String | |
} | |
pub trait Bar: Send + Sync + std::fmt::Debug { } | |
impl Bar for Foo { } | |
fn main() { | |
let d = Box::new(Foo{ a: String::from("a") }); | |
rocket::ignite() | |
.mount("/", routes![dummy]) | |
.manage(d) | |
.launch(); | |
} | |
#[get("/")] | |
pub fn dummy(state: State<Box<Bar>>) -> () { | |
dbg!(state); | |
unimplemented!() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment