pub struct WalkEntry { /* private fields */ }Available on crate feature
fs only.Expand description
Implementations§
Source§impl WalkEntry
impl WalkEntry
Sourcepub fn depth(&self) -> usize
pub fn depth(&self) -> usize
Get the depth of this entry, 0 is root, 1 is an entry in the root, etc.
Sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Get the path by joining the walk root and the relative path of the entry
Sourcepub fn rel_path(&self) -> Result<PathBuf>
pub fn rel_path(&self) -> Result<PathBuf>
Get this entry’s path relative to the walk root, without a leading ./.
Returns Ok(None) when the entry is the root of the walk (only emitted
when include_dir_entries is
enabled). Returns an error if the entry path is unexpectedly not
contained within the walk root.
for entry in cu::fs::walk("src")? {
let entry = entry?;
cu::info!("{}", entry.rel_path()?.display());
}Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Check if the entry is a symlink.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WalkEntry
impl !UnwindSafe for WalkEntry
impl Freeze for WalkEntry
impl Send for WalkEntry
impl Sync for WalkEntry
impl Unpin for WalkEntry
impl UnsafeUnpin for WalkEntry
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