From 0c63ae51d1221b8ecd9742c7d5580bd06551ecbb Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Thu, 4 Mar 2021 18:14:12 -0500 Subject: did some templating, added some models --- src/models/mod.rs | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/models/mod.rs (limited to 'src/models') diff --git a/src/models/mod.rs b/src/models/mod.rs new file mode 100644 index 0000000..d7ff47a --- /dev/null +++ b/src/models/mod.rs @@ -0,0 +1,43 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize)] +pub struct Car { + year: u16, // Yes, in 30767 years I will address this. + make: String, + model: String, + engine: Engine, + doors: u8, + transmission: Transmission, +} + +#[derive(Serialize, Deserialize)] +pub struct Part { + name: String, + compatible_cars: Vec, + sources: Vec, + categories: Vec, +} + +#[derive(Serialize, Deserialize)] +pub enum Source { + Uri(String), +} + +#[derive(Serialize, Deserialize)] +pub struct Engine { + cylinders: u8, + displacement: u16, + layout: Layout, +} + +#[derive(Serialize, Deserialize)] +pub enum Layout { + I, + V, +} + +#[derive(Serialize, Deserialize)] +pub struct Transmission(String); + +#[derive(Serialize, Deserialize)] +pub struct Category(String); -- cgit v1.2.3