pub struct MultiBitSet { /* private fields */ }
Expand description
Bit-packed vector of unsigned integers. Used to encode and decode litematica
Implementations§
Source§impl MultiBitSet
impl MultiBitSet
pub fn new() -> MultiBitSet
pub fn from_data( data: &[u64], length: usize, ele_bits: u8, ) -> Option<MultiBitSet>
pub fn from_data_vec( data: Vec<u64>, length: usize, ele_bits: u8, ) -> Option<MultiBitSet>
pub fn as_u64_slice(&self) -> &[u64]
pub fn element_bits(&self) -> u8
pub fn len(&self) -> usize
pub fn total_bits(&self) -> usize
pub fn reset(&mut self, element_bits: u8, len: usize)
pub fn basic_mask(&self) -> u64
pub fn logic_bit_index_to_global_bit_index(logic_bit_index: isize) -> usize
pub fn element_max_value(&self) -> u64
pub fn get(&self, ele_index: usize) -> u64
pub fn set(&mut self, ele_index: usize, value: u64) -> Result<(), ()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiBitSet
impl RefUnwindSafe for MultiBitSet
impl Send for MultiBitSet
impl Sync for MultiBitSet
impl Unpin for MultiBitSet
impl UnwindSafe for MultiBitSet
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> 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