ticker/src/ics/mod.rs

21 lines
405 B
Rust

use std::collections::HashMap;
mod tokenizer;
mod parser;
pub use parser::Parser;
pub type Props = Vec<(String, String)>;
#[derive(Debug, PartialEq)]
pub struct Object {
pub name: String,
pub content: HashMap<String, (Props, String)>,
}
impl Object {
pub fn get(&self, key: &'_ str) -> Option<&str> {
self.content.get(key)
.map(|(props, value)| value.as_ref())
}
}