NetworkGraphView

Trait NetworkGraphView 

Source
pub trait NetworkGraphView {
    // Required methods
    fn nodes(&self) -> Pin<Box<dyn Stream<Item = PeerId> + Send>>;
    fn find_routes<'life0, 'life1, 'async_trait>(
        &'life0 self,
        destination: &'life1 PeerId,
        length: usize,
    ) -> Pin<Box<dyn Future<Output = Vec<DestinationRouting>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

A trait specifying the graph traversal functionality

Required Methods§

Source

fn nodes(&self) -> Pin<Box<dyn Stream<Item = PeerId> + Send>>

Returns a stream of all known nodes in the network graph.

Source

fn find_routes<'life0, 'life1, 'async_trait>( &'life0 self, destination: &'life1 PeerId, length: usize, ) -> Pin<Box<dyn Future<Output = Vec<DestinationRouting>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns a list of all routes to the given destination of the specified length.

Implementations on Foreign Types§

Source§

impl<T> NetworkGraphView for ImmediateNeighborChannelGraph<T>
where T: NetworkView + Send + Sync + Clone + 'static,

Source§

fn nodes(&self) -> Pin<Box<dyn Stream<Item = PeerId> + Send>>

Source§

fn find_routes<'life0, 'life1, 'async_trait>( &'life0 self, _destination: &'life1 PeerId, _length: usize, ) -> Pin<Box<dyn Future<Output = Vec<DestinationRouting>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, ImmediateNeighborChannelGraph<T>: 'async_trait,

Implementors§