Skip to main content

EdgeContainer

Trait 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§