PipelineStage

Trait PipelineStage 

Source
pub trait PipelineStage:
    Send
    + Sync
    + 'static {
    // Required method
    fn process(
        &self,
        ctx: PacketContext,
    ) -> impl Future<Output = Result<Action, DropReason>> + Send;
}
Expand description

A single stage in the NDN forwarding pipeline.

Stages are fixed at build time (not runtime-configurable) so the compiler can inline and optimise the dispatch loop for the known concrete types.

process takes PacketContext by value. Action::Continue returns it to the runner. All other actions consume it, making use-after-hand-off a compile error.

Required Methods§

Source

fn process( &self, ctx: PacketContext, ) -> impl Future<Output = Result<Action, DropReason>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§