pub struct TimeFilter {
pub modified_before: Option<Duration>,
pub created_before: Option<Duration>,
}Expand description
Time-based filter for matching entries by age (mtime/btime).
Used in addition to glob filters to skip entries that are not yet old enough.
Each threshold is interpreted as a minimum age — an entry matches when its
timestamp is at least the threshold ago (i.e. the timestamp is “before”
now - threshold). When both fields are set, both conditions must hold (AND).
created_before uses the file’s birth time (std::fs::Metadata::created()).
Some Linux filesystems do not expose btime; in that case Self::matches
returns an error rather than silently treating the file as a match.
Fields§
§modified_before: Option<Duration>minimum age based on mtime; entry matches when mtime is at least this old
created_before: Option<Duration>minimum age based on btime; entry matches when btime is at least this old
Implementations§
Source§impl TimeFilter
impl TimeFilter
Sourcepub fn matches(&self, metadata: &Metadata) -> Result<TimeFilterResult>
pub fn matches(&self, metadata: &Metadata) -> Result<TimeFilterResult>
Evaluate this filter against metadata.
Returns:
Ok(TimeFilterResult::Matched)when the entry passes all configured thresholds.Ok(TimeFilterResult::TooNew*)when one or both thresholds are not yet met.Err(_)whencreated_beforeis configured and the underlyingcreated()call fails (e.g., a filesystem that does not expose birth time).
Trait Implementations§
Source§impl Clone for TimeFilter
impl Clone for TimeFilter
Source§fn clone(&self) -> TimeFilter
fn clone(&self) -> TimeFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TimeFilter
impl Debug for TimeFilter
Source§impl Default for TimeFilter
impl Default for TimeFilter
Source§fn default() -> TimeFilter
fn default() -> TimeFilter
Auto Trait Implementations§
impl Freeze for TimeFilter
impl RefUnwindSafe for TimeFilter
impl Send for TimeFilter
impl Sync for TimeFilter
impl Unpin for TimeFilter
impl UnsafeUnpin for TimeFilter
impl UnwindSafe for TimeFilter
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request