[−][src]Struct pathrs::OpenFlags
Wrapper for the underlying libc
's O_*
flags.
The flag values and their meaning is identical to the description in the
open(2)
man page.
Caveats
For historical reasons, the first three bits of open(2)
's flags are for
the access mode and are actually treated as a 2-bit number. So, it is
incorrect to attempt to do any checks on the access mode without masking it
correctly. So some helpers were added to make usage more ergonomic.
Methods
impl OpenFlags
[src]
pub fn access_mode(self) -> c_int
[src]
Grab the access mode bits from the flags.
pub fn wants_read(self) -> bool
[src]
Does the access mode imply read access?
pub fn wants_write(self) -> bool
[src]
Does the access mode imply write access? Note that there are several
other bits (such as O_TRUNC
) which imply write access but are not part
of the access mode, and thus a false
value from .wants_write()
does
not guarantee that the kernel will not do a MAY_WRITE
check.
Trait Implementations
impl Clone for OpenFlags
[src]
impl Copy for OpenFlags
[src]
impl Debug for OpenFlags
[src]
impl Eq for OpenFlags
[src]
impl From<i32> for OpenFlags
[src]
impl PartialEq<OpenFlags> for OpenFlags
[src]
impl StructuralEq for OpenFlags
[src]
impl StructuralPartialEq for OpenFlags
[src]
Auto Trait Implementations
impl RefUnwindSafe for OpenFlags
impl Send for OpenFlags
impl Sync for OpenFlags
impl Unpin for OpenFlags
impl UnwindSafe for OpenFlags
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,