pub enum SearchQueryCondition {
Contains {
value: String,
},
EndsWith {
value: String,
},
Equals {
value: String,
},
Or {
value: Vec<SearchQueryCondition>,
},
Regex {
value: String,
},
StartsWith {
value: String,
},
}
Expand description
Condition used to find a match in a search query
Variants§
Contains
Text is found anywhere (all regex patterns are escaped)
EndsWith
Begins with some text (all regex patterns are escaped)
Equals
Matches some text exactly (all regex patterns are escaped)
Or
Fields
§
value: Vec<SearchQueryCondition>
Any of the conditions match
Regex
Matches some regex
StartsWith
Begins with some text (all regex patterns are escaped)
Implementations§
source§impl SearchQueryCondition
impl SearchQueryCondition
sourcepub fn ends_with(value: impl Into<String>) -> Self
pub fn ends_with(value: impl Into<String>) -> Self
Creates a new instance with EndsWith
variant
sourcepub fn or<I, C>(value: I) -> Selfwhere
I: IntoIterator<Item = C>,
C: Into<SearchQueryCondition>,
pub fn or<I, C>(value: I) -> Selfwhere I: IntoIterator<Item = C>, C: Into<SearchQueryCondition>,
Creates a new instance with Or
variant
sourcepub fn starts_with(value: impl Into<String>) -> Self
pub fn starts_with(value: impl Into<String>) -> Self
Creates a new instance with StartsWith
variant
sourcepub fn to_regex_string(&self) -> String
pub fn to_regex_string(&self) -> String
Converts the condition in a regex string
Trait Implementations§
source§impl Clone for SearchQueryCondition
impl Clone for SearchQueryCondition
source§fn clone(&self) -> SearchQueryCondition
fn clone(&self) -> SearchQueryCondition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SearchQueryCondition
impl Debug for SearchQueryCondition
source§impl<'de> Deserialize<'de> for SearchQueryCondition
impl<'de> Deserialize<'de> for SearchQueryCondition
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromStr for SearchQueryCondition
impl FromStr for SearchQueryCondition
source§impl PartialEq<SearchQueryCondition> for SearchQueryCondition
impl PartialEq<SearchQueryCondition> for SearchQueryCondition
source§fn eq(&self, other: &SearchQueryCondition) -> bool
fn eq(&self, other: &SearchQueryCondition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for SearchQueryCondition
impl Serialize for SearchQueryCondition
impl Eq for SearchQueryCondition
impl StructuralEq for SearchQueryCondition
impl StructuralPartialEq for SearchQueryCondition
Auto Trait Implementations§
impl RefUnwindSafe for SearchQueryCondition
impl Send for SearchQueryCondition
impl Sync for SearchQueryCondition
impl Unpin for SearchQueryCondition
impl UnwindSafe for SearchQueryCondition
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