pub trait BitArray:
Sized
+ BitAnd<Output = Self>
+ BitOr<Output = Self>
+ BitXor<Output = Self>
+ Not<Output = Self>
+ Copy {
const LEN: usize;
// Required methods
fn splat(s: bool) -> Self;
fn get_bit(self, index: usize) -> bool;
fn set_bit(&mut self, index: usize, sign: bool);
fn count_ones(self) -> u32;
fn transpose_in_place(a: &mut BitMatrix<Self, { Self::LEN }>);
}
Expand description
Things we can do to an array of bits.
Required Associated Constants§
Required Methods§
Sourcefn get_bit(self, index: usize) -> bool
fn get_bit(self, index: usize) -> bool
Get a bit. Poor performance, used only for testing and debugging.
Sourcefn set_bit(&mut self, index: usize, sign: bool)
fn set_bit(&mut self, index: usize, sign: bool)
Set a bit. Poor performance, used only for testing and debugging.
fn count_ones(self) -> u32
Sourcefn transpose_in_place(a: &mut BitMatrix<Self, { Self::LEN }>)
fn transpose_in_place(a: &mut BitMatrix<Self, { Self::LEN }>)
Transpose a square matrix in place. This will likely be better performance than using Transpose::transpose()
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.