pub struct CompiledSearch { /* private fields */ }Implementations§
Source§impl CompiledSearch
impl CompiledSearch
Sourcepub fn new(patterns: &[String], opts: SearchOptions) -> Result<Self>
pub fn new(patterns: &[String], opts: SearchOptions) -> Result<Self>
Compile patterns and options once.
§Errors
Returns crate::Error::EmptyPatterns if patterns is empty, or crate::Error::Regex
if compilation fails.
Sourcepub fn search_walk(
&self,
root: &Path,
candidates: Option<&[PathBuf]>,
) -> Result<Vec<Match>>
pub fn search_walk( &self, root: &Path, candidates: Option<&[PathBuf]>, ) -> Result<Vec<Match>>
Walk root with ignore rules (or scan only candidates when Some).
§Errors
Returns crate::Error::Io if the corpus root cannot be canonicalized, or crate::Error::Ignore
for directory walk failures.
pub fn patterns(&self) -> &[String]
Trait Implementations§
Source§impl Clone for CompiledSearch
impl Clone for CompiledSearch
Source§fn clone(&self) -> CompiledSearch
fn clone(&self) -> CompiledSearch
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for CompiledSearch
impl RefUnwindSafe for CompiledSearch
impl Send for CompiledSearch
impl Sync for CompiledSearch
impl Unpin for CompiledSearch
impl UnsafeUnpin for CompiledSearch
impl UnwindSafe for CompiledSearch
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> 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