Skip to main content

fcb_core/fb/
extension_generated.rs

1// automatically generated by the FlatBuffers compiler, do not modify
2
3// @generated
4
5use core::cmp::Ordering;
6use core::mem;
7
8extern crate flatbuffers;
9use self::flatbuffers::{EndianScalar, Follow};
10
11pub enum ExtensionOffset {}
12#[derive(Copy, Clone, PartialEq)]
13
14pub struct Extension<'a> {
15    pub _tab: flatbuffers::Table<'a>,
16}
17
18impl<'a> flatbuffers::Follow<'a> for Extension<'a> {
19    type Inner = Extension<'a>;
20    #[inline]
21    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
22        Self {
23            _tab: unsafe { flatbuffers::Table::new(buf, loc) },
24        }
25    }
26}
27
28impl<'a> Extension<'a> {
29    pub const VT_NAME: flatbuffers::VOffsetT = 4;
30    pub const VT_DESCRIPTION: flatbuffers::VOffsetT = 6;
31    pub const VT_URL: flatbuffers::VOffsetT = 8;
32    pub const VT_VERSION: flatbuffers::VOffsetT = 10;
33    pub const VT_VERSION_CITYJSON: flatbuffers::VOffsetT = 12;
34    pub const VT_EXTRA_ATTRIBUTES: flatbuffers::VOffsetT = 14;
35    pub const VT_EXTRA_CITY_OBJECTS: flatbuffers::VOffsetT = 16;
36    pub const VT_EXTRA_ROOT_PROPERTIES: flatbuffers::VOffsetT = 18;
37    pub const VT_EXTRA_SEMANTIC_SURFACES: flatbuffers::VOffsetT = 20;
38
39    #[inline]
40    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
41        Extension { _tab: table }
42    }
43    #[allow(unused_mut)]
44    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
45        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
46        args: &'args ExtensionArgs<'args>,
47    ) -> flatbuffers::WIPOffset<Extension<'bldr>> {
48        let mut builder = ExtensionBuilder::new(_fbb);
49        if let Some(x) = args.extra_semantic_surfaces {
50            builder.add_extra_semantic_surfaces(x);
51        }
52        if let Some(x) = args.extra_root_properties {
53            builder.add_extra_root_properties(x);
54        }
55        if let Some(x) = args.extra_city_objects {
56            builder.add_extra_city_objects(x);
57        }
58        if let Some(x) = args.extra_attributes {
59            builder.add_extra_attributes(x);
60        }
61        if let Some(x) = args.version_cityjson {
62            builder.add_version_cityjson(x);
63        }
64        if let Some(x) = args.version {
65            builder.add_version(x);
66        }
67        if let Some(x) = args.url {
68            builder.add_url(x);
69        }
70        if let Some(x) = args.description {
71            builder.add_description(x);
72        }
73        if let Some(x) = args.name {
74            builder.add_name(x);
75        }
76        builder.finish()
77    }
78
79    #[inline]
80    pub fn name(&self) -> Option<&'a str> {
81        // Safety:
82        // Created from valid Table for this object
83        // which contains a valid value in this slot
84        unsafe {
85            self._tab
86                .get::<flatbuffers::ForwardsUOffset<&str>>(Extension::VT_NAME, None)
87        }
88    }
89    #[inline]
90    pub fn description(&self) -> Option<&'a str> {
91        // Safety:
92        // Created from valid Table for this object
93        // which contains a valid value in this slot
94        unsafe {
95            self._tab
96                .get::<flatbuffers::ForwardsUOffset<&str>>(Extension::VT_DESCRIPTION, None)
97        }
98    }
99    #[inline]
100    pub fn url(&self) -> Option<&'a str> {
101        // Safety:
102        // Created from valid Table for this object
103        // which contains a valid value in this slot
104        unsafe {
105            self._tab
106                .get::<flatbuffers::ForwardsUOffset<&str>>(Extension::VT_URL, None)
107        }
108    }
109    #[inline]
110    pub fn version(&self) -> Option<&'a str> {
111        // Safety:
112        // Created from valid Table for this object
113        // which contains a valid value in this slot
114        unsafe {
115            self._tab
116                .get::<flatbuffers::ForwardsUOffset<&str>>(Extension::VT_VERSION, None)
117        }
118    }
119    #[inline]
120    pub fn version_cityjson(&self) -> Option<&'a str> {
121        // Safety:
122        // Created from valid Table for this object
123        // which contains a valid value in this slot
124        unsafe {
125            self._tab
126                .get::<flatbuffers::ForwardsUOffset<&str>>(Extension::VT_VERSION_CITYJSON, None)
127        }
128    }
129    #[inline]
130    pub fn extra_attributes(&self) -> Option<&'a str> {
131        // Safety:
132        // Created from valid Table for this object
133        // which contains a valid value in this slot
134        unsafe {
135            self._tab
136                .get::<flatbuffers::ForwardsUOffset<&str>>(Extension::VT_EXTRA_ATTRIBUTES, None)
137        }
138    }
139    #[inline]
140    pub fn extra_city_objects(&self) -> Option<&'a str> {
141        // Safety:
142        // Created from valid Table for this object
143        // which contains a valid value in this slot
144        unsafe {
145            self._tab
146                .get::<flatbuffers::ForwardsUOffset<&str>>(Extension::VT_EXTRA_CITY_OBJECTS, None)
147        }
148    }
149    #[inline]
150    pub fn extra_root_properties(&self) -> Option<&'a str> {
151        // Safety:
152        // Created from valid Table for this object
153        // which contains a valid value in this slot
154        unsafe {
155            self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(
156                Extension::VT_EXTRA_ROOT_PROPERTIES,
157                None,
158            )
159        }
160    }
161    #[inline]
162    pub fn extra_semantic_surfaces(&self) -> Option<&'a str> {
163        // Safety:
164        // Created from valid Table for this object
165        // which contains a valid value in this slot
166        unsafe {
167            self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(
168                Extension::VT_EXTRA_SEMANTIC_SURFACES,
169                None,
170            )
171        }
172    }
173}
174
175impl flatbuffers::Verifiable for Extension<'_> {
176    #[inline]
177    fn run_verifier(
178        v: &mut flatbuffers::Verifier,
179        pos: usize,
180    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
181        use self::flatbuffers::Verifiable;
182        v.visit_table(pos)?
183            .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
184            .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
185                "description",
186                Self::VT_DESCRIPTION,
187                false,
188            )?
189            .visit_field::<flatbuffers::ForwardsUOffset<&str>>("url", Self::VT_URL, false)?
190            .visit_field::<flatbuffers::ForwardsUOffset<&str>>("version", Self::VT_VERSION, false)?
191            .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
192                "version_cityjson",
193                Self::VT_VERSION_CITYJSON,
194                false,
195            )?
196            .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
197                "extra_attributes",
198                Self::VT_EXTRA_ATTRIBUTES,
199                false,
200            )?
201            .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
202                "extra_city_objects",
203                Self::VT_EXTRA_CITY_OBJECTS,
204                false,
205            )?
206            .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
207                "extra_root_properties",
208                Self::VT_EXTRA_ROOT_PROPERTIES,
209                false,
210            )?
211            .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
212                "extra_semantic_surfaces",
213                Self::VT_EXTRA_SEMANTIC_SURFACES,
214                false,
215            )?
216            .finish();
217        Ok(())
218    }
219}
220pub struct ExtensionArgs<'a> {
221    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
222    pub description: Option<flatbuffers::WIPOffset<&'a str>>,
223    pub url: Option<flatbuffers::WIPOffset<&'a str>>,
224    pub version: Option<flatbuffers::WIPOffset<&'a str>>,
225    pub version_cityjson: Option<flatbuffers::WIPOffset<&'a str>>,
226    pub extra_attributes: Option<flatbuffers::WIPOffset<&'a str>>,
227    pub extra_city_objects: Option<flatbuffers::WIPOffset<&'a str>>,
228    pub extra_root_properties: Option<flatbuffers::WIPOffset<&'a str>>,
229    pub extra_semantic_surfaces: Option<flatbuffers::WIPOffset<&'a str>>,
230}
231impl<'a> Default for ExtensionArgs<'a> {
232    #[inline]
233    fn default() -> Self {
234        ExtensionArgs {
235            name: None,
236            description: None,
237            url: None,
238            version: None,
239            version_cityjson: None,
240            extra_attributes: None,
241            extra_city_objects: None,
242            extra_root_properties: None,
243            extra_semantic_surfaces: None,
244        }
245    }
246}
247
248pub struct ExtensionBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
249    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
250    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
251}
252impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ExtensionBuilder<'a, 'b, A> {
253    #[inline]
254    pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
255        self.fbb_
256            .push_slot_always::<flatbuffers::WIPOffset<_>>(Extension::VT_NAME, name);
257    }
258    #[inline]
259    pub fn add_description(&mut self, description: flatbuffers::WIPOffset<&'b str>) {
260        self.fbb_
261            .push_slot_always::<flatbuffers::WIPOffset<_>>(Extension::VT_DESCRIPTION, description);
262    }
263    #[inline]
264    pub fn add_url(&mut self, url: flatbuffers::WIPOffset<&'b str>) {
265        self.fbb_
266            .push_slot_always::<flatbuffers::WIPOffset<_>>(Extension::VT_URL, url);
267    }
268    #[inline]
269    pub fn add_version(&mut self, version: flatbuffers::WIPOffset<&'b str>) {
270        self.fbb_
271            .push_slot_always::<flatbuffers::WIPOffset<_>>(Extension::VT_VERSION, version);
272    }
273    #[inline]
274    pub fn add_version_cityjson(&mut self, version_cityjson: flatbuffers::WIPOffset<&'b str>) {
275        self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
276            Extension::VT_VERSION_CITYJSON,
277            version_cityjson,
278        );
279    }
280    #[inline]
281    pub fn add_extra_attributes(&mut self, extra_attributes: flatbuffers::WIPOffset<&'b str>) {
282        self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
283            Extension::VT_EXTRA_ATTRIBUTES,
284            extra_attributes,
285        );
286    }
287    #[inline]
288    pub fn add_extra_city_objects(&mut self, extra_city_objects: flatbuffers::WIPOffset<&'b str>) {
289        self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
290            Extension::VT_EXTRA_CITY_OBJECTS,
291            extra_city_objects,
292        );
293    }
294    #[inline]
295    pub fn add_extra_root_properties(
296        &mut self,
297        extra_root_properties: flatbuffers::WIPOffset<&'b str>,
298    ) {
299        self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
300            Extension::VT_EXTRA_ROOT_PROPERTIES,
301            extra_root_properties,
302        );
303    }
304    #[inline]
305    pub fn add_extra_semantic_surfaces(
306        &mut self,
307        extra_semantic_surfaces: flatbuffers::WIPOffset<&'b str>,
308    ) {
309        self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
310            Extension::VT_EXTRA_SEMANTIC_SURFACES,
311            extra_semantic_surfaces,
312        );
313    }
314    #[inline]
315    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ExtensionBuilder<'a, 'b, A> {
316        let start = _fbb.start_table();
317        ExtensionBuilder {
318            fbb_: _fbb,
319            start_: start,
320        }
321    }
322    #[inline]
323    pub fn finish(self) -> flatbuffers::WIPOffset<Extension<'a>> {
324        let o = self.fbb_.end_table(self.start_);
325        flatbuffers::WIPOffset::new(o.value())
326    }
327}
328
329impl core::fmt::Debug for Extension<'_> {
330    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
331        let mut ds = f.debug_struct("Extension");
332        ds.field("name", &self.name());
333        ds.field("description", &self.description());
334        ds.field("url", &self.url());
335        ds.field("version", &self.version());
336        ds.field("version_cityjson", &self.version_cityjson());
337        ds.field("extra_attributes", &self.extra_attributes());
338        ds.field("extra_city_objects", &self.extra_city_objects());
339        ds.field("extra_root_properties", &self.extra_root_properties());
340        ds.field("extra_semantic_surfaces", &self.extra_semantic_surfaces());
341        ds.finish()
342    }
343}