dsalgo/
graph.rs

1pub mod edge {
2
3    pub trait Edge {}
4
5    pub trait UndirectedEdge {
6        type V;
7
8        fn u(&self) -> &Self::V;
9
10        fn v(&self) -> &Self::V;
11    }
12
13    pub trait ToDirected {
14        type E;
15
16        fn to_directed(self) -> Self::E;
17    }
18
19    pub trait From {
20        type V;
21
22        fn from(&self) -> &Self::V;
23    }
24
25    pub trait To {
26        type V;
27
28        fn to(&self) -> &Self::V;
29    }
30
31    pub trait DirectedEdge: To {}
32
33    pub trait Reversed {
34        fn reversed(self) -> Self;
35    }
36
37    pub trait Value {
38        type T;
39
40        fn value(&self) -> &Self::T;
41    }
42
43    pub trait ValueMut {
44        type T;
45
46        fn value_mut(&mut self) -> &mut Self::T;
47    }
48
49    pub trait Weight<T> {
50        fn weight(&self) -> &T;
51    }
52
53    pub trait WeightMut<T> {
54        fn weight_mut(&mut self) -> &mut T;
55    }
56
57    pub trait Capacity<T> {
58        fn capacity(&self) -> &T;
59    }
60}