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 is Zip<L, R>, this defers to L (aka. Left<Zip<L, R>).
  • If Self is VecGraph<_>, this does the equivalent of deferring to VecGraph<()> (through DelabelingIterator because it cannot create a new VecGraph without copying)

Required Associated Types§

source

type UnlabeledSuccessors<'succ>: IntoIterator<Item = NodeId> where Self: 'succ

Required Methods§

source

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 SwhLabels::num_arcs always panics as of f460742fe0f776df2248a5f09a3425b81eb70b07, so we can’t use that.

source

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

source

fn unlabeled_successors(&self, node_id: NodeId) -> Self::UnlabeledSuccessors<'_>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<F: RandomAccessDecoderFactory> UnderlyingGraph for BVGraph<F>

§

type UnlabeledSuccessors<'succ> = <BVGraph<F> as RandomAccessLabeling>::Labels<'succ> where Self: 'succ

source§

fn num_arcs(&self) -> u64

source§

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

source§

fn unlabeled_successors(&self, node_id: NodeId) -> Self::UnlabeledSuccessors<'_>

source§

impl<G: UnderlyingGraph, L: RandomAccessLabeling> UnderlyingGraph for Zip<G, L>

§

type UnlabeledSuccessors<'succ> = <G as UnderlyingGraph>::UnlabeledSuccessors<'succ> where Self: 'succ

source§

fn num_arcs(&self) -> u64

source§

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

source§

fn unlabeled_successors(&self, node_id: NodeId) -> Self::UnlabeledSuccessors<'_>

source§

impl<L: Copy> UnderlyingGraph for Left<VecGraph<L>>

§

type UnlabeledSuccessors<'succ> = <Left<VecGraph<L>> as RandomAccessLabeling>::Labels<'succ> where Self: 'succ

source§

fn num_arcs(&self) -> u64

source§

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

source§

fn unlabeled_successors(&self, node_id: NodeId) -> Self::UnlabeledSuccessors<'_>

source§

impl<L: Copy> UnderlyingGraph for VecGraph<L>

§

type UnlabeledSuccessors<'succ> = DelabelingIterator<<VecGraph<L> as RandomAccessLabeling>::Labels<'succ>> where Self: 'succ

source§

fn num_arcs(&self) -> u64

source§

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

source§

fn unlabeled_successors(&self, node_id: NodeId) -> Self::UnlabeledSuccessors<'_>

Implementors§