#[non_exhaustive]pub struct FindQuery {Show 18 fields
pub pattern: String,
pub kind: MatchKind,
pub max_depth: Option<usize>,
pub min_depth: Option<usize>,
pub min_size: Option<u64>,
pub max_size: Option<u64>,
pub modified_after: Option<SystemTime>,
pub modified_before: Option<SystemTime>,
pub extension: Option<String>,
pub extensions: Vec<String>,
pub file_type: Option<FileType>,
pub case_sensitive: Option<bool>,
pub fixed_strings: bool,
pub full_path: bool,
pub hidden: bool,
pub follow_links: bool,
pub absolute_path: bool,
pub downloadable: bool,
}Expand description
Filters supported by FindEngine.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pattern: String§kind: MatchKind§max_depth: Option<usize>§min_depth: Option<usize>§min_size: Option<u64>§max_size: Option<u64>§modified_after: Option<SystemTime>§modified_before: Option<SystemTime>§extension: Option<String>§extensions: Vec<String>§file_type: Option<FileType>§case_sensitive: Option<bool>§fixed_strings: bool§full_path: bool§follow_links: bool§absolute_path: bool§downloadable: boolImplementations§
Source§impl FindQuery
impl FindQuery
pub fn exact(pattern: impl Into<String>) -> Self
pub fn glob(pattern: impl Into<String>) -> Self
pub fn regex(pattern: impl Into<String>) -> Self
pub const fn depth(self, max_depth: usize) -> Self
pub const fn size(self, min: Option<u64>, max: Option<u64>) -> Self
pub fn extension(self, extension: impl Into<String>) -> Self
pub fn extensions(self, exts: Vec<String>) -> Self
pub const fn file_type(self, file_type: FileType) -> Self
pub const fn modified_after(self, time: SystemTime) -> Self
pub const fn modified_before(self, time: SystemTime) -> Self
Sourcepub fn parse_size_constraints(
size_strs: &[String],
) -> Result<(Option<u64>, Option<u64>)>
pub fn parse_size_constraints( size_strs: &[String], ) -> Result<(Option<u64>, Option<u64>)>
Parse size constraints from fd-find style strings.
§Errors
Returns an error if the string cannot be parsed.
Sourcepub fn parse_time_constraints(
within_strs: &[String],
before_strs: &[String],
modified_strs: &[String],
) -> Result<(Option<SystemTime>, Option<SystemTime>)>
pub fn parse_time_constraints( within_strs: &[String], before_strs: &[String], modified_strs: &[String], ) -> Result<(Option<SystemTime>, Option<SystemTime>)>
Parse time constraints from human-readable strings.
§Errors
Returns an error if the string cannot be parsed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FindQuery
impl RefUnwindSafe for FindQuery
impl Send for FindQuery
impl Sync for FindQuery
impl Unpin for FindQuery
impl UnsafeUnpin for FindQuery
impl UnwindSafe for FindQuery
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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