rnetmon/src/plugins/output/mod.rs

15 lines
412 B
Rust

pub mod bluetooth_lightbulb;
pub mod espeak;
pub mod stdout;
use crate::output::*;
use std::collections::HashMap;
pub fn factory(name: &str, config: &HashMap<String, serde_yaml::Value>) -> Box<Output + Send> {
match name {
"stdout" => Box::new(stdout::Stdout::new(&config)),
"espeak" => Box::new(espeak::Espeak::new(&config)),
_ => panic!("Unknown monitor name: {}", name),
}
}