[−][src]Struct multiproof_rs::keys::nibble_key::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]
impl Index<RangeFrom<usize>> for NibbleKey
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, r: RangeFrom<usize>) -> &[u8]
[src]
impl Index<RangeTo<usize>> for NibbleKey
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, r: RangeTo<usize>) -> &[u8]
[src]
impl Index<usize> for NibbleKey
[src]
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
impl RefUnwindSafe for NibbleKey
impl Send for NibbleKey
impl Sync for NibbleKey
impl Unpin for NibbleKey
impl UnwindSafe for NibbleKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,