[−][src]Struct capctl::caps::CapSet
Represents a set of capabilities.
Internally, this stores the set of capabilities as a bitmask, which is much more efficient than
a HashSet<Cap>
.
Implementations
impl CapSet
[src]
pub const fn empty() -> Self
[src]
Create an empty capability set.
pub fn clear(&mut self)
[src]
Clear all capabilities from this set.
After this call, set.is_empty()
will return true
.
pub fn is_empty(&self) -> bool
[src]
Check if this capability set is empty.
pub fn size(&self) -> usize
[src]
Returns the number of capabilities in this capability set.
pub fn has(&self, cap: Cap) -> bool
[src]
Checks if a given capability is present in this set.
pub fn add(&mut self, cap: Cap)
[src]
Adds the given capability to this set.
pub fn drop(&mut self, cap: Cap)
[src]
Removes the given capability from this set.
pub fn set_state(&mut self, cap: Cap, val: bool)
[src]
If val
is true
the given capability is added; otherwise it is removed.
pub fn add_all<T: IntoIterator<Item = Cap>>(&mut self, t: T)
[src]
Adds all of the capabilities yielded by the given iterator to this set.
pub fn drop_all<T: IntoIterator<Item = Cap>>(&mut self, t: T)
[src]
Removes all of the capabilities yielded by the given iterator from this set.
pub fn iter(&self) -> CapSetIteratorⓘNotable traits for CapSetIterator
impl Iterator for CapSetIterator type Item = Cap;
[src]
Notable traits for CapSetIterator
impl Iterator for CapSetIterator type Item = Cap;
Returns an iterator over all of the capabilities in this set.
pub const fn union(&self, other: Self) -> Self
[src]
Returns the union of this set and another capability set (i.e. all the capabilities that are in either set).
pub const fn intersection(&self, other: Self) -> Self
[src]
Returns the intersection of this set and another capability set (i.e. all the capabilities that are in both sets).
Trait Implementations
impl BitAnd<CapSet> for CapSet
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, rhs: Self) -> Self::Output
[src]
impl BitOr<CapSet> for CapSet
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self::Output
[src]
impl BitXor<CapSet> for CapSet
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Self) -> Self::Output
[src]
impl Clone for CapSet
[src]
impl Copy for CapSet
[src]
impl Debug for CapSet
[src]
impl Default for CapSet
[src]
impl Eq for CapSet
[src]
impl Extend<Cap> for CapSet
[src]
fn extend<I: IntoIterator<Item = Cap>>(&mut self, it: I)
[src]
fn extend_one(&mut self, item: A)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]
impl FromIterator<Cap> for CapSet
[src]
fn from_iter<I: IntoIterator<Item = Cap>>(it: I) -> Self
[src]
impl Hash for CapSet
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl IntoIterator for CapSet
[src]
type Item = Cap
The type of the elements being iterated over.
type IntoIter = CapSetIterator
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl Not for CapSet
[src]
type Output = Self
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl PartialEq<CapSet> for CapSet
[src]
impl StructuralEq for CapSet
[src]
impl StructuralPartialEq for CapSet
[src]
impl Sub<CapSet> for CapSet
[src]
Auto Trait Implementations
impl RefUnwindSafe for CapSet
impl Send for CapSet
impl Sync for CapSet
impl Unpin for CapSet
impl UnwindSafe for CapSet
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,
pub 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<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,