Trait rusty_logger::modules::Module [−][src]
pub trait Module {
fn print(&mut self, msg: &LogMessage<'_>) -> String;
}
Expand description
Trait that allows your struct to be implemented as a logger module
Example
use rusty_logger::modules::Module;
use rusty_logger::logger::LogMessage;
struct IncrementalModule {n: usize};
impl Module for IncrementalModule {
fn print(&mut self, msg: &LogMessage) -> String {
self.n = self.n + 1;
(self.n - 1).to_string()
}
}