[][src]Trait gamma::graph::Graph

pub trait Graph<'a, N: 'a> {
    type NodeIterator: Iterator<Item = &'a N>;
    type NeighborIterator: Iterator<Item = &'a N>;
    type EdgeIterator: Iterator<Item = (&'a N, &'a N)>;
    fn is_empty(&self) -> bool;
fn order(&self) -> usize;
fn size(&self) -> usize;
fn nodes(&'a self) -> Self::NodeIterator;
fn has_node(&self, node: &N) -> bool;
fn neighbors(&'a self, node: &N) -> Result<Self::NeighborIterator, Error>;
fn degree(&self, node: &N) -> Result<usize, Error>;
fn edges(&'a self) -> Self::EdgeIterator;
fn has_edge(&self, source: &N, target: &N) -> Result<bool, Error>; }

Associated Types

Loading content...

Required methods

fn is_empty(&self) -> bool

Returns true if there are no nodes, or false otherwise.

fn order(&self) -> usize

fn size(&self) -> usize

fn nodes(&'a self) -> Self::NodeIterator

fn has_node(&self, node: &N) -> bool

fn neighbors(&'a self, node: &N) -> Result<Self::NeighborIterator, Error>

fn degree(&self, node: &N) -> Result<usize, Error>

fn edges(&'a self) -> Self::EdgeIterator

fn has_edge(&self, source: &N, target: &N) -> Result<bool, Error>

Loading content...

Implementors

impl<'a, N: Eq + Hash, E> Graph<'a, N> for HashGraph<'a, N, E>[src]

type NodeIterator = Keys<'a, N, Vec<&'a N>>

type NeighborIterator = Cloned<Iter<'a, &'a N>>

type EdgeIterator = Cloned<Iter<'a, (&'a N, &'a N)>>

Loading content...