pub mod occupancy;
pub mod simple;
pub use simple::SimpleGraph;
pub mod shared_graph;
pub use shared_graph::SharedGraph;
use std::borrow::Borrow;
pub trait Edge<Key, Attributes> {
fn from_vertex(&self) -> &Key;
fn to_vertex(&self) -> &Key;
fn attributes(&self) -> &Attributes;
}
pub trait Graph {
type Vertex;
type Key;
type EdgeAttributes;
type VertexRef<'a>: Borrow<Self::Vertex> + 'a
where
Self: 'a,
Self::Vertex: 'a,
Self::Key: 'a,
Self::EdgeAttributes: 'a;
type Edge<'a>: Edge<Self::Key, Self::EdgeAttributes> + 'a
where
Self: 'a,
Self::Vertex: 'a,
Self::Key: 'a,
Self::EdgeAttributes: 'a;
type EdgeIter<'a>: IntoIterator<Item = Self::Edge<'a>> + 'a
where
Self: 'a,
Self::Vertex: 'a,
Self::Key: 'a,
Self::EdgeAttributes: 'a;
fn vertex<'a>(&'a self, key: &Self::Key) -> Option<Self::VertexRef<'a>>;
fn edges_from_vertex<'a>(&'a self, key: &Self::Key) -> Self::EdgeIter<'a>
where
Self: 'a,
Self::Vertex: 'a,
Self::Key: 'a,
Self::EdgeAttributes: 'a;
type LazyEdgeIter<'a>: IntoIterator<Item = Self::Edge<'a>> + 'a
where
Self: 'a,
Self::Vertex: 'a,
Self::Key: 'a,
Self::EdgeAttributes: 'a;
fn lazy_edges_between<'a>(
&'a self,
from_key: &Self::Key,
to_key: &Self::Key,
) -> Self::LazyEdgeIter<'a>
where
Self: 'a,
Self::Vertex: 'a,
Self::Key: 'a,
Self::EdgeAttributes: 'a;
}