pub enum TextQuery {
Empty,
Term(String),
Phrase(String),
Not(Box<TextQuery>),
And(Vec<TextQuery>),
Or(Vec<TextQuery>),
}Expand description
A constrained full-text query representation for FathomDB’s safe search API.
TextQuery models the subset of boolean search supported by
QueryBuilder::text_search:
literal terms, quoted phrases, uppercase OR, uppercase NOT, and
implicit AND by adjacency.
Variants§
Empty
An empty query.
Term(String)
A literal search term.
Phrase(String)
A literal quoted phrase.
Not(Box<TextQuery>)
A negated child query.
And(Vec<TextQuery>)
A conjunction of child queries.
Or(Vec<TextQuery>)
A disjunction of child queries.
Implementations§
Source§impl TextQuery
impl TextQuery
Sourcepub fn parse(raw: &str) -> Self
pub fn parse(raw: &str) -> Self
Parse raw user or agent input into FathomDB’s supported text-query subset.
Parsing is intentionally forgiving. Only exact uppercase OR and NOT
tokens are treated as operators; unsupported or malformed syntax is
downgraded to literal terms instead of being passed through as raw FTS5.
Trait Implementations§
impl Eq for TextQuery
impl StructuralPartialEq for TextQuery
Auto Trait Implementations§
impl Freeze for TextQuery
impl RefUnwindSafe for TextQuery
impl Send for TextQuery
impl Sync for TextQuery
impl Unpin for TextQuery
impl UnsafeUnpin for TextQuery
impl UnwindSafe for TextQuery
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