Struct mtree::Perms [−]
pub struct Perms { /* fields omitted */ }
Unix file permissions.
Methods
impl Perms
impl Perms
pub const READ: Perms
READ: Perms = Perms{bits: 4,}
Entity has read access.
pub const WRITE: Perms
WRITE: Perms = Perms{bits: 2,}
Entity has write access.
pub const EXECUTE: Perms
EXECUTE: Perms = Perms{bits: 1,}
Entity has execute access.
pub fn empty() -> Perms
pub fn empty() -> Perms
Returns an empty set of flags.
pub fn all() -> Perms
pub fn all() -> Perms
Returns the set containing all flags.
pub fn bits(&self) -> u8
pub fn bits(&self) -> u8
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u8) -> Option<Perms>
pub fn from_bits(bits: u8) -> Option<Perms>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u8) -> Perms
pub fn from_bits_truncate(bits: u8) -> Perms
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: Perms) -> bool
pub fn intersects(&self, other: Perms) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: Perms) -> bool
pub fn contains(&self, other: Perms) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: Perms)
pub fn insert(&mut self, other: Perms)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: Perms)
pub fn remove(&mut self, other: Perms)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: Perms)
pub fn toggle(&mut self, other: Perms)
Toggles the specified flags in-place.
pub fn set(&mut self, other: Perms, value: bool)
pub fn set(&mut self, other: Perms, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Copy for Perms
impl Copy for Perms
impl PartialEq for Perms
impl PartialEq for Perms
fn eq(&self, other: &Perms) -> bool
fn eq(&self, other: &Perms) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Perms) -> bool
fn ne(&self, other: &Perms) -> bool
This method tests for !=
.
impl Eq for Perms
impl Eq for Perms
impl Clone for Perms
impl Clone for Perms
fn clone(&self) -> Perms
fn clone(&self) -> Perms
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialOrd for Perms
impl PartialOrd for Perms
fn partial_cmp(&self, other: &Perms) -> Option<Ordering>
fn partial_cmp(&self, other: &Perms) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Perms) -> bool
fn lt(&self, other: &Perms) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Perms) -> bool
fn le(&self, other: &Perms) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Perms) -> bool
fn gt(&self, other: &Perms) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Perms) -> bool
fn ge(&self, other: &Perms) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Perms
impl Ord for Perms
fn cmp(&self, other: &Perms) -> Ordering
fn cmp(&self, other: &Perms) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for Perms
impl Hash for Perms
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Perms
impl Debug for Perms
impl Binary for Perms
impl Binary for Perms
impl Octal for Perms
impl Octal for Perms
impl LowerHex for Perms
impl LowerHex for Perms
impl UpperHex for Perms
impl UpperHex for Perms
impl BitOr for Perms
impl BitOr for Perms
type Output = Perms
The resulting type after applying the |
operator.
fn bitor(self, other: Perms) -> Perms
fn bitor(self, other: Perms) -> Perms
Returns the union of the two sets of flags.
impl BitOrAssign for Perms
impl BitOrAssign for Perms
fn bitor_assign(&mut self, other: Perms)
fn bitor_assign(&mut self, other: Perms)
Adds the set of flags.
impl BitXor for Perms
impl BitXor for Perms
type Output = Perms
The resulting type after applying the ^
operator.
fn bitxor(self, other: Perms) -> Perms
fn bitxor(self, other: Perms) -> Perms
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for Perms
impl BitXorAssign for Perms
fn bitxor_assign(&mut self, other: Perms)
fn bitxor_assign(&mut self, other: Perms)
Toggles the set of flags.
impl BitAnd for Perms
impl BitAnd for Perms
type Output = Perms
The resulting type after applying the &
operator.
fn bitand(self, other: Perms) -> Perms
fn bitand(self, other: Perms) -> Perms
Returns the intersection between the two sets of flags.
impl BitAndAssign for Perms
impl BitAndAssign for Perms
fn bitand_assign(&mut self, other: Perms)
fn bitand_assign(&mut self, other: Perms)
Disables all flags disabled in the set.
impl Sub for Perms
impl Sub for Perms
type Output = Perms
The resulting type after applying the -
operator.
fn sub(self, other: Perms) -> Perms
fn sub(self, other: Perms) -> Perms
Returns the set difference of the two sets of flags.
impl SubAssign for Perms
impl SubAssign for Perms
fn sub_assign(&mut self, other: Perms)
fn sub_assign(&mut self, other: Perms)
Disables all flags enabled in the set.
impl Not for Perms
impl Not for Perms
type Output = Perms
The resulting type after applying the !
operator.
fn not(self) -> Perms
fn not(self) -> Perms
Returns the complement of this set of flags.
impl Extend<Perms> for Perms
impl Extend<Perms> for Perms
fn extend<T: IntoIterator<Item = Perms>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Perms>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<Perms> for Perms
impl FromIterator<Perms> for Perms
fn from_iter<T: IntoIterator<Item = Perms>>(iterator: T) -> Perms
fn from_iter<T: IntoIterator<Item = Perms>>(iterator: T) -> Perms
Creates a value from an iterator. Read more
impl Display for Perms
[src]
impl Display for Perms