Struct smallbitset::Set8[][src]

pub struct Set8(_);

This structure encapsulates a small allocation free set of integers. Because it is implemented as a fixed size bitset, it can only accomodate values in the range 0..$capa.

Because of this restriction on the range of allowed values, all the items that can be stored in this set are of type ‘u8’.

Implementations

impl Set8[src]

pub fn empty() -> Self[src]

This method creates an empty set

pub fn full() -> Self[src]

This method returns the complete set

pub fn singleton(x: u8) -> Self[src]

This method creates a singleton set holding the single value ‘x’.

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

This method returns the union of two sets

pub fn inter(self, other: Self) -> Self[src]

This method returns the intersection of two sets

pub fn diff(self, other: Self) -> Self[src]

This method returns the difference of two sets.

pub fn complement(self) -> Self[src]

This method retuns the complement of the current set

pub fn insert(&mut self, x: u8) -> Self[src]

This method returns the set obtained by adding the singleton x to the current set

pub fn remove(self, x: u8) -> Self[src]

This method returns the set obtained by removing the singleton x from the current set

pub fn is_empty(self) -> bool[src]

Returns true iff the set is empty

pub fn len(self) -> usize[src]

Returns the number of items in this set

pub fn contains(self, x: u8) -> bool[src]

Returns true iff the current set contains the given item x

pub const fn capacity(self) -> usize[src]

Returns the capcity of this set

pub fn iter(self) -> Set8Iter

Notable traits for Set8Iter

impl Iterator for Set8Iter type Item = u8;
[src]

Returns an iterator over the elements of this set

Trait Implementations

impl Clone for Set8[src]

impl Copy for Set8[src]

impl Debug for Set8[src]

impl Default for Set8[src]

impl Display for Set8[src]

impl Eq for Set8[src]

impl From<u8> for Set8[src]

impl Hash for Set8[src]

impl IntoIterator for Set8[src]

type Item = u8

The type of the elements being iterated over.

type IntoIter = Set8Iter

Which kind of iterator are we turning this into?

impl PartialEq<Set8> for Set8[src]

impl StructuralEq for Set8[src]

impl StructuralPartialEq for Set8[src]

Auto Trait Implementations

impl RefUnwindSafe for Set8

impl Send for Set8

impl Sync for Set8

impl Unpin for Set8

impl UnwindSafe for Set8

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.