pub struct ForwarderEngine { /* private fields */ }Expand description
Re-export the engine builder for convenience. Handle to a running forwarding engine.
Cloning the handle gives another reference to the same running engine.
Implementations§
Source§impl ForwarderEngine
impl ForwarderEngine
pub fn fib(&self) -> Arc<Fib>
pub fn rib(&self) -> Arc<Rib>
pub fn routing(&self) -> Arc<RoutingManager>
pub fn faces(&self) -> Arc<FaceTable>
pub fn pit(&self) -> Arc<Pit>
pub fn cs(&self) -> Arc<dyn ErasedContentStore>
pub fn security(&self) -> Option<Arc<SecurityManager>>
Sourcepub fn validator(&self) -> Option<Arc<Validator>>
pub fn validator(&self) -> Option<Arc<Validator>>
The active validator, if any.
The returned Arc<Validator> is the same instance used by the pipeline.
Its trust schema can be modified at runtime via
Validator::add_schema_rule, Validator::remove_schema_rule, and
Validator::set_schema.
pub fn strategy_table(&self) -> Arc<StrategyTable<dyn ErasedStrategy>>
pub fn neighbors(&self) -> Arc<NeighborTable>
pub fn measurements(&self) -> Arc<MeasurementsTable>
pub fn discovery(&self) -> Arc<dyn DiscoveryProtocol>
Sourcepub fn discovery_ctx(&self) -> Arc<EngineDiscoveryContext>
pub fn discovery_ctx(&self) -> Arc<EngineDiscoveryContext>
The discovery context for this engine.
Panics if called before build() completes (OnceLock not yet set).
Sourcepub fn source_face_id(&self, interest: &Interest) -> Option<FaceId>
pub fn source_face_id(&self, interest: &Interest) -> Option<FaceId>
Look up the source face that originally sent an Interest.
Sourcepub fn add_face<F>(&self, face: F, cancel: CancellationToken)where
F: Face + 'static,
pub fn add_face<F>(&self, face: F, cancel: CancellationToken)where
F: Face + 'static,
Register a face and immediately start its packet-reader task.
Persistence defaults to OnDemand. Use add_face_with_persistency for
management-created or permanent faces.
Sourcepub fn add_face_with_persistency<F>(
&self,
face: F,
cancel: CancellationToken,
persistency: FacePersistency,
)where
F: Face + 'static,
pub fn add_face_with_persistency<F>(
&self,
face: F,
cancel: CancellationToken,
persistency: FacePersistency,
)where
F: Face + 'static,
Register a face with an explicit persistence level.
Spawns both a recv-reader task (pushes inbound packets to the pipeline
channel) and a send-writer task (drains the per-face outbound queue
and calls face.send()).
Sourcepub fn add_face_send_only<F>(&self, face: F, cancel: CancellationToken)where
F: Face + 'static,
pub fn add_face_send_only<F>(&self, face: F, cancel: CancellationToken)where
F: Face + 'static,
Register a send-only face (no recv loop spawned).
Use this for faces created by a listener that handles inbound packets
itself via inject_packet. The face is added to the face table so
the dispatcher can send Data/Nack to it, but no run_face_reader
task is spawned. A send-writer task is spawned to drain the outbound
queue.
Sourcepub async fn inject_packet(
&self,
raw: Bytes,
face_id: FaceId,
arrival: u64,
meta: InboundMeta,
) -> Result<(), ()>
pub async fn inject_packet( &self, raw: Bytes, face_id: FaceId, arrival: u64, meta: InboundMeta, ) -> Result<(), ()>
Inject a raw packet into the pipeline as if it arrived from face_id.
Processes the reliability layer (Ack extraction / piggybacked Ack
processing) before enqueuing, matching the same path as run_face_reader.
meta carries the link-layer source address when available (use
InboundMeta::udp(src) for UDP listeners, InboundMeta::none() when
the source is implicit in the face).
discovery.on_inbound() is called later inside process_packet, after
LP-unwrap and fragment reassembly, at the single call site in the pipeline.
Returns Err(()) if the pipeline channel is closed.
Sourcepub fn face_token(&self, face_id: FaceId) -> Option<CancellationToken>
pub fn face_token(&self, face_id: FaceId) -> Option<CancellationToken>
Get the cancellation token for a face, if one exists.
Sourcepub fn face_states(&self) -> Arc<DashMap<FaceId, FaceState>>
pub fn face_states(&self) -> Arc<DashMap<FaceId, FaceState>>
Access the face states map (for idle timeout sweeps).
Trait Implementations§
Source§impl Clone for ForwarderEngine
impl Clone for ForwarderEngine
Source§fn clone(&self) -> ForwarderEngine
fn clone(&self) -> ForwarderEngine
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more