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§
sourcefn atbs_new_empty() -> Self
fn atbs_new_empty() -> Self
Create a new empty store.
sourcefn atbs_push_front(&mut self, byte: u8)
fn atbs_push_front(&mut self, byte: u8)
Push a byte to the front of the store.
sourcefn atbs_extend_front(&mut self, other: &[u8])
fn atbs_extend_front(&mut self, other: &[u8])
Push multiple bytes to the front of the store.
sourcefn atbs_to_bytes(&self) -> Vec<u8>
fn atbs_to_bytes(&self) -> Vec<u8>
Read the store into a Vec<u8>
.
sourcefn atbs_bitor_assign(&mut self, index: usize, bits: u8)
fn atbs_bitor_assign(&mut self, index: usize, bits: u8)
Perform the operation self[index] |= bits
sourcefn atbs_swap_ranges(&mut self, start: usize, mid: usize, limit: usize)
fn atbs_swap_ranges(&mut self, start: usize, mid: usize, limit: usize)
Swap the adjacent ranges self[start..mid]
and self[mid..limit]
.
sourcefn atbs_pop_front(&mut self) -> Option<u8>
fn atbs_pop_front(&mut self) -> Option<u8>
Remove and return the first element in the store, or None
if empty.
Provided Methods§
sourcefn atbs_prepend_n_zeros(&mut self, n: usize)
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.