[][src]Struct cjdns_core::RoutingLabel

pub struct RoutingLabel<L: LabelBits>(_);

Routing label (a sequence of encoded Directors).

For more information on labels please refer to the whitepaper.

Implementations

impl<L: LabelBits> RoutingLabel<L>[src]

pub fn try_new(bits: L) -> Option<Self>[src]

Create new non-zero routing label. Returns None if bits is zero.

pub fn self_reference() -> Self[src]

Create a new label which is a self-reference. Corresponds to director with value of 1.

pub fn bits(&self) -> L[src]

Raw data of this routing label. Always non-zero.

pub fn size(&self) -> usize[src]

Size in bytes of this routing label

Trait Implementations

impl Binary for RoutingLabel<u32>[src]

impl Binary for RoutingLabel<u64>[src]

impl Binary for RoutingLabel<u128>[src]

impl<L: Clone + LabelBits> Clone for RoutingLabel<L>[src]

impl<L: Copy + LabelBits> Copy for RoutingLabel<L>[src]

impl<L: Debug + LabelBits> Debug for RoutingLabel<L>[src]

impl Display for RoutingLabel<u32>[src]

impl Display for RoutingLabel<u64>[src]

impl Display for RoutingLabel<u128>[src]

impl<L: Eq + LabelBits> Eq for RoutingLabel<L>[src]

impl LowerHex for RoutingLabel<u32>[src]

impl LowerHex for RoutingLabel<u64>[src]

impl LowerHex for RoutingLabel<u128>[src]

impl<L: PartialEq + LabelBits> PartialEq<RoutingLabel<L>> for RoutingLabel<L>[src]

impl<L: LabelBits> StructuralEq for RoutingLabel<L>[src]

impl<L: LabelBits> StructuralPartialEq for RoutingLabel<L>[src]

impl<'_> TryFrom<&'_ str> for RoutingLabel<u32>[src]

type Error = LabelError

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ str> for RoutingLabel<u64>[src]

type Error = LabelError

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ str> for RoutingLabel<u128>[src]

type Error = LabelError

The type returned in the event of a conversion error.

impl UpperHex for RoutingLabel<u32>[src]

impl UpperHex for RoutingLabel<u64>[src]

impl UpperHex for RoutingLabel<u128>[src]

Auto Trait Implementations

impl<L> RefUnwindSafe for RoutingLabel<L> where
    L: RefUnwindSafe

impl<L> Send for RoutingLabel<L> where
    L: Send

impl<L> Sync for RoutingLabel<L> where
    L: Sync

impl<L> Unpin for RoutingLabel<L> where
    L: Unpin

impl<L> UnwindSafe for RoutingLabel<L> where
    L: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.