WIP Repository and resources

This commit is contained in:
Adrian Heine 2017-02-16 18:35:54 +01:00
parent 4be608a002
commit 124b639e50
4 changed files with 50 additions and 4 deletions

13
src/resources/mod.rs Normal file
View file

@ -0,0 +1,13 @@
pub trait Resource {
fn get_type(&self) -> &str;
fn get_value(&self) -> &str;
}
pub struct UserResource<'a> {
pub name: &'a str
}
impl<'a> Resource for UserResource<'a> {
fn get_type(&self) -> &str { "user" }
fn get_value(&self) -> &str { self.name }
}