Trait DirectedGraph

Source
pub trait DirectedGraph<K: Key, T> {
    type Node: DirectedGraphNode<K, T>;

    // Required methods
    fn get(&self, key: K) -> Option<&Self::Node>;
    fn get_mut(&mut self, key: K) -> Option<&mut Self::Node>;
    fn node_count(&self) -> usize;
    fn from_len(&self) -> usize;
    fn to_len(&self) -> usize;
    fn from(&self) -> &[K];
    fn to(&self) -> &[K];
    fn topological_sort(&self) -> &[K];
}
Expand description

有向无环图 K 节点的键 T 节点的值

Required Associated Types§

Source

type Node: DirectedGraphNode<K, T>

节点

Required Methods§

Source

fn get(&self, key: K) -> Option<&Self::Node>

根据 key 取 节点

Source

fn get_mut(&mut self, key: K) -> Option<&mut Self::Node>

根据 key 取 节点

Source

fn node_count(&self) -> usize

取节点的数量

Source

fn from_len(&self) -> usize

取 有输入节点 的 数量

Source

fn to_len(&self) -> usize

取 有输出节点 的 数量

Source

fn from(&self) -> &[K]

取 输入节点 切片

Source

fn to(&self) -> &[K]

取 输出节点 切片

Source

fn topological_sort(&self) -> &[K]

拓扑排序

Implementors§

Source§

impl<K: Key, T> DirectedGraph<K, T> for NGraph<K, T>