Skip to main content

ResolveHandle

Trait ResolveHandle 

Source
pub trait ResolveHandle {
    type Error: Debug + Send;

    // Provided methods
    fn resolve_random(
        &mut self,
        id: impl Into<Id>,
    ) -> impl Future<Output = Result<Option<PeerId>, Self::Error>> { ... }
    fn resolve_first(
        &mut self,
        id: impl Into<Id>,
    ) -> impl Future<Output = Result<Option<PeerId>, Self::Error>> { ... }
    fn resolve_all(
        &mut self,
        id: impl Into<Id>,
    ) -> impl Stream<Item = Result<PeerId, Self::Error>> + Send { ... }
    fn resolve_handle(
        &mut self,
        _handle: impl Into<Handle>,
    ) -> impl Stream<Item = Result<PeerId, Self::Error>> + Send { ... }
}
Expand description

A resolver for ASIMOV handles (e.g., “Ⓐjhacker”).

Required Associated Types§

Provided Methods§

Source

fn resolve_random( &mut self, id: impl Into<Id>, ) -> impl Future<Output = Result<Option<PeerId>, Self::Error>>

Resolves an ASIMOV ID and yields a random known peer ID. Ignores any erroneous results, sampling from only successful results.

The default implementation requires the random feature.

Source

fn resolve_first( &mut self, id: impl Into<Id>, ) -> impl Future<Output = Result<Option<PeerId>, Self::Error>>

Resolves an ASIMOV ID and yields only the first known peer ID. Ignores any initial erroneous results, returning the first successful result.

Source

fn resolve_all( &mut self, id: impl Into<Id>, ) -> impl Stream<Item = Result<PeerId, Self::Error>> + Send

Resolves an ASIMOV ID into a stream of all known peer IDs.

Source

fn resolve_handle( &mut self, _handle: impl Into<Handle>, ) -> impl Stream<Item = Result<PeerId, Self::Error>> + Send

Resolves an ASIMOV handle into a stream of all known peer IDs.

This is the only method that trait implementors must provide.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl ResolveHandle for CsvHandleResolver

Available on crate features csv and std only.