[−][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.
Associated Types
Loading content...Required methods
pub fn one() -> Self[src]
The value of 1 in this type
pub fn is_zero(self) -> bool[src]
Returns true if this value is 0, in its type
pub fn from_u8(u: u8) -> Self[src]
Returns a u8 value in this type
pub fn to_u8(self) -> u8[src]
Assuming 0 <= value < 256, returns this value as a u8 type
pub fn count_ones(self) -> u32[src]
Counts the number of 1 bits
pub fn leading_zeros(self) -> u32[src]
Counts the number of leading zeros
pub fn trailing_zeros(self) -> u32[src]
Counts the number of trailing zeros
pub fn bits_size() -> u32[src]
Size of type in bits
pub fn buffer() -> Self::Bytes[src]
An empty buffer of this type's size
pub fn to_be_bytes(self) -> Self::Bytes[src]
Our value in big-endian bytes
pub fn to_le_bytes(self) -> Self::Bytes[src]
Our value in little-endian bytes
pub fn from_be_bytes(bytes: Self::Bytes) -> Self[src]
Convert big-endian bytes to our value
pub fn from_le_bytes(bytes: Self::Bytes) -> Self[src]
Convert little-endian bytes to out value
pub fn unsigned_value(self) -> UnsignedValue[src]
Convert to a generic unsigned write value for stream recording purposes