diff --git a/src/lrs_generated.rs b/src/lrs_generated.rs index f0c71ae..8000ce5 100644 --- a/src/lrs_generated.rs +++ b/src/lrs_generated.rs @@ -933,34 +933,34 @@ impl<'a> Lrs<'a> { /// Networks are segments connected by nodes. /// There can be multiple networks, such as railway tracks and lines, sewer pipe and power lines. #[inline] - pub fn networks(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>> { + pub fn networks(&self) -> Option>>> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot - unsafe { self._tab.get::>>>(Lrs::VT_NETWORKS, None).unwrap()} + unsafe { self._tab.get::>>>(Lrs::VT_NETWORKS, None)} } #[inline] - pub fn anchors(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>> { + pub fn anchors(&self) -> Option>>> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot - unsafe { self._tab.get::>>>(Lrs::VT_ANCHORS, None).unwrap()} + unsafe { self._tab.get::>>>(Lrs::VT_ANCHORS, None)} } #[inline] - pub fn linear_referencing_methods(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>> { + pub fn linear_referencing_methods(&self) -> Option>>> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot - unsafe { self._tab.get::>>>(Lrs::VT_LINEAR_REFERENCING_METHODS, None).unwrap()} + unsafe { self._tab.get::>>>(Lrs::VT_LINEAR_REFERENCING_METHODS, None)} } /// There can be multiple geometries /// For instance a geographic and and schematic representation of the same network #[inline] - pub fn views(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>> { + pub fn views(&self) -> Option>>> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot - unsafe { self._tab.get::>>>(Lrs::VT_VIEWS, None).unwrap()} + unsafe { self._tab.get::>>>(Lrs::VT_VIEWS, None)} } } @@ -972,10 +972,10 @@ impl flatbuffers::Verifiable for Lrs<'_> { use self::flatbuffers::Verifiable; v.visit_table(pos)? .visit_field::>>>("properties", Self::VT_PROPERTIES, false)? - .visit_field::>>>("networks", Self::VT_NETWORKS, true)? - .visit_field::>>>("anchors", Self::VT_ANCHORS, true)? - .visit_field::>>>("linear_referencing_methods", Self::VT_LINEAR_REFERENCING_METHODS, true)? - .visit_field::>>>("views", Self::VT_VIEWS, true)? + .visit_field::>>>("networks", Self::VT_NETWORKS, false)? + .visit_field::>>>("anchors", Self::VT_ANCHORS, false)? + .visit_field::>>>("linear_referencing_methods", Self::VT_LINEAR_REFERENCING_METHODS, false)? + .visit_field::>>>("views", Self::VT_VIEWS, false)? .finish(); Ok(()) } @@ -992,10 +992,10 @@ impl<'a> Default for LrsArgs<'a> { fn default() -> Self { LrsArgs { properties: None, - networks: None, // required field - anchors: None, // required field - linear_referencing_methods: None, // required field - views: None, // required field + networks: None, + anchors: None, + linear_referencing_methods: None, + views: None, } } } @@ -1036,10 +1036,6 @@ impl<'a: 'b, 'b> LrsBuilder<'a, 'b> { #[inline] pub fn finish(self) -> flatbuffers::WIPOffset> { let o = self.fbb_.end_table(self.start_); - self.fbb_.required(o, Lrs::VT_NETWORKS,"networks"); - self.fbb_.required(o, Lrs::VT_ANCHORS,"anchors"); - self.fbb_.required(o, Lrs::VT_LINEAR_REFERENCING_METHODS,"linear_referencing_methods"); - self.fbb_.required(o, Lrs::VT_VIEWS,"views"); flatbuffers::WIPOffset::new(o.value()) } } @@ -1614,8 +1610,9 @@ impl<'a> flatbuffers::Follow<'a> for Traversal<'a> { impl<'a> Traversal<'a> { pub const VT_ID: flatbuffers::VOffsetT = 4; - pub const VT_SEGMENTS: flatbuffers::VOffsetT = 6; - pub const VT_DIRECTIONS: flatbuffers::VOffsetT = 8; + pub const VT_PROPERTIES: flatbuffers::VOffsetT = 6; + pub const VT_SEGMENTS: flatbuffers::VOffsetT = 8; + pub const VT_DIRECTIONS: flatbuffers::VOffsetT = 10; #[inline] pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { @@ -1629,6 +1626,7 @@ impl<'a> Traversal<'a> { let mut builder = TraversalBuilder::new(_fbb); if let Some(x) = args.directions { builder.add_directions(x); } if let Some(x) = args.segments { builder.add_segments(x); } + if let Some(x) = args.properties { builder.add_properties(x); } if let Some(x) = args.id { builder.add_id(x); } builder.finish() } @@ -1642,6 +1640,13 @@ impl<'a> Traversal<'a> { unsafe { self._tab.get::>(Traversal::VT_ID, None).unwrap()} } #[inline] + pub fn properties(&self) -> Option>>> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::>>>(Traversal::VT_PROPERTIES, None)} + } + #[inline] pub fn segments(&self) -> flatbuffers::Vector<'a, u64> { // Safety: // Created from valid Table for this object @@ -1665,6 +1670,7 @@ impl flatbuffers::Verifiable for Traversal<'_> { use self::flatbuffers::Verifiable; v.visit_table(pos)? .visit_field::>("id", Self::VT_ID, true)? + .visit_field::>>>("properties", Self::VT_PROPERTIES, false)? .visit_field::>>("segments", Self::VT_SEGMENTS, true)? .visit_field::>>("directions", Self::VT_DIRECTIONS, true)? .finish(); @@ -1673,6 +1679,7 @@ impl flatbuffers::Verifiable for Traversal<'_> { } pub struct TraversalArgs<'a> { pub id: Option>, + pub properties: Option>>>>, pub segments: Option>>, pub directions: Option>>, } @@ -1681,6 +1688,7 @@ impl<'a> Default for TraversalArgs<'a> { fn default() -> Self { TraversalArgs { id: None, // required field + properties: None, segments: None, // required field directions: None, // required field } @@ -1697,6 +1705,10 @@ impl<'a: 'b, 'b> TraversalBuilder<'a, 'b> { self.fbb_.push_slot_always::>(Traversal::VT_ID, id); } #[inline] + pub fn add_properties(&mut self, properties: flatbuffers::WIPOffset>>>) { + self.fbb_.push_slot_always::>(Traversal::VT_PROPERTIES, properties); + } + #[inline] pub fn add_segments(&mut self, segments: flatbuffers::WIPOffset>) { self.fbb_.push_slot_always::>(Traversal::VT_SEGMENTS, segments); } @@ -1726,6 +1738,7 @@ impl core::fmt::Debug for Traversal<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { let mut ds = f.debug_struct("Traversal"); ds.field("id", &self.id()); + ds.field("properties", &self.properties()); ds.field("segments", &self.segments()); ds.field("directions", &self.directions()); ds.finish() @@ -1752,8 +1765,9 @@ impl<'a> flatbuffers::Follow<'a> for Anchor<'a> { impl<'a> Anchor<'a> { pub const VT_ID: flatbuffers::VOffsetT = 4; - pub const VT_NAME: flatbuffers::VOffsetT = 6; - pub const VT_NODE: flatbuffers::VOffsetT = 8; + pub const VT_PROPERTIES: flatbuffers::VOffsetT = 6; + pub const VT_NAME: flatbuffers::VOffsetT = 8; + pub const VT_NODE: flatbuffers::VOffsetT = 10; #[inline] pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { @@ -1767,6 +1781,7 @@ impl<'a> Anchor<'a> { let mut builder = AnchorBuilder::new(_fbb); if let Some(x) = args.node { builder.add_node(x); } if let Some(x) = args.name { builder.add_name(x); } + if let Some(x) = args.properties { builder.add_properties(x); } if let Some(x) = args.id { builder.add_id(x); } builder.finish() } @@ -1779,6 +1794,13 @@ impl<'a> Anchor<'a> { // which contains a valid value in this slot unsafe { self._tab.get::>(Anchor::VT_ID, None).unwrap()} } + #[inline] + pub fn properties(&self) -> Option>>> { + // Safety: + // Created from valid Table for this object + // which contains a valid value in this slot + unsafe { self._tab.get::>>>(Anchor::VT_PROPERTIES, None)} + } /// Most anchors have a name, which is used to reference the location. /// More often than not a kilometer or mile number, but it can also be a letter or word. #[inline] @@ -1807,6 +1829,7 @@ impl flatbuffers::Verifiable for Anchor<'_> { use self::flatbuffers::Verifiable; v.visit_table(pos)? .visit_field::>("id", Self::VT_ID, true)? + .visit_field::>>>("properties", Self::VT_PROPERTIES, false)? .visit_field::>("name", Self::VT_NAME, false)? .visit_field::("node", Self::VT_NODE, false)? .finish(); @@ -1815,6 +1838,7 @@ impl flatbuffers::Verifiable for Anchor<'_> { } pub struct AnchorArgs<'a> { pub id: Option>, + pub properties: Option>>>>, pub name: Option>, pub node: Option<&'a NodeRef>, } @@ -1823,6 +1847,7 @@ impl<'a> Default for AnchorArgs<'a> { fn default() -> Self { AnchorArgs { id: None, // required field + properties: None, name: None, node: None, } @@ -1839,6 +1864,10 @@ impl<'a: 'b, 'b> AnchorBuilder<'a, 'b> { self.fbb_.push_slot_always::>(Anchor::VT_ID, id); } #[inline] + pub fn add_properties(&mut self, properties: flatbuffers::WIPOffset>>>) { + self.fbb_.push_slot_always::>(Anchor::VT_PROPERTIES, properties); + } + #[inline] pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) { self.fbb_.push_slot_always::>(Anchor::VT_NAME, name); } @@ -1866,6 +1895,7 @@ impl core::fmt::Debug for Anchor<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { let mut ds = f.debug_struct("Anchor"); ds.field("id", &self.id()); + ds.field("properties", &self.properties()); ds.field("name", &self.name()); ds.field("node", &self.node()); ds.finish() @@ -2154,19 +2184,19 @@ impl<'a> GeometryView<'a> { unsafe { self._tab.get::(GeometryView::VT_GEOMETRY_TYPE, None)} } #[inline] - pub fn anchors(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>> { + pub fn anchors(&self) -> Option>>> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot - unsafe { self._tab.get::>>>(GeometryView::VT_ANCHORS, None).unwrap()} + unsafe { self._tab.get::>>>(GeometryView::VT_ANCHORS, None)} } /// Must be the same size as the top level network array #[inline] - pub fn networks(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>> { + pub fn networks(&self) -> Option>>> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot - unsafe { self._tab.get::>>>(GeometryView::VT_NETWORKS, None).unwrap()} + unsafe { self._tab.get::>>>(GeometryView::VT_NETWORKS, None)} } } @@ -2179,8 +2209,8 @@ impl flatbuffers::Verifiable for GeometryView<'_> { v.visit_table(pos)? .visit_field::>>>("properties", Self::VT_PROPERTIES, false)? .visit_field::("geometry_type", Self::VT_GEOMETRY_TYPE, false)? - .visit_field::>>>("anchors", Self::VT_ANCHORS, true)? - .visit_field::>>>("networks", Self::VT_NETWORKS, true)? + .visit_field::>>>("anchors", Self::VT_ANCHORS, false)? + .visit_field::>>>("networks", Self::VT_NETWORKS, false)? .finish(); Ok(()) } @@ -2197,8 +2227,8 @@ impl<'a> Default for GeometryViewArgs<'a> { GeometryViewArgs { properties: None, geometry_type: None, - anchors: None, // required field - networks: None, // required field + anchors: None, + networks: None, } } } @@ -2235,8 +2265,6 @@ impl<'a: 'b, 'b> GeometryViewBuilder<'a, 'b> { #[inline] pub fn finish(self) -> flatbuffers::WIPOffset> { let o = self.fbb_.end_table(self.start_); - self.fbb_.required(o, GeometryView::VT_ANCHORS,"anchors"); - self.fbb_.required(o, GeometryView::VT_NETWORKS,"networks"); flatbuffers::WIPOffset::new(o.value()) } }