pub struct OpenOptions { /* private fields */ }Expand description
Options for opening a file.
This struct provides a builder-style API for configuring how a file
should be opened, similar to std::fs::OpenOptions. The individual
flags are stored in a single bitfield and exposed via is_* accessors.
Implementations§
Source§impl OpenOptions
impl OpenOptions
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn create_new(self, value: bool) -> Self
pub fn create_new(self, value: bool) -> Self
Set the create_new flag.
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn is_create_new(&self) -> bool
pub fn is_create_new(&self) -> bool
Returns true if the file must be created new (failing if it exists).
Sourcepub fn is_truncate(&self) -> bool
pub fn is_truncate(&self) -> bool
Returns true if the file will be truncated to zero length on open.
Sourcepub fn is_append(&self) -> bool
pub fn is_append(&self) -> bool
Returns true if writes will be appended to the end of the file.
Sourcepub fn create_write() -> Self
pub fn create_write() -> Self
Create options for creating and writing a new file (truncating if exists).
Sourcepub fn create_new_write() -> Self
pub fn create_new_write() -> Self
Create options for creating a new file for writing (fails if exists).
Trait Implementations§
Source§impl Clone for OpenOptions
impl Clone for OpenOptions
Source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenOptions
impl Debug for OpenOptions
Source§impl Default for OpenOptions
impl Default for OpenOptions
Source§fn default() -> OpenOptions
fn default() -> OpenOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OpenOptions
impl RefUnwindSafe for OpenOptions
impl Send for OpenOptions
impl Sync for OpenOptions
impl Unpin for OpenOptions
impl UnsafeUnpin for OpenOptions
impl UnwindSafe for OpenOptions
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