diff --git a/libimagentryfilter/src/builtin/bool_filter.rs b/libimagentryfilter/src/builtin/bool_filter.rs new file mode 100644 index 00000000..14dbbc8e --- /dev/null +++ b/libimagentryfilter/src/builtin/bool_filter.rs @@ -0,0 +1,22 @@ +use libimagstore::store::Entry; + +use filter::Filter; + +pub struct BoolFilter(bool); + +impl BoolFilter { + + pub fn new(b: bool) -> BoolFilter { + BoolFilter(b) + } + +} + +impl Filter for BoolFilter { + + fn filter(&self, _: &Entry) -> bool { + self.0 + } + +} + diff --git a/libimagentryfilter/src/builtin/mod.rs b/libimagentryfilter/src/builtin/mod.rs index 260f1a1b..be547532 100644 --- a/libimagentryfilter/src/builtin/mod.rs +++ b/libimagentryfilter/src/builtin/mod.rs @@ -1,2 +1,5 @@ pub mod content; pub mod header; + +pub mod bool_filter; +