pub struct QueryBuilder { /* private fields */ }
Expand description
A builder for constructing Anki search queries
This builder provides a fluent interface for creating properly escaped and formatted Anki search queries. It helps prevent syntax errors and ensures proper escaping of special characters.
Implementations§
Source§impl QueryBuilder
impl QueryBuilder
Sourcepub fn text<S: AsRef<str>>(self, text: S) -> Self
pub fn text<S: AsRef<str>>(self, text: S) -> Self
Adds free text to search for across all fields
Special characters are automatically escaped.
Sourcepub fn field<S: AsRef<str>>(self, field_name: S) -> FieldQueryBuilder
pub fn field<S: AsRef<str>>(self, field_name: S) -> FieldQueryBuilder
Specifies a field to search in
This must be followed by one of the field content methods like contains
.
Sourcepub fn in_field(self, field: &Field) -> FieldQueryBuilder
pub fn in_field(self, field: &Field) -> FieldQueryBuilder
Specifies a field to search in using a Field reference
This must be followed by one of the field content methods like contains
.
Sourcepub fn in_field_ref(self, field_ref: FieldRef<'_>) -> FieldQueryBuilder
pub fn in_field_ref(self, field_ref: FieldRef<'_>) -> FieldQueryBuilder
Specifies a field to search in using a FieldRef
This ensures the field actually exists in a model.
This must be followed by one of the field content methods like contains
.
Sourcepub fn in_deck_obj(self, deck: &Deck) -> Self
pub fn in_deck_obj(self, deck: &Deck) -> Self
Searches for cards in the specified deck object
Sourcepub fn interval_at_least(self, days: u32) -> Self
pub fn interval_at_least(self, days: u32) -> Self
Searches for cards with an interval greater than or equal to the specified days
Sourcepub fn reps_less_than(self, count: u32) -> Self
pub fn reps_less_than(self, count: u32) -> Self
Searches for cards with fewer than the specified number of repetitions
Sourcepub fn added_in_last_n_days(self, days: u32) -> Self
pub fn added_in_last_n_days(self, days: u32) -> Self
Searches for cards added within the last n days
Sourcepub fn rated_today(self) -> Self
pub fn rated_today(self) -> Self
Searches for cards rated today
Sourcepub fn rated_in_last_n_days(self, days: u32) -> Self
pub fn rated_in_last_n_days(self, days: u32) -> Self
Searches for cards rated within the last n days
Source§impl QueryBuilder
Convenience functions for common queries
impl QueryBuilder
Convenience functions for common queries
Sourcepub fn deck<S: AsRef<str>>(deck: S) -> Self
pub fn deck<S: AsRef<str>>(deck: S) -> Self
Creates a query that searches for cards in the specified deck
Sourcepub fn tag<S: AsRef<str>>(tag: S) -> Self
pub fn tag<S: AsRef<str>>(tag: S) -> Self
Creates a query that searches for cards with the specified tag
Trait Implementations§
Source§impl Clone for QueryBuilder
impl Clone for QueryBuilder
Source§fn clone(&self) -> QueryBuilder
fn clone(&self) -> QueryBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more