diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-10-22 20:32:07 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-10-24 12:02:00 +0200 |
commit | c658f2ed24fd672b17b077db1bd659e2be830b1d (patch) | |
tree | 1fd1346935ce0260b7d41768c3a70f18955e4f63 /service-person/src/model.rs | |
parent | 14b981c63d558969bc29b25ca40e8b249d072ebb (diff) |
Move "model" types to model.rs
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'service-person/src/model.rs')
-rw-r--r-- | service-person/src/model.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/service-person/src/model.rs b/service-person/src/model.rs new file mode 100644 index 0000000..aa81312 --- /dev/null +++ b/service-person/src/model.rs @@ -0,0 +1,32 @@ +use serde::Deserialize; + +#[derive(Debug, Deserialize)] +pub struct Name(String); + +#[derive(Debug, Deserialize)] +pub struct Age(usize); + +#[derive(Debug, Deserialize)] +pub struct Street(String); + +#[derive(Debug, Deserialize)] +pub struct City(String); + +#[derive(Debug, Deserialize)] +pub struct Country(String); + +#[derive(Debug, Deserialize)] +pub struct Address { + country: Country, + city: City, + street: Street, + number: usize, +} + +#[derive(Debug, Deserialize)] +pub struct Person { + name: Name, + age: Age, + addr: Address, +} + |