pub trait BitInformation {
// Required methods
fn number_of_bits(&self) -> usize;
fn has_x_bit(&self, position: usize) -> bool;
// Provided methods
fn is_bit_in_bounds(&self, position: usize) -> bool { ... }
fn has_most_signifigant_bit(&self) -> bool { ... }
}
Required Methods§
Sourcefn number_of_bits(&self) -> usize
fn number_of_bits(&self) -> usize
Gets the number of bits contained in this type
Provided Methods§
Sourcefn is_bit_in_bounds(&self, position: usize) -> bool
fn is_bit_in_bounds(&self, position: usize) -> bool
Checks to see if the requested bit position is in bounds
Sourcefn has_most_signifigant_bit(&self) -> bool
fn has_most_signifigant_bit(&self) -> bool
Checks to see if the most signifigant bit is set