summaryrefslogtreecommitdiff
path: root/src/models/mod.rs
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2022-01-22 08:45:24 -0500
committerAdam T. Carpenter <atc@53hor.net>2022-01-22 15:18:04 -0500
commitba49aa806a48839b61fb261f7ccd007a507d8d50 (patch)
tree222855376c301972a10bb8656c94731fc40ded76 /src/models/mod.rs
parentd7472320a00fa0bfd6b9be904e0730461f093f61 (diff)
downloadtwinh-ba49aa806a48839b61fb261f7ccd007a507d8d50.tar.xz
twinh-ba49aa806a48839b61fb261f7ccd007a507d8d50.zip
feat: experimental cgi forkcgi
Diffstat (limited to 'src/models/mod.rs')
-rw-r--r--src/models/mod.rs63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/models/mod.rs b/src/models/mod.rs
deleted file mode 100644
index ddef71f..0000000
--- a/src/models/mod.rs
+++ /dev/null
@@ -1,63 +0,0 @@
-use crate::error::TwinHError;
-use bincode::deserialize;
-use serde::{de::DeserializeOwned, Deserialize, Serialize};
-use sled::IVec;
-
-pub struct Entity<M: DeserializeOwned + Serialize> {
- pub umrn: u64,
- pub model: M,
-}
-
-impl<M: DeserializeOwned + Serialize> Entity<M> {
- pub fn new(t: (IVec, IVec)) -> Result<Self, TwinHError> {
- let (umrn, model) = t;
- let umrn = deserialize(&umrn)?;
- let model = deserialize(&model)?;
- Ok(Entity { umrn, model })
- }
-}
-
-#[derive(Serialize, Deserialize)]
-pub struct Part {
- pub key: u64,
- pub number: String,
- pub name: String,
- pub sources: Vec<u64>,
- pub categories: Vec<u64>,
- pub fits_cars: Vec<u64>,
-}
-
-#[derive(Serialize, Deserialize)]
-pub struct Car {
- pub doors: u8,
- //pub engine: Engine,
- pub make: String,
- pub model: String,
- //pub transmission: Transmission,
- pub trim: String,
- pub year: u16,
-}
-
-#[derive(Serialize, Deserialize)]
-pub enum Source {
- Web(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);