pub struct TinyBitSet(u16);
Expand description
A bit-set implemented with a u16
, supporting domains up to 16 elements.
Tuple Fields§
§0: u16
Implementations§
Source§impl TinyBitSet
impl TinyBitSet
Sourcepub fn within_domain(self, index: u32) -> bool
pub fn within_domain(self, index: u32) -> bool
Returns the domain size of the bitset.
Sourcepub fn is_set(self, index: u32) -> bool
pub fn is_set(self, index: u32) -> bool
Similar to Self::contains
but in the case of an index
outside the
domain it returns false
instead of None
.
Sourcepub fn into_iter_set_in_domain(self) -> impl Iterator<Item = u32> + Clone
pub fn into_iter_set_in_domain(self) -> impl Iterator<Item = u32> + Clone
Iterate over all set indices that are within the domain (less than 16).
Sourcepub fn display_pretty(self) -> DisplayTinyBitSet
pub fn display_pretty(self) -> DisplayTinyBitSet
Create a struct with a pretty Display
implementation for this tiny
bit set.
Sourcepub fn intersection(self, other: Self) -> Self
pub fn intersection(self, other: Self) -> Self
A new bit set that contains elements that are both in self
and
other
. Same as using &
Trait Implementations§
Source§impl BitAnd for TinyBitSet
impl BitAnd for TinyBitSet
Source§impl BitAndAssign for TinyBitSet
impl BitAndAssign for TinyBitSet
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moreSource§impl BitOr for TinyBitSet
impl BitOr for TinyBitSet
Source§impl BitOrAssign for TinyBitSet
impl BitOrAssign for TinyBitSet
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moreSource§impl BitXor for TinyBitSet
impl BitXor for TinyBitSet
Source§impl BitXorAssign for TinyBitSet
impl BitXorAssign for TinyBitSet
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moreSource§impl Clone for TinyBitSet
impl Clone for TinyBitSet
Source§fn clone(&self) -> TinyBitSet
fn clone(&self) -> TinyBitSet
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TinyBitSet
impl Debug for TinyBitSet
Source§impl<__D: SpanDecoder> Decodable<__D> for TinyBitSet
impl<__D: SpanDecoder> Decodable<__D> for TinyBitSet
Source§impl Default for TinyBitSet
impl Default for TinyBitSet
Source§impl<'de> Deserialize<'de> for TinyBitSet
impl<'de> Deserialize<'de> for TinyBitSet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<__E: SpanEncoder> Encodable<__E> for TinyBitSet
impl<__E: SpanEncoder> Encodable<__E> for TinyBitSet
Source§impl FromIterator<u32> for TinyBitSet
impl FromIterator<u32> for TinyBitSet
Source§impl Hash for TinyBitSet
impl Hash for TinyBitSet
Source§impl Ord for TinyBitSet
impl Ord for TinyBitSet
Source§fn cmp(&self, other: &TinyBitSet) -> Ordering
fn cmp(&self, other: &TinyBitSet) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TinyBitSet
impl PartialEq for TinyBitSet
Source§impl PartialOrd for TinyBitSet
impl PartialOrd for TinyBitSet
Source§impl Serialize for TinyBitSet
impl Serialize for TinyBitSet
impl Copy for TinyBitSet
impl Eq for TinyBitSet
impl StructuralPartialEq for TinyBitSet
Auto Trait Implementations§
impl Freeze for TinyBitSet
impl RefUnwindSafe for TinyBitSet
impl Send for TinyBitSet
impl Sync for TinyBitSet
impl Unpin for TinyBitSet
impl UnwindSafe for TinyBitSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more