pub enum BinaryPredicate<'a> {
Contains(Finder<'a>),
StartsWith(&'a [u8]),
EndsWith(&'a [u8]),
}
Expand description
A binary based predicate
Variants§
Implementations§
Source§impl<'a> BinaryPredicate<'a>
impl<'a> BinaryPredicate<'a>
pub fn contains(needle: &'a [u8]) -> Self
Sourcepub fn evaluate(&self, haystack: &[u8]) -> bool
pub fn evaluate(&self, haystack: &[u8]) -> bool
Evaluate this predicate against the given haystack
Sourcepub fn evaluate_array<'i, T>(&self, array: T, negate: bool) -> BooleanArraywhere
T: ArrayAccessor<Item = &'i [u8]>,
pub fn evaluate_array<'i, T>(&self, array: T, negate: bool) -> BooleanArraywhere
T: ArrayAccessor<Item = &'i [u8]>,
Evaluate this predicate against the elements of array
If negate
is true the result of the predicate will be negated
Auto Trait Implementations§
impl<'a> Freeze for BinaryPredicate<'a>
impl<'a> RefUnwindSafe for BinaryPredicate<'a>
impl<'a> Send for BinaryPredicate<'a>
impl<'a> Sync for BinaryPredicate<'a>
impl<'a> Unpin for BinaryPredicate<'a>
impl<'a> UnwindSafe for BinaryPredicate<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more