pub trait BitTest {
// Required methods
fn bits(&self) -> usize;
fn bit(&self, position: usize) -> bool;
fn trailing_zeros(&self) -> usize;
}
Expand description
This trait support unified bit testing for (unsigned) integers
Required Methods§
sourcefn bit(&self, position: usize) -> bool
fn bit(&self, position: usize) -> bool
Get the i-th bit of the integer, with i specified by position
sourcefn trailing_zeros(&self) -> usize
fn trailing_zeros(&self) -> usize
Get the number of trailing zeros in the integer