pentagram 0.1.0

graph library with a focus on ergonomics and minimalism
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub trait MultiDiGraph<'a, NI: 'a, ND: 'a, EI: 'a, ED: 'a> {
    type NodeIter: ExactSizeIterator<Item = (&'a NI, &'a ND)>;
    type EdgeIter: ExactSizeIterator<Item = (&'a NI, &'a NI, &'a EI, &'a ED)>;
    type NodeEdgeIter: ExactSizeIterator<Item = (&'a NI, &'a NI, &'a EI, &'a ED)>;

    fn insert_node(&mut self, id: NI, data: ND) -> Result<(), ()>;
    fn remove_node(&mut self, id: &NI) -> Option<ND>;
    fn insert_edge(&mut self, from: &NI, to: &NI, id: EI, data: ED) -> Result<(), ()>;
    fn remove_edge(&mut self, id: &EI) -> Option<(NI, NI, ED)>;
    fn nodes(&'a self) -> Self::NodeIter;
    fn edges(&'a self) -> Self::EdgeIter;
    fn node_data(&self, id: &NI) -> Option<&ND>;
    fn node_data_mut(&mut self, id: &NI) -> Option<&mut ND>;
    fn node_in_edges(&'a self, id: &NI) -> Option<Self::NodeEdgeIter>;
    fn node_out_edges(&'a self, id: &NI) -> Option<Self::NodeEdgeIter>;
    fn edge_data(&self, id: &EI) -> Option<&ED>;
    fn edge_data_mut(&mut self, id: &EI) -> Option<&mut ED>;
}