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