#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Property {
#[cfg_attr(feature = "serde", serde(rename = "type"))]
pub type_: String,
pub value: String,
pub comment: String,
pub format: String,
}
impl Default for Property {
fn default() -> Self {
Self {
type_: "String".to_owned(),
value: String::new(),
comment: String::new(),
format: String::new(),
}
}
}
impl Property {
pub fn new(type_: impl Into<String>, value: impl Into<String>) -> Self {
Self {
type_: type_.into(),
value: value.into(),
..Self::default()
}
}
}