pub struct ComposedStrategy { /* private fields */ }Expand description
A strategy that delegates to an inner strategy and post-processes its forwarding actions through a chain of filters.
This enables cross-layer filtering without modifying base strategies.
For example, composing BestRouteStrategy with an RssiFilter produces
“best-route but only on faces with acceptable signal strength.”
Implementations§
Trait Implementations§
Source§impl ErasedStrategy for ComposedStrategy
impl ErasedStrategy for ComposedStrategy
Source§fn name(&self) -> &Name
fn name(&self) -> &Name
Canonical name identifying this strategy (e.g.
/localhost/nfd/strategy/best-route).Source§fn decide_sync(
&self,
ctx: &StrategyContext<'_>,
) -> Option<SmallVec<[ForwardingAction; 2]>>
fn decide_sync( &self, ctx: &StrategyContext<'_>, ) -> Option<SmallVec<[ForwardingAction; 2]>>
Synchronous fast path — avoids the
Box::pin heap allocation.
Returns None to fall through to the async path.Source§fn after_receive_interest_erased<'a>(
&'a self,
ctx: &'a StrategyContext<'a>,
) -> Pin<Box<dyn Future<Output = SmallVec<[ForwardingAction; 2]>> + Send + 'a>>
fn after_receive_interest_erased<'a>( &'a self, ctx: &'a StrategyContext<'a>, ) -> Pin<Box<dyn Future<Output = SmallVec<[ForwardingAction; 2]>> + Send + 'a>>
Async path for Interest forwarding decisions (boxed future).
Source§fn on_nack_erased<'a>(
&'a self,
ctx: &'a StrategyContext<'a>,
reason: NackReason,
) -> Pin<Box<dyn Future<Output = ForwardingAction> + Send + 'a>>
fn on_nack_erased<'a>( &'a self, ctx: &'a StrategyContext<'a>, reason: NackReason, ) -> Pin<Box<dyn Future<Output = ForwardingAction> + Send + 'a>>
Handle an incoming Nack and decide whether to retry or propagate.
Auto Trait Implementations§
impl !Freeze for ComposedStrategy
impl !RefUnwindSafe for ComposedStrategy
impl Send for ComposedStrategy
impl Sync for ComposedStrategy
impl Unpin for ComposedStrategy
impl !UnwindSafe for ComposedStrategy
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