graph_types/graphs/named.rs
1use super::*;
2
3/// Labeling a graph can provide Weight information
4///
5/// # Examples
6///
7/// ```
8/// use graph_theory::GraphEngine;
9/// ```
10pub trait NamedGraph<'i> {
11 /// Remove edge by given edge-id or start and end node-id.
12 ///
13 /// # Panics
14 ///
15 /// - No such ability
16 ///
17 /// Not all graph engine supports insert edge.
18 ///
19 /// # Examples
20 ///
21 /// ```
22 /// use graph_theory::GraphEngine;
23 /// ```
24 type NameRef;
25 /// Remove edge by given edge-id or start and end node-id.
26 ///
27 /// # Panics
28 ///
29 /// - No such ability
30 ///
31 /// Not all graph engine supports insert edge.
32 ///
33 /// # Examples
34 ///
35 /// ```
36 /// use graph_theory::GraphEngine;
37 /// ```
38 type NameMut;
39 /// Remove edge by given edge-id or start and end node-id.
40 ///
41 /// # Panics
42 ///
43 /// - No such ability
44 ///
45 /// Not all graph engine supports insert edge.
46 ///
47 /// # Examples
48 ///
49 /// ```
50 /// use graph_theory::GraphEngine;
51 /// ```
52 fn get_node_name(&'i self, node: NodeID) -> Option<Self::NameRef>;
53 /// Remove edge by given edge-id or start and end node-id.
54 ///
55 /// # Panics
56 ///
57 /// - No such ability
58 ///
59 /// Not all graph engine supports insert edge.
60 ///
61 /// # Examples
62 ///
63 /// ```
64 /// use graph_theory::GraphEngine;
65 /// ```
66 fn mut_node_name(&'i mut self, node: NodeID) -> Option<Self::NameMut>;
67 /// Remove edge by given edge-id or start and end node-id.
68 ///
69 /// # Panics
70 ///
71 /// - No such ability
72 ///
73 /// Not all graph engine supports insert edge.
74 ///
75 /// # Examples
76 ///
77 /// ```
78 /// use graph_theory::GraphEngine;
79 /// ```
80 fn set_node_name(&'i mut self, node: NodeID, name: &str);
81 /// Remove edge by given edge-id or start and end node-id.
82 ///
83 /// # Panics
84 ///
85 /// - No such ability
86 ///
87 /// Not all graph engine supports insert edge.
88 ///
89 /// # Examples
90 ///
91 /// ```
92 /// use graph_theory::GraphEngine;
93 /// ```
94 fn get_edge_name<Q: Into<EdgeQuery>>(&'i self, edge: Q) -> Option<Self::NameRef>;
95 /// Remove edge by given edge-id or start and end node-id.
96 ///
97 /// # Panics
98 ///
99 /// - No such ability
100 ///
101 /// Not all graph engine supports insert edge.
102 ///
103 /// # Examples
104 ///
105 /// ```
106 /// use graph_theory::GraphEngine;
107 /// ```
108 fn mut_edge_name<Q: Into<EdgeQuery>>(&'i mut self, edge: Q) -> Option<Self::NameMut>;
109 /// Remove edge by given edge-id or start and end node-id.
110 ///
111 /// # Panics
112 ///
113 /// - No such ability
114 ///
115 /// Not all graph engine supports insert edge.
116 ///
117 /// # Examples
118 ///
119 /// ```
120 /// use graph_theory::GraphEngine;
121 /// ```
122 fn set_edge_name<Q: Into<EdgeQuery>>(&'i mut self, edge: Q, name: &str);
123}