pub enum Predicate<'a> {
Eq(&'a str),
Contains(Finder<'a>),
StartsWith(&'a str),
EndsWith(&'a str),
IEqAscii(&'a str),
IStartsWithAscii(&'a str),
IEndsWithAscii(&'a str),
Regex(Regex),
}
Expand description
A string based predicate
Variants§
Eq(&'a str)
Contains(Finder<'a>)
StartsWith(&'a str)
EndsWith(&'a str)
IEqAscii(&'a str)
Equality ignoring ASCII case
IStartsWithAscii(&'a str)
Starts with ignoring ASCII case
IEndsWithAscii(&'a str)
Ends with ignoring ASCII case
Regex(Regex)
Implementations§
Source§impl<'a> Predicate<'a>
impl<'a> Predicate<'a>
Sourcepub fn like(pattern: &'a str) -> Result<Self, ArrowError>
pub fn like(pattern: &'a str) -> Result<Self, ArrowError>
Create a predicate for the given like pattern
pub fn contains(needle: &'a str) -> Self
Sourcepub fn ilike(pattern: &'a str, is_ascii: bool) -> Result<Self, ArrowError>
pub fn ilike(pattern: &'a str, is_ascii: bool) -> Result<Self, ArrowError>
Create a predicate for the given ilike pattern
Sourcepub fn evaluate(&self, haystack: &str) -> bool
pub fn evaluate(&self, haystack: &str) -> bool
Evaluate this predicate against the given haystack
Sourcepub fn evaluate_array<'i, T>(&self, array: T, negate: bool) -> BooleanArraywhere
T: ArrayAccessor<Item = &'i str>,
pub fn evaluate_array<'i, T>(&self, array: T, negate: bool) -> BooleanArraywhere
T: ArrayAccessor<Item = &'i str>,
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 Predicate<'a>
impl<'a> RefUnwindSafe for Predicate<'a>
impl<'a> Send for Predicate<'a>
impl<'a> Sync for Predicate<'a>
impl<'a> Unpin for Predicate<'a>
impl<'a> UnwindSafe for Predicate<'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