[−][src]Trait bitstream_io::Numeric
This trait extends many common integer types (both unsigned and signed) with a few trivial methods so that they can be used with the bitstream handling traits.
Required methods
fn one() -> Self
The value of 1 in this type
fn is_zero(self) -> bool
Returns true if this value is 0, in its type
fn from_u8(u: u8) -> Self
Returns a u8
value in this type
fn to_u8(self) -> u8
Assuming 0 <= value < 256, returns this value as a u8
type
fn count_ones(self) -> u32
Counts the number of 1 bits
fn leading_zeros(self) -> u32
Counts the number of leading zeros
fn trailing_zeros(self) -> u32
Counts the number of trailing zeros
fn bits_size() -> u32
Size of type in bits