Struct linux_io::fd::OpenOptions
source · #[repr(transparent)]pub struct OpenOptions<NeedMode: OpenMode> { /* private fields */ }
Expand description
Encapsulates the various options for the open
system call behind a
builder API.
Use OPEN_READ_ONLY
, OPEN_WRITE_ONLY
, or OPEN_READ_WRITE
as
a starting value of this type and then refine as necessary using the
methods to set additional flags.
Implementations§
source§impl OpenOptions<OpenWithoutMode>
impl OpenOptions<OpenWithoutMode>
pub const fn read_only() -> Self
pub const fn write_only() -> Self
pub const fn read_write() -> Self
source§impl<NeedMode: OpenMode> OpenOptions<NeedMode>
impl<NeedMode: OpenMode> OpenOptions<NeedMode>
pub const fn append(self) -> Self
pub const fn close_on_exec(self) -> Self
pub const fn create(self) -> OpenOptions<OpenWithMode>
pub const fn direct(self) -> Self
pub const fn directory(self) -> Self
pub const fn excl(self) -> Self
pub const fn no_atime(self) -> Self
pub const fn no_controlling_tty(self) -> Self
pub const fn no_follow_symlinks(self) -> Self
pub const fn nonblocking(self) -> Self
pub const fn path_only(self) -> Self
pub const fn sync(self) -> Self
pub const fn temp_file(self) -> OpenOptions<OpenWithMode>
pub const fn truncate(self) -> Self
sourcepub const fn into_raw_flags(self) -> int
pub const fn into_raw_flags(self) -> int
Convert the options wrapper into the corresponding raw flags value
to use with the open
system call.
Trait Implementations§
source§impl<NeedMode: Clone + OpenMode> Clone for OpenOptions<NeedMode>
impl<NeedMode: Clone + OpenMode> Clone for OpenOptions<NeedMode>
source§fn clone(&self) -> OpenOptions<NeedMode>
fn clone(&self) -> OpenOptions<NeedMode>
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<NeedMode: PartialEq + OpenMode> PartialEq<OpenOptions<NeedMode>> for OpenOptions<NeedMode>
impl<NeedMode: PartialEq + OpenMode> PartialEq<OpenOptions<NeedMode>> for OpenOptions<NeedMode>
source§fn eq(&self, other: &OpenOptions<NeedMode>) -> bool
fn eq(&self, other: &OpenOptions<NeedMode>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.