Trait mayda::utility::Bits [] [src]

pub trait Bits {
    fn width() -> u32;
fn bits(&self) -> u32; }

Indicates that the bitwise representation of the type is known to mayda. Intended to be implemented only for the primitive integer types. Mainly used as a bound on the Encode trait.

Required Methods

Number of bits in the standard representation.

Number of bits required to represent the number in binary. Notice that 0.bits() == 0u32 intentionally.

Implementations on Foreign Types

impl Bits for u8
[src]

[src]

[src]

impl Bits for u16
[src]

[src]

[src]

impl Bits for u32
[src]

[src]

[src]

impl Bits for u64
[src]

[src]

[src]

impl Bits for usize
[src]

[src]

[src]

impl Bits for i8
[src]

[src]

[src]

impl Bits for i16
[src]

[src]

[src]

impl Bits for i32
[src]

[src]

[src]

impl Bits for i64
[src]

[src]

[src]

impl Bits for isize
[src]

[src]

[src]

Implementors