pub struct OpenOptions {
pub append: bool,
pub create: bool,
pub read: bool,
pub truncate: bool,
pub write: bool,
}
Expand description
Options for opening a file. The default mode is read-only.
Fields§
§append: bool
True if the file should be able to be appended to.
create: bool
True if the file should be created if not present.
read: bool
True if the file should be able to be read.
truncate: bool
True if the file should be truncated.
write: bool
True if the file should be written to.
Implementations§
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn append(self, append: bool) -> Self
pub fn append(self, append: bool) -> Self
§Arguments
append
: If true, the file should be opened with the cursor set to the end of the file,
rather than overwriting the file contents. Note that setting this to true will implicitly
enable writing.
Sourcepub fn create(self, create: bool) -> Self
pub fn create(self, create: bool) -> Self
§Arguments
append
: If true, the file should be created if it does not exist. Note that setting this
to true will implicitly enable writing.
Sourcepub fn read(self, read: bool) -> Self
pub fn read(self, read: bool) -> Self
§Arguments
read
: If true, the file should be able to be read in entirety.
Trait Implementations§
Source§impl Debug for OpenOptions
impl Debug for OpenOptions
Source§impl Default for OpenOptions
impl Default for OpenOptions
Source§impl From<&OpenOptions> for OpenOptions
impl From<&OpenOptions> for OpenOptions
Source§fn from(value: &OpenOptions) -> Self
fn from(value: &OpenOptions) -> Self
Converts to this type from the input type.
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more