[][src]Struct multiproof_rs::keys::nibble_key::NibbleKey

pub struct NibbleKey(_);

Represents a key whose unit is nibbles, i.e. 4-byte long values.

Internally, nibbles are stored in a byte array, with each byte having its most significant nibble set to 0.

Methods

impl NibbleKey[src]

pub fn factor_length(&self, other: &Self) -> usize[src]

Finds the length of the common prefix of two keys.

pub fn with_hex_prefix(&self, is_terminator: bool) -> Vec<u8>[src]

Encodes a nibble key to its hex prefix. The output is byte-encoded, so as to be stored immediately.

pub fn remove_hex_prefix(payload: &[u8]) -> NibbleKey[src]

Rebuilds the hex prefix from a &[u8] slice assumed to be hex prefix-encoded.

Trait Implementations

impl Clone for NibbleKey[src]

impl Debug for NibbleKey[src]

impl Encodable for NibbleKey[src]

impl<'_> From<&'_ [u8]> for NibbleKey[src]

impl From<ByteKey> for NibbleKey[src]

impl From<NibbleKey> for ByteKey[src]

impl From<Vec<u8>> for NibbleKey[src]

impl<'_> Index<&'_ NibbleKey> for Node[src]

type Output = Node

The returned type after indexing.

impl Index<RangeFrom<usize>> for NibbleKey[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeTo<usize>> for NibbleKey[src]

type Output = [u8]

The returned type after indexing.

impl Index<usize> for NibbleKey[src]

type Output = u8

The returned type after indexing.

impl Into<Vec<u8>> for NibbleKey[src]

impl Key<u8> for NibbleKey[src]

impl PartialEq<NibbleKey> for NibbleKey[src]

impl StructuralPartialEq for NibbleKey[src]

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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.