pub struct SubstringQueryProcessor { /* private fields */ }Expand description
§Query processor implementation for substring matches
§Examples
This example will demonstrate how to create and use a QueryProcessor that will perform a
substring match on the haystack string.
let substring_query_processor = SubstringQueryProcessor::new("sub");
let parts = substring_query_processor.matching("contains substring").unwrap();
assert_eq!(
parts,
Match::parts(vec![
Part::non_matching("contains "),
Part::matching("sub"),
Part::non_matching("string")
])
);Implementations§
Trait Implementations§
Source§impl Clone for SubstringQueryProcessor
impl Clone for SubstringQueryProcessor
Source§fn clone(&self) -> SubstringQueryProcessor
fn clone(&self) -> SubstringQueryProcessor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SubstringQueryProcessor
impl Debug for SubstringQueryProcessor
Source§impl PartialEq for SubstringQueryProcessor
impl PartialEq for SubstringQueryProcessor
Source§fn eq(&self, other: &SubstringQueryProcessor) -> bool
fn eq(&self, other: &SubstringQueryProcessor) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl QueryProcessor for SubstringQueryProcessor
impl QueryProcessor for SubstringQueryProcessor
Source§fn matching(&self, haystack: &str) -> Option<Match>
fn matching(&self, haystack: &str) -> Option<Match>
Applies generic query to string. Read more
Source§fn matching_expression(
&self,
_haystack: &str,
) -> Option<(String, String, Option<String>)>
fn matching_expression( &self, _haystack: &str, ) -> Option<(String, String, Option<String>)>
Applies expression query to string. Read more
impl StructuralPartialEq for SubstringQueryProcessor
Auto Trait Implementations§
impl Freeze for SubstringQueryProcessor
impl RefUnwindSafe for SubstringQueryProcessor
impl Send for SubstringQueryProcessor
impl Sync for SubstringQueryProcessor
impl Unpin for SubstringQueryProcessor
impl UnsafeUnpin for SubstringQueryProcessor
impl UnwindSafe for SubstringQueryProcessor
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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