liblisa::utils::bitmap

Struct FixedBitmapU64

pub struct FixedBitmapU64<const N: usize = 1> { /* private fields */ }
Expand description

A bitmap of a fixed multiple of 64-bit blocks.

Implementations§

§

impl FixedBitmapU64<1>

pub fn from_u64(value: u64) -> Self

Creates a new bitmap, using value as the bitmap data. The bit N in the bitmap is set if the Nth bit in value is set.

pub fn as_u64(&self) -> u64

Converts the bitmap to a u64.

§

impl<const N: usize> FixedBitmapU64<N>

pub fn iter_one_indices_rev(&self) -> impl Iterator<Item = usize> + '_

Iterates over the indices of the bits that are one, starting at the highest index.

Trait Implementations§

§

impl<'arbitrary, const N: usize> Arbitrary<'arbitrary> for FixedBitmapU64<N>

§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

impl<const N: usize> Bitmap for FixedBitmapU64<N>

§

fn set(&mut self, index: usize) -> bool

Sets the bit at position index to one.
§

fn clear(&mut self, index: usize) -> bool

Sets the bit at position index to zero.
§

fn and_with(&mut self, other: &impl BitmapSlice) -> bool

ANDs the slice with other. Returns true if anything changed.
§

fn clear_from(&mut self, other: &impl BitmapSlice) -> bool

Computes self & !other. Returns true if anything changed.
§

fn or_with(&mut self, other: &impl BitmapSlice) -> bool

ORs the slice with other. Returns true if anything changed.
§

fn xor_with(&mut self, other: &impl BitmapSlice) -> bool

XORs the slice with other. Returns true if anything changed.
§

fn is_all_ones(&self) -> bool

Returns true if the bitmap contains only ones.
§

fn is_superset_of(&self, other: &Self) -> bool

Returns true if the bitmap is a superset of other. In other words: for every bit that is set in other, it should also be set in self.
§

fn new_all_zeros(len: usize) -> Self

Creates a new bitmap with all bits set to zero.
§

fn new_all_ones(len: usize) -> Self

Creates a new bitmap with all bits set to one.
§

fn set_many(&mut self, indices: impl Iterator<Item = usize>)

Sets all bits in indices to one.
§

fn clear_many(&mut self, indices: impl Iterator<Item = usize>)

Sets all bits in indices to zero.
§

impl<const N: usize> BitmapSlice for FixedBitmapU64<N>

§

fn get(&self, index: usize) -> bool

Returns the value of the bit at position index.
§

fn len(&self) -> usize

Returns the number of bits in the bitmap.
§

fn iter_data(&self) -> impl Iterator<Item = u64> + '_

Iterates over the internal backing data of the bitmap.
§

fn is_empty(&self) -> bool

Return true if the bitmap is empty.
§

fn count_overlapping_with(&self, other: &impl BitmapSlice) -> usize
where Self: Sized,

Counts the number of bits that are one in both this bitmap and other.
§

fn overlaps_with(&self, other: &impl BitmapSlice) -> bool
where Self: Sized,

Returns true if the bitmap overlaps with other. In other words, if there is any bit which is set in both bitmaps.
§

fn is_all_zeros(&self) -> bool

Returns true if all bits in the bitmap are set to one.
§

fn is_subset_of(&self, other: &impl BitmapSlice) -> bool

Returns true if, for all bits set in the bitmap, it is also set in other.
§

fn flipped(&self) -> Flipped<'_, Self>
where Self: Sized,

Returns a slice to a bitmap where each bit is negated.
§

fn anded_with<'r, B: BitmapSlice>( &'r self, other: &'r B, ) -> AndWith<'r, Self, B>
where Self: Sized,

Returns a slice to a bitmap where each bit is ANDed with other.
§

fn xored_with<'r, B: BitmapSlice>( &'r self, other: &'r B, ) -> XorWith<'r, Self, B>
where Self: Sized,

Returns a slice to a bitmap where each bit is XORed with other.
§

fn ored_with<'r, B: BitmapSlice>(&'r self, other: &'r B) -> OrWith<'r, Self, B>
where Self: Sized,

Returns a slice to a bitmap where each bit is ORed with other.
§

fn cleared_from<'r, B: BitmapSlice>( &'r self, other: &'r B, ) -> ClearFrom<'r, Self, B>
where Self: Sized,

Returns a slice to a bitmap where each bit is set to self & !other.
§

fn iter_one_indices(&self) -> impl Iterator<Item = usize> + '_

Iterates over all indices in the bitmap that are set to one.
§

fn iter(&self) -> impl Iterator<Item = bool> + '_

Iterates over all bits in the bitmap.
§

fn count_ones(&self) -> usize

Counts the number of bits that are one.
§

fn count_zeros(&self) -> usize

Counts the number of bits that are zero.
§

impl<const N: usize> Clone for FixedBitmapU64<N>

§

fn clone(&self) -> FixedBitmapU64<N>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<const N: usize> Debug for FixedBitmapU64<N>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl<const N: usize> Default for FixedBitmapU64<N>

§

fn default() -> Self

Returns the “default value” for a type. Read more
§

impl<'de, const N: usize> Deserialize<'de> for FixedBitmapU64<N>

§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<const N: usize> From<&[usize]> for FixedBitmapU64<N>

§

fn from(items: &[usize]) -> Self

Converts to this type from the input type.
§

impl<const N: usize, const K: usize> From<[usize; K]> for FixedBitmapU64<N>

§

fn from(items: [usize; K]) -> Self

Converts to this type from the input type.
§

impl<const N: usize> FromIterator<bool> for FixedBitmapU64<N>

§

fn from_iter<T: IntoIterator<Item = bool>>(iter: T) -> Self

Creates a value from an iterator. Read more
§

impl<const N: usize> FromIterator<usize> for FixedBitmapU64<N>

§

fn from_iter<T: IntoIterator<Item = usize>>(iter: T) -> Self

Creates a value from an iterator. Read more
§

impl<const N: usize> Hash for FixedBitmapU64<N>

§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<const N: usize> Ord for FixedBitmapU64<N>

§

fn cmp(&self, other: &FixedBitmapU64<N>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl<const N: usize> PartialEq for FixedBitmapU64<N>

§

fn eq(&self, other: &FixedBitmapU64<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<const N: usize> PartialOrd for FixedBitmapU64<N>

§

fn partial_cmp(&self, other: &FixedBitmapU64<N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<const N: usize> Serialize for FixedBitmapU64<N>

§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<const N: usize> TryFrom<&GrowingBitmap> for FixedBitmapU64<N>

§

type Error = ()

The type returned in the event of a conversion error.
§

fn try_from(value: &GrowingBitmap) -> Result<Self, Self::Error>

Performs the conversion.
§

impl<const N: usize> Eq for FixedBitmapU64<N>

§

impl<const N: usize> StructuralPartialEq for FixedBitmapU64<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for FixedBitmapU64<N>

§

impl<const N: usize> RefUnwindSafe for FixedBitmapU64<N>

§

impl<const N: usize> Send for FixedBitmapU64<N>

§

impl<const N: usize> Sync for FixedBitmapU64<N>

§

impl<const N: usize> Unpin for FixedBitmapU64<N>

§

impl<const N: usize> UnwindSafe for FixedBitmapU64<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,