Trait zerotrie::builder::nonconst::store::TrieBuilderStore

source ·
pub(crate) trait TrieBuilderStore {
    // Required methods
    fn atbs_new_empty() -> Self;
    fn atbs_len(&self) -> usize;
    fn atbs_push_front(&mut self, byte: u8);
    fn atbs_extend_front(&mut self, other: &[u8]);
    fn atbs_to_bytes(&self) -> Vec<u8>;
    fn atbs_bitor_assign(&mut self, index: usize, bits: u8);
    fn atbs_swap_ranges(&mut self, start: usize, mid: usize, limit: usize);
    fn atbs_pop_front(&mut self) -> Option<u8>;

    // Provided method
    fn atbs_prepend_n_zeros(&mut self, n: usize) { ... }
}
Expand description

A trait applied to a data structure for building a ZeroTrie.

Required Methods§

source

fn atbs_new_empty() -> Self

Create a new empty store.

source

fn atbs_len(&self) -> usize

Return the length in bytes of the store.

source

fn atbs_push_front(&mut self, byte: u8)

Push a byte to the front of the store.

source

fn atbs_extend_front(&mut self, other: &[u8])

Push multiple bytes to the front of the store.

source

fn atbs_to_bytes(&self) -> Vec<u8>

Read the store into a Vec<u8>.

source

fn atbs_bitor_assign(&mut self, index: usize, bits: u8)

Perform the operation self[index] |= bits

source

fn atbs_swap_ranges(&mut self, start: usize, mid: usize, limit: usize)

Swap the adjacent ranges self[start..mid] and self[mid..limit].

source

fn atbs_pop_front(&mut self) -> Option<u8>

Remove and return the first element in the store, or None if empty.

Provided Methods§

source

fn atbs_prepend_n_zeros(&mut self, n: usize)

Prepend n zeros to the front of the store.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TrieBuilderStore for VecDeque<u8>

source§

fn atbs_new_empty() -> Self

source§

fn atbs_len(&self) -> usize

source§

fn atbs_push_front(&mut self, byte: u8)

source§

fn atbs_extend_front(&mut self, other: &[u8])

source§

fn atbs_to_bytes(&self) -> Vec<u8>

source§

fn atbs_bitor_assign(&mut self, index: usize, bits: u8)

source§

fn atbs_swap_ranges(&mut self, start: usize, mid: usize, limit: usize)

source§

fn atbs_pop_front(&mut self) -> Option<u8>

Implementors§