diff options
Diffstat (limited to 'src/filters')
-rw-r--r-- | src/filters/values.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/filters/values.rs b/src/filters/values.rs index f64d6dd..3109ef4 100644 --- a/src/filters/values.rs +++ b/src/filters/values.rs @@ -18,7 +18,7 @@ use std::{ use chrono::{DateTime, Duration, Utc}; -use super::{log::LogFilter, Filter}; +use super::{log::LogFilter, Filter, Inclusion}; use crate::{EarlyLogResult, LogResult}; /// A producer for a given value. @@ -101,6 +101,15 @@ impl<V> Filter<EarlyLogResult, LogResult> for Comparator<V> where V: Ord, { + fn filter_early(&self, early_log: &EarlyLogResult) -> Inclusion { + self.0 + .produce_early(early_log) + .and_then(|lhs| self.2.produce_early(early_log).map(|rhs| lhs.cmp(&rhs))) + .map(|ordering| self.1.matches(ordering)) + .map(Into::into) + .unwrap_or(Inclusion::Unknown) + } + fn filter(&self, log: &LogResult) -> bool { let lhs = self.0.produce(log); let rhs = self.2.produce(log); |