ndn_store/
lib.rs

1//! # ndn-store -- Forwarding tables and content storage
2//!
3//! Implements the core forwarding-plane data structures: FIB, PIT, Content
4//! Store, and strategy table. All tables are designed for concurrent access
5//! (using `DashMap` or sharding) on the packet-processing hot path.
6//!
7//! ## Key types
8//!
9//! - [`NameTrie`] -- generic name-prefix trie used by FIB and strategy table.
10//! - [`Fib`] / [`FibEntry`] -- Forwarding Information Base (longest-prefix match).
11//! - [`Pit`] / [`PitEntry`] -- Pending Interest Table with in/out records.
12//! - [`ContentStore`] trait -- pluggable cache interface.
13//! - [`LruCs`] -- single-threaded LRU content store.
14//! - [`ShardedCs`] -- sharded wrapper for concurrent CS access.
15//! - [`FjallCs`] -- persistent on-disk content store (requires `fjall` feature).
16//! - [`NullCs`] -- no-op store for testing or cache-less operation.
17//! - [`ObservableCs`] -- decorator that emits [`CsEvent`]s on insert/evict.
18//! - [`StrategyTable`] -- prefix-to-strategy mapping.
19//! - [`CsAdmissionPolicy`] -- trait controlling which Data packets are cached.
20//!
21//! ## Feature flags
22//!
23//! - **`fjall`** -- enables [`FjallCs`], the persistent content store backend.
24
25#![allow(missing_docs)]
26
27pub mod content_store;
28pub mod fib;
29#[cfg(any(feature = "fjall", test))]
30pub mod fjall_cs;
31pub mod lru_cs;
32pub mod observable_cs;
33pub mod pit;
34pub mod sharded_cs;
35pub mod strategy_table;
36pub mod trie;
37
38pub use content_store::{
39    AdmitAllPolicy, ContentStore, CsAdmissionPolicy, CsCapacity, CsEntry, CsMeta, CsStats,
40    DefaultAdmissionPolicy, ErasedContentStore, InsertResult, NullCs,
41};
42pub use fib::{Fib, FibEntry, FibNexthop};
43#[cfg(any(feature = "fjall", test))]
44pub use fjall_cs::FjallCs;
45pub use lru_cs::LruCs;
46pub use observable_cs::{CsEvent, CsObserver, ObservableCs};
47pub use pit::{InRecord, NameHashes, OutRecord, Pit, PitEntry, PitToken};
48pub use sharded_cs::ShardedCs;
49pub use strategy_table::StrategyTable;
50pub use trie::NameTrie;