Struct cap_primitives::fs::OpenOptions
source · pub struct OpenOptions { /* private fields */ }
Expand description
Options and flags which can be used to configure how a file is opened.
This corresponds to std::fs::OpenOptions
.
This OpenOptions
has no open
method. To open a file with an
OptionOptions
, first obtain a Dir
containing the path, and then call
Dir::open_with
.
Implementations§
source§impl OpenOptions
impl OpenOptions
sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a blank new set of options ready for configuration.
This corresponds to std::fs::OpenOptions::new
.
sourcepub fn read(&mut self, read: bool) -> &mut Self
pub fn read(&mut self, read: bool) -> &mut Self
Sets the option for read access.
This corresponds to std::fs::OpenOptions::read
.
sourcepub fn write(&mut self, write: bool) -> &mut Self
pub fn write(&mut self, write: bool) -> &mut Self
Sets the option for write access.
This corresponds to std::fs::OpenOptions::write
.
sourcepub fn append(&mut self, append: bool) -> &mut Self
pub fn append(&mut self, append: bool) -> &mut Self
Sets the option for the append mode.
This corresponds to std::fs::OpenOptions::append
.
sourcepub fn truncate(&mut self, truncate: bool) -> &mut Self
pub fn truncate(&mut self, truncate: bool) -> &mut Self
Sets the option for truncating a previous file.
This corresponds to std::fs::OpenOptions::truncate
.
sourcepub fn create(&mut self, create: bool) -> &mut Self
pub fn create(&mut self, create: bool) -> &mut Self
Sets the option to create a new file.
This corresponds to std::fs::OpenOptions::create
.
sourcepub fn create_new(&mut self, create_new: bool) -> &mut Self
pub fn create_new(&mut self, create_new: bool) -> &mut Self
Sets the option to always create a new file.
This corresponds to std::fs::OpenOptions::create_new
.
Trait Implementations§
source§impl Clone for OpenOptions
impl Clone for OpenOptions
source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more