pub struct OpenOptions(/* private fields */);
Expand description
Wrapper around 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
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§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 moresource§impl Debug for OpenOptions
impl Debug for OpenOptions
source§impl OpenOptionsExt for OpenOptions
impl OpenOptionsExt for OpenOptions
source§fn access_mode(&mut self, access: u32) -> &mut Self
fn access_mode(&mut self, access: u32) -> &mut Self
OpenOptionsExt::access_mode
OpenOptionsExt::share_mode
source§fn custom_flags(&mut self, flags: u32) -> &mut Self
fn custom_flags(&mut self, flags: u32) -> &mut Self
OpenOptionsExt::custom_flags
source§fn attributes(&mut self, val: u32) -> &mut Self
fn attributes(&mut self, val: u32) -> &mut Self
OpenOptionsExt::attributes
source§fn security_qos_flags(&mut self, flags: u32) -> &mut Self
fn security_qos_flags(&mut self, flags: u32) -> &mut Self
OpenOptionsExt::security_qos_flags
Auto Trait Implementations§
impl Freeze for OpenOptions
impl RefUnwindSafe for OpenOptions
impl Send for OpenOptions
impl Sync for OpenOptions
impl Unpin 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)