pub struct OpenOptions(/* private fields */);Expand description
Wrapper for std::fs::OpenOptions.
Implementations§
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a blank new set of options ready for configuration.
Wrapper for 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.
Wrapper for 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.
Wrapper for 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.
Wrapper for 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.
Wrapper for 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, or open it if it already exists.
Wrapper for 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 create a new file, failing if it already exists.
Wrapper for std::fs::OpenOptions::create_new.
Source§impl OpenOptions
Methods added by fs-err that are not available on std::fs::OpenOptions.
impl OpenOptions
Methods added by fs-err that are not available on std::fs::OpenOptions.
Sourcepub fn from_options(options: OpenOptions) -> Self
pub fn from_options(options: OpenOptions) -> Self
Constructs Self from std::fs::OpenOptions.
Sourcepub fn options(&self) -> &OpenOptions
pub fn options(&self) -> &OpenOptions
Returns a reference to the underlying std::fs::OpenOptions.
Note that calling open() on this reference will NOT give you the improved errors from fs-err.
Sourcepub fn options_mut(&mut self) -> &mut OpenOptions
pub fn options_mut(&mut self) -> &mut OpenOptions
Returns a mutable reference to the underlying std::fs::OpenOptions.
This allows you to change settings that don’t yet have wrappers in fs-err.
Note that calling open() on this reference will NOT give you the improved errors from fs-err.
Trait Implementations§
Source§impl Clone for OpenOptions
impl Clone for OpenOptions
Source§impl Debug for OpenOptions
impl Debug for OpenOptions
Source§impl OpenOptionsExt for OpenOptions
Available on Unix only.
impl OpenOptionsExt for OpenOptions
Source§fn mode(&mut self, mode: u32) -> &mut Self
fn mode(&mut self, mode: u32) -> &mut Self
std::os::unix::fs::OpenOptionsExt::mode.Source§fn custom_flags(&mut self, flags: i32) -> &mut Self
fn custom_flags(&mut self, flags: i32) -> &mut Self
std::os::unix::fs::OpenOptionsExt::custom_flags.