pub trait LookupQuery<N>where
N: LookupNode,{
type Error;
// Required method
fn query_batch(
&mut self,
target: [u8; 32],
count: usize,
iteration: usize,
batch: Vec<N>,
) -> impl Future<Output = Result<Vec<LookupQueryOutcome<N>>, Self::Error>>;
// Provided methods
fn is_candidate_eligible(
&mut self,
_candidate: &N,
) -> impl Future<Output = Result<bool, Self::Error>> { ... }
fn candidate_evicted(
&mut self,
_peer: [u8; 32],
) -> impl Future<Output = Result<(), Self::Error>> { ... }
}Expand description
Transport and response-validation boundary used by the shared DHT walk.
Implementations receive a complete α-sized batch so they can execute its queries concurrently using transport-specific cancellation and timeout facilities. Only validated candidates should be returned to the engine. The shared runner may drop any pending adapter future at its overall deadline. Implementations must support cancellation without detached work.
Required Associated Types§
Required Methods§
Sourcefn query_batch(
&mut self,
target: [u8; 32],
count: usize,
iteration: usize,
batch: Vec<N>,
) -> impl Future<Output = Result<Vec<LookupQueryOutcome<N>>, Self::Error>>
fn query_batch( &mut self, target: [u8; 32], count: usize, iteration: usize, batch: Vec<N>, ) -> impl Future<Output = Result<Vec<LookupQueryOutcome<N>>, Self::Error>>
Execute one concurrent lookup batch and validate its responses.
A missing outcome is treated as LookupQueryOutcome::Unresponsive.
Provided Methods§
Sourcefn is_candidate_eligible(
&mut self,
_candidate: &N,
) -> impl Future<Output = Result<bool, Self::Error>>
fn is_candidate_eligible( &mut self, _candidate: &N, ) -> impl Future<Output = Result<bool, Self::Error>>
Whether the current address view for a candidate is usable.
Returning false discards this representation without assigning a
final peer state. A later response may therefore reintroduce the same
peer with a usable address.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".