diff options
Diffstat (limited to 'src/output/pipeline.rs')
-rw-r--r-- | src/output/pipeline.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/output/pipeline.rs b/src/output/pipeline.rs index fb23a6f..9664928 100644 --- a/src/output/pipeline.rs +++ b/src/output/pipeline.rs @@ -1,22 +1,24 @@ -use super::{formats::Format, aggregators::Aggregator}; use super::super::LogResult; +use super::{aggregators::Aggregator, formats::Format}; use std::{io::Write, sync::Mutex}; - pub struct Pipeline { format: Box<dyn Format>, aggregator: Box<dyn Aggregator>, writer: Mutex<Box<dyn Write + Send>>, } - impl Pipeline { - pub fn new<W: Write + 'static + Send, F: Format + 'static, A: Aggregator + 'static>(writer: W, format: F, aggregator: A) -> Pipeline { + pub fn new( + writer: Box<dyn Write + Send>, + format: Box<dyn Format>, + aggregator: Box<dyn Aggregator>, + ) -> Pipeline { Pipeline { - format: Box::new(format), - aggregator: Box::new(aggregator), - writer: Mutex::new(Box::new(writer)), + format, + aggregator, + writer: Mutex::new(writer), } } |