pub struct FileOpenOptions {
pub read: bool,
pub write: bool,
pub create: bool,
pub append: bool,
pub truncate: bool,
}Expand description
Declarative open-mode configuration for File::open_with.
Named fields keep call sites from transposing modes silently.
Fields§
§read: boolOpen for reading.
write: boolOpen for writing.
create: boolCreate the file if it does not exist.
append: boolAppend instead of overwriting.
truncate: boolTruncate existing content.
Implementations§
Source§impl FileOpenOptions
impl FileOpenOptions
Sourcepub const fn read_only() -> FileOpenOptions
pub const fn read_only() -> FileOpenOptions
Read-only access.
Sourcepub const fn write_only() -> FileOpenOptions
pub const fn write_only() -> FileOpenOptions
Write-only access (creates if absent, truncates existing content).
Sourcepub const fn append_only() -> FileOpenOptions
pub const fn append_only() -> FileOpenOptions
Append access (creates if absent, preserves existing content).
Sourcepub const fn read_write() -> FileOpenOptions
pub const fn read_write() -> FileOpenOptions
Read-write access (creates if absent, preserves existing content).
Sourcepub const fn read_write_truncate() -> FileOpenOptions
pub const fn read_write_truncate() -> FileOpenOptions
Read-write access that truncates existing content (creates if absent).
Trait Implementations§
Source§impl Clone for FileOpenOptions
impl Clone for FileOpenOptions
Source§fn clone(&self) -> FileOpenOptions
fn clone(&self) -> FileOpenOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FileOpenOptions
Source§impl Debug for FileOpenOptions
impl Debug for FileOpenOptions
Source§impl Default for FileOpenOptions
impl Default for FileOpenOptions
Source§fn default() -> FileOpenOptions
fn default() -> FileOpenOptions
Returns the “default value” for a type. Read more
impl Eq for FileOpenOptions
Source§impl PartialEq for FileOpenOptions
impl PartialEq for FileOpenOptions
impl StructuralPartialEq for FileOpenOptions
Auto Trait Implementations§
impl Freeze for FileOpenOptions
impl RefUnwindSafe for FileOpenOptions
impl Send for FileOpenOptions
impl Sync for FileOpenOptions
impl Unpin for FileOpenOptions
impl UnsafeUnpin for FileOpenOptions
impl UnwindSafe for FileOpenOptions
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