pub trait UnderlyingGraph: RandomAccessLabeling {
type UnlabeledSuccessors<'succ>: IntoIterator<Item = NodeId>
where Self: 'succ;
// Required methods
fn num_arcs(&self) -> u64;
fn has_arc(&self, src_node_id: NodeId, dst_node_id: NodeId) -> bool;
fn unlabeled_successors(
&self,
node_id: NodeId,
) -> Self::UnlabeledSuccessors<'_>;
}
Expand description
Supertrait of RandomAccessLabeling
with methods to act like a RandomAccessGraph
.
If Self
implements RandomAccessGraph
, then this is implemented as no-ops.
Otherwise, it “unpeels” layers of zipping until it reaches the graph at the bottom:
- If
Self
isZip<L, R>
, this defers toL
(aka.Left<Zip<L, R>
). - If
Self
isVecGraph
orLabeledVecGraph<_>, this does the equivalent of deferring to
VecGraph(through [
DelabelingIterator] because it cannot create a new
VecGraph` without copying)
Required Associated Types§
type UnlabeledSuccessors<'succ>: IntoIterator<Item = NodeId> where Self: 'succ
Required Methods§
Sourcefn num_arcs(&self) -> u64
fn num_arcs(&self) -> u64
Workaround for some implementations of <Self as RandomAccessLabeling>::num_arcs
being missing
Zip::num_arcs
runs assert_eq!(self.0.num_arcs(), self.1.num_arcs());
but BitStreamLabeling::num_arcs
always panics as of
f460742fe0f776df2248a5f09a3425b81eb70b07, so we can’t use that.
fn has_arc(&self, src_node_id: NodeId, dst_node_id: NodeId) -> bool
fn unlabeled_successors(&self, node_id: NodeId) -> Self::UnlabeledSuccessors<'_>
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.