[][src]Trait cjdns_core::LabelBits

pub trait LabelBits: Sized + Copy + From<u32> + Shl<u32, Output = Self> + Shr<u32, Output = Self> + BitXor<Output = Self> + BitOr<Output = Self> + BitAnd<Output = Self> + Add<Output = Self> + Sub<Output = Self> + Eq + Display {
    const ZERO: Self;
    const ONE: Self;
    const BIT_SIZE: u32;
    const MAX_PAYLOAD_BITS: u32;

    fn highest_set_bit(&self) -> Option<u32>;
}

Describes types which can act as routing label's underlying data type.

Routing labels itself are opaque, so this trait is required for internal data manipulations.

The following parent traits of LabelBits are considered public: Sized, Copy, From<u32>, Eq, Display.

For label manipulation routines please see the cjdns-splice crate.

This trait is implemented for u64 and u128.

Associated Constants

const ZERO: Self

Zero value for this data type.

const ONE: Self

One (1) value for this data type.

const BIT_SIZE: u32

Bit size of the this data type.

const MAX_PAYLOAD_BITS: u32

Maximum number of bits a label payload can occupy.

Loading content...

Required methods

fn highest_set_bit(&self) -> Option<u32>

Index of highest set bit in binary representation.

Loading content...

Implementations on Foreign Types

impl LabelBits for u32[src]

impl LabelBits for u64[src]

impl LabelBits for u128[src]

Loading content...

Implementors

Loading content...