ForwarderEngine

Struct ForwarderEngine 

Source
pub struct ForwarderEngine { /* private fields */ }
Expand description

Handle to a running forwarding engine.

Cloning the handle gives another reference to the same running engine.

Implementations§

Source§

impl ForwarderEngine

Source

pub fn fib(&self) -> Arc<Fib>

Source

pub fn rib(&self) -> Arc<Rib>

Source

pub fn routing(&self) -> Arc<RoutingManager>

Source

pub fn faces(&self) -> Arc<FaceTable>

Source

pub fn pit(&self) -> Arc<Pit>

Source

pub fn cs(&self) -> Arc<dyn ErasedContentStore>

Source

pub fn security(&self) -> Option<Arc<SecurityManager>>

Source

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.

Source

pub fn strategy_table(&self) -> Arc<StrategyTable<dyn ErasedStrategy>>

Source

pub fn neighbors(&self) -> Arc<NeighborTable>

Source

pub fn measurements(&self) -> Arc<MeasurementsTable>

Source

pub fn discovery(&self) -> Arc<dyn DiscoveryProtocol>

Source

pub fn discovery_ctx(&self) -> Arc<EngineDiscoveryContext>

The discovery context for this engine.

Panics if called before build() completes (OnceLock not yet set).

Source

pub fn source_face_id(&self, interest: &Interest) -> Option<FaceId>

Look up the source face that originally sent an Interest.

Source

pub fn add_face<F: Face + 'static>(&self, face: F, cancel: CancellationToken)

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.

Source

pub fn add_face_with_persistency<F: Face + 'static>( &self, face: F, cancel: CancellationToken, persistency: FacePersistency, )

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

Source

pub fn add_face_send_only<F: Face + 'static>( &self, face: F, cancel: CancellationToken, )

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.

Source

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.

Source

pub fn face_token(&self, face_id: FaceId) -> Option<CancellationToken>

Get the cancellation token for a face, if one exists.

Source

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

Source§

fn clone(&self) -> ForwarderEngine

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more