Expand description
bb::PeerSelector — Contract trait for peer-selection protocols.
Every method takes ctx: &mut RuntimeResourceRef<'_> as the first
parameter after &mut self (the uniform shape shared by every
Contract trait) plus a CompletionHandle AND returns
ContractResponse. See crate::contracts::index for the
sync (Now) vs async (Later) semantics.
Selector impls read ctx.peers.addresses to walk the local
AddressBook, write through it for membership updates from the
dispatch_atomic arm (Announce / Forget), and reach the
shared Scheduler via ctx.time when they need to plan a delayed
probe. Declared dependencies are reached via
ctx.dependency::<T>(slot).
Enums§
- Select
Params - Parameters describing what peer set to select. Different
concrete selectors handle the variants they support and return
an error variant for the ones they don’t (e.g.
GlobalRegistrysupportsRandom+All;DhtViewsupportsNearKey).
Traits§
- Peer
Selector - User-facing Contract trait for a peer-selection protocol.