pub struct NoDiscovery;Expand description
No-op discovery protocol.
All hook methods are empty. [claimed_prefixes] returns an empty slice,
so CompositeDiscovery will never route inbound packets to it.
§Example
use ndn_discovery::NoDiscovery;
let nd = NoDiscovery;
// Pass to the engine builder:
// builder.discovery(nd)Trait Implementations§
Source§impl DiscoveryProtocol for NoDiscovery
impl DiscoveryProtocol for NoDiscovery
Source§fn protocol_id(&self) -> ProtocolId
fn protocol_id(&self) -> ProtocolId
Unique protocol identifier.
Source§fn claimed_prefixes(&self) -> &[Name]
fn claimed_prefixes(&self) -> &[Name]
NDN name prefixes this protocol reserves. Read more
Source§fn on_face_up(&self, _face_id: FaceId, _ctx: &dyn DiscoveryContext)
fn on_face_up(&self, _face_id: FaceId, _ctx: &dyn DiscoveryContext)
Called when a new face comes up (after
FaceTable::insert).Source§fn on_face_down(&self, _face_id: FaceId, _ctx: &dyn DiscoveryContext)
fn on_face_down(&self, _face_id: FaceId, _ctx: &dyn DiscoveryContext)
Called when a face goes down (before
FaceTable::remove).Source§fn on_inbound(
&self,
_raw: &Bytes,
_incoming_face: FaceId,
_meta: &InboundMeta,
_ctx: &dyn DiscoveryContext,
) -> bool
fn on_inbound( &self, _raw: &Bytes, _incoming_face: FaceId, _meta: &InboundMeta, _ctx: &dyn DiscoveryContext, ) -> bool
Called for every inbound raw packet before it enters the pipeline. Read more
Source§fn on_tick(&self, _now: Instant, _ctx: &dyn DiscoveryContext)
fn on_tick(&self, _now: Instant, _ctx: &dyn DiscoveryContext)
Periodic tick, called by the engine’s tick task at
tick_interval. Read moreSource§fn tick_interval(&self) -> Duration
fn tick_interval(&self) -> Duration
How often the engine should call
on_tick. Read moreAuto Trait Implementations§
impl Freeze for NoDiscovery
impl RefUnwindSafe for NoDiscovery
impl Send for NoDiscovery
impl Sync for NoDiscovery
impl Unpin for NoDiscovery
impl UnwindSafe for NoDiscovery
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