reactive_graph_model_core/reactive_graph/core/
labeled.rs

1//! ---------------------------------------------
2//! This file was generated automatically.
3//! ---------------------------------------------
4#![allow(dead_code, unused)]
5#![cfg_attr(rustfmt, rustfmt_skip)]
6
7/// Namespace `reactive_graph::core::Labeled`
8#[cfg_attr(rustfmt, rustfmt_skip)]
9pub const LABELED_NAMESPACE: &str = "reactive_graph::core::Labeled";
10
11/// The [type identifier]() of Component `Labeled`.
12///
13/// ### Namespace
14///
15/// The fully qualified namespace is
16/// `reactive_graph::core::Labeled`
17pub static LABELED: std::sync::LazyLock<reactive_graph_graph::ComponentTypeId> = std::sync::LazyLock::new(||
18std::str::FromStr::from_str(LABELED_NAMESPACE).unwrap());
19
20/// The properties of Component `Labeled`.
21#[allow(non_camel_case_types)]
22#[derive(Debug, PartialEq, PartialOrd, Eq, Hash, Clone)]
23pub enum LabeledProperties {
24    
25    /// ### Property `label`
26    ///
27    /// Hierarchical path with static segments, named parameters and catch-all parameters
28    ///
29    /// Data Type: `String`
30    ///
31    /// Socket Type: `None`
32    ///
33    /// Mutability: `Mutable`
34    ///
35    LABEL,
36}
37impl LabeledProperties {
38    pub fn len() -> usize {
39        1usize
40    }
41    
42    pub fn property_types() -> reactive_graph_graph::PropertyTypes {
43        let property_types = reactive_graph_graph::PropertyTypes::new();
44        property_types.push(LabeledProperties::LABEL);
45        property_types
46    }
47}
48
49impl AsRef<str> for LabeledProperties {
50    #[inline]
51    fn as_ref(&self) -> &str {
52        match *self {
53            LabeledProperties::LABEL => "label",
54        }
55    }
56}
57
58impl From<LabeledProperties> for &'static str {
59    #[inline]
60    fn from(properties: LabeledProperties) -> &'static str {
61        match properties {
62            LabeledProperties::LABEL => "label",
63        }
64    }
65}
66
67impl From<LabeledProperties> for String {
68    #[inline]
69    fn from(properties: LabeledProperties) -> String {
70        match properties {
71            LabeledProperties::LABEL => "label".to_owned(),
72        }
73    }
74}
75
76impl From<LabeledProperties> for reactive_graph_graph::PropertyType {
77    #[inline]
78    fn from(properties: LabeledProperties) -> reactive_graph_graph::PropertyType {
79        match properties {
80            LabeledProperties::LABEL => {
81                reactive_graph_graph::PropertyType::new_with_all(
82                    "label",
83                    "Hierarchical path with static segments, named parameters and catch-all parameters",
84                    reactive_graph_graph::DataType::String,
85                    reactive_graph_graph::SocketType::None,
86                    reactive_graph_graph::Mutability::Mutable,
87                    reactive_graph_graph::Extensions::new(),
88                )
89            }
90        }
91    }
92}
93
94pub struct LabeledPropertiesIterator(Option<LabeledProperties>);
95
96impl LabeledProperties {
97    pub fn into_iter() -> LabeledPropertiesIterator {
98        LabeledPropertiesIterator(None)
99    }
100}
101
102impl Iterator for LabeledPropertiesIterator {
103    type Item = LabeledProperties;
104    fn next(&mut self) -> Option<Self::Item> {
105        self.0 = match self.0 {
106            None => Some(LabeledProperties::LABEL),
107            Some(LabeledProperties::LABEL) => None,
108        };
109        self.0.clone()
110    }
111}
112
113impl IntoIterator for LabeledProperties {
114    type Item = LabeledProperties;
115    type IntoIter = LabeledPropertiesIterator;
116    fn into_iter(self) -> Self::IntoIter {
117        LabeledPropertiesIterator(None)
118    }
119}
120
121impl core::fmt::Display for LabeledProperties {
122    fn fmt(&self, f: &mut core::fmt::Formatter) -> Result<(), core::fmt::Error> {
123        match *self {
124            LabeledProperties::LABEL => core::fmt::Display::fmt("label", f),
125        }
126    }
127}
128
129///
130pub static LABELED_EXTENSIONS: std::sync::LazyLock<reactive_graph_graph::Extensions> = std::sync::LazyLock::new(||
131{ reactive_graph_graph::Extensions::new() });
132
133pub static LABELED_TYPE: std::sync::LazyLock<reactive_graph_graph::Component> = std::sync::LazyLock::new(||
134{
135    reactive_graph_graph::Component::builder()
136        .ty(core::ops::Deref::deref(&LABELED))
137        .description(
138            "The label is a hierarchical path with static segments, named parameters and catch-all parameters.",
139        )
140        .properties(LabeledProperties::property_types())
141        .build()
142});
143
144/// # Component `Labeled`
145///
146/// ## Fully Qualified Namespace
147///
148/// `reactive_graph::core::Labeled`
149///
150/// ## Description
151///
152/// The label is a hierarchical path with static segments, named parameters and catch-all
153/// parameters.
154///
155/// ### Properties
156///
157/// - label
158///
159/// ## JSON Schema
160///
161/// [https://schema.reactive-graph.io/schema/json/dynamic_graph/types/component/reactive_graph/core/Labeled.schema.json]()
162///
163pub trait Labeled {
164    
165    /// ### Property `label`
166    ///
167    /// Hierarchical path with static segments, named parameters and catch-all parameters
168    ///
169    /// Data Type: `String`
170    ///
171    /// Socket Type: `None`
172    ///
173    /// Mutability: `Mutable`
174    ///
175    fn label(&self) -> String;
176    
177    /// ### Property `label`
178    ///
179    /// Hierarchical path with static segments, named parameters and catch-all parameters
180    ///
181    /// Data Type: `String`
182    ///
183    /// Socket Type: `None`
184    ///
185    /// Mutability: `Mutable`
186    ///
187    fn set_label(&mut self, label: String);
188}