27 lines
548 B
Rust
27 lines
548 B
Rust
use std::collections::HashMap;
|
|
|
|
pub struct Properties {
|
|
pub(crate) properties: HashMap<String, Property>
|
|
}
|
|
|
|
impl Properties {
|
|
pub(crate) fn new() -> Self {
|
|
Self {
|
|
properties: HashMap::new()
|
|
}
|
|
}
|
|
}
|
|
|
|
pub enum Property {
|
|
Integer(i32),
|
|
Text(String),
|
|
}
|
|
|
|
impl std::fmt::Display for Property {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
match self {
|
|
Self::Integer(i) => write!(f, "{}", i),
|
|
Self::Text(t) => write!(f, "{}", t),
|
|
}
|
|
}
|
|
} |