Trait PathSelector

Source
pub trait PathSelector {
    // Required method
    fn select_path<'life0, 'async_trait>(
        &'life0 self,
        source: Address,
        destination: Address,
        min_hops: usize,
        max_hops: usize,
    ) -> Pin<Box<dyn Future<Output = Result<ChannelPath>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn select_auto_path<'life0, 'async_trait>(
        &'life0 self,
        source: Address,
        destination: Address,
    ) -> Pin<Box<dyn Future<Output = Result<ChannelPath>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait for implementing a custom path selection algorithm from the channel graph.

Required Methods§

Source

fn select_path<'life0, 'async_trait>( &'life0 self, source: Address, destination: Address, min_hops: usize, max_hops: usize, ) -> Pin<Box<dyn Future<Output = Result<ChannelPath>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Select a path of maximum max_hops from source to destination in the given channel graph. NOTE: the resulting path does not contain source but does contain destination. Fails if no such path can be found.

Provided Methods§

Source

fn select_auto_path<'life0, 'async_trait>( &'life0 self, source: Address, destination: Address, ) -> Pin<Box<dyn Future<Output = Result<ChannelPath>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Constructs a new valid packet Path from source to the given destination. This method uses INTERMEDIATE_HOPS as the maximum number of hops.

Implementors§