Struct file_mode::Protection[][src]

pub struct Protection { /* fields omitted */ }

Protection bits for user’s access to a file.

Implementations

impl Protection[src]

pub fn empty() -> Protection[src]

Constructs Protection with all bits forgotten.

pub fn all_set() -> Protection[src]

Constructs Protection with all bits set.

pub fn all_clear() -> Protection[src]

Constructs Protection with all bits cleared.

pub fn from_mode_user(mode: &Mode, user: User) -> Protection[src]

Constructs Protection representing User access to the file described by Mode.

pub fn is_read_set(&self) -> bool[src]

Returns true if read permission bit is set.

pub fn is_write_set(&self) -> bool[src]

Returns true if write permission bit is set.

pub fn is_execute_set(&self) -> bool[src]

Returns true if execute permission bit is set.

pub fn is_search_set(&self) -> bool[src]

Returns true if execute or search permission bits are set.

pub fn with_set(self, bit: ProtectionBit) -> Protection[src]

Returns self with given ProtectionBit set.

pub fn with_cleared(self, bit: ProtectionBit) -> Protection[src]

Returns self with given ProtectionBit cleared.

pub fn with_forgotten(self, bit: ProtectionBit) -> Protection[src]

Returns self with given ProtectionBit value forgotten.

pub fn set(&mut self, bit: ProtectionBit)[src]

Sets given ProtectionBit.

pub fn clear(&mut self, bit: ProtectionBit)[src]

Clears given ProtectionBit.

pub fn forget(&mut self, bit: ProtectionBit)[src]

Forgets the value of given ProtectionBit.

pub fn for_user(&self, user: User) -> Mode[src]

Constructs Mode with protection bits set for User.

Trait Implementations

impl Clone for Protection[src]

impl Debug for Protection[src]

impl From<ProtectionBit> for Protection[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.