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§
Required Methods§
Sourcefn vertex_set(&self) -> &Self::Vertices
fn vertex_set(&self) -> &Self::Vertices
Gets the set of vertices.
Provided Methods§
Sourcefn iter_invalid(&self) -> impl Iterator<Item = InvalidGraph<Self::E>>
fn iter_invalid(&self) -> impl Iterator<Item = InvalidGraph<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.