Struct io_providers::fs::OpenOptions [−][src]
pub struct OpenOptions { /* fields omitted */ }
Options and flags which can be used to configure how a file is opened.
This replicates std::fs::OpenOptions.
Methods
impl OpenOptions
[src]
impl OpenOptions
pub fn new() -> OpenOptions
[src]
pub fn new() -> OpenOptions
Creates a blank new set of options ready for configuration.
All options are initially set to false
.
pub fn read(&mut self, read: bool) -> &mut OpenOptions
[src]
pub fn read(&mut self, read: bool) -> &mut OpenOptions
Sets the option for read access.
This option, when true, will indicate that the file should be read-able if opened.
pub fn write(&mut self, write: bool) -> &mut OpenOptions
[src]
pub fn write(&mut self, write: bool) -> &mut OpenOptions
Sets the option for write access.
This option, when true, will indicate that the file should be write-able if opened.
See std::fs::OpenOptions for more information.
pub fn append(&mut self, append: bool) -> &mut OpenOptions
[src]
pub fn append(&mut self, append: bool) -> &mut OpenOptions
Sets the option for the append mode.
This option, when true, means that writes will append to a file instead
of overwriting previous contents.
Note that setting .write(true).append(true)
has the same effect as
setting only .append(true)
.
See std::fs::OpenOptions for more information.
pub fn truncate(&mut self, truncate: bool) -> &mut OpenOptions
[src]
pub fn truncate(&mut self, truncate: bool) -> &mut OpenOptions
Sets the option for truncating a previous file.
If a file is successfully opened with this option set it will truncate the file to 0 length if it already exists.
See std::fs::OpenOptions for more information.
pub fn create(&mut self, create: bool) -> &mut OpenOptions
[src]
pub fn create(&mut self, create: bool) -> &mut OpenOptions
Sets the option for creating a new file.
This option indicates whether a new file will be created if the file does not yet already exist.
See std::fs::OpenOptions for more information.
pub fn create_new(&mut self, create_new: bool) -> &mut OpenOptions
[src]
pub fn create_new(&mut self, create_new: bool) -> &mut OpenOptions
Sets the option to always create a new file.
This option indicates whether a new file will be created. No file is allowed to exist at the target location, also no (dangling) symlink.
See std::fs::OpenOptions for more information.
Trait Implementations
impl Debug for OpenOptions
[src]
impl Debug for OpenOptions
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for OpenOptions
[src]
impl Default for OpenOptions
fn default() -> OpenOptions
[src]
fn default() -> OpenOptions
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for OpenOptions
impl Send for OpenOptions
impl Sync for OpenOptions
impl Sync for OpenOptions