use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct Car {
doors: u8,
engine: Engine,
make: String,
model: String,
transmission: Transmission,
trim: String,
year: u16, // I'll worry about this in 65534 AD.
}
#[derive(Serialize, Deserialize)]
pub struct Part {
name: String,
compatible_cars: Vec<Car>,
sources: Vec<Source>,
categories: Vec<Category>,
}
#[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);