Trait NetworkGraphView
pub trait NetworkGraphView {
type Observed: EdgeObservable + Send;
type NodeId: Send;
// Required methods
fn node_count(&self) -> usize;
fn contains_node(&self, key: &Self::NodeId) -> bool;
fn nodes(&self) -> Pin<Box<dyn Stream<Item = Self::NodeId> + Send>>;
fn edge(
&self,
src: &Self::NodeId,
dest: &Self::NodeId,
) -> Option<Self::Observed>;
// Provided method
fn has_edge(&self, src: &Self::NodeId, dest: &Self::NodeId) -> bool { ... }
}Expand description
A trait specifying read-only graph view functionality.
Provides methods to inspect the graph topology: node membership, node count, edge existence, and edge observation retrieval.
Required Associated Types§
type Observed: EdgeObservable + Send
type Observed: EdgeObservable + Send
The concrete type of observations for peers.
Required Methods§
fn node_count(&self) -> usize
fn node_count(&self) -> usize
Returns the number of nodes in the graph.
fn contains_node(&self, key: &Self::NodeId) -> bool
fn contains_node(&self, key: &Self::NodeId) -> bool
Checks whether the graph contains the given node.