pub struct Trie<'a> { /* private fields */ }Implementations§
Source§impl<'a> Trie<'a>
impl<'a> Trie<'a>
Sourcepub const DEFAULT_PREFETCH_LANES: usize = 4
pub const DEFAULT_PREFETCH_LANES: usize = 4
Number of independent walks Trie::common_prefix_batch keeps in flight.
Sourcepub const MAX_PREFETCH_LANES: usize = 16
pub const MAX_PREFETCH_LANES: usize = 16
Upper bound on lanes so the scheduler can keep lane state on the stack.
pub fn from_bytes(data: &'a [u8]) -> Trie<'a>
pub fn new(data: &'a [u8], size: usize) -> Trie<'a>
pub fn new_owned(data: Vec<u32>) -> Trie<'a>
pub fn total_size(&self) -> usize
pub fn common_prefix_iterator<'b>(
&'a self,
input: &'b [u8],
offset: usize,
) -> TrieEntryIter<'b> ⓘwhere
'a: 'b,
Sourcepub fn common_prefix_batch<F: FnMut(usize, u32, usize)>(
&self,
input: &[u8],
starts: &[usize],
emit: F,
)
pub fn common_prefix_batch<F: FnMut(usize, u32, usize)>( &self, input: &[u8], starts: &[usize], emit: F, )
Run common-prefix search from many start positions, overlapping their memory latency.
emit(bucket, value, end) fires once per match; bucket indexes
starts. Within a bucket, matches keep Trie::common_prefix_iterator
order, so grouping by bucket reproduces the scalar result.
Sourcepub fn common_prefix_batch_cfg<F: FnMut(usize, u32, usize)>(
&self,
input: &[u8],
starts: &[usize],
lanes: usize,
prefetch: bool,
emit: F,
)
pub fn common_prefix_batch_cfg<F: FnMut(usize, u32, usize)>( &self, input: &[u8], starts: &[usize], lanes: usize, prefetch: bool, emit: F, )
Trie::common_prefix_batch with an explicit lane count and prefetch
toggle. lanes is rounded to the nearest compile-time-specialized count;
values above Trie::MAX_PREFETCH_LANES are clamped.
Auto Trait Implementations§
impl<'a> Freeze for Trie<'a>
impl<'a> RefUnwindSafe for Trie<'a>
impl<'a> Send for Trie<'a>
impl<'a> Sync for Trie<'a>
impl<'a> Unpin for Trie<'a>
impl<'a> UnsafeUnpin for Trie<'a>
impl<'a> UnwindSafe for Trie<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more