pub enum WriteMode {
AlwaysAppend,
AppendOrCreate,
CreateOrTruncate,
AlwaysCreate,
Atomic,
}Expand description
File Already Exists File Does not Exist
AA Append Dies
AoC Append Create
CoT Truncate Create
AC Dies CreateAtomic is like CreateOrTruncate, but it tries to be more atomic.
It first creates a tmp file with a different name, then renames the tmp file.
If it fails, it might leave a tmp file. But you’ll never have a partially
written file.
Variants§
Trait Implementations§
Source§impl From<WriteMode> for OpenOptions
impl From<WriteMode> for OpenOptions
Source§fn from(m: WriteMode) -> OpenOptions
fn from(m: WriteMode) -> OpenOptions
Converts to this type from the input type.
impl Copy for WriteMode
impl Eq for WriteMode
impl StructuralPartialEq for WriteMode
Auto Trait Implementations§
impl Freeze for WriteMode
impl RefUnwindSafe for WriteMode
impl Send for WriteMode
impl Sync for WriteMode
impl Unpin for WriteMode
impl UnwindSafe for WriteMode
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