Trait swh_graph::graph::SwhGraph

source ·
pub trait SwhGraph {
    // Required methods
    fn path(&self) -> &Path;
    fn is_transposed(&self) -> bool;
    fn num_nodes(&self) -> usize;
    fn num_arcs(&self) -> u64;
    fn has_arc(&self, src_node_id: NodeId, dst_node_id: NodeId) -> bool;

    // Provided method
    fn has_node(&self, node_id: NodeId) -> bool { ... }
}

Required Methods§

source

fn path(&self) -> &Path

Return the base path of the graph

source

fn is_transposed(&self) -> bool

Returns whether the graph is in the ori->snp->rel,rev->dir->cnt direction (with a few dir->rev arcs)

source

fn num_nodes(&self) -> usize

Return the number of nodes in the graph.

source

fn num_arcs(&self) -> u64

Return the number of arcs in the graph.

source

fn has_arc(&self, src_node_id: NodeId, dst_node_id: NodeId) -> bool

Return whether there is an arc going from src_node_id to dst_node_id.

Provided Methods§

source

fn has_node(&self, node_id: NodeId) -> bool

Returns whether the given node id exists in the graph

This is usually true iff node_id < self.num_nodes(), but may be false when using a filtered view such as Subgraph.

Implementors§

source§

impl<G: SwhGraph> SwhGraph for GraphSpy<G>

source§

impl<G: SwhGraph> SwhGraph for Transposed<G>

source§

impl<G: SwhGraph, NodeFilter: Fn(usize) -> bool, ArcFilter: Fn(usize, usize) -> bool> SwhGraph for Subgraph<G, NodeFilter, ArcFilter>

source§

impl<P, FG: UnderlyingGraph, BG: UnderlyingGraph> SwhGraph for SwhBidirectionalGraph<P, FG, BG>

source§

impl<P, G: UnderlyingGraph> SwhGraph for SwhUnidirectionalGraph<P, G>

source§

impl<T: Deref> SwhGraph for Twhere <T as Deref>::Target: SwhGraph,