Crate quicklog_flush

source ·
Expand description

Flush trait

Simple trait that allows an underlying implementation of Flush to perform some type of IO operation, i.e. writing to file, writing to stdout, etc

Example usage of Flush

use quicklog_flush::Flush;
impl Quicklog {
    fn flush_logger(&mut self) {
        while let Some(item) = queue.pop_front() {
            let log_string = serialize_into_string(item);
            // flusher implements `Flush` trait
            flusher.flush_one(log_string);
        }
    }
}

Modules

Traits

  • Simple trait that allows an underlying implementation of Flush to perform some type of IO operation, i.e. writing to file, writing to stdout, etc