Add BoolFilter
This commit is contained in:
parent
5cd2964fe3
commit
79c1edcbd1
2 changed files with 25 additions and 0 deletions
22
libimagentryfilter/src/builtin/bool_filter.rs
Normal file
22
libimagentryfilter/src/builtin/bool_filter.rs
Normal file
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,2 +1,5 @@
|
|||
pub mod content;
|
||||
pub mod header;
|
||||
|
||||
pub mod bool_filter;
|
||||
|
||||
|
|
Loading…
Reference in a new issue