Trait NetworkGraphTraverse
pub trait NetworkGraphTraverse {
type NodeId: Send + Sync;
type Observed: EdgeObservableRead + Send;
// Required methods
fn simple_paths<C>(
&self,
source: &Self::NodeId,
destination: &Self::NodeId,
length: usize,
take_count: Option<usize>,
cost_fn: C,
) -> Vec<(Vec<Self::NodeId>, [u64; 5], <C as CostFn>::Cost)>
where C: CostFn<Weight = Self::Observed>;
fn simple_loopback_to_self(
&self,
length: usize,
take_count: Option<usize>,
) -> Vec<(Vec<Self::NodeId>, [u64; 5])>;
}Expand description
A trait specifying the graph traversal functionality.
Provides methods for finding simple paths between nodes in the network graph.
Required Associated Types§
type Observed: EdgeObservableRead + Send
type Observed: EdgeObservableRead + Send
The concrete edge observation type used by cost functions during traversal.
Required Methods§
fn simple_paths<C>(
&self,
source: &Self::NodeId,
destination: &Self::NodeId,
length: usize,
take_count: Option<usize>,
cost_fn: C,
) -> Vec<(Vec<Self::NodeId>, [u64; 5], <C as CostFn>::Cost)>
fn simple_paths<C>( &self, source: &Self::NodeId, destination: &Self::NodeId, length: usize, take_count: Option<usize>, cost_fn: C, ) -> Vec<(Vec<Self::NodeId>, [u64; 5], <C as CostFn>::Cost)>
Returns a list of routes from the source to the destination with the specified length at the time of calling.
The length argument specifies the number of edges in the graph, over which the path should be formed, i.e. source -> intermediate -> destination is 2 edges.
The take count argument should be set in case the graph is expected to be large enough to be traversed slowly.
fn simple_loopback_to_self(
&self,
length: usize,
take_count: Option<usize>,
) -> Vec<(Vec<Self::NodeId>, [u64; 5])>
fn simple_loopback_to_self( &self, length: usize, take_count: Option<usize>, ) -> Vec<(Vec<Self::NodeId>, [u64; 5])>
Return a list of nodes with a full loopback from myself to myself.
The length argument specifies the number of edges in the graph, over which the path should be formed, i.e. source -> intermediate -> destination is 2 edges.
At least length 2 is required to provide a path through a single relay.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.