Skip to main content

WalkConfiguration

Struct WalkConfiguration 

Source
#[non_exhaustive]
pub struct WalkConfiguration<'p> { /* private fields */ }
Expand description

Options controlling recursive traversal with walk.

Implementations§

Source§

impl<'p> WalkConfiguration<'p>

Source

pub fn noxdev(self) -> Self

Enable configuration to not traverse mount points.

Note that the mount point directory itself will still be visited (passed to the callback); only traversal into it is prevented. To skip mount point directories entirely, use skip_mountpoints.

Source

pub fn skip_mountpoints(self) -> Self

Skip mount point directories entirely during the walk.

When enabled, directories that are mount points will not be visited (the callback will not be invoked for them) and will not be traversed.

This is independent from noxdevskip_mountpoints controls whether mount point directories are visited at all, while noxdev controls whether the walk traverses into directories on different devices. In practice you may want to use both together.

This option currently only has an effect on Linux.

Source

pub fn sort_by<F>(self, cmp: F) -> Self
where F: Fn(&DirEntry, &DirEntry) -> Ordering + 'static,

Set a function for sorting directory entries.

Source

pub fn sort_by_file_name(self) -> Self

Sort directory entries by file name.

Source

pub fn path_base(self, base: &'p Path) -> Self

Change the inital state for the path. By default the computed path is relative. This has no effect on the filesystem traversal - it solely affects the value of WalkComponent::path.

Trait Implementations§

Source§

impl Debug for WalkConfiguration<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'p> Default for WalkConfiguration<'p>

Source§

fn default() -> WalkConfiguration<'p>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'p> Freeze for WalkConfiguration<'p>

§

impl<'p> !RefUnwindSafe for WalkConfiguration<'p>

§

impl<'p> !Send for WalkConfiguration<'p>

§

impl<'p> !Sync for WalkConfiguration<'p>

§

impl<'p> Unpin for WalkConfiguration<'p>

§

impl<'p> UnsafeUnpin for WalkConfiguration<'p>

§

impl<'p> !UnwindSafe for WalkConfiguration<'p>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.