pub struct SearchRequest {
pub root: PathBuf,
pub patterns: Vec<String>,
pub exclude_patterns: Vec<String>,
pub options: ListOptions,
pub cache: CachePolicy,
}Available on crate feature
search only.Expand description
Request for a glob-based search.
Fields§
§root: PathBufRoot directory to search.
patterns: Vec<String>Include glob patterns (matched against paths relative to root).
exclude_patterns: Vec<String>Optional exclude patterns.
options: ListOptionsListing / traversal options.
cache: CachePolicyCache policy for this request.
Caching only occurs when an explicit DiscoveryCache is passed to
search_with_cache. search never reads or writes a cache.
Implementations§
Source§impl SearchRequest
impl SearchRequest
Sourcepub fn new(
root: impl Into<PathBuf>,
patterns: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn new( root: impl Into<PathBuf>, patterns: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Create a search request with include patterns and default options.
Sourcepub fn exclude(
self,
patterns: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn exclude( self, patterns: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add exclude patterns.
Sourcepub fn options(self, options: ListOptions) -> Self
pub fn options(self, options: ListOptions) -> Self
Set list options.
Sourcepub fn cache_policy(self, policy: CachePolicy) -> Self
pub fn cache_policy(self, policy: CachePolicy) -> Self
Set cache policy (only effective with an explicit cache in search_with_cache).
Trait Implementations§
Source§impl Clone for SearchRequest
impl Clone for SearchRequest
Source§fn clone(&self) -> SearchRequest
fn clone(&self) -> SearchRequest
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 SearchRequest
impl Debug for SearchRequest
Auto Trait Implementations§
impl Freeze for SearchRequest
impl RefUnwindSafe for SearchRequest
impl Send for SearchRequest
impl Sync for SearchRequest
impl Unpin for SearchRequest
impl UnsafeUnpin for SearchRequest
impl UnwindSafe for SearchRequest
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