use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct Schema {
pub name: String,
pub documentation: Option<String>,
pub columns: Vec<Column>,
}
#[derive(Debug, Clone, Serialize)]
pub struct Column {
pub mnemonic: String,
pub name: String,
pub engineering_type: EngineeringType,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(transparent)]
pub struct EngineeringType(String);
impl EngineeringType {
pub fn new(value: impl Into<String>) -> Self {
Self(value.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
pub fn is(&self, other: &str) -> bool {
self.0 == other
}
}
impl From<String> for EngineeringType {
fn from(s: String) -> Self {
Self(s)
}
}