pub struct Protection { /* private fields */ }
Expand description
Protection bits for user’s access to a file.
Implementations§
Source§impl Protection
impl Protection
Sourcepub fn empty() -> Protection
pub fn empty() -> Protection
Constructs Protection with all bits forgotten.
Sourcepub fn all_set() -> Protection
pub fn all_set() -> Protection
Constructs Protection with all bits set.
Sourcepub fn all_clear() -> Protection
pub fn all_clear() -> Protection
Constructs Protection with all bits cleared.
Sourcepub fn from_mode_user(mode: &Mode, user: User) -> Protection
pub fn from_mode_user(mode: &Mode, user: User) -> Protection
Constructs Protection representing User access to the file described by Mode.
Sourcepub fn is_read_set(&self) -> bool
pub fn is_read_set(&self) -> bool
Returns true if read permission bit is set.
Sourcepub fn is_write_set(&self) -> bool
pub fn is_write_set(&self) -> bool
Returns true if write permission bit is set.
Sourcepub fn is_execute_set(&self) -> bool
pub fn is_execute_set(&self) -> bool
Returns true if execute permission bit is set.
Sourcepub fn is_search_set(&self) -> bool
pub fn is_search_set(&self) -> bool
Returns true if execute or search permission bits are set.
Sourcepub fn with_set(self, bit: ProtectionBit) -> Protection
pub fn with_set(self, bit: ProtectionBit) -> Protection
Returns self with given ProtectionBit set.
Sourcepub fn with_cleared(self, bit: ProtectionBit) -> Protection
pub fn with_cleared(self, bit: ProtectionBit) -> Protection
Returns self with given ProtectionBit cleared.
Sourcepub fn with_forgotten(self, bit: ProtectionBit) -> Protection
pub fn with_forgotten(self, bit: ProtectionBit) -> Protection
Returns self with given ProtectionBit value forgotten.
Sourcepub fn set(&mut self, bit: ProtectionBit)
pub fn set(&mut self, bit: ProtectionBit)
Sets given ProtectionBit.
Sourcepub fn clear(&mut self, bit: ProtectionBit)
pub fn clear(&mut self, bit: ProtectionBit)
Clears given ProtectionBit.
Sourcepub fn forget(&mut self, bit: ProtectionBit)
pub fn forget(&mut self, bit: ProtectionBit)
Forgets the value of given ProtectionBit.
Trait Implementations§
Source§impl Clone for Protection
impl Clone for Protection
Source§fn clone(&self) -> Protection
fn clone(&self) -> Protection
Returns a duplicate 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 Debug for Protection
impl Debug for Protection
Source§impl From<ProtectionBit> for Protection
impl From<ProtectionBit> for Protection
Source§fn from(bit: ProtectionBit) -> Protection
fn from(bit: ProtectionBit) -> Protection
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Protection
impl RefUnwindSafe for Protection
impl Send for Protection
impl Sync for Protection
impl Unpin for Protection
impl UnwindSafe for Protection
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