Struct paralegal_spdg::TinyBitSet
source · 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<TinyBitSet> for TinyBitSet
impl BitAnd<TinyBitSet> for TinyBitSet
source§impl BitAndAssign<TinyBitSet> for TinyBitSet
impl BitAndAssign<TinyBitSet> for TinyBitSet
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl BitOr<TinyBitSet> for TinyBitSet
impl BitOr<TinyBitSet> for TinyBitSet
source§impl BitOrAssign<TinyBitSet> for TinyBitSet
impl BitOrAssign<TinyBitSet> for TinyBitSet
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl BitXor<TinyBitSet> for TinyBitSet
impl BitXor<TinyBitSet> for TinyBitSet
source§impl BitXorAssign<TinyBitSet> for TinyBitSet
impl BitXorAssign<TinyBitSet> 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: Decoder> Decodable<__D> for TinyBitSet
impl<__D: Decoder> 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 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<TinyBitSet> for TinyBitSet
impl PartialEq<TinyBitSet> for TinyBitSet
source§fn eq(&self, other: &TinyBitSet) -> bool
fn eq(&self, other: &TinyBitSet) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<TinyBitSet> for TinyBitSet
impl PartialOrd<TinyBitSet> for TinyBitSet
source§fn partial_cmp(&self, other: &TinyBitSet) -> Option<Ordering>
fn partial_cmp(&self, other: &TinyBitSet) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for TinyBitSet
impl Serialize for TinyBitSet
impl Copy for TinyBitSet
impl Eq for TinyBitSet
impl StructuralEq for TinyBitSet
impl StructuralPartialEq for TinyBitSet
Auto Trait Implementations§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.