Trait graphannis_core::graph::storage::EdgeContainer

source ·
pub trait EdgeContainer: Sync + Send {
    // Required methods
    fn get_outgoing_edges<'a>(
        &'a self,
        node: NodeID
    ) -> Box<dyn Iterator<Item = Result<NodeID>> + 'a>;
    fn get_ingoing_edges<'a>(
        &'a self,
        node: NodeID
    ) -> Box<dyn Iterator<Item = Result<NodeID>> + 'a>;
    fn source_nodes<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = Result<NodeID>> + 'a>;

    // Provided methods
    fn has_outgoing_edges(&self, node: NodeID) -> Result<bool> { ... }
    fn has_ingoing_edges(&self, node: NodeID) -> Result<bool> { ... }
    fn get_statistics(&self) -> Option<&GraphStatistic> { ... }
    fn root_nodes<'a>(&'a self) -> Box<dyn Iterator<Item = Result<NodeID>> + 'a> { ... }
}
Expand description

Basic trait for accessing edges of a graph for a specific component.

Required Methods§

source

fn get_outgoing_edges<'a>( &'a self, node: NodeID ) -> Box<dyn Iterator<Item = Result<NodeID>> + 'a>

Get all outgoing edges for a given node.

source

fn get_ingoing_edges<'a>( &'a self, node: NodeID ) -> Box<dyn Iterator<Item = Result<NodeID>> + 'a>

Get all incoming edges for a given node.

source

fn source_nodes<'a>(&'a self) -> Box<dyn Iterator<Item = Result<NodeID>> + 'a>

Provides an iterator over all nodes of this edge container that are the source of an edge.

Provided Methods§

source

fn has_outgoing_edges(&self, node: NodeID) -> Result<bool>

Return true of the given node has any outgoing edges.

source

fn has_ingoing_edges(&self, node: NodeID) -> Result<bool>

Return true of the given node has any incoming edges.

source

fn get_statistics(&self) -> Option<&GraphStatistic>

source

fn root_nodes<'a>(&'a self) -> Box<dyn Iterator<Item = Result<NodeID>> + 'a>

Provides an iterator over all nodes of this edge container that have no incoming edges.

Implementors§