mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-06-07 14:20:42 +00:00
add dependencies to schema
This commit is contained in:
parent
d1c7ac5887
commit
3427fb4c6f
4 changed files with 141 additions and 50 deletions
|
@ -27,14 +27,14 @@ rest_struct!{User {
|
|||
username : String
|
||||
}}
|
||||
|
||||
impl ResourceReadAll<Success<Vec<User>>> for Users
|
||||
impl ResourceReadAll<Success<Vec<Option<User>>>> for Users
|
||||
{
|
||||
fn read_all(_state : &mut State) -> Success<Vec<User>>
|
||||
fn read_all(_state : &mut State) -> Success<Vec<Option<User>>>
|
||||
{
|
||||
vec![Username().fake(), Username().fake()]
|
||||
.into_iter()
|
||||
.map(|username| User { username })
|
||||
.collect::<Vec<User>>()
|
||||
.map(|username| Some(User { username }))
|
||||
.collect::<Vec<Option<User>>>()
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue