pub struct DirMethodFlags<'a> { /* private fields */ }Expand description
‘Dir::with(&self)’/‘Dir::with(&self)’ creates a new DirMethodsFlags object with default (O_CLOEXEC|O_NOFOLLOW) flags. One can then freely add/remove flags to the set. Implements proxies for the Dir:: methods that open contained objects.
Implementations§
Source§impl<'a> DirMethodFlags<'a>
impl<'a> DirMethodFlags<'a>
Sourcepub fn open_file<P: AsPath>(&self, path: P) -> Result<File>
pub fn open_file<P: AsPath>(&self, path: P) -> Result<File>
Open file for reading in this directory
Sourcepub fn write_file<P: AsPath>(&self, path: P, mode: mode_t) -> Result<File>
pub fn write_file<P: AsPath>(&self, path: P, mode: mode_t) -> Result<File>
Open file for writing, create if necessary, truncate on open
Sourcepub fn append_file<P: AsPath>(&self, path: P, mode: mode_t) -> Result<File>
pub fn append_file<P: AsPath>(&self, path: P, mode: mode_t) -> Result<File>
Open file for append, create if necessary
Sourcepub fn create_file<P: AsPath>(&self, path: P, mode: mode_t) -> Result<File>
👎Deprecated since 0.1.7: please use write_file instead
pub fn create_file<P: AsPath>(&self, path: P, mode: mode_t) -> Result<File>
write_file insteadCreate file for writing (and truncate) in this directory
Sourcepub fn new_unnamed_file(&self, mode: mode_t) -> Result<File>
pub fn new_unnamed_file(&self, mode: mode_t) -> Result<File>
Create a tmpfile in this directory which isn’t linked to any filename
Sourcepub fn new_file<P: AsPath>(&self, path: P, mode: mode_t) -> Result<File>
pub fn new_file<P: AsPath>(&self, path: P, mode: mode_t) -> Result<File>
Create file if not exists, fail if exists
Sourcepub fn clone_upgrade(&self) -> Result<Dir>
pub fn clone_upgrade(&self) -> Result<Dir>
Creates a new ‘Normal’ independently owned handle to the underlying directory.
Trait Implementations§
Source§impl<'a> Clone for DirMethodFlags<'a>
impl<'a> Clone for DirMethodFlags<'a>
Source§fn clone(&self) -> DirMethodFlags<'a>
fn clone(&self) -> DirMethodFlags<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for DirMethodFlags<'a>
Auto Trait Implementations§
impl<'a> Freeze for DirMethodFlags<'a>
impl<'a> RefUnwindSafe for DirMethodFlags<'a>
impl<'a> Send for DirMethodFlags<'a>
impl<'a> Sync for DirMethodFlags<'a>
impl<'a> Unpin for DirMethodFlags<'a>
impl<'a> UnwindSafe for DirMethodFlags<'a>
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