rusty_mos::utils::bitmapStruct Bitmap
Source pub struct Bitmap<const COUNT: usize> {
bitmap: [u8; COUNT],
used: usize,
pointer: usize,
}
Expand description
The bitmap itself. Contains the map and assistant field.
The used maintains the count of bit used to speed up the empty or
full judgement.
The algorithm of searching the next empty bit is as follows:
We maintain a pointer, the search will from the pointer one-by-one.
§Generic
The const CCOUNT marks the count of bit maintains. The bitmap can hold
(CCOUNT * 8) bits.
Create a new bitmap and initialize the field as zero.
Judge whether the bitmap is empty.
To see whether the index is not used.
Alloc a new bit if available. A None will be returned if no bit rest.
Free the specified bit. Double free is not allowed.
Formats the value using the given formatter.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
[From]<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.