pub struct Directory(/* private fields */);
Implementations§
Source§impl Directory
impl Directory
Sourcepub fn read<'a>(&self) -> ReadDir<'a> ⓘ
pub fn read<'a>(&self) -> ReadDir<'a> ⓘ
Will try to read a directory into a 512 byte buffer.
The iterator will try to keep requesting entries until the directory is EOF or produces an error.
Best case number of syscalls to drain the interator is 2.
Worst case, assuming each entity has the linux-max name of 256 bytes is
n + 1
when n
is the number of files.
Sourcepub fn remove_all(&self) -> Result<()>
pub fn remove_all(&self) -> Result<()>
Removes all children of this directory. Potentially destructive.
§Errors
Os errors relating to permissions
Auto Trait Implementations§
impl Freeze for Directory
impl RefUnwindSafe for Directory
impl Send for Directory
impl Sync for Directory
impl Unpin for Directory
impl UnwindSafe for Directory
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