diff --git a/src/filter_plugin/head.rs b/src/filter_plugin/head.rs index 25cef4c..2c21e29 100644 --- a/src/filter_plugin/head.rs +++ b/src/filter_plugin/head.rs @@ -32,6 +32,12 @@ impl FilterPlugin for HeadBytesFilter { } Ok(()) } + + fn clone_box(&self) -> Box { + Box::new(Self { + remaining: self.remaining, + }) + } } pub struct HeadLinesFilter { @@ -63,4 +69,10 @@ impl FilterPlugin for HeadLinesFilter { } Ok(()) } + + fn clone_box(&self) -> Box { + Box::new(Self { + remaining: self.remaining, + }) + } } diff --git a/src/filter_plugin/skip.rs b/src/filter_plugin/skip.rs index 783118f..7112cd4 100644 --- a/src/filter_plugin/skip.rs +++ b/src/filter_plugin/skip.rs @@ -54,6 +54,12 @@ impl FilterPlugin for SkipBytesFilter { std::io::copy(&mut *reader, &mut *writer)?; Ok(()) } + + fn clone_box(&self) -> Box { + Box::new(Self { + remaining: self.remaining, + }) + } } pub struct SkipLinesFilter { @@ -102,4 +108,10 @@ impl FilterPlugin for SkipLinesFilter { } Ok(()) } + + fn clone_box(&self) -> Box { + Box::new(Self { + remaining: self.remaining, + }) + } } diff --git a/src/filter_plugin/tail.rs b/src/filter_plugin/tail.rs index b80a854..072229e 100644 --- a/src/filter_plugin/tail.rs +++ b/src/filter_plugin/tail.rs @@ -61,6 +61,13 @@ impl FilterPlugin for TailBytesFilter { (&mut *writer).write_all(&result)?; Ok(()) } + + fn clone_box(&self) -> Box { + Box::new(Self { + buffer: self.buffer.clone(), + count: self.count, + }) + } } pub struct TailLinesFilter { @@ -115,4 +122,11 @@ impl FilterPlugin for TailLinesFilter { } Ok(()) } + + fn clone_box(&self) -> Box { + Box::new(Self { + lines: self.lines.clone(), + count: self.count, + }) + } }