use prelude::*;
use std::iter::Empty;
pub struct Never<T>(!, T);
impl<'a, K: EdgeKind> VertexTypes<'a, Never<K>> for Never<K> {
type VertexIter = Empty<()>;
type OutNeighborIter = Empty<()>;
}
impl<K: EdgeKind> WithVertex for Never<K> {
type Vertex = ();
type OptionVertex = Option<()>;
}
impl<'a, K: EdgeKind> EdgeTypes<'a, Never<K>> for Never<K> {
type EdgeIter = Empty<()>;
type OutEdgeIter = Empty<()>;
}
impl<K: EdgeKind> WithEdge for Never<K> {
type Kind = K;
type Edge = ();
type OptionEdge = Option<()>;
fn orientation(&self, _e: Edge<Self>) -> Orientation {
self.0
}
fn source(&self, _e: Edge<Self>) -> Vertex<Self> {
self.0
}
fn target(&self, _e: Edge<Self>) -> Vertex<Self> {
self.0
}
}
impl<K: EdgeKind> VertexList for Never<K> {
fn vertices(&self) -> VertexIter<Self> {
self.0
}
}
impl<K: EdgeKind> EdgeList for Never<K> {
fn edges(&self) -> EdgeIter<Self> {
self.0
}
}
impl<K: EdgeKind> Adjacency for Never<K> {
fn out_neighbors(&self, _v: Vertex<Self>) -> OutNeighborIter<Self> {
self.0
}
}
impl<K: EdgeKind> Incidence for Never<K> {
fn out_edges(&self, _v: Vertex<Self>) -> OutEdgeIter<Self> {
self.0
}
}