reactive_graph_flow_model/reactive_graph/flow/
flow_2_d.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::flow::Flow2D`
8#[cfg_attr(rustfmt, rustfmt_skip)]
9pub const FLOW_2_D_NAMESPACE: &str = "reactive_graph::flow::Flow2D";
10
11/// The [type identifier]() of Component `Flow2D`.
12///
13/// ### Namespace
14///
15/// The fully qualified namespace is
16/// `reactive_graph::flow::Flow2D`
17pub static FLOW_2_D: std::sync::LazyLock<reactive_graph_graph::ComponentTypeId> = std::sync::LazyLock::new(||
18std::str::FromStr::from_str(FLOW_2_D_NAMESPACE).unwrap());
19
20/// The properties of Component `Flow2D`.
21#[allow(non_camel_case_types)]
22#[derive(Debug, PartialEq, PartialOrd, Eq, Hash, Clone)]
23pub enum Flow2DProperties {
24    
25    /// ### Property `f2dh`
26    ///
27    /// The height (y-axis) in a 2D flow
28    ///
29    /// Data Type: `Number`
30    ///
31    /// Socket Type: `None`
32    ///
33    /// Mutability: `Mutable`
34    ///
35    F_2_DH,
36    
37    /// ### Property `f2dw`
38    ///
39    /// The width (x-axis) in a 2D flow
40    ///
41    /// Data Type: `Number`
42    ///
43    /// Socket Type: `None`
44    ///
45    /// Mutability: `Mutable`
46    ///
47    F_2_DW,
48    
49    /// ### Property `f2dx`
50    ///
51    /// The X position in a 2D flow
52    ///
53    /// Data Type: `Number`
54    ///
55    /// Socket Type: `None`
56    ///
57    /// Mutability: `Mutable`
58    ///
59    F_2_DX,
60    
61    /// ### Property `f2dy`
62    ///
63    /// The Y position in a 2D flow
64    ///
65    /// Data Type: `Number`
66    ///
67    /// Socket Type: `None`
68    ///
69    /// Mutability: `Mutable`
70    ///
71    F_2_DY,
72}
73impl Flow2DProperties {
74    pub fn len() -> usize {
75        4usize
76    }
77    
78    pub fn property_types() -> reactive_graph_graph::PropertyTypes {
79        let property_types = reactive_graph_graph::PropertyTypes::new();
80        property_types.push(Flow2DProperties::F_2_DH);
81        property_types.push(Flow2DProperties::F_2_DW);
82        property_types.push(Flow2DProperties::F_2_DX);
83        property_types.push(Flow2DProperties::F_2_DY);
84        property_types
85    }
86}
87
88impl AsRef<str> for Flow2DProperties {
89    #[inline]
90    fn as_ref(&self) -> &str {
91        match *self {
92            Flow2DProperties::F_2_DH => "f2dh",
93            Flow2DProperties::F_2_DW => "f2dw",
94            Flow2DProperties::F_2_DX => "f2dx",
95            Flow2DProperties::F_2_DY => "f2dy",
96        }
97    }
98}
99
100impl From<Flow2DProperties> for &'static str {
101    #[inline]
102    fn from(properties: Flow2DProperties) -> &'static str {
103        match properties {
104            Flow2DProperties::F_2_DH => "f2dh",
105            Flow2DProperties::F_2_DW => "f2dw",
106            Flow2DProperties::F_2_DX => "f2dx",
107            Flow2DProperties::F_2_DY => "f2dy",
108        }
109    }
110}
111
112impl From<Flow2DProperties> for String {
113    #[inline]
114    fn from(properties: Flow2DProperties) -> String {
115        match properties {
116            Flow2DProperties::F_2_DH => "f2dh".to_owned(),
117            Flow2DProperties::F_2_DW => "f2dw".to_owned(),
118            Flow2DProperties::F_2_DX => "f2dx".to_owned(),
119            Flow2DProperties::F_2_DY => "f2dy".to_owned(),
120        }
121    }
122}
123
124impl From<Flow2DProperties> for reactive_graph_graph::PropertyType {
125    #[inline]
126    fn from(properties: Flow2DProperties) -> reactive_graph_graph::PropertyType {
127        match properties {
128            Flow2DProperties::F_2_DH => {
129                reactive_graph_graph::PropertyType::new_with_all(
130                    "f2dh",
131                    "The height (y-axis) in a 2D flow",
132                    reactive_graph_graph::DataType::Number,
133                    reactive_graph_graph::SocketType::None,
134                    reactive_graph_graph::Mutability::Mutable,
135                    reactive_graph_graph::Extensions::new(),
136                )
137            }
138            Flow2DProperties::F_2_DW => {
139                reactive_graph_graph::PropertyType::new_with_all(
140                    "f2dw",
141                    "The width (x-axis) in a 2D flow",
142                    reactive_graph_graph::DataType::Number,
143                    reactive_graph_graph::SocketType::None,
144                    reactive_graph_graph::Mutability::Mutable,
145                    reactive_graph_graph::Extensions::new(),
146                )
147            }
148            Flow2DProperties::F_2_DX => {
149                reactive_graph_graph::PropertyType::new_with_all(
150                    "f2dx",
151                    "The X position in a 2D flow",
152                    reactive_graph_graph::DataType::Number,
153                    reactive_graph_graph::SocketType::None,
154                    reactive_graph_graph::Mutability::Mutable,
155                    reactive_graph_graph::Extensions::new(),
156                )
157            }
158            Flow2DProperties::F_2_DY => {
159                reactive_graph_graph::PropertyType::new_with_all(
160                    "f2dy",
161                    "The Y position in a 2D flow",
162                    reactive_graph_graph::DataType::Number,
163                    reactive_graph_graph::SocketType::None,
164                    reactive_graph_graph::Mutability::Mutable,
165                    reactive_graph_graph::Extensions::new(),
166                )
167            }
168        }
169    }
170}
171
172pub struct Flow2DPropertiesIterator(Option<Flow2DProperties>);
173
174impl Flow2DProperties {
175    pub fn into_iter() -> Flow2DPropertiesIterator {
176        Flow2DPropertiesIterator(None)
177    }
178}
179
180impl Iterator for Flow2DPropertiesIterator {
181    type Item = Flow2DProperties;
182    fn next(&mut self) -> Option<Self::Item> {
183        self.0 = match self.0 {
184            None => Some(Flow2DProperties::F_2_DH),
185            Some(Flow2DProperties::F_2_DH) => Some(Flow2DProperties::F_2_DW),
186            Some(Flow2DProperties::F_2_DW) => Some(Flow2DProperties::F_2_DX),
187            Some(Flow2DProperties::F_2_DX) => Some(Flow2DProperties::F_2_DY),
188            Some(Flow2DProperties::F_2_DY) => None,
189        };
190        self.0.clone()
191    }
192}
193
194impl IntoIterator for Flow2DProperties {
195    type Item = Flow2DProperties;
196    type IntoIter = Flow2DPropertiesIterator;
197    fn into_iter(self) -> Self::IntoIter {
198        Flow2DPropertiesIterator(None)
199    }
200}
201
202impl core::fmt::Display for Flow2DProperties {
203    fn fmt(&self, f: &mut core::fmt::Formatter) -> Result<(), core::fmt::Error> {
204        match *self {
205            Flow2DProperties::F_2_DH => core::fmt::Display::fmt("f2dh", f),
206            Flow2DProperties::F_2_DW => core::fmt::Display::fmt("f2dw", f),
207            Flow2DProperties::F_2_DX => core::fmt::Display::fmt("f2dx", f),
208            Flow2DProperties::F_2_DY => core::fmt::Display::fmt("f2dy", f),
209        }
210    }
211}
212
213///
214pub static FLOW_2_D_EXTENSIONS: std::sync::LazyLock<reactive_graph_graph::Extensions> = std::sync::LazyLock::new(||
215{ reactive_graph_graph::Extensions::new() });
216
217pub static FLOW_2_D_TYPE: std::sync::LazyLock<reactive_graph_graph::Component> = std::sync::LazyLock::new(||
218{
219    reactive_graph_graph::Component::builder()
220        .ty(core::ops::Deref::deref(&FLOW_2_D))
221        .description(
222            "The position (x,y) of the entity or relation on a two dimensional flow.",
223        )
224        .properties(Flow2DProperties::property_types())
225        .build()
226});
227
228/// # Component `Flow2D`
229///
230/// ## Fully Qualified Namespace
231///
232/// `reactive_graph::flow::Flow2D`
233///
234/// ## Description
235///
236/// The position (x,y) of the entity or relation on a two dimensional flow.
237///
238/// ### Properties
239///
240/// - f2dh
241/// - f2dw
242/// - f2dx
243/// - f2dy
244///
245/// ## JSON Schema
246///
247/// [https://schema.reactive-graph.io/schema/json/dynamic_graph/types/component/reactive_graph/flow/Flow2D.schema.json]()
248///
249pub trait Flow2D {
250    
251    /// ### Property `f2dh`
252    ///
253    /// The height (y-axis) in a 2D flow
254    ///
255    /// Data Type: `Number`
256    ///
257    /// Socket Type: `None`
258    ///
259    /// Mutability: `Mutable`
260    ///
261    fn f2dh(&self) -> u64;
262    
263    /// ### Property `f2dh`
264    ///
265    /// The height (y-axis) in a 2D flow
266    ///
267    /// Data Type: `Number`
268    ///
269    /// Socket Type: `None`
270    ///
271    /// Mutability: `Mutable`
272    ///
273    fn set_f2dh(&mut self, f2dh: u64);
274    
275    /// ### Property `f2dw`
276    ///
277    /// The width (x-axis) in a 2D flow
278    ///
279    /// Data Type: `Number`
280    ///
281    /// Socket Type: `None`
282    ///
283    /// Mutability: `Mutable`
284    ///
285    fn f2dw(&self) -> u64;
286    
287    /// ### Property `f2dw`
288    ///
289    /// The width (x-axis) in a 2D flow
290    ///
291    /// Data Type: `Number`
292    ///
293    /// Socket Type: `None`
294    ///
295    /// Mutability: `Mutable`
296    ///
297    fn set_f2dw(&mut self, f2dw: u64);
298    
299    /// ### Property `f2dx`
300    ///
301    /// The X position in a 2D flow
302    ///
303    /// Data Type: `Number`
304    ///
305    /// Socket Type: `None`
306    ///
307    /// Mutability: `Mutable`
308    ///
309    fn f2dx(&self) -> u64;
310    
311    /// ### Property `f2dx`
312    ///
313    /// The X position in a 2D flow
314    ///
315    /// Data Type: `Number`
316    ///
317    /// Socket Type: `None`
318    ///
319    /// Mutability: `Mutable`
320    ///
321    fn set_f2dx(&mut self, f2dx: u64);
322    
323    /// ### Property `f2dy`
324    ///
325    /// The Y position in a 2D flow
326    ///
327    /// Data Type: `Number`
328    ///
329    /// Socket Type: `None`
330    ///
331    /// Mutability: `Mutable`
332    ///
333    fn f2dy(&self) -> u64;
334    
335    /// ### Property `f2dy`
336    ///
337    /// The Y position in a 2D flow
338    ///
339    /// Data Type: `Number`
340    ///
341    /// Socket Type: `None`
342    ///
343    /// Mutability: `Mutable`
344    ///
345    fn set_f2dy(&mut self, f2dy: u64);
346}