#[non_exhaustive]pub struct OpenOptions {
pub read: bool,
pub write: bool,
pub create: bool,
pub truncate: bool,
pub append: bool,
pub create_new: bool,
pub mode: Option<u32>,
pub custom_flags: Option<i32>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.read: bool§write: bool§create: bool§truncate: bool§append: bool§create_new: bool§mode: Option<u32>Unix only. Ignored on Windows.
custom_flags: Option<i32>Custom flags to set on Unix or Windows.
On Windows this is a u32, but on Unix it’s an i32.
Note: only provide flags that make sense for the current operating system.
Implementations§
Source§impl OpenOptions
impl OpenOptions
pub fn new() -> Self
pub fn new_read() -> Self
pub fn write() -> Self
👎Deprecated: use
new_write insteadpub fn new_write() -> Self
pub fn read(&mut self) -> &mut Self
pub fn create(&mut self) -> &mut Self
pub fn truncate(&mut self) -> &mut Self
pub fn append(&mut self) -> &mut Self
pub fn create_new(&mut self) -> &mut Self
pub fn mode(&mut self, mode: u32) -> &mut Self
pub fn custom_flags(&mut self, flags: i32) -> &mut Self
Trait Implementations§
Source§impl Clone for OpenOptions
impl Clone for OpenOptions
Source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
Returns a copy of the value. Read more
1.0.0 · 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
Source§impl<'de> Deserialize<'de> for OpenOptionswhere
OpenOptions: Default,
impl<'de> Deserialize<'de> for OpenOptionswhere
OpenOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for OpenOptions
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
Mutably borrows from an owned value. Read more