Trait iroh_blobs::downloader::Dialer

source ·
pub trait Dialer: Stream<Item = (NodeId, Result<Self::Connection>)> + Unpin {
    type Connection: Clone + 'static;

    // Required methods
    fn queue_dial(&mut self, node_id: NodeId);
    fn pending_count(&self) -> usize;
    fn is_pending(&self, node: NodeId) -> bool;
    fn node_id(&self) -> NodeId;
}
Available on crate feature downloader only.
Expand description

Trait modeling a dialer. This allows for IO-less testing.

Required Associated Types§

source

type Connection: Clone + 'static

Type of connections returned by the Dialer.

Required Methods§

source

fn queue_dial(&mut self, node_id: NodeId)

Dial a node.

source

fn pending_count(&self) -> usize

Get the number of dialing nodes.

source

fn is_pending(&self, node: NodeId) -> bool

Check if a node is being dialed.

source

fn node_id(&self) -> NodeId

Get the node id of our node.

Implementations on Foreign Types§

source§

impl Dialer for Dialer

§

type Connection = Connection

source§

fn queue_dial(&mut self, node_id: NodeId)

source§

fn pending_count(&self) -> usize

source§

fn is_pending(&self, node: NodeId) -> bool

source§

fn node_id(&self) -> NodeId

Implementors§