reactive_graph_graph/instances/named/mod.rs
1pub trait NamedInstanceContainer {
2 /// Returns the name of the instance.
3 fn name(&self) -> String;
4
5 /// Returns the description of the instance.
6 fn description(&self) -> String;
7}
8
9// pub struct NamedInstance {
10// pub name: String,
11// pub description: String,
12// }
13//
14// impl NamedInstanceContainer for NamedInstance {
15// fn name(&self) -> String {
16// self.name.clone()
17// }
18//
19// fn description(&self) -> String {
20// self.description.clone()
21// }
22// }
23//
24// impl NamedInstanceContainer for Option<NamedInstance> {
25// fn name(&self) -> String {
26// match self {
27// None => Default::default(),
28// Some(named_instance) => named_instance.name.clone(),
29// }
30// }
31//
32// fn description(&self) -> String {
33// match self {
34// None => Default::default(),
35// Some(named_instance) => named_instance.description.clone(),
36// }
37// }
38// }