Skip to main content

RandomAccessGraph

Trait RandomAccessGraph 

Source
pub trait RandomAccessGraph: RandomAccessLabeling<Label = usize> + SequentialGraph {
    // Provided methods
    fn successors(
        &self,
        node_id: usize,
    ) -> <Self as RandomAccessLabeling>::Labels<'_> { ... }
    fn labels(
        &self,
        _node_id: usize,
    ) -> <Self as RandomAccessLabeling>::Labels<'_>
       where for<'a> this_method_cannot_be_called_use_successors_instead: Clone { ... }
    fn has_arc(&self, src_node_id: usize, dst_node_id: usize) -> bool { ... }
}
Expand description

A sequential graph providing, additionally, random access to successor lists.

On such a graph, successors are returned by the successors method rather than by the labels method.

Provided Methods§

Source

fn successors( &self, node_id: usize, ) -> <Self as RandomAccessLabeling>::Labels<'_>

Returns the successors of a node.

Note that this is just a convenience alias of the RandomAccessLabeling::labels method, which is overridden in this trait by an unimplemented, uncallable version. This approach avoids that users might call labels expecting to get just the labels associated with a node.

Source

fn labels(&self, _node_id: usize) -> <Self as RandomAccessLabeling>::Labels<'_>
where for<'a> this_method_cannot_be_called_use_successors_instead: Clone,

Disabling override of the RandomAccessLabeling::labels method.

The where clause of this override contains an unsatisfiable private trait bound, which makes calling this method impossible. Use the RandomAccessGraph::successors method instead.

Source

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

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

Note that the default implementation performs a linear scan.

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.

Implementations on Foreign Types§

Source§

impl<S: RandomAccessGraph + ?Sized> RandomAccessGraph for &S

Source§

fn successors( &self, node_id: usize, ) -> <Self as RandomAccessLabeling>::Labels<'_>

Source§

fn labels(&self, _node_id: usize) -> <Self as RandomAccessLabeling>::Labels<'_>
where for<'a> this_method_cannot_be_called_use_successors_instead: Clone,

Source§

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

Source§

impl<S: RandomAccessGraph + ?Sized> RandomAccessGraph for &mut S

Source§

fn successors( &self, node_id: usize, ) -> <Self as RandomAccessLabeling>::Labels<'_>

Source§

fn labels(&self, _node_id: usize) -> <Self as RandomAccessLabeling>::Labels<'_>
where for<'a> this_method_cannot_be_called_use_successors_instead: Clone,

Source§

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

Source§

impl<S: RandomAccessGraph + ?Sized> RandomAccessGraph for Rc<S>

Source§

fn successors( &self, node_id: usize, ) -> <Self as RandomAccessLabeling>::Labels<'_>

Source§

fn labels(&self, _node_id: usize) -> <Self as RandomAccessLabeling>::Labels<'_>
where for<'a> this_method_cannot_be_called_use_successors_instead: Clone,

Source§

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

Implementors§