Implement {and,or}_not() variants
This commit is contained in:
parent
d4cee5459f
commit
34e62aaade
1 changed files with 12 additions and 0 deletions
|
@ -20,6 +20,12 @@ pub trait Filter {
|
||||||
Or::new(Box::new(self), other)
|
Or::new(Box::new(self), other)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn or_not(self, other: Box<Filter>) -> Or
|
||||||
|
where Self: Sized + 'static
|
||||||
|
{
|
||||||
|
self.or(Box::new(Not::new(other)))
|
||||||
|
}
|
||||||
|
|
||||||
fn or3(self, other: Box<Filter>, other2: Box<Filter>) -> Or
|
fn or3(self, other: Box<Filter>, other2: Box<Filter>) -> Or
|
||||||
where Self: Sized + 'static
|
where Self: Sized + 'static
|
||||||
{
|
{
|
||||||
|
@ -38,5 +44,11 @@ pub trait Filter {
|
||||||
And::new(Box::new(self), Box::new(And::new(other, other2)))
|
And::new(Box::new(self), Box::new(And::new(other, other2)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn and_not(self, other: Box<Filter>) -> And
|
||||||
|
where Self: Sized + 'static
|
||||||
|
{
|
||||||
|
self.and(Box::new(Not::new(other)))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue