Skip to main content

OperationSet

Struct OperationSet 

Source
pub struct OperationSet(/* private fields */);
Expand description

Normalized set of LDAP operations, stored as a bitflag.

All and SelfWrite are expanded at construction: All sets every concrete operation bit, SelfWrite also sets Modify. This makes set operations (union, intersection, containment) correct without special-casing.

Forms a bounded lattice under subset inclusion, with bitwise OR as join (union) and bitwise AND as meet (intersection).

Implementations§

Source§

impl OperationSet

Source

pub fn empty() -> Self

Source

pub fn all() -> Self

Source

pub fn contains(self, op: OperationType) -> bool

Source

pub fn is_empty(self) -> bool

Source

pub fn len(self) -> usize

Source

pub fn insert(&mut self, op: OperationType)

Source

pub fn union(self, other: Self) -> Self

Source

pub fn intersection(self, other: Self) -> Self

Source

pub fn difference(self, other: Self) -> Self

Source

pub fn is_subset_of(self, other: Self) -> bool

Source

pub fn is_superset_of(self, other: Self) -> bool

Source

pub fn grants_write(self) -> bool

Source

pub fn grants_read(self) -> bool

Source

pub fn iter(self) -> OperationSetIter

Source

pub fn to_vec(self) -> Vec<OperationType>

Trait Implementations§

Source§

impl BoundedJoinSemilattice for OperationSet

Source§

fn bottom() -> Self

Return the bottom element (least element). Read more
Source§

impl BoundedMeetSemilattice for OperationSet

Source§

fn top() -> Self

Return the top element (greatest element). Read more
Source§

impl Clone for OperationSet

Source§

fn clone(&self) -> OperationSet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OperationSet

Source§

impl Debug for OperationSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for OperationSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for OperationSet

Source§

impl From<&[OperationType]> for OperationSet

Source§

fn from(ops: &[OperationType]) -> Self

Converts to this type from the input type.
Source§

impl From<OperationType> for OperationSet

Source§

fn from(op: OperationType) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<OperationType> for OperationSet

Source§

fn from_iter<I: IntoIterator<Item = OperationType>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl Hash for OperationSet

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl JoinSemilattice for OperationSet

Source§

fn join(self, other: Self) -> Self

Compute the least upper bound (join) of two elements. Read more
Source§

impl MeetSemilattice for OperationSet

Source§

fn meet(self, other: Self) -> Self

Compute the greatest lower bound (meet) of two elements. Read more
Source§

impl Monoid for OperationSet

Source§

fn identity() -> Self

Return the identity element. Read more
Source§

fn combine_all_with_identity<I>(iter: I) -> Self
where I: IntoIterator<Item = Self>,

Combine all elements from an iterator, using identity for empty iterators. Read more
Source§

impl PartialEq for OperationSet

Source§

fn eq(&self, other: &OperationSet) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for OperationSet

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Semigroup for OperationSet

Source§

fn combine(self, other: Self) -> Self

Combine two elements associatively. Read more
Source§

fn combine_all<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = Self>,

Combine all elements from an iterator. Read more
Source§

impl StructuralPartialEq for OperationSet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Lattice for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.