pub struct Permission(/* private fields */);Expand description
The permissions of a file or directory.
Implementations§
Source§impl Permission
impl Permission
pub const Execute: Self
pub const Write: Self
pub const Read: Self
pub const None: Self
pub const All: Self
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Checks if the flag set contains the specified flag(s)
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Checks if the flag set contains any of the specified flag(s)
Sourcepub const fn set(self, other: Self, value: bool) -> Self
pub const fn set(self, other: Self, value: bool) -> Self
Sets or clears the specified flag(s) based on the passed value
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection of the two flag sets
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the two flag sets
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference between the two flag sets
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of the flag set
Sourcepub const fn bits_used() -> u8
pub const fn bits_used() -> u8
Returns the number of bits required to represent all defined flags
Sourcepub const fn from_bits_truncate(bits: u8) -> Self
pub const fn from_bits_truncate(bits: u8) -> Self
Creates a flag set from raw bits, truncating any unknown bits
Sourcepub const unsafe fn from_bits_unchecked(bits: u8) -> Self
pub const unsafe fn from_bits_unchecked(bits: u8) -> Self
Creates a flag set from raw bits without checking validity
Source§impl Permission
impl Permission
pub const READ_WRITE: Self
pub const READ_EXECUTE: Self
pub const WRITE_EXECUTE: Self
pub const fn from_unix(unix: u8) -> Option<Self>
pub const fn to_unix(&self) -> u8
Trait Implementations§
Source§impl BitAnd for Permission
impl BitAnd for Permission
Source§impl BitAndAssign for Permission
impl BitAndAssign for Permission
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Performs the
&= operation. Read moreSource§impl BitOr for Permission
impl BitOr for Permission
Source§impl BitOrAssign for Permission
impl BitOrAssign for Permission
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the
|= operation. Read moreSource§impl BitXor for Permission
impl BitXor for Permission
Source§impl BitXorAssign for Permission
impl BitXorAssign for Permission
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Performs the
^= operation. Read moreSource§impl Clone for Permission
impl Clone for Permission
Source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
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 Permission
impl Debug for Permission
Source§impl Display for Permission
impl Display for Permission
Source§impl Not for Permission
impl Not for Permission
Source§impl PartialEq for Permission
impl PartialEq for Permission
Source§impl Sub for Permission
impl Sub for Permission
Source§impl SubAssign for Permission
impl SubAssign for Permission
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreimpl Copy for Permission
impl Eq for Permission
impl StructuralPartialEq for Permission
Auto Trait Implementations§
impl Freeze for Permission
impl RefUnwindSafe for Permission
impl Send for Permission
impl Sync for Permission
impl Unpin for Permission
impl UnwindSafe for Permission
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