Struct smallbitset::Set16[][src]

pub struct Set16(_);

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 Set16[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) -> Set16Iter

Notable traits for Set16Iter

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

Returns an iterator over the elements of this set

Trait Implementations

impl Clone for Set16[src]

impl Copy for Set16[src]

impl Debug for Set16[src]

impl Default for Set16[src]

impl Display for Set16[src]

impl Eq for Set16[src]

impl From<u16> for Set16[src]

impl Hash for Set16[src]

impl IntoIterator for Set16[src]

type Item = u8

The type of the elements being iterated over.

type IntoIter = Set16Iter

Which kind of iterator are we turning this into?

impl PartialEq<Set16> for Set16[src]

impl StructuralEq for Set16[src]

impl StructuralPartialEq for Set16[src]

Auto Trait Implementations

impl RefUnwindSafe for Set16

impl Send for Set16

impl Sync for Set16

impl Unpin for Set16

impl UnwindSafe for Set16

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.