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 moreimpl<NeedMode: Copy + OpenMode> Copy for OpenOptions<NeedMode>
impl<NeedMode: Eq + OpenMode> Eq for OpenOptions<NeedMode>
impl<NeedMode: OpenMode> StructuralPartialEq for OpenOptions<NeedMode>
Auto Trait Implementations§
impl<NeedMode> Freeze for OpenOptions<NeedMode>
impl<NeedMode> RefUnwindSafe for OpenOptions<NeedMode>where
NeedMode: RefUnwindSafe,
impl<NeedMode> Send for OpenOptions<NeedMode>where
NeedMode: Send,
impl<NeedMode> Sync for OpenOptions<NeedMode>where
NeedMode: Sync,
impl<NeedMode> Unpin for OpenOptions<NeedMode>where
NeedMode: Unpin,
impl<NeedMode> UnwindSafe for OpenOptions<NeedMode>where
NeedMode: UnwindSafe,
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