mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-04-20 06:54:46 +00:00
have the setup method be a macro arg for now
This commit is contained in:
parent
e845d996d9
commit
d2275df6ff
3 changed files with 13 additions and 19 deletions
|
@ -15,7 +15,13 @@ use log4rs::{
|
|||
encode::pattern::PatternEncoder
|
||||
};
|
||||
|
||||
rest_resource!{Users}
|
||||
rest_resource!{Users, route => {
|
||||
route.read_all::<Self, _>();
|
||||
route.read::<Self, _, _>();
|
||||
route.create::<Self, _, _>();
|
||||
route.update_all::<Self, _, _>();
|
||||
route.update::<Self, _, _, _>();
|
||||
}}
|
||||
|
||||
rest_struct!{User {
|
||||
username : String
|
||||
|
@ -87,18 +93,6 @@ impl ResourceDelete<u64, Success<()>> for Users
|
|||
}
|
||||
}
|
||||
|
||||
// impl Resource for Users
|
||||
// {
|
||||
// fn setup<D : DrawResourceRoutes>(mut route : D)
|
||||
// {
|
||||
// route.read_all::<Self, _>();
|
||||
// route.read::<Self, _, _>();
|
||||
// route.create::<Self, _, _>();
|
||||
// route.update_all::<Self, _, _>();
|
||||
// route.update::<Self, _, _, _>();
|
||||
// }
|
||||
// }
|
||||
|
||||
const ADDR : &str = "127.0.0.1:18080";
|
||||
|
||||
fn main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue