pub struct SearchQuery { /* private fields */ }Implementations§
Source§impl SearchQuery
impl SearchQuery
Sourcepub fn build_matcher(&self) -> Result<RegexMatcher, SearchError>
pub fn build_matcher(&self) -> Result<RegexMatcher, SearchError>
Builds a regex matcher from the compiled patterns and options.
§Errors
Returns SearchError::RegexBuild if pattern compilation fails.
pub fn build_searcher( &self, line_number: bool, max_matches: Option<usize>, include_context: bool, ) -> Searcher
Source§impl SearchQuery
impl SearchQuery
Sourcepub fn new(
patterns: &[String],
opts: SearchOptions,
) -> Result<Self, SearchError>
pub fn new( patterns: &[String], opts: SearchOptions, ) -> Result<Self, SearchError>
Creates a new search query from patterns and options.
§Errors
Returns SearchError::EmptyPatterns if the pattern list is empty.
pub fn patterns(&self) -> &[String]
pub const fn opts(&self) -> &SearchOptions
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SearchQuery
impl RefUnwindSafe for SearchQuery
impl Send for SearchQuery
impl Sync for SearchQuery
impl Unpin for SearchQuery
impl UnsafeUnpin for SearchQuery
impl UnwindSafe for SearchQuery
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> 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