[][src]Trait handlegraph::handlegraph::IntoNeighbors

pub trait IntoNeighbors: Sized {
    type Neighbors: Iterator<Item = Handle>;
    fn neighbors(self, handle: Handle, dir: Direction) -> Self::Neighbors;

    fn degree(self, handle: Handle, dir: Direction) -> usize { ... }
fn has_edge(self, left: Handle, right: Handle) -> bool { ... } }

Access to the neighbors of handles in the graph, and querying the graph for a node's degree.

Implementors should make sure that handles are flipped correctly depending on direction, e.g. using NeighborIter

Associated Types

Loading content...

Required methods

fn neighbors(self, handle: Handle, dir: Direction) -> Self::Neighbors[src]

Return an iterator of the Handles adjacent to the given handle, in the provided Direction. Implementations should take the orientation of handle into account.

Loading content...

Provided methods

fn degree(self, handle: Handle, dir: Direction) -> usize[src]

Return the number of neighbors of handle in the given direction. The default implementation uses count on Self::neighbors.

fn has_edge(self, left: Handle, right: Handle) -> bool[src]

Returns true if the left handle has a connection on its right-hand side to the right handle. The default implementation uses any on Self::neighbors.

Loading content...

Implementors

impl<'a> IntoNeighbors for &'a HashGraph[src]

type Neighbors = NeighborIter<'a, Iter<'a, Handle>>

impl<'a> IntoNeighbors for &'a PackedGraph[src]

type Neighbors = EdgeListHandleIter<'a>

Loading content...