pub enum Query {
All,
Tri(Trigram),
And(Vec<Query>),
Or(Vec<Query>),
}Expand description
A boolean formula over trigrams. All means “no constraint” — scan everything (the safe
fallback). Leaves are individual trigrams that must be present.
Variants§
Implementations§
Source§impl Query
impl Query
Sourcepub fn for_pattern(pattern: &str, opts: Options) -> Query
pub fn for_pattern(pattern: &str, opts: Options) -> Query
Build a trigram query for pattern. Any condition we can’t reason about soundly yields
Query::All (full scan) rather than risking a missed match.
Sourcepub fn is_fallback(&self) -> bool
pub fn is_fallback(&self) -> bool
True if this query imposes no constraint (the engine must fall back to a full scan).
Trait Implementations§
impl Eq for Query
impl StructuralPartialEq for Query
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more