completed basic functions
This commit is contained in:
27
src/properties.rs
Normal file
27
src/properties.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
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),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user