Trait bit_collection::BitCollection [] [src]

pub trait BitCollection: DoubleEndedIterator + ExactSizeIterator {
    fn full() -> Self;
fn empty() -> Self;
fn is_empty(&self) -> bool;
unsafe fn lsb_unchecked(&self) -> Self::Item;
unsafe fn msb_unchecked(&self) -> Self::Item;
fn remove_lsb(&mut self);
fn remove_msb(&mut self);
fn pop_lsb(&mut self) -> Option<Self::Item>;
fn pop_msb(&mut self) -> Option<Self::Item>;
fn contains<T: Into<Self>>(&self, _: T) -> bool
    where
        Self: Sized
;
fn removing<T: Into<Self>>(self, _: T) -> Self
    where
        Self: Sized
;
fn inserting<T: Into<Self>>(self, _: T) -> Self
    where
        Self: Sized
;
fn toggling<T: Into<Self>>(self, _: T) -> Self
    where
        Self: Sized
;
fn intersecting<T: Into<Self>>(self, _: T) -> Self
    where
        Self: Sized
;
fn remove<T: Into<Self>>(&mut self, _: T)
    where
        Self: Sized
;
fn insert<T: Into<Self>>(&mut self, _: T)
    where
        Self: Sized
;
fn toggle<T: Into<Self>>(&mut self, _: T)
    where
        Self: Sized
;
fn intersect<T: Into<Self>>(&mut self, _: T)
    where
        Self: Sized
; fn lsb(&self) -> Option<Self::Item> { ... }
fn msb(&self) -> Option<Self::Item> { ... }
fn setting<T: Into<Self>>(self, x: T, condition: bool) -> Self
    where
        Self: Sized
, { ... }
fn set<T: Into<Self>>(&mut self, x: T, condition: bool)
    where
        Self: Sized
, { ... } }

A type that represents a collection of bits that can be iterated over.

Required Methods

Returns a full instance with all bits set.

Returns an empty instance with no bits set.

Returns whether self is empty.

Returns the least significant bit in self without checking whether self is empty.

Returns the most significant bit in self without checking whether self is empty.

Removes the least significant bit from self.

Removes the most significant bit from self.

Removes the least significant bit from self and returns it.

Removes the most significant bit from self and returns it.

Returns whether self contains the value.

Returns the result of removing the value from self.

Returns the result of inserting the value into self.

Returns the result of toggling the bits of the value in self.

Returns the result of intersecting the bits of the value with self.

Removes the value from self.

Inserts the value into self.

Toggles bits of the value in self.

Intersects the bits of the value with self.

Provided Methods

Returns the least significant bit in self if self is not empty.

Returns the most significant bit in self if self is not empty.

Returns the result of setting the bits of the value in self based on condition.

Sets the bits of the value in self based on condition.

Implementors