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 methods
fn has_node(&self, node_id: NodeId) -> bool { ... }
fn iter_nodes<'a>(
&'a self,
pl: impl ProgressLog + 'a,
) -> impl Iterator<Item = NodeId> + 'a { ... }
fn par_iter_nodes<'a>(
&'a self,
pl: impl ConcurrentProgressLog + 'a,
) -> impl ParallelIterator<Item = NodeId> + 'a
where Self: Sync { ... }
}
Required Methods§
Sourcefn is_transposed(&self) -> bool
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)
Provided Methods§
Sourcefn has_node(&self, node_id: NodeId) -> bool
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
.
Sourcefn iter_nodes<'a>(
&'a self,
pl: impl ProgressLog + 'a,
) -> impl Iterator<Item = NodeId> + 'a
fn iter_nodes<'a>( &'a self, pl: impl ProgressLog + 'a, ) -> impl Iterator<Item = NodeId> + 'a
Returns an iterator on all the nodes
Order is not guaranteed.
Updates the progress logger on every node id from 0 to self.num_nodes()
,
even those that are filtered out.
Sourcefn par_iter_nodes<'a>(
&'a self,
pl: impl ConcurrentProgressLog + 'a,
) -> impl ParallelIterator<Item = NodeId> + 'awhere
Self: Sync,
fn par_iter_nodes<'a>(
&'a self,
pl: impl ConcurrentProgressLog + 'a,
) -> impl ParallelIterator<Item = NodeId> + 'awhere
Self: Sync,
Returns a parallel iterator on all the nodes
Order is not guaranteed.
Updates the progress logger on every node id from 0 to self.num_nodes()
,
even those that are filtered out.
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.