zerotrie::builder::nonconst::store

Trait 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.

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.

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§