Struct lilbits::LilBitSet [] [src]

pub struct LilBitSet { /* fields omitted */ }

Set-like data structure for storing u8 elements. Cannot contains values >= 64.

Methods

impl LilBitSet
[src]

[src]

Creates a new, empty LilBitSet.

[src]

Returns the largest u8 values that IS permitted to be inserted.

[src]

Constructs a LilBitSet from a u64. The indices of positive bits refers to the presence of a u8 in the set. ie '...1010' binary for 10 will represent the set {1,3}.

[src]

Inverse of new_from_raw

[src]

Included only as it is a common function for the HashSet. Here it simply wraps contains.

Panics

panics when element > Self::largest_allowed().

[src]

Returns true IFF the given u8 is in the set.

Panics

panics when element > Self::largest_allowed().

[src]

Returns true IFF the set is empty (contains no values).

[src]

Of course this set is not unqiue in its finite value-space for set elements. However, as there is the additional restriction of x <= Self::largest_allowed() for any element x, the UNIVERSE of missing elements can be useful

[src]

Attempts to insert the given u8 into the set. Returns true IFF successful.

Panics

panics when element > Self::largest_allowed().

[src]

Attempts to remove a given u8 from the set. Returns true IFF successful.

Panics

panics when element >= Self::largest_allowed().

[src]

Returns the set union of this, and the given LilBitSet.

[src]

Returns the set itersection of this, and the given LilBitSet.

[src]

Returns the set cardinality (number of elements of the set).

[src]

Returns the set symmetric difference of this, and the given LilBitSet.

[src]

Relying on Self::universe(), this function can be useful in reasoning over missing elements in a more convenient way

Trait Implementations

impl Copy for LilBitSet
[src]

impl Clone for LilBitSet
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for LilBitSet
[src]

impl PartialEq for LilBitSet
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Into<HashSet<u8>> for LilBitSet
[src]

[src]

Performs the conversion.

impl Into<BTreeSet<u8>> for LilBitSet
[src]

[src]

Performs the conversion.

impl Debug for LilBitSet
[src]

[src]

Formats the value using the given formatter.

impl IntoIterator for LilBitSet
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl FromIterator<u8> for LilBitSet
[src]

[src]

Creates a value from an iterator. Read more

impl<'a> FromIterator<&'a u8> for LilBitSet
[src]

[src]

Creates a value from an iterator. Read more