Skip to main content

TargetedResolver

Trait TargetedResolver 

Source
pub trait TargetedResolver: Resolver {
    type PublicKey: PublicKey;

    // Required methods
    fn fetch_targeted(
        &mut self,
        fetch: impl Into<Fetch<Self::Key, Self::Subscriber>> + Send,
        targets: NonEmptyVec<Self::PublicKey>,
    ) -> Feedback;
    fn fetch_all_targeted<F>(
        &mut self,
        keys: Vec<(F, NonEmptyVec<Self::PublicKey>)>,
    ) -> Feedback
       where F: Into<Fetch<Self::Key, Self::Subscriber>> + Send;
}
Expand description

Extension for resolvers that accept target peer hints.

Required Associated Types§

Source

type PublicKey: PublicKey

Type used to identify peers for targeted fetch hints.

Required Methods§

Source

fn fetch_targeted( &mut self, fetch: impl Into<Fetch<Self::Key, Self::Subscriber>> + Send, targets: NonEmptyVec<Self::PublicKey>, ) -> Feedback

Initiate a fetch with target peer hints.

Implementations define whether target hints persist through retries, merge with existing in-progress fetches, or are discarded.

Source

fn fetch_all_targeted<F>( &mut self, keys: Vec<(F, NonEmptyVec<Self::PublicKey>)>, ) -> Feedback
where F: Into<Fetch<Self::Key, Self::Subscriber>> + Send,

Initiate fetches for multiple keys, each with their own target hints.

See fetch_targeted for details on target behavior.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, P, S> TargetedResolver for Mailbox<K, P, S>
where K: Span, P: PublicKey, S: Clone + Eq + Send + 'static,

Source§

impl<K, S, P> TargetedResolver for Resolver<K, S, P>
where K: Span, S: Clone + Eq + Send + 'static, P: PublicKey,