Trait typed_path::Encoding

source ·
pub trait Encoding<'a>: Sealed {
    type Components: Components<'a>;

    // Required methods
    fn label() -> &'static str;
    fn components(path: &'a [u8]) -> Self::Components;
    fn hash<H: Hasher>(path: &[u8], h: &mut H);
    fn push(current_path: &mut Vec<u8>, path: &[u8]);
}
Expand description

Interface to provide meaning to a byte slice such that paths can be derived

Required Associated Types§

source

type Components: Components<'a>

Represents the type of component that will be derived by this encoding

Required Methods§

source

fn label() -> &'static str

Static label representing encoding type

source

fn components(path: &'a [u8]) -> Self::Components

Produces an iterator of Components over the given the byte slice (path)

source

fn hash<H: Hasher>(path: &[u8], h: &mut H)

Hashes a byte slice (path)

source

fn push(current_path: &mut Vec<u8>, path: &[u8])

Pushes a byte slice (path) onto the an existing path (current_path)

Object Safety§

This trait is not object safe.

Implementors§