pub struct DirBuilder { /* private fields */ }
Expand description
A builder used to create directories in various manners.
This corresponds to std::fs::DirBuilder
.
Unlike std::fs::DirBuilder
, this API has no DirBuilder::create
, because
creating directories requires a capability. Use Dir::create_dir_with
instead.
We need to define our own version because the libstd `DirBuilder` doesn't
have public accessors that we can use.
Implementations§
Source§impl DirBuilder
impl DirBuilder
Sourcepub const fn new() -> DirBuilder
pub const fn new() -> DirBuilder
Creates a new set of options with default mode/security settings for all platforms and also non-recursive.
This corresponds to std::fs::DirBuilder::new
.
Sourcepub fn recursive(&mut self, recursive: bool) -> &mut DirBuilder
pub fn recursive(&mut self, recursive: bool) -> &mut DirBuilder
Indicates that directories should be created recursively, creating all parent directories.
This corresponds to std::fs::DirBuilder::recursive
.
Sourcepub const fn options(&self) -> &DirOptions
pub const fn options(&self) -> &DirOptions
Return the DirOptions
contained in this DirBuilder
.
Sourcepub const fn is_recursive(&self) -> bool
pub const fn is_recursive(&self) -> bool
Return the value of the recursive
flag.
Trait Implementations§
Source§impl Debug for DirBuilder
impl Debug for DirBuilder
Source§impl DirBuilderExt for DirBuilder
Available on Unix only.
impl DirBuilderExt for DirBuilder
Available on Unix only.
Source§fn mode(&mut self, mode: u32) -> &mut DirBuilder
fn mode(&mut self, mode: u32) -> &mut DirBuilder
Sets the mode to create new directories with. This option defaults to
0o777.
Auto Trait Implementations§
impl Freeze for DirBuilder
impl RefUnwindSafe for DirBuilder
impl Send for DirBuilder
impl Sync for DirBuilder
impl Unpin for DirBuilder
impl UnwindSafe for DirBuilder
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