1extern crate alloc;
4
5
6#[allow(unused_imports, dead_code)]
7pub mod app_scale {
8
9#[allow(unused_imports, dead_code)]
10pub mod ir {
11
12
13#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
14pub const ENUM_MIN_VIEW_TYPE: u8 = 0;
15#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
16pub const ENUM_MAX_VIEW_TYPE: u8 = 255;
17#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
18#[allow(non_camel_case_types)]
19pub const ENUM_VALUES_VIEW_TYPE: [ViewType; 15] = [
20 ViewType::Container,
21 ViewType::Text,
22 ViewType::TextInput,
23 ViewType::Image,
24 ViewType::ScrollView,
25 ViewType::Button,
26 ViewType::Switch,
27 ViewType::Slider,
28 ViewType::ActivityIndicator,
29 ViewType::DatePicker,
30 ViewType::Modal,
31 ViewType::BottomSheet,
32 ViewType::MenuBar,
33 ViewType::TitleBar,
34 ViewType::Custom,
35];
36
37#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
38#[repr(transparent)]
39pub struct ViewType(pub u8);
40#[allow(non_upper_case_globals)]
41impl ViewType {
42 pub const Container: Self = Self(0);
43 pub const Text: Self = Self(1);
44 pub const TextInput: Self = Self(2);
45 pub const Image: Self = Self(3);
46 pub const ScrollView: Self = Self(4);
47 pub const Button: Self = Self(5);
48 pub const Switch: Self = Self(6);
49 pub const Slider: Self = Self(7);
50 pub const ActivityIndicator: Self = Self(8);
51 pub const DatePicker: Self = Self(9);
52 pub const Modal: Self = Self(10);
53 pub const BottomSheet: Self = Self(11);
54 pub const MenuBar: Self = Self(12);
55 pub const TitleBar: Self = Self(13);
56 pub const Custom: Self = Self(255);
57
58 pub const ENUM_MIN: u8 = 0;
59 pub const ENUM_MAX: u8 = 255;
60 pub const ENUM_VALUES: &'static [Self] = &[
61 Self::Container,
62 Self::Text,
63 Self::TextInput,
64 Self::Image,
65 Self::ScrollView,
66 Self::Button,
67 Self::Switch,
68 Self::Slider,
69 Self::ActivityIndicator,
70 Self::DatePicker,
71 Self::Modal,
72 Self::BottomSheet,
73 Self::MenuBar,
74 Self::TitleBar,
75 Self::Custom,
76 ];
77 pub fn variant_name(self) -> Option<&'static str> {
79 match self {
80 Self::Container => Some("Container"),
81 Self::Text => Some("Text"),
82 Self::TextInput => Some("TextInput"),
83 Self::Image => Some("Image"),
84 Self::ScrollView => Some("ScrollView"),
85 Self::Button => Some("Button"),
86 Self::Switch => Some("Switch"),
87 Self::Slider => Some("Slider"),
88 Self::ActivityIndicator => Some("ActivityIndicator"),
89 Self::DatePicker => Some("DatePicker"),
90 Self::Modal => Some("Modal"),
91 Self::BottomSheet => Some("BottomSheet"),
92 Self::MenuBar => Some("MenuBar"),
93 Self::TitleBar => Some("TitleBar"),
94 Self::Custom => Some("Custom"),
95 _ => None,
96 }
97 }
98}
99impl ::core::fmt::Debug for ViewType {
100 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
101 if let Some(name) = self.variant_name() {
102 f.write_str(name)
103 } else {
104 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
105 }
106 }
107}
108impl<'a> ::flatbuffers::Follow<'a> for ViewType {
109 type Inner = Self;
110 #[inline]
111 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
112 let b = unsafe { ::flatbuffers::read_scalar_at::<u8>(buf, loc) };
113 Self(b)
114 }
115}
116
117impl ::flatbuffers::Push for ViewType {
118 type Output = ViewType;
119 #[inline]
120 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
121 unsafe { ::flatbuffers::emplace_scalar::<u8>(dst, self.0) };
122 }
123}
124
125impl ::flatbuffers::EndianScalar for ViewType {
126 type Scalar = u8;
127 #[inline]
128 fn to_little_endian(self) -> u8 {
129 self.0.to_le()
130 }
131 #[inline]
132 #[allow(clippy::wrong_self_convention)]
133 fn from_little_endian(v: u8) -> Self {
134 let b = u8::from_le(v);
135 Self(b)
136 }
137}
138
139impl<'a> ::flatbuffers::Verifiable for ViewType {
140 #[inline]
141 fn run_verifier(
142 v: &mut ::flatbuffers::Verifier, pos: usize
143 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
144 u8::run_verifier(v, pos)
145 }
146}
147
148impl ::flatbuffers::SimpleToVerifyInSlice for ViewType {}
149#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
150pub const ENUM_MIN_DISPLAY: i8 = 0;
151#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
152pub const ENUM_MAX_DISPLAY: i8 = 2;
153#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
154#[allow(non_camel_case_types)]
155pub const ENUM_VALUES_DISPLAY: [Display; 3] = [
156 Display::Flex,
157 Display::Grid,
158 Display::None,
159];
160
161#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
162#[repr(transparent)]
163pub struct Display(pub i8);
164#[allow(non_upper_case_globals)]
165impl Display {
166 pub const Flex: Self = Self(0);
167 pub const Grid: Self = Self(1);
168 pub const None: Self = Self(2);
169
170 pub const ENUM_MIN: i8 = 0;
171 pub const ENUM_MAX: i8 = 2;
172 pub const ENUM_VALUES: &'static [Self] = &[
173 Self::Flex,
174 Self::Grid,
175 Self::None,
176 ];
177 pub fn variant_name(self) -> Option<&'static str> {
179 match self {
180 Self::Flex => Some("Flex"),
181 Self::Grid => Some("Grid"),
182 Self::None => Some("None"),
183 _ => None,
184 }
185 }
186}
187impl ::core::fmt::Debug for Display {
188 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
189 if let Some(name) = self.variant_name() {
190 f.write_str(name)
191 } else {
192 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
193 }
194 }
195}
196impl<'a> ::flatbuffers::Follow<'a> for Display {
197 type Inner = Self;
198 #[inline]
199 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
200 let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
201 Self(b)
202 }
203}
204
205impl ::flatbuffers::Push for Display {
206 type Output = Display;
207 #[inline]
208 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
209 unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
210 }
211}
212
213impl ::flatbuffers::EndianScalar for Display {
214 type Scalar = i8;
215 #[inline]
216 fn to_little_endian(self) -> i8 {
217 self.0.to_le()
218 }
219 #[inline]
220 #[allow(clippy::wrong_self_convention)]
221 fn from_little_endian(v: i8) -> Self {
222 let b = i8::from_le(v);
223 Self(b)
224 }
225}
226
227impl<'a> ::flatbuffers::Verifiable for Display {
228 #[inline]
229 fn run_verifier(
230 v: &mut ::flatbuffers::Verifier, pos: usize
231 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
232 i8::run_verifier(v, pos)
233 }
234}
235
236impl ::flatbuffers::SimpleToVerifyInSlice for Display {}
237#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
238pub const ENUM_MIN_POSITION: i8 = 0;
239#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
240pub const ENUM_MAX_POSITION: i8 = 1;
241#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
242#[allow(non_camel_case_types)]
243pub const ENUM_VALUES_POSITION: [Position; 2] = [
244 Position::Relative,
245 Position::Absolute,
246];
247
248#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
249#[repr(transparent)]
250pub struct Position(pub i8);
251#[allow(non_upper_case_globals)]
252impl Position {
253 pub const Relative: Self = Self(0);
254 pub const Absolute: Self = Self(1);
255
256 pub const ENUM_MIN: i8 = 0;
257 pub const ENUM_MAX: i8 = 1;
258 pub const ENUM_VALUES: &'static [Self] = &[
259 Self::Relative,
260 Self::Absolute,
261 ];
262 pub fn variant_name(self) -> Option<&'static str> {
264 match self {
265 Self::Relative => Some("Relative"),
266 Self::Absolute => Some("Absolute"),
267 _ => None,
268 }
269 }
270}
271impl ::core::fmt::Debug for Position {
272 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
273 if let Some(name) = self.variant_name() {
274 f.write_str(name)
275 } else {
276 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
277 }
278 }
279}
280impl<'a> ::flatbuffers::Follow<'a> for Position {
281 type Inner = Self;
282 #[inline]
283 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
284 let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
285 Self(b)
286 }
287}
288
289impl ::flatbuffers::Push for Position {
290 type Output = Position;
291 #[inline]
292 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
293 unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
294 }
295}
296
297impl ::flatbuffers::EndianScalar for Position {
298 type Scalar = i8;
299 #[inline]
300 fn to_little_endian(self) -> i8 {
301 self.0.to_le()
302 }
303 #[inline]
304 #[allow(clippy::wrong_self_convention)]
305 fn from_little_endian(v: i8) -> Self {
306 let b = i8::from_le(v);
307 Self(b)
308 }
309}
310
311impl<'a> ::flatbuffers::Verifiable for Position {
312 #[inline]
313 fn run_verifier(
314 v: &mut ::flatbuffers::Verifier, pos: usize
315 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
316 i8::run_verifier(v, pos)
317 }
318}
319
320impl ::flatbuffers::SimpleToVerifyInSlice for Position {}
321#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
322pub const ENUM_MIN_FLEX_DIRECTION: i8 = 0;
323#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
324pub const ENUM_MAX_FLEX_DIRECTION: i8 = 3;
325#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
326#[allow(non_camel_case_types)]
327pub const ENUM_VALUES_FLEX_DIRECTION: [FlexDirection; 4] = [
328 FlexDirection::Column,
329 FlexDirection::Row,
330 FlexDirection::ColumnReverse,
331 FlexDirection::RowReverse,
332];
333
334#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
335#[repr(transparent)]
336pub struct FlexDirection(pub i8);
337#[allow(non_upper_case_globals)]
338impl FlexDirection {
339 pub const Column: Self = Self(0);
340 pub const Row: Self = Self(1);
341 pub const ColumnReverse: Self = Self(2);
342 pub const RowReverse: Self = Self(3);
343
344 pub const ENUM_MIN: i8 = 0;
345 pub const ENUM_MAX: i8 = 3;
346 pub const ENUM_VALUES: &'static [Self] = &[
347 Self::Column,
348 Self::Row,
349 Self::ColumnReverse,
350 Self::RowReverse,
351 ];
352 pub fn variant_name(self) -> Option<&'static str> {
354 match self {
355 Self::Column => Some("Column"),
356 Self::Row => Some("Row"),
357 Self::ColumnReverse => Some("ColumnReverse"),
358 Self::RowReverse => Some("RowReverse"),
359 _ => None,
360 }
361 }
362}
363impl ::core::fmt::Debug for FlexDirection {
364 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
365 if let Some(name) = self.variant_name() {
366 f.write_str(name)
367 } else {
368 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
369 }
370 }
371}
372impl<'a> ::flatbuffers::Follow<'a> for FlexDirection {
373 type Inner = Self;
374 #[inline]
375 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
376 let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
377 Self(b)
378 }
379}
380
381impl ::flatbuffers::Push for FlexDirection {
382 type Output = FlexDirection;
383 #[inline]
384 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
385 unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
386 }
387}
388
389impl ::flatbuffers::EndianScalar for FlexDirection {
390 type Scalar = i8;
391 #[inline]
392 fn to_little_endian(self) -> i8 {
393 self.0.to_le()
394 }
395 #[inline]
396 #[allow(clippy::wrong_self_convention)]
397 fn from_little_endian(v: i8) -> Self {
398 let b = i8::from_le(v);
399 Self(b)
400 }
401}
402
403impl<'a> ::flatbuffers::Verifiable for FlexDirection {
404 #[inline]
405 fn run_verifier(
406 v: &mut ::flatbuffers::Verifier, pos: usize
407 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
408 i8::run_verifier(v, pos)
409 }
410}
411
412impl ::flatbuffers::SimpleToVerifyInSlice for FlexDirection {}
413#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
414pub const ENUM_MIN_FLEX_WRAP: i8 = 0;
415#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
416pub const ENUM_MAX_FLEX_WRAP: i8 = 2;
417#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
418#[allow(non_camel_case_types)]
419pub const ENUM_VALUES_FLEX_WRAP: [FlexWrap; 3] = [
420 FlexWrap::NoWrap,
421 FlexWrap::Wrap,
422 FlexWrap::WrapReverse,
423];
424
425#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
426#[repr(transparent)]
427pub struct FlexWrap(pub i8);
428#[allow(non_upper_case_globals)]
429impl FlexWrap {
430 pub const NoWrap: Self = Self(0);
431 pub const Wrap: Self = Self(1);
432 pub const WrapReverse: Self = Self(2);
433
434 pub const ENUM_MIN: i8 = 0;
435 pub const ENUM_MAX: i8 = 2;
436 pub const ENUM_VALUES: &'static [Self] = &[
437 Self::NoWrap,
438 Self::Wrap,
439 Self::WrapReverse,
440 ];
441 pub fn variant_name(self) -> Option<&'static str> {
443 match self {
444 Self::NoWrap => Some("NoWrap"),
445 Self::Wrap => Some("Wrap"),
446 Self::WrapReverse => Some("WrapReverse"),
447 _ => None,
448 }
449 }
450}
451impl ::core::fmt::Debug for FlexWrap {
452 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
453 if let Some(name) = self.variant_name() {
454 f.write_str(name)
455 } else {
456 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
457 }
458 }
459}
460impl<'a> ::flatbuffers::Follow<'a> for FlexWrap {
461 type Inner = Self;
462 #[inline]
463 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
464 let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
465 Self(b)
466 }
467}
468
469impl ::flatbuffers::Push for FlexWrap {
470 type Output = FlexWrap;
471 #[inline]
472 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
473 unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
474 }
475}
476
477impl ::flatbuffers::EndianScalar for FlexWrap {
478 type Scalar = i8;
479 #[inline]
480 fn to_little_endian(self) -> i8 {
481 self.0.to_le()
482 }
483 #[inline]
484 #[allow(clippy::wrong_self_convention)]
485 fn from_little_endian(v: i8) -> Self {
486 let b = i8::from_le(v);
487 Self(b)
488 }
489}
490
491impl<'a> ::flatbuffers::Verifiable for FlexWrap {
492 #[inline]
493 fn run_verifier(
494 v: &mut ::flatbuffers::Verifier, pos: usize
495 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
496 i8::run_verifier(v, pos)
497 }
498}
499
500impl ::flatbuffers::SimpleToVerifyInSlice for FlexWrap {}
501#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
502pub const ENUM_MIN_JUSTIFY_CONTENT: i8 = 0;
503#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
504pub const ENUM_MAX_JUSTIFY_CONTENT: i8 = 5;
505#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
506#[allow(non_camel_case_types)]
507pub const ENUM_VALUES_JUSTIFY_CONTENT: [JustifyContent; 6] = [
508 JustifyContent::FlexStart,
509 JustifyContent::FlexEnd,
510 JustifyContent::Center,
511 JustifyContent::SpaceBetween,
512 JustifyContent::SpaceAround,
513 JustifyContent::SpaceEvenly,
514];
515
516#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
517#[repr(transparent)]
518pub struct JustifyContent(pub i8);
519#[allow(non_upper_case_globals)]
520impl JustifyContent {
521 pub const FlexStart: Self = Self(0);
522 pub const FlexEnd: Self = Self(1);
523 pub const Center: Self = Self(2);
524 pub const SpaceBetween: Self = Self(3);
525 pub const SpaceAround: Self = Self(4);
526 pub const SpaceEvenly: Self = Self(5);
527
528 pub const ENUM_MIN: i8 = 0;
529 pub const ENUM_MAX: i8 = 5;
530 pub const ENUM_VALUES: &'static [Self] = &[
531 Self::FlexStart,
532 Self::FlexEnd,
533 Self::Center,
534 Self::SpaceBetween,
535 Self::SpaceAround,
536 Self::SpaceEvenly,
537 ];
538 pub fn variant_name(self) -> Option<&'static str> {
540 match self {
541 Self::FlexStart => Some("FlexStart"),
542 Self::FlexEnd => Some("FlexEnd"),
543 Self::Center => Some("Center"),
544 Self::SpaceBetween => Some("SpaceBetween"),
545 Self::SpaceAround => Some("SpaceAround"),
546 Self::SpaceEvenly => Some("SpaceEvenly"),
547 _ => None,
548 }
549 }
550}
551impl ::core::fmt::Debug for JustifyContent {
552 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
553 if let Some(name) = self.variant_name() {
554 f.write_str(name)
555 } else {
556 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
557 }
558 }
559}
560impl<'a> ::flatbuffers::Follow<'a> for JustifyContent {
561 type Inner = Self;
562 #[inline]
563 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
564 let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
565 Self(b)
566 }
567}
568
569impl ::flatbuffers::Push for JustifyContent {
570 type Output = JustifyContent;
571 #[inline]
572 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
573 unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
574 }
575}
576
577impl ::flatbuffers::EndianScalar for JustifyContent {
578 type Scalar = i8;
579 #[inline]
580 fn to_little_endian(self) -> i8 {
581 self.0.to_le()
582 }
583 #[inline]
584 #[allow(clippy::wrong_self_convention)]
585 fn from_little_endian(v: i8) -> Self {
586 let b = i8::from_le(v);
587 Self(b)
588 }
589}
590
591impl<'a> ::flatbuffers::Verifiable for JustifyContent {
592 #[inline]
593 fn run_verifier(
594 v: &mut ::flatbuffers::Verifier, pos: usize
595 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
596 i8::run_verifier(v, pos)
597 }
598}
599
600impl ::flatbuffers::SimpleToVerifyInSlice for JustifyContent {}
601#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
602pub const ENUM_MIN_ALIGN_ITEMS: i8 = 0;
603#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
604pub const ENUM_MAX_ALIGN_ITEMS: i8 = 4;
605#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
606#[allow(non_camel_case_types)]
607pub const ENUM_VALUES_ALIGN_ITEMS: [AlignItems; 5] = [
608 AlignItems::FlexStart,
609 AlignItems::FlexEnd,
610 AlignItems::Center,
611 AlignItems::Stretch,
612 AlignItems::Baseline,
613];
614
615#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
616#[repr(transparent)]
617pub struct AlignItems(pub i8);
618#[allow(non_upper_case_globals)]
619impl AlignItems {
620 pub const FlexStart: Self = Self(0);
621 pub const FlexEnd: Self = Self(1);
622 pub const Center: Self = Self(2);
623 pub const Stretch: Self = Self(3);
624 pub const Baseline: Self = Self(4);
625
626 pub const ENUM_MIN: i8 = 0;
627 pub const ENUM_MAX: i8 = 4;
628 pub const ENUM_VALUES: &'static [Self] = &[
629 Self::FlexStart,
630 Self::FlexEnd,
631 Self::Center,
632 Self::Stretch,
633 Self::Baseline,
634 ];
635 pub fn variant_name(self) -> Option<&'static str> {
637 match self {
638 Self::FlexStart => Some("FlexStart"),
639 Self::FlexEnd => Some("FlexEnd"),
640 Self::Center => Some("Center"),
641 Self::Stretch => Some("Stretch"),
642 Self::Baseline => Some("Baseline"),
643 _ => None,
644 }
645 }
646}
647impl ::core::fmt::Debug for AlignItems {
648 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
649 if let Some(name) = self.variant_name() {
650 f.write_str(name)
651 } else {
652 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
653 }
654 }
655}
656impl<'a> ::flatbuffers::Follow<'a> for AlignItems {
657 type Inner = Self;
658 #[inline]
659 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
660 let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
661 Self(b)
662 }
663}
664
665impl ::flatbuffers::Push for AlignItems {
666 type Output = AlignItems;
667 #[inline]
668 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
669 unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
670 }
671}
672
673impl ::flatbuffers::EndianScalar for AlignItems {
674 type Scalar = i8;
675 #[inline]
676 fn to_little_endian(self) -> i8 {
677 self.0.to_le()
678 }
679 #[inline]
680 #[allow(clippy::wrong_self_convention)]
681 fn from_little_endian(v: i8) -> Self {
682 let b = i8::from_le(v);
683 Self(b)
684 }
685}
686
687impl<'a> ::flatbuffers::Verifiable for AlignItems {
688 #[inline]
689 fn run_verifier(
690 v: &mut ::flatbuffers::Verifier, pos: usize
691 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
692 i8::run_verifier(v, pos)
693 }
694}
695
696impl ::flatbuffers::SimpleToVerifyInSlice for AlignItems {}
697#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
698pub const ENUM_MIN_DIMENSION_TYPE: i8 = 0;
699#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
700pub const ENUM_MAX_DIMENSION_TYPE: i8 = 2;
701#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
702#[allow(non_camel_case_types)]
703pub const ENUM_VALUES_DIMENSION_TYPE: [DimensionType; 3] = [
704 DimensionType::Auto,
705 DimensionType::Points,
706 DimensionType::Percent,
707];
708
709#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
710#[repr(transparent)]
711pub struct DimensionType(pub i8);
712#[allow(non_upper_case_globals)]
713impl DimensionType {
714 pub const Auto: Self = Self(0);
715 pub const Points: Self = Self(1);
716 pub const Percent: Self = Self(2);
717
718 pub const ENUM_MIN: i8 = 0;
719 pub const ENUM_MAX: i8 = 2;
720 pub const ENUM_VALUES: &'static [Self] = &[
721 Self::Auto,
722 Self::Points,
723 Self::Percent,
724 ];
725 pub fn variant_name(self) -> Option<&'static str> {
727 match self {
728 Self::Auto => Some("Auto"),
729 Self::Points => Some("Points"),
730 Self::Percent => Some("Percent"),
731 _ => None,
732 }
733 }
734}
735impl ::core::fmt::Debug for DimensionType {
736 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
737 if let Some(name) = self.variant_name() {
738 f.write_str(name)
739 } else {
740 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
741 }
742 }
743}
744impl<'a> ::flatbuffers::Follow<'a> for DimensionType {
745 type Inner = Self;
746 #[inline]
747 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
748 let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
749 Self(b)
750 }
751}
752
753impl ::flatbuffers::Push for DimensionType {
754 type Output = DimensionType;
755 #[inline]
756 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
757 unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
758 }
759}
760
761impl ::flatbuffers::EndianScalar for DimensionType {
762 type Scalar = i8;
763 #[inline]
764 fn to_little_endian(self) -> i8 {
765 self.0.to_le()
766 }
767 #[inline]
768 #[allow(clippy::wrong_self_convention)]
769 fn from_little_endian(v: i8) -> Self {
770 let b = i8::from_le(v);
771 Self(b)
772 }
773}
774
775impl<'a> ::flatbuffers::Verifiable for DimensionType {
776 #[inline]
777 fn run_verifier(
778 v: &mut ::flatbuffers::Verifier, pos: usize
779 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
780 i8::run_verifier(v, pos)
781 }
782}
783
784impl ::flatbuffers::SimpleToVerifyInSlice for DimensionType {}
785#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
786pub const ENUM_MIN_OVERFLOW: i8 = 0;
787#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
788pub const ENUM_MAX_OVERFLOW: i8 = 2;
789#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
790#[allow(non_camel_case_types)]
791pub const ENUM_VALUES_OVERFLOW: [Overflow; 3] = [
792 Overflow::Visible,
793 Overflow::Hidden,
794 Overflow::Scroll,
795];
796
797#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
798#[repr(transparent)]
799pub struct Overflow(pub i8);
800#[allow(non_upper_case_globals)]
801impl Overflow {
802 pub const Visible: Self = Self(0);
803 pub const Hidden: Self = Self(1);
804 pub const Scroll: Self = Self(2);
805
806 pub const ENUM_MIN: i8 = 0;
807 pub const ENUM_MAX: i8 = 2;
808 pub const ENUM_VALUES: &'static [Self] = &[
809 Self::Visible,
810 Self::Hidden,
811 Self::Scroll,
812 ];
813 pub fn variant_name(self) -> Option<&'static str> {
815 match self {
816 Self::Visible => Some("Visible"),
817 Self::Hidden => Some("Hidden"),
818 Self::Scroll => Some("Scroll"),
819 _ => None,
820 }
821 }
822}
823impl ::core::fmt::Debug for Overflow {
824 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
825 if let Some(name) = self.variant_name() {
826 f.write_str(name)
827 } else {
828 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
829 }
830 }
831}
832impl<'a> ::flatbuffers::Follow<'a> for Overflow {
833 type Inner = Self;
834 #[inline]
835 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
836 let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
837 Self(b)
838 }
839}
840
841impl ::flatbuffers::Push for Overflow {
842 type Output = Overflow;
843 #[inline]
844 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
845 unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
846 }
847}
848
849impl ::flatbuffers::EndianScalar for Overflow {
850 type Scalar = i8;
851 #[inline]
852 fn to_little_endian(self) -> i8 {
853 self.0.to_le()
854 }
855 #[inline]
856 #[allow(clippy::wrong_self_convention)]
857 fn from_little_endian(v: i8) -> Self {
858 let b = i8::from_le(v);
859 Self(b)
860 }
861}
862
863impl<'a> ::flatbuffers::Verifiable for Overflow {
864 #[inline]
865 fn run_verifier(
866 v: &mut ::flatbuffers::Verifier, pos: usize
867 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
868 i8::run_verifier(v, pos)
869 }
870}
871
872impl ::flatbuffers::SimpleToVerifyInSlice for Overflow {}
873#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
874pub const ENUM_MIN_PROP_VALUE_UNION: u8 = 0;
875#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
876pub const ENUM_MAX_PROP_VALUE_UNION: u8 = 5;
877#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
878#[allow(non_camel_case_types)]
879pub const ENUM_VALUES_PROP_VALUE_UNION: [PropValueUnion; 6] = [
880 PropValueUnion::NONE,
881 PropValueUnion::StringVal,
882 PropValueUnion::FloatVal,
883 PropValueUnion::IntVal,
884 PropValueUnion::BoolVal,
885 PropValueUnion::ColorVal,
886];
887
888#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
889#[repr(transparent)]
890pub struct PropValueUnion(pub u8);
891#[allow(non_upper_case_globals)]
892impl PropValueUnion {
893 pub const NONE: Self = Self(0);
894 pub const StringVal: Self = Self(1);
895 pub const FloatVal: Self = Self(2);
896 pub const IntVal: Self = Self(3);
897 pub const BoolVal: Self = Self(4);
898 pub const ColorVal: Self = Self(5);
899
900 pub const ENUM_MIN: u8 = 0;
901 pub const ENUM_MAX: u8 = 5;
902 pub const ENUM_VALUES: &'static [Self] = &[
903 Self::NONE,
904 Self::StringVal,
905 Self::FloatVal,
906 Self::IntVal,
907 Self::BoolVal,
908 Self::ColorVal,
909 ];
910 pub fn variant_name(self) -> Option<&'static str> {
912 match self {
913 Self::NONE => Some("NONE"),
914 Self::StringVal => Some("StringVal"),
915 Self::FloatVal => Some("FloatVal"),
916 Self::IntVal => Some("IntVal"),
917 Self::BoolVal => Some("BoolVal"),
918 Self::ColorVal => Some("ColorVal"),
919 _ => None,
920 }
921 }
922}
923impl ::core::fmt::Debug for PropValueUnion {
924 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
925 if let Some(name) = self.variant_name() {
926 f.write_str(name)
927 } else {
928 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
929 }
930 }
931}
932impl<'a> ::flatbuffers::Follow<'a> for PropValueUnion {
933 type Inner = Self;
934 #[inline]
935 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
936 let b = unsafe { ::flatbuffers::read_scalar_at::<u8>(buf, loc) };
937 Self(b)
938 }
939}
940
941impl ::flatbuffers::Push for PropValueUnion {
942 type Output = PropValueUnion;
943 #[inline]
944 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
945 unsafe { ::flatbuffers::emplace_scalar::<u8>(dst, self.0) };
946 }
947}
948
949impl ::flatbuffers::EndianScalar for PropValueUnion {
950 type Scalar = u8;
951 #[inline]
952 fn to_little_endian(self) -> u8 {
953 self.0.to_le()
954 }
955 #[inline]
956 #[allow(clippy::wrong_self_convention)]
957 fn from_little_endian(v: u8) -> Self {
958 let b = u8::from_le(v);
959 Self(b)
960 }
961}
962
963impl<'a> ::flatbuffers::Verifiable for PropValueUnion {
964 #[inline]
965 fn run_verifier(
966 v: &mut ::flatbuffers::Verifier, pos: usize
967 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
968 u8::run_verifier(v, pos)
969 }
970}
971
972impl ::flatbuffers::SimpleToVerifyInSlice for PropValueUnion {}
973pub struct PropValueUnionUnionTableOffset {}
974
975#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
976pub const ENUM_MIN_COMMAND: u8 = 0;
977#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
978pub const ENUM_MAX_COMMAND: u8 = 7;
979#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
980#[allow(non_camel_case_types)]
981pub const ENUM_VALUES_COMMAND: [Command; 8] = [
982 Command::NONE,
983 Command::CreateNode,
984 Command::UpdateProps,
985 Command::UpdateStyle,
986 Command::AppendChild,
987 Command::InsertBefore,
988 Command::RemoveChild,
989 Command::SetRoot,
990];
991
992#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
993#[repr(transparent)]
994pub struct Command(pub u8);
995#[allow(non_upper_case_globals)]
996impl Command {
997 pub const NONE: Self = Self(0);
998 pub const CreateNode: Self = Self(1);
999 pub const UpdateProps: Self = Self(2);
1000 pub const UpdateStyle: Self = Self(3);
1001 pub const AppendChild: Self = Self(4);
1002 pub const InsertBefore: Self = Self(5);
1003 pub const RemoveChild: Self = Self(6);
1004 pub const SetRoot: Self = Self(7);
1005
1006 pub const ENUM_MIN: u8 = 0;
1007 pub const ENUM_MAX: u8 = 7;
1008 pub const ENUM_VALUES: &'static [Self] = &[
1009 Self::NONE,
1010 Self::CreateNode,
1011 Self::UpdateProps,
1012 Self::UpdateStyle,
1013 Self::AppendChild,
1014 Self::InsertBefore,
1015 Self::RemoveChild,
1016 Self::SetRoot,
1017 ];
1018 pub fn variant_name(self) -> Option<&'static str> {
1020 match self {
1021 Self::NONE => Some("NONE"),
1022 Self::CreateNode => Some("CreateNode"),
1023 Self::UpdateProps => Some("UpdateProps"),
1024 Self::UpdateStyle => Some("UpdateStyle"),
1025 Self::AppendChild => Some("AppendChild"),
1026 Self::InsertBefore => Some("InsertBefore"),
1027 Self::RemoveChild => Some("RemoveChild"),
1028 Self::SetRoot => Some("SetRoot"),
1029 _ => None,
1030 }
1031 }
1032}
1033impl ::core::fmt::Debug for Command {
1034 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1035 if let Some(name) = self.variant_name() {
1036 f.write_str(name)
1037 } else {
1038 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1039 }
1040 }
1041}
1042impl<'a> ::flatbuffers::Follow<'a> for Command {
1043 type Inner = Self;
1044 #[inline]
1045 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1046 let b = unsafe { ::flatbuffers::read_scalar_at::<u8>(buf, loc) };
1047 Self(b)
1048 }
1049}
1050
1051impl ::flatbuffers::Push for Command {
1052 type Output = Command;
1053 #[inline]
1054 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1055 unsafe { ::flatbuffers::emplace_scalar::<u8>(dst, self.0) };
1056 }
1057}
1058
1059impl ::flatbuffers::EndianScalar for Command {
1060 type Scalar = u8;
1061 #[inline]
1062 fn to_little_endian(self) -> u8 {
1063 self.0.to_le()
1064 }
1065 #[inline]
1066 #[allow(clippy::wrong_self_convention)]
1067 fn from_little_endian(v: u8) -> Self {
1068 let b = u8::from_le(v);
1069 Self(b)
1070 }
1071}
1072
1073impl<'a> ::flatbuffers::Verifiable for Command {
1074 #[inline]
1075 fn run_verifier(
1076 v: &mut ::flatbuffers::Verifier, pos: usize
1077 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
1078 u8::run_verifier(v, pos)
1079 }
1080}
1081
1082impl ::flatbuffers::SimpleToVerifyInSlice for Command {}
1083pub struct CommandUnionTableOffset {}
1084
1085#[repr(transparent)]
1087#[derive(Clone, Copy, PartialEq)]
1088pub struct Color(pub [u8; 8]);
1089impl Default for Color {
1090 fn default() -> Self {
1091 Self([0; 8])
1092 }
1093}
1094impl ::core::fmt::Debug for Color {
1095 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1096 f.debug_struct("Color")
1097 .field("r", &self.r())
1098 .field("g", &self.g())
1099 .field("b", &self.b())
1100 .field("a", &self.a())
1101 .finish()
1102 }
1103}
1104
1105impl ::flatbuffers::SimpleToVerifyInSlice for Color {}
1106impl<'a> ::flatbuffers::Follow<'a> for Color {
1107 type Inner = &'a Color;
1108 #[inline]
1109 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1110 unsafe { <&'a Color>::follow(buf, loc) }
1111 }
1112}
1113impl<'a> ::flatbuffers::Follow<'a> for &'a Color {
1114 type Inner = &'a Color;
1115 #[inline]
1116 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1117 unsafe { ::flatbuffers::follow_cast_ref::<Color>(buf, loc) }
1118 }
1119}
1120impl<'b> ::flatbuffers::Push for Color {
1121 type Output = Color;
1122 #[inline]
1123 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1124 let src = unsafe { ::core::slice::from_raw_parts(self as *const Color as *const u8, <Self as ::flatbuffers::Push>::size()) };
1125 dst.copy_from_slice(src);
1126 }
1127 #[inline]
1128 fn alignment() -> ::flatbuffers::PushAlignment {
1129 ::flatbuffers::PushAlignment::new(4)
1130 }
1131}
1132
1133impl<'a> ::flatbuffers::Verifiable for Color {
1134 #[inline]
1135 fn run_verifier(
1136 v: &mut ::flatbuffers::Verifier, pos: usize
1137 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
1138 v.in_buffer::<Self>(pos)
1139 }
1140}
1141
1142impl<'a> Color {
1143 #[allow(clippy::too_many_arguments)]
1144 pub fn new(
1145 r: u8,
1146 g: u8,
1147 b: u8,
1148 a: f32,
1149 ) -> Self {
1150 let mut s = Self([0; 8]);
1151 s.set_r(r);
1152 s.set_g(g);
1153 s.set_b(b);
1154 s.set_a(a);
1155 s
1156 }
1157
1158 pub fn r(&self) -> u8 {
1159 let mut mem = ::core::mem::MaybeUninit::<<u8 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1160 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1164 ::core::ptr::copy_nonoverlapping(
1165 self.0[0..].as_ptr(),
1166 mem.as_mut_ptr() as *mut u8,
1167 ::core::mem::size_of::<<u8 as ::flatbuffers::EndianScalar>::Scalar>(),
1168 );
1169 mem.assume_init()
1170 })
1171 }
1172
1173 pub fn set_r(&mut self, x: u8) {
1174 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1175 unsafe {
1179 ::core::ptr::copy_nonoverlapping(
1180 &x_le as *const _ as *const u8,
1181 self.0[0..].as_mut_ptr(),
1182 ::core::mem::size_of::<<u8 as ::flatbuffers::EndianScalar>::Scalar>(),
1183 );
1184 }
1185 }
1186
1187 pub fn g(&self) -> u8 {
1188 let mut mem = ::core::mem::MaybeUninit::<<u8 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1189 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1193 ::core::ptr::copy_nonoverlapping(
1194 self.0[1..].as_ptr(),
1195 mem.as_mut_ptr() as *mut u8,
1196 ::core::mem::size_of::<<u8 as ::flatbuffers::EndianScalar>::Scalar>(),
1197 );
1198 mem.assume_init()
1199 })
1200 }
1201
1202 pub fn set_g(&mut self, x: u8) {
1203 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1204 unsafe {
1208 ::core::ptr::copy_nonoverlapping(
1209 &x_le as *const _ as *const u8,
1210 self.0[1..].as_mut_ptr(),
1211 ::core::mem::size_of::<<u8 as ::flatbuffers::EndianScalar>::Scalar>(),
1212 );
1213 }
1214 }
1215
1216 pub fn b(&self) -> u8 {
1217 let mut mem = ::core::mem::MaybeUninit::<<u8 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1218 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1222 ::core::ptr::copy_nonoverlapping(
1223 self.0[2..].as_ptr(),
1224 mem.as_mut_ptr() as *mut u8,
1225 ::core::mem::size_of::<<u8 as ::flatbuffers::EndianScalar>::Scalar>(),
1226 );
1227 mem.assume_init()
1228 })
1229 }
1230
1231 pub fn set_b(&mut self, x: u8) {
1232 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1233 unsafe {
1237 ::core::ptr::copy_nonoverlapping(
1238 &x_le as *const _ as *const u8,
1239 self.0[2..].as_mut_ptr(),
1240 ::core::mem::size_of::<<u8 as ::flatbuffers::EndianScalar>::Scalar>(),
1241 );
1242 }
1243 }
1244
1245 pub fn a(&self) -> f32 {
1246 let mut mem = ::core::mem::MaybeUninit::<<f32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1247 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1251 ::core::ptr::copy_nonoverlapping(
1252 self.0[4..].as_ptr(),
1253 mem.as_mut_ptr() as *mut u8,
1254 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1255 );
1256 mem.assume_init()
1257 })
1258 }
1259
1260 pub fn set_a(&mut self, x: f32) {
1261 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1262 unsafe {
1266 ::core::ptr::copy_nonoverlapping(
1267 &x_le as *const _ as *const u8,
1268 self.0[4..].as_mut_ptr(),
1269 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1270 );
1271 }
1272 }
1273
1274}
1275
1276#[repr(transparent)]
1278#[derive(Clone, Copy, PartialEq)]
1279pub struct Edges(pub [u8; 16]);
1280impl Default for Edges {
1281 fn default() -> Self {
1282 Self([0; 16])
1283 }
1284}
1285impl ::core::fmt::Debug for Edges {
1286 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1287 f.debug_struct("Edges")
1288 .field("top", &self.top())
1289 .field("right", &self.right())
1290 .field("bottom", &self.bottom())
1291 .field("left", &self.left())
1292 .finish()
1293 }
1294}
1295
1296impl ::flatbuffers::SimpleToVerifyInSlice for Edges {}
1297impl<'a> ::flatbuffers::Follow<'a> for Edges {
1298 type Inner = &'a Edges;
1299 #[inline]
1300 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1301 unsafe { <&'a Edges>::follow(buf, loc) }
1302 }
1303}
1304impl<'a> ::flatbuffers::Follow<'a> for &'a Edges {
1305 type Inner = &'a Edges;
1306 #[inline]
1307 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1308 unsafe { ::flatbuffers::follow_cast_ref::<Edges>(buf, loc) }
1309 }
1310}
1311impl<'b> ::flatbuffers::Push for Edges {
1312 type Output = Edges;
1313 #[inline]
1314 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1315 let src = unsafe { ::core::slice::from_raw_parts(self as *const Edges as *const u8, <Self as ::flatbuffers::Push>::size()) };
1316 dst.copy_from_slice(src);
1317 }
1318 #[inline]
1319 fn alignment() -> ::flatbuffers::PushAlignment {
1320 ::flatbuffers::PushAlignment::new(4)
1321 }
1322}
1323
1324impl<'a> ::flatbuffers::Verifiable for Edges {
1325 #[inline]
1326 fn run_verifier(
1327 v: &mut ::flatbuffers::Verifier, pos: usize
1328 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
1329 v.in_buffer::<Self>(pos)
1330 }
1331}
1332
1333impl<'a> Edges {
1334 #[allow(clippy::too_many_arguments)]
1335 pub fn new(
1336 top: f32,
1337 right: f32,
1338 bottom: f32,
1339 left: f32,
1340 ) -> Self {
1341 let mut s = Self([0; 16]);
1342 s.set_top(top);
1343 s.set_right(right);
1344 s.set_bottom(bottom);
1345 s.set_left(left);
1346 s
1347 }
1348
1349 pub fn top(&self) -> f32 {
1350 let mut mem = ::core::mem::MaybeUninit::<<f32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1351 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1355 ::core::ptr::copy_nonoverlapping(
1356 self.0[0..].as_ptr(),
1357 mem.as_mut_ptr() as *mut u8,
1358 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1359 );
1360 mem.assume_init()
1361 })
1362 }
1363
1364 pub fn set_top(&mut self, x: f32) {
1365 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1366 unsafe {
1370 ::core::ptr::copy_nonoverlapping(
1371 &x_le as *const _ as *const u8,
1372 self.0[0..].as_mut_ptr(),
1373 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1374 );
1375 }
1376 }
1377
1378 pub fn right(&self) -> f32 {
1379 let mut mem = ::core::mem::MaybeUninit::<<f32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1380 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1384 ::core::ptr::copy_nonoverlapping(
1385 self.0[4..].as_ptr(),
1386 mem.as_mut_ptr() as *mut u8,
1387 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1388 );
1389 mem.assume_init()
1390 })
1391 }
1392
1393 pub fn set_right(&mut self, x: f32) {
1394 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1395 unsafe {
1399 ::core::ptr::copy_nonoverlapping(
1400 &x_le as *const _ as *const u8,
1401 self.0[4..].as_mut_ptr(),
1402 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1403 );
1404 }
1405 }
1406
1407 pub fn bottom(&self) -> f32 {
1408 let mut mem = ::core::mem::MaybeUninit::<<f32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1409 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1413 ::core::ptr::copy_nonoverlapping(
1414 self.0[8..].as_ptr(),
1415 mem.as_mut_ptr() as *mut u8,
1416 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1417 );
1418 mem.assume_init()
1419 })
1420 }
1421
1422 pub fn set_bottom(&mut self, x: f32) {
1423 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1424 unsafe {
1428 ::core::ptr::copy_nonoverlapping(
1429 &x_le as *const _ as *const u8,
1430 self.0[8..].as_mut_ptr(),
1431 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1432 );
1433 }
1434 }
1435
1436 pub fn left(&self) -> f32 {
1437 let mut mem = ::core::mem::MaybeUninit::<<f32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1438 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1442 ::core::ptr::copy_nonoverlapping(
1443 self.0[12..].as_ptr(),
1444 mem.as_mut_ptr() as *mut u8,
1445 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1446 );
1447 mem.assume_init()
1448 })
1449 }
1450
1451 pub fn set_left(&mut self, x: f32) {
1452 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1453 unsafe {
1457 ::core::ptr::copy_nonoverlapping(
1458 &x_le as *const _ as *const u8,
1459 self.0[12..].as_mut_ptr(),
1460 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1461 );
1462 }
1463 }
1464
1465}
1466
1467#[repr(transparent)]
1469#[derive(Clone, Copy, PartialEq)]
1470pub struct Dimension(pub [u8; 8]);
1471impl Default for Dimension {
1472 fn default() -> Self {
1473 Self([0; 8])
1474 }
1475}
1476impl ::core::fmt::Debug for Dimension {
1477 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1478 f.debug_struct("Dimension")
1479 .field("type_", &self.type_())
1480 .field("value", &self.value())
1481 .finish()
1482 }
1483}
1484
1485impl ::flatbuffers::SimpleToVerifyInSlice for Dimension {}
1486impl<'a> ::flatbuffers::Follow<'a> for Dimension {
1487 type Inner = &'a Dimension;
1488 #[inline]
1489 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1490 unsafe { <&'a Dimension>::follow(buf, loc) }
1491 }
1492}
1493impl<'a> ::flatbuffers::Follow<'a> for &'a Dimension {
1494 type Inner = &'a Dimension;
1495 #[inline]
1496 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1497 unsafe { ::flatbuffers::follow_cast_ref::<Dimension>(buf, loc) }
1498 }
1499}
1500impl<'b> ::flatbuffers::Push for Dimension {
1501 type Output = Dimension;
1502 #[inline]
1503 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1504 let src = unsafe { ::core::slice::from_raw_parts(self as *const Dimension as *const u8, <Self as ::flatbuffers::Push>::size()) };
1505 dst.copy_from_slice(src);
1506 }
1507 #[inline]
1508 fn alignment() -> ::flatbuffers::PushAlignment {
1509 ::flatbuffers::PushAlignment::new(4)
1510 }
1511}
1512
1513impl<'a> ::flatbuffers::Verifiable for Dimension {
1514 #[inline]
1515 fn run_verifier(
1516 v: &mut ::flatbuffers::Verifier, pos: usize
1517 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
1518 v.in_buffer::<Self>(pos)
1519 }
1520}
1521
1522impl<'a> Dimension {
1523 #[allow(clippy::too_many_arguments)]
1524 pub fn new(
1525 type_: DimensionType,
1526 value: f32,
1527 ) -> Self {
1528 let mut s = Self([0; 8]);
1529 s.set_type_(type_);
1530 s.set_value(value);
1531 s
1532 }
1533
1534 pub fn type_(&self) -> DimensionType {
1535 let mut mem = ::core::mem::MaybeUninit::<<DimensionType as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1536 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1540 ::core::ptr::copy_nonoverlapping(
1541 self.0[0..].as_ptr(),
1542 mem.as_mut_ptr() as *mut u8,
1543 ::core::mem::size_of::<<DimensionType as ::flatbuffers::EndianScalar>::Scalar>(),
1544 );
1545 mem.assume_init()
1546 })
1547 }
1548
1549 pub fn set_type_(&mut self, x: DimensionType) {
1550 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1551 unsafe {
1555 ::core::ptr::copy_nonoverlapping(
1556 &x_le as *const _ as *const u8,
1557 self.0[0..].as_mut_ptr(),
1558 ::core::mem::size_of::<<DimensionType as ::flatbuffers::EndianScalar>::Scalar>(),
1559 );
1560 }
1561 }
1562
1563 pub fn value(&self) -> f32 {
1564 let mut mem = ::core::mem::MaybeUninit::<<f32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
1565 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
1569 ::core::ptr::copy_nonoverlapping(
1570 self.0[4..].as_ptr(),
1571 mem.as_mut_ptr() as *mut u8,
1572 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1573 );
1574 mem.assume_init()
1575 })
1576 }
1577
1578 pub fn set_value(&mut self, x: f32) {
1579 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
1580 unsafe {
1584 ::core::ptr::copy_nonoverlapping(
1585 &x_le as *const _ as *const u8,
1586 self.0[4..].as_mut_ptr(),
1587 ::core::mem::size_of::<<f32 as ::flatbuffers::EndianScalar>::Scalar>(),
1588 );
1589 }
1590 }
1591
1592}
1593
1594pub enum LayoutStyleOffset {}
1595#[derive(Copy, Clone, PartialEq)]
1596
1597pub struct LayoutStyle<'a> {
1598 pub _tab: ::flatbuffers::Table<'a>,
1599}
1600
1601impl<'a> ::flatbuffers::Follow<'a> for LayoutStyle<'a> {
1602 type Inner = LayoutStyle<'a>;
1603 #[inline]
1604 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1605 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
1606 }
1607}
1608
1609impl<'a> LayoutStyle<'a> {
1610 pub const VT_DISPLAY: ::flatbuffers::VOffsetT = 4;
1611 pub const VT_POSITION: ::flatbuffers::VOffsetT = 6;
1612 pub const VT_FLEX_DIRECTION: ::flatbuffers::VOffsetT = 8;
1613 pub const VT_FLEX_WRAP: ::flatbuffers::VOffsetT = 10;
1614 pub const VT_FLEX_GROW: ::flatbuffers::VOffsetT = 12;
1615 pub const VT_FLEX_SHRINK: ::flatbuffers::VOffsetT = 14;
1616 pub const VT_JUSTIFY_CONTENT: ::flatbuffers::VOffsetT = 16;
1617 pub const VT_ALIGN_ITEMS: ::flatbuffers::VOffsetT = 18;
1618 pub const VT_WIDTH: ::flatbuffers::VOffsetT = 20;
1619 pub const VT_HEIGHT: ::flatbuffers::VOffsetT = 22;
1620 pub const VT_MIN_WIDTH: ::flatbuffers::VOffsetT = 24;
1621 pub const VT_MIN_HEIGHT: ::flatbuffers::VOffsetT = 26;
1622 pub const VT_MAX_WIDTH: ::flatbuffers::VOffsetT = 28;
1623 pub const VT_MAX_HEIGHT: ::flatbuffers::VOffsetT = 30;
1624 pub const VT_ASPECT_RATIO: ::flatbuffers::VOffsetT = 32;
1625 pub const VT_MARGIN: ::flatbuffers::VOffsetT = 34;
1626 pub const VT_PADDING: ::flatbuffers::VOffsetT = 36;
1627 pub const VT_GAP: ::flatbuffers::VOffsetT = 38;
1628 pub const VT_OVERFLOW: ::flatbuffers::VOffsetT = 40;
1629
1630 #[inline]
1631 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
1632 LayoutStyle { _tab: table }
1633 }
1634 #[allow(unused_mut)]
1635 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
1636 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
1637 args: &'args LayoutStyleArgs<'args>
1638 ) -> ::flatbuffers::WIPOffset<LayoutStyle<'bldr>> {
1639 let mut builder = LayoutStyleBuilder::new(_fbb);
1640 builder.add_gap(args.gap);
1641 if let Some(x) = args.padding { builder.add_padding(x); }
1642 if let Some(x) = args.margin { builder.add_margin(x); }
1643 builder.add_aspect_ratio(args.aspect_ratio);
1644 if let Some(x) = args.max_height { builder.add_max_height(x); }
1645 if let Some(x) = args.max_width { builder.add_max_width(x); }
1646 if let Some(x) = args.min_height { builder.add_min_height(x); }
1647 if let Some(x) = args.min_width { builder.add_min_width(x); }
1648 if let Some(x) = args.height { builder.add_height(x); }
1649 if let Some(x) = args.width { builder.add_width(x); }
1650 builder.add_flex_shrink(args.flex_shrink);
1651 builder.add_flex_grow(args.flex_grow);
1652 builder.add_overflow(args.overflow);
1653 builder.add_align_items(args.align_items);
1654 builder.add_justify_content(args.justify_content);
1655 builder.add_flex_wrap(args.flex_wrap);
1656 builder.add_flex_direction(args.flex_direction);
1657 builder.add_position(args.position);
1658 builder.add_display(args.display);
1659 builder.finish()
1660 }
1661
1662
1663 #[inline]
1664 pub fn display(&self) -> Display {
1665 unsafe { self._tab.get::<Display>(LayoutStyle::VT_DISPLAY, Some(Display::Flex)).unwrap()}
1669 }
1670 #[inline]
1671 pub fn position(&self) -> Position {
1672 unsafe { self._tab.get::<Position>(LayoutStyle::VT_POSITION, Some(Position::Relative)).unwrap()}
1676 }
1677 #[inline]
1678 pub fn flex_direction(&self) -> FlexDirection {
1679 unsafe { self._tab.get::<FlexDirection>(LayoutStyle::VT_FLEX_DIRECTION, Some(FlexDirection::Column)).unwrap()}
1683 }
1684 #[inline]
1685 pub fn flex_wrap(&self) -> FlexWrap {
1686 unsafe { self._tab.get::<FlexWrap>(LayoutStyle::VT_FLEX_WRAP, Some(FlexWrap::NoWrap)).unwrap()}
1690 }
1691 #[inline]
1692 pub fn flex_grow(&self) -> f32 {
1693 unsafe { self._tab.get::<f32>(LayoutStyle::VT_FLEX_GROW, Some(0.0)).unwrap()}
1697 }
1698 #[inline]
1699 pub fn flex_shrink(&self) -> f32 {
1700 unsafe { self._tab.get::<f32>(LayoutStyle::VT_FLEX_SHRINK, Some(1.0)).unwrap()}
1704 }
1705 #[inline]
1706 pub fn justify_content(&self) -> JustifyContent {
1707 unsafe { self._tab.get::<JustifyContent>(LayoutStyle::VT_JUSTIFY_CONTENT, Some(JustifyContent::FlexStart)).unwrap()}
1711 }
1712 #[inline]
1713 pub fn align_items(&self) -> AlignItems {
1714 unsafe { self._tab.get::<AlignItems>(LayoutStyle::VT_ALIGN_ITEMS, Some(AlignItems::FlexStart)).unwrap()}
1718 }
1719 #[inline]
1720 pub fn width(&self) -> Option<&'a Dimension> {
1721 unsafe { self._tab.get::<Dimension>(LayoutStyle::VT_WIDTH, None)}
1725 }
1726 #[inline]
1727 pub fn height(&self) -> Option<&'a Dimension> {
1728 unsafe { self._tab.get::<Dimension>(LayoutStyle::VT_HEIGHT, None)}
1732 }
1733 #[inline]
1734 pub fn min_width(&self) -> Option<&'a Dimension> {
1735 unsafe { self._tab.get::<Dimension>(LayoutStyle::VT_MIN_WIDTH, None)}
1739 }
1740 #[inline]
1741 pub fn min_height(&self) -> Option<&'a Dimension> {
1742 unsafe { self._tab.get::<Dimension>(LayoutStyle::VT_MIN_HEIGHT, None)}
1746 }
1747 #[inline]
1748 pub fn max_width(&self) -> Option<&'a Dimension> {
1749 unsafe { self._tab.get::<Dimension>(LayoutStyle::VT_MAX_WIDTH, None)}
1753 }
1754 #[inline]
1755 pub fn max_height(&self) -> Option<&'a Dimension> {
1756 unsafe { self._tab.get::<Dimension>(LayoutStyle::VT_MAX_HEIGHT, None)}
1760 }
1761 #[inline]
1762 pub fn aspect_ratio(&self) -> f32 {
1763 unsafe { self._tab.get::<f32>(LayoutStyle::VT_ASPECT_RATIO, Some(0.0)).unwrap()}
1767 }
1768 #[inline]
1769 pub fn margin(&self) -> Option<&'a Edges> {
1770 unsafe { self._tab.get::<Edges>(LayoutStyle::VT_MARGIN, None)}
1774 }
1775 #[inline]
1776 pub fn padding(&self) -> Option<&'a Edges> {
1777 unsafe { self._tab.get::<Edges>(LayoutStyle::VT_PADDING, None)}
1781 }
1782 #[inline]
1783 pub fn gap(&self) -> f32 {
1784 unsafe { self._tab.get::<f32>(LayoutStyle::VT_GAP, Some(0.0)).unwrap()}
1788 }
1789 #[inline]
1790 pub fn overflow(&self) -> Overflow {
1791 unsafe { self._tab.get::<Overflow>(LayoutStyle::VT_OVERFLOW, Some(Overflow::Visible)).unwrap()}
1795 }
1796}
1797
1798impl ::flatbuffers::Verifiable for LayoutStyle<'_> {
1799 #[inline]
1800 fn run_verifier(
1801 v: &mut ::flatbuffers::Verifier, pos: usize
1802 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
1803 v.visit_table(pos)?
1804 .visit_field::<Display>("display", Self::VT_DISPLAY, false)?
1805 .visit_field::<Position>("position", Self::VT_POSITION, false)?
1806 .visit_field::<FlexDirection>("flex_direction", Self::VT_FLEX_DIRECTION, false)?
1807 .visit_field::<FlexWrap>("flex_wrap", Self::VT_FLEX_WRAP, false)?
1808 .visit_field::<f32>("flex_grow", Self::VT_FLEX_GROW, false)?
1809 .visit_field::<f32>("flex_shrink", Self::VT_FLEX_SHRINK, false)?
1810 .visit_field::<JustifyContent>("justify_content", Self::VT_JUSTIFY_CONTENT, false)?
1811 .visit_field::<AlignItems>("align_items", Self::VT_ALIGN_ITEMS, false)?
1812 .visit_field::<Dimension>("width", Self::VT_WIDTH, false)?
1813 .visit_field::<Dimension>("height", Self::VT_HEIGHT, false)?
1814 .visit_field::<Dimension>("min_width", Self::VT_MIN_WIDTH, false)?
1815 .visit_field::<Dimension>("min_height", Self::VT_MIN_HEIGHT, false)?
1816 .visit_field::<Dimension>("max_width", Self::VT_MAX_WIDTH, false)?
1817 .visit_field::<Dimension>("max_height", Self::VT_MAX_HEIGHT, false)?
1818 .visit_field::<f32>("aspect_ratio", Self::VT_ASPECT_RATIO, false)?
1819 .visit_field::<Edges>("margin", Self::VT_MARGIN, false)?
1820 .visit_field::<Edges>("padding", Self::VT_PADDING, false)?
1821 .visit_field::<f32>("gap", Self::VT_GAP, false)?
1822 .visit_field::<Overflow>("overflow", Self::VT_OVERFLOW, false)?
1823 .finish();
1824 Ok(())
1825 }
1826}
1827pub struct LayoutStyleArgs<'a> {
1828 pub display: Display,
1829 pub position: Position,
1830 pub flex_direction: FlexDirection,
1831 pub flex_wrap: FlexWrap,
1832 pub flex_grow: f32,
1833 pub flex_shrink: f32,
1834 pub justify_content: JustifyContent,
1835 pub align_items: AlignItems,
1836 pub width: Option<&'a Dimension>,
1837 pub height: Option<&'a Dimension>,
1838 pub min_width: Option<&'a Dimension>,
1839 pub min_height: Option<&'a Dimension>,
1840 pub max_width: Option<&'a Dimension>,
1841 pub max_height: Option<&'a Dimension>,
1842 pub aspect_ratio: f32,
1843 pub margin: Option<&'a Edges>,
1844 pub padding: Option<&'a Edges>,
1845 pub gap: f32,
1846 pub overflow: Overflow,
1847}
1848impl<'a> Default for LayoutStyleArgs<'a> {
1849 #[inline]
1850 fn default() -> Self {
1851 LayoutStyleArgs {
1852 display: Display::Flex,
1853 position: Position::Relative,
1854 flex_direction: FlexDirection::Column,
1855 flex_wrap: FlexWrap::NoWrap,
1856 flex_grow: 0.0,
1857 flex_shrink: 1.0,
1858 justify_content: JustifyContent::FlexStart,
1859 align_items: AlignItems::FlexStart,
1860 width: None,
1861 height: None,
1862 min_width: None,
1863 min_height: None,
1864 max_width: None,
1865 max_height: None,
1866 aspect_ratio: 0.0,
1867 margin: None,
1868 padding: None,
1869 gap: 0.0,
1870 overflow: Overflow::Visible,
1871 }
1872 }
1873}
1874
1875pub struct LayoutStyleBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
1876 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
1877 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
1878}
1879impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> LayoutStyleBuilder<'a, 'b, A> {
1880 #[inline]
1881 pub fn add_display(&mut self, display: Display) {
1882 self.fbb_.push_slot::<Display>(LayoutStyle::VT_DISPLAY, display, Display::Flex);
1883 }
1884 #[inline]
1885 pub fn add_position(&mut self, position: Position) {
1886 self.fbb_.push_slot::<Position>(LayoutStyle::VT_POSITION, position, Position::Relative);
1887 }
1888 #[inline]
1889 pub fn add_flex_direction(&mut self, flex_direction: FlexDirection) {
1890 self.fbb_.push_slot::<FlexDirection>(LayoutStyle::VT_FLEX_DIRECTION, flex_direction, FlexDirection::Column);
1891 }
1892 #[inline]
1893 pub fn add_flex_wrap(&mut self, flex_wrap: FlexWrap) {
1894 self.fbb_.push_slot::<FlexWrap>(LayoutStyle::VT_FLEX_WRAP, flex_wrap, FlexWrap::NoWrap);
1895 }
1896 #[inline]
1897 pub fn add_flex_grow(&mut self, flex_grow: f32) {
1898 self.fbb_.push_slot::<f32>(LayoutStyle::VT_FLEX_GROW, flex_grow, 0.0);
1899 }
1900 #[inline]
1901 pub fn add_flex_shrink(&mut self, flex_shrink: f32) {
1902 self.fbb_.push_slot::<f32>(LayoutStyle::VT_FLEX_SHRINK, flex_shrink, 1.0);
1903 }
1904 #[inline]
1905 pub fn add_justify_content(&mut self, justify_content: JustifyContent) {
1906 self.fbb_.push_slot::<JustifyContent>(LayoutStyle::VT_JUSTIFY_CONTENT, justify_content, JustifyContent::FlexStart);
1907 }
1908 #[inline]
1909 pub fn add_align_items(&mut self, align_items: AlignItems) {
1910 self.fbb_.push_slot::<AlignItems>(LayoutStyle::VT_ALIGN_ITEMS, align_items, AlignItems::FlexStart);
1911 }
1912 #[inline]
1913 pub fn add_width(&mut self, width: &Dimension) {
1914 self.fbb_.push_slot_always::<&Dimension>(LayoutStyle::VT_WIDTH, width);
1915 }
1916 #[inline]
1917 pub fn add_height(&mut self, height: &Dimension) {
1918 self.fbb_.push_slot_always::<&Dimension>(LayoutStyle::VT_HEIGHT, height);
1919 }
1920 #[inline]
1921 pub fn add_min_width(&mut self, min_width: &Dimension) {
1922 self.fbb_.push_slot_always::<&Dimension>(LayoutStyle::VT_MIN_WIDTH, min_width);
1923 }
1924 #[inline]
1925 pub fn add_min_height(&mut self, min_height: &Dimension) {
1926 self.fbb_.push_slot_always::<&Dimension>(LayoutStyle::VT_MIN_HEIGHT, min_height);
1927 }
1928 #[inline]
1929 pub fn add_max_width(&mut self, max_width: &Dimension) {
1930 self.fbb_.push_slot_always::<&Dimension>(LayoutStyle::VT_MAX_WIDTH, max_width);
1931 }
1932 #[inline]
1933 pub fn add_max_height(&mut self, max_height: &Dimension) {
1934 self.fbb_.push_slot_always::<&Dimension>(LayoutStyle::VT_MAX_HEIGHT, max_height);
1935 }
1936 #[inline]
1937 pub fn add_aspect_ratio(&mut self, aspect_ratio: f32) {
1938 self.fbb_.push_slot::<f32>(LayoutStyle::VT_ASPECT_RATIO, aspect_ratio, 0.0);
1939 }
1940 #[inline]
1941 pub fn add_margin(&mut self, margin: &Edges) {
1942 self.fbb_.push_slot_always::<&Edges>(LayoutStyle::VT_MARGIN, margin);
1943 }
1944 #[inline]
1945 pub fn add_padding(&mut self, padding: &Edges) {
1946 self.fbb_.push_slot_always::<&Edges>(LayoutStyle::VT_PADDING, padding);
1947 }
1948 #[inline]
1949 pub fn add_gap(&mut self, gap: f32) {
1950 self.fbb_.push_slot::<f32>(LayoutStyle::VT_GAP, gap, 0.0);
1951 }
1952 #[inline]
1953 pub fn add_overflow(&mut self, overflow: Overflow) {
1954 self.fbb_.push_slot::<Overflow>(LayoutStyle::VT_OVERFLOW, overflow, Overflow::Visible);
1955 }
1956 #[inline]
1957 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> LayoutStyleBuilder<'a, 'b, A> {
1958 let start = _fbb.start_table();
1959 LayoutStyleBuilder {
1960 fbb_: _fbb,
1961 start_: start,
1962 }
1963 }
1964 #[inline]
1965 pub fn finish(self) -> ::flatbuffers::WIPOffset<LayoutStyle<'a>> {
1966 let o = self.fbb_.end_table(self.start_);
1967 ::flatbuffers::WIPOffset::new(o.value())
1968 }
1969}
1970
1971impl ::core::fmt::Debug for LayoutStyle<'_> {
1972 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1973 let mut ds = f.debug_struct("LayoutStyle");
1974 ds.field("display", &self.display());
1975 ds.field("position", &self.position());
1976 ds.field("flex_direction", &self.flex_direction());
1977 ds.field("flex_wrap", &self.flex_wrap());
1978 ds.field("flex_grow", &self.flex_grow());
1979 ds.field("flex_shrink", &self.flex_shrink());
1980 ds.field("justify_content", &self.justify_content());
1981 ds.field("align_items", &self.align_items());
1982 ds.field("width", &self.width());
1983 ds.field("height", &self.height());
1984 ds.field("min_width", &self.min_width());
1985 ds.field("min_height", &self.min_height());
1986 ds.field("max_width", &self.max_width());
1987 ds.field("max_height", &self.max_height());
1988 ds.field("aspect_ratio", &self.aspect_ratio());
1989 ds.field("margin", &self.margin());
1990 ds.field("padding", &self.padding());
1991 ds.field("gap", &self.gap());
1992 ds.field("overflow", &self.overflow());
1993 ds.finish()
1994 }
1995}
1996pub enum StringValOffset {}
1997#[derive(Copy, Clone, PartialEq)]
1998
1999pub struct StringVal<'a> {
2000 pub _tab: ::flatbuffers::Table<'a>,
2001}
2002
2003impl<'a> ::flatbuffers::Follow<'a> for StringVal<'a> {
2004 type Inner = StringVal<'a>;
2005 #[inline]
2006 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2007 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
2008 }
2009}
2010
2011impl<'a> StringVal<'a> {
2012 pub const VT_VALUE: ::flatbuffers::VOffsetT = 4;
2013
2014 #[inline]
2015 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
2016 StringVal { _tab: table }
2017 }
2018 #[allow(unused_mut)]
2019 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
2020 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
2021 args: &'args StringValArgs<'args>
2022 ) -> ::flatbuffers::WIPOffset<StringVal<'bldr>> {
2023 let mut builder = StringValBuilder::new(_fbb);
2024 if let Some(x) = args.value { builder.add_value(x); }
2025 builder.finish()
2026 }
2027
2028
2029 #[inline]
2030 pub fn value(&self) -> Option<&'a str> {
2031 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(StringVal::VT_VALUE, None)}
2035 }
2036}
2037
2038impl ::flatbuffers::Verifiable for StringVal<'_> {
2039 #[inline]
2040 fn run_verifier(
2041 v: &mut ::flatbuffers::Verifier, pos: usize
2042 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
2043 v.visit_table(pos)?
2044 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("value", Self::VT_VALUE, false)?
2045 .finish();
2046 Ok(())
2047 }
2048}
2049pub struct StringValArgs<'a> {
2050 pub value: Option<::flatbuffers::WIPOffset<&'a str>>,
2051}
2052impl<'a> Default for StringValArgs<'a> {
2053 #[inline]
2054 fn default() -> Self {
2055 StringValArgs {
2056 value: None,
2057 }
2058 }
2059}
2060
2061pub struct StringValBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
2062 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
2063 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
2064}
2065impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> StringValBuilder<'a, 'b, A> {
2066 #[inline]
2067 pub fn add_value(&mut self, value: ::flatbuffers::WIPOffset<&'b str>) {
2068 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(StringVal::VT_VALUE, value);
2069 }
2070 #[inline]
2071 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> StringValBuilder<'a, 'b, A> {
2072 let start = _fbb.start_table();
2073 StringValBuilder {
2074 fbb_: _fbb,
2075 start_: start,
2076 }
2077 }
2078 #[inline]
2079 pub fn finish(self) -> ::flatbuffers::WIPOffset<StringVal<'a>> {
2080 let o = self.fbb_.end_table(self.start_);
2081 ::flatbuffers::WIPOffset::new(o.value())
2082 }
2083}
2084
2085impl ::core::fmt::Debug for StringVal<'_> {
2086 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2087 let mut ds = f.debug_struct("StringVal");
2088 ds.field("value", &self.value());
2089 ds.finish()
2090 }
2091}
2092pub enum FloatValOffset {}
2093#[derive(Copy, Clone, PartialEq)]
2094
2095pub struct FloatVal<'a> {
2096 pub _tab: ::flatbuffers::Table<'a>,
2097}
2098
2099impl<'a> ::flatbuffers::Follow<'a> for FloatVal<'a> {
2100 type Inner = FloatVal<'a>;
2101 #[inline]
2102 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2103 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
2104 }
2105}
2106
2107impl<'a> FloatVal<'a> {
2108 pub const VT_VALUE: ::flatbuffers::VOffsetT = 4;
2109
2110 #[inline]
2111 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
2112 FloatVal { _tab: table }
2113 }
2114 #[allow(unused_mut)]
2115 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
2116 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
2117 args: &'args FloatValArgs
2118 ) -> ::flatbuffers::WIPOffset<FloatVal<'bldr>> {
2119 let mut builder = FloatValBuilder::new(_fbb);
2120 builder.add_value(args.value);
2121 builder.finish()
2122 }
2123
2124
2125 #[inline]
2126 pub fn value(&self) -> f32 {
2127 unsafe { self._tab.get::<f32>(FloatVal::VT_VALUE, Some(0.0)).unwrap()}
2131 }
2132}
2133
2134impl ::flatbuffers::Verifiable for FloatVal<'_> {
2135 #[inline]
2136 fn run_verifier(
2137 v: &mut ::flatbuffers::Verifier, pos: usize
2138 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
2139 v.visit_table(pos)?
2140 .visit_field::<f32>("value", Self::VT_VALUE, false)?
2141 .finish();
2142 Ok(())
2143 }
2144}
2145pub struct FloatValArgs {
2146 pub value: f32,
2147}
2148impl<'a> Default for FloatValArgs {
2149 #[inline]
2150 fn default() -> Self {
2151 FloatValArgs {
2152 value: 0.0,
2153 }
2154 }
2155}
2156
2157pub struct FloatValBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
2158 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
2159 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
2160}
2161impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> FloatValBuilder<'a, 'b, A> {
2162 #[inline]
2163 pub fn add_value(&mut self, value: f32) {
2164 self.fbb_.push_slot::<f32>(FloatVal::VT_VALUE, value, 0.0);
2165 }
2166 #[inline]
2167 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> FloatValBuilder<'a, 'b, A> {
2168 let start = _fbb.start_table();
2169 FloatValBuilder {
2170 fbb_: _fbb,
2171 start_: start,
2172 }
2173 }
2174 #[inline]
2175 pub fn finish(self) -> ::flatbuffers::WIPOffset<FloatVal<'a>> {
2176 let o = self.fbb_.end_table(self.start_);
2177 ::flatbuffers::WIPOffset::new(o.value())
2178 }
2179}
2180
2181impl ::core::fmt::Debug for FloatVal<'_> {
2182 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2183 let mut ds = f.debug_struct("FloatVal");
2184 ds.field("value", &self.value());
2185 ds.finish()
2186 }
2187}
2188pub enum IntValOffset {}
2189#[derive(Copy, Clone, PartialEq)]
2190
2191pub struct IntVal<'a> {
2192 pub _tab: ::flatbuffers::Table<'a>,
2193}
2194
2195impl<'a> ::flatbuffers::Follow<'a> for IntVal<'a> {
2196 type Inner = IntVal<'a>;
2197 #[inline]
2198 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2199 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
2200 }
2201}
2202
2203impl<'a> IntVal<'a> {
2204 pub const VT_VALUE: ::flatbuffers::VOffsetT = 4;
2205
2206 #[inline]
2207 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
2208 IntVal { _tab: table }
2209 }
2210 #[allow(unused_mut)]
2211 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
2212 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
2213 args: &'args IntValArgs
2214 ) -> ::flatbuffers::WIPOffset<IntVal<'bldr>> {
2215 let mut builder = IntValBuilder::new(_fbb);
2216 builder.add_value(args.value);
2217 builder.finish()
2218 }
2219
2220
2221 #[inline]
2222 pub fn value(&self) -> i32 {
2223 unsafe { self._tab.get::<i32>(IntVal::VT_VALUE, Some(0)).unwrap()}
2227 }
2228}
2229
2230impl ::flatbuffers::Verifiable for IntVal<'_> {
2231 #[inline]
2232 fn run_verifier(
2233 v: &mut ::flatbuffers::Verifier, pos: usize
2234 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
2235 v.visit_table(pos)?
2236 .visit_field::<i32>("value", Self::VT_VALUE, false)?
2237 .finish();
2238 Ok(())
2239 }
2240}
2241pub struct IntValArgs {
2242 pub value: i32,
2243}
2244impl<'a> Default for IntValArgs {
2245 #[inline]
2246 fn default() -> Self {
2247 IntValArgs {
2248 value: 0,
2249 }
2250 }
2251}
2252
2253pub struct IntValBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
2254 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
2255 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
2256}
2257impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> IntValBuilder<'a, 'b, A> {
2258 #[inline]
2259 pub fn add_value(&mut self, value: i32) {
2260 self.fbb_.push_slot::<i32>(IntVal::VT_VALUE, value, 0);
2261 }
2262 #[inline]
2263 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> IntValBuilder<'a, 'b, A> {
2264 let start = _fbb.start_table();
2265 IntValBuilder {
2266 fbb_: _fbb,
2267 start_: start,
2268 }
2269 }
2270 #[inline]
2271 pub fn finish(self) -> ::flatbuffers::WIPOffset<IntVal<'a>> {
2272 let o = self.fbb_.end_table(self.start_);
2273 ::flatbuffers::WIPOffset::new(o.value())
2274 }
2275}
2276
2277impl ::core::fmt::Debug for IntVal<'_> {
2278 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2279 let mut ds = f.debug_struct("IntVal");
2280 ds.field("value", &self.value());
2281 ds.finish()
2282 }
2283}
2284pub enum BoolValOffset {}
2285#[derive(Copy, Clone, PartialEq)]
2286
2287pub struct BoolVal<'a> {
2288 pub _tab: ::flatbuffers::Table<'a>,
2289}
2290
2291impl<'a> ::flatbuffers::Follow<'a> for BoolVal<'a> {
2292 type Inner = BoolVal<'a>;
2293 #[inline]
2294 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2295 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
2296 }
2297}
2298
2299impl<'a> BoolVal<'a> {
2300 pub const VT_VALUE: ::flatbuffers::VOffsetT = 4;
2301
2302 #[inline]
2303 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
2304 BoolVal { _tab: table }
2305 }
2306 #[allow(unused_mut)]
2307 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
2308 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
2309 args: &'args BoolValArgs
2310 ) -> ::flatbuffers::WIPOffset<BoolVal<'bldr>> {
2311 let mut builder = BoolValBuilder::new(_fbb);
2312 builder.add_value(args.value);
2313 builder.finish()
2314 }
2315
2316
2317 #[inline]
2318 pub fn value(&self) -> bool {
2319 unsafe { self._tab.get::<bool>(BoolVal::VT_VALUE, Some(false)).unwrap()}
2323 }
2324}
2325
2326impl ::flatbuffers::Verifiable for BoolVal<'_> {
2327 #[inline]
2328 fn run_verifier(
2329 v: &mut ::flatbuffers::Verifier, pos: usize
2330 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
2331 v.visit_table(pos)?
2332 .visit_field::<bool>("value", Self::VT_VALUE, false)?
2333 .finish();
2334 Ok(())
2335 }
2336}
2337pub struct BoolValArgs {
2338 pub value: bool,
2339}
2340impl<'a> Default for BoolValArgs {
2341 #[inline]
2342 fn default() -> Self {
2343 BoolValArgs {
2344 value: false,
2345 }
2346 }
2347}
2348
2349pub struct BoolValBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
2350 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
2351 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
2352}
2353impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> BoolValBuilder<'a, 'b, A> {
2354 #[inline]
2355 pub fn add_value(&mut self, value: bool) {
2356 self.fbb_.push_slot::<bool>(BoolVal::VT_VALUE, value, false);
2357 }
2358 #[inline]
2359 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> BoolValBuilder<'a, 'b, A> {
2360 let start = _fbb.start_table();
2361 BoolValBuilder {
2362 fbb_: _fbb,
2363 start_: start,
2364 }
2365 }
2366 #[inline]
2367 pub fn finish(self) -> ::flatbuffers::WIPOffset<BoolVal<'a>> {
2368 let o = self.fbb_.end_table(self.start_);
2369 ::flatbuffers::WIPOffset::new(o.value())
2370 }
2371}
2372
2373impl ::core::fmt::Debug for BoolVal<'_> {
2374 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2375 let mut ds = f.debug_struct("BoolVal");
2376 ds.field("value", &self.value());
2377 ds.finish()
2378 }
2379}
2380pub enum ColorValOffset {}
2381#[derive(Copy, Clone, PartialEq)]
2382
2383pub struct ColorVal<'a> {
2384 pub _tab: ::flatbuffers::Table<'a>,
2385}
2386
2387impl<'a> ::flatbuffers::Follow<'a> for ColorVal<'a> {
2388 type Inner = ColorVal<'a>;
2389 #[inline]
2390 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2391 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
2392 }
2393}
2394
2395impl<'a> ColorVal<'a> {
2396 pub const VT_VALUE: ::flatbuffers::VOffsetT = 4;
2397
2398 #[inline]
2399 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
2400 ColorVal { _tab: table }
2401 }
2402 #[allow(unused_mut)]
2403 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
2404 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
2405 args: &'args ColorValArgs<'args>
2406 ) -> ::flatbuffers::WIPOffset<ColorVal<'bldr>> {
2407 let mut builder = ColorValBuilder::new(_fbb);
2408 if let Some(x) = args.value { builder.add_value(x); }
2409 builder.finish()
2410 }
2411
2412
2413 #[inline]
2414 pub fn value(&self) -> Option<&'a Color> {
2415 unsafe { self._tab.get::<Color>(ColorVal::VT_VALUE, None)}
2419 }
2420}
2421
2422impl ::flatbuffers::Verifiable for ColorVal<'_> {
2423 #[inline]
2424 fn run_verifier(
2425 v: &mut ::flatbuffers::Verifier, pos: usize
2426 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
2427 v.visit_table(pos)?
2428 .visit_field::<Color>("value", Self::VT_VALUE, false)?
2429 .finish();
2430 Ok(())
2431 }
2432}
2433pub struct ColorValArgs<'a> {
2434 pub value: Option<&'a Color>,
2435}
2436impl<'a> Default for ColorValArgs<'a> {
2437 #[inline]
2438 fn default() -> Self {
2439 ColorValArgs {
2440 value: None,
2441 }
2442 }
2443}
2444
2445pub struct ColorValBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
2446 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
2447 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
2448}
2449impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ColorValBuilder<'a, 'b, A> {
2450 #[inline]
2451 pub fn add_value(&mut self, value: &Color) {
2452 self.fbb_.push_slot_always::<&Color>(ColorVal::VT_VALUE, value);
2453 }
2454 #[inline]
2455 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ColorValBuilder<'a, 'b, A> {
2456 let start = _fbb.start_table();
2457 ColorValBuilder {
2458 fbb_: _fbb,
2459 start_: start,
2460 }
2461 }
2462 #[inline]
2463 pub fn finish(self) -> ::flatbuffers::WIPOffset<ColorVal<'a>> {
2464 let o = self.fbb_.end_table(self.start_);
2465 ::flatbuffers::WIPOffset::new(o.value())
2466 }
2467}
2468
2469impl ::core::fmt::Debug for ColorVal<'_> {
2470 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2471 let mut ds = f.debug_struct("ColorVal");
2472 ds.field("value", &self.value());
2473 ds.finish()
2474 }
2475}
2476pub enum PropEntryOffset {}
2477#[derive(Copy, Clone, PartialEq)]
2478
2479pub struct PropEntry<'a> {
2480 pub _tab: ::flatbuffers::Table<'a>,
2481}
2482
2483impl<'a> ::flatbuffers::Follow<'a> for PropEntry<'a> {
2484 type Inner = PropEntry<'a>;
2485 #[inline]
2486 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2487 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
2488 }
2489}
2490
2491impl<'a> PropEntry<'a> {
2492 pub const VT_KEY: ::flatbuffers::VOffsetT = 4;
2493 pub const VT_VALUE_TYPE: ::flatbuffers::VOffsetT = 6;
2494 pub const VT_VALUE: ::flatbuffers::VOffsetT = 8;
2495
2496 #[inline]
2497 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
2498 PropEntry { _tab: table }
2499 }
2500 #[allow(unused_mut)]
2501 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
2502 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
2503 args: &'args PropEntryArgs<'args>
2504 ) -> ::flatbuffers::WIPOffset<PropEntry<'bldr>> {
2505 let mut builder = PropEntryBuilder::new(_fbb);
2506 if let Some(x) = args.value { builder.add_value(x); }
2507 if let Some(x) = args.key { builder.add_key(x); }
2508 builder.add_value_type(args.value_type);
2509 builder.finish()
2510 }
2511
2512
2513 #[inline]
2514 pub fn key(&self) -> &'a str {
2515 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(PropEntry::VT_KEY, None).unwrap()}
2519 }
2520 #[inline]
2521 pub fn value_type(&self) -> PropValueUnion {
2522 unsafe { self._tab.get::<PropValueUnion>(PropEntry::VT_VALUE_TYPE, Some(PropValueUnion::NONE)).unwrap()}
2526 }
2527 #[inline]
2528 pub fn value(&self) -> Option<::flatbuffers::Table<'a>> {
2529 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Table<'a>>>(PropEntry::VT_VALUE, None)}
2533 }
2534 #[inline]
2535 #[allow(non_snake_case)]
2536 pub fn value_as_string_val(&self) -> Option<StringVal<'a>> {
2537 if self.value_type() == PropValueUnion::StringVal {
2538 self.value().map(|t| {
2539 unsafe { StringVal::init_from_table(t) }
2543 })
2544 } else {
2545 None
2546 }
2547 }
2548
2549 #[inline]
2550 #[allow(non_snake_case)]
2551 pub fn value_as_float_val(&self) -> Option<FloatVal<'a>> {
2552 if self.value_type() == PropValueUnion::FloatVal {
2553 self.value().map(|t| {
2554 unsafe { FloatVal::init_from_table(t) }
2558 })
2559 } else {
2560 None
2561 }
2562 }
2563
2564 #[inline]
2565 #[allow(non_snake_case)]
2566 pub fn value_as_int_val(&self) -> Option<IntVal<'a>> {
2567 if self.value_type() == PropValueUnion::IntVal {
2568 self.value().map(|t| {
2569 unsafe { IntVal::init_from_table(t) }
2573 })
2574 } else {
2575 None
2576 }
2577 }
2578
2579 #[inline]
2580 #[allow(non_snake_case)]
2581 pub fn value_as_bool_val(&self) -> Option<BoolVal<'a>> {
2582 if self.value_type() == PropValueUnion::BoolVal {
2583 self.value().map(|t| {
2584 unsafe { BoolVal::init_from_table(t) }
2588 })
2589 } else {
2590 None
2591 }
2592 }
2593
2594 #[inline]
2595 #[allow(non_snake_case)]
2596 pub fn value_as_color_val(&self) -> Option<ColorVal<'a>> {
2597 if self.value_type() == PropValueUnion::ColorVal {
2598 self.value().map(|t| {
2599 unsafe { ColorVal::init_from_table(t) }
2603 })
2604 } else {
2605 None
2606 }
2607 }
2608
2609}
2610
2611impl ::flatbuffers::Verifiable for PropEntry<'_> {
2612 #[inline]
2613 fn run_verifier(
2614 v: &mut ::flatbuffers::Verifier, pos: usize
2615 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
2616 v.visit_table(pos)?
2617 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("key", Self::VT_KEY, true)?
2618 .visit_union::<PropValueUnion, _>("value_type", Self::VT_VALUE_TYPE, "value", Self::VT_VALUE, false, |key, v, pos| {
2619 match key {
2620 PropValueUnion::StringVal => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<StringVal>>("PropValueUnion::StringVal", pos),
2621 PropValueUnion::FloatVal => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<FloatVal>>("PropValueUnion::FloatVal", pos),
2622 PropValueUnion::IntVal => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<IntVal>>("PropValueUnion::IntVal", pos),
2623 PropValueUnion::BoolVal => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<BoolVal>>("PropValueUnion::BoolVal", pos),
2624 PropValueUnion::ColorVal => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<ColorVal>>("PropValueUnion::ColorVal", pos),
2625 _ => Ok(()),
2626 }
2627 })?
2628 .finish();
2629 Ok(())
2630 }
2631}
2632pub struct PropEntryArgs<'a> {
2633 pub key: Option<::flatbuffers::WIPOffset<&'a str>>,
2634 pub value_type: PropValueUnion,
2635 pub value: Option<::flatbuffers::WIPOffset<::flatbuffers::UnionWIPOffset>>,
2636}
2637impl<'a> Default for PropEntryArgs<'a> {
2638 #[inline]
2639 fn default() -> Self {
2640 PropEntryArgs {
2641 key: None, value_type: PropValueUnion::NONE,
2643 value: None,
2644 }
2645 }
2646}
2647
2648pub struct PropEntryBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
2649 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
2650 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
2651}
2652impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> PropEntryBuilder<'a, 'b, A> {
2653 #[inline]
2654 pub fn add_key(&mut self, key: ::flatbuffers::WIPOffset<&'b str>) {
2655 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(PropEntry::VT_KEY, key);
2656 }
2657 #[inline]
2658 pub fn add_value_type(&mut self, value_type: PropValueUnion) {
2659 self.fbb_.push_slot::<PropValueUnion>(PropEntry::VT_VALUE_TYPE, value_type, PropValueUnion::NONE);
2660 }
2661 #[inline]
2662 pub fn add_value(&mut self, value: ::flatbuffers::WIPOffset<::flatbuffers::UnionWIPOffset>) {
2663 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(PropEntry::VT_VALUE, value);
2664 }
2665 #[inline]
2666 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> PropEntryBuilder<'a, 'b, A> {
2667 let start = _fbb.start_table();
2668 PropEntryBuilder {
2669 fbb_: _fbb,
2670 start_: start,
2671 }
2672 }
2673 #[inline]
2674 pub fn finish(self) -> ::flatbuffers::WIPOffset<PropEntry<'a>> {
2675 let o = self.fbb_.end_table(self.start_);
2676 self.fbb_.required(o, PropEntry::VT_KEY,"key");
2677 ::flatbuffers::WIPOffset::new(o.value())
2678 }
2679}
2680
2681impl ::core::fmt::Debug for PropEntry<'_> {
2682 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2683 let mut ds = f.debug_struct("PropEntry");
2684 ds.field("key", &self.key());
2685 ds.field("value_type", &self.value_type());
2686 match self.value_type() {
2687 PropValueUnion::StringVal => {
2688 if let Some(x) = self.value_as_string_val() {
2689 ds.field("value", &x)
2690 } else {
2691 ds.field("value", &"InvalidFlatbuffer: Union discriminant does not match value.")
2692 }
2693 },
2694 PropValueUnion::FloatVal => {
2695 if let Some(x) = self.value_as_float_val() {
2696 ds.field("value", &x)
2697 } else {
2698 ds.field("value", &"InvalidFlatbuffer: Union discriminant does not match value.")
2699 }
2700 },
2701 PropValueUnion::IntVal => {
2702 if let Some(x) = self.value_as_int_val() {
2703 ds.field("value", &x)
2704 } else {
2705 ds.field("value", &"InvalidFlatbuffer: Union discriminant does not match value.")
2706 }
2707 },
2708 PropValueUnion::BoolVal => {
2709 if let Some(x) = self.value_as_bool_val() {
2710 ds.field("value", &x)
2711 } else {
2712 ds.field("value", &"InvalidFlatbuffer: Union discriminant does not match value.")
2713 }
2714 },
2715 PropValueUnion::ColorVal => {
2716 if let Some(x) = self.value_as_color_val() {
2717 ds.field("value", &x)
2718 } else {
2719 ds.field("value", &"InvalidFlatbuffer: Union discriminant does not match value.")
2720 }
2721 },
2722 _ => {
2723 let x: Option<()> = None;
2724 ds.field("value", &x)
2725 },
2726 };
2727 ds.finish()
2728 }
2729}
2730pub enum PropsDiffOffset {}
2731#[derive(Copy, Clone, PartialEq)]
2732
2733pub struct PropsDiff<'a> {
2734 pub _tab: ::flatbuffers::Table<'a>,
2735}
2736
2737impl<'a> ::flatbuffers::Follow<'a> for PropsDiff<'a> {
2738 type Inner = PropsDiff<'a>;
2739 #[inline]
2740 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2741 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
2742 }
2743}
2744
2745impl<'a> PropsDiff<'a> {
2746 pub const VT_CHANGES: ::flatbuffers::VOffsetT = 4;
2747
2748 #[inline]
2749 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
2750 PropsDiff { _tab: table }
2751 }
2752 #[allow(unused_mut)]
2753 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
2754 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
2755 args: &'args PropsDiffArgs<'args>
2756 ) -> ::flatbuffers::WIPOffset<PropsDiff<'bldr>> {
2757 let mut builder = PropsDiffBuilder::new(_fbb);
2758 if let Some(x) = args.changes { builder.add_changes(x); }
2759 builder.finish()
2760 }
2761
2762
2763 #[inline]
2764 pub fn changes(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<PropEntry<'a>>>> {
2765 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<PropEntry>>>>(PropsDiff::VT_CHANGES, None)}
2769 }
2770}
2771
2772impl ::flatbuffers::Verifiable for PropsDiff<'_> {
2773 #[inline]
2774 fn run_verifier(
2775 v: &mut ::flatbuffers::Verifier, pos: usize
2776 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
2777 v.visit_table(pos)?
2778 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<PropEntry>>>>("changes", Self::VT_CHANGES, false)?
2779 .finish();
2780 Ok(())
2781 }
2782}
2783pub struct PropsDiffArgs<'a> {
2784 pub changes: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<PropEntry<'a>>>>>,
2785}
2786impl<'a> Default for PropsDiffArgs<'a> {
2787 #[inline]
2788 fn default() -> Self {
2789 PropsDiffArgs {
2790 changes: None,
2791 }
2792 }
2793}
2794
2795pub struct PropsDiffBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
2796 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
2797 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
2798}
2799impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> PropsDiffBuilder<'a, 'b, A> {
2800 #[inline]
2801 pub fn add_changes(&mut self, changes: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<PropEntry<'b >>>>) {
2802 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(PropsDiff::VT_CHANGES, changes);
2803 }
2804 #[inline]
2805 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> PropsDiffBuilder<'a, 'b, A> {
2806 let start = _fbb.start_table();
2807 PropsDiffBuilder {
2808 fbb_: _fbb,
2809 start_: start,
2810 }
2811 }
2812 #[inline]
2813 pub fn finish(self) -> ::flatbuffers::WIPOffset<PropsDiff<'a>> {
2814 let o = self.fbb_.end_table(self.start_);
2815 ::flatbuffers::WIPOffset::new(o.value())
2816 }
2817}
2818
2819impl ::core::fmt::Debug for PropsDiff<'_> {
2820 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2821 let mut ds = f.debug_struct("PropsDiff");
2822 ds.field("changes", &self.changes());
2823 ds.finish()
2824 }
2825}
2826pub enum CreateNodeOffset {}
2827#[derive(Copy, Clone, PartialEq)]
2828
2829pub struct CreateNode<'a> {
2830 pub _tab: ::flatbuffers::Table<'a>,
2831}
2832
2833impl<'a> ::flatbuffers::Follow<'a> for CreateNode<'a> {
2834 type Inner = CreateNode<'a>;
2835 #[inline]
2836 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2837 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
2838 }
2839}
2840
2841impl<'a> CreateNode<'a> {
2842 pub const VT_ID: ::flatbuffers::VOffsetT = 4;
2843 pub const VT_VIEW_TYPE: ::flatbuffers::VOffsetT = 6;
2844 pub const VT_CUSTOM_TYPE: ::flatbuffers::VOffsetT = 8;
2845 pub const VT_PROPS: ::flatbuffers::VOffsetT = 10;
2846 pub const VT_STYLE: ::flatbuffers::VOffsetT = 12;
2847
2848 #[inline]
2849 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
2850 CreateNode { _tab: table }
2851 }
2852 #[allow(unused_mut)]
2853 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
2854 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
2855 args: &'args CreateNodeArgs<'args>
2856 ) -> ::flatbuffers::WIPOffset<CreateNode<'bldr>> {
2857 let mut builder = CreateNodeBuilder::new(_fbb);
2858 builder.add_id(args.id);
2859 if let Some(x) = args.style { builder.add_style(x); }
2860 if let Some(x) = args.props { builder.add_props(x); }
2861 if let Some(x) = args.custom_type { builder.add_custom_type(x); }
2862 builder.add_view_type(args.view_type);
2863 builder.finish()
2864 }
2865
2866
2867 #[inline]
2868 pub fn id(&self) -> u64 {
2869 unsafe { self._tab.get::<u64>(CreateNode::VT_ID, Some(0)).unwrap()}
2873 }
2874 #[inline]
2875 pub fn view_type(&self) -> ViewType {
2876 unsafe { self._tab.get::<ViewType>(CreateNode::VT_VIEW_TYPE, Some(ViewType::Container)).unwrap()}
2880 }
2881 #[inline]
2882 pub fn custom_type(&self) -> Option<&'a str> {
2883 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(CreateNode::VT_CUSTOM_TYPE, None)}
2887 }
2888 #[inline]
2889 pub fn props(&self) -> Option<PropsDiff<'a>> {
2890 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<PropsDiff>>(CreateNode::VT_PROPS, None)}
2894 }
2895 #[inline]
2896 pub fn style(&self) -> Option<LayoutStyle<'a>> {
2897 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<LayoutStyle>>(CreateNode::VT_STYLE, None)}
2901 }
2902}
2903
2904impl ::flatbuffers::Verifiable for CreateNode<'_> {
2905 #[inline]
2906 fn run_verifier(
2907 v: &mut ::flatbuffers::Verifier, pos: usize
2908 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
2909 v.visit_table(pos)?
2910 .visit_field::<u64>("id", Self::VT_ID, false)?
2911 .visit_field::<ViewType>("view_type", Self::VT_VIEW_TYPE, false)?
2912 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("custom_type", Self::VT_CUSTOM_TYPE, false)?
2913 .visit_field::<::flatbuffers::ForwardsUOffset<PropsDiff>>("props", Self::VT_PROPS, false)?
2914 .visit_field::<::flatbuffers::ForwardsUOffset<LayoutStyle>>("style", Self::VT_STYLE, false)?
2915 .finish();
2916 Ok(())
2917 }
2918}
2919pub struct CreateNodeArgs<'a> {
2920 pub id: u64,
2921 pub view_type: ViewType,
2922 pub custom_type: Option<::flatbuffers::WIPOffset<&'a str>>,
2923 pub props: Option<::flatbuffers::WIPOffset<PropsDiff<'a>>>,
2924 pub style: Option<::flatbuffers::WIPOffset<LayoutStyle<'a>>>,
2925}
2926impl<'a> Default for CreateNodeArgs<'a> {
2927 #[inline]
2928 fn default() -> Self {
2929 CreateNodeArgs {
2930 id: 0,
2931 view_type: ViewType::Container,
2932 custom_type: None,
2933 props: None,
2934 style: None,
2935 }
2936 }
2937}
2938
2939pub struct CreateNodeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
2940 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
2941 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
2942}
2943impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> CreateNodeBuilder<'a, 'b, A> {
2944 #[inline]
2945 pub fn add_id(&mut self, id: u64) {
2946 self.fbb_.push_slot::<u64>(CreateNode::VT_ID, id, 0);
2947 }
2948 #[inline]
2949 pub fn add_view_type(&mut self, view_type: ViewType) {
2950 self.fbb_.push_slot::<ViewType>(CreateNode::VT_VIEW_TYPE, view_type, ViewType::Container);
2951 }
2952 #[inline]
2953 pub fn add_custom_type(&mut self, custom_type: ::flatbuffers::WIPOffset<&'b str>) {
2954 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(CreateNode::VT_CUSTOM_TYPE, custom_type);
2955 }
2956 #[inline]
2957 pub fn add_props(&mut self, props: ::flatbuffers::WIPOffset<PropsDiff<'b >>) {
2958 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<PropsDiff>>(CreateNode::VT_PROPS, props);
2959 }
2960 #[inline]
2961 pub fn add_style(&mut self, style: ::flatbuffers::WIPOffset<LayoutStyle<'b >>) {
2962 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<LayoutStyle>>(CreateNode::VT_STYLE, style);
2963 }
2964 #[inline]
2965 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> CreateNodeBuilder<'a, 'b, A> {
2966 let start = _fbb.start_table();
2967 CreateNodeBuilder {
2968 fbb_: _fbb,
2969 start_: start,
2970 }
2971 }
2972 #[inline]
2973 pub fn finish(self) -> ::flatbuffers::WIPOffset<CreateNode<'a>> {
2974 let o = self.fbb_.end_table(self.start_);
2975 ::flatbuffers::WIPOffset::new(o.value())
2976 }
2977}
2978
2979impl ::core::fmt::Debug for CreateNode<'_> {
2980 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2981 let mut ds = f.debug_struct("CreateNode");
2982 ds.field("id", &self.id());
2983 ds.field("view_type", &self.view_type());
2984 ds.field("custom_type", &self.custom_type());
2985 ds.field("props", &self.props());
2986 ds.field("style", &self.style());
2987 ds.finish()
2988 }
2989}
2990pub enum UpdatePropsOffset {}
2991#[derive(Copy, Clone, PartialEq)]
2992
2993pub struct UpdateProps<'a> {
2994 pub _tab: ::flatbuffers::Table<'a>,
2995}
2996
2997impl<'a> ::flatbuffers::Follow<'a> for UpdateProps<'a> {
2998 type Inner = UpdateProps<'a>;
2999 #[inline]
3000 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3001 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
3002 }
3003}
3004
3005impl<'a> UpdateProps<'a> {
3006 pub const VT_ID: ::flatbuffers::VOffsetT = 4;
3007 pub const VT_DIFF: ::flatbuffers::VOffsetT = 6;
3008
3009 #[inline]
3010 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
3011 UpdateProps { _tab: table }
3012 }
3013 #[allow(unused_mut)]
3014 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
3015 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
3016 args: &'args UpdatePropsArgs<'args>
3017 ) -> ::flatbuffers::WIPOffset<UpdateProps<'bldr>> {
3018 let mut builder = UpdatePropsBuilder::new(_fbb);
3019 builder.add_id(args.id);
3020 if let Some(x) = args.diff { builder.add_diff(x); }
3021 builder.finish()
3022 }
3023
3024
3025 #[inline]
3026 pub fn id(&self) -> u64 {
3027 unsafe { self._tab.get::<u64>(UpdateProps::VT_ID, Some(0)).unwrap()}
3031 }
3032 #[inline]
3033 pub fn diff(&self) -> Option<PropsDiff<'a>> {
3034 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<PropsDiff>>(UpdateProps::VT_DIFF, None)}
3038 }
3039}
3040
3041impl ::flatbuffers::Verifiable for UpdateProps<'_> {
3042 #[inline]
3043 fn run_verifier(
3044 v: &mut ::flatbuffers::Verifier, pos: usize
3045 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
3046 v.visit_table(pos)?
3047 .visit_field::<u64>("id", Self::VT_ID, false)?
3048 .visit_field::<::flatbuffers::ForwardsUOffset<PropsDiff>>("diff", Self::VT_DIFF, false)?
3049 .finish();
3050 Ok(())
3051 }
3052}
3053pub struct UpdatePropsArgs<'a> {
3054 pub id: u64,
3055 pub diff: Option<::flatbuffers::WIPOffset<PropsDiff<'a>>>,
3056}
3057impl<'a> Default for UpdatePropsArgs<'a> {
3058 #[inline]
3059 fn default() -> Self {
3060 UpdatePropsArgs {
3061 id: 0,
3062 diff: None,
3063 }
3064 }
3065}
3066
3067pub struct UpdatePropsBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
3068 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
3069 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
3070}
3071impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> UpdatePropsBuilder<'a, 'b, A> {
3072 #[inline]
3073 pub fn add_id(&mut self, id: u64) {
3074 self.fbb_.push_slot::<u64>(UpdateProps::VT_ID, id, 0);
3075 }
3076 #[inline]
3077 pub fn add_diff(&mut self, diff: ::flatbuffers::WIPOffset<PropsDiff<'b >>) {
3078 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<PropsDiff>>(UpdateProps::VT_DIFF, diff);
3079 }
3080 #[inline]
3081 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> UpdatePropsBuilder<'a, 'b, A> {
3082 let start = _fbb.start_table();
3083 UpdatePropsBuilder {
3084 fbb_: _fbb,
3085 start_: start,
3086 }
3087 }
3088 #[inline]
3089 pub fn finish(self) -> ::flatbuffers::WIPOffset<UpdateProps<'a>> {
3090 let o = self.fbb_.end_table(self.start_);
3091 ::flatbuffers::WIPOffset::new(o.value())
3092 }
3093}
3094
3095impl ::core::fmt::Debug for UpdateProps<'_> {
3096 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3097 let mut ds = f.debug_struct("UpdateProps");
3098 ds.field("id", &self.id());
3099 ds.field("diff", &self.diff());
3100 ds.finish()
3101 }
3102}
3103pub enum UpdateStyleOffset {}
3104#[derive(Copy, Clone, PartialEq)]
3105
3106pub struct UpdateStyle<'a> {
3107 pub _tab: ::flatbuffers::Table<'a>,
3108}
3109
3110impl<'a> ::flatbuffers::Follow<'a> for UpdateStyle<'a> {
3111 type Inner = UpdateStyle<'a>;
3112 #[inline]
3113 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3114 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
3115 }
3116}
3117
3118impl<'a> UpdateStyle<'a> {
3119 pub const VT_ID: ::flatbuffers::VOffsetT = 4;
3120 pub const VT_STYLE: ::flatbuffers::VOffsetT = 6;
3121
3122 #[inline]
3123 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
3124 UpdateStyle { _tab: table }
3125 }
3126 #[allow(unused_mut)]
3127 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
3128 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
3129 args: &'args UpdateStyleArgs<'args>
3130 ) -> ::flatbuffers::WIPOffset<UpdateStyle<'bldr>> {
3131 let mut builder = UpdateStyleBuilder::new(_fbb);
3132 builder.add_id(args.id);
3133 if let Some(x) = args.style { builder.add_style(x); }
3134 builder.finish()
3135 }
3136
3137
3138 #[inline]
3139 pub fn id(&self) -> u64 {
3140 unsafe { self._tab.get::<u64>(UpdateStyle::VT_ID, Some(0)).unwrap()}
3144 }
3145 #[inline]
3146 pub fn style(&self) -> Option<LayoutStyle<'a>> {
3147 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<LayoutStyle>>(UpdateStyle::VT_STYLE, None)}
3151 }
3152}
3153
3154impl ::flatbuffers::Verifiable for UpdateStyle<'_> {
3155 #[inline]
3156 fn run_verifier(
3157 v: &mut ::flatbuffers::Verifier, pos: usize
3158 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
3159 v.visit_table(pos)?
3160 .visit_field::<u64>("id", Self::VT_ID, false)?
3161 .visit_field::<::flatbuffers::ForwardsUOffset<LayoutStyle>>("style", Self::VT_STYLE, false)?
3162 .finish();
3163 Ok(())
3164 }
3165}
3166pub struct UpdateStyleArgs<'a> {
3167 pub id: u64,
3168 pub style: Option<::flatbuffers::WIPOffset<LayoutStyle<'a>>>,
3169}
3170impl<'a> Default for UpdateStyleArgs<'a> {
3171 #[inline]
3172 fn default() -> Self {
3173 UpdateStyleArgs {
3174 id: 0,
3175 style: None,
3176 }
3177 }
3178}
3179
3180pub struct UpdateStyleBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
3181 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
3182 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
3183}
3184impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> UpdateStyleBuilder<'a, 'b, A> {
3185 #[inline]
3186 pub fn add_id(&mut self, id: u64) {
3187 self.fbb_.push_slot::<u64>(UpdateStyle::VT_ID, id, 0);
3188 }
3189 #[inline]
3190 pub fn add_style(&mut self, style: ::flatbuffers::WIPOffset<LayoutStyle<'b >>) {
3191 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<LayoutStyle>>(UpdateStyle::VT_STYLE, style);
3192 }
3193 #[inline]
3194 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> UpdateStyleBuilder<'a, 'b, A> {
3195 let start = _fbb.start_table();
3196 UpdateStyleBuilder {
3197 fbb_: _fbb,
3198 start_: start,
3199 }
3200 }
3201 #[inline]
3202 pub fn finish(self) -> ::flatbuffers::WIPOffset<UpdateStyle<'a>> {
3203 let o = self.fbb_.end_table(self.start_);
3204 ::flatbuffers::WIPOffset::new(o.value())
3205 }
3206}
3207
3208impl ::core::fmt::Debug for UpdateStyle<'_> {
3209 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3210 let mut ds = f.debug_struct("UpdateStyle");
3211 ds.field("id", &self.id());
3212 ds.field("style", &self.style());
3213 ds.finish()
3214 }
3215}
3216pub enum AppendChildOffset {}
3217#[derive(Copy, Clone, PartialEq)]
3218
3219pub struct AppendChild<'a> {
3220 pub _tab: ::flatbuffers::Table<'a>,
3221}
3222
3223impl<'a> ::flatbuffers::Follow<'a> for AppendChild<'a> {
3224 type Inner = AppendChild<'a>;
3225 #[inline]
3226 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3227 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
3228 }
3229}
3230
3231impl<'a> AppendChild<'a> {
3232 pub const VT_PARENT: ::flatbuffers::VOffsetT = 4;
3233 pub const VT_CHILD: ::flatbuffers::VOffsetT = 6;
3234
3235 #[inline]
3236 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
3237 AppendChild { _tab: table }
3238 }
3239 #[allow(unused_mut)]
3240 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
3241 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
3242 args: &'args AppendChildArgs
3243 ) -> ::flatbuffers::WIPOffset<AppendChild<'bldr>> {
3244 let mut builder = AppendChildBuilder::new(_fbb);
3245 builder.add_child(args.child);
3246 builder.add_parent(args.parent);
3247 builder.finish()
3248 }
3249
3250
3251 #[inline]
3252 pub fn parent(&self) -> u64 {
3253 unsafe { self._tab.get::<u64>(AppendChild::VT_PARENT, Some(0)).unwrap()}
3257 }
3258 #[inline]
3259 pub fn child(&self) -> u64 {
3260 unsafe { self._tab.get::<u64>(AppendChild::VT_CHILD, Some(0)).unwrap()}
3264 }
3265}
3266
3267impl ::flatbuffers::Verifiable for AppendChild<'_> {
3268 #[inline]
3269 fn run_verifier(
3270 v: &mut ::flatbuffers::Verifier, pos: usize
3271 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
3272 v.visit_table(pos)?
3273 .visit_field::<u64>("parent", Self::VT_PARENT, false)?
3274 .visit_field::<u64>("child", Self::VT_CHILD, false)?
3275 .finish();
3276 Ok(())
3277 }
3278}
3279pub struct AppendChildArgs {
3280 pub parent: u64,
3281 pub child: u64,
3282}
3283impl<'a> Default for AppendChildArgs {
3284 #[inline]
3285 fn default() -> Self {
3286 AppendChildArgs {
3287 parent: 0,
3288 child: 0,
3289 }
3290 }
3291}
3292
3293pub struct AppendChildBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
3294 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
3295 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
3296}
3297impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> AppendChildBuilder<'a, 'b, A> {
3298 #[inline]
3299 pub fn add_parent(&mut self, parent: u64) {
3300 self.fbb_.push_slot::<u64>(AppendChild::VT_PARENT, parent, 0);
3301 }
3302 #[inline]
3303 pub fn add_child(&mut self, child: u64) {
3304 self.fbb_.push_slot::<u64>(AppendChild::VT_CHILD, child, 0);
3305 }
3306 #[inline]
3307 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> AppendChildBuilder<'a, 'b, A> {
3308 let start = _fbb.start_table();
3309 AppendChildBuilder {
3310 fbb_: _fbb,
3311 start_: start,
3312 }
3313 }
3314 #[inline]
3315 pub fn finish(self) -> ::flatbuffers::WIPOffset<AppendChild<'a>> {
3316 let o = self.fbb_.end_table(self.start_);
3317 ::flatbuffers::WIPOffset::new(o.value())
3318 }
3319}
3320
3321impl ::core::fmt::Debug for AppendChild<'_> {
3322 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3323 let mut ds = f.debug_struct("AppendChild");
3324 ds.field("parent", &self.parent());
3325 ds.field("child", &self.child());
3326 ds.finish()
3327 }
3328}
3329pub enum InsertBeforeOffset {}
3330#[derive(Copy, Clone, PartialEq)]
3331
3332pub struct InsertBefore<'a> {
3333 pub _tab: ::flatbuffers::Table<'a>,
3334}
3335
3336impl<'a> ::flatbuffers::Follow<'a> for InsertBefore<'a> {
3337 type Inner = InsertBefore<'a>;
3338 #[inline]
3339 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3340 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
3341 }
3342}
3343
3344impl<'a> InsertBefore<'a> {
3345 pub const VT_PARENT: ::flatbuffers::VOffsetT = 4;
3346 pub const VT_CHILD: ::flatbuffers::VOffsetT = 6;
3347 pub const VT_BEFORE: ::flatbuffers::VOffsetT = 8;
3348
3349 #[inline]
3350 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
3351 InsertBefore { _tab: table }
3352 }
3353 #[allow(unused_mut)]
3354 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
3355 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
3356 args: &'args InsertBeforeArgs
3357 ) -> ::flatbuffers::WIPOffset<InsertBefore<'bldr>> {
3358 let mut builder = InsertBeforeBuilder::new(_fbb);
3359 builder.add_before(args.before);
3360 builder.add_child(args.child);
3361 builder.add_parent(args.parent);
3362 builder.finish()
3363 }
3364
3365
3366 #[inline]
3367 pub fn parent(&self) -> u64 {
3368 unsafe { self._tab.get::<u64>(InsertBefore::VT_PARENT, Some(0)).unwrap()}
3372 }
3373 #[inline]
3374 pub fn child(&self) -> u64 {
3375 unsafe { self._tab.get::<u64>(InsertBefore::VT_CHILD, Some(0)).unwrap()}
3379 }
3380 #[inline]
3381 pub fn before(&self) -> u64 {
3382 unsafe { self._tab.get::<u64>(InsertBefore::VT_BEFORE, Some(0)).unwrap()}
3386 }
3387}
3388
3389impl ::flatbuffers::Verifiable for InsertBefore<'_> {
3390 #[inline]
3391 fn run_verifier(
3392 v: &mut ::flatbuffers::Verifier, pos: usize
3393 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
3394 v.visit_table(pos)?
3395 .visit_field::<u64>("parent", Self::VT_PARENT, false)?
3396 .visit_field::<u64>("child", Self::VT_CHILD, false)?
3397 .visit_field::<u64>("before", Self::VT_BEFORE, false)?
3398 .finish();
3399 Ok(())
3400 }
3401}
3402pub struct InsertBeforeArgs {
3403 pub parent: u64,
3404 pub child: u64,
3405 pub before: u64,
3406}
3407impl<'a> Default for InsertBeforeArgs {
3408 #[inline]
3409 fn default() -> Self {
3410 InsertBeforeArgs {
3411 parent: 0,
3412 child: 0,
3413 before: 0,
3414 }
3415 }
3416}
3417
3418pub struct InsertBeforeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
3419 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
3420 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
3421}
3422impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> InsertBeforeBuilder<'a, 'b, A> {
3423 #[inline]
3424 pub fn add_parent(&mut self, parent: u64) {
3425 self.fbb_.push_slot::<u64>(InsertBefore::VT_PARENT, parent, 0);
3426 }
3427 #[inline]
3428 pub fn add_child(&mut self, child: u64) {
3429 self.fbb_.push_slot::<u64>(InsertBefore::VT_CHILD, child, 0);
3430 }
3431 #[inline]
3432 pub fn add_before(&mut self, before: u64) {
3433 self.fbb_.push_slot::<u64>(InsertBefore::VT_BEFORE, before, 0);
3434 }
3435 #[inline]
3436 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> InsertBeforeBuilder<'a, 'b, A> {
3437 let start = _fbb.start_table();
3438 InsertBeforeBuilder {
3439 fbb_: _fbb,
3440 start_: start,
3441 }
3442 }
3443 #[inline]
3444 pub fn finish(self) -> ::flatbuffers::WIPOffset<InsertBefore<'a>> {
3445 let o = self.fbb_.end_table(self.start_);
3446 ::flatbuffers::WIPOffset::new(o.value())
3447 }
3448}
3449
3450impl ::core::fmt::Debug for InsertBefore<'_> {
3451 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3452 let mut ds = f.debug_struct("InsertBefore");
3453 ds.field("parent", &self.parent());
3454 ds.field("child", &self.child());
3455 ds.field("before", &self.before());
3456 ds.finish()
3457 }
3458}
3459pub enum RemoveChildOffset {}
3460#[derive(Copy, Clone, PartialEq)]
3461
3462pub struct RemoveChild<'a> {
3463 pub _tab: ::flatbuffers::Table<'a>,
3464}
3465
3466impl<'a> ::flatbuffers::Follow<'a> for RemoveChild<'a> {
3467 type Inner = RemoveChild<'a>;
3468 #[inline]
3469 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3470 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
3471 }
3472}
3473
3474impl<'a> RemoveChild<'a> {
3475 pub const VT_PARENT: ::flatbuffers::VOffsetT = 4;
3476 pub const VT_CHILD: ::flatbuffers::VOffsetT = 6;
3477
3478 #[inline]
3479 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
3480 RemoveChild { _tab: table }
3481 }
3482 #[allow(unused_mut)]
3483 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
3484 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
3485 args: &'args RemoveChildArgs
3486 ) -> ::flatbuffers::WIPOffset<RemoveChild<'bldr>> {
3487 let mut builder = RemoveChildBuilder::new(_fbb);
3488 builder.add_child(args.child);
3489 builder.add_parent(args.parent);
3490 builder.finish()
3491 }
3492
3493
3494 #[inline]
3495 pub fn parent(&self) -> u64 {
3496 unsafe { self._tab.get::<u64>(RemoveChild::VT_PARENT, Some(0)).unwrap()}
3500 }
3501 #[inline]
3502 pub fn child(&self) -> u64 {
3503 unsafe { self._tab.get::<u64>(RemoveChild::VT_CHILD, Some(0)).unwrap()}
3507 }
3508}
3509
3510impl ::flatbuffers::Verifiable for RemoveChild<'_> {
3511 #[inline]
3512 fn run_verifier(
3513 v: &mut ::flatbuffers::Verifier, pos: usize
3514 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
3515 v.visit_table(pos)?
3516 .visit_field::<u64>("parent", Self::VT_PARENT, false)?
3517 .visit_field::<u64>("child", Self::VT_CHILD, false)?
3518 .finish();
3519 Ok(())
3520 }
3521}
3522pub struct RemoveChildArgs {
3523 pub parent: u64,
3524 pub child: u64,
3525}
3526impl<'a> Default for RemoveChildArgs {
3527 #[inline]
3528 fn default() -> Self {
3529 RemoveChildArgs {
3530 parent: 0,
3531 child: 0,
3532 }
3533 }
3534}
3535
3536pub struct RemoveChildBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
3537 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
3538 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
3539}
3540impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> RemoveChildBuilder<'a, 'b, A> {
3541 #[inline]
3542 pub fn add_parent(&mut self, parent: u64) {
3543 self.fbb_.push_slot::<u64>(RemoveChild::VT_PARENT, parent, 0);
3544 }
3545 #[inline]
3546 pub fn add_child(&mut self, child: u64) {
3547 self.fbb_.push_slot::<u64>(RemoveChild::VT_CHILD, child, 0);
3548 }
3549 #[inline]
3550 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> RemoveChildBuilder<'a, 'b, A> {
3551 let start = _fbb.start_table();
3552 RemoveChildBuilder {
3553 fbb_: _fbb,
3554 start_: start,
3555 }
3556 }
3557 #[inline]
3558 pub fn finish(self) -> ::flatbuffers::WIPOffset<RemoveChild<'a>> {
3559 let o = self.fbb_.end_table(self.start_);
3560 ::flatbuffers::WIPOffset::new(o.value())
3561 }
3562}
3563
3564impl ::core::fmt::Debug for RemoveChild<'_> {
3565 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3566 let mut ds = f.debug_struct("RemoveChild");
3567 ds.field("parent", &self.parent());
3568 ds.field("child", &self.child());
3569 ds.finish()
3570 }
3571}
3572pub enum SetRootOffset {}
3573#[derive(Copy, Clone, PartialEq)]
3574
3575pub struct SetRoot<'a> {
3576 pub _tab: ::flatbuffers::Table<'a>,
3577}
3578
3579impl<'a> ::flatbuffers::Follow<'a> for SetRoot<'a> {
3580 type Inner = SetRoot<'a>;
3581 #[inline]
3582 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3583 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
3584 }
3585}
3586
3587impl<'a> SetRoot<'a> {
3588 pub const VT_ID: ::flatbuffers::VOffsetT = 4;
3589
3590 #[inline]
3591 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
3592 SetRoot { _tab: table }
3593 }
3594 #[allow(unused_mut)]
3595 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
3596 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
3597 args: &'args SetRootArgs
3598 ) -> ::flatbuffers::WIPOffset<SetRoot<'bldr>> {
3599 let mut builder = SetRootBuilder::new(_fbb);
3600 builder.add_id(args.id);
3601 builder.finish()
3602 }
3603
3604
3605 #[inline]
3606 pub fn id(&self) -> u64 {
3607 unsafe { self._tab.get::<u64>(SetRoot::VT_ID, Some(0)).unwrap()}
3611 }
3612}
3613
3614impl ::flatbuffers::Verifiable for SetRoot<'_> {
3615 #[inline]
3616 fn run_verifier(
3617 v: &mut ::flatbuffers::Verifier, pos: usize
3618 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
3619 v.visit_table(pos)?
3620 .visit_field::<u64>("id", Self::VT_ID, false)?
3621 .finish();
3622 Ok(())
3623 }
3624}
3625pub struct SetRootArgs {
3626 pub id: u64,
3627}
3628impl<'a> Default for SetRootArgs {
3629 #[inline]
3630 fn default() -> Self {
3631 SetRootArgs {
3632 id: 0,
3633 }
3634 }
3635}
3636
3637pub struct SetRootBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
3638 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
3639 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
3640}
3641impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> SetRootBuilder<'a, 'b, A> {
3642 #[inline]
3643 pub fn add_id(&mut self, id: u64) {
3644 self.fbb_.push_slot::<u64>(SetRoot::VT_ID, id, 0);
3645 }
3646 #[inline]
3647 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> SetRootBuilder<'a, 'b, A> {
3648 let start = _fbb.start_table();
3649 SetRootBuilder {
3650 fbb_: _fbb,
3651 start_: start,
3652 }
3653 }
3654 #[inline]
3655 pub fn finish(self) -> ::flatbuffers::WIPOffset<SetRoot<'a>> {
3656 let o = self.fbb_.end_table(self.start_);
3657 ::flatbuffers::WIPOffset::new(o.value())
3658 }
3659}
3660
3661impl ::core::fmt::Debug for SetRoot<'_> {
3662 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3663 let mut ds = f.debug_struct("SetRoot");
3664 ds.field("id", &self.id());
3665 ds.finish()
3666 }
3667}
3668pub enum IrCommandOffset {}
3669#[derive(Copy, Clone, PartialEq)]
3670
3671pub struct IrCommand<'a> {
3672 pub _tab: ::flatbuffers::Table<'a>,
3673}
3674
3675impl<'a> ::flatbuffers::Follow<'a> for IrCommand<'a> {
3676 type Inner = IrCommand<'a>;
3677 #[inline]
3678 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3679 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
3680 }
3681}
3682
3683impl<'a> IrCommand<'a> {
3684 pub const VT_CMD_TYPE: ::flatbuffers::VOffsetT = 4;
3685 pub const VT_CMD: ::flatbuffers::VOffsetT = 6;
3686
3687 #[inline]
3688 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
3689 IrCommand { _tab: table }
3690 }
3691 #[allow(unused_mut)]
3692 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
3693 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
3694 args: &'args IrCommandArgs
3695 ) -> ::flatbuffers::WIPOffset<IrCommand<'bldr>> {
3696 let mut builder = IrCommandBuilder::new(_fbb);
3697 if let Some(x) = args.cmd { builder.add_cmd(x); }
3698 builder.add_cmd_type(args.cmd_type);
3699 builder.finish()
3700 }
3701
3702
3703 #[inline]
3704 pub fn cmd_type(&self) -> Command {
3705 unsafe { self._tab.get::<Command>(IrCommand::VT_CMD_TYPE, Some(Command::NONE)).unwrap()}
3709 }
3710 #[inline]
3711 pub fn cmd(&self) -> Option<::flatbuffers::Table<'a>> {
3712 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Table<'a>>>(IrCommand::VT_CMD, None)}
3716 }
3717 #[inline]
3718 #[allow(non_snake_case)]
3719 pub fn cmd_as_create_node(&self) -> Option<CreateNode<'a>> {
3720 if self.cmd_type() == Command::CreateNode {
3721 self.cmd().map(|t| {
3722 unsafe { CreateNode::init_from_table(t) }
3726 })
3727 } else {
3728 None
3729 }
3730 }
3731
3732 #[inline]
3733 #[allow(non_snake_case)]
3734 pub fn cmd_as_update_props(&self) -> Option<UpdateProps<'a>> {
3735 if self.cmd_type() == Command::UpdateProps {
3736 self.cmd().map(|t| {
3737 unsafe { UpdateProps::init_from_table(t) }
3741 })
3742 } else {
3743 None
3744 }
3745 }
3746
3747 #[inline]
3748 #[allow(non_snake_case)]
3749 pub fn cmd_as_update_style(&self) -> Option<UpdateStyle<'a>> {
3750 if self.cmd_type() == Command::UpdateStyle {
3751 self.cmd().map(|t| {
3752 unsafe { UpdateStyle::init_from_table(t) }
3756 })
3757 } else {
3758 None
3759 }
3760 }
3761
3762 #[inline]
3763 #[allow(non_snake_case)]
3764 pub fn cmd_as_append_child(&self) -> Option<AppendChild<'a>> {
3765 if self.cmd_type() == Command::AppendChild {
3766 self.cmd().map(|t| {
3767 unsafe { AppendChild::init_from_table(t) }
3771 })
3772 } else {
3773 None
3774 }
3775 }
3776
3777 #[inline]
3778 #[allow(non_snake_case)]
3779 pub fn cmd_as_insert_before(&self) -> Option<InsertBefore<'a>> {
3780 if self.cmd_type() == Command::InsertBefore {
3781 self.cmd().map(|t| {
3782 unsafe { InsertBefore::init_from_table(t) }
3786 })
3787 } else {
3788 None
3789 }
3790 }
3791
3792 #[inline]
3793 #[allow(non_snake_case)]
3794 pub fn cmd_as_remove_child(&self) -> Option<RemoveChild<'a>> {
3795 if self.cmd_type() == Command::RemoveChild {
3796 self.cmd().map(|t| {
3797 unsafe { RemoveChild::init_from_table(t) }
3801 })
3802 } else {
3803 None
3804 }
3805 }
3806
3807 #[inline]
3808 #[allow(non_snake_case)]
3809 pub fn cmd_as_set_root(&self) -> Option<SetRoot<'a>> {
3810 if self.cmd_type() == Command::SetRoot {
3811 self.cmd().map(|t| {
3812 unsafe { SetRoot::init_from_table(t) }
3816 })
3817 } else {
3818 None
3819 }
3820 }
3821
3822}
3823
3824impl ::flatbuffers::Verifiable for IrCommand<'_> {
3825 #[inline]
3826 fn run_verifier(
3827 v: &mut ::flatbuffers::Verifier, pos: usize
3828 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
3829 v.visit_table(pos)?
3830 .visit_union::<Command, _>("cmd_type", Self::VT_CMD_TYPE, "cmd", Self::VT_CMD, false, |key, v, pos| {
3831 match key {
3832 Command::CreateNode => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<CreateNode>>("Command::CreateNode", pos),
3833 Command::UpdateProps => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<UpdateProps>>("Command::UpdateProps", pos),
3834 Command::UpdateStyle => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<UpdateStyle>>("Command::UpdateStyle", pos),
3835 Command::AppendChild => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<AppendChild>>("Command::AppendChild", pos),
3836 Command::InsertBefore => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<InsertBefore>>("Command::InsertBefore", pos),
3837 Command::RemoveChild => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<RemoveChild>>("Command::RemoveChild", pos),
3838 Command::SetRoot => v.verify_union_variant::<::flatbuffers::ForwardsUOffset<SetRoot>>("Command::SetRoot", pos),
3839 _ => Ok(()),
3840 }
3841 })?
3842 .finish();
3843 Ok(())
3844 }
3845}
3846pub struct IrCommandArgs {
3847 pub cmd_type: Command,
3848 pub cmd: Option<::flatbuffers::WIPOffset<::flatbuffers::UnionWIPOffset>>,
3849}
3850impl<'a> Default for IrCommandArgs {
3851 #[inline]
3852 fn default() -> Self {
3853 IrCommandArgs {
3854 cmd_type: Command::NONE,
3855 cmd: None,
3856 }
3857 }
3858}
3859
3860pub struct IrCommandBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
3861 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
3862 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
3863}
3864impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> IrCommandBuilder<'a, 'b, A> {
3865 #[inline]
3866 pub fn add_cmd_type(&mut self, cmd_type: Command) {
3867 self.fbb_.push_slot::<Command>(IrCommand::VT_CMD_TYPE, cmd_type, Command::NONE);
3868 }
3869 #[inline]
3870 pub fn add_cmd(&mut self, cmd: ::flatbuffers::WIPOffset<::flatbuffers::UnionWIPOffset>) {
3871 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(IrCommand::VT_CMD, cmd);
3872 }
3873 #[inline]
3874 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> IrCommandBuilder<'a, 'b, A> {
3875 let start = _fbb.start_table();
3876 IrCommandBuilder {
3877 fbb_: _fbb,
3878 start_: start,
3879 }
3880 }
3881 #[inline]
3882 pub fn finish(self) -> ::flatbuffers::WIPOffset<IrCommand<'a>> {
3883 let o = self.fbb_.end_table(self.start_);
3884 ::flatbuffers::WIPOffset::new(o.value())
3885 }
3886}
3887
3888impl ::core::fmt::Debug for IrCommand<'_> {
3889 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3890 let mut ds = f.debug_struct("IrCommand");
3891 ds.field("cmd_type", &self.cmd_type());
3892 match self.cmd_type() {
3893 Command::CreateNode => {
3894 if let Some(x) = self.cmd_as_create_node() {
3895 ds.field("cmd", &x)
3896 } else {
3897 ds.field("cmd", &"InvalidFlatbuffer: Union discriminant does not match value.")
3898 }
3899 },
3900 Command::UpdateProps => {
3901 if let Some(x) = self.cmd_as_update_props() {
3902 ds.field("cmd", &x)
3903 } else {
3904 ds.field("cmd", &"InvalidFlatbuffer: Union discriminant does not match value.")
3905 }
3906 },
3907 Command::UpdateStyle => {
3908 if let Some(x) = self.cmd_as_update_style() {
3909 ds.field("cmd", &x)
3910 } else {
3911 ds.field("cmd", &"InvalidFlatbuffer: Union discriminant does not match value.")
3912 }
3913 },
3914 Command::AppendChild => {
3915 if let Some(x) = self.cmd_as_append_child() {
3916 ds.field("cmd", &x)
3917 } else {
3918 ds.field("cmd", &"InvalidFlatbuffer: Union discriminant does not match value.")
3919 }
3920 },
3921 Command::InsertBefore => {
3922 if let Some(x) = self.cmd_as_insert_before() {
3923 ds.field("cmd", &x)
3924 } else {
3925 ds.field("cmd", &"InvalidFlatbuffer: Union discriminant does not match value.")
3926 }
3927 },
3928 Command::RemoveChild => {
3929 if let Some(x) = self.cmd_as_remove_child() {
3930 ds.field("cmd", &x)
3931 } else {
3932 ds.field("cmd", &"InvalidFlatbuffer: Union discriminant does not match value.")
3933 }
3934 },
3935 Command::SetRoot => {
3936 if let Some(x) = self.cmd_as_set_root() {
3937 ds.field("cmd", &x)
3938 } else {
3939 ds.field("cmd", &"InvalidFlatbuffer: Union discriminant does not match value.")
3940 }
3941 },
3942 _ => {
3943 let x: Option<()> = None;
3944 ds.field("cmd", &x)
3945 },
3946 };
3947 ds.finish()
3948 }
3949}
3950pub enum IrBatchOffset {}
3951#[derive(Copy, Clone, PartialEq)]
3952
3953pub struct IrBatch<'a> {
3954 pub _tab: ::flatbuffers::Table<'a>,
3955}
3956
3957impl<'a> ::flatbuffers::Follow<'a> for IrBatch<'a> {
3958 type Inner = IrBatch<'a>;
3959 #[inline]
3960 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3961 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
3962 }
3963}
3964
3965impl<'a> IrBatch<'a> {
3966 pub const VT_COMMIT_ID: ::flatbuffers::VOffsetT = 4;
3967 pub const VT_TIMESTAMP_MS: ::flatbuffers::VOffsetT = 6;
3968 pub const VT_COMMANDS: ::flatbuffers::VOffsetT = 8;
3969
3970 #[inline]
3971 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
3972 IrBatch { _tab: table }
3973 }
3974 #[allow(unused_mut)]
3975 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
3976 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
3977 args: &'args IrBatchArgs<'args>
3978 ) -> ::flatbuffers::WIPOffset<IrBatch<'bldr>> {
3979 let mut builder = IrBatchBuilder::new(_fbb);
3980 builder.add_timestamp_ms(args.timestamp_ms);
3981 builder.add_commit_id(args.commit_id);
3982 if let Some(x) = args.commands { builder.add_commands(x); }
3983 builder.finish()
3984 }
3985
3986
3987 #[inline]
3988 pub fn commit_id(&self) -> u64 {
3989 unsafe { self._tab.get::<u64>(IrBatch::VT_COMMIT_ID, Some(0)).unwrap()}
3993 }
3994 #[inline]
3995 pub fn timestamp_ms(&self) -> f64 {
3996 unsafe { self._tab.get::<f64>(IrBatch::VT_TIMESTAMP_MS, Some(0.0)).unwrap()}
4000 }
4001 #[inline]
4002 pub fn commands(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<IrCommand<'a>>>> {
4003 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<IrCommand>>>>(IrBatch::VT_COMMANDS, None)}
4007 }
4008}
4009
4010impl ::flatbuffers::Verifiable for IrBatch<'_> {
4011 #[inline]
4012 fn run_verifier(
4013 v: &mut ::flatbuffers::Verifier, pos: usize
4014 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
4015 v.visit_table(pos)?
4016 .visit_field::<u64>("commit_id", Self::VT_COMMIT_ID, false)?
4017 .visit_field::<f64>("timestamp_ms", Self::VT_TIMESTAMP_MS, false)?
4018 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<IrCommand>>>>("commands", Self::VT_COMMANDS, false)?
4019 .finish();
4020 Ok(())
4021 }
4022}
4023pub struct IrBatchArgs<'a> {
4024 pub commit_id: u64,
4025 pub timestamp_ms: f64,
4026 pub commands: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<IrCommand<'a>>>>>,
4027}
4028impl<'a> Default for IrBatchArgs<'a> {
4029 #[inline]
4030 fn default() -> Self {
4031 IrBatchArgs {
4032 commit_id: 0,
4033 timestamp_ms: 0.0,
4034 commands: None,
4035 }
4036 }
4037}
4038
4039pub struct IrBatchBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
4040 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
4041 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
4042}
4043impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> IrBatchBuilder<'a, 'b, A> {
4044 #[inline]
4045 pub fn add_commit_id(&mut self, commit_id: u64) {
4046 self.fbb_.push_slot::<u64>(IrBatch::VT_COMMIT_ID, commit_id, 0);
4047 }
4048 #[inline]
4049 pub fn add_timestamp_ms(&mut self, timestamp_ms: f64) {
4050 self.fbb_.push_slot::<f64>(IrBatch::VT_TIMESTAMP_MS, timestamp_ms, 0.0);
4051 }
4052 #[inline]
4053 pub fn add_commands(&mut self, commands: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<IrCommand<'b >>>>) {
4054 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(IrBatch::VT_COMMANDS, commands);
4055 }
4056 #[inline]
4057 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> IrBatchBuilder<'a, 'b, A> {
4058 let start = _fbb.start_table();
4059 IrBatchBuilder {
4060 fbb_: _fbb,
4061 start_: start,
4062 }
4063 }
4064 #[inline]
4065 pub fn finish(self) -> ::flatbuffers::WIPOffset<IrBatch<'a>> {
4066 let o = self.fbb_.end_table(self.start_);
4067 ::flatbuffers::WIPOffset::new(o.value())
4068 }
4069}
4070
4071impl ::core::fmt::Debug for IrBatch<'_> {
4072 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4073 let mut ds = f.debug_struct("IrBatch");
4074 ds.field("commit_id", &self.commit_id());
4075 ds.field("timestamp_ms", &self.timestamp_ms());
4076 ds.field("commands", &self.commands());
4077 ds.finish()
4078 }
4079}
4080#[inline]
4081pub fn root_as_ir_batch(buf: &[u8]) -> Result<IrBatch<'_>, ::flatbuffers::InvalidFlatbuffer> {
4088 ::flatbuffers::root::<IrBatch>(buf)
4089}
4090#[inline]
4091pub fn size_prefixed_root_as_ir_batch(buf: &[u8]) -> Result<IrBatch<'_>, ::flatbuffers::InvalidFlatbuffer> {
4098 ::flatbuffers::size_prefixed_root::<IrBatch>(buf)
4099}
4100#[inline]
4101pub fn root_as_ir_batch_with_opts<'b, 'o>(
4108 opts: &'o ::flatbuffers::VerifierOptions,
4109 buf: &'b [u8],
4110) -> Result<IrBatch<'b>, ::flatbuffers::InvalidFlatbuffer> {
4111 ::flatbuffers::root_with_opts::<IrBatch<'b>>(opts, buf)
4112}
4113#[inline]
4114pub fn size_prefixed_root_as_ir_batch_with_opts<'b, 'o>(
4121 opts: &'o ::flatbuffers::VerifierOptions,
4122 buf: &'b [u8],
4123) -> Result<IrBatch<'b>, ::flatbuffers::InvalidFlatbuffer> {
4124 ::flatbuffers::size_prefixed_root_with_opts::<IrBatch<'b>>(opts, buf)
4125}
4126#[inline]
4127pub unsafe fn root_as_ir_batch_unchecked(buf: &[u8]) -> IrBatch<'_> {
4131 unsafe { ::flatbuffers::root_unchecked::<IrBatch>(buf) }
4132}
4133#[inline]
4134pub unsafe fn size_prefixed_root_as_ir_batch_unchecked(buf: &[u8]) -> IrBatch<'_> {
4138 unsafe { ::flatbuffers::size_prefixed_root_unchecked::<IrBatch>(buf) }
4139}
4140#[inline]
4141pub fn finish_ir_batch_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(
4142 fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
4143 root: ::flatbuffers::WIPOffset<IrBatch<'a>>) {
4144 fbb.finish(root, None);
4145}
4146
4147#[inline]
4148pub fn finish_size_prefixed_ir_batch_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>, root: ::flatbuffers::WIPOffset<IrBatch<'a>>) {
4149 fbb.finish_size_prefixed(root, None);
4150}
4151} }