Trait Kinship

Source
pub trait Kinship<K, V>: AnyGraph<K, V>
where K: Key, V: Value,
{ // Required methods fn successors(&self) -> HashMap<Vertex<K, V>, Vec<Edge<K>>>; fn predecessors(&self) -> HashMap<Vertex<K, V>, Vec<Edge<K>>>; // Provided methods fn successors_as_key_and_edges(&self) -> HashMap<K, Vec<Edge<K>>> { ... } fn predecessors_as_key_and_edges(&self) -> HashMap<K, Vec<Edge<K>>> { ... } fn key_vertex_map(&self) -> HashMap<K, Vertex<K, V>> { ... } }
Expand description

An interface for getting the successors and predecessors of each Vertex.

Required Methods§

Source

fn successors(&self) -> HashMap<Vertex<K, V>, Vec<Edge<K>>>

Get the successors of each vertex.

Source

fn predecessors(&self) -> HashMap<Vertex<K, V>, Vec<Edge<K>>>

Get the predecessors of each vertex.

Provided Methods§

Source

fn successors_as_key_and_edges(&self) -> HashMap<K, Vec<Edge<K>>>

Get the successors of each vertex where the key is a Key.

Source

fn predecessors_as_key_and_edges(&self) -> HashMap<K, Vec<Edge<K>>>

Get the predecessors of each vertex where the key is a Key.

Source

fn key_vertex_map(&self) -> HashMap<K, Vertex<K, V>>

Get the map of key and vertex.

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<K, V> Kinship<K, V> for BasicDirectedGraph<K, V>
where K: Key, V: Value,

Source§

impl<K, V> Kinship<K, V> for BasicUndirectedGraph<K, V>
where K: Key, V: Value,