Trait ColumnarGraph

Source
pub trait ColumnarGraph {
    type V: Eq + Clone;
    type E: Eq + Clone;
    type Vertices: Set<Elem = Self::V>;
    type Edges: Set<Elem = Self::E>;
    type Src: Mapping<Dom = Self::E, Cod = Self::V>;
    type Tgt: Mapping<Dom = Self::E, Cod = Self::V>;

    // Required methods
    fn vertex_set(&self) -> &Self::Vertices;
    fn edge_set(&self) -> &Self::Edges;
    fn src_map(&self) -> &Self::Src;
    fn tgt_map(&self) -> &Self::Tgt;

    // Provided method
    fn iter_invalid(&self) -> impl Iterator<Item = InvalidGraph<Self::E>>
       where Self::Edges: FinSet<Elem = Self::E> { ... }
}
Expand description

A graph backed by sets and mappings.

Such a graph is defined in copresheaf style by two sets and two mappings. Implementing this trait provides a blanket implementation of Graph. This is the easiest way to define a new graph type.

This trait does not assume that the graph is mutable; for that, you must also implement the trait MutColumnarGraph.

Required Associated Types§

Source

type V: Eq + Clone

Type of vertices in the graph.

Source

type E: Eq + Clone

Type of edges in the graph.

Source

type Vertices: Set<Elem = Self::V>

The set of vertices.

Source

type Edges: Set<Elem = Self::E>

The set of edges.

Source

type Src: Mapping<Dom = Self::E, Cod = Self::V>

The map assigning each edge its source vertex.

Source

type Tgt: Mapping<Dom = Self::E, Cod = Self::V>

The map assigning each edge its target vertex.

Required Methods§

Source

fn vertex_set(&self) -> &Self::Vertices

Gets the set of vertices.

Source

fn edge_set(&self) -> &Self::Edges

Gets the set of edges.

Source

fn src_map(&self) -> &Self::Src

Gets the mapping assigning a source vertex to each edge.

Source

fn tgt_map(&self) -> &Self::Tgt

Gets the mapping assignment a target vertex to each edge.

Provided Methods§

Source

fn iter_invalid(&self) -> impl Iterator<Item = InvalidGraph<Self::E>>
where Self::Edges: FinSet<Elem = Self::E>,

Iterates over failures to be a valid graph.

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.

Implementors§

Source§

impl ColumnarGraph for SkelGraph

Source§

impl<'a, Ob, ObSet, E, S> ColumnarGraph for Computad<'a, Ob, ObSet, E, S>
where Ob: Eq + Clone, ObSet: Set<Elem = Ob>, E: Eq + Clone + Hash, S: BuildHasher,

Source§

type V = Ob

Source§

type E = E

Source§

type Vertices = ObSet

Source§

type Edges = HashFinSet<E, S>

Source§

type Src = HashColumn<E, Ob, S>

Source§

type Tgt = HashColumn<E, Ob, S>

Source§

impl<V, E, S> ColumnarGraph for HashGraph<V, E, S>
where V: Eq + Hash + Clone, E: Eq + Hash + Clone, S: BuildHasher,