vart

Trait Key

Source
pub trait Key {
    // Required methods
    fn at(&self, pos: usize) -> u8;
    fn len(&self) -> usize;
    fn prefix_before(&self, length: usize) -> &[u8] ;
    fn prefix_after(&self, start: usize) -> &[u8] ;
    fn longest_common_prefix(&self, slice: &[u8]) -> usize;
    fn as_slice(&self) -> &[u8] ;
    fn extend(&self, other: &Self) -> Self;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}

Required Methods§

Source

fn at(&self, pos: usize) -> u8

Source

fn len(&self) -> usize

Source

fn prefix_before(&self, length: usize) -> &[u8]

Source

fn prefix_after(&self, start: usize) -> &[u8]

Source

fn longest_common_prefix(&self, slice: &[u8]) -> usize

Source

fn as_slice(&self) -> &[u8]

Source

fn extend(&self, other: &Self) -> Self

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Key for VariableSizeKey

Source§

impl<const SIZE: usize> Key for FixedSizeKey<SIZE>