pub struct NameHashes {
pub prefix_hashes: SmallVec<[u64; 8]>,
}Expand description
Pre-computed cumulative name-prefix hashes.
Computed once at TLV decode and reused for all PIT lookups (check, match, nack) without re-hashing name components on every probe.
Inspired by NDN-DPDK’s memoized name hashing: the FIB/PIT dispatch layer hashes the name once at RX and reuses the hash for NDT, PCCT, and FIB lookups.
Ref: Shi et al., “NDN-DPDK: NDN Forwarding at 100 Gbps on Commodity Hardware” (ACM ICN 2020), §3.1.
Fields§
§prefix_hashes: SmallVec<[u64; 8]>prefix_hashes[i] is the hash of the first i+1 name components.
Implementations§
Source§impl NameHashes
impl NameHashes
Sourcepub fn from_components(components: &[NameComponent]) -> Self
pub fn from_components(components: &[NameComponent]) -> Self
Compute from a component slice (avoids requiring a Name value).
Sourcepub fn prefix_hash(&self, n: usize) -> u64
pub fn prefix_hash(&self, n: usize) -> u64
Hash of the first n components. Returns 0 for the root name (n=0).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn full_name_hash(name: &Name) -> u64
pub fn full_name_hash(name: &Name) -> u64
Compute the full-name hash without storing intermediates.
Trait Implementations§
Source§impl Clone for NameHashes
impl Clone for NameHashes
Source§fn clone(&self) -> NameHashes
fn clone(&self) -> NameHashes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NameHashes
impl RefUnwindSafe for NameHashes
impl Send for NameHashes
impl Sync for NameHashes
impl Unpin for NameHashes
impl UnwindSafe for NameHashes
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