Skip to main content

fidl_next_common_fuchsia_sysmem2/
fidl_next_common_fuchsia_sysmem2.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8    pub struct AllocatorValidateBufferCollectionTokenRequest {
9        pub token_server_koid: ::core::option::Option<u64>,
10    }
11
12    impl AllocatorValidateBufferCollectionTokenRequest {
13        fn __max_ordinal(&self) -> usize {
14            if self.token_server_koid.is_some() {
15                return 1;
16            }
17
18            0
19        }
20    }
21
22    unsafe impl<___E>
23        ::fidl_next::Encode<
24            crate::wire::AllocatorValidateBufferCollectionTokenRequest<'static>,
25            ___E,
26        > for AllocatorValidateBufferCollectionTokenRequest
27    where
28        ___E: ::fidl_next::Encoder + ?Sized,
29    {
30        #[inline]
31        fn encode(
32            mut self,
33            encoder: &mut ___E,
34            out: &mut ::core::mem::MaybeUninit<
35                crate::wire::AllocatorValidateBufferCollectionTokenRequest<'static>,
36            >,
37            _: (),
38        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
39            ::fidl_next::munge!(let crate::wire::AllocatorValidateBufferCollectionTokenRequest { table } = out);
40
41            let max_ord = self.__max_ordinal();
42
43            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
44            ::fidl_next::Wire::zero_padding(&mut out);
45
46            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
47                ::fidl_next::wire::Envelope,
48            >(encoder, max_ord);
49
50            for i in 1..=max_ord {
51                match i {
52                    1 => {
53                        if let Some(value) = self.token_server_koid.take() {
54                            ::fidl_next::wire::Envelope::encode_value::<
55                                ::fidl_next::wire::Uint64,
56                                ___E,
57                            >(
58                                value, preallocated.encoder, &mut out, ()
59                            )?;
60                        } else {
61                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
62                        }
63                    }
64
65                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
66                }
67                unsafe {
68                    preallocated.write_next(out.assume_init_ref());
69                }
70            }
71
72            ::fidl_next::wire::Table::encode_len(table, max_ord);
73
74            Ok(())
75        }
76    }
77
78    unsafe impl<'a, ___E>
79        ::fidl_next::Encode<
80            crate::wire::AllocatorValidateBufferCollectionTokenRequest<'static>,
81            ___E,
82        > for &'a AllocatorValidateBufferCollectionTokenRequest
83    where
84        ___E: ::fidl_next::Encoder + ?Sized,
85    {
86        #[inline]
87        fn encode(
88            self,
89            encoder: &mut ___E,
90            out: &mut ::core::mem::MaybeUninit<
91                crate::wire::AllocatorValidateBufferCollectionTokenRequest<'static>,
92            >,
93            _: (),
94        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
95            ::fidl_next::munge!(let crate::wire::AllocatorValidateBufferCollectionTokenRequest { table } = out);
96
97            let max_ord = self.__max_ordinal();
98
99            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
100            ::fidl_next::Wire::zero_padding(&mut out);
101
102            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
103                ::fidl_next::wire::Envelope,
104            >(encoder, max_ord);
105
106            for i in 1..=max_ord {
107                match i {
108                    1 => {
109                        if let Some(value) = &self.token_server_koid {
110                            ::fidl_next::wire::Envelope::encode_value::<
111                                ::fidl_next::wire::Uint64,
112                                ___E,
113                            >(
114                                value, preallocated.encoder, &mut out, ()
115                            )?;
116                        } else {
117                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
118                        }
119                    }
120
121                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
122                }
123                unsafe {
124                    preallocated.write_next(out.assume_init_ref());
125                }
126            }
127
128            ::fidl_next::wire::Table::encode_len(table, max_ord);
129
130            Ok(())
131        }
132    }
133
134    impl<'de> ::fidl_next::FromWire<crate::wire::AllocatorValidateBufferCollectionTokenRequest<'de>>
135        for AllocatorValidateBufferCollectionTokenRequest
136    {
137        #[inline]
138        fn from_wire(
139            wire_: crate::wire::AllocatorValidateBufferCollectionTokenRequest<'de>,
140        ) -> Self {
141            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
142
143            let token_server_koid = wire_.table.get(1);
144
145            Self {
146                token_server_koid: token_server_koid.map(|envelope| {
147                    ::fidl_next::FromWire::from_wire(unsafe {
148                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
149                    })
150                }),
151            }
152        }
153    }
154
155    impl<'de>
156        ::fidl_next::FromWireRef<crate::wire::AllocatorValidateBufferCollectionTokenRequest<'de>>
157        for AllocatorValidateBufferCollectionTokenRequest
158    {
159        #[inline]
160        fn from_wire_ref(
161            wire: &crate::wire::AllocatorValidateBufferCollectionTokenRequest<'de>,
162        ) -> Self {
163            Self {
164                token_server_koid: wire.table.get(1).map(|envelope| {
165                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
166                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
167                    })
168                }),
169            }
170        }
171    }
172
173    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
174    pub struct AllocatorValidateBufferCollectionTokenResponse {
175        pub is_known: ::core::option::Option<bool>,
176    }
177
178    impl AllocatorValidateBufferCollectionTokenResponse {
179        fn __max_ordinal(&self) -> usize {
180            if self.is_known.is_some() {
181                return 1;
182            }
183
184            0
185        }
186    }
187
188    unsafe impl<___E>
189        ::fidl_next::Encode<
190            crate::wire::AllocatorValidateBufferCollectionTokenResponse<'static>,
191            ___E,
192        > for AllocatorValidateBufferCollectionTokenResponse
193    where
194        ___E: ::fidl_next::Encoder + ?Sized,
195    {
196        #[inline]
197        fn encode(
198            mut self,
199            encoder: &mut ___E,
200            out: &mut ::core::mem::MaybeUninit<
201                crate::wire::AllocatorValidateBufferCollectionTokenResponse<'static>,
202            >,
203            _: (),
204        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
205            ::fidl_next::munge!(let crate::wire::AllocatorValidateBufferCollectionTokenResponse { table } = out);
206
207            let max_ord = self.__max_ordinal();
208
209            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
210            ::fidl_next::Wire::zero_padding(&mut out);
211
212            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
213                ::fidl_next::wire::Envelope,
214            >(encoder, max_ord);
215
216            for i in 1..=max_ord {
217                match i {
218                    1 => {
219                        if let Some(value) = self.is_known.take() {
220                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
221                                value,
222                                preallocated.encoder,
223                                &mut out,
224                                (),
225                            )?;
226                        } else {
227                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
228                        }
229                    }
230
231                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
232                }
233                unsafe {
234                    preallocated.write_next(out.assume_init_ref());
235                }
236            }
237
238            ::fidl_next::wire::Table::encode_len(table, max_ord);
239
240            Ok(())
241        }
242    }
243
244    unsafe impl<'a, ___E>
245        ::fidl_next::Encode<
246            crate::wire::AllocatorValidateBufferCollectionTokenResponse<'static>,
247            ___E,
248        > for &'a AllocatorValidateBufferCollectionTokenResponse
249    where
250        ___E: ::fidl_next::Encoder + ?Sized,
251    {
252        #[inline]
253        fn encode(
254            self,
255            encoder: &mut ___E,
256            out: &mut ::core::mem::MaybeUninit<
257                crate::wire::AllocatorValidateBufferCollectionTokenResponse<'static>,
258            >,
259            _: (),
260        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
261            ::fidl_next::munge!(let crate::wire::AllocatorValidateBufferCollectionTokenResponse { table } = out);
262
263            let max_ord = self.__max_ordinal();
264
265            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
266            ::fidl_next::Wire::zero_padding(&mut out);
267
268            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
269                ::fidl_next::wire::Envelope,
270            >(encoder, max_ord);
271
272            for i in 1..=max_ord {
273                match i {
274                    1 => {
275                        if let Some(value) = &self.is_known {
276                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
277                                value,
278                                preallocated.encoder,
279                                &mut out,
280                                (),
281                            )?;
282                        } else {
283                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
284                        }
285                    }
286
287                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
288                }
289                unsafe {
290                    preallocated.write_next(out.assume_init_ref());
291                }
292            }
293
294            ::fidl_next::wire::Table::encode_len(table, max_ord);
295
296            Ok(())
297        }
298    }
299
300    impl<'de>
301        ::fidl_next::FromWire<crate::wire::AllocatorValidateBufferCollectionTokenResponse<'de>>
302        for AllocatorValidateBufferCollectionTokenResponse
303    {
304        #[inline]
305        fn from_wire(
306            wire_: crate::wire::AllocatorValidateBufferCollectionTokenResponse<'de>,
307        ) -> Self {
308            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
309
310            let is_known = wire_.table.get(1);
311
312            Self {
313                is_known: is_known.map(|envelope| {
314                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
315                }),
316            }
317        }
318    }
319
320    impl<'de>
321        ::fidl_next::FromWireRef<crate::wire::AllocatorValidateBufferCollectionTokenResponse<'de>>
322        for AllocatorValidateBufferCollectionTokenResponse
323    {
324        #[inline]
325        fn from_wire_ref(
326            wire: &crate::wire::AllocatorValidateBufferCollectionTokenResponse<'de>,
327        ) -> Self {
328            Self {
329                is_known: wire.table.get(1).map(|envelope| {
330                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
331                        envelope.deref_unchecked::<bool>()
332                    })
333                }),
334            }
335        }
336    }
337
338    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
339    pub struct AllocatorSetDebugClientInfoRequest {
340        pub name: ::core::option::Option<::std::string::String>,
341
342        pub id: ::core::option::Option<u64>,
343    }
344
345    impl AllocatorSetDebugClientInfoRequest {
346        fn __max_ordinal(&self) -> usize {
347            if self.id.is_some() {
348                return 2;
349            }
350
351            if self.name.is_some() {
352                return 1;
353            }
354
355            0
356        }
357    }
358
359    unsafe impl<___E>
360        ::fidl_next::Encode<crate::wire::AllocatorSetDebugClientInfoRequest<'static>, ___E>
361        for AllocatorSetDebugClientInfoRequest
362    where
363        ___E: ::fidl_next::Encoder + ?Sized,
364    {
365        #[inline]
366        fn encode(
367            mut self,
368            encoder: &mut ___E,
369            out: &mut ::core::mem::MaybeUninit<
370                crate::wire::AllocatorSetDebugClientInfoRequest<'static>,
371            >,
372            _: (),
373        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
374            ::fidl_next::munge!(let crate::wire::AllocatorSetDebugClientInfoRequest { table } = out);
375
376            let max_ord = self.__max_ordinal();
377
378            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
379            ::fidl_next::Wire::zero_padding(&mut out);
380
381            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
382                ::fidl_next::wire::Envelope,
383            >(encoder, max_ord);
384
385            for i in 1..=max_ord {
386                match i {
387                    2 => {
388                        if let Some(value) = self.id.take() {
389                            ::fidl_next::wire::Envelope::encode_value::<
390                                ::fidl_next::wire::Uint64,
391                                ___E,
392                            >(
393                                value, preallocated.encoder, &mut out, ()
394                            )?;
395                        } else {
396                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
397                        }
398                    }
399
400                    1 => {
401                        if let Some(value) = self.name.take() {
402                            ::fidl_next::wire::Envelope::encode_value::<
403                                ::fidl_next::wire::String<'static>,
404                                ___E,
405                            >(
406                                value, preallocated.encoder, &mut out, 256
407                            )?;
408                        } else {
409                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
410                        }
411                    }
412
413                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
414                }
415                unsafe {
416                    preallocated.write_next(out.assume_init_ref());
417                }
418            }
419
420            ::fidl_next::wire::Table::encode_len(table, max_ord);
421
422            Ok(())
423        }
424    }
425
426    unsafe impl<'a, ___E>
427        ::fidl_next::Encode<crate::wire::AllocatorSetDebugClientInfoRequest<'static>, ___E>
428        for &'a AllocatorSetDebugClientInfoRequest
429    where
430        ___E: ::fidl_next::Encoder + ?Sized,
431    {
432        #[inline]
433        fn encode(
434            self,
435            encoder: &mut ___E,
436            out: &mut ::core::mem::MaybeUninit<
437                crate::wire::AllocatorSetDebugClientInfoRequest<'static>,
438            >,
439            _: (),
440        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
441            ::fidl_next::munge!(let crate::wire::AllocatorSetDebugClientInfoRequest { table } = out);
442
443            let max_ord = self.__max_ordinal();
444
445            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
446            ::fidl_next::Wire::zero_padding(&mut out);
447
448            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
449                ::fidl_next::wire::Envelope,
450            >(encoder, max_ord);
451
452            for i in 1..=max_ord {
453                match i {
454                    2 => {
455                        if let Some(value) = &self.id {
456                            ::fidl_next::wire::Envelope::encode_value::<
457                                ::fidl_next::wire::Uint64,
458                                ___E,
459                            >(
460                                value, preallocated.encoder, &mut out, ()
461                            )?;
462                        } else {
463                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
464                        }
465                    }
466
467                    1 => {
468                        if let Some(value) = &self.name {
469                            ::fidl_next::wire::Envelope::encode_value::<
470                                ::fidl_next::wire::String<'static>,
471                                ___E,
472                            >(
473                                value, preallocated.encoder, &mut out, 256
474                            )?;
475                        } else {
476                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
477                        }
478                    }
479
480                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
481                }
482                unsafe {
483                    preallocated.write_next(out.assume_init_ref());
484                }
485            }
486
487            ::fidl_next::wire::Table::encode_len(table, max_ord);
488
489            Ok(())
490        }
491    }
492
493    impl<'de> ::fidl_next::FromWire<crate::wire::AllocatorSetDebugClientInfoRequest<'de>>
494        for AllocatorSetDebugClientInfoRequest
495    {
496        #[inline]
497        fn from_wire(wire_: crate::wire::AllocatorSetDebugClientInfoRequest<'de>) -> Self {
498            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
499
500            let name = wire_.table.get(1);
501
502            let id = wire_.table.get(2);
503
504            Self {
505                name: name.map(|envelope| {
506                    ::fidl_next::FromWire::from_wire(unsafe {
507                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
508                    })
509                }),
510
511                id: id.map(|envelope| {
512                    ::fidl_next::FromWire::from_wire(unsafe {
513                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
514                    })
515                }),
516            }
517        }
518    }
519
520    impl<'de> ::fidl_next::FromWireRef<crate::wire::AllocatorSetDebugClientInfoRequest<'de>>
521        for AllocatorSetDebugClientInfoRequest
522    {
523        #[inline]
524        fn from_wire_ref(wire: &crate::wire::AllocatorSetDebugClientInfoRequest<'de>) -> Self {
525            Self {
526                name: wire.table.get(1).map(|envelope| {
527                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
528                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
529                    })
530                }),
531
532                id: wire.table.get(2).map(|envelope| {
533                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
534                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
535                    })
536                }),
537            }
538        }
539    }
540
541    #[doc = " Describes how a client will access the contents of a buffer.\n"]
542    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
543    pub struct BufferUsage {
544        pub none: ::core::option::Option<u32>,
545
546        pub cpu: ::core::option::Option<u32>,
547
548        pub vulkan: ::core::option::Option<u32>,
549
550        pub display: ::core::option::Option<u32>,
551
552        pub video: ::core::option::Option<u32>,
553    }
554
555    impl BufferUsage {
556        fn __max_ordinal(&self) -> usize {
557            if self.video.is_some() {
558                return 5;
559            }
560
561            if self.display.is_some() {
562                return 4;
563            }
564
565            if self.vulkan.is_some() {
566                return 3;
567            }
568
569            if self.cpu.is_some() {
570                return 2;
571            }
572
573            if self.none.is_some() {
574                return 1;
575            }
576
577            0
578        }
579    }
580
581    unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferUsage<'static>, ___E> for BufferUsage
582    where
583        ___E: ::fidl_next::Encoder + ?Sized,
584    {
585        #[inline]
586        fn encode(
587            mut self,
588            encoder: &mut ___E,
589            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferUsage<'static>>,
590            _: (),
591        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
592            ::fidl_next::munge!(let crate::wire::BufferUsage { table } = out);
593
594            let max_ord = self.__max_ordinal();
595
596            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
597            ::fidl_next::Wire::zero_padding(&mut out);
598
599            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
600                ::fidl_next::wire::Envelope,
601            >(encoder, max_ord);
602
603            for i in 1..=max_ord {
604                match i {
605                    5 => {
606                        if let Some(value) = self.video.take() {
607                            ::fidl_next::wire::Envelope::encode_value::<
608                                ::fidl_next::wire::Uint32,
609                                ___E,
610                            >(
611                                value, preallocated.encoder, &mut out, ()
612                            )?;
613                        } else {
614                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
615                        }
616                    }
617
618                    4 => {
619                        if let Some(value) = self.display.take() {
620                            ::fidl_next::wire::Envelope::encode_value::<
621                                ::fidl_next::wire::Uint32,
622                                ___E,
623                            >(
624                                value, preallocated.encoder, &mut out, ()
625                            )?;
626                        } else {
627                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
628                        }
629                    }
630
631                    3 => {
632                        if let Some(value) = self.vulkan.take() {
633                            ::fidl_next::wire::Envelope::encode_value::<
634                                ::fidl_next::wire::Uint32,
635                                ___E,
636                            >(
637                                value, preallocated.encoder, &mut out, ()
638                            )?;
639                        } else {
640                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
641                        }
642                    }
643
644                    2 => {
645                        if let Some(value) = self.cpu.take() {
646                            ::fidl_next::wire::Envelope::encode_value::<
647                                ::fidl_next::wire::Uint32,
648                                ___E,
649                            >(
650                                value, preallocated.encoder, &mut out, ()
651                            )?;
652                        } else {
653                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
654                        }
655                    }
656
657                    1 => {
658                        if let Some(value) = self.none.take() {
659                            ::fidl_next::wire::Envelope::encode_value::<
660                                ::fidl_next::wire::Uint32,
661                                ___E,
662                            >(
663                                value, preallocated.encoder, &mut out, ()
664                            )?;
665                        } else {
666                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
667                        }
668                    }
669
670                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
671                }
672                unsafe {
673                    preallocated.write_next(out.assume_init_ref());
674                }
675            }
676
677            ::fidl_next::wire::Table::encode_len(table, max_ord);
678
679            Ok(())
680        }
681    }
682
683    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BufferUsage<'static>, ___E>
684        for &'a BufferUsage
685    where
686        ___E: ::fidl_next::Encoder + ?Sized,
687    {
688        #[inline]
689        fn encode(
690            self,
691            encoder: &mut ___E,
692            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferUsage<'static>>,
693            _: (),
694        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
695            ::fidl_next::munge!(let crate::wire::BufferUsage { table } = out);
696
697            let max_ord = self.__max_ordinal();
698
699            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
700            ::fidl_next::Wire::zero_padding(&mut out);
701
702            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
703                ::fidl_next::wire::Envelope,
704            >(encoder, max_ord);
705
706            for i in 1..=max_ord {
707                match i {
708                    5 => {
709                        if let Some(value) = &self.video {
710                            ::fidl_next::wire::Envelope::encode_value::<
711                                ::fidl_next::wire::Uint32,
712                                ___E,
713                            >(
714                                value, preallocated.encoder, &mut out, ()
715                            )?;
716                        } else {
717                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
718                        }
719                    }
720
721                    4 => {
722                        if let Some(value) = &self.display {
723                            ::fidl_next::wire::Envelope::encode_value::<
724                                ::fidl_next::wire::Uint32,
725                                ___E,
726                            >(
727                                value, preallocated.encoder, &mut out, ()
728                            )?;
729                        } else {
730                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
731                        }
732                    }
733
734                    3 => {
735                        if let Some(value) = &self.vulkan {
736                            ::fidl_next::wire::Envelope::encode_value::<
737                                ::fidl_next::wire::Uint32,
738                                ___E,
739                            >(
740                                value, preallocated.encoder, &mut out, ()
741                            )?;
742                        } else {
743                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
744                        }
745                    }
746
747                    2 => {
748                        if let Some(value) = &self.cpu {
749                            ::fidl_next::wire::Envelope::encode_value::<
750                                ::fidl_next::wire::Uint32,
751                                ___E,
752                            >(
753                                value, preallocated.encoder, &mut out, ()
754                            )?;
755                        } else {
756                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
757                        }
758                    }
759
760                    1 => {
761                        if let Some(value) = &self.none {
762                            ::fidl_next::wire::Envelope::encode_value::<
763                                ::fidl_next::wire::Uint32,
764                                ___E,
765                            >(
766                                value, preallocated.encoder, &mut out, ()
767                            )?;
768                        } else {
769                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
770                        }
771                    }
772
773                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
774                }
775                unsafe {
776                    preallocated.write_next(out.assume_init_ref());
777                }
778            }
779
780            ::fidl_next::wire::Table::encode_len(table, max_ord);
781
782            Ok(())
783        }
784    }
785
786    impl<'de> ::fidl_next::FromWire<crate::wire::BufferUsage<'de>> for BufferUsage {
787        #[inline]
788        fn from_wire(wire_: crate::wire::BufferUsage<'de>) -> Self {
789            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
790
791            let none = wire_.table.get(1);
792
793            let cpu = wire_.table.get(2);
794
795            let vulkan = wire_.table.get(3);
796
797            let display = wire_.table.get(4);
798
799            let video = wire_.table.get(5);
800
801            Self {
802                none: none.map(|envelope| {
803                    ::fidl_next::FromWire::from_wire(unsafe {
804                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
805                    })
806                }),
807
808                cpu: cpu.map(|envelope| {
809                    ::fidl_next::FromWire::from_wire(unsafe {
810                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
811                    })
812                }),
813
814                vulkan: vulkan.map(|envelope| {
815                    ::fidl_next::FromWire::from_wire(unsafe {
816                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
817                    })
818                }),
819
820                display: display.map(|envelope| {
821                    ::fidl_next::FromWire::from_wire(unsafe {
822                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
823                    })
824                }),
825
826                video: video.map(|envelope| {
827                    ::fidl_next::FromWire::from_wire(unsafe {
828                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
829                    })
830                }),
831            }
832        }
833    }
834
835    impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferUsage<'de>> for BufferUsage {
836        #[inline]
837        fn from_wire_ref(wire: &crate::wire::BufferUsage<'de>) -> Self {
838            Self {
839                none: wire.table.get(1).map(|envelope| {
840                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
841                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
842                    })
843                }),
844
845                cpu: wire.table.get(2).map(|envelope| {
846                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
847                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
848                    })
849                }),
850
851                vulkan: wire.table.get(3).map(|envelope| {
852                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
853                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
854                    })
855                }),
856
857                display: wire.table.get(4).map(|envelope| {
858                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
859                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
860                    })
861                }),
862
863                video: wire.table.get(5).map(|envelope| {
864                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
865                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
866                    })
867                }),
868            }
869        }
870    }
871
872    #[doc = " A reference to a heap instance.\n\n A given heap instance can have more than one `Heap` which can be used to\n refer to the heap instance. Comparing `Heap` tables without knowledge of\n these `Heap` aliases is not a reliable way to determine if two `Heap` tables\n refer to the same heap (matching means yes, but not matching means maybe).\n Allowing heap aliases makes renaming `Heap.type`(s) easier.\n"]
873    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
874    pub struct Heap {
875        pub heap_type: ::core::option::Option<::std::string::String>,
876
877        pub id: ::core::option::Option<u64>,
878    }
879
880    impl Heap {
881        fn __max_ordinal(&self) -> usize {
882            if self.id.is_some() {
883                return 2;
884            }
885
886            if self.heap_type.is_some() {
887                return 1;
888            }
889
890            0
891        }
892    }
893
894    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Heap<'static>, ___E> for Heap
895    where
896        ___E: ::fidl_next::Encoder + ?Sized,
897    {
898        #[inline]
899        fn encode(
900            mut self,
901            encoder: &mut ___E,
902            out: &mut ::core::mem::MaybeUninit<crate::wire::Heap<'static>>,
903            _: (),
904        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
905            ::fidl_next::munge!(let crate::wire::Heap { table } = out);
906
907            let max_ord = self.__max_ordinal();
908
909            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
910            ::fidl_next::Wire::zero_padding(&mut out);
911
912            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
913                ::fidl_next::wire::Envelope,
914            >(encoder, max_ord);
915
916            for i in 1..=max_ord {
917                match i {
918                    2 => {
919                        if let Some(value) = self.id.take() {
920                            ::fidl_next::wire::Envelope::encode_value::<
921                                ::fidl_next::wire::Uint64,
922                                ___E,
923                            >(
924                                value, preallocated.encoder, &mut out, ()
925                            )?;
926                        } else {
927                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
928                        }
929                    }
930
931                    1 => {
932                        if let Some(value) = self.heap_type.take() {
933                            ::fidl_next::wire::Envelope::encode_value::<
934                                ::fidl_next::wire::String<'static>,
935                                ___E,
936                            >(
937                                value, preallocated.encoder, &mut out, 128
938                            )?;
939                        } else {
940                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
941                        }
942                    }
943
944                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
945                }
946                unsafe {
947                    preallocated.write_next(out.assume_init_ref());
948                }
949            }
950
951            ::fidl_next::wire::Table::encode_len(table, max_ord);
952
953            Ok(())
954        }
955    }
956
957    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Heap<'static>, ___E> for &'a Heap
958    where
959        ___E: ::fidl_next::Encoder + ?Sized,
960    {
961        #[inline]
962        fn encode(
963            self,
964            encoder: &mut ___E,
965            out: &mut ::core::mem::MaybeUninit<crate::wire::Heap<'static>>,
966            _: (),
967        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
968            ::fidl_next::munge!(let crate::wire::Heap { table } = out);
969
970            let max_ord = self.__max_ordinal();
971
972            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
973            ::fidl_next::Wire::zero_padding(&mut out);
974
975            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
976                ::fidl_next::wire::Envelope,
977            >(encoder, max_ord);
978
979            for i in 1..=max_ord {
980                match i {
981                    2 => {
982                        if let Some(value) = &self.id {
983                            ::fidl_next::wire::Envelope::encode_value::<
984                                ::fidl_next::wire::Uint64,
985                                ___E,
986                            >(
987                                value, preallocated.encoder, &mut out, ()
988                            )?;
989                        } else {
990                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
991                        }
992                    }
993
994                    1 => {
995                        if let Some(value) = &self.heap_type {
996                            ::fidl_next::wire::Envelope::encode_value::<
997                                ::fidl_next::wire::String<'static>,
998                                ___E,
999                            >(
1000                                value, preallocated.encoder, &mut out, 128
1001                            )?;
1002                        } else {
1003                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1004                        }
1005                    }
1006
1007                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1008                }
1009                unsafe {
1010                    preallocated.write_next(out.assume_init_ref());
1011                }
1012            }
1013
1014            ::fidl_next::wire::Table::encode_len(table, max_ord);
1015
1016            Ok(())
1017        }
1018    }
1019
1020    impl<'de> ::fidl_next::FromWire<crate::wire::Heap<'de>> for Heap {
1021        #[inline]
1022        fn from_wire(wire_: crate::wire::Heap<'de>) -> Self {
1023            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1024
1025            let heap_type = wire_.table.get(1);
1026
1027            let id = wire_.table.get(2);
1028
1029            Self {
1030                heap_type: heap_type.map(|envelope| {
1031                    ::fidl_next::FromWire::from_wire(unsafe {
1032                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1033                    })
1034                }),
1035
1036                id: id.map(|envelope| {
1037                    ::fidl_next::FromWire::from_wire(unsafe {
1038                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
1039                    })
1040                }),
1041            }
1042        }
1043    }
1044
1045    impl<'de> ::fidl_next::FromWireRef<crate::wire::Heap<'de>> for Heap {
1046        #[inline]
1047        fn from_wire_ref(wire: &crate::wire::Heap<'de>) -> Self {
1048            Self {
1049                heap_type: wire.table.get(1).map(|envelope| {
1050                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1051                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1052                    })
1053                }),
1054
1055                id: wire.table.get(2).map(|envelope| {
1056                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1057                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
1058                    })
1059                }),
1060            }
1061        }
1062    }
1063
1064    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1065    pub struct BufferMemoryConstraints {
1066        pub min_size_bytes: ::core::option::Option<u64>,
1067
1068        pub max_size_bytes: ::core::option::Option<u64>,
1069
1070        pub physically_contiguous_required: ::core::option::Option<bool>,
1071
1072        pub secure_required: ::core::option::Option<bool>,
1073
1074        pub cpu_domain_supported: ::core::option::Option<bool>,
1075
1076        pub ram_domain_supported: ::core::option::Option<bool>,
1077
1078        pub inaccessible_domain_supported: ::core::option::Option<bool>,
1079
1080        pub permitted_heaps: ::core::option::Option<::std::vec::Vec<crate::natural::Heap>>,
1081
1082        pub min_physical_base_alignment: ::core::option::Option<u64>,
1083    }
1084
1085    impl BufferMemoryConstraints {
1086        fn __max_ordinal(&self) -> usize {
1087            if self.min_physical_base_alignment.is_some() {
1088                return 9;
1089            }
1090
1091            if self.permitted_heaps.is_some() {
1092                return 8;
1093            }
1094
1095            if self.inaccessible_domain_supported.is_some() {
1096                return 7;
1097            }
1098
1099            if self.ram_domain_supported.is_some() {
1100                return 6;
1101            }
1102
1103            if self.cpu_domain_supported.is_some() {
1104                return 5;
1105            }
1106
1107            if self.secure_required.is_some() {
1108                return 4;
1109            }
1110
1111            if self.physically_contiguous_required.is_some() {
1112                return 3;
1113            }
1114
1115            if self.max_size_bytes.is_some() {
1116                return 2;
1117            }
1118
1119            if self.min_size_bytes.is_some() {
1120                return 1;
1121            }
1122
1123            0
1124        }
1125    }
1126
1127    unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferMemoryConstraints<'static>, ___E>
1128        for BufferMemoryConstraints
1129    where
1130        ___E: ::fidl_next::Encoder + ?Sized,
1131    {
1132        #[inline]
1133        fn encode(
1134            mut self,
1135            encoder: &mut ___E,
1136            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemoryConstraints<'static>>,
1137            _: (),
1138        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1139            ::fidl_next::munge!(let crate::wire::BufferMemoryConstraints { table } = out);
1140
1141            let max_ord = self.__max_ordinal();
1142
1143            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1144            ::fidl_next::Wire::zero_padding(&mut out);
1145
1146            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1147                ::fidl_next::wire::Envelope,
1148            >(encoder, max_ord);
1149
1150            for i in 1..=max_ord {
1151                match i {
1152                    9 => {
1153                        if let Some(value) = self.min_physical_base_alignment.take() {
1154                            ::fidl_next::wire::Envelope::encode_value::<
1155                                ::fidl_next::wire::Uint64,
1156                                ___E,
1157                            >(
1158                                value, preallocated.encoder, &mut out, ()
1159                            )?;
1160                        } else {
1161                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1162                        }
1163                    }
1164
1165                    8 => {
1166                        if let Some(value) = self.permitted_heaps.take() {
1167                            ::fidl_next::wire::Envelope::encode_value::<
1168                                ::fidl_next::wire::Vector<'static, crate::wire::Heap<'static>>,
1169                                ___E,
1170                            >(
1171                                value, preallocated.encoder, &mut out, (64, ())
1172                            )?;
1173                        } else {
1174                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1175                        }
1176                    }
1177
1178                    7 => {
1179                        if let Some(value) = self.inaccessible_domain_supported.take() {
1180                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1181                                value,
1182                                preallocated.encoder,
1183                                &mut out,
1184                                (),
1185                            )?;
1186                        } else {
1187                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1188                        }
1189                    }
1190
1191                    6 => {
1192                        if let Some(value) = self.ram_domain_supported.take() {
1193                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1194                                value,
1195                                preallocated.encoder,
1196                                &mut out,
1197                                (),
1198                            )?;
1199                        } else {
1200                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1201                        }
1202                    }
1203
1204                    5 => {
1205                        if let Some(value) = self.cpu_domain_supported.take() {
1206                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1207                                value,
1208                                preallocated.encoder,
1209                                &mut out,
1210                                (),
1211                            )?;
1212                        } else {
1213                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1214                        }
1215                    }
1216
1217                    4 => {
1218                        if let Some(value) = self.secure_required.take() {
1219                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1220                                value,
1221                                preallocated.encoder,
1222                                &mut out,
1223                                (),
1224                            )?;
1225                        } else {
1226                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1227                        }
1228                    }
1229
1230                    3 => {
1231                        if let Some(value) = self.physically_contiguous_required.take() {
1232                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1233                                value,
1234                                preallocated.encoder,
1235                                &mut out,
1236                                (),
1237                            )?;
1238                        } else {
1239                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1240                        }
1241                    }
1242
1243                    2 => {
1244                        if let Some(value) = self.max_size_bytes.take() {
1245                            ::fidl_next::wire::Envelope::encode_value::<
1246                                ::fidl_next::wire::Uint64,
1247                                ___E,
1248                            >(
1249                                value, preallocated.encoder, &mut out, ()
1250                            )?;
1251                        } else {
1252                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1253                        }
1254                    }
1255
1256                    1 => {
1257                        if let Some(value) = self.min_size_bytes.take() {
1258                            ::fidl_next::wire::Envelope::encode_value::<
1259                                ::fidl_next::wire::Uint64,
1260                                ___E,
1261                            >(
1262                                value, preallocated.encoder, &mut out, ()
1263                            )?;
1264                        } else {
1265                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1266                        }
1267                    }
1268
1269                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1270                }
1271                unsafe {
1272                    preallocated.write_next(out.assume_init_ref());
1273                }
1274            }
1275
1276            ::fidl_next::wire::Table::encode_len(table, max_ord);
1277
1278            Ok(())
1279        }
1280    }
1281
1282    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BufferMemoryConstraints<'static>, ___E>
1283        for &'a BufferMemoryConstraints
1284    where
1285        ___E: ::fidl_next::Encoder + ?Sized,
1286    {
1287        #[inline]
1288        fn encode(
1289            self,
1290            encoder: &mut ___E,
1291            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemoryConstraints<'static>>,
1292            _: (),
1293        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1294            ::fidl_next::munge!(let crate::wire::BufferMemoryConstraints { table } = out);
1295
1296            let max_ord = self.__max_ordinal();
1297
1298            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1299            ::fidl_next::Wire::zero_padding(&mut out);
1300
1301            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1302                ::fidl_next::wire::Envelope,
1303            >(encoder, max_ord);
1304
1305            for i in 1..=max_ord {
1306                match i {
1307                    9 => {
1308                        if let Some(value) = &self.min_physical_base_alignment {
1309                            ::fidl_next::wire::Envelope::encode_value::<
1310                                ::fidl_next::wire::Uint64,
1311                                ___E,
1312                            >(
1313                                value, preallocated.encoder, &mut out, ()
1314                            )?;
1315                        } else {
1316                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1317                        }
1318                    }
1319
1320                    8 => {
1321                        if let Some(value) = &self.permitted_heaps {
1322                            ::fidl_next::wire::Envelope::encode_value::<
1323                                ::fidl_next::wire::Vector<'static, crate::wire::Heap<'static>>,
1324                                ___E,
1325                            >(
1326                                value, preallocated.encoder, &mut out, (64, ())
1327                            )?;
1328                        } else {
1329                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1330                        }
1331                    }
1332
1333                    7 => {
1334                        if let Some(value) = &self.inaccessible_domain_supported {
1335                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1336                                value,
1337                                preallocated.encoder,
1338                                &mut out,
1339                                (),
1340                            )?;
1341                        } else {
1342                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1343                        }
1344                    }
1345
1346                    6 => {
1347                        if let Some(value) = &self.ram_domain_supported {
1348                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1349                                value,
1350                                preallocated.encoder,
1351                                &mut out,
1352                                (),
1353                            )?;
1354                        } else {
1355                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1356                        }
1357                    }
1358
1359                    5 => {
1360                        if let Some(value) = &self.cpu_domain_supported {
1361                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1362                                value,
1363                                preallocated.encoder,
1364                                &mut out,
1365                                (),
1366                            )?;
1367                        } else {
1368                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1369                        }
1370                    }
1371
1372                    4 => {
1373                        if let Some(value) = &self.secure_required {
1374                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1375                                value,
1376                                preallocated.encoder,
1377                                &mut out,
1378                                (),
1379                            )?;
1380                        } else {
1381                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1382                        }
1383                    }
1384
1385                    3 => {
1386                        if let Some(value) = &self.physically_contiguous_required {
1387                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1388                                value,
1389                                preallocated.encoder,
1390                                &mut out,
1391                                (),
1392                            )?;
1393                        } else {
1394                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1395                        }
1396                    }
1397
1398                    2 => {
1399                        if let Some(value) = &self.max_size_bytes {
1400                            ::fidl_next::wire::Envelope::encode_value::<
1401                                ::fidl_next::wire::Uint64,
1402                                ___E,
1403                            >(
1404                                value, preallocated.encoder, &mut out, ()
1405                            )?;
1406                        } else {
1407                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1408                        }
1409                    }
1410
1411                    1 => {
1412                        if let Some(value) = &self.min_size_bytes {
1413                            ::fidl_next::wire::Envelope::encode_value::<
1414                                ::fidl_next::wire::Uint64,
1415                                ___E,
1416                            >(
1417                                value, preallocated.encoder, &mut out, ()
1418                            )?;
1419                        } else {
1420                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1421                        }
1422                    }
1423
1424                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1425                }
1426                unsafe {
1427                    preallocated.write_next(out.assume_init_ref());
1428                }
1429            }
1430
1431            ::fidl_next::wire::Table::encode_len(table, max_ord);
1432
1433            Ok(())
1434        }
1435    }
1436
1437    impl<'de> ::fidl_next::FromWire<crate::wire::BufferMemoryConstraints<'de>>
1438        for BufferMemoryConstraints
1439    {
1440        #[inline]
1441        fn from_wire(wire_: crate::wire::BufferMemoryConstraints<'de>) -> Self {
1442            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1443
1444            let min_size_bytes = wire_.table.get(1);
1445
1446            let max_size_bytes = wire_.table.get(2);
1447
1448            let physically_contiguous_required = wire_.table.get(3);
1449
1450            let secure_required = wire_.table.get(4);
1451
1452            let cpu_domain_supported = wire_.table.get(5);
1453
1454            let ram_domain_supported = wire_.table.get(6);
1455
1456            let inaccessible_domain_supported = wire_.table.get(7);
1457
1458            let permitted_heaps = wire_.table.get(8);
1459
1460            let min_physical_base_alignment = wire_.table.get(9);
1461
1462            Self {
1463
1464
1465                min_size_bytes: min_size_bytes.map(|envelope| ::fidl_next::FromWire::from_wire(
1466                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
1467                )),
1468
1469
1470                max_size_bytes: max_size_bytes.map(|envelope| ::fidl_next::FromWire::from_wire(
1471                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
1472                )),
1473
1474
1475                physically_contiguous_required: physically_contiguous_required.map(|envelope| ::fidl_next::FromWire::from_wire(
1476                    unsafe { envelope.read_unchecked::<bool>() }
1477                )),
1478
1479
1480                secure_required: secure_required.map(|envelope| ::fidl_next::FromWire::from_wire(
1481                    unsafe { envelope.read_unchecked::<bool>() }
1482                )),
1483
1484
1485                cpu_domain_supported: cpu_domain_supported.map(|envelope| ::fidl_next::FromWire::from_wire(
1486                    unsafe { envelope.read_unchecked::<bool>() }
1487                )),
1488
1489
1490                ram_domain_supported: ram_domain_supported.map(|envelope| ::fidl_next::FromWire::from_wire(
1491                    unsafe { envelope.read_unchecked::<bool>() }
1492                )),
1493
1494
1495                inaccessible_domain_supported: inaccessible_domain_supported.map(|envelope| ::fidl_next::FromWire::from_wire(
1496                    unsafe { envelope.read_unchecked::<bool>() }
1497                )),
1498
1499
1500                permitted_heaps: permitted_heaps.map(|envelope| ::fidl_next::FromWire::from_wire(
1501                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>() }
1502                )),
1503
1504
1505                min_physical_base_alignment: min_physical_base_alignment.map(|envelope| ::fidl_next::FromWire::from_wire(
1506                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
1507                )),
1508
1509        }
1510        }
1511    }
1512
1513    impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferMemoryConstraints<'de>>
1514        for BufferMemoryConstraints
1515    {
1516        #[inline]
1517        fn from_wire_ref(wire: &crate::wire::BufferMemoryConstraints<'de>) -> Self {
1518            Self {
1519
1520
1521                min_size_bytes: wire.table.get(1)
1522                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1523                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
1524                    )),
1525
1526
1527                max_size_bytes: wire.table.get(2)
1528                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1529                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
1530                    )),
1531
1532
1533                physically_contiguous_required: wire.table.get(3)
1534                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1535                        unsafe { envelope.deref_unchecked::<bool>() }
1536                    )),
1537
1538
1539                secure_required: wire.table.get(4)
1540                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1541                        unsafe { envelope.deref_unchecked::<bool>() }
1542                    )),
1543
1544
1545                cpu_domain_supported: wire.table.get(5)
1546                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1547                        unsafe { envelope.deref_unchecked::<bool>() }
1548                    )),
1549
1550
1551                ram_domain_supported: wire.table.get(6)
1552                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1553                        unsafe { envelope.deref_unchecked::<bool>() }
1554                    )),
1555
1556
1557                inaccessible_domain_supported: wire.table.get(7)
1558                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1559                        unsafe { envelope.deref_unchecked::<bool>() }
1560                    )),
1561
1562
1563                permitted_heaps: wire.table.get(8)
1564                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1565                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>() }
1566                    )),
1567
1568
1569                min_physical_base_alignment: wire.table.get(9)
1570                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1571                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
1572                    )),
1573
1574        }
1575        }
1576    }
1577
1578    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1579    pub struct PixelFormatAndModifier {
1580        pub pixel_format: ::fidl_next_common_fuchsia_images2::natural::PixelFormat,
1581
1582        pub pixel_format_modifier: ::fidl_next_common_fuchsia_images2::natural::PixelFormatModifier,
1583    }
1584
1585    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>
1586        for PixelFormatAndModifier
1587    where
1588        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1589    {
1590        #[inline]
1591        fn encode(
1592            self,
1593            encoder_: &mut ___E,
1594            out_: &mut ::core::mem::MaybeUninit<crate::wire::PixelFormatAndModifier>,
1595            _: (),
1596        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1597            ::fidl_next::munge! {
1598                let crate::wire::PixelFormatAndModifier {
1599                    pixel_format,
1600                    pixel_format_modifier,
1601
1602                } = out_;
1603            }
1604
1605            ::fidl_next::Encode::encode(self.pixel_format, encoder_, pixel_format, ())?;
1606
1607            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(pixel_format.as_mut_ptr()) };
1608
1609            ::fidl_next::Encode::encode(
1610                self.pixel_format_modifier,
1611                encoder_,
1612                pixel_format_modifier,
1613                (),
1614            )?;
1615
1616            let mut _field =
1617                unsafe { ::fidl_next::Slot::new_unchecked(pixel_format_modifier.as_mut_ptr()) };
1618
1619            Ok(())
1620        }
1621    }
1622
1623    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>
1624        for &'a PixelFormatAndModifier
1625    where
1626        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1627    {
1628        #[inline]
1629        fn encode(
1630            self,
1631            encoder_: &mut ___E,
1632            out_: &mut ::core::mem::MaybeUninit<crate::wire::PixelFormatAndModifier>,
1633            _: (),
1634        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1635            ::fidl_next::munge! {
1636                let crate::wire::PixelFormatAndModifier {
1637                    pixel_format,
1638                    pixel_format_modifier,
1639
1640                } = out_;
1641            }
1642
1643            ::fidl_next::Encode::encode(&self.pixel_format, encoder_, pixel_format, ())?;
1644
1645            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(pixel_format.as_mut_ptr()) };
1646
1647            ::fidl_next::Encode::encode(
1648                &self.pixel_format_modifier,
1649                encoder_,
1650                pixel_format_modifier,
1651                (),
1652            )?;
1653
1654            let mut _field =
1655                unsafe { ::fidl_next::Slot::new_unchecked(pixel_format_modifier.as_mut_ptr()) };
1656
1657            Ok(())
1658        }
1659    }
1660
1661    unsafe impl<___E>
1662        ::fidl_next::EncodeOption<
1663            ::fidl_next::wire::Box<'static, crate::wire::PixelFormatAndModifier>,
1664            ___E,
1665        > for PixelFormatAndModifier
1666    where
1667        ___E: ::fidl_next::Encoder + ?Sized,
1668        PixelFormatAndModifier: ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>,
1669    {
1670        #[inline]
1671        fn encode_option(
1672            this: ::core::option::Option<Self>,
1673            encoder: &mut ___E,
1674            out: &mut ::core::mem::MaybeUninit<
1675                ::fidl_next::wire::Box<'static, crate::wire::PixelFormatAndModifier>,
1676            >,
1677            _: (),
1678        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1679            if let Some(inner) = this {
1680                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1681                ::fidl_next::wire::Box::encode_present(out);
1682            } else {
1683                ::fidl_next::wire::Box::encode_absent(out);
1684            }
1685
1686            Ok(())
1687        }
1688    }
1689
1690    unsafe impl<'a, ___E>
1691        ::fidl_next::EncodeOption<
1692            ::fidl_next::wire::Box<'static, crate::wire::PixelFormatAndModifier>,
1693            ___E,
1694        > for &'a PixelFormatAndModifier
1695    where
1696        ___E: ::fidl_next::Encoder + ?Sized,
1697        &'a PixelFormatAndModifier: ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>,
1698    {
1699        #[inline]
1700        fn encode_option(
1701            this: ::core::option::Option<Self>,
1702            encoder: &mut ___E,
1703            out: &mut ::core::mem::MaybeUninit<
1704                ::fidl_next::wire::Box<'static, crate::wire::PixelFormatAndModifier>,
1705            >,
1706            _: (),
1707        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1708            if let Some(inner) = this {
1709                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1710                ::fidl_next::wire::Box::encode_present(out);
1711            } else {
1712                ::fidl_next::wire::Box::encode_absent(out);
1713            }
1714
1715            Ok(())
1716        }
1717    }
1718
1719    impl ::fidl_next::FromWire<crate::wire::PixelFormatAndModifier> for PixelFormatAndModifier {
1720        #[inline]
1721        fn from_wire(wire: crate::wire::PixelFormatAndModifier) -> Self {
1722            Self {
1723                pixel_format: ::fidl_next::FromWire::from_wire(wire.pixel_format),
1724
1725                pixel_format_modifier: ::fidl_next::FromWire::from_wire(wire.pixel_format_modifier),
1726            }
1727        }
1728    }
1729
1730    impl ::fidl_next::FromWireRef<crate::wire::PixelFormatAndModifier> for PixelFormatAndModifier {
1731        #[inline]
1732        fn from_wire_ref(wire: &crate::wire::PixelFormatAndModifier) -> Self {
1733            Self {
1734                pixel_format: ::fidl_next::FromWireRef::from_wire_ref(&wire.pixel_format),
1735
1736                pixel_format_modifier: ::fidl_next::FromWireRef::from_wire_ref(
1737                    &wire.pixel_format_modifier,
1738                ),
1739            }
1740        }
1741    }
1742
1743    #[doc = " Describes constraints on layout of image data in buffers.\n"]
1744    #[derive(Debug, Default, Clone, PartialEq)]
1745    pub struct ImageFormatConstraints {
1746        pub pixel_format:
1747            ::core::option::Option<::fidl_next_common_fuchsia_images2::natural::PixelFormat>,
1748
1749        pub pixel_format_modifier: ::core::option::Option<
1750            ::fidl_next_common_fuchsia_images2::natural::PixelFormatModifier,
1751        >,
1752
1753        pub color_spaces: ::core::option::Option<
1754            ::std::vec::Vec<::fidl_next_common_fuchsia_images2::natural::ColorSpace>,
1755        >,
1756
1757        pub min_size: ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
1758
1759        pub max_size: ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
1760
1761        pub min_bytes_per_row: ::core::option::Option<u32>,
1762
1763        pub max_bytes_per_row: ::core::option::Option<u32>,
1764
1765        pub max_width_times_height: ::core::option::Option<u64>,
1766
1767        pub size_alignment: ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
1768
1769        pub display_rect_alignment:
1770            ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
1771
1772        pub required_min_size:
1773            ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
1774
1775        pub required_max_size:
1776            ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
1777
1778        pub bytes_per_row_divisor: ::core::option::Option<u32>,
1779
1780        pub start_offset_divisor: ::core::option::Option<u32>,
1781
1782        pub pixel_format_and_modifiers:
1783            ::core::option::Option<::std::vec::Vec<crate::natural::PixelFormatAndModifier>>,
1784
1785        pub require_bytes_per_row_at_pixel_boundary: ::core::option::Option<bool>,
1786
1787        pub is_alpha_present: ::core::option::Option<bool>,
1788
1789        pub required_max_size_list: ::core::option::Option<
1790            ::std::vec::Vec<::fidl_next_common_fuchsia_math::natural::SizeU>,
1791        >,
1792
1793        pub pad_for_block_size:
1794            ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
1795
1796        pub pad_beyond_image_size_bytes: ::core::option::Option<u64>,
1797    }
1798
1799    impl ImageFormatConstraints {
1800        fn __max_ordinal(&self) -> usize {
1801            if self.pad_beyond_image_size_bytes.is_some() {
1802                return 20;
1803            }
1804
1805            if self.pad_for_block_size.is_some() {
1806                return 19;
1807            }
1808
1809            if self.required_max_size_list.is_some() {
1810                return 18;
1811            }
1812
1813            if self.is_alpha_present.is_some() {
1814                return 17;
1815            }
1816
1817            if self.require_bytes_per_row_at_pixel_boundary.is_some() {
1818                return 16;
1819            }
1820
1821            if self.pixel_format_and_modifiers.is_some() {
1822                return 15;
1823            }
1824
1825            if self.start_offset_divisor.is_some() {
1826                return 14;
1827            }
1828
1829            if self.bytes_per_row_divisor.is_some() {
1830                return 13;
1831            }
1832
1833            if self.required_max_size.is_some() {
1834                return 12;
1835            }
1836
1837            if self.required_min_size.is_some() {
1838                return 11;
1839            }
1840
1841            if self.display_rect_alignment.is_some() {
1842                return 10;
1843            }
1844
1845            if self.size_alignment.is_some() {
1846                return 9;
1847            }
1848
1849            if self.max_width_times_height.is_some() {
1850                return 8;
1851            }
1852
1853            if self.max_bytes_per_row.is_some() {
1854                return 7;
1855            }
1856
1857            if self.min_bytes_per_row.is_some() {
1858                return 6;
1859            }
1860
1861            if self.max_size.is_some() {
1862                return 5;
1863            }
1864
1865            if self.min_size.is_some() {
1866                return 4;
1867            }
1868
1869            if self.color_spaces.is_some() {
1870                return 3;
1871            }
1872
1873            if self.pixel_format_modifier.is_some() {
1874                return 2;
1875            }
1876
1877            if self.pixel_format.is_some() {
1878                return 1;
1879            }
1880
1881            0
1882        }
1883    }
1884
1885    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ImageFormatConstraints<'static>, ___E>
1886        for ImageFormatConstraints
1887    where
1888        ___E: ::fidl_next::Encoder + ?Sized,
1889    {
1890        #[inline]
1891        fn encode(
1892            mut self,
1893            encoder: &mut ___E,
1894            out: &mut ::core::mem::MaybeUninit<crate::wire::ImageFormatConstraints<'static>>,
1895            _: (),
1896        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1897            ::fidl_next::munge!(let crate::wire::ImageFormatConstraints { table } = out);
1898
1899            let max_ord = self.__max_ordinal();
1900
1901            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1902            ::fidl_next::Wire::zero_padding(&mut out);
1903
1904            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1905                ::fidl_next::wire::Envelope,
1906            >(encoder, max_ord);
1907
1908            for i in 1..=max_ord {
1909                match i {
1910                    20 => {
1911                        if let Some(value) = self.pad_beyond_image_size_bytes.take() {
1912                            ::fidl_next::wire::Envelope::encode_value::<
1913                                ::fidl_next::wire::Uint64,
1914                                ___E,
1915                            >(
1916                                value, preallocated.encoder, &mut out, ()
1917                            )?;
1918                        } else {
1919                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1920                        }
1921                    }
1922
1923                    19 => {
1924                        if let Some(value) = self.pad_for_block_size.take() {
1925                            ::fidl_next::wire::Envelope::encode_value::<
1926                                ::fidl_next_common_fuchsia_math::wire::SizeU,
1927                                ___E,
1928                            >(
1929                                value, preallocated.encoder, &mut out, ()
1930                            )?;
1931                        } else {
1932                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1933                        }
1934                    }
1935
1936                    18 => {
1937                        if let Some(value) = self.required_max_size_list.take() {
1938                            ::fidl_next::wire::Envelope::encode_value::<
1939                                ::fidl_next::wire::Vector<
1940                                    'static,
1941                                    ::fidl_next_common_fuchsia_math::wire::SizeU,
1942                                >,
1943                                ___E,
1944                            >(
1945                                value, preallocated.encoder, &mut out, (64, ())
1946                            )?;
1947                        } else {
1948                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1949                        }
1950                    }
1951
1952                    17 => {
1953                        if let Some(value) = self.is_alpha_present.take() {
1954                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1955                                value,
1956                                preallocated.encoder,
1957                                &mut out,
1958                                (),
1959                            )?;
1960                        } else {
1961                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1962                        }
1963                    }
1964
1965                    16 => {
1966                        if let Some(value) = self.require_bytes_per_row_at_pixel_boundary.take() {
1967                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1968                                value,
1969                                preallocated.encoder,
1970                                &mut out,
1971                                (),
1972                            )?;
1973                        } else {
1974                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1975                        }
1976                    }
1977
1978                    15 => {
1979                        if let Some(value) = self.pixel_format_and_modifiers.take() {
1980                            ::fidl_next::wire::Envelope::encode_value::<
1981                                ::fidl_next::wire::Vector<
1982                                    'static,
1983                                    crate::wire::PixelFormatAndModifier,
1984                                >,
1985                                ___E,
1986                            >(
1987                                value, preallocated.encoder, &mut out, (64, ())
1988                            )?;
1989                        } else {
1990                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1991                        }
1992                    }
1993
1994                    14 => {
1995                        if let Some(value) = self.start_offset_divisor.take() {
1996                            ::fidl_next::wire::Envelope::encode_value::<
1997                                ::fidl_next::wire::Uint32,
1998                                ___E,
1999                            >(
2000                                value, preallocated.encoder, &mut out, ()
2001                            )?;
2002                        } else {
2003                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2004                        }
2005                    }
2006
2007                    13 => {
2008                        if let Some(value) = self.bytes_per_row_divisor.take() {
2009                            ::fidl_next::wire::Envelope::encode_value::<
2010                                ::fidl_next::wire::Uint32,
2011                                ___E,
2012                            >(
2013                                value, preallocated.encoder, &mut out, ()
2014                            )?;
2015                        } else {
2016                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2017                        }
2018                    }
2019
2020                    12 => {
2021                        if let Some(value) = self.required_max_size.take() {
2022                            ::fidl_next::wire::Envelope::encode_value::<
2023                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2024                                ___E,
2025                            >(
2026                                value, preallocated.encoder, &mut out, ()
2027                            )?;
2028                        } else {
2029                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2030                        }
2031                    }
2032
2033                    11 => {
2034                        if let Some(value) = self.required_min_size.take() {
2035                            ::fidl_next::wire::Envelope::encode_value::<
2036                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2037                                ___E,
2038                            >(
2039                                value, preallocated.encoder, &mut out, ()
2040                            )?;
2041                        } else {
2042                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2043                        }
2044                    }
2045
2046                    10 => {
2047                        if let Some(value) = self.display_rect_alignment.take() {
2048                            ::fidl_next::wire::Envelope::encode_value::<
2049                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2050                                ___E,
2051                            >(
2052                                value, preallocated.encoder, &mut out, ()
2053                            )?;
2054                        } else {
2055                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2056                        }
2057                    }
2058
2059                    9 => {
2060                        if let Some(value) = self.size_alignment.take() {
2061                            ::fidl_next::wire::Envelope::encode_value::<
2062                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2063                                ___E,
2064                            >(
2065                                value, preallocated.encoder, &mut out, ()
2066                            )?;
2067                        } else {
2068                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2069                        }
2070                    }
2071
2072                    8 => {
2073                        if let Some(value) = self.max_width_times_height.take() {
2074                            ::fidl_next::wire::Envelope::encode_value::<
2075                                ::fidl_next::wire::Uint64,
2076                                ___E,
2077                            >(
2078                                value, preallocated.encoder, &mut out, ()
2079                            )?;
2080                        } else {
2081                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2082                        }
2083                    }
2084
2085                    7 => {
2086                        if let Some(value) = self.max_bytes_per_row.take() {
2087                            ::fidl_next::wire::Envelope::encode_value::<
2088                                ::fidl_next::wire::Uint32,
2089                                ___E,
2090                            >(
2091                                value, preallocated.encoder, &mut out, ()
2092                            )?;
2093                        } else {
2094                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2095                        }
2096                    }
2097
2098                    6 => {
2099                        if let Some(value) = self.min_bytes_per_row.take() {
2100                            ::fidl_next::wire::Envelope::encode_value::<
2101                                ::fidl_next::wire::Uint32,
2102                                ___E,
2103                            >(
2104                                value, preallocated.encoder, &mut out, ()
2105                            )?;
2106                        } else {
2107                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2108                        }
2109                    }
2110
2111                    5 => {
2112                        if let Some(value) = self.max_size.take() {
2113                            ::fidl_next::wire::Envelope::encode_value::<
2114                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2115                                ___E,
2116                            >(
2117                                value, preallocated.encoder, &mut out, ()
2118                            )?;
2119                        } else {
2120                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2121                        }
2122                    }
2123
2124                    4 => {
2125                        if let Some(value) = self.min_size.take() {
2126                            ::fidl_next::wire::Envelope::encode_value::<
2127                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2128                                ___E,
2129                            >(
2130                                value, preallocated.encoder, &mut out, ()
2131                            )?;
2132                        } else {
2133                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2134                        }
2135                    }
2136
2137                    3 => {
2138                        if let Some(value) = self.color_spaces.take() {
2139                            ::fidl_next::wire::Envelope::encode_value::<
2140                                ::fidl_next::wire::Vector<
2141                                    'static,
2142                                    ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
2143                                >,
2144                                ___E,
2145                            >(
2146                                value, preallocated.encoder, &mut out, (32, ())
2147                            )?;
2148                        } else {
2149                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2150                        }
2151                    }
2152
2153                    2 => {
2154                        if let Some(value) = self.pixel_format_modifier.take() {
2155                            ::fidl_next::wire::Envelope::encode_value::<
2156                                ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
2157                                ___E,
2158                            >(
2159                                value, preallocated.encoder, &mut out, ()
2160                            )?;
2161                        } else {
2162                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2163                        }
2164                    }
2165
2166                    1 => {
2167                        if let Some(value) = self.pixel_format.take() {
2168                            ::fidl_next::wire::Envelope::encode_value::<
2169                                ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
2170                                ___E,
2171                            >(
2172                                value, preallocated.encoder, &mut out, ()
2173                            )?;
2174                        } else {
2175                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2176                        }
2177                    }
2178
2179                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2180                }
2181                unsafe {
2182                    preallocated.write_next(out.assume_init_ref());
2183                }
2184            }
2185
2186            ::fidl_next::wire::Table::encode_len(table, max_ord);
2187
2188            Ok(())
2189        }
2190    }
2191
2192    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ImageFormatConstraints<'static>, ___E>
2193        for &'a ImageFormatConstraints
2194    where
2195        ___E: ::fidl_next::Encoder + ?Sized,
2196    {
2197        #[inline]
2198        fn encode(
2199            self,
2200            encoder: &mut ___E,
2201            out: &mut ::core::mem::MaybeUninit<crate::wire::ImageFormatConstraints<'static>>,
2202            _: (),
2203        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2204            ::fidl_next::munge!(let crate::wire::ImageFormatConstraints { table } = out);
2205
2206            let max_ord = self.__max_ordinal();
2207
2208            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2209            ::fidl_next::Wire::zero_padding(&mut out);
2210
2211            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2212                ::fidl_next::wire::Envelope,
2213            >(encoder, max_ord);
2214
2215            for i in 1..=max_ord {
2216                match i {
2217                    20 => {
2218                        if let Some(value) = &self.pad_beyond_image_size_bytes {
2219                            ::fidl_next::wire::Envelope::encode_value::<
2220                                ::fidl_next::wire::Uint64,
2221                                ___E,
2222                            >(
2223                                value, preallocated.encoder, &mut out, ()
2224                            )?;
2225                        } else {
2226                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2227                        }
2228                    }
2229
2230                    19 => {
2231                        if let Some(value) = &self.pad_for_block_size {
2232                            ::fidl_next::wire::Envelope::encode_value::<
2233                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2234                                ___E,
2235                            >(
2236                                value, preallocated.encoder, &mut out, ()
2237                            )?;
2238                        } else {
2239                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2240                        }
2241                    }
2242
2243                    18 => {
2244                        if let Some(value) = &self.required_max_size_list {
2245                            ::fidl_next::wire::Envelope::encode_value::<
2246                                ::fidl_next::wire::Vector<
2247                                    'static,
2248                                    ::fidl_next_common_fuchsia_math::wire::SizeU,
2249                                >,
2250                                ___E,
2251                            >(
2252                                value, preallocated.encoder, &mut out, (64, ())
2253                            )?;
2254                        } else {
2255                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2256                        }
2257                    }
2258
2259                    17 => {
2260                        if let Some(value) = &self.is_alpha_present {
2261                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2262                                value,
2263                                preallocated.encoder,
2264                                &mut out,
2265                                (),
2266                            )?;
2267                        } else {
2268                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2269                        }
2270                    }
2271
2272                    16 => {
2273                        if let Some(value) = &self.require_bytes_per_row_at_pixel_boundary {
2274                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2275                                value,
2276                                preallocated.encoder,
2277                                &mut out,
2278                                (),
2279                            )?;
2280                        } else {
2281                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2282                        }
2283                    }
2284
2285                    15 => {
2286                        if let Some(value) = &self.pixel_format_and_modifiers {
2287                            ::fidl_next::wire::Envelope::encode_value::<
2288                                ::fidl_next::wire::Vector<
2289                                    'static,
2290                                    crate::wire::PixelFormatAndModifier,
2291                                >,
2292                                ___E,
2293                            >(
2294                                value, preallocated.encoder, &mut out, (64, ())
2295                            )?;
2296                        } else {
2297                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2298                        }
2299                    }
2300
2301                    14 => {
2302                        if let Some(value) = &self.start_offset_divisor {
2303                            ::fidl_next::wire::Envelope::encode_value::<
2304                                ::fidl_next::wire::Uint32,
2305                                ___E,
2306                            >(
2307                                value, preallocated.encoder, &mut out, ()
2308                            )?;
2309                        } else {
2310                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2311                        }
2312                    }
2313
2314                    13 => {
2315                        if let Some(value) = &self.bytes_per_row_divisor {
2316                            ::fidl_next::wire::Envelope::encode_value::<
2317                                ::fidl_next::wire::Uint32,
2318                                ___E,
2319                            >(
2320                                value, preallocated.encoder, &mut out, ()
2321                            )?;
2322                        } else {
2323                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2324                        }
2325                    }
2326
2327                    12 => {
2328                        if let Some(value) = &self.required_max_size {
2329                            ::fidl_next::wire::Envelope::encode_value::<
2330                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2331                                ___E,
2332                            >(
2333                                value, preallocated.encoder, &mut out, ()
2334                            )?;
2335                        } else {
2336                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2337                        }
2338                    }
2339
2340                    11 => {
2341                        if let Some(value) = &self.required_min_size {
2342                            ::fidl_next::wire::Envelope::encode_value::<
2343                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2344                                ___E,
2345                            >(
2346                                value, preallocated.encoder, &mut out, ()
2347                            )?;
2348                        } else {
2349                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2350                        }
2351                    }
2352
2353                    10 => {
2354                        if let Some(value) = &self.display_rect_alignment {
2355                            ::fidl_next::wire::Envelope::encode_value::<
2356                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2357                                ___E,
2358                            >(
2359                                value, preallocated.encoder, &mut out, ()
2360                            )?;
2361                        } else {
2362                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2363                        }
2364                    }
2365
2366                    9 => {
2367                        if let Some(value) = &self.size_alignment {
2368                            ::fidl_next::wire::Envelope::encode_value::<
2369                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2370                                ___E,
2371                            >(
2372                                value, preallocated.encoder, &mut out, ()
2373                            )?;
2374                        } else {
2375                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2376                        }
2377                    }
2378
2379                    8 => {
2380                        if let Some(value) = &self.max_width_times_height {
2381                            ::fidl_next::wire::Envelope::encode_value::<
2382                                ::fidl_next::wire::Uint64,
2383                                ___E,
2384                            >(
2385                                value, preallocated.encoder, &mut out, ()
2386                            )?;
2387                        } else {
2388                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2389                        }
2390                    }
2391
2392                    7 => {
2393                        if let Some(value) = &self.max_bytes_per_row {
2394                            ::fidl_next::wire::Envelope::encode_value::<
2395                                ::fidl_next::wire::Uint32,
2396                                ___E,
2397                            >(
2398                                value, preallocated.encoder, &mut out, ()
2399                            )?;
2400                        } else {
2401                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2402                        }
2403                    }
2404
2405                    6 => {
2406                        if let Some(value) = &self.min_bytes_per_row {
2407                            ::fidl_next::wire::Envelope::encode_value::<
2408                                ::fidl_next::wire::Uint32,
2409                                ___E,
2410                            >(
2411                                value, preallocated.encoder, &mut out, ()
2412                            )?;
2413                        } else {
2414                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2415                        }
2416                    }
2417
2418                    5 => {
2419                        if let Some(value) = &self.max_size {
2420                            ::fidl_next::wire::Envelope::encode_value::<
2421                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2422                                ___E,
2423                            >(
2424                                value, preallocated.encoder, &mut out, ()
2425                            )?;
2426                        } else {
2427                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2428                        }
2429                    }
2430
2431                    4 => {
2432                        if let Some(value) = &self.min_size {
2433                            ::fidl_next::wire::Envelope::encode_value::<
2434                                ::fidl_next_common_fuchsia_math::wire::SizeU,
2435                                ___E,
2436                            >(
2437                                value, preallocated.encoder, &mut out, ()
2438                            )?;
2439                        } else {
2440                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2441                        }
2442                    }
2443
2444                    3 => {
2445                        if let Some(value) = &self.color_spaces {
2446                            ::fidl_next::wire::Envelope::encode_value::<
2447                                ::fidl_next::wire::Vector<
2448                                    'static,
2449                                    ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
2450                                >,
2451                                ___E,
2452                            >(
2453                                value, preallocated.encoder, &mut out, (32, ())
2454                            )?;
2455                        } else {
2456                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2457                        }
2458                    }
2459
2460                    2 => {
2461                        if let Some(value) = &self.pixel_format_modifier {
2462                            ::fidl_next::wire::Envelope::encode_value::<
2463                                ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
2464                                ___E,
2465                            >(
2466                                value, preallocated.encoder, &mut out, ()
2467                            )?;
2468                        } else {
2469                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2470                        }
2471                    }
2472
2473                    1 => {
2474                        if let Some(value) = &self.pixel_format {
2475                            ::fidl_next::wire::Envelope::encode_value::<
2476                                ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
2477                                ___E,
2478                            >(
2479                                value, preallocated.encoder, &mut out, ()
2480                            )?;
2481                        } else {
2482                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2483                        }
2484                    }
2485
2486                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2487                }
2488                unsafe {
2489                    preallocated.write_next(out.assume_init_ref());
2490                }
2491            }
2492
2493            ::fidl_next::wire::Table::encode_len(table, max_ord);
2494
2495            Ok(())
2496        }
2497    }
2498
2499    impl<'de> ::fidl_next::FromWire<crate::wire::ImageFormatConstraints<'de>>
2500        for ImageFormatConstraints
2501    {
2502        #[inline]
2503        fn from_wire(wire_: crate::wire::ImageFormatConstraints<'de>) -> Self {
2504            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2505
2506            let pixel_format = wire_.table.get(1);
2507
2508            let pixel_format_modifier = wire_.table.get(2);
2509
2510            let color_spaces = wire_.table.get(3);
2511
2512            let min_size = wire_.table.get(4);
2513
2514            let max_size = wire_.table.get(5);
2515
2516            let min_bytes_per_row = wire_.table.get(6);
2517
2518            let max_bytes_per_row = wire_.table.get(7);
2519
2520            let max_width_times_height = wire_.table.get(8);
2521
2522            let size_alignment = wire_.table.get(9);
2523
2524            let display_rect_alignment = wire_.table.get(10);
2525
2526            let required_min_size = wire_.table.get(11);
2527
2528            let required_max_size = wire_.table.get(12);
2529
2530            let bytes_per_row_divisor = wire_.table.get(13);
2531
2532            let start_offset_divisor = wire_.table.get(14);
2533
2534            let pixel_format_and_modifiers = wire_.table.get(15);
2535
2536            let require_bytes_per_row_at_pixel_boundary = wire_.table.get(16);
2537
2538            let is_alpha_present = wire_.table.get(17);
2539
2540            let required_max_size_list = wire_.table.get(18);
2541
2542            let pad_for_block_size = wire_.table.get(19);
2543
2544            let pad_beyond_image_size_bytes = wire_.table.get(20);
2545
2546            Self {
2547
2548
2549                pixel_format: pixel_format.map(|envelope| ::fidl_next::FromWire::from_wire(
2550                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
2551                )),
2552
2553
2554                pixel_format_modifier: pixel_format_modifier.map(|envelope| ::fidl_next::FromWire::from_wire(
2555                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
2556                )),
2557
2558
2559                color_spaces: color_spaces.map(|envelope| ::fidl_next::FromWire::from_wire(
2560                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>>() }
2561                )),
2562
2563
2564                min_size: min_size.map(|envelope| ::fidl_next::FromWire::from_wire(
2565                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2566                )),
2567
2568
2569                max_size: max_size.map(|envelope| ::fidl_next::FromWire::from_wire(
2570                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2571                )),
2572
2573
2574                min_bytes_per_row: min_bytes_per_row.map(|envelope| ::fidl_next::FromWire::from_wire(
2575                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
2576                )),
2577
2578
2579                max_bytes_per_row: max_bytes_per_row.map(|envelope| ::fidl_next::FromWire::from_wire(
2580                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
2581                )),
2582
2583
2584                max_width_times_height: max_width_times_height.map(|envelope| ::fidl_next::FromWire::from_wire(
2585                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
2586                )),
2587
2588
2589                size_alignment: size_alignment.map(|envelope| ::fidl_next::FromWire::from_wire(
2590                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2591                )),
2592
2593
2594                display_rect_alignment: display_rect_alignment.map(|envelope| ::fidl_next::FromWire::from_wire(
2595                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2596                )),
2597
2598
2599                required_min_size: required_min_size.map(|envelope| ::fidl_next::FromWire::from_wire(
2600                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2601                )),
2602
2603
2604                required_max_size: required_max_size.map(|envelope| ::fidl_next::FromWire::from_wire(
2605                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2606                )),
2607
2608
2609                bytes_per_row_divisor: bytes_per_row_divisor.map(|envelope| ::fidl_next::FromWire::from_wire(
2610                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
2611                )),
2612
2613
2614                start_offset_divisor: start_offset_divisor.map(|envelope| ::fidl_next::FromWire::from_wire(
2615                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
2616                )),
2617
2618
2619                pixel_format_and_modifiers: pixel_format_and_modifiers.map(|envelope| ::fidl_next::FromWire::from_wire(
2620                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>>() }
2621                )),
2622
2623
2624                require_bytes_per_row_at_pixel_boundary: require_bytes_per_row_at_pixel_boundary.map(|envelope| ::fidl_next::FromWire::from_wire(
2625                    unsafe { envelope.read_unchecked::<bool>() }
2626                )),
2627
2628
2629                is_alpha_present: is_alpha_present.map(|envelope| ::fidl_next::FromWire::from_wire(
2630                    unsafe { envelope.read_unchecked::<bool>() }
2631                )),
2632
2633
2634                required_max_size_list: required_max_size_list.map(|envelope| ::fidl_next::FromWire::from_wire(
2635                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>>() }
2636                )),
2637
2638
2639                pad_for_block_size: pad_for_block_size.map(|envelope| ::fidl_next::FromWire::from_wire(
2640                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2641                )),
2642
2643
2644                pad_beyond_image_size_bytes: pad_beyond_image_size_bytes.map(|envelope| ::fidl_next::FromWire::from_wire(
2645                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
2646                )),
2647
2648        }
2649        }
2650    }
2651
2652    impl<'de> ::fidl_next::FromWireRef<crate::wire::ImageFormatConstraints<'de>>
2653        for ImageFormatConstraints
2654    {
2655        #[inline]
2656        fn from_wire_ref(wire: &crate::wire::ImageFormatConstraints<'de>) -> Self {
2657            Self {
2658
2659
2660                pixel_format: wire.table.get(1)
2661                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2662                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
2663                    )),
2664
2665
2666                pixel_format_modifier: wire.table.get(2)
2667                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2668                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
2669                    )),
2670
2671
2672                color_spaces: wire.table.get(3)
2673                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2674                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>>() }
2675                    )),
2676
2677
2678                min_size: wire.table.get(4)
2679                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2680                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2681                    )),
2682
2683
2684                max_size: wire.table.get(5)
2685                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2686                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2687                    )),
2688
2689
2690                min_bytes_per_row: wire.table.get(6)
2691                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2692                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
2693                    )),
2694
2695
2696                max_bytes_per_row: wire.table.get(7)
2697                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2698                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
2699                    )),
2700
2701
2702                max_width_times_height: wire.table.get(8)
2703                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2704                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
2705                    )),
2706
2707
2708                size_alignment: wire.table.get(9)
2709                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2710                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2711                    )),
2712
2713
2714                display_rect_alignment: wire.table.get(10)
2715                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2716                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2717                    )),
2718
2719
2720                required_min_size: wire.table.get(11)
2721                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2722                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2723                    )),
2724
2725
2726                required_max_size: wire.table.get(12)
2727                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2728                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2729                    )),
2730
2731
2732                bytes_per_row_divisor: wire.table.get(13)
2733                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2734                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
2735                    )),
2736
2737
2738                start_offset_divisor: wire.table.get(14)
2739                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2740                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
2741                    )),
2742
2743
2744                pixel_format_and_modifiers: wire.table.get(15)
2745                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2746                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>>() }
2747                    )),
2748
2749
2750                require_bytes_per_row_at_pixel_boundary: wire.table.get(16)
2751                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2752                        unsafe { envelope.deref_unchecked::<bool>() }
2753                    )),
2754
2755
2756                is_alpha_present: wire.table.get(17)
2757                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2758                        unsafe { envelope.deref_unchecked::<bool>() }
2759                    )),
2760
2761
2762                required_max_size_list: wire.table.get(18)
2763                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2764                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>>() }
2765                    )),
2766
2767
2768                pad_for_block_size: wire.table.get(19)
2769                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2770                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
2771                    )),
2772
2773
2774                pad_beyond_image_size_bytes: wire.table.get(20)
2775                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2776                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
2777                    )),
2778
2779        }
2780        }
2781    }
2782
2783    #[doc = " Constraints on allocated buffers and, optionally, constraints on images\n stored in the buffers. These constraints can be specified per-participant.\n The sysmem service implements aggregation of constraints from multiple\n participants.\n"]
2784    #[derive(Debug, Default, Clone, PartialEq)]
2785    pub struct BufferCollectionConstraints {
2786        pub usage: ::core::option::Option<crate::natural::BufferUsage>,
2787
2788        pub min_buffer_count_for_camping: ::core::option::Option<u32>,
2789
2790        pub min_buffer_count_for_dedicated_slack: ::core::option::Option<u32>,
2791
2792        pub min_buffer_count_for_shared_slack: ::core::option::Option<u32>,
2793
2794        pub min_buffer_count: ::core::option::Option<u32>,
2795
2796        pub max_buffer_count: ::core::option::Option<u32>,
2797
2798        pub buffer_memory_constraints:
2799            ::core::option::Option<crate::natural::BufferMemoryConstraints>,
2800
2801        pub image_format_constraints:
2802            ::core::option::Option<::std::vec::Vec<crate::natural::ImageFormatConstraints>>,
2803    }
2804
2805    impl BufferCollectionConstraints {
2806        fn __max_ordinal(&self) -> usize {
2807            if self.image_format_constraints.is_some() {
2808                return 8;
2809            }
2810
2811            if self.buffer_memory_constraints.is_some() {
2812                return 7;
2813            }
2814
2815            if self.max_buffer_count.is_some() {
2816                return 6;
2817            }
2818
2819            if self.min_buffer_count.is_some() {
2820                return 5;
2821            }
2822
2823            if self.min_buffer_count_for_shared_slack.is_some() {
2824                return 4;
2825            }
2826
2827            if self.min_buffer_count_for_dedicated_slack.is_some() {
2828                return 3;
2829            }
2830
2831            if self.min_buffer_count_for_camping.is_some() {
2832                return 2;
2833            }
2834
2835            if self.usage.is_some() {
2836                return 1;
2837            }
2838
2839            0
2840        }
2841    }
2842
2843    unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferCollectionConstraints<'static>, ___E>
2844        for BufferCollectionConstraints
2845    where
2846        ___E: ::fidl_next::Encoder + ?Sized,
2847    {
2848        #[inline]
2849        fn encode(
2850            mut self,
2851            encoder: &mut ___E,
2852            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferCollectionConstraints<'static>>,
2853            _: (),
2854        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2855            ::fidl_next::munge!(let crate::wire::BufferCollectionConstraints { table } = out);
2856
2857            let max_ord = self.__max_ordinal();
2858
2859            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2860            ::fidl_next::Wire::zero_padding(&mut out);
2861
2862            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2863                ::fidl_next::wire::Envelope,
2864            >(encoder, max_ord);
2865
2866            for i in 1..=max_ord {
2867                match i {
2868                    8 => {
2869                        if let Some(value) = self.image_format_constraints.take() {
2870                            ::fidl_next::wire::Envelope::encode_value::<
2871                                ::fidl_next::wire::Vector<
2872                                    'static,
2873                                    crate::wire::ImageFormatConstraints<'static>,
2874                                >,
2875                                ___E,
2876                            >(
2877                                value, preallocated.encoder, &mut out, (64, ())
2878                            )?;
2879                        } else {
2880                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2881                        }
2882                    }
2883
2884                    7 => {
2885                        if let Some(value) = self.buffer_memory_constraints.take() {
2886                            ::fidl_next::wire::Envelope::encode_value::<
2887                                crate::wire::BufferMemoryConstraints<'static>,
2888                                ___E,
2889                            >(
2890                                value, preallocated.encoder, &mut out, ()
2891                            )?;
2892                        } else {
2893                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2894                        }
2895                    }
2896
2897                    6 => {
2898                        if let Some(value) = self.max_buffer_count.take() {
2899                            ::fidl_next::wire::Envelope::encode_value::<
2900                                ::fidl_next::wire::Uint32,
2901                                ___E,
2902                            >(
2903                                value, preallocated.encoder, &mut out, ()
2904                            )?;
2905                        } else {
2906                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2907                        }
2908                    }
2909
2910                    5 => {
2911                        if let Some(value) = self.min_buffer_count.take() {
2912                            ::fidl_next::wire::Envelope::encode_value::<
2913                                ::fidl_next::wire::Uint32,
2914                                ___E,
2915                            >(
2916                                value, preallocated.encoder, &mut out, ()
2917                            )?;
2918                        } else {
2919                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2920                        }
2921                    }
2922
2923                    4 => {
2924                        if let Some(value) = self.min_buffer_count_for_shared_slack.take() {
2925                            ::fidl_next::wire::Envelope::encode_value::<
2926                                ::fidl_next::wire::Uint32,
2927                                ___E,
2928                            >(
2929                                value, preallocated.encoder, &mut out, ()
2930                            )?;
2931                        } else {
2932                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2933                        }
2934                    }
2935
2936                    3 => {
2937                        if let Some(value) = self.min_buffer_count_for_dedicated_slack.take() {
2938                            ::fidl_next::wire::Envelope::encode_value::<
2939                                ::fidl_next::wire::Uint32,
2940                                ___E,
2941                            >(
2942                                value, preallocated.encoder, &mut out, ()
2943                            )?;
2944                        } else {
2945                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2946                        }
2947                    }
2948
2949                    2 => {
2950                        if let Some(value) = self.min_buffer_count_for_camping.take() {
2951                            ::fidl_next::wire::Envelope::encode_value::<
2952                                ::fidl_next::wire::Uint32,
2953                                ___E,
2954                            >(
2955                                value, preallocated.encoder, &mut out, ()
2956                            )?;
2957                        } else {
2958                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2959                        }
2960                    }
2961
2962                    1 => {
2963                        if let Some(value) = self.usage.take() {
2964                            ::fidl_next::wire::Envelope::encode_value::<
2965                                crate::wire::BufferUsage<'static>,
2966                                ___E,
2967                            >(
2968                                value, preallocated.encoder, &mut out, ()
2969                            )?;
2970                        } else {
2971                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2972                        }
2973                    }
2974
2975                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2976                }
2977                unsafe {
2978                    preallocated.write_next(out.assume_init_ref());
2979                }
2980            }
2981
2982            ::fidl_next::wire::Table::encode_len(table, max_ord);
2983
2984            Ok(())
2985        }
2986    }
2987
2988    unsafe impl<'a, ___E>
2989        ::fidl_next::Encode<crate::wire::BufferCollectionConstraints<'static>, ___E>
2990        for &'a BufferCollectionConstraints
2991    where
2992        ___E: ::fidl_next::Encoder + ?Sized,
2993    {
2994        #[inline]
2995        fn encode(
2996            self,
2997            encoder: &mut ___E,
2998            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferCollectionConstraints<'static>>,
2999            _: (),
3000        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3001            ::fidl_next::munge!(let crate::wire::BufferCollectionConstraints { table } = out);
3002
3003            let max_ord = self.__max_ordinal();
3004
3005            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3006            ::fidl_next::Wire::zero_padding(&mut out);
3007
3008            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3009                ::fidl_next::wire::Envelope,
3010            >(encoder, max_ord);
3011
3012            for i in 1..=max_ord {
3013                match i {
3014                    8 => {
3015                        if let Some(value) = &self.image_format_constraints {
3016                            ::fidl_next::wire::Envelope::encode_value::<
3017                                ::fidl_next::wire::Vector<
3018                                    'static,
3019                                    crate::wire::ImageFormatConstraints<'static>,
3020                                >,
3021                                ___E,
3022                            >(
3023                                value, preallocated.encoder, &mut out, (64, ())
3024                            )?;
3025                        } else {
3026                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3027                        }
3028                    }
3029
3030                    7 => {
3031                        if let Some(value) = &self.buffer_memory_constraints {
3032                            ::fidl_next::wire::Envelope::encode_value::<
3033                                crate::wire::BufferMemoryConstraints<'static>,
3034                                ___E,
3035                            >(
3036                                value, preallocated.encoder, &mut out, ()
3037                            )?;
3038                        } else {
3039                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3040                        }
3041                    }
3042
3043                    6 => {
3044                        if let Some(value) = &self.max_buffer_count {
3045                            ::fidl_next::wire::Envelope::encode_value::<
3046                                ::fidl_next::wire::Uint32,
3047                                ___E,
3048                            >(
3049                                value, preallocated.encoder, &mut out, ()
3050                            )?;
3051                        } else {
3052                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3053                        }
3054                    }
3055
3056                    5 => {
3057                        if let Some(value) = &self.min_buffer_count {
3058                            ::fidl_next::wire::Envelope::encode_value::<
3059                                ::fidl_next::wire::Uint32,
3060                                ___E,
3061                            >(
3062                                value, preallocated.encoder, &mut out, ()
3063                            )?;
3064                        } else {
3065                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3066                        }
3067                    }
3068
3069                    4 => {
3070                        if let Some(value) = &self.min_buffer_count_for_shared_slack {
3071                            ::fidl_next::wire::Envelope::encode_value::<
3072                                ::fidl_next::wire::Uint32,
3073                                ___E,
3074                            >(
3075                                value, preallocated.encoder, &mut out, ()
3076                            )?;
3077                        } else {
3078                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3079                        }
3080                    }
3081
3082                    3 => {
3083                        if let Some(value) = &self.min_buffer_count_for_dedicated_slack {
3084                            ::fidl_next::wire::Envelope::encode_value::<
3085                                ::fidl_next::wire::Uint32,
3086                                ___E,
3087                            >(
3088                                value, preallocated.encoder, &mut out, ()
3089                            )?;
3090                        } else {
3091                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3092                        }
3093                    }
3094
3095                    2 => {
3096                        if let Some(value) = &self.min_buffer_count_for_camping {
3097                            ::fidl_next::wire::Envelope::encode_value::<
3098                                ::fidl_next::wire::Uint32,
3099                                ___E,
3100                            >(
3101                                value, preallocated.encoder, &mut out, ()
3102                            )?;
3103                        } else {
3104                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3105                        }
3106                    }
3107
3108                    1 => {
3109                        if let Some(value) = &self.usage {
3110                            ::fidl_next::wire::Envelope::encode_value::<
3111                                crate::wire::BufferUsage<'static>,
3112                                ___E,
3113                            >(
3114                                value, preallocated.encoder, &mut out, ()
3115                            )?;
3116                        } else {
3117                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3118                        }
3119                    }
3120
3121                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3122                }
3123                unsafe {
3124                    preallocated.write_next(out.assume_init_ref());
3125                }
3126            }
3127
3128            ::fidl_next::wire::Table::encode_len(table, max_ord);
3129
3130            Ok(())
3131        }
3132    }
3133
3134    impl<'de> ::fidl_next::FromWire<crate::wire::BufferCollectionConstraints<'de>>
3135        for BufferCollectionConstraints
3136    {
3137        #[inline]
3138        fn from_wire(wire_: crate::wire::BufferCollectionConstraints<'de>) -> Self {
3139            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3140
3141            let usage = wire_.table.get(1);
3142
3143            let min_buffer_count_for_camping = wire_.table.get(2);
3144
3145            let min_buffer_count_for_dedicated_slack = wire_.table.get(3);
3146
3147            let min_buffer_count_for_shared_slack = wire_.table.get(4);
3148
3149            let min_buffer_count = wire_.table.get(5);
3150
3151            let max_buffer_count = wire_.table.get(6);
3152
3153            let buffer_memory_constraints = wire_.table.get(7);
3154
3155            let image_format_constraints = wire_.table.get(8);
3156
3157            Self {
3158                usage: usage.map(|envelope| {
3159                    ::fidl_next::FromWire::from_wire(unsafe {
3160                        envelope.read_unchecked::<crate::wire::BufferUsage<'de>>()
3161                    })
3162                }),
3163
3164                min_buffer_count_for_camping: min_buffer_count_for_camping.map(|envelope| {
3165                    ::fidl_next::FromWire::from_wire(unsafe {
3166                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
3167                    })
3168                }),
3169
3170                min_buffer_count_for_dedicated_slack: min_buffer_count_for_dedicated_slack.map(
3171                    |envelope| {
3172                        ::fidl_next::FromWire::from_wire(unsafe {
3173                            envelope.read_unchecked::<::fidl_next::wire::Uint32>()
3174                        })
3175                    },
3176                ),
3177
3178                min_buffer_count_for_shared_slack: min_buffer_count_for_shared_slack.map(
3179                    |envelope| {
3180                        ::fidl_next::FromWire::from_wire(unsafe {
3181                            envelope.read_unchecked::<::fidl_next::wire::Uint32>()
3182                        })
3183                    },
3184                ),
3185
3186                min_buffer_count: min_buffer_count.map(|envelope| {
3187                    ::fidl_next::FromWire::from_wire(unsafe {
3188                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
3189                    })
3190                }),
3191
3192                max_buffer_count: max_buffer_count.map(|envelope| {
3193                    ::fidl_next::FromWire::from_wire(unsafe {
3194                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
3195                    })
3196                }),
3197
3198                buffer_memory_constraints: buffer_memory_constraints.map(|envelope| {
3199                    ::fidl_next::FromWire::from_wire(unsafe {
3200                        envelope.read_unchecked::<crate::wire::BufferMemoryConstraints<'de>>()
3201                    })
3202                }),
3203
3204                image_format_constraints:
3205                    image_format_constraints.map(|envelope| {
3206                        ::fidl_next::FromWire::from_wire(unsafe {
3207                            envelope.read_unchecked::<::fidl_next::wire::Vector<
3208                                'de,
3209                                crate::wire::ImageFormatConstraints<'de>,
3210                            >>()
3211                        })
3212                    }),
3213            }
3214        }
3215    }
3216
3217    impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferCollectionConstraints<'de>>
3218        for BufferCollectionConstraints
3219    {
3220        #[inline]
3221        fn from_wire_ref(wire: &crate::wire::BufferCollectionConstraints<'de>) -> Self {
3222            Self {
3223                usage: wire.table.get(1).map(|envelope| {
3224                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3225                        envelope.deref_unchecked::<crate::wire::BufferUsage<'de>>()
3226                    })
3227                }),
3228
3229                min_buffer_count_for_camping: wire.table.get(2).map(|envelope| {
3230                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3231                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3232                    })
3233                }),
3234
3235                min_buffer_count_for_dedicated_slack: wire.table.get(3).map(|envelope| {
3236                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3237                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3238                    })
3239                }),
3240
3241                min_buffer_count_for_shared_slack: wire.table.get(4).map(|envelope| {
3242                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3243                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3244                    })
3245                }),
3246
3247                min_buffer_count: wire.table.get(5).map(|envelope| {
3248                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3249                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3250                    })
3251                }),
3252
3253                max_buffer_count: wire.table.get(6).map(|envelope| {
3254                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3255                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3256                    })
3257                }),
3258
3259                buffer_memory_constraints: wire.table.get(7).map(|envelope| {
3260                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3261                        envelope.deref_unchecked::<crate::wire::BufferMemoryConstraints<'de>>()
3262                    })
3263                }),
3264
3265                image_format_constraints:
3266                    wire.table.get(8).map(|envelope| {
3267                        ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3268                            envelope.deref_unchecked::<::fidl_next::wire::Vector<
3269                                'de,
3270                                crate::wire::ImageFormatConstraints<'de>,
3271                            >>()
3272                        })
3273                    }),
3274            }
3275        }
3276    }
3277
3278    #[doc = " `INACCESSIBLE` is only for cases where there is no CPU access to the\n buffers.\n\n Device-local memory that isn\'t reachable from the CPU is `CoherencyDomain`\n `INACCESSIBLE`, even if it\'s possible to cause a device (physical or\n virtual) to copy the data from the `INACCESSIBLE` buffers to buffers that\n are visible to the CPU. In other words, INACCESSIBLE does not imply secure,\n but secure implies INACCESSIBLE.\n\n `CPU` means producers must ensure that a consumer can read the produced data\n with the CPU without the consumer needing to do additional cache ops not\n already performed (as needed) by the producer.\n\n `RAM` means producers must ensure that the produced data is entirely present\n in RAM, without any dirty CPU cache lines, and a consumer must invalidate\n (or flush and invalidate, typically) the CPU cache before reading data with\n the CPU. The `RAM` domain can be faster than the `CPU` domain when all\n access is via HW DMA, since in that case no CPU cache ops are required,\n since no participant is actually reading/writing using the CPU.\n"]
3279    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3280    #[repr(u32)]
3281    pub enum CoherencyDomain {
3282        Cpu = 0,
3283        Ram = 1,
3284        Inaccessible = 2,
3285        UnknownOrdinal_(u32) = 3,
3286    }
3287    impl ::std::convert::From<u32> for CoherencyDomain {
3288        fn from(value: u32) -> Self {
3289            match value {
3290                0 => Self::Cpu,
3291                1 => Self::Ram,
3292                2 => Self::Inaccessible,
3293
3294                _ => Self::UnknownOrdinal_(value),
3295            }
3296        }
3297    }
3298
3299    unsafe impl<___E> ::fidl_next::Encode<crate::wire::CoherencyDomain, ___E> for CoherencyDomain
3300    where
3301        ___E: ?Sized,
3302    {
3303        #[inline]
3304        fn encode(
3305            self,
3306            encoder: &mut ___E,
3307            out: &mut ::core::mem::MaybeUninit<crate::wire::CoherencyDomain>,
3308            _: (),
3309        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3310            ::fidl_next::Encode::encode(&self, encoder, out, ())
3311        }
3312    }
3313
3314    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CoherencyDomain, ___E>
3315        for &'a CoherencyDomain
3316    where
3317        ___E: ?Sized,
3318    {
3319        #[inline]
3320        fn encode(
3321            self,
3322            encoder: &mut ___E,
3323            out: &mut ::core::mem::MaybeUninit<crate::wire::CoherencyDomain>,
3324            _: (),
3325        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3326            ::fidl_next::munge!(let crate::wire::CoherencyDomain { value } = out);
3327            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
3328                CoherencyDomain::Cpu => 0,
3329
3330                CoherencyDomain::Ram => 1,
3331
3332                CoherencyDomain::Inaccessible => 2,
3333
3334                CoherencyDomain::UnknownOrdinal_(value) => value,
3335            }));
3336
3337            Ok(())
3338        }
3339    }
3340
3341    impl ::core::convert::From<crate::wire::CoherencyDomain> for CoherencyDomain {
3342        fn from(wire: crate::wire::CoherencyDomain) -> Self {
3343            match u32::from(wire.value) {
3344                0 => Self::Cpu,
3345
3346                1 => Self::Ram,
3347
3348                2 => Self::Inaccessible,
3349
3350                value => Self::UnknownOrdinal_(value),
3351            }
3352        }
3353    }
3354
3355    impl ::fidl_next::FromWire<crate::wire::CoherencyDomain> for CoherencyDomain {
3356        #[inline]
3357        fn from_wire(wire: crate::wire::CoherencyDomain) -> Self {
3358            Self::from(wire)
3359        }
3360    }
3361
3362    impl ::fidl_next::FromWireRef<crate::wire::CoherencyDomain> for CoherencyDomain {
3363        #[inline]
3364        fn from_wire_ref(wire: &crate::wire::CoherencyDomain) -> Self {
3365            Self::from(*wire)
3366        }
3367    }
3368
3369    #[doc = " These are memory-related settings for all buffers of a buffer collection.\n"]
3370    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3371    pub struct BufferMemorySettings {
3372        pub size_bytes: ::core::option::Option<u64>,
3373
3374        pub is_physically_contiguous: ::core::option::Option<bool>,
3375
3376        pub is_secure: ::core::option::Option<bool>,
3377
3378        pub coherency_domain: ::core::option::Option<crate::natural::CoherencyDomain>,
3379
3380        pub heap: ::core::option::Option<crate::natural::Heap>,
3381
3382        pub raw_vmo_size: ::core::option::Option<u64>,
3383    }
3384
3385    impl BufferMemorySettings {
3386        fn __max_ordinal(&self) -> usize {
3387            if self.raw_vmo_size.is_some() {
3388                return 6;
3389            }
3390
3391            if self.heap.is_some() {
3392                return 5;
3393            }
3394
3395            if self.coherency_domain.is_some() {
3396                return 4;
3397            }
3398
3399            if self.is_secure.is_some() {
3400                return 3;
3401            }
3402
3403            if self.is_physically_contiguous.is_some() {
3404                return 2;
3405            }
3406
3407            if self.size_bytes.is_some() {
3408                return 1;
3409            }
3410
3411            0
3412        }
3413    }
3414
3415    unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferMemorySettings<'static>, ___E>
3416        for BufferMemorySettings
3417    where
3418        ___E: ::fidl_next::Encoder + ?Sized,
3419    {
3420        #[inline]
3421        fn encode(
3422            mut self,
3423            encoder: &mut ___E,
3424            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemorySettings<'static>>,
3425            _: (),
3426        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3427            ::fidl_next::munge!(let crate::wire::BufferMemorySettings { table } = out);
3428
3429            let max_ord = self.__max_ordinal();
3430
3431            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3432            ::fidl_next::Wire::zero_padding(&mut out);
3433
3434            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3435                ::fidl_next::wire::Envelope,
3436            >(encoder, max_ord);
3437
3438            for i in 1..=max_ord {
3439                match i {
3440                    6 => {
3441                        if let Some(value) = self.raw_vmo_size.take() {
3442                            ::fidl_next::wire::Envelope::encode_value::<
3443                                ::fidl_next::wire::Uint64,
3444                                ___E,
3445                            >(
3446                                value, preallocated.encoder, &mut out, ()
3447                            )?;
3448                        } else {
3449                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3450                        }
3451                    }
3452
3453                    5 => {
3454                        if let Some(value) = self.heap.take() {
3455                            ::fidl_next::wire::Envelope::encode_value::<
3456                                crate::wire::Heap<'static>,
3457                                ___E,
3458                            >(
3459                                value, preallocated.encoder, &mut out, ()
3460                            )?;
3461                        } else {
3462                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3463                        }
3464                    }
3465
3466                    4 => {
3467                        if let Some(value) = self.coherency_domain.take() {
3468                            ::fidl_next::wire::Envelope::encode_value::<
3469                                crate::wire::CoherencyDomain,
3470                                ___E,
3471                            >(
3472                                value, preallocated.encoder, &mut out, ()
3473                            )?;
3474                        } else {
3475                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3476                        }
3477                    }
3478
3479                    3 => {
3480                        if let Some(value) = self.is_secure.take() {
3481                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3482                                value,
3483                                preallocated.encoder,
3484                                &mut out,
3485                                (),
3486                            )?;
3487                        } else {
3488                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3489                        }
3490                    }
3491
3492                    2 => {
3493                        if let Some(value) = self.is_physically_contiguous.take() {
3494                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3495                                value,
3496                                preallocated.encoder,
3497                                &mut out,
3498                                (),
3499                            )?;
3500                        } else {
3501                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3502                        }
3503                    }
3504
3505                    1 => {
3506                        if let Some(value) = self.size_bytes.take() {
3507                            ::fidl_next::wire::Envelope::encode_value::<
3508                                ::fidl_next::wire::Uint64,
3509                                ___E,
3510                            >(
3511                                value, preallocated.encoder, &mut out, ()
3512                            )?;
3513                        } else {
3514                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3515                        }
3516                    }
3517
3518                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3519                }
3520                unsafe {
3521                    preallocated.write_next(out.assume_init_ref());
3522                }
3523            }
3524
3525            ::fidl_next::wire::Table::encode_len(table, max_ord);
3526
3527            Ok(())
3528        }
3529    }
3530
3531    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BufferMemorySettings<'static>, ___E>
3532        for &'a BufferMemorySettings
3533    where
3534        ___E: ::fidl_next::Encoder + ?Sized,
3535    {
3536        #[inline]
3537        fn encode(
3538            self,
3539            encoder: &mut ___E,
3540            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemorySettings<'static>>,
3541            _: (),
3542        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3543            ::fidl_next::munge!(let crate::wire::BufferMemorySettings { table } = out);
3544
3545            let max_ord = self.__max_ordinal();
3546
3547            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3548            ::fidl_next::Wire::zero_padding(&mut out);
3549
3550            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3551                ::fidl_next::wire::Envelope,
3552            >(encoder, max_ord);
3553
3554            for i in 1..=max_ord {
3555                match i {
3556                    6 => {
3557                        if let Some(value) = &self.raw_vmo_size {
3558                            ::fidl_next::wire::Envelope::encode_value::<
3559                                ::fidl_next::wire::Uint64,
3560                                ___E,
3561                            >(
3562                                value, preallocated.encoder, &mut out, ()
3563                            )?;
3564                        } else {
3565                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3566                        }
3567                    }
3568
3569                    5 => {
3570                        if let Some(value) = &self.heap {
3571                            ::fidl_next::wire::Envelope::encode_value::<
3572                                crate::wire::Heap<'static>,
3573                                ___E,
3574                            >(
3575                                value, preallocated.encoder, &mut out, ()
3576                            )?;
3577                        } else {
3578                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3579                        }
3580                    }
3581
3582                    4 => {
3583                        if let Some(value) = &self.coherency_domain {
3584                            ::fidl_next::wire::Envelope::encode_value::<
3585                                crate::wire::CoherencyDomain,
3586                                ___E,
3587                            >(
3588                                value, preallocated.encoder, &mut out, ()
3589                            )?;
3590                        } else {
3591                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3592                        }
3593                    }
3594
3595                    3 => {
3596                        if let Some(value) = &self.is_secure {
3597                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3598                                value,
3599                                preallocated.encoder,
3600                                &mut out,
3601                                (),
3602                            )?;
3603                        } else {
3604                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3605                        }
3606                    }
3607
3608                    2 => {
3609                        if let Some(value) = &self.is_physically_contiguous {
3610                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3611                                value,
3612                                preallocated.encoder,
3613                                &mut out,
3614                                (),
3615                            )?;
3616                        } else {
3617                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3618                        }
3619                    }
3620
3621                    1 => {
3622                        if let Some(value) = &self.size_bytes {
3623                            ::fidl_next::wire::Envelope::encode_value::<
3624                                ::fidl_next::wire::Uint64,
3625                                ___E,
3626                            >(
3627                                value, preallocated.encoder, &mut out, ()
3628                            )?;
3629                        } else {
3630                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3631                        }
3632                    }
3633
3634                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3635                }
3636                unsafe {
3637                    preallocated.write_next(out.assume_init_ref());
3638                }
3639            }
3640
3641            ::fidl_next::wire::Table::encode_len(table, max_ord);
3642
3643            Ok(())
3644        }
3645    }
3646
3647    impl<'de> ::fidl_next::FromWire<crate::wire::BufferMemorySettings<'de>> for BufferMemorySettings {
3648        #[inline]
3649        fn from_wire(wire_: crate::wire::BufferMemorySettings<'de>) -> Self {
3650            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3651
3652            let size_bytes = wire_.table.get(1);
3653
3654            let is_physically_contiguous = wire_.table.get(2);
3655
3656            let is_secure = wire_.table.get(3);
3657
3658            let coherency_domain = wire_.table.get(4);
3659
3660            let heap = wire_.table.get(5);
3661
3662            let raw_vmo_size = wire_.table.get(6);
3663
3664            Self {
3665                size_bytes: size_bytes.map(|envelope| {
3666                    ::fidl_next::FromWire::from_wire(unsafe {
3667                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
3668                    })
3669                }),
3670
3671                is_physically_contiguous: is_physically_contiguous.map(|envelope| {
3672                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3673                }),
3674
3675                is_secure: is_secure.map(|envelope| {
3676                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3677                }),
3678
3679                coherency_domain: coherency_domain.map(|envelope| {
3680                    ::fidl_next::FromWire::from_wire(unsafe {
3681                        envelope.read_unchecked::<crate::wire::CoherencyDomain>()
3682                    })
3683                }),
3684
3685                heap: heap.map(|envelope| {
3686                    ::fidl_next::FromWire::from_wire(unsafe {
3687                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
3688                    })
3689                }),
3690
3691                raw_vmo_size: raw_vmo_size.map(|envelope| {
3692                    ::fidl_next::FromWire::from_wire(unsafe {
3693                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
3694                    })
3695                }),
3696            }
3697        }
3698    }
3699
3700    impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferMemorySettings<'de>>
3701        for BufferMemorySettings
3702    {
3703        #[inline]
3704        fn from_wire_ref(wire: &crate::wire::BufferMemorySettings<'de>) -> Self {
3705            Self {
3706                size_bytes: wire.table.get(1).map(|envelope| {
3707                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3708                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
3709                    })
3710                }),
3711
3712                is_physically_contiguous: wire.table.get(2).map(|envelope| {
3713                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3714                        envelope.deref_unchecked::<bool>()
3715                    })
3716                }),
3717
3718                is_secure: wire.table.get(3).map(|envelope| {
3719                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3720                        envelope.deref_unchecked::<bool>()
3721                    })
3722                }),
3723
3724                coherency_domain: wire.table.get(4).map(|envelope| {
3725                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3726                        envelope.deref_unchecked::<crate::wire::CoherencyDomain>()
3727                    })
3728                }),
3729
3730                heap: wire.table.get(5).map(|envelope| {
3731                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3732                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
3733                    })
3734                }),
3735
3736                raw_vmo_size: wire.table.get(6).map(|envelope| {
3737                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3738                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
3739                    })
3740                }),
3741            }
3742        }
3743    }
3744
3745    #[doc = " These settings and constraints apply to all the buffers in the collection.\n"]
3746    #[derive(Debug, Default, Clone, PartialEq)]
3747    pub struct SingleBufferSettings {
3748        pub buffer_settings: ::core::option::Option<crate::natural::BufferMemorySettings>,
3749
3750        pub image_format_constraints:
3751            ::core::option::Option<crate::natural::ImageFormatConstraints>,
3752    }
3753
3754    impl SingleBufferSettings {
3755        fn __max_ordinal(&self) -> usize {
3756            if self.image_format_constraints.is_some() {
3757                return 2;
3758            }
3759
3760            if self.buffer_settings.is_some() {
3761                return 1;
3762            }
3763
3764            0
3765        }
3766    }
3767
3768    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SingleBufferSettings<'static>, ___E>
3769        for SingleBufferSettings
3770    where
3771        ___E: ::fidl_next::Encoder + ?Sized,
3772    {
3773        #[inline]
3774        fn encode(
3775            mut self,
3776            encoder: &mut ___E,
3777            out: &mut ::core::mem::MaybeUninit<crate::wire::SingleBufferSettings<'static>>,
3778            _: (),
3779        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3780            ::fidl_next::munge!(let crate::wire::SingleBufferSettings { table } = out);
3781
3782            let max_ord = self.__max_ordinal();
3783
3784            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3785            ::fidl_next::Wire::zero_padding(&mut out);
3786
3787            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3788                ::fidl_next::wire::Envelope,
3789            >(encoder, max_ord);
3790
3791            for i in 1..=max_ord {
3792                match i {
3793                    2 => {
3794                        if let Some(value) = self.image_format_constraints.take() {
3795                            ::fidl_next::wire::Envelope::encode_value::<
3796                                crate::wire::ImageFormatConstraints<'static>,
3797                                ___E,
3798                            >(
3799                                value, preallocated.encoder, &mut out, ()
3800                            )?;
3801                        } else {
3802                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3803                        }
3804                    }
3805
3806                    1 => {
3807                        if let Some(value) = self.buffer_settings.take() {
3808                            ::fidl_next::wire::Envelope::encode_value::<
3809                                crate::wire::BufferMemorySettings<'static>,
3810                                ___E,
3811                            >(
3812                                value, preallocated.encoder, &mut out, ()
3813                            )?;
3814                        } else {
3815                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3816                        }
3817                    }
3818
3819                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3820                }
3821                unsafe {
3822                    preallocated.write_next(out.assume_init_ref());
3823                }
3824            }
3825
3826            ::fidl_next::wire::Table::encode_len(table, max_ord);
3827
3828            Ok(())
3829        }
3830    }
3831
3832    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SingleBufferSettings<'static>, ___E>
3833        for &'a SingleBufferSettings
3834    where
3835        ___E: ::fidl_next::Encoder + ?Sized,
3836    {
3837        #[inline]
3838        fn encode(
3839            self,
3840            encoder: &mut ___E,
3841            out: &mut ::core::mem::MaybeUninit<crate::wire::SingleBufferSettings<'static>>,
3842            _: (),
3843        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3844            ::fidl_next::munge!(let crate::wire::SingleBufferSettings { table } = out);
3845
3846            let max_ord = self.__max_ordinal();
3847
3848            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3849            ::fidl_next::Wire::zero_padding(&mut out);
3850
3851            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3852                ::fidl_next::wire::Envelope,
3853            >(encoder, max_ord);
3854
3855            for i in 1..=max_ord {
3856                match i {
3857                    2 => {
3858                        if let Some(value) = &self.image_format_constraints {
3859                            ::fidl_next::wire::Envelope::encode_value::<
3860                                crate::wire::ImageFormatConstraints<'static>,
3861                                ___E,
3862                            >(
3863                                value, preallocated.encoder, &mut out, ()
3864                            )?;
3865                        } else {
3866                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3867                        }
3868                    }
3869
3870                    1 => {
3871                        if let Some(value) = &self.buffer_settings {
3872                            ::fidl_next::wire::Envelope::encode_value::<
3873                                crate::wire::BufferMemorySettings<'static>,
3874                                ___E,
3875                            >(
3876                                value, preallocated.encoder, &mut out, ()
3877                            )?;
3878                        } else {
3879                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3880                        }
3881                    }
3882
3883                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3884                }
3885                unsafe {
3886                    preallocated.write_next(out.assume_init_ref());
3887                }
3888            }
3889
3890            ::fidl_next::wire::Table::encode_len(table, max_ord);
3891
3892            Ok(())
3893        }
3894    }
3895
3896    impl<'de> ::fidl_next::FromWire<crate::wire::SingleBufferSettings<'de>> for SingleBufferSettings {
3897        #[inline]
3898        fn from_wire(wire_: crate::wire::SingleBufferSettings<'de>) -> Self {
3899            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3900
3901            let buffer_settings = wire_.table.get(1);
3902
3903            let image_format_constraints = wire_.table.get(2);
3904
3905            Self {
3906                buffer_settings: buffer_settings.map(|envelope| {
3907                    ::fidl_next::FromWire::from_wire(unsafe {
3908                        envelope.read_unchecked::<crate::wire::BufferMemorySettings<'de>>()
3909                    })
3910                }),
3911
3912                image_format_constraints: image_format_constraints.map(|envelope| {
3913                    ::fidl_next::FromWire::from_wire(unsafe {
3914                        envelope.read_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
3915                    })
3916                }),
3917            }
3918        }
3919    }
3920
3921    impl<'de> ::fidl_next::FromWireRef<crate::wire::SingleBufferSettings<'de>>
3922        for SingleBufferSettings
3923    {
3924        #[inline]
3925        fn from_wire_ref(wire: &crate::wire::SingleBufferSettings<'de>) -> Self {
3926            Self {
3927                buffer_settings: wire.table.get(1).map(|envelope| {
3928                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3929                        envelope.deref_unchecked::<crate::wire::BufferMemorySettings<'de>>()
3930                    })
3931                }),
3932
3933                image_format_constraints: wire.table.get(2).map(|envelope| {
3934                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3935                        envelope.deref_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
3936                    })
3937                }),
3938            }
3939        }
3940    }
3941
3942    #[doc = " Regardless of which error code, any client retries should be very limited in\n number, if any.\n\n A Error value should never be stored in a zx_status_t, since positive values\n in zx_status_t are deprecated.\n"]
3943    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3944    #[repr(u32)]
3945    pub enum Error {
3946        Invalid = 0,
3947        Unspecified = 1,
3948        ProtocolDeviation = 2,
3949        NotFound = 3,
3950        HandleAccessDenied = 4,
3951        NoMemory = 5,
3952        ConstraintsIntersectionEmpty = 6,
3953        Pending = 7,
3954        TooManyGroupChildCombinations = 8,
3955        NoMoreStrongVmoHandles = 9,
3956        UnknownOrdinal_(u32) = 10,
3957    }
3958    impl ::std::convert::From<u32> for Error {
3959        fn from(value: u32) -> Self {
3960            match value {
3961                0 => Self::Invalid,
3962                1 => Self::Unspecified,
3963                2 => Self::ProtocolDeviation,
3964                3 => Self::NotFound,
3965                4 => Self::HandleAccessDenied,
3966                5 => Self::NoMemory,
3967                6 => Self::ConstraintsIntersectionEmpty,
3968                7 => Self::Pending,
3969                8 => Self::TooManyGroupChildCombinations,
3970                9 => Self::NoMoreStrongVmoHandles,
3971
3972                _ => Self::UnknownOrdinal_(value),
3973            }
3974        }
3975    }
3976
3977    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Error, ___E> for Error
3978    where
3979        ___E: ?Sized,
3980    {
3981        #[inline]
3982        fn encode(
3983            self,
3984            encoder: &mut ___E,
3985            out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
3986            _: (),
3987        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3988            ::fidl_next::Encode::encode(&self, encoder, out, ())
3989        }
3990    }
3991
3992    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Error, ___E> for &'a Error
3993    where
3994        ___E: ?Sized,
3995    {
3996        #[inline]
3997        fn encode(
3998            self,
3999            encoder: &mut ___E,
4000            out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
4001            _: (),
4002        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4003            ::fidl_next::munge!(let crate::wire::Error { value } = out);
4004            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
4005                Error::Invalid => 0,
4006
4007                Error::Unspecified => 1,
4008
4009                Error::ProtocolDeviation => 2,
4010
4011                Error::NotFound => 3,
4012
4013                Error::HandleAccessDenied => 4,
4014
4015                Error::NoMemory => 5,
4016
4017                Error::ConstraintsIntersectionEmpty => 6,
4018
4019                Error::Pending => 7,
4020
4021                Error::TooManyGroupChildCombinations => 8,
4022
4023                Error::NoMoreStrongVmoHandles => 9,
4024
4025                Error::UnknownOrdinal_(value) => value,
4026            }));
4027
4028            Ok(())
4029        }
4030    }
4031
4032    impl ::core::convert::From<crate::wire::Error> for Error {
4033        fn from(wire: crate::wire::Error) -> Self {
4034            match u32::from(wire.value) {
4035                0 => Self::Invalid,
4036
4037                1 => Self::Unspecified,
4038
4039                2 => Self::ProtocolDeviation,
4040
4041                3 => Self::NotFound,
4042
4043                4 => Self::HandleAccessDenied,
4044
4045                5 => Self::NoMemory,
4046
4047                6 => Self::ConstraintsIntersectionEmpty,
4048
4049                7 => Self::Pending,
4050
4051                8 => Self::TooManyGroupChildCombinations,
4052
4053                9 => Self::NoMoreStrongVmoHandles,
4054
4055                value => Self::UnknownOrdinal_(value),
4056            }
4057        }
4058    }
4059
4060    impl ::fidl_next::FromWire<crate::wire::Error> for Error {
4061        #[inline]
4062        fn from_wire(wire: crate::wire::Error) -> Self {
4063            Self::from(wire)
4064        }
4065    }
4066
4067    impl ::fidl_next::FromWireRef<crate::wire::Error> for Error {
4068        #[inline]
4069        fn from_wire_ref(wire: &crate::wire::Error) -> Self {
4070            Self::from(*wire)
4071        }
4072    }
4073
4074    pub type NodeSyncResponse = ();
4075
4076    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4077    pub struct NodeSetNameRequest {
4078        pub priority: ::core::option::Option<u32>,
4079
4080        pub name: ::core::option::Option<::std::string::String>,
4081    }
4082
4083    impl NodeSetNameRequest {
4084        fn __max_ordinal(&self) -> usize {
4085            if self.name.is_some() {
4086                return 2;
4087            }
4088
4089            if self.priority.is_some() {
4090                return 1;
4091            }
4092
4093            0
4094        }
4095    }
4096
4097    unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeSetNameRequest<'static>, ___E>
4098        for NodeSetNameRequest
4099    where
4100        ___E: ::fidl_next::Encoder + ?Sized,
4101    {
4102        #[inline]
4103        fn encode(
4104            mut self,
4105            encoder: &mut ___E,
4106            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetNameRequest<'static>>,
4107            _: (),
4108        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4109            ::fidl_next::munge!(let crate::wire::NodeSetNameRequest { table } = out);
4110
4111            let max_ord = self.__max_ordinal();
4112
4113            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4114            ::fidl_next::Wire::zero_padding(&mut out);
4115
4116            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4117                ::fidl_next::wire::Envelope,
4118            >(encoder, max_ord);
4119
4120            for i in 1..=max_ord {
4121                match i {
4122                    2 => {
4123                        if let Some(value) = self.name.take() {
4124                            ::fidl_next::wire::Envelope::encode_value::<
4125                                ::fidl_next::wire::String<'static>,
4126                                ___E,
4127                            >(
4128                                value, preallocated.encoder, &mut out, 64
4129                            )?;
4130                        } else {
4131                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4132                        }
4133                    }
4134
4135                    1 => {
4136                        if let Some(value) = self.priority.take() {
4137                            ::fidl_next::wire::Envelope::encode_value::<
4138                                ::fidl_next::wire::Uint32,
4139                                ___E,
4140                            >(
4141                                value, preallocated.encoder, &mut out, ()
4142                            )?;
4143                        } else {
4144                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4145                        }
4146                    }
4147
4148                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4149                }
4150                unsafe {
4151                    preallocated.write_next(out.assume_init_ref());
4152                }
4153            }
4154
4155            ::fidl_next::wire::Table::encode_len(table, max_ord);
4156
4157            Ok(())
4158        }
4159    }
4160
4161    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeSetNameRequest<'static>, ___E>
4162        for &'a NodeSetNameRequest
4163    where
4164        ___E: ::fidl_next::Encoder + ?Sized,
4165    {
4166        #[inline]
4167        fn encode(
4168            self,
4169            encoder: &mut ___E,
4170            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetNameRequest<'static>>,
4171            _: (),
4172        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4173            ::fidl_next::munge!(let crate::wire::NodeSetNameRequest { table } = out);
4174
4175            let max_ord = self.__max_ordinal();
4176
4177            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4178            ::fidl_next::Wire::zero_padding(&mut out);
4179
4180            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4181                ::fidl_next::wire::Envelope,
4182            >(encoder, max_ord);
4183
4184            for i in 1..=max_ord {
4185                match i {
4186                    2 => {
4187                        if let Some(value) = &self.name {
4188                            ::fidl_next::wire::Envelope::encode_value::<
4189                                ::fidl_next::wire::String<'static>,
4190                                ___E,
4191                            >(
4192                                value, preallocated.encoder, &mut out, 64
4193                            )?;
4194                        } else {
4195                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4196                        }
4197                    }
4198
4199                    1 => {
4200                        if let Some(value) = &self.priority {
4201                            ::fidl_next::wire::Envelope::encode_value::<
4202                                ::fidl_next::wire::Uint32,
4203                                ___E,
4204                            >(
4205                                value, preallocated.encoder, &mut out, ()
4206                            )?;
4207                        } else {
4208                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4209                        }
4210                    }
4211
4212                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4213                }
4214                unsafe {
4215                    preallocated.write_next(out.assume_init_ref());
4216                }
4217            }
4218
4219            ::fidl_next::wire::Table::encode_len(table, max_ord);
4220
4221            Ok(())
4222        }
4223    }
4224
4225    impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetNameRequest<'de>> for NodeSetNameRequest {
4226        #[inline]
4227        fn from_wire(wire_: crate::wire::NodeSetNameRequest<'de>) -> Self {
4228            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4229
4230            let priority = wire_.table.get(1);
4231
4232            let name = wire_.table.get(2);
4233
4234            Self {
4235                priority: priority.map(|envelope| {
4236                    ::fidl_next::FromWire::from_wire(unsafe {
4237                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
4238                    })
4239                }),
4240
4241                name: name.map(|envelope| {
4242                    ::fidl_next::FromWire::from_wire(unsafe {
4243                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4244                    })
4245                }),
4246            }
4247        }
4248    }
4249
4250    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetNameRequest<'de>> for NodeSetNameRequest {
4251        #[inline]
4252        fn from_wire_ref(wire: &crate::wire::NodeSetNameRequest<'de>) -> Self {
4253            Self {
4254                priority: wire.table.get(1).map(|envelope| {
4255                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4256                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
4257                    })
4258                }),
4259
4260                name: wire.table.get(2).map(|envelope| {
4261                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4262                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4263                    })
4264                }),
4265            }
4266        }
4267    }
4268
4269    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4270    pub struct NodeSetDebugClientInfoRequest {
4271        pub name: ::core::option::Option<::std::string::String>,
4272
4273        pub id: ::core::option::Option<u64>,
4274    }
4275
4276    impl NodeSetDebugClientInfoRequest {
4277        fn __max_ordinal(&self) -> usize {
4278            if self.id.is_some() {
4279                return 2;
4280            }
4281
4282            if self.name.is_some() {
4283                return 1;
4284            }
4285
4286            0
4287        }
4288    }
4289
4290    unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeSetDebugClientInfoRequest<'static>, ___E>
4291        for NodeSetDebugClientInfoRequest
4292    where
4293        ___E: ::fidl_next::Encoder + ?Sized,
4294    {
4295        #[inline]
4296        fn encode(
4297            mut self,
4298            encoder: &mut ___E,
4299            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetDebugClientInfoRequest<'static>>,
4300            _: (),
4301        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4302            ::fidl_next::munge!(let crate::wire::NodeSetDebugClientInfoRequest { table } = out);
4303
4304            let max_ord = self.__max_ordinal();
4305
4306            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4307            ::fidl_next::Wire::zero_padding(&mut out);
4308
4309            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4310                ::fidl_next::wire::Envelope,
4311            >(encoder, max_ord);
4312
4313            for i in 1..=max_ord {
4314                match i {
4315                    2 => {
4316                        if let Some(value) = self.id.take() {
4317                            ::fidl_next::wire::Envelope::encode_value::<
4318                                ::fidl_next::wire::Uint64,
4319                                ___E,
4320                            >(
4321                                value, preallocated.encoder, &mut out, ()
4322                            )?;
4323                        } else {
4324                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4325                        }
4326                    }
4327
4328                    1 => {
4329                        if let Some(value) = self.name.take() {
4330                            ::fidl_next::wire::Envelope::encode_value::<
4331                                ::fidl_next::wire::String<'static>,
4332                                ___E,
4333                            >(
4334                                value, preallocated.encoder, &mut out, 256
4335                            )?;
4336                        } else {
4337                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4338                        }
4339                    }
4340
4341                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4342                }
4343                unsafe {
4344                    preallocated.write_next(out.assume_init_ref());
4345                }
4346            }
4347
4348            ::fidl_next::wire::Table::encode_len(table, max_ord);
4349
4350            Ok(())
4351        }
4352    }
4353
4354    unsafe impl<'a, ___E>
4355        ::fidl_next::Encode<crate::wire::NodeSetDebugClientInfoRequest<'static>, ___E>
4356        for &'a NodeSetDebugClientInfoRequest
4357    where
4358        ___E: ::fidl_next::Encoder + ?Sized,
4359    {
4360        #[inline]
4361        fn encode(
4362            self,
4363            encoder: &mut ___E,
4364            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetDebugClientInfoRequest<'static>>,
4365            _: (),
4366        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4367            ::fidl_next::munge!(let crate::wire::NodeSetDebugClientInfoRequest { table } = out);
4368
4369            let max_ord = self.__max_ordinal();
4370
4371            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4372            ::fidl_next::Wire::zero_padding(&mut out);
4373
4374            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4375                ::fidl_next::wire::Envelope,
4376            >(encoder, max_ord);
4377
4378            for i in 1..=max_ord {
4379                match i {
4380                    2 => {
4381                        if let Some(value) = &self.id {
4382                            ::fidl_next::wire::Envelope::encode_value::<
4383                                ::fidl_next::wire::Uint64,
4384                                ___E,
4385                            >(
4386                                value, preallocated.encoder, &mut out, ()
4387                            )?;
4388                        } else {
4389                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4390                        }
4391                    }
4392
4393                    1 => {
4394                        if let Some(value) = &self.name {
4395                            ::fidl_next::wire::Envelope::encode_value::<
4396                                ::fidl_next::wire::String<'static>,
4397                                ___E,
4398                            >(
4399                                value, preallocated.encoder, &mut out, 256
4400                            )?;
4401                        } else {
4402                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4403                        }
4404                    }
4405
4406                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4407                }
4408                unsafe {
4409                    preallocated.write_next(out.assume_init_ref());
4410                }
4411            }
4412
4413            ::fidl_next::wire::Table::encode_len(table, max_ord);
4414
4415            Ok(())
4416        }
4417    }
4418
4419    impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetDebugClientInfoRequest<'de>>
4420        for NodeSetDebugClientInfoRequest
4421    {
4422        #[inline]
4423        fn from_wire(wire_: crate::wire::NodeSetDebugClientInfoRequest<'de>) -> Self {
4424            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4425
4426            let name = wire_.table.get(1);
4427
4428            let id = wire_.table.get(2);
4429
4430            Self {
4431                name: name.map(|envelope| {
4432                    ::fidl_next::FromWire::from_wire(unsafe {
4433                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4434                    })
4435                }),
4436
4437                id: id.map(|envelope| {
4438                    ::fidl_next::FromWire::from_wire(unsafe {
4439                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
4440                    })
4441                }),
4442            }
4443        }
4444    }
4445
4446    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetDebugClientInfoRequest<'de>>
4447        for NodeSetDebugClientInfoRequest
4448    {
4449        #[inline]
4450        fn from_wire_ref(wire: &crate::wire::NodeSetDebugClientInfoRequest<'de>) -> Self {
4451            Self {
4452                name: wire.table.get(1).map(|envelope| {
4453                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4454                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4455                    })
4456                }),
4457
4458                id: wire.table.get(2).map(|envelope| {
4459                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4460                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
4461                    })
4462                }),
4463            }
4464        }
4465    }
4466
4467    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4468    pub struct NodeSetDebugTimeoutLogDeadlineRequest {
4469        pub deadline: ::core::option::Option<i64>,
4470    }
4471
4472    impl NodeSetDebugTimeoutLogDeadlineRequest {
4473        fn __max_ordinal(&self) -> usize {
4474            if self.deadline.is_some() {
4475                return 1;
4476            }
4477
4478            0
4479        }
4480    }
4481
4482    unsafe impl<___E>
4483        ::fidl_next::Encode<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>, ___E>
4484        for NodeSetDebugTimeoutLogDeadlineRequest
4485    where
4486        ___E: ::fidl_next::Encoder + ?Sized,
4487    {
4488        #[inline]
4489        fn encode(
4490            mut self,
4491            encoder: &mut ___E,
4492            out: &mut ::core::mem::MaybeUninit<
4493                crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>,
4494            >,
4495            _: (),
4496        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4497            ::fidl_next::munge!(let crate::wire::NodeSetDebugTimeoutLogDeadlineRequest { table } = out);
4498
4499            let max_ord = self.__max_ordinal();
4500
4501            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4502            ::fidl_next::Wire::zero_padding(&mut out);
4503
4504            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4505                ::fidl_next::wire::Envelope,
4506            >(encoder, max_ord);
4507
4508            for i in 1..=max_ord {
4509                match i {
4510                    1 => {
4511                        if let Some(value) = self.deadline.take() {
4512                            ::fidl_next::wire::Envelope::encode_value::<
4513                                ::fidl_next::wire::Int64,
4514                                ___E,
4515                            >(
4516                                value, preallocated.encoder, &mut out, ()
4517                            )?;
4518                        } else {
4519                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4520                        }
4521                    }
4522
4523                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4524                }
4525                unsafe {
4526                    preallocated.write_next(out.assume_init_ref());
4527                }
4528            }
4529
4530            ::fidl_next::wire::Table::encode_len(table, max_ord);
4531
4532            Ok(())
4533        }
4534    }
4535
4536    unsafe impl<'a, ___E>
4537        ::fidl_next::Encode<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>, ___E>
4538        for &'a NodeSetDebugTimeoutLogDeadlineRequest
4539    where
4540        ___E: ::fidl_next::Encoder + ?Sized,
4541    {
4542        #[inline]
4543        fn encode(
4544            self,
4545            encoder: &mut ___E,
4546            out: &mut ::core::mem::MaybeUninit<
4547                crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>,
4548            >,
4549            _: (),
4550        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4551            ::fidl_next::munge!(let crate::wire::NodeSetDebugTimeoutLogDeadlineRequest { table } = out);
4552
4553            let max_ord = self.__max_ordinal();
4554
4555            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4556            ::fidl_next::Wire::zero_padding(&mut out);
4557
4558            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4559                ::fidl_next::wire::Envelope,
4560            >(encoder, max_ord);
4561
4562            for i in 1..=max_ord {
4563                match i {
4564                    1 => {
4565                        if let Some(value) = &self.deadline {
4566                            ::fidl_next::wire::Envelope::encode_value::<
4567                                ::fidl_next::wire::Int64,
4568                                ___E,
4569                            >(
4570                                value, preallocated.encoder, &mut out, ()
4571                            )?;
4572                        } else {
4573                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4574                        }
4575                    }
4576
4577                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4578                }
4579                unsafe {
4580                    preallocated.write_next(out.assume_init_ref());
4581                }
4582            }
4583
4584            ::fidl_next::wire::Table::encode_len(table, max_ord);
4585
4586            Ok(())
4587        }
4588    }
4589
4590    impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>>
4591        for NodeSetDebugTimeoutLogDeadlineRequest
4592    {
4593        #[inline]
4594        fn from_wire(wire_: crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>) -> Self {
4595            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4596
4597            let deadline = wire_.table.get(1);
4598
4599            Self {
4600                deadline: deadline.map(|envelope| {
4601                    ::fidl_next::FromWire::from_wire(unsafe {
4602                        envelope.read_unchecked::<::fidl_next::wire::Int64>()
4603                    })
4604                }),
4605            }
4606        }
4607    }
4608
4609    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>>
4610        for NodeSetDebugTimeoutLogDeadlineRequest
4611    {
4612        #[inline]
4613        fn from_wire_ref(wire: &crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>) -> Self {
4614            Self {
4615                deadline: wire.table.get(1).map(|envelope| {
4616                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4617                        envelope.deref_unchecked::<::fidl_next::wire::Int64>()
4618                    })
4619                }),
4620            }
4621        }
4622    }
4623
4624    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4625    pub struct NodeIsAlternateForResponse {
4626        pub is_alternate: ::core::option::Option<bool>,
4627    }
4628
4629    impl NodeIsAlternateForResponse {
4630        fn __max_ordinal(&self) -> usize {
4631            if self.is_alternate.is_some() {
4632                return 1;
4633            }
4634
4635            0
4636        }
4637    }
4638
4639    unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeIsAlternateForResponse<'static>, ___E>
4640        for NodeIsAlternateForResponse
4641    where
4642        ___E: ::fidl_next::Encoder + ?Sized,
4643    {
4644        #[inline]
4645        fn encode(
4646            mut self,
4647            encoder: &mut ___E,
4648            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeIsAlternateForResponse<'static>>,
4649            _: (),
4650        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4651            ::fidl_next::munge!(let crate::wire::NodeIsAlternateForResponse { table } = out);
4652
4653            let max_ord = self.__max_ordinal();
4654
4655            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4656            ::fidl_next::Wire::zero_padding(&mut out);
4657
4658            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4659                ::fidl_next::wire::Envelope,
4660            >(encoder, max_ord);
4661
4662            for i in 1..=max_ord {
4663                match i {
4664                    1 => {
4665                        if let Some(value) = self.is_alternate.take() {
4666                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
4667                                value,
4668                                preallocated.encoder,
4669                                &mut out,
4670                                (),
4671                            )?;
4672                        } else {
4673                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4674                        }
4675                    }
4676
4677                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4678                }
4679                unsafe {
4680                    preallocated.write_next(out.assume_init_ref());
4681                }
4682            }
4683
4684            ::fidl_next::wire::Table::encode_len(table, max_ord);
4685
4686            Ok(())
4687        }
4688    }
4689
4690    unsafe impl<'a, ___E>
4691        ::fidl_next::Encode<crate::wire::NodeIsAlternateForResponse<'static>, ___E>
4692        for &'a NodeIsAlternateForResponse
4693    where
4694        ___E: ::fidl_next::Encoder + ?Sized,
4695    {
4696        #[inline]
4697        fn encode(
4698            self,
4699            encoder: &mut ___E,
4700            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeIsAlternateForResponse<'static>>,
4701            _: (),
4702        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4703            ::fidl_next::munge!(let crate::wire::NodeIsAlternateForResponse { table } = out);
4704
4705            let max_ord = self.__max_ordinal();
4706
4707            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4708            ::fidl_next::Wire::zero_padding(&mut out);
4709
4710            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4711                ::fidl_next::wire::Envelope,
4712            >(encoder, max_ord);
4713
4714            for i in 1..=max_ord {
4715                match i {
4716                    1 => {
4717                        if let Some(value) = &self.is_alternate {
4718                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
4719                                value,
4720                                preallocated.encoder,
4721                                &mut out,
4722                                (),
4723                            )?;
4724                        } else {
4725                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4726                        }
4727                    }
4728
4729                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4730                }
4731                unsafe {
4732                    preallocated.write_next(out.assume_init_ref());
4733                }
4734            }
4735
4736            ::fidl_next::wire::Table::encode_len(table, max_ord);
4737
4738            Ok(())
4739        }
4740    }
4741
4742    impl<'de> ::fidl_next::FromWire<crate::wire::NodeIsAlternateForResponse<'de>>
4743        for NodeIsAlternateForResponse
4744    {
4745        #[inline]
4746        fn from_wire(wire_: crate::wire::NodeIsAlternateForResponse<'de>) -> Self {
4747            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4748
4749            let is_alternate = wire_.table.get(1);
4750
4751            Self {
4752                is_alternate: is_alternate.map(|envelope| {
4753                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
4754                }),
4755            }
4756        }
4757    }
4758
4759    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeIsAlternateForResponse<'de>>
4760        for NodeIsAlternateForResponse
4761    {
4762        #[inline]
4763        fn from_wire_ref(wire: &crate::wire::NodeIsAlternateForResponse<'de>) -> Self {
4764            Self {
4765                is_alternate: wire.table.get(1).map(|envelope| {
4766                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4767                        envelope.deref_unchecked::<bool>()
4768                    })
4769                }),
4770            }
4771        }
4772    }
4773
4774    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4775    pub struct NodeGetBufferCollectionIdResponse {
4776        pub buffer_collection_id: ::core::option::Option<u64>,
4777    }
4778
4779    impl NodeGetBufferCollectionIdResponse {
4780        fn __max_ordinal(&self) -> usize {
4781            if self.buffer_collection_id.is_some() {
4782                return 1;
4783            }
4784
4785            0
4786        }
4787    }
4788
4789    unsafe impl<___E>
4790        ::fidl_next::Encode<crate::wire::NodeGetBufferCollectionIdResponse<'static>, ___E>
4791        for NodeGetBufferCollectionIdResponse
4792    where
4793        ___E: ::fidl_next::Encoder + ?Sized,
4794    {
4795        #[inline]
4796        fn encode(
4797            mut self,
4798            encoder: &mut ___E,
4799            out: &mut ::core::mem::MaybeUninit<
4800                crate::wire::NodeGetBufferCollectionIdResponse<'static>,
4801            >,
4802            _: (),
4803        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4804            ::fidl_next::munge!(let crate::wire::NodeGetBufferCollectionIdResponse { table } = out);
4805
4806            let max_ord = self.__max_ordinal();
4807
4808            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4809            ::fidl_next::Wire::zero_padding(&mut out);
4810
4811            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4812                ::fidl_next::wire::Envelope,
4813            >(encoder, max_ord);
4814
4815            for i in 1..=max_ord {
4816                match i {
4817                    1 => {
4818                        if let Some(value) = self.buffer_collection_id.take() {
4819                            ::fidl_next::wire::Envelope::encode_value::<
4820                                ::fidl_next::wire::Uint64,
4821                                ___E,
4822                            >(
4823                                value, preallocated.encoder, &mut out, ()
4824                            )?;
4825                        } else {
4826                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4827                        }
4828                    }
4829
4830                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4831                }
4832                unsafe {
4833                    preallocated.write_next(out.assume_init_ref());
4834                }
4835            }
4836
4837            ::fidl_next::wire::Table::encode_len(table, max_ord);
4838
4839            Ok(())
4840        }
4841    }
4842
4843    unsafe impl<'a, ___E>
4844        ::fidl_next::Encode<crate::wire::NodeGetBufferCollectionIdResponse<'static>, ___E>
4845        for &'a NodeGetBufferCollectionIdResponse
4846    where
4847        ___E: ::fidl_next::Encoder + ?Sized,
4848    {
4849        #[inline]
4850        fn encode(
4851            self,
4852            encoder: &mut ___E,
4853            out: &mut ::core::mem::MaybeUninit<
4854                crate::wire::NodeGetBufferCollectionIdResponse<'static>,
4855            >,
4856            _: (),
4857        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4858            ::fidl_next::munge!(let crate::wire::NodeGetBufferCollectionIdResponse { table } = out);
4859
4860            let max_ord = self.__max_ordinal();
4861
4862            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4863            ::fidl_next::Wire::zero_padding(&mut out);
4864
4865            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4866                ::fidl_next::wire::Envelope,
4867            >(encoder, max_ord);
4868
4869            for i in 1..=max_ord {
4870                match i {
4871                    1 => {
4872                        if let Some(value) = &self.buffer_collection_id {
4873                            ::fidl_next::wire::Envelope::encode_value::<
4874                                ::fidl_next::wire::Uint64,
4875                                ___E,
4876                            >(
4877                                value, preallocated.encoder, &mut out, ()
4878                            )?;
4879                        } else {
4880                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4881                        }
4882                    }
4883
4884                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4885                }
4886                unsafe {
4887                    preallocated.write_next(out.assume_init_ref());
4888                }
4889            }
4890
4891            ::fidl_next::wire::Table::encode_len(table, max_ord);
4892
4893            Ok(())
4894        }
4895    }
4896
4897    impl<'de> ::fidl_next::FromWire<crate::wire::NodeGetBufferCollectionIdResponse<'de>>
4898        for NodeGetBufferCollectionIdResponse
4899    {
4900        #[inline]
4901        fn from_wire(wire_: crate::wire::NodeGetBufferCollectionIdResponse<'de>) -> Self {
4902            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4903
4904            let buffer_collection_id = wire_.table.get(1);
4905
4906            Self {
4907                buffer_collection_id: buffer_collection_id.map(|envelope| {
4908                    ::fidl_next::FromWire::from_wire(unsafe {
4909                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
4910                    })
4911                }),
4912            }
4913        }
4914    }
4915
4916    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeGetBufferCollectionIdResponse<'de>>
4917        for NodeGetBufferCollectionIdResponse
4918    {
4919        #[inline]
4920        fn from_wire_ref(wire: &crate::wire::NodeGetBufferCollectionIdResponse<'de>) -> Self {
4921            Self {
4922                buffer_collection_id: wire.table.get(1).map(|envelope| {
4923                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4924                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
4925                    })
4926                }),
4927            }
4928        }
4929    }
4930
4931    pub type BufferCollectionCheckAllBuffersAllocatedResponse = ();
4932
4933    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4934    pub struct BufferCollectionTokenDuplicateSyncRequest {
4935        pub rights_attenuation_masks:
4936            ::core::option::Option<::std::vec::Vec<::fidl_next::fuchsia::zx::Rights>>,
4937    }
4938
4939    impl BufferCollectionTokenDuplicateSyncRequest {
4940        fn __max_ordinal(&self) -> usize {
4941            if self.rights_attenuation_masks.is_some() {
4942                return 1;
4943            }
4944
4945            0
4946        }
4947    }
4948
4949    unsafe impl<___E>
4950        ::fidl_next::Encode<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>, ___E>
4951        for BufferCollectionTokenDuplicateSyncRequest
4952    where
4953        ___E: ::fidl_next::Encoder + ?Sized,
4954    {
4955        #[inline]
4956        fn encode(
4957            mut self,
4958            encoder: &mut ___E,
4959            out: &mut ::core::mem::MaybeUninit<
4960                crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>,
4961            >,
4962            _: (),
4963        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4964            ::fidl_next::munge!(let crate::wire::BufferCollectionTokenDuplicateSyncRequest { table } = out);
4965
4966            let max_ord = self.__max_ordinal();
4967
4968            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4969            ::fidl_next::Wire::zero_padding(&mut out);
4970
4971            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4972                ::fidl_next::wire::Envelope,
4973            >(encoder, max_ord);
4974
4975            for i in 1..=max_ord {
4976                match i {
4977                    1 => {
4978                        if let Some(value) = self.rights_attenuation_masks.take() {
4979                            ::fidl_next::wire::Envelope::encode_value::<
4980                                ::fidl_next::wire::Vector<
4981                                    'static,
4982                                    ::fidl_next::wire::fuchsia::Rights,
4983                                >,
4984                                ___E,
4985                            >(
4986                                value, preallocated.encoder, &mut out, (64, ())
4987                            )?;
4988                        } else {
4989                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4990                        }
4991                    }
4992
4993                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4994                }
4995                unsafe {
4996                    preallocated.write_next(out.assume_init_ref());
4997                }
4998            }
4999
5000            ::fidl_next::wire::Table::encode_len(table, max_ord);
5001
5002            Ok(())
5003        }
5004    }
5005
5006    unsafe impl<'a, ___E>
5007        ::fidl_next::Encode<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>, ___E>
5008        for &'a BufferCollectionTokenDuplicateSyncRequest
5009    where
5010        ___E: ::fidl_next::Encoder + ?Sized,
5011    {
5012        #[inline]
5013        fn encode(
5014            self,
5015            encoder: &mut ___E,
5016            out: &mut ::core::mem::MaybeUninit<
5017                crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>,
5018            >,
5019            _: (),
5020        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5021            ::fidl_next::munge!(let crate::wire::BufferCollectionTokenDuplicateSyncRequest { table } = out);
5022
5023            let max_ord = self.__max_ordinal();
5024
5025            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5026            ::fidl_next::Wire::zero_padding(&mut out);
5027
5028            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5029                ::fidl_next::wire::Envelope,
5030            >(encoder, max_ord);
5031
5032            for i in 1..=max_ord {
5033                match i {
5034                    1 => {
5035                        if let Some(value) = &self.rights_attenuation_masks {
5036                            ::fidl_next::wire::Envelope::encode_value::<
5037                                ::fidl_next::wire::Vector<
5038                                    'static,
5039                                    ::fidl_next::wire::fuchsia::Rights,
5040                                >,
5041                                ___E,
5042                            >(
5043                                value, preallocated.encoder, &mut out, (64, ())
5044                            )?;
5045                        } else {
5046                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5047                        }
5048                    }
5049
5050                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5051                }
5052                unsafe {
5053                    preallocated.write_next(out.assume_init_ref());
5054                }
5055            }
5056
5057            ::fidl_next::wire::Table::encode_len(table, max_ord);
5058
5059            Ok(())
5060        }
5061    }
5062
5063    impl<'de> ::fidl_next::FromWire<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>>
5064        for BufferCollectionTokenDuplicateSyncRequest
5065    {
5066        #[inline]
5067        fn from_wire(wire_: crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>) -> Self {
5068            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5069
5070            let rights_attenuation_masks = wire_.table.get(1);
5071
5072            Self {
5073
5074
5075                rights_attenuation_masks: rights_attenuation_masks.map(|envelope| ::fidl_next::FromWire::from_wire(
5076                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5077                )),
5078
5079        }
5080        }
5081    }
5082
5083    impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>>
5084        for BufferCollectionTokenDuplicateSyncRequest
5085    {
5086        #[inline]
5087        fn from_wire_ref(
5088            wire: &crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>,
5089        ) -> Self {
5090            Self {
5091
5092
5093                rights_attenuation_masks: wire.table.get(1)
5094                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5095                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5096                    )),
5097
5098        }
5099        }
5100    }
5101
5102    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5103    pub struct BufferCollectionTokenGroupCreateChildrenSyncRequest {
5104        pub rights_attenuation_masks:
5105            ::core::option::Option<::std::vec::Vec<::fidl_next::fuchsia::zx::Rights>>,
5106    }
5107
5108    impl BufferCollectionTokenGroupCreateChildrenSyncRequest {
5109        fn __max_ordinal(&self) -> usize {
5110            if self.rights_attenuation_masks.is_some() {
5111                return 1;
5112            }
5113
5114            0
5115        }
5116    }
5117
5118    unsafe impl<___E>
5119        ::fidl_next::Encode<
5120            crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5121            ___E,
5122        > for BufferCollectionTokenGroupCreateChildrenSyncRequest
5123    where
5124        ___E: ::fidl_next::Encoder + ?Sized,
5125    {
5126        #[inline]
5127        fn encode(
5128            mut self,
5129            encoder: &mut ___E,
5130            out: &mut ::core::mem::MaybeUninit<
5131                crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5132            >,
5133            _: (),
5134        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5135            ::fidl_next::munge!(let crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest { table } = out);
5136
5137            let max_ord = self.__max_ordinal();
5138
5139            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5140            ::fidl_next::Wire::zero_padding(&mut out);
5141
5142            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5143                ::fidl_next::wire::Envelope,
5144            >(encoder, max_ord);
5145
5146            for i in 1..=max_ord {
5147                match i {
5148                    1 => {
5149                        if let Some(value) = self.rights_attenuation_masks.take() {
5150                            ::fidl_next::wire::Envelope::encode_value::<
5151                                ::fidl_next::wire::Vector<
5152                                    'static,
5153                                    ::fidl_next::wire::fuchsia::Rights,
5154                                >,
5155                                ___E,
5156                            >(
5157                                value, preallocated.encoder, &mut out, (64, ())
5158                            )?;
5159                        } else {
5160                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5161                        }
5162                    }
5163
5164                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5165                }
5166                unsafe {
5167                    preallocated.write_next(out.assume_init_ref());
5168                }
5169            }
5170
5171            ::fidl_next::wire::Table::encode_len(table, max_ord);
5172
5173            Ok(())
5174        }
5175    }
5176
5177    unsafe impl<'a, ___E>
5178        ::fidl_next::Encode<
5179            crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5180            ___E,
5181        > for &'a BufferCollectionTokenGroupCreateChildrenSyncRequest
5182    where
5183        ___E: ::fidl_next::Encoder + ?Sized,
5184    {
5185        #[inline]
5186        fn encode(
5187            self,
5188            encoder: &mut ___E,
5189            out: &mut ::core::mem::MaybeUninit<
5190                crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5191            >,
5192            _: (),
5193        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5194            ::fidl_next::munge!(let crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest { table } = out);
5195
5196            let max_ord = self.__max_ordinal();
5197
5198            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5199            ::fidl_next::Wire::zero_padding(&mut out);
5200
5201            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5202                ::fidl_next::wire::Envelope,
5203            >(encoder, max_ord);
5204
5205            for i in 1..=max_ord {
5206                match i {
5207                    1 => {
5208                        if let Some(value) = &self.rights_attenuation_masks {
5209                            ::fidl_next::wire::Envelope::encode_value::<
5210                                ::fidl_next::wire::Vector<
5211                                    'static,
5212                                    ::fidl_next::wire::fuchsia::Rights,
5213                                >,
5214                                ___E,
5215                            >(
5216                                value, preallocated.encoder, &mut out, (64, ())
5217                            )?;
5218                        } else {
5219                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5220                        }
5221                    }
5222
5223                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5224                }
5225                unsafe {
5226                    preallocated.write_next(out.assume_init_ref());
5227                }
5228            }
5229
5230            ::fidl_next::wire::Table::encode_len(table, max_ord);
5231
5232            Ok(())
5233        }
5234    }
5235
5236    impl<'de>
5237        ::fidl_next::FromWire<crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>>
5238        for BufferCollectionTokenGroupCreateChildrenSyncRequest
5239    {
5240        #[inline]
5241        fn from_wire(
5242            wire_: crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5243        ) -> Self {
5244            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5245
5246            let rights_attenuation_masks = wire_.table.get(1);
5247
5248            Self {
5249
5250
5251                rights_attenuation_masks: rights_attenuation_masks.map(|envelope| ::fidl_next::FromWire::from_wire(
5252                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5253                )),
5254
5255        }
5256        }
5257    }
5258
5259    impl<'de>
5260        ::fidl_next::FromWireRef<
5261            crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5262        > for BufferCollectionTokenGroupCreateChildrenSyncRequest
5263    {
5264        #[inline]
5265        fn from_wire_ref(
5266            wire: &crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5267        ) -> Self {
5268            Self {
5269
5270
5271                rights_attenuation_masks: wire.table.get(1)
5272                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5273                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5274                    )),
5275
5276        }
5277        }
5278    }
5279
5280    #[doc = " Entries which have the same pixel_format, pixel_format_modifier, and\n required_usage_bits as a previous entry will override that previous entry.\n For matching purposes, an absent pixel_format_modifier matches LINEAR, and\n an absent required_buffer_usage_bits matches all-0 usage bits.\n"]
5281    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5282    pub struct FormatCostKey {
5283        pub pixel_format:
5284            ::core::option::Option<::fidl_next_common_fuchsia_images2::natural::PixelFormat>,
5285
5286        pub pixel_format_modifier: ::core::option::Option<
5287            ::fidl_next_common_fuchsia_images2::natural::PixelFormatModifier,
5288        >,
5289
5290        pub buffer_usage_bits: ::core::option::Option<crate::natural::BufferUsage>,
5291    }
5292
5293    impl FormatCostKey {
5294        fn __max_ordinal(&self) -> usize {
5295            if self.buffer_usage_bits.is_some() {
5296                return 3;
5297            }
5298
5299            if self.pixel_format_modifier.is_some() {
5300                return 2;
5301            }
5302
5303            if self.pixel_format.is_some() {
5304                return 1;
5305            }
5306
5307            0
5308        }
5309    }
5310
5311    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCostKey<'static>, ___E> for FormatCostKey
5312    where
5313        ___E: ::fidl_next::Encoder + ?Sized,
5314    {
5315        #[inline]
5316        fn encode(
5317            mut self,
5318            encoder: &mut ___E,
5319            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostKey<'static>>,
5320            _: (),
5321        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5322            ::fidl_next::munge!(let crate::wire::FormatCostKey { table } = out);
5323
5324            let max_ord = self.__max_ordinal();
5325
5326            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5327            ::fidl_next::Wire::zero_padding(&mut out);
5328
5329            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5330                ::fidl_next::wire::Envelope,
5331            >(encoder, max_ord);
5332
5333            for i in 1..=max_ord {
5334                match i {
5335                    3 => {
5336                        if let Some(value) = self.buffer_usage_bits.take() {
5337                            ::fidl_next::wire::Envelope::encode_value::<
5338                                crate::wire::BufferUsage<'static>,
5339                                ___E,
5340                            >(
5341                                value, preallocated.encoder, &mut out, ()
5342                            )?;
5343                        } else {
5344                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5345                        }
5346                    }
5347
5348                    2 => {
5349                        if let Some(value) = self.pixel_format_modifier.take() {
5350                            ::fidl_next::wire::Envelope::encode_value::<
5351                                ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
5352                                ___E,
5353                            >(
5354                                value, preallocated.encoder, &mut out, ()
5355                            )?;
5356                        } else {
5357                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5358                        }
5359                    }
5360
5361                    1 => {
5362                        if let Some(value) = self.pixel_format.take() {
5363                            ::fidl_next::wire::Envelope::encode_value::<
5364                                ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
5365                                ___E,
5366                            >(
5367                                value, preallocated.encoder, &mut out, ()
5368                            )?;
5369                        } else {
5370                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5371                        }
5372                    }
5373
5374                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5375                }
5376                unsafe {
5377                    preallocated.write_next(out.assume_init_ref());
5378                }
5379            }
5380
5381            ::fidl_next::wire::Table::encode_len(table, max_ord);
5382
5383            Ok(())
5384        }
5385    }
5386
5387    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCostKey<'static>, ___E>
5388        for &'a FormatCostKey
5389    where
5390        ___E: ::fidl_next::Encoder + ?Sized,
5391    {
5392        #[inline]
5393        fn encode(
5394            self,
5395            encoder: &mut ___E,
5396            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostKey<'static>>,
5397            _: (),
5398        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5399            ::fidl_next::munge!(let crate::wire::FormatCostKey { table } = out);
5400
5401            let max_ord = self.__max_ordinal();
5402
5403            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5404            ::fidl_next::Wire::zero_padding(&mut out);
5405
5406            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5407                ::fidl_next::wire::Envelope,
5408            >(encoder, max_ord);
5409
5410            for i in 1..=max_ord {
5411                match i {
5412                    3 => {
5413                        if let Some(value) = &self.buffer_usage_bits {
5414                            ::fidl_next::wire::Envelope::encode_value::<
5415                                crate::wire::BufferUsage<'static>,
5416                                ___E,
5417                            >(
5418                                value, preallocated.encoder, &mut out, ()
5419                            )?;
5420                        } else {
5421                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5422                        }
5423                    }
5424
5425                    2 => {
5426                        if let Some(value) = &self.pixel_format_modifier {
5427                            ::fidl_next::wire::Envelope::encode_value::<
5428                                ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
5429                                ___E,
5430                            >(
5431                                value, preallocated.encoder, &mut out, ()
5432                            )?;
5433                        } else {
5434                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5435                        }
5436                    }
5437
5438                    1 => {
5439                        if let Some(value) = &self.pixel_format {
5440                            ::fidl_next::wire::Envelope::encode_value::<
5441                                ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
5442                                ___E,
5443                            >(
5444                                value, preallocated.encoder, &mut out, ()
5445                            )?;
5446                        } else {
5447                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5448                        }
5449                    }
5450
5451                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5452                }
5453                unsafe {
5454                    preallocated.write_next(out.assume_init_ref());
5455                }
5456            }
5457
5458            ::fidl_next::wire::Table::encode_len(table, max_ord);
5459
5460            Ok(())
5461        }
5462    }
5463
5464    impl<'de> ::fidl_next::FromWire<crate::wire::FormatCostKey<'de>> for FormatCostKey {
5465        #[inline]
5466        fn from_wire(wire_: crate::wire::FormatCostKey<'de>) -> Self {
5467            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5468
5469            let pixel_format = wire_.table.get(1);
5470
5471            let pixel_format_modifier = wire_.table.get(2);
5472
5473            let buffer_usage_bits = wire_.table.get(3);
5474
5475            Self {
5476
5477
5478                pixel_format: pixel_format.map(|envelope| ::fidl_next::FromWire::from_wire(
5479                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
5480                )),
5481
5482
5483                pixel_format_modifier: pixel_format_modifier.map(|envelope| ::fidl_next::FromWire::from_wire(
5484                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
5485                )),
5486
5487
5488                buffer_usage_bits: buffer_usage_bits.map(|envelope| ::fidl_next::FromWire::from_wire(
5489                    unsafe { envelope.read_unchecked::<crate::wire::BufferUsage<'de>>() }
5490                )),
5491
5492        }
5493        }
5494    }
5495
5496    impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCostKey<'de>> for FormatCostKey {
5497        #[inline]
5498        fn from_wire_ref(wire: &crate::wire::FormatCostKey<'de>) -> Self {
5499            Self {
5500
5501
5502                pixel_format: wire.table.get(1)
5503                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5504                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
5505                    )),
5506
5507
5508                pixel_format_modifier: wire.table.get(2)
5509                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5510                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
5511                    )),
5512
5513
5514                buffer_usage_bits: wire.table.get(3)
5515                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5516                        unsafe { envelope.deref_unchecked::<crate::wire::BufferUsage<'de>>() }
5517                    )),
5518
5519        }
5520        }
5521    }
5522
5523    #[doc = " A FormatCostEntry can be used to influence which PixelFormatAndModifier is\n chosen for a buffer collection, optionally taking BufferUsage into account.\n\n The default cost is f32::MAX, so any specified cost with a non-MAX value\n will prefer the specified format over any formats that don\'t have any\n FormatCost entry.\n\n Entries which have the same pixel_format, pixel_format_modifier, and\n required_usage_bits as a previous entry will override that previous entry.\n For matching purposes, an absent pixel_format_modifier matches LINEAR, and\n an absent required_buffer_usage_bits matches all-0 usage bits.\n\n Board info sysmem_defaults entries are logically before platform sysmem\n entries.\n\n Sysmem uses the resulting aggregated list of FormatCostEntry(s) when\n breaking ties among the set of formats which are supported by all\n participants of a buffer collection. For each mutually-supported format,\n entries with non-matching format are ignored, and entries with extra\n buffer_usage_bits set are ignored. Among the remaining entries, the entry\n with the most usage bits in common with the aggregated participant usages is\n selected to determine the cost (if a tie, the later entry wins). Then the\n format with the lowest cost is chosen. If it\'s still a tie (equal cost), the\n tie is broken arbitrarily but not randomly.\n\n This is not intended as a mechanism to disallow selection of a format that\n is supported by all participants of a buffer collection. If a participant\n claims support for a format but fails to handle that format correctly, it\n should be fixed to handle that format correctly or changed to stop claiming\n support for that format.\n\n This mechanism is intended to influence format selection toward more\n efficient formats with better performance, lower memory bandwidth usage,\n etc, for a given set of usage bits, taking into account quirks that may be\n unique to a given board or overall platform config.\n"]
5524    #[derive(Debug, Default, Copy, Clone, PartialEq, PartialOrd)]
5525    pub struct FormatCostEntry {
5526        pub key: ::core::option::Option<crate::natural::FormatCostKey>,
5527
5528        pub cost: ::core::option::Option<f32>,
5529    }
5530
5531    impl FormatCostEntry {
5532        fn __max_ordinal(&self) -> usize {
5533            if self.cost.is_some() {
5534                return 2;
5535            }
5536
5537            if self.key.is_some() {
5538                return 1;
5539            }
5540
5541            0
5542        }
5543    }
5544
5545    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCostEntry<'static>, ___E>
5546        for FormatCostEntry
5547    where
5548        ___E: ::fidl_next::Encoder + ?Sized,
5549    {
5550        #[inline]
5551        fn encode(
5552            mut self,
5553            encoder: &mut ___E,
5554            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostEntry<'static>>,
5555            _: (),
5556        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5557            ::fidl_next::munge!(let crate::wire::FormatCostEntry { table } = out);
5558
5559            let max_ord = self.__max_ordinal();
5560
5561            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5562            ::fidl_next::Wire::zero_padding(&mut out);
5563
5564            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5565                ::fidl_next::wire::Envelope,
5566            >(encoder, max_ord);
5567
5568            for i in 1..=max_ord {
5569                match i {
5570                    2 => {
5571                        if let Some(value) = self.cost.take() {
5572                            ::fidl_next::wire::Envelope::encode_value::<
5573                                ::fidl_next::wire::Float32,
5574                                ___E,
5575                            >(
5576                                value, preallocated.encoder, &mut out, ()
5577                            )?;
5578                        } else {
5579                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5580                        }
5581                    }
5582
5583                    1 => {
5584                        if let Some(value) = self.key.take() {
5585                            ::fidl_next::wire::Envelope::encode_value::<
5586                                crate::wire::FormatCostKey<'static>,
5587                                ___E,
5588                            >(
5589                                value, preallocated.encoder, &mut out, ()
5590                            )?;
5591                        } else {
5592                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5593                        }
5594                    }
5595
5596                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5597                }
5598                unsafe {
5599                    preallocated.write_next(out.assume_init_ref());
5600                }
5601            }
5602
5603            ::fidl_next::wire::Table::encode_len(table, max_ord);
5604
5605            Ok(())
5606        }
5607    }
5608
5609    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCostEntry<'static>, ___E>
5610        for &'a FormatCostEntry
5611    where
5612        ___E: ::fidl_next::Encoder + ?Sized,
5613    {
5614        #[inline]
5615        fn encode(
5616            self,
5617            encoder: &mut ___E,
5618            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostEntry<'static>>,
5619            _: (),
5620        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5621            ::fidl_next::munge!(let crate::wire::FormatCostEntry { table } = out);
5622
5623            let max_ord = self.__max_ordinal();
5624
5625            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5626            ::fidl_next::Wire::zero_padding(&mut out);
5627
5628            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5629                ::fidl_next::wire::Envelope,
5630            >(encoder, max_ord);
5631
5632            for i in 1..=max_ord {
5633                match i {
5634                    2 => {
5635                        if let Some(value) = &self.cost {
5636                            ::fidl_next::wire::Envelope::encode_value::<
5637                                ::fidl_next::wire::Float32,
5638                                ___E,
5639                            >(
5640                                value, preallocated.encoder, &mut out, ()
5641                            )?;
5642                        } else {
5643                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5644                        }
5645                    }
5646
5647                    1 => {
5648                        if let Some(value) = &self.key {
5649                            ::fidl_next::wire::Envelope::encode_value::<
5650                                crate::wire::FormatCostKey<'static>,
5651                                ___E,
5652                            >(
5653                                value, preallocated.encoder, &mut out, ()
5654                            )?;
5655                        } else {
5656                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5657                        }
5658                    }
5659
5660                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5661                }
5662                unsafe {
5663                    preallocated.write_next(out.assume_init_ref());
5664                }
5665            }
5666
5667            ::fidl_next::wire::Table::encode_len(table, max_ord);
5668
5669            Ok(())
5670        }
5671    }
5672
5673    impl<'de> ::fidl_next::FromWire<crate::wire::FormatCostEntry<'de>> for FormatCostEntry {
5674        #[inline]
5675        fn from_wire(wire_: crate::wire::FormatCostEntry<'de>) -> Self {
5676            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5677
5678            let key = wire_.table.get(1);
5679
5680            let cost = wire_.table.get(2);
5681
5682            Self {
5683                key: key.map(|envelope| {
5684                    ::fidl_next::FromWire::from_wire(unsafe {
5685                        envelope.read_unchecked::<crate::wire::FormatCostKey<'de>>()
5686                    })
5687                }),
5688
5689                cost: cost.map(|envelope| {
5690                    ::fidl_next::FromWire::from_wire(unsafe {
5691                        envelope.read_unchecked::<::fidl_next::wire::Float32>()
5692                    })
5693                }),
5694            }
5695        }
5696    }
5697
5698    impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCostEntry<'de>> for FormatCostEntry {
5699        #[inline]
5700        fn from_wire_ref(wire: &crate::wire::FormatCostEntry<'de>) -> Self {
5701            Self {
5702                key: wire.table.get(1).map(|envelope| {
5703                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5704                        envelope.deref_unchecked::<crate::wire::FormatCostKey<'de>>()
5705                    })
5706                }),
5707
5708                cost: wire.table.get(2).map(|envelope| {
5709                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5710                        envelope.deref_unchecked::<::fidl_next::wire::Float32>()
5711                    })
5712                }),
5713            }
5714        }
5715    }
5716
5717    #[doc = " This type is fidl::Persist()\'ed in the sysmem_config.persistent_fidl file\n within the sysmem domain config by the assembly tool, and read by the sysmem\n driver.\n\n Normally json[5] would be preferable for config, but we generate this config\n in rust using FIDL types (to avoid repetition and to take advantage of FIDL\n rust codegen), and there\'s no json schema for FIDL types.\n\n Currently there is no mechanism to change anything in this config at runtime\n or from boot to boot. This config is static per run of the assembly tool.\n\n See src/lib/assembly/config_schema/src/platform_config/sysmem_config.rs for\n aspects of sysmem config which are specified directly inline in board info\n or assembly platform config. The two parts of sysmem config don\'t\n (currently) overlap. The config here is for aspects of sysmem config which\n would be too verbose for direct inclusion in board info or assembly platform\n config. In addition, some/most of the pixel format cost entries are\n programmatically generated (as of this comment).\n\n Prior to aggregation by assembly tool, there are multiple .persistent_fidl\n files each storing its own Config instance. The board info and assembly\n platform config lists the input persistent_fidl files, with board info\n logically before assembly platform config. The overall list of files is\n processed, which allows later files to override/replace info in prior files.\n\n Because this type is only intended for use with persistent fidl, where the\n length of a serialized instance isn\'t bounded, we don\'t bound the internal\n vector element counts.\n"]
5718    #[derive(Debug, Default, Clone, PartialEq, PartialOrd)]
5719    pub struct Config {
5720        pub format_costs: ::core::option::Option<::std::vec::Vec<crate::natural::FormatCostEntry>>,
5721    }
5722
5723    impl Config {
5724        fn __max_ordinal(&self) -> usize {
5725            if self.format_costs.is_some() {
5726                return 1;
5727            }
5728
5729            0
5730        }
5731    }
5732
5733    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Config<'static>, ___E> for Config
5734    where
5735        ___E: ::fidl_next::Encoder + ?Sized,
5736    {
5737        #[inline]
5738        fn encode(
5739            mut self,
5740            encoder: &mut ___E,
5741            out: &mut ::core::mem::MaybeUninit<crate::wire::Config<'static>>,
5742            _: (),
5743        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5744            ::fidl_next::munge!(let crate::wire::Config { table } = out);
5745
5746            let max_ord = self.__max_ordinal();
5747
5748            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5749            ::fidl_next::Wire::zero_padding(&mut out);
5750
5751            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5752                ::fidl_next::wire::Envelope,
5753            >(encoder, max_ord);
5754
5755            for i in 1..=max_ord {
5756                match i {
5757                    1 => {
5758                        if let Some(value) = self.format_costs.take() {
5759                            ::fidl_next::wire::Envelope::encode_value::<
5760                                ::fidl_next::wire::Vector<
5761                                    'static,
5762                                    crate::wire::FormatCostEntry<'static>,
5763                                >,
5764                                ___E,
5765                            >(
5766                                value, preallocated.encoder, &mut out, (4294967295, ())
5767                            )?;
5768                        } else {
5769                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5770                        }
5771                    }
5772
5773                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5774                }
5775                unsafe {
5776                    preallocated.write_next(out.assume_init_ref());
5777                }
5778            }
5779
5780            ::fidl_next::wire::Table::encode_len(table, max_ord);
5781
5782            Ok(())
5783        }
5784    }
5785
5786    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Config<'static>, ___E> for &'a Config
5787    where
5788        ___E: ::fidl_next::Encoder + ?Sized,
5789    {
5790        #[inline]
5791        fn encode(
5792            self,
5793            encoder: &mut ___E,
5794            out: &mut ::core::mem::MaybeUninit<crate::wire::Config<'static>>,
5795            _: (),
5796        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5797            ::fidl_next::munge!(let crate::wire::Config { table } = out);
5798
5799            let max_ord = self.__max_ordinal();
5800
5801            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5802            ::fidl_next::Wire::zero_padding(&mut out);
5803
5804            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5805                ::fidl_next::wire::Envelope,
5806            >(encoder, max_ord);
5807
5808            for i in 1..=max_ord {
5809                match i {
5810                    1 => {
5811                        if let Some(value) = &self.format_costs {
5812                            ::fidl_next::wire::Envelope::encode_value::<
5813                                ::fidl_next::wire::Vector<
5814                                    'static,
5815                                    crate::wire::FormatCostEntry<'static>,
5816                                >,
5817                                ___E,
5818                            >(
5819                                value, preallocated.encoder, &mut out, (4294967295, ())
5820                            )?;
5821                        } else {
5822                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5823                        }
5824                    }
5825
5826                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5827                }
5828                unsafe {
5829                    preallocated.write_next(out.assume_init_ref());
5830                }
5831            }
5832
5833            ::fidl_next::wire::Table::encode_len(table, max_ord);
5834
5835            Ok(())
5836        }
5837    }
5838
5839    impl<'de> ::fidl_next::FromWire<crate::wire::Config<'de>> for Config {
5840        #[inline]
5841        fn from_wire(wire_: crate::wire::Config<'de>) -> Self {
5842            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5843
5844            let format_costs = wire_.table.get(1);
5845
5846            Self {
5847
5848
5849                format_costs: format_costs.map(|envelope| ::fidl_next::FromWire::from_wire(
5850                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
5851                )),
5852
5853        }
5854        }
5855    }
5856
5857    impl<'de> ::fidl_next::FromWireRef<crate::wire::Config<'de>> for Config {
5858        #[inline]
5859        fn from_wire_ref(wire: &crate::wire::Config<'de>) -> Self {
5860            Self {
5861
5862
5863                format_costs: wire.table.get(1)
5864                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5865                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
5866                    )),
5867
5868        }
5869        }
5870    }
5871
5872    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5873    pub struct DynamicSecureHeap {
5874        pub heap: ::core::option::Option<crate::natural::Heap>,
5875    }
5876
5877    impl DynamicSecureHeap {
5878        fn __max_ordinal(&self) -> usize {
5879            if self.heap.is_some() {
5880                return 1;
5881            }
5882
5883            0
5884        }
5885    }
5886
5887    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DynamicSecureHeap<'static>, ___E>
5888        for DynamicSecureHeap
5889    where
5890        ___E: ::fidl_next::Encoder + ?Sized,
5891    {
5892        #[inline]
5893        fn encode(
5894            mut self,
5895            encoder: &mut ___E,
5896            out: &mut ::core::mem::MaybeUninit<crate::wire::DynamicSecureHeap<'static>>,
5897            _: (),
5898        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5899            ::fidl_next::munge!(let crate::wire::DynamicSecureHeap { table } = out);
5900
5901            let max_ord = self.__max_ordinal();
5902
5903            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5904            ::fidl_next::Wire::zero_padding(&mut out);
5905
5906            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5907                ::fidl_next::wire::Envelope,
5908            >(encoder, max_ord);
5909
5910            for i in 1..=max_ord {
5911                match i {
5912                    1 => {
5913                        if let Some(value) = self.heap.take() {
5914                            ::fidl_next::wire::Envelope::encode_value::<
5915                                crate::wire::Heap<'static>,
5916                                ___E,
5917                            >(
5918                                value, preallocated.encoder, &mut out, ()
5919                            )?;
5920                        } else {
5921                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5922                        }
5923                    }
5924
5925                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5926                }
5927                unsafe {
5928                    preallocated.write_next(out.assume_init_ref());
5929                }
5930            }
5931
5932            ::fidl_next::wire::Table::encode_len(table, max_ord);
5933
5934            Ok(())
5935        }
5936    }
5937
5938    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DynamicSecureHeap<'static>, ___E>
5939        for &'a DynamicSecureHeap
5940    where
5941        ___E: ::fidl_next::Encoder + ?Sized,
5942    {
5943        #[inline]
5944        fn encode(
5945            self,
5946            encoder: &mut ___E,
5947            out: &mut ::core::mem::MaybeUninit<crate::wire::DynamicSecureHeap<'static>>,
5948            _: (),
5949        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5950            ::fidl_next::munge!(let crate::wire::DynamicSecureHeap { table } = out);
5951
5952            let max_ord = self.__max_ordinal();
5953
5954            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5955            ::fidl_next::Wire::zero_padding(&mut out);
5956
5957            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5958                ::fidl_next::wire::Envelope,
5959            >(encoder, max_ord);
5960
5961            for i in 1..=max_ord {
5962                match i {
5963                    1 => {
5964                        if let Some(value) = &self.heap {
5965                            ::fidl_next::wire::Envelope::encode_value::<
5966                                crate::wire::Heap<'static>,
5967                                ___E,
5968                            >(
5969                                value, preallocated.encoder, &mut out, ()
5970                            )?;
5971                        } else {
5972                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5973                        }
5974                    }
5975
5976                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5977                }
5978                unsafe {
5979                    preallocated.write_next(out.assume_init_ref());
5980                }
5981            }
5982
5983            ::fidl_next::wire::Table::encode_len(table, max_ord);
5984
5985            Ok(())
5986        }
5987    }
5988
5989    impl<'de> ::fidl_next::FromWire<crate::wire::DynamicSecureHeap<'de>> for DynamicSecureHeap {
5990        #[inline]
5991        fn from_wire(wire_: crate::wire::DynamicSecureHeap<'de>) -> Self {
5992            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5993
5994            let heap = wire_.table.get(1);
5995
5996            Self {
5997                heap: heap.map(|envelope| {
5998                    ::fidl_next::FromWire::from_wire(unsafe {
5999                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
6000                    })
6001                }),
6002            }
6003        }
6004    }
6005
6006    impl<'de> ::fidl_next::FromWireRef<crate::wire::DynamicSecureHeap<'de>> for DynamicSecureHeap {
6007        #[inline]
6008        fn from_wire_ref(wire: &crate::wire::DynamicSecureHeap<'de>) -> Self {
6009            Self {
6010                heap: wire.table.get(1).map(|envelope| {
6011                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6012                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
6013                    })
6014                }),
6015            }
6016        }
6017    }
6018
6019    #[doc = " This is the root of the persistent fidl in a format costs file. The format\n costs files are read by the assembly tool and merged into the single\n sysmem_config.persistent_fidl file in the sysmem domain config (see Config\n above).\n\n Normally json[5] would be preferable for config, but we generate this config\n in rust using FIDL types (to avoid repetition and to take advantage of FIDL\n rust codegen), and there\'s no json schema for FIDL types.\n\n While the resulting sysmem_config.persistent_fidl is a single file that can\n contain multiple aspects of sysmem config, in contrast a format costs file\n contains only format costs. We don\'t mind having more separate files during\n the build, but it\'s nice to get sysmem\'s domain config down to a single file\n on-device.\n"]
6020    #[derive(Debug, Default, Clone, PartialEq, PartialOrd)]
6021    pub struct FormatCosts {
6022        pub format_costs: ::core::option::Option<::std::vec::Vec<crate::natural::FormatCostEntry>>,
6023    }
6024
6025    impl FormatCosts {
6026        fn __max_ordinal(&self) -> usize {
6027            if self.format_costs.is_some() {
6028                return 1;
6029            }
6030
6031            0
6032        }
6033    }
6034
6035    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCosts<'static>, ___E> for FormatCosts
6036    where
6037        ___E: ::fidl_next::Encoder + ?Sized,
6038    {
6039        #[inline]
6040        fn encode(
6041            mut self,
6042            encoder: &mut ___E,
6043            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCosts<'static>>,
6044            _: (),
6045        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6046            ::fidl_next::munge!(let crate::wire::FormatCosts { table } = out);
6047
6048            let max_ord = self.__max_ordinal();
6049
6050            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6051            ::fidl_next::Wire::zero_padding(&mut out);
6052
6053            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6054                ::fidl_next::wire::Envelope,
6055            >(encoder, max_ord);
6056
6057            for i in 1..=max_ord {
6058                match i {
6059                    1 => {
6060                        if let Some(value) = self.format_costs.take() {
6061                            ::fidl_next::wire::Envelope::encode_value::<
6062                                ::fidl_next::wire::Vector<
6063                                    'static,
6064                                    crate::wire::FormatCostEntry<'static>,
6065                                >,
6066                                ___E,
6067                            >(
6068                                value, preallocated.encoder, &mut out, (4294967295, ())
6069                            )?;
6070                        } else {
6071                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6072                        }
6073                    }
6074
6075                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6076                }
6077                unsafe {
6078                    preallocated.write_next(out.assume_init_ref());
6079                }
6080            }
6081
6082            ::fidl_next::wire::Table::encode_len(table, max_ord);
6083
6084            Ok(())
6085        }
6086    }
6087
6088    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCosts<'static>, ___E>
6089        for &'a FormatCosts
6090    where
6091        ___E: ::fidl_next::Encoder + ?Sized,
6092    {
6093        #[inline]
6094        fn encode(
6095            self,
6096            encoder: &mut ___E,
6097            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCosts<'static>>,
6098            _: (),
6099        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6100            ::fidl_next::munge!(let crate::wire::FormatCosts { table } = out);
6101
6102            let max_ord = self.__max_ordinal();
6103
6104            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6105            ::fidl_next::Wire::zero_padding(&mut out);
6106
6107            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6108                ::fidl_next::wire::Envelope,
6109            >(encoder, max_ord);
6110
6111            for i in 1..=max_ord {
6112                match i {
6113                    1 => {
6114                        if let Some(value) = &self.format_costs {
6115                            ::fidl_next::wire::Envelope::encode_value::<
6116                                ::fidl_next::wire::Vector<
6117                                    'static,
6118                                    crate::wire::FormatCostEntry<'static>,
6119                                >,
6120                                ___E,
6121                            >(
6122                                value, preallocated.encoder, &mut out, (4294967295, ())
6123                            )?;
6124                        } else {
6125                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6126                        }
6127                    }
6128
6129                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6130                }
6131                unsafe {
6132                    preallocated.write_next(out.assume_init_ref());
6133                }
6134            }
6135
6136            ::fidl_next::wire::Table::encode_len(table, max_ord);
6137
6138            Ok(())
6139        }
6140    }
6141
6142    impl<'de> ::fidl_next::FromWire<crate::wire::FormatCosts<'de>> for FormatCosts {
6143        #[inline]
6144        fn from_wire(wire_: crate::wire::FormatCosts<'de>) -> Self {
6145            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6146
6147            let format_costs = wire_.table.get(1);
6148
6149            Self {
6150
6151
6152                format_costs: format_costs.map(|envelope| ::fidl_next::FromWire::from_wire(
6153                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
6154                )),
6155
6156        }
6157        }
6158    }
6159
6160    impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCosts<'de>> for FormatCosts {
6161        #[inline]
6162        fn from_wire_ref(wire: &crate::wire::FormatCosts<'de>) -> Self {
6163            Self {
6164
6165
6166                format_costs: wire.table.get(1)
6167                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6168                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
6169                    )),
6170
6171        }
6172        }
6173    }
6174
6175    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6176    pub struct SecureHeapRange {
6177        pub physical_address: ::core::option::Option<u64>,
6178
6179        pub size_bytes: ::core::option::Option<u64>,
6180    }
6181
6182    impl SecureHeapRange {
6183        fn __max_ordinal(&self) -> usize {
6184            if self.size_bytes.is_some() {
6185                return 2;
6186            }
6187
6188            if self.physical_address.is_some() {
6189                return 1;
6190            }
6191
6192            0
6193        }
6194    }
6195
6196    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapRange<'static>, ___E>
6197        for SecureHeapRange
6198    where
6199        ___E: ::fidl_next::Encoder + ?Sized,
6200    {
6201        #[inline]
6202        fn encode(
6203            mut self,
6204            encoder: &mut ___E,
6205            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapRange<'static>>,
6206            _: (),
6207        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6208            ::fidl_next::munge!(let crate::wire::SecureHeapRange { table } = out);
6209
6210            let max_ord = self.__max_ordinal();
6211
6212            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6213            ::fidl_next::Wire::zero_padding(&mut out);
6214
6215            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6216                ::fidl_next::wire::Envelope,
6217            >(encoder, max_ord);
6218
6219            for i in 1..=max_ord {
6220                match i {
6221                    2 => {
6222                        if let Some(value) = self.size_bytes.take() {
6223                            ::fidl_next::wire::Envelope::encode_value::<
6224                                ::fidl_next::wire::Uint64,
6225                                ___E,
6226                            >(
6227                                value, preallocated.encoder, &mut out, ()
6228                            )?;
6229                        } else {
6230                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6231                        }
6232                    }
6233
6234                    1 => {
6235                        if let Some(value) = self.physical_address.take() {
6236                            ::fidl_next::wire::Envelope::encode_value::<
6237                                ::fidl_next::wire::Uint64,
6238                                ___E,
6239                            >(
6240                                value, preallocated.encoder, &mut out, ()
6241                            )?;
6242                        } else {
6243                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6244                        }
6245                    }
6246
6247                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6248                }
6249                unsafe {
6250                    preallocated.write_next(out.assume_init_ref());
6251                }
6252            }
6253
6254            ::fidl_next::wire::Table::encode_len(table, max_ord);
6255
6256            Ok(())
6257        }
6258    }
6259
6260    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapRange<'static>, ___E>
6261        for &'a SecureHeapRange
6262    where
6263        ___E: ::fidl_next::Encoder + ?Sized,
6264    {
6265        #[inline]
6266        fn encode(
6267            self,
6268            encoder: &mut ___E,
6269            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapRange<'static>>,
6270            _: (),
6271        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6272            ::fidl_next::munge!(let crate::wire::SecureHeapRange { table } = out);
6273
6274            let max_ord = self.__max_ordinal();
6275
6276            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6277            ::fidl_next::Wire::zero_padding(&mut out);
6278
6279            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6280                ::fidl_next::wire::Envelope,
6281            >(encoder, max_ord);
6282
6283            for i in 1..=max_ord {
6284                match i {
6285                    2 => {
6286                        if let Some(value) = &self.size_bytes {
6287                            ::fidl_next::wire::Envelope::encode_value::<
6288                                ::fidl_next::wire::Uint64,
6289                                ___E,
6290                            >(
6291                                value, preallocated.encoder, &mut out, ()
6292                            )?;
6293                        } else {
6294                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6295                        }
6296                    }
6297
6298                    1 => {
6299                        if let Some(value) = &self.physical_address {
6300                            ::fidl_next::wire::Envelope::encode_value::<
6301                                ::fidl_next::wire::Uint64,
6302                                ___E,
6303                            >(
6304                                value, preallocated.encoder, &mut out, ()
6305                            )?;
6306                        } else {
6307                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6308                        }
6309                    }
6310
6311                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6312                }
6313                unsafe {
6314                    preallocated.write_next(out.assume_init_ref());
6315                }
6316            }
6317
6318            ::fidl_next::wire::Table::encode_len(table, max_ord);
6319
6320            Ok(())
6321        }
6322    }
6323
6324    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapRange<'de>> for SecureHeapRange {
6325        #[inline]
6326        fn from_wire(wire_: crate::wire::SecureHeapRange<'de>) -> Self {
6327            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6328
6329            let physical_address = wire_.table.get(1);
6330
6331            let size_bytes = wire_.table.get(2);
6332
6333            Self {
6334                physical_address: physical_address.map(|envelope| {
6335                    ::fidl_next::FromWire::from_wire(unsafe {
6336                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6337                    })
6338                }),
6339
6340                size_bytes: size_bytes.map(|envelope| {
6341                    ::fidl_next::FromWire::from_wire(unsafe {
6342                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6343                    })
6344                }),
6345            }
6346        }
6347    }
6348
6349    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapRange<'de>> for SecureHeapRange {
6350        #[inline]
6351        fn from_wire_ref(wire: &crate::wire::SecureHeapRange<'de>) -> Self {
6352            Self {
6353                physical_address: wire.table.get(1).map(|envelope| {
6354                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6355                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6356                    })
6357                }),
6358
6359                size_bytes: wire.table.get(2).map(|envelope| {
6360                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6361                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6362                    })
6363                }),
6364            }
6365        }
6366    }
6367
6368    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6369    pub struct SecureHeapAndRange {
6370        pub heap: ::core::option::Option<crate::natural::Heap>,
6371
6372        pub range: ::core::option::Option<crate::natural::SecureHeapRange>,
6373    }
6374
6375    impl SecureHeapAndRange {
6376        fn __max_ordinal(&self) -> usize {
6377            if self.range.is_some() {
6378                return 2;
6379            }
6380
6381            if self.heap.is_some() {
6382                return 1;
6383            }
6384
6385            0
6386        }
6387    }
6388
6389    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRange<'static>, ___E>
6390        for SecureHeapAndRange
6391    where
6392        ___E: ::fidl_next::Encoder + ?Sized,
6393    {
6394        #[inline]
6395        fn encode(
6396            mut self,
6397            encoder: &mut ___E,
6398            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRange<'static>>,
6399            _: (),
6400        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6401            ::fidl_next::munge!(let crate::wire::SecureHeapAndRange { table } = out);
6402
6403            let max_ord = self.__max_ordinal();
6404
6405            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6406            ::fidl_next::Wire::zero_padding(&mut out);
6407
6408            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6409                ::fidl_next::wire::Envelope,
6410            >(encoder, max_ord);
6411
6412            for i in 1..=max_ord {
6413                match i {
6414                    2 => {
6415                        if let Some(value) = self.range.take() {
6416                            ::fidl_next::wire::Envelope::encode_value::<
6417                                crate::wire::SecureHeapRange<'static>,
6418                                ___E,
6419                            >(
6420                                value, preallocated.encoder, &mut out, ()
6421                            )?;
6422                        } else {
6423                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6424                        }
6425                    }
6426
6427                    1 => {
6428                        if let Some(value) = self.heap.take() {
6429                            ::fidl_next::wire::Envelope::encode_value::<
6430                                crate::wire::Heap<'static>,
6431                                ___E,
6432                            >(
6433                                value, preallocated.encoder, &mut out, ()
6434                            )?;
6435                        } else {
6436                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6437                        }
6438                    }
6439
6440                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6441                }
6442                unsafe {
6443                    preallocated.write_next(out.assume_init_ref());
6444                }
6445            }
6446
6447            ::fidl_next::wire::Table::encode_len(table, max_ord);
6448
6449            Ok(())
6450        }
6451    }
6452
6453    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRange<'static>, ___E>
6454        for &'a SecureHeapAndRange
6455    where
6456        ___E: ::fidl_next::Encoder + ?Sized,
6457    {
6458        #[inline]
6459        fn encode(
6460            self,
6461            encoder: &mut ___E,
6462            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRange<'static>>,
6463            _: (),
6464        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6465            ::fidl_next::munge!(let crate::wire::SecureHeapAndRange { table } = out);
6466
6467            let max_ord = self.__max_ordinal();
6468
6469            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6470            ::fidl_next::Wire::zero_padding(&mut out);
6471
6472            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6473                ::fidl_next::wire::Envelope,
6474            >(encoder, max_ord);
6475
6476            for i in 1..=max_ord {
6477                match i {
6478                    2 => {
6479                        if let Some(value) = &self.range {
6480                            ::fidl_next::wire::Envelope::encode_value::<
6481                                crate::wire::SecureHeapRange<'static>,
6482                                ___E,
6483                            >(
6484                                value, preallocated.encoder, &mut out, ()
6485                            )?;
6486                        } else {
6487                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6488                        }
6489                    }
6490
6491                    1 => {
6492                        if let Some(value) = &self.heap {
6493                            ::fidl_next::wire::Envelope::encode_value::<
6494                                crate::wire::Heap<'static>,
6495                                ___E,
6496                            >(
6497                                value, preallocated.encoder, &mut out, ()
6498                            )?;
6499                        } else {
6500                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6501                        }
6502                    }
6503
6504                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6505                }
6506                unsafe {
6507                    preallocated.write_next(out.assume_init_ref());
6508                }
6509            }
6510
6511            ::fidl_next::wire::Table::encode_len(table, max_ord);
6512
6513            Ok(())
6514        }
6515    }
6516
6517    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRange<'de>> for SecureHeapAndRange {
6518        #[inline]
6519        fn from_wire(wire_: crate::wire::SecureHeapAndRange<'de>) -> Self {
6520            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6521
6522            let heap = wire_.table.get(1);
6523
6524            let range = wire_.table.get(2);
6525
6526            Self {
6527                heap: heap.map(|envelope| {
6528                    ::fidl_next::FromWire::from_wire(unsafe {
6529                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
6530                    })
6531                }),
6532
6533                range: range.map(|envelope| {
6534                    ::fidl_next::FromWire::from_wire(unsafe {
6535                        envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6536                    })
6537                }),
6538            }
6539        }
6540    }
6541
6542    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRange<'de>> for SecureHeapAndRange {
6543        #[inline]
6544        fn from_wire_ref(wire: &crate::wire::SecureHeapAndRange<'de>) -> Self {
6545            Self {
6546                heap: wire.table.get(1).map(|envelope| {
6547                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6548                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
6549                    })
6550                }),
6551
6552                range: wire.table.get(2).map(|envelope| {
6553                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6554                        envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6555                    })
6556                }),
6557            }
6558        }
6559    }
6560
6561    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6562    pub struct SecureHeapAndRangeModification {
6563        pub heap: ::core::option::Option<crate::natural::Heap>,
6564
6565        pub old_range: ::core::option::Option<crate::natural::SecureHeapRange>,
6566
6567        pub new_range: ::core::option::Option<crate::natural::SecureHeapRange>,
6568    }
6569
6570    impl SecureHeapAndRangeModification {
6571        fn __max_ordinal(&self) -> usize {
6572            if self.new_range.is_some() {
6573                return 3;
6574            }
6575
6576            if self.old_range.is_some() {
6577                return 2;
6578            }
6579
6580            if self.heap.is_some() {
6581                return 1;
6582            }
6583
6584            0
6585        }
6586    }
6587
6588    unsafe impl<___E>
6589        ::fidl_next::Encode<crate::wire::SecureHeapAndRangeModification<'static>, ___E>
6590        for SecureHeapAndRangeModification
6591    where
6592        ___E: ::fidl_next::Encoder + ?Sized,
6593    {
6594        #[inline]
6595        fn encode(
6596            mut self,
6597            encoder: &mut ___E,
6598            out: &mut ::core::mem::MaybeUninit<
6599                crate::wire::SecureHeapAndRangeModification<'static>,
6600            >,
6601            _: (),
6602        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6603            ::fidl_next::munge!(let crate::wire::SecureHeapAndRangeModification { table } = out);
6604
6605            let max_ord = self.__max_ordinal();
6606
6607            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6608            ::fidl_next::Wire::zero_padding(&mut out);
6609
6610            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6611                ::fidl_next::wire::Envelope,
6612            >(encoder, max_ord);
6613
6614            for i in 1..=max_ord {
6615                match i {
6616                    3 => {
6617                        if let Some(value) = self.new_range.take() {
6618                            ::fidl_next::wire::Envelope::encode_value::<
6619                                crate::wire::SecureHeapRange<'static>,
6620                                ___E,
6621                            >(
6622                                value, preallocated.encoder, &mut out, ()
6623                            )?;
6624                        } else {
6625                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6626                        }
6627                    }
6628
6629                    2 => {
6630                        if let Some(value) = self.old_range.take() {
6631                            ::fidl_next::wire::Envelope::encode_value::<
6632                                crate::wire::SecureHeapRange<'static>,
6633                                ___E,
6634                            >(
6635                                value, preallocated.encoder, &mut out, ()
6636                            )?;
6637                        } else {
6638                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6639                        }
6640                    }
6641
6642                    1 => {
6643                        if let Some(value) = self.heap.take() {
6644                            ::fidl_next::wire::Envelope::encode_value::<
6645                                crate::wire::Heap<'static>,
6646                                ___E,
6647                            >(
6648                                value, preallocated.encoder, &mut out, ()
6649                            )?;
6650                        } else {
6651                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6652                        }
6653                    }
6654
6655                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6656                }
6657                unsafe {
6658                    preallocated.write_next(out.assume_init_ref());
6659                }
6660            }
6661
6662            ::fidl_next::wire::Table::encode_len(table, max_ord);
6663
6664            Ok(())
6665        }
6666    }
6667
6668    unsafe impl<'a, ___E>
6669        ::fidl_next::Encode<crate::wire::SecureHeapAndRangeModification<'static>, ___E>
6670        for &'a SecureHeapAndRangeModification
6671    where
6672        ___E: ::fidl_next::Encoder + ?Sized,
6673    {
6674        #[inline]
6675        fn encode(
6676            self,
6677            encoder: &mut ___E,
6678            out: &mut ::core::mem::MaybeUninit<
6679                crate::wire::SecureHeapAndRangeModification<'static>,
6680            >,
6681            _: (),
6682        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6683            ::fidl_next::munge!(let crate::wire::SecureHeapAndRangeModification { table } = out);
6684
6685            let max_ord = self.__max_ordinal();
6686
6687            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6688            ::fidl_next::Wire::zero_padding(&mut out);
6689
6690            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6691                ::fidl_next::wire::Envelope,
6692            >(encoder, max_ord);
6693
6694            for i in 1..=max_ord {
6695                match i {
6696                    3 => {
6697                        if let Some(value) = &self.new_range {
6698                            ::fidl_next::wire::Envelope::encode_value::<
6699                                crate::wire::SecureHeapRange<'static>,
6700                                ___E,
6701                            >(
6702                                value, preallocated.encoder, &mut out, ()
6703                            )?;
6704                        } else {
6705                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6706                        }
6707                    }
6708
6709                    2 => {
6710                        if let Some(value) = &self.old_range {
6711                            ::fidl_next::wire::Envelope::encode_value::<
6712                                crate::wire::SecureHeapRange<'static>,
6713                                ___E,
6714                            >(
6715                                value, preallocated.encoder, &mut out, ()
6716                            )?;
6717                        } else {
6718                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6719                        }
6720                    }
6721
6722                    1 => {
6723                        if let Some(value) = &self.heap {
6724                            ::fidl_next::wire::Envelope::encode_value::<
6725                                crate::wire::Heap<'static>,
6726                                ___E,
6727                            >(
6728                                value, preallocated.encoder, &mut out, ()
6729                            )?;
6730                        } else {
6731                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6732                        }
6733                    }
6734
6735                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6736                }
6737                unsafe {
6738                    preallocated.write_next(out.assume_init_ref());
6739                }
6740            }
6741
6742            ::fidl_next::wire::Table::encode_len(table, max_ord);
6743
6744            Ok(())
6745        }
6746    }
6747
6748    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRangeModification<'de>>
6749        for SecureHeapAndRangeModification
6750    {
6751        #[inline]
6752        fn from_wire(wire_: crate::wire::SecureHeapAndRangeModification<'de>) -> Self {
6753            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6754
6755            let heap = wire_.table.get(1);
6756
6757            let old_range = wire_.table.get(2);
6758
6759            let new_range = wire_.table.get(3);
6760
6761            Self {
6762                heap: heap.map(|envelope| {
6763                    ::fidl_next::FromWire::from_wire(unsafe {
6764                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
6765                    })
6766                }),
6767
6768                old_range: old_range.map(|envelope| {
6769                    ::fidl_next::FromWire::from_wire(unsafe {
6770                        envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6771                    })
6772                }),
6773
6774                new_range: new_range.map(|envelope| {
6775                    ::fidl_next::FromWire::from_wire(unsafe {
6776                        envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6777                    })
6778                }),
6779            }
6780        }
6781    }
6782
6783    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRangeModification<'de>>
6784        for SecureHeapAndRangeModification
6785    {
6786        #[inline]
6787        fn from_wire_ref(wire: &crate::wire::SecureHeapAndRangeModification<'de>) -> Self {
6788            Self {
6789                heap: wire.table.get(1).map(|envelope| {
6790                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6791                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
6792                    })
6793                }),
6794
6795                old_range: wire.table.get(2).map(|envelope| {
6796                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6797                        envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6798                    })
6799                }),
6800
6801                new_range: wire.table.get(3).map(|envelope| {
6802                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6803                        envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6804                    })
6805                }),
6806            }
6807        }
6808    }
6809
6810    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6811    pub struct SecureHeapAndRanges {
6812        pub heap: ::core::option::Option<crate::natural::Heap>,
6813
6814        pub ranges: ::core::option::Option<::std::vec::Vec<crate::natural::SecureHeapRange>>,
6815    }
6816
6817    impl SecureHeapAndRanges {
6818        fn __max_ordinal(&self) -> usize {
6819            if self.ranges.is_some() {
6820                return 2;
6821            }
6822
6823            if self.heap.is_some() {
6824                return 1;
6825            }
6826
6827            0
6828        }
6829    }
6830
6831    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRanges<'static>, ___E>
6832        for SecureHeapAndRanges
6833    where
6834        ___E: ::fidl_next::Encoder + ?Sized,
6835    {
6836        #[inline]
6837        fn encode(
6838            mut self,
6839            encoder: &mut ___E,
6840            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRanges<'static>>,
6841            _: (),
6842        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6843            ::fidl_next::munge!(let crate::wire::SecureHeapAndRanges { table } = out);
6844
6845            let max_ord = self.__max_ordinal();
6846
6847            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6848            ::fidl_next::Wire::zero_padding(&mut out);
6849
6850            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6851                ::fidl_next::wire::Envelope,
6852            >(encoder, max_ord);
6853
6854            for i in 1..=max_ord {
6855                match i {
6856                    2 => {
6857                        if let Some(value) = self.ranges.take() {
6858                            ::fidl_next::wire::Envelope::encode_value::<
6859                                ::fidl_next::wire::Vector<
6860                                    'static,
6861                                    crate::wire::SecureHeapRange<'static>,
6862                                >,
6863                                ___E,
6864                            >(
6865                                value, preallocated.encoder, &mut out, (128, ())
6866                            )?;
6867                        } else {
6868                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6869                        }
6870                    }
6871
6872                    1 => {
6873                        if let Some(value) = self.heap.take() {
6874                            ::fidl_next::wire::Envelope::encode_value::<
6875                                crate::wire::Heap<'static>,
6876                                ___E,
6877                            >(
6878                                value, preallocated.encoder, &mut out, ()
6879                            )?;
6880                        } else {
6881                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6882                        }
6883                    }
6884
6885                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6886                }
6887                unsafe {
6888                    preallocated.write_next(out.assume_init_ref());
6889                }
6890            }
6891
6892            ::fidl_next::wire::Table::encode_len(table, max_ord);
6893
6894            Ok(())
6895        }
6896    }
6897
6898    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRanges<'static>, ___E>
6899        for &'a SecureHeapAndRanges
6900    where
6901        ___E: ::fidl_next::Encoder + ?Sized,
6902    {
6903        #[inline]
6904        fn encode(
6905            self,
6906            encoder: &mut ___E,
6907            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRanges<'static>>,
6908            _: (),
6909        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6910            ::fidl_next::munge!(let crate::wire::SecureHeapAndRanges { table } = out);
6911
6912            let max_ord = self.__max_ordinal();
6913
6914            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6915            ::fidl_next::Wire::zero_padding(&mut out);
6916
6917            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6918                ::fidl_next::wire::Envelope,
6919            >(encoder, max_ord);
6920
6921            for i in 1..=max_ord {
6922                match i {
6923                    2 => {
6924                        if let Some(value) = &self.ranges {
6925                            ::fidl_next::wire::Envelope::encode_value::<
6926                                ::fidl_next::wire::Vector<
6927                                    'static,
6928                                    crate::wire::SecureHeapRange<'static>,
6929                                >,
6930                                ___E,
6931                            >(
6932                                value, preallocated.encoder, &mut out, (128, ())
6933                            )?;
6934                        } else {
6935                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6936                        }
6937                    }
6938
6939                    1 => {
6940                        if let Some(value) = &self.heap {
6941                            ::fidl_next::wire::Envelope::encode_value::<
6942                                crate::wire::Heap<'static>,
6943                                ___E,
6944                            >(
6945                                value, preallocated.encoder, &mut out, ()
6946                            )?;
6947                        } else {
6948                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6949                        }
6950                    }
6951
6952                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6953                }
6954                unsafe {
6955                    preallocated.write_next(out.assume_init_ref());
6956                }
6957            }
6958
6959            ::fidl_next::wire::Table::encode_len(table, max_ord);
6960
6961            Ok(())
6962        }
6963    }
6964
6965    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRanges<'de>> for SecureHeapAndRanges {
6966        #[inline]
6967        fn from_wire(wire_: crate::wire::SecureHeapAndRanges<'de>) -> Self {
6968            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6969
6970            let heap = wire_.table.get(1);
6971
6972            let ranges = wire_.table.get(2);
6973
6974            Self {
6975
6976
6977                heap: heap.map(|envelope| ::fidl_next::FromWire::from_wire(
6978                    unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() }
6979                )),
6980
6981
6982                ranges: ranges.map(|envelope| ::fidl_next::FromWire::from_wire(
6983                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>() }
6984                )),
6985
6986        }
6987        }
6988    }
6989
6990    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRanges<'de>> for SecureHeapAndRanges {
6991        #[inline]
6992        fn from_wire_ref(wire: &crate::wire::SecureHeapAndRanges<'de>) -> Self {
6993            Self {
6994
6995
6996                heap: wire.table.get(1)
6997                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6998                        unsafe { envelope.deref_unchecked::<crate::wire::Heap<'de>>() }
6999                    )),
7000
7001
7002                ranges: wire.table.get(2)
7003                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7004                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>() }
7005                    )),
7006
7007        }
7008        }
7009    }
7010
7011    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7012    pub struct SecureHeapProperties {
7013        pub heap: ::core::option::Option<crate::natural::Heap>,
7014
7015        pub dynamic_protection_ranges: ::core::option::Option<bool>,
7016
7017        pub protected_range_granularity: ::core::option::Option<u32>,
7018
7019        pub max_protected_range_count: ::core::option::Option<u64>,
7020
7021        pub is_mod_protected_range_available: ::core::option::Option<bool>,
7022    }
7023
7024    impl SecureHeapProperties {
7025        fn __max_ordinal(&self) -> usize {
7026            if self.is_mod_protected_range_available.is_some() {
7027                return 5;
7028            }
7029
7030            if self.max_protected_range_count.is_some() {
7031                return 4;
7032            }
7033
7034            if self.protected_range_granularity.is_some() {
7035                return 3;
7036            }
7037
7038            if self.dynamic_protection_ranges.is_some() {
7039                return 2;
7040            }
7041
7042            if self.heap.is_some() {
7043                return 1;
7044            }
7045
7046            0
7047        }
7048    }
7049
7050    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapProperties<'static>, ___E>
7051        for SecureHeapProperties
7052    where
7053        ___E: ::fidl_next::Encoder + ?Sized,
7054    {
7055        #[inline]
7056        fn encode(
7057            mut self,
7058            encoder: &mut ___E,
7059            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapProperties<'static>>,
7060            _: (),
7061        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7062            ::fidl_next::munge!(let crate::wire::SecureHeapProperties { table } = out);
7063
7064            let max_ord = self.__max_ordinal();
7065
7066            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7067            ::fidl_next::Wire::zero_padding(&mut out);
7068
7069            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7070                ::fidl_next::wire::Envelope,
7071            >(encoder, max_ord);
7072
7073            for i in 1..=max_ord {
7074                match i {
7075                    5 => {
7076                        if let Some(value) = self.is_mod_protected_range_available.take() {
7077                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7078                                value,
7079                                preallocated.encoder,
7080                                &mut out,
7081                                (),
7082                            )?;
7083                        } else {
7084                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7085                        }
7086                    }
7087
7088                    4 => {
7089                        if let Some(value) = self.max_protected_range_count.take() {
7090                            ::fidl_next::wire::Envelope::encode_value::<
7091                                ::fidl_next::wire::Uint64,
7092                                ___E,
7093                            >(
7094                                value, preallocated.encoder, &mut out, ()
7095                            )?;
7096                        } else {
7097                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7098                        }
7099                    }
7100
7101                    3 => {
7102                        if let Some(value) = self.protected_range_granularity.take() {
7103                            ::fidl_next::wire::Envelope::encode_value::<
7104                                ::fidl_next::wire::Uint32,
7105                                ___E,
7106                            >(
7107                                value, preallocated.encoder, &mut out, ()
7108                            )?;
7109                        } else {
7110                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7111                        }
7112                    }
7113
7114                    2 => {
7115                        if let Some(value) = self.dynamic_protection_ranges.take() {
7116                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7117                                value,
7118                                preallocated.encoder,
7119                                &mut out,
7120                                (),
7121                            )?;
7122                        } else {
7123                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7124                        }
7125                    }
7126
7127                    1 => {
7128                        if let Some(value) = self.heap.take() {
7129                            ::fidl_next::wire::Envelope::encode_value::<
7130                                crate::wire::Heap<'static>,
7131                                ___E,
7132                            >(
7133                                value, preallocated.encoder, &mut out, ()
7134                            )?;
7135                        } else {
7136                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7137                        }
7138                    }
7139
7140                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7141                }
7142                unsafe {
7143                    preallocated.write_next(out.assume_init_ref());
7144                }
7145            }
7146
7147            ::fidl_next::wire::Table::encode_len(table, max_ord);
7148
7149            Ok(())
7150        }
7151    }
7152
7153    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapProperties<'static>, ___E>
7154        for &'a SecureHeapProperties
7155    where
7156        ___E: ::fidl_next::Encoder + ?Sized,
7157    {
7158        #[inline]
7159        fn encode(
7160            self,
7161            encoder: &mut ___E,
7162            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapProperties<'static>>,
7163            _: (),
7164        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7165            ::fidl_next::munge!(let crate::wire::SecureHeapProperties { table } = out);
7166
7167            let max_ord = self.__max_ordinal();
7168
7169            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7170            ::fidl_next::Wire::zero_padding(&mut out);
7171
7172            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7173                ::fidl_next::wire::Envelope,
7174            >(encoder, max_ord);
7175
7176            for i in 1..=max_ord {
7177                match i {
7178                    5 => {
7179                        if let Some(value) = &self.is_mod_protected_range_available {
7180                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7181                                value,
7182                                preallocated.encoder,
7183                                &mut out,
7184                                (),
7185                            )?;
7186                        } else {
7187                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7188                        }
7189                    }
7190
7191                    4 => {
7192                        if let Some(value) = &self.max_protected_range_count {
7193                            ::fidl_next::wire::Envelope::encode_value::<
7194                                ::fidl_next::wire::Uint64,
7195                                ___E,
7196                            >(
7197                                value, preallocated.encoder, &mut out, ()
7198                            )?;
7199                        } else {
7200                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7201                        }
7202                    }
7203
7204                    3 => {
7205                        if let Some(value) = &self.protected_range_granularity {
7206                            ::fidl_next::wire::Envelope::encode_value::<
7207                                ::fidl_next::wire::Uint32,
7208                                ___E,
7209                            >(
7210                                value, preallocated.encoder, &mut out, ()
7211                            )?;
7212                        } else {
7213                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7214                        }
7215                    }
7216
7217                    2 => {
7218                        if let Some(value) = &self.dynamic_protection_ranges {
7219                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7220                                value,
7221                                preallocated.encoder,
7222                                &mut out,
7223                                (),
7224                            )?;
7225                        } else {
7226                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7227                        }
7228                    }
7229
7230                    1 => {
7231                        if let Some(value) = &self.heap {
7232                            ::fidl_next::wire::Envelope::encode_value::<
7233                                crate::wire::Heap<'static>,
7234                                ___E,
7235                            >(
7236                                value, preallocated.encoder, &mut out, ()
7237                            )?;
7238                        } else {
7239                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7240                        }
7241                    }
7242
7243                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7244                }
7245                unsafe {
7246                    preallocated.write_next(out.assume_init_ref());
7247                }
7248            }
7249
7250            ::fidl_next::wire::Table::encode_len(table, max_ord);
7251
7252            Ok(())
7253        }
7254    }
7255
7256    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapProperties<'de>> for SecureHeapProperties {
7257        #[inline]
7258        fn from_wire(wire_: crate::wire::SecureHeapProperties<'de>) -> Self {
7259            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7260
7261            let heap = wire_.table.get(1);
7262
7263            let dynamic_protection_ranges = wire_.table.get(2);
7264
7265            let protected_range_granularity = wire_.table.get(3);
7266
7267            let max_protected_range_count = wire_.table.get(4);
7268
7269            let is_mod_protected_range_available = wire_.table.get(5);
7270
7271            Self {
7272                heap: heap.map(|envelope| {
7273                    ::fidl_next::FromWire::from_wire(unsafe {
7274                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
7275                    })
7276                }),
7277
7278                dynamic_protection_ranges: dynamic_protection_ranges.map(|envelope| {
7279                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
7280                }),
7281
7282                protected_range_granularity: protected_range_granularity.map(|envelope| {
7283                    ::fidl_next::FromWire::from_wire(unsafe {
7284                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
7285                    })
7286                }),
7287
7288                max_protected_range_count: max_protected_range_count.map(|envelope| {
7289                    ::fidl_next::FromWire::from_wire(unsafe {
7290                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
7291                    })
7292                }),
7293
7294                is_mod_protected_range_available: is_mod_protected_range_available.map(
7295                    |envelope| {
7296                        ::fidl_next::FromWire::from_wire(unsafe {
7297                            envelope.read_unchecked::<bool>()
7298                        })
7299                    },
7300                ),
7301            }
7302        }
7303    }
7304
7305    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapProperties<'de>>
7306        for SecureHeapProperties
7307    {
7308        #[inline]
7309        fn from_wire_ref(wire: &crate::wire::SecureHeapProperties<'de>) -> Self {
7310            Self {
7311                heap: wire.table.get(1).map(|envelope| {
7312                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7313                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
7314                    })
7315                }),
7316
7317                dynamic_protection_ranges: wire.table.get(2).map(|envelope| {
7318                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7319                        envelope.deref_unchecked::<bool>()
7320                    })
7321                }),
7322
7323                protected_range_granularity: wire.table.get(3).map(|envelope| {
7324                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7325                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
7326                    })
7327                }),
7328
7329                max_protected_range_count: wire.table.get(4).map(|envelope| {
7330                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7331                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
7332                    })
7333                }),
7334
7335                is_mod_protected_range_available: wire.table.get(5).map(|envelope| {
7336                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7337                        envelope.deref_unchecked::<bool>()
7338                    })
7339                }),
7340            }
7341        }
7342    }
7343
7344    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7345    pub struct SecureMemGetPhysicalSecureHeapsResponse {
7346        pub heaps: ::core::option::Option<::std::vec::Vec<crate::natural::SecureHeapAndRanges>>,
7347    }
7348
7349    impl SecureMemGetPhysicalSecureHeapsResponse {
7350        fn __max_ordinal(&self) -> usize {
7351            if self.heaps.is_some() {
7352                return 1;
7353            }
7354
7355            0
7356        }
7357    }
7358
7359    unsafe impl<___E>
7360        ::fidl_next::Encode<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>, ___E>
7361        for SecureMemGetPhysicalSecureHeapsResponse
7362    where
7363        ___E: ::fidl_next::Encoder + ?Sized,
7364    {
7365        #[inline]
7366        fn encode(
7367            mut self,
7368            encoder: &mut ___E,
7369            out: &mut ::core::mem::MaybeUninit<
7370                crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
7371            >,
7372            _: (),
7373        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7374            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapsResponse { table } = out);
7375
7376            let max_ord = self.__max_ordinal();
7377
7378            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7379            ::fidl_next::Wire::zero_padding(&mut out);
7380
7381            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7382                ::fidl_next::wire::Envelope,
7383            >(encoder, max_ord);
7384
7385            for i in 1..=max_ord {
7386                match i {
7387                    1 => {
7388                        if let Some(value) = self.heaps.take() {
7389                            ::fidl_next::wire::Envelope::encode_value::<
7390                                ::fidl_next::wire::Vector<
7391                                    'static,
7392                                    crate::wire::SecureHeapAndRanges<'static>,
7393                                >,
7394                                ___E,
7395                            >(
7396                                value, preallocated.encoder, &mut out, (32, ())
7397                            )?;
7398                        } else {
7399                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7400                        }
7401                    }
7402
7403                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7404                }
7405                unsafe {
7406                    preallocated.write_next(out.assume_init_ref());
7407                }
7408            }
7409
7410            ::fidl_next::wire::Table::encode_len(table, max_ord);
7411
7412            Ok(())
7413        }
7414    }
7415
7416    unsafe impl<'a, ___E>
7417        ::fidl_next::Encode<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>, ___E>
7418        for &'a SecureMemGetPhysicalSecureHeapsResponse
7419    where
7420        ___E: ::fidl_next::Encoder + ?Sized,
7421    {
7422        #[inline]
7423        fn encode(
7424            self,
7425            encoder: &mut ___E,
7426            out: &mut ::core::mem::MaybeUninit<
7427                crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
7428            >,
7429            _: (),
7430        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7431            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapsResponse { table } = out);
7432
7433            let max_ord = self.__max_ordinal();
7434
7435            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7436            ::fidl_next::Wire::zero_padding(&mut out);
7437
7438            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7439                ::fidl_next::wire::Envelope,
7440            >(encoder, max_ord);
7441
7442            for i in 1..=max_ord {
7443                match i {
7444                    1 => {
7445                        if let Some(value) = &self.heaps {
7446                            ::fidl_next::wire::Envelope::encode_value::<
7447                                ::fidl_next::wire::Vector<
7448                                    'static,
7449                                    crate::wire::SecureHeapAndRanges<'static>,
7450                                >,
7451                                ___E,
7452                            >(
7453                                value, preallocated.encoder, &mut out, (32, ())
7454                            )?;
7455                        } else {
7456                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7457                        }
7458                    }
7459
7460                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7461                }
7462                unsafe {
7463                    preallocated.write_next(out.assume_init_ref());
7464                }
7465            }
7466
7467            ::fidl_next::wire::Table::encode_len(table, max_ord);
7468
7469            Ok(())
7470        }
7471    }
7472
7473    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>>
7474        for SecureMemGetPhysicalSecureHeapsResponse
7475    {
7476        #[inline]
7477        fn from_wire(wire_: crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>) -> Self {
7478            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7479
7480            let heaps = wire_.table.get(1);
7481
7482            Self {
7483                heaps:
7484                    heaps.map(|envelope| {
7485                        ::fidl_next::FromWire::from_wire(unsafe {
7486                            envelope.read_unchecked::<::fidl_next::wire::Vector<
7487                                'de,
7488                                crate::wire::SecureHeapAndRanges<'de>,
7489                            >>()
7490                        })
7491                    }),
7492            }
7493        }
7494    }
7495
7496    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>>
7497        for SecureMemGetPhysicalSecureHeapsResponse
7498    {
7499        #[inline]
7500        fn from_wire_ref(wire: &crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>) -> Self {
7501            Self {
7502                heaps:
7503                    wire.table.get(1).map(|envelope| {
7504                        ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7505                            envelope.deref_unchecked::<::fidl_next::wire::Vector<
7506                                'de,
7507                                crate::wire::SecureHeapAndRanges<'de>,
7508                            >>()
7509                        })
7510                    }),
7511            }
7512        }
7513    }
7514
7515    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7516    pub struct SecureMemGetDynamicSecureHeapsResponse {
7517        pub heaps: ::core::option::Option<::std::vec::Vec<crate::natural::DynamicSecureHeap>>,
7518    }
7519
7520    impl SecureMemGetDynamicSecureHeapsResponse {
7521        fn __max_ordinal(&self) -> usize {
7522            if self.heaps.is_some() {
7523                return 1;
7524            }
7525
7526            0
7527        }
7528    }
7529
7530    unsafe impl<___E>
7531        ::fidl_next::Encode<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>, ___E>
7532        for SecureMemGetDynamicSecureHeapsResponse
7533    where
7534        ___E: ::fidl_next::Encoder + ?Sized,
7535    {
7536        #[inline]
7537        fn encode(
7538            mut self,
7539            encoder: &mut ___E,
7540            out: &mut ::core::mem::MaybeUninit<
7541                crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
7542            >,
7543            _: (),
7544        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7545            ::fidl_next::munge!(let crate::wire::SecureMemGetDynamicSecureHeapsResponse { table } = out);
7546
7547            let max_ord = self.__max_ordinal();
7548
7549            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7550            ::fidl_next::Wire::zero_padding(&mut out);
7551
7552            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7553                ::fidl_next::wire::Envelope,
7554            >(encoder, max_ord);
7555
7556            for i in 1..=max_ord {
7557                match i {
7558                    1 => {
7559                        if let Some(value) = self.heaps.take() {
7560                            ::fidl_next::wire::Envelope::encode_value::<
7561                                ::fidl_next::wire::Vector<
7562                                    'static,
7563                                    crate::wire::DynamicSecureHeap<'static>,
7564                                >,
7565                                ___E,
7566                            >(
7567                                value, preallocated.encoder, &mut out, (32, ())
7568                            )?;
7569                        } else {
7570                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7571                        }
7572                    }
7573
7574                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7575                }
7576                unsafe {
7577                    preallocated.write_next(out.assume_init_ref());
7578                }
7579            }
7580
7581            ::fidl_next::wire::Table::encode_len(table, max_ord);
7582
7583            Ok(())
7584        }
7585    }
7586
7587    unsafe impl<'a, ___E>
7588        ::fidl_next::Encode<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>, ___E>
7589        for &'a SecureMemGetDynamicSecureHeapsResponse
7590    where
7591        ___E: ::fidl_next::Encoder + ?Sized,
7592    {
7593        #[inline]
7594        fn encode(
7595            self,
7596            encoder: &mut ___E,
7597            out: &mut ::core::mem::MaybeUninit<
7598                crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
7599            >,
7600            _: (),
7601        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7602            ::fidl_next::munge!(let crate::wire::SecureMemGetDynamicSecureHeapsResponse { table } = out);
7603
7604            let max_ord = self.__max_ordinal();
7605
7606            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7607            ::fidl_next::Wire::zero_padding(&mut out);
7608
7609            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7610                ::fidl_next::wire::Envelope,
7611            >(encoder, max_ord);
7612
7613            for i in 1..=max_ord {
7614                match i {
7615                    1 => {
7616                        if let Some(value) = &self.heaps {
7617                            ::fidl_next::wire::Envelope::encode_value::<
7618                                ::fidl_next::wire::Vector<
7619                                    'static,
7620                                    crate::wire::DynamicSecureHeap<'static>,
7621                                >,
7622                                ___E,
7623                            >(
7624                                value, preallocated.encoder, &mut out, (32, ())
7625                            )?;
7626                        } else {
7627                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7628                        }
7629                    }
7630
7631                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7632                }
7633                unsafe {
7634                    preallocated.write_next(out.assume_init_ref());
7635                }
7636            }
7637
7638            ::fidl_next::wire::Table::encode_len(table, max_ord);
7639
7640            Ok(())
7641        }
7642    }
7643
7644    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>>
7645        for SecureMemGetDynamicSecureHeapsResponse
7646    {
7647        #[inline]
7648        fn from_wire(wire_: crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>) -> Self {
7649            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7650
7651            let heaps = wire_.table.get(1);
7652
7653            Self {
7654
7655
7656                heaps: heaps.map(|envelope| ::fidl_next::FromWire::from_wire(
7657                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>() }
7658                )),
7659
7660        }
7661        }
7662    }
7663
7664    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>>
7665        for SecureMemGetDynamicSecureHeapsResponse
7666    {
7667        #[inline]
7668        fn from_wire_ref(wire: &crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>) -> Self {
7669            Self {
7670
7671
7672                heaps: wire.table.get(1)
7673                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7674                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>() }
7675                    )),
7676
7677        }
7678        }
7679    }
7680
7681    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7682    pub struct SecureMemGetPhysicalSecureHeapPropertiesRequest {
7683        pub entire_heap: ::core::option::Option<crate::natural::SecureHeapAndRange>,
7684    }
7685
7686    impl SecureMemGetPhysicalSecureHeapPropertiesRequest {
7687        fn __max_ordinal(&self) -> usize {
7688            if self.entire_heap.is_some() {
7689                return 1;
7690            }
7691
7692            0
7693        }
7694    }
7695
7696    unsafe impl<___E>
7697        ::fidl_next::Encode<
7698            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7699            ___E,
7700        > for SecureMemGetPhysicalSecureHeapPropertiesRequest
7701    where
7702        ___E: ::fidl_next::Encoder + ?Sized,
7703    {
7704        #[inline]
7705        fn encode(
7706            mut self,
7707            encoder: &mut ___E,
7708            out: &mut ::core::mem::MaybeUninit<
7709                crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7710            >,
7711            _: (),
7712        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7713            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest { table } = out);
7714
7715            let max_ord = self.__max_ordinal();
7716
7717            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7718            ::fidl_next::Wire::zero_padding(&mut out);
7719
7720            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7721                ::fidl_next::wire::Envelope,
7722            >(encoder, max_ord);
7723
7724            for i in 1..=max_ord {
7725                match i {
7726                    1 => {
7727                        if let Some(value) = self.entire_heap.take() {
7728                            ::fidl_next::wire::Envelope::encode_value::<
7729                                crate::wire::SecureHeapAndRange<'static>,
7730                                ___E,
7731                            >(
7732                                value, preallocated.encoder, &mut out, ()
7733                            )?;
7734                        } else {
7735                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7736                        }
7737                    }
7738
7739                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7740                }
7741                unsafe {
7742                    preallocated.write_next(out.assume_init_ref());
7743                }
7744            }
7745
7746            ::fidl_next::wire::Table::encode_len(table, max_ord);
7747
7748            Ok(())
7749        }
7750    }
7751
7752    unsafe impl<'a, ___E>
7753        ::fidl_next::Encode<
7754            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7755            ___E,
7756        > for &'a SecureMemGetPhysicalSecureHeapPropertiesRequest
7757    where
7758        ___E: ::fidl_next::Encoder + ?Sized,
7759    {
7760        #[inline]
7761        fn encode(
7762            self,
7763            encoder: &mut ___E,
7764            out: &mut ::core::mem::MaybeUninit<
7765                crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7766            >,
7767            _: (),
7768        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7769            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest { table } = out);
7770
7771            let max_ord = self.__max_ordinal();
7772
7773            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7774            ::fidl_next::Wire::zero_padding(&mut out);
7775
7776            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7777                ::fidl_next::wire::Envelope,
7778            >(encoder, max_ord);
7779
7780            for i in 1..=max_ord {
7781                match i {
7782                    1 => {
7783                        if let Some(value) = &self.entire_heap {
7784                            ::fidl_next::wire::Envelope::encode_value::<
7785                                crate::wire::SecureHeapAndRange<'static>,
7786                                ___E,
7787                            >(
7788                                value, preallocated.encoder, &mut out, ()
7789                            )?;
7790                        } else {
7791                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7792                        }
7793                    }
7794
7795                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7796                }
7797                unsafe {
7798                    preallocated.write_next(out.assume_init_ref());
7799                }
7800            }
7801
7802            ::fidl_next::wire::Table::encode_len(table, max_ord);
7803
7804            Ok(())
7805        }
7806    }
7807
7808    impl<'de>
7809        ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>>
7810        for SecureMemGetPhysicalSecureHeapPropertiesRequest
7811    {
7812        #[inline]
7813        fn from_wire(
7814            wire_: crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>,
7815        ) -> Self {
7816            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7817
7818            let entire_heap = wire_.table.get(1);
7819
7820            Self {
7821                entire_heap: entire_heap.map(|envelope| {
7822                    ::fidl_next::FromWire::from_wire(unsafe {
7823                        envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
7824                    })
7825                }),
7826            }
7827        }
7828    }
7829
7830    impl<'de>
7831        ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>>
7832        for SecureMemGetPhysicalSecureHeapPropertiesRequest
7833    {
7834        #[inline]
7835        fn from_wire_ref(
7836            wire: &crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>,
7837        ) -> Self {
7838            Self {
7839                entire_heap: wire.table.get(1).map(|envelope| {
7840                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7841                        envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
7842                    })
7843                }),
7844            }
7845        }
7846    }
7847
7848    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7849    pub struct SecureMemGetPhysicalSecureHeapPropertiesResponse {
7850        pub properties: ::core::option::Option<crate::natural::SecureHeapProperties>,
7851    }
7852
7853    impl SecureMemGetPhysicalSecureHeapPropertiesResponse {
7854        fn __max_ordinal(&self) -> usize {
7855            if self.properties.is_some() {
7856                return 1;
7857            }
7858
7859            0
7860        }
7861    }
7862
7863    unsafe impl<___E>
7864        ::fidl_next::Encode<
7865            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7866            ___E,
7867        > for SecureMemGetPhysicalSecureHeapPropertiesResponse
7868    where
7869        ___E: ::fidl_next::Encoder + ?Sized,
7870    {
7871        #[inline]
7872        fn encode(
7873            mut self,
7874            encoder: &mut ___E,
7875            out: &mut ::core::mem::MaybeUninit<
7876                crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7877            >,
7878            _: (),
7879        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7880            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse { table } = out);
7881
7882            let max_ord = self.__max_ordinal();
7883
7884            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7885            ::fidl_next::Wire::zero_padding(&mut out);
7886
7887            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7888                ::fidl_next::wire::Envelope,
7889            >(encoder, max_ord);
7890
7891            for i in 1..=max_ord {
7892                match i {
7893                    1 => {
7894                        if let Some(value) = self.properties.take() {
7895                            ::fidl_next::wire::Envelope::encode_value::<
7896                                crate::wire::SecureHeapProperties<'static>,
7897                                ___E,
7898                            >(
7899                                value, preallocated.encoder, &mut out, ()
7900                            )?;
7901                        } else {
7902                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7903                        }
7904                    }
7905
7906                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7907                }
7908                unsafe {
7909                    preallocated.write_next(out.assume_init_ref());
7910                }
7911            }
7912
7913            ::fidl_next::wire::Table::encode_len(table, max_ord);
7914
7915            Ok(())
7916        }
7917    }
7918
7919    unsafe impl<'a, ___E>
7920        ::fidl_next::Encode<
7921            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7922            ___E,
7923        > for &'a SecureMemGetPhysicalSecureHeapPropertiesResponse
7924    where
7925        ___E: ::fidl_next::Encoder + ?Sized,
7926    {
7927        #[inline]
7928        fn encode(
7929            self,
7930            encoder: &mut ___E,
7931            out: &mut ::core::mem::MaybeUninit<
7932                crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7933            >,
7934            _: (),
7935        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7936            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse { table } = out);
7937
7938            let max_ord = self.__max_ordinal();
7939
7940            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7941            ::fidl_next::Wire::zero_padding(&mut out);
7942
7943            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7944                ::fidl_next::wire::Envelope,
7945            >(encoder, max_ord);
7946
7947            for i in 1..=max_ord {
7948                match i {
7949                    1 => {
7950                        if let Some(value) = &self.properties {
7951                            ::fidl_next::wire::Envelope::encode_value::<
7952                                crate::wire::SecureHeapProperties<'static>,
7953                                ___E,
7954                            >(
7955                                value, preallocated.encoder, &mut out, ()
7956                            )?;
7957                        } else {
7958                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7959                        }
7960                    }
7961
7962                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7963                }
7964                unsafe {
7965                    preallocated.write_next(out.assume_init_ref());
7966                }
7967            }
7968
7969            ::fidl_next::wire::Table::encode_len(table, max_ord);
7970
7971            Ok(())
7972        }
7973    }
7974
7975    impl<'de>
7976        ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>>
7977        for SecureMemGetPhysicalSecureHeapPropertiesResponse
7978    {
7979        #[inline]
7980        fn from_wire(
7981            wire_: crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>,
7982        ) -> Self {
7983            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7984
7985            let properties = wire_.table.get(1);
7986
7987            Self {
7988                properties: properties.map(|envelope| {
7989                    ::fidl_next::FromWire::from_wire(unsafe {
7990                        envelope.read_unchecked::<crate::wire::SecureHeapProperties<'de>>()
7991                    })
7992                }),
7993            }
7994        }
7995    }
7996
7997    impl<'de>
7998        ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>>
7999        for SecureMemGetPhysicalSecureHeapPropertiesResponse
8000    {
8001        #[inline]
8002        fn from_wire_ref(
8003            wire: &crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>,
8004        ) -> Self {
8005            Self {
8006                properties: wire.table.get(1).map(|envelope| {
8007                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8008                        envelope.deref_unchecked::<crate::wire::SecureHeapProperties<'de>>()
8009                    })
8010                }),
8011            }
8012        }
8013    }
8014
8015    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8016    pub struct SecureMemAddSecureHeapPhysicalRangeRequest {
8017        pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
8018    }
8019
8020    impl SecureMemAddSecureHeapPhysicalRangeRequest {
8021        fn __max_ordinal(&self) -> usize {
8022            if self.heap_range.is_some() {
8023                return 1;
8024            }
8025
8026            0
8027        }
8028    }
8029
8030    unsafe impl<___E>
8031        ::fidl_next::Encode<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>, ___E>
8032        for SecureMemAddSecureHeapPhysicalRangeRequest
8033    where
8034        ___E: ::fidl_next::Encoder + ?Sized,
8035    {
8036        #[inline]
8037        fn encode(
8038            mut self,
8039            encoder: &mut ___E,
8040            out: &mut ::core::mem::MaybeUninit<
8041                crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
8042            >,
8043            _: (),
8044        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8045            ::fidl_next::munge!(let crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest { table } = out);
8046
8047            let max_ord = self.__max_ordinal();
8048
8049            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8050            ::fidl_next::Wire::zero_padding(&mut out);
8051
8052            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8053                ::fidl_next::wire::Envelope,
8054            >(encoder, max_ord);
8055
8056            for i in 1..=max_ord {
8057                match i {
8058                    1 => {
8059                        if let Some(value) = self.heap_range.take() {
8060                            ::fidl_next::wire::Envelope::encode_value::<
8061                                crate::wire::SecureHeapAndRange<'static>,
8062                                ___E,
8063                            >(
8064                                value, preallocated.encoder, &mut out, ()
8065                            )?;
8066                        } else {
8067                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8068                        }
8069                    }
8070
8071                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8072                }
8073                unsafe {
8074                    preallocated.write_next(out.assume_init_ref());
8075                }
8076            }
8077
8078            ::fidl_next::wire::Table::encode_len(table, max_ord);
8079
8080            Ok(())
8081        }
8082    }
8083
8084    unsafe impl<'a, ___E>
8085        ::fidl_next::Encode<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>, ___E>
8086        for &'a SecureMemAddSecureHeapPhysicalRangeRequest
8087    where
8088        ___E: ::fidl_next::Encoder + ?Sized,
8089    {
8090        #[inline]
8091        fn encode(
8092            self,
8093            encoder: &mut ___E,
8094            out: &mut ::core::mem::MaybeUninit<
8095                crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
8096            >,
8097            _: (),
8098        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8099            ::fidl_next::munge!(let crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest { table } = out);
8100
8101            let max_ord = self.__max_ordinal();
8102
8103            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8104            ::fidl_next::Wire::zero_padding(&mut out);
8105
8106            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8107                ::fidl_next::wire::Envelope,
8108            >(encoder, max_ord);
8109
8110            for i in 1..=max_ord {
8111                match i {
8112                    1 => {
8113                        if let Some(value) = &self.heap_range {
8114                            ::fidl_next::wire::Envelope::encode_value::<
8115                                crate::wire::SecureHeapAndRange<'static>,
8116                                ___E,
8117                            >(
8118                                value, preallocated.encoder, &mut out, ()
8119                            )?;
8120                        } else {
8121                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8122                        }
8123                    }
8124
8125                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8126                }
8127                unsafe {
8128                    preallocated.write_next(out.assume_init_ref());
8129                }
8130            }
8131
8132            ::fidl_next::wire::Table::encode_len(table, max_ord);
8133
8134            Ok(())
8135        }
8136    }
8137
8138    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>>
8139        for SecureMemAddSecureHeapPhysicalRangeRequest
8140    {
8141        #[inline]
8142        fn from_wire(wire_: crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>) -> Self {
8143            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8144
8145            let heap_range = wire_.table.get(1);
8146
8147            Self {
8148                heap_range: heap_range.map(|envelope| {
8149                    ::fidl_next::FromWire::from_wire(unsafe {
8150                        envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8151                    })
8152                }),
8153            }
8154        }
8155    }
8156
8157    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>>
8158        for SecureMemAddSecureHeapPhysicalRangeRequest
8159    {
8160        #[inline]
8161        fn from_wire_ref(
8162            wire: &crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>,
8163        ) -> Self {
8164            Self {
8165                heap_range: wire.table.get(1).map(|envelope| {
8166                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8167                        envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8168                    })
8169                }),
8170            }
8171        }
8172    }
8173
8174    pub type SecureMemAddSecureHeapPhysicalRangeResponse = ();
8175
8176    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8177    pub struct SecureMemDeleteSecureHeapPhysicalRangeRequest {
8178        pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
8179    }
8180
8181    impl SecureMemDeleteSecureHeapPhysicalRangeRequest {
8182        fn __max_ordinal(&self) -> usize {
8183            if self.heap_range.is_some() {
8184                return 1;
8185            }
8186
8187            0
8188        }
8189    }
8190
8191    unsafe impl<___E>
8192        ::fidl_next::Encode<
8193            crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8194            ___E,
8195        > for SecureMemDeleteSecureHeapPhysicalRangeRequest
8196    where
8197        ___E: ::fidl_next::Encoder + ?Sized,
8198    {
8199        #[inline]
8200        fn encode(
8201            mut self,
8202            encoder: &mut ___E,
8203            out: &mut ::core::mem::MaybeUninit<
8204                crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8205            >,
8206            _: (),
8207        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8208            ::fidl_next::munge!(let crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest { table } = out);
8209
8210            let max_ord = self.__max_ordinal();
8211
8212            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8213            ::fidl_next::Wire::zero_padding(&mut out);
8214
8215            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8216                ::fidl_next::wire::Envelope,
8217            >(encoder, max_ord);
8218
8219            for i in 1..=max_ord {
8220                match i {
8221                    1 => {
8222                        if let Some(value) = self.heap_range.take() {
8223                            ::fidl_next::wire::Envelope::encode_value::<
8224                                crate::wire::SecureHeapAndRange<'static>,
8225                                ___E,
8226                            >(
8227                                value, preallocated.encoder, &mut out, ()
8228                            )?;
8229                        } else {
8230                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8231                        }
8232                    }
8233
8234                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8235                }
8236                unsafe {
8237                    preallocated.write_next(out.assume_init_ref());
8238                }
8239            }
8240
8241            ::fidl_next::wire::Table::encode_len(table, max_ord);
8242
8243            Ok(())
8244        }
8245    }
8246
8247    unsafe impl<'a, ___E>
8248        ::fidl_next::Encode<
8249            crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8250            ___E,
8251        > for &'a SecureMemDeleteSecureHeapPhysicalRangeRequest
8252    where
8253        ___E: ::fidl_next::Encoder + ?Sized,
8254    {
8255        #[inline]
8256        fn encode(
8257            self,
8258            encoder: &mut ___E,
8259            out: &mut ::core::mem::MaybeUninit<
8260                crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8261            >,
8262            _: (),
8263        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8264            ::fidl_next::munge!(let crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest { table } = out);
8265
8266            let max_ord = self.__max_ordinal();
8267
8268            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8269            ::fidl_next::Wire::zero_padding(&mut out);
8270
8271            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8272                ::fidl_next::wire::Envelope,
8273            >(encoder, max_ord);
8274
8275            for i in 1..=max_ord {
8276                match i {
8277                    1 => {
8278                        if let Some(value) = &self.heap_range {
8279                            ::fidl_next::wire::Envelope::encode_value::<
8280                                crate::wire::SecureHeapAndRange<'static>,
8281                                ___E,
8282                            >(
8283                                value, preallocated.encoder, &mut out, ()
8284                            )?;
8285                        } else {
8286                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8287                        }
8288                    }
8289
8290                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8291                }
8292                unsafe {
8293                    preallocated.write_next(out.assume_init_ref());
8294                }
8295            }
8296
8297            ::fidl_next::wire::Table::encode_len(table, max_ord);
8298
8299            Ok(())
8300        }
8301    }
8302
8303    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>>
8304        for SecureMemDeleteSecureHeapPhysicalRangeRequest
8305    {
8306        #[inline]
8307        fn from_wire(
8308            wire_: crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>,
8309        ) -> Self {
8310            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8311
8312            let heap_range = wire_.table.get(1);
8313
8314            Self {
8315                heap_range: heap_range.map(|envelope| {
8316                    ::fidl_next::FromWire::from_wire(unsafe {
8317                        envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8318                    })
8319                }),
8320            }
8321        }
8322    }
8323
8324    impl<'de>
8325        ::fidl_next::FromWireRef<crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>>
8326        for SecureMemDeleteSecureHeapPhysicalRangeRequest
8327    {
8328        #[inline]
8329        fn from_wire_ref(
8330            wire: &crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>,
8331        ) -> Self {
8332            Self {
8333                heap_range: wire.table.get(1).map(|envelope| {
8334                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8335                        envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8336                    })
8337                }),
8338            }
8339        }
8340    }
8341
8342    pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ();
8343
8344    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8345    pub struct SecureMemModifySecureHeapPhysicalRangeRequest {
8346        pub range_modification:
8347            ::core::option::Option<crate::natural::SecureHeapAndRangeModification>,
8348    }
8349
8350    impl SecureMemModifySecureHeapPhysicalRangeRequest {
8351        fn __max_ordinal(&self) -> usize {
8352            if self.range_modification.is_some() {
8353                return 1;
8354            }
8355
8356            0
8357        }
8358    }
8359
8360    unsafe impl<___E>
8361        ::fidl_next::Encode<
8362            crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8363            ___E,
8364        > for SecureMemModifySecureHeapPhysicalRangeRequest
8365    where
8366        ___E: ::fidl_next::Encoder + ?Sized,
8367    {
8368        #[inline]
8369        fn encode(
8370            mut self,
8371            encoder: &mut ___E,
8372            out: &mut ::core::mem::MaybeUninit<
8373                crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8374            >,
8375            _: (),
8376        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8377            ::fidl_next::munge!(let crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest { table } = out);
8378
8379            let max_ord = self.__max_ordinal();
8380
8381            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8382            ::fidl_next::Wire::zero_padding(&mut out);
8383
8384            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8385                ::fidl_next::wire::Envelope,
8386            >(encoder, max_ord);
8387
8388            for i in 1..=max_ord {
8389                match i {
8390                    1 => {
8391                        if let Some(value) = self.range_modification.take() {
8392                            ::fidl_next::wire::Envelope::encode_value::<
8393                                crate::wire::SecureHeapAndRangeModification<'static>,
8394                                ___E,
8395                            >(
8396                                value, preallocated.encoder, &mut out, ()
8397                            )?;
8398                        } else {
8399                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8400                        }
8401                    }
8402
8403                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8404                }
8405                unsafe {
8406                    preallocated.write_next(out.assume_init_ref());
8407                }
8408            }
8409
8410            ::fidl_next::wire::Table::encode_len(table, max_ord);
8411
8412            Ok(())
8413        }
8414    }
8415
8416    unsafe impl<'a, ___E>
8417        ::fidl_next::Encode<
8418            crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8419            ___E,
8420        > for &'a SecureMemModifySecureHeapPhysicalRangeRequest
8421    where
8422        ___E: ::fidl_next::Encoder + ?Sized,
8423    {
8424        #[inline]
8425        fn encode(
8426            self,
8427            encoder: &mut ___E,
8428            out: &mut ::core::mem::MaybeUninit<
8429                crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8430            >,
8431            _: (),
8432        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8433            ::fidl_next::munge!(let crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest { table } = out);
8434
8435            let max_ord = self.__max_ordinal();
8436
8437            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8438            ::fidl_next::Wire::zero_padding(&mut out);
8439
8440            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8441                ::fidl_next::wire::Envelope,
8442            >(encoder, max_ord);
8443
8444            for i in 1..=max_ord {
8445                match i {
8446                    1 => {
8447                        if let Some(value) = &self.range_modification {
8448                            ::fidl_next::wire::Envelope::encode_value::<
8449                                crate::wire::SecureHeapAndRangeModification<'static>,
8450                                ___E,
8451                            >(
8452                                value, preallocated.encoder, &mut out, ()
8453                            )?;
8454                        } else {
8455                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8456                        }
8457                    }
8458
8459                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8460                }
8461                unsafe {
8462                    preallocated.write_next(out.assume_init_ref());
8463                }
8464            }
8465
8466            ::fidl_next::wire::Table::encode_len(table, max_ord);
8467
8468            Ok(())
8469        }
8470    }
8471
8472    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>>
8473        for SecureMemModifySecureHeapPhysicalRangeRequest
8474    {
8475        #[inline]
8476        fn from_wire(
8477            wire_: crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>,
8478        ) -> Self {
8479            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8480
8481            let range_modification = wire_.table.get(1);
8482
8483            Self {
8484                range_modification: range_modification.map(|envelope| {
8485                    ::fidl_next::FromWire::from_wire(unsafe {
8486                        envelope
8487                            .read_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
8488                    })
8489                }),
8490            }
8491        }
8492    }
8493
8494    impl<'de>
8495        ::fidl_next::FromWireRef<crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>>
8496        for SecureMemModifySecureHeapPhysicalRangeRequest
8497    {
8498        #[inline]
8499        fn from_wire_ref(
8500            wire: &crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>,
8501        ) -> Self {
8502            Self {
8503                range_modification: wire.table.get(1).map(|envelope| {
8504                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8505                        envelope
8506                            .deref_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
8507                    })
8508                }),
8509            }
8510        }
8511    }
8512
8513    pub type SecureMemModifySecureHeapPhysicalRangeResponse = ();
8514
8515    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8516    pub struct SecureMemZeroSubRangeRequest {
8517        pub is_covering_range_explicit: ::core::option::Option<bool>,
8518
8519        pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
8520    }
8521
8522    impl SecureMemZeroSubRangeRequest {
8523        fn __max_ordinal(&self) -> usize {
8524            if self.heap_range.is_some() {
8525                return 2;
8526            }
8527
8528            if self.is_covering_range_explicit.is_some() {
8529                return 1;
8530            }
8531
8532            0
8533        }
8534    }
8535
8536    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureMemZeroSubRangeRequest<'static>, ___E>
8537        for SecureMemZeroSubRangeRequest
8538    where
8539        ___E: ::fidl_next::Encoder + ?Sized,
8540    {
8541        #[inline]
8542        fn encode(
8543            mut self,
8544            encoder: &mut ___E,
8545            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureMemZeroSubRangeRequest<'static>>,
8546            _: (),
8547        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8548            ::fidl_next::munge!(let crate::wire::SecureMemZeroSubRangeRequest { table } = out);
8549
8550            let max_ord = self.__max_ordinal();
8551
8552            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8553            ::fidl_next::Wire::zero_padding(&mut out);
8554
8555            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8556                ::fidl_next::wire::Envelope,
8557            >(encoder, max_ord);
8558
8559            for i in 1..=max_ord {
8560                match i {
8561                    2 => {
8562                        if let Some(value) = self.heap_range.take() {
8563                            ::fidl_next::wire::Envelope::encode_value::<
8564                                crate::wire::SecureHeapAndRange<'static>,
8565                                ___E,
8566                            >(
8567                                value, preallocated.encoder, &mut out, ()
8568                            )?;
8569                        } else {
8570                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8571                        }
8572                    }
8573
8574                    1 => {
8575                        if let Some(value) = self.is_covering_range_explicit.take() {
8576                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
8577                                value,
8578                                preallocated.encoder,
8579                                &mut out,
8580                                (),
8581                            )?;
8582                        } else {
8583                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8584                        }
8585                    }
8586
8587                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8588                }
8589                unsafe {
8590                    preallocated.write_next(out.assume_init_ref());
8591                }
8592            }
8593
8594            ::fidl_next::wire::Table::encode_len(table, max_ord);
8595
8596            Ok(())
8597        }
8598    }
8599
8600    unsafe impl<'a, ___E>
8601        ::fidl_next::Encode<crate::wire::SecureMemZeroSubRangeRequest<'static>, ___E>
8602        for &'a SecureMemZeroSubRangeRequest
8603    where
8604        ___E: ::fidl_next::Encoder + ?Sized,
8605    {
8606        #[inline]
8607        fn encode(
8608            self,
8609            encoder: &mut ___E,
8610            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureMemZeroSubRangeRequest<'static>>,
8611            _: (),
8612        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8613            ::fidl_next::munge!(let crate::wire::SecureMemZeroSubRangeRequest { table } = out);
8614
8615            let max_ord = self.__max_ordinal();
8616
8617            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8618            ::fidl_next::Wire::zero_padding(&mut out);
8619
8620            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8621                ::fidl_next::wire::Envelope,
8622            >(encoder, max_ord);
8623
8624            for i in 1..=max_ord {
8625                match i {
8626                    2 => {
8627                        if let Some(value) = &self.heap_range {
8628                            ::fidl_next::wire::Envelope::encode_value::<
8629                                crate::wire::SecureHeapAndRange<'static>,
8630                                ___E,
8631                            >(
8632                                value, preallocated.encoder, &mut out, ()
8633                            )?;
8634                        } else {
8635                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8636                        }
8637                    }
8638
8639                    1 => {
8640                        if let Some(value) = &self.is_covering_range_explicit {
8641                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
8642                                value,
8643                                preallocated.encoder,
8644                                &mut out,
8645                                (),
8646                            )?;
8647                        } else {
8648                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8649                        }
8650                    }
8651
8652                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8653                }
8654                unsafe {
8655                    preallocated.write_next(out.assume_init_ref());
8656                }
8657            }
8658
8659            ::fidl_next::wire::Table::encode_len(table, max_ord);
8660
8661            Ok(())
8662        }
8663    }
8664
8665    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemZeroSubRangeRequest<'de>>
8666        for SecureMemZeroSubRangeRequest
8667    {
8668        #[inline]
8669        fn from_wire(wire_: crate::wire::SecureMemZeroSubRangeRequest<'de>) -> Self {
8670            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8671
8672            let is_covering_range_explicit = wire_.table.get(1);
8673
8674            let heap_range = wire_.table.get(2);
8675
8676            Self {
8677                is_covering_range_explicit: is_covering_range_explicit.map(|envelope| {
8678                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
8679                }),
8680
8681                heap_range: heap_range.map(|envelope| {
8682                    ::fidl_next::FromWire::from_wire(unsafe {
8683                        envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8684                    })
8685                }),
8686            }
8687        }
8688    }
8689
8690    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemZeroSubRangeRequest<'de>>
8691        for SecureMemZeroSubRangeRequest
8692    {
8693        #[inline]
8694        fn from_wire_ref(wire: &crate::wire::SecureMemZeroSubRangeRequest<'de>) -> Self {
8695            Self {
8696                is_covering_range_explicit: wire.table.get(1).map(|envelope| {
8697                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8698                        envelope.deref_unchecked::<bool>()
8699                    })
8700                }),
8701
8702                heap_range: wire.table.get(2).map(|envelope| {
8703                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8704                        envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8705                    })
8706                }),
8707            }
8708        }
8709    }
8710
8711    pub type SecureMemZeroSubRangeResponse = ();
8712}
8713
8714pub mod wire {
8715
8716    /// The wire type corresponding to [`AllocatorValidateBufferCollectionTokenRequest`].
8717    #[repr(C)]
8718    pub struct AllocatorValidateBufferCollectionTokenRequest<'de> {
8719        pub(crate) table: ::fidl_next::wire::Table<'de>,
8720    }
8721
8722    impl<'de> Drop for AllocatorValidateBufferCollectionTokenRequest<'de> {
8723        fn drop(&mut self) {
8724            let _ = self
8725                .table
8726                .get(1)
8727                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
8728        }
8729    }
8730
8731    impl ::fidl_next::Constrained for AllocatorValidateBufferCollectionTokenRequest<'_> {
8732        type Constraint = ();
8733
8734        fn validate(
8735            _: ::fidl_next::Slot<'_, Self>,
8736            _: Self::Constraint,
8737        ) -> Result<(), ::fidl_next::ValidationError> {
8738            Ok(())
8739        }
8740    }
8741
8742    unsafe impl ::fidl_next::Wire for AllocatorValidateBufferCollectionTokenRequest<'static> {
8743        type Narrowed<'de> = AllocatorValidateBufferCollectionTokenRequest<'de>;
8744
8745        #[inline]
8746        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8747            ::fidl_next::munge!(let Self { table } = out);
8748            ::fidl_next::wire::Table::zero_padding(table);
8749        }
8750    }
8751
8752    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
8753        for AllocatorValidateBufferCollectionTokenRequest<'de>
8754    where
8755        ___D: ::fidl_next::Decoder<'de> + ?Sized,
8756    {
8757        fn decode(
8758            slot: ::fidl_next::Slot<'_, Self>,
8759            decoder: &mut ___D,
8760            _: (),
8761        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8762            ::fidl_next::munge!(let Self { table } = slot);
8763
8764            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8765                match ordinal {
8766                    0 => unsafe { ::core::hint::unreachable_unchecked() },
8767
8768                    1 => {
8769                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
8770                            slot.as_mut(),
8771                            decoder,
8772                            (),
8773                        )?;
8774
8775                        Ok(())
8776                    }
8777
8778                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
8779                }
8780            })
8781        }
8782    }
8783
8784    impl<'de> AllocatorValidateBufferCollectionTokenRequest<'de> {
8785        pub fn token_server_koid(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
8786            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8787        }
8788
8789        pub fn take_token_server_koid(
8790            &mut self,
8791        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
8792            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
8793        }
8794    }
8795
8796    impl<'de> ::core::fmt::Debug for AllocatorValidateBufferCollectionTokenRequest<'de> {
8797        fn fmt(
8798            &self,
8799            f: &mut ::core::fmt::Formatter<'_>,
8800        ) -> ::core::result::Result<(), ::core::fmt::Error> {
8801            f.debug_struct("AllocatorValidateBufferCollectionTokenRequest")
8802                .field("token_server_koid", &self.token_server_koid())
8803                .finish()
8804        }
8805    }
8806
8807    impl<'de> ::fidl_next::IntoNatural for AllocatorValidateBufferCollectionTokenRequest<'de> {
8808        type Natural = crate::natural::AllocatorValidateBufferCollectionTokenRequest;
8809    }
8810
8811    /// The wire type corresponding to [`AllocatorValidateBufferCollectionTokenResponse`].
8812    #[repr(C)]
8813    pub struct AllocatorValidateBufferCollectionTokenResponse<'de> {
8814        pub(crate) table: ::fidl_next::wire::Table<'de>,
8815    }
8816
8817    impl<'de> Drop for AllocatorValidateBufferCollectionTokenResponse<'de> {
8818        fn drop(&mut self) {
8819            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
8820        }
8821    }
8822
8823    impl ::fidl_next::Constrained for AllocatorValidateBufferCollectionTokenResponse<'_> {
8824        type Constraint = ();
8825
8826        fn validate(
8827            _: ::fidl_next::Slot<'_, Self>,
8828            _: Self::Constraint,
8829        ) -> Result<(), ::fidl_next::ValidationError> {
8830            Ok(())
8831        }
8832    }
8833
8834    unsafe impl ::fidl_next::Wire for AllocatorValidateBufferCollectionTokenResponse<'static> {
8835        type Narrowed<'de> = AllocatorValidateBufferCollectionTokenResponse<'de>;
8836
8837        #[inline]
8838        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8839            ::fidl_next::munge!(let Self { table } = out);
8840            ::fidl_next::wire::Table::zero_padding(table);
8841        }
8842    }
8843
8844    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
8845        for AllocatorValidateBufferCollectionTokenResponse<'de>
8846    where
8847        ___D: ::fidl_next::Decoder<'de> + ?Sized,
8848    {
8849        fn decode(
8850            slot: ::fidl_next::Slot<'_, Self>,
8851            decoder: &mut ___D,
8852            _: (),
8853        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8854            ::fidl_next::munge!(let Self { table } = slot);
8855
8856            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8857                match ordinal {
8858                    0 => unsafe { ::core::hint::unreachable_unchecked() },
8859
8860                    1 => {
8861                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
8862                            slot.as_mut(),
8863                            decoder,
8864                            (),
8865                        )?;
8866
8867                        Ok(())
8868                    }
8869
8870                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
8871                }
8872            })
8873        }
8874    }
8875
8876    impl<'de> AllocatorValidateBufferCollectionTokenResponse<'de> {
8877        pub fn is_known(&self) -> ::core::option::Option<&bool> {
8878            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8879        }
8880
8881        pub fn take_is_known(&mut self) -> ::core::option::Option<bool> {
8882            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
8883        }
8884    }
8885
8886    impl<'de> ::core::fmt::Debug for AllocatorValidateBufferCollectionTokenResponse<'de> {
8887        fn fmt(
8888            &self,
8889            f: &mut ::core::fmt::Formatter<'_>,
8890        ) -> ::core::result::Result<(), ::core::fmt::Error> {
8891            f.debug_struct("AllocatorValidateBufferCollectionTokenResponse")
8892                .field("is_known", &self.is_known())
8893                .finish()
8894        }
8895    }
8896
8897    impl<'de> ::fidl_next::IntoNatural for AllocatorValidateBufferCollectionTokenResponse<'de> {
8898        type Natural = crate::natural::AllocatorValidateBufferCollectionTokenResponse;
8899    }
8900
8901    /// The wire type corresponding to [`AllocatorSetDebugClientInfoRequest`].
8902    #[repr(C)]
8903    pub struct AllocatorSetDebugClientInfoRequest<'de> {
8904        pub(crate) table: ::fidl_next::wire::Table<'de>,
8905    }
8906
8907    impl<'de> Drop for AllocatorSetDebugClientInfoRequest<'de> {
8908        fn drop(&mut self) {
8909            let _ = self.table.get(1).map(|envelope| unsafe {
8910                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8911            });
8912
8913            let _ = self
8914                .table
8915                .get(2)
8916                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
8917        }
8918    }
8919
8920    impl ::fidl_next::Constrained for AllocatorSetDebugClientInfoRequest<'_> {
8921        type Constraint = ();
8922
8923        fn validate(
8924            _: ::fidl_next::Slot<'_, Self>,
8925            _: Self::Constraint,
8926        ) -> Result<(), ::fidl_next::ValidationError> {
8927            Ok(())
8928        }
8929    }
8930
8931    unsafe impl ::fidl_next::Wire for AllocatorSetDebugClientInfoRequest<'static> {
8932        type Narrowed<'de> = AllocatorSetDebugClientInfoRequest<'de>;
8933
8934        #[inline]
8935        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8936            ::fidl_next::munge!(let Self { table } = out);
8937            ::fidl_next::wire::Table::zero_padding(table);
8938        }
8939    }
8940
8941    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for AllocatorSetDebugClientInfoRequest<'de>
8942    where
8943        ___D: ::fidl_next::Decoder<'de> + ?Sized,
8944    {
8945        fn decode(
8946            slot: ::fidl_next::Slot<'_, Self>,
8947            decoder: &mut ___D,
8948            _: (),
8949        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8950            ::fidl_next::munge!(let Self { table } = slot);
8951
8952            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8953                match ordinal {
8954                    0 => unsafe { ::core::hint::unreachable_unchecked() },
8955
8956                    1 => {
8957                        ::fidl_next::wire::Envelope::decode_as::<
8958                            ___D,
8959                            ::fidl_next::wire::String<'de>,
8960                        >(slot.as_mut(), decoder, 256)?;
8961
8962                        let value = unsafe {
8963                            slot.deref_unchecked()
8964                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
8965                        };
8966
8967                        if value.len() > 256 {
8968                            return Err(::fidl_next::DecodeError::VectorTooLong {
8969                                size: value.len() as u64,
8970                                limit: 256,
8971                            });
8972                        }
8973
8974                        Ok(())
8975                    }
8976
8977                    2 => {
8978                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
8979                            slot.as_mut(),
8980                            decoder,
8981                            (),
8982                        )?;
8983
8984                        Ok(())
8985                    }
8986
8987                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
8988                }
8989            })
8990        }
8991    }
8992
8993    impl<'de> AllocatorSetDebugClientInfoRequest<'de> {
8994        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
8995            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8996        }
8997
8998        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
8999            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
9000        }
9001
9002        pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9003            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9004        }
9005
9006        pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9007            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
9008        }
9009    }
9010
9011    impl<'de> ::core::fmt::Debug for AllocatorSetDebugClientInfoRequest<'de> {
9012        fn fmt(
9013            &self,
9014            f: &mut ::core::fmt::Formatter<'_>,
9015        ) -> ::core::result::Result<(), ::core::fmt::Error> {
9016            f.debug_struct("AllocatorSetDebugClientInfoRequest")
9017                .field("name", &self.name())
9018                .field("id", &self.id())
9019                .finish()
9020        }
9021    }
9022
9023    impl<'de> ::fidl_next::IntoNatural for AllocatorSetDebugClientInfoRequest<'de> {
9024        type Natural = crate::natural::AllocatorSetDebugClientInfoRequest;
9025    }
9026
9027    /// The wire type corresponding to [`BufferUsage`].
9028    #[repr(C)]
9029    pub struct BufferUsage<'de> {
9030        pub(crate) table: ::fidl_next::wire::Table<'de>,
9031    }
9032
9033    impl<'de> Drop for BufferUsage<'de> {
9034        fn drop(&mut self) {
9035            let _ = self
9036                .table
9037                .get(1)
9038                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9039
9040            let _ = self
9041                .table
9042                .get(2)
9043                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9044
9045            let _ = self
9046                .table
9047                .get(3)
9048                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9049
9050            let _ = self
9051                .table
9052                .get(4)
9053                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9054
9055            let _ = self
9056                .table
9057                .get(5)
9058                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9059        }
9060    }
9061
9062    impl ::fidl_next::Constrained for BufferUsage<'_> {
9063        type Constraint = ();
9064
9065        fn validate(
9066            _: ::fidl_next::Slot<'_, Self>,
9067            _: Self::Constraint,
9068        ) -> Result<(), ::fidl_next::ValidationError> {
9069            Ok(())
9070        }
9071    }
9072
9073    unsafe impl ::fidl_next::Wire for BufferUsage<'static> {
9074        type Narrowed<'de> = BufferUsage<'de>;
9075
9076        #[inline]
9077        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9078            ::fidl_next::munge!(let Self { table } = out);
9079            ::fidl_next::wire::Table::zero_padding(table);
9080        }
9081    }
9082
9083    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferUsage<'de>
9084    where
9085        ___D: ::fidl_next::Decoder<'de> + ?Sized,
9086    {
9087        fn decode(
9088            slot: ::fidl_next::Slot<'_, Self>,
9089            decoder: &mut ___D,
9090            _: (),
9091        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9092            ::fidl_next::munge!(let Self { table } = slot);
9093
9094            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9095                match ordinal {
9096                    0 => unsafe { ::core::hint::unreachable_unchecked() },
9097
9098                    1 => {
9099                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9100                            slot.as_mut(),
9101                            decoder,
9102                            (),
9103                        )?;
9104
9105                        Ok(())
9106                    }
9107
9108                    2 => {
9109                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9110                            slot.as_mut(),
9111                            decoder,
9112                            (),
9113                        )?;
9114
9115                        Ok(())
9116                    }
9117
9118                    3 => {
9119                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9120                            slot.as_mut(),
9121                            decoder,
9122                            (),
9123                        )?;
9124
9125                        Ok(())
9126                    }
9127
9128                    4 => {
9129                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9130                            slot.as_mut(),
9131                            decoder,
9132                            (),
9133                        )?;
9134
9135                        Ok(())
9136                    }
9137
9138                    5 => {
9139                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9140                            slot.as_mut(),
9141                            decoder,
9142                            (),
9143                        )?;
9144
9145                        Ok(())
9146                    }
9147
9148                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9149                }
9150            })
9151        }
9152    }
9153
9154    impl<'de> BufferUsage<'de> {
9155        pub fn none(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9156            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9157        }
9158
9159        pub fn take_none(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9160            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
9161        }
9162
9163        pub fn cpu(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9164            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9165        }
9166
9167        pub fn take_cpu(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9168            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
9169        }
9170
9171        pub fn vulkan(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9172            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9173        }
9174
9175        pub fn take_vulkan(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9176            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
9177        }
9178
9179        pub fn display(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9180            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9181        }
9182
9183        pub fn take_display(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9184            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
9185        }
9186
9187        pub fn video(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9188            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9189        }
9190
9191        pub fn take_video(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9192            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
9193        }
9194    }
9195
9196    impl<'de> ::core::fmt::Debug for BufferUsage<'de> {
9197        fn fmt(
9198            &self,
9199            f: &mut ::core::fmt::Formatter<'_>,
9200        ) -> ::core::result::Result<(), ::core::fmt::Error> {
9201            f.debug_struct("BufferUsage")
9202                .field("none", &self.none())
9203                .field("cpu", &self.cpu())
9204                .field("vulkan", &self.vulkan())
9205                .field("display", &self.display())
9206                .field("video", &self.video())
9207                .finish()
9208        }
9209    }
9210
9211    impl<'de> ::fidl_next::IntoNatural for BufferUsage<'de> {
9212        type Natural = crate::natural::BufferUsage;
9213    }
9214
9215    /// The wire type corresponding to [`Heap`].
9216    #[repr(C)]
9217    pub struct Heap<'de> {
9218        pub(crate) table: ::fidl_next::wire::Table<'de>,
9219    }
9220
9221    impl<'de> Drop for Heap<'de> {
9222        fn drop(&mut self) {
9223            let _ = self.table.get(1).map(|envelope| unsafe {
9224                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9225            });
9226
9227            let _ = self
9228                .table
9229                .get(2)
9230                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9231        }
9232    }
9233
9234    impl ::fidl_next::Constrained for Heap<'_> {
9235        type Constraint = ();
9236
9237        fn validate(
9238            _: ::fidl_next::Slot<'_, Self>,
9239            _: Self::Constraint,
9240        ) -> Result<(), ::fidl_next::ValidationError> {
9241            Ok(())
9242        }
9243    }
9244
9245    unsafe impl ::fidl_next::Wire for Heap<'static> {
9246        type Narrowed<'de> = Heap<'de>;
9247
9248        #[inline]
9249        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9250            ::fidl_next::munge!(let Self { table } = out);
9251            ::fidl_next::wire::Table::zero_padding(table);
9252        }
9253    }
9254
9255    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Heap<'de>
9256    where
9257        ___D: ::fidl_next::Decoder<'de> + ?Sized,
9258    {
9259        fn decode(
9260            slot: ::fidl_next::Slot<'_, Self>,
9261            decoder: &mut ___D,
9262            _: (),
9263        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9264            ::fidl_next::munge!(let Self { table } = slot);
9265
9266            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9267                match ordinal {
9268                    0 => unsafe { ::core::hint::unreachable_unchecked() },
9269
9270                    1 => {
9271                        ::fidl_next::wire::Envelope::decode_as::<
9272                            ___D,
9273                            ::fidl_next::wire::String<'de>,
9274                        >(slot.as_mut(), decoder, 128)?;
9275
9276                        let value = unsafe {
9277                            slot.deref_unchecked()
9278                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
9279                        };
9280
9281                        if value.len() > 128 {
9282                            return Err(::fidl_next::DecodeError::VectorTooLong {
9283                                size: value.len() as u64,
9284                                limit: 128,
9285                            });
9286                        }
9287
9288                        Ok(())
9289                    }
9290
9291                    2 => {
9292                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9293                            slot.as_mut(),
9294                            decoder,
9295                            (),
9296                        )?;
9297
9298                        Ok(())
9299                    }
9300
9301                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9302                }
9303            })
9304        }
9305    }
9306
9307    impl<'de> Heap<'de> {
9308        pub fn heap_type(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
9309            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9310        }
9311
9312        pub fn take_heap_type(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
9313            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
9314        }
9315
9316        pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9317            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9318        }
9319
9320        pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9321            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
9322        }
9323    }
9324
9325    impl<'de> ::core::fmt::Debug for Heap<'de> {
9326        fn fmt(
9327            &self,
9328            f: &mut ::core::fmt::Formatter<'_>,
9329        ) -> ::core::result::Result<(), ::core::fmt::Error> {
9330            f.debug_struct("Heap")
9331                .field("heap_type", &self.heap_type())
9332                .field("id", &self.id())
9333                .finish()
9334        }
9335    }
9336
9337    impl<'de> ::fidl_next::IntoNatural for Heap<'de> {
9338        type Natural = crate::natural::Heap;
9339    }
9340
9341    /// The wire type corresponding to [`BufferMemoryConstraints`].
9342    #[repr(C)]
9343    pub struct BufferMemoryConstraints<'de> {
9344        pub(crate) table: ::fidl_next::wire::Table<'de>,
9345    }
9346
9347    impl<'de> Drop for BufferMemoryConstraints<'de> {
9348        fn drop(&mut self) {
9349            let _ = self
9350                .table
9351                .get(1)
9352                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9353
9354            let _ = self
9355                .table
9356                .get(2)
9357                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9358
9359            let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9360
9361            let _ = self.table.get(4).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9362
9363            let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9364
9365            let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9366
9367            let _ = self.table.get(7).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9368
9369            let _ = self.table.get(8).map(|envelope| unsafe {
9370                envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>()
9371            });
9372
9373            let _ = self
9374                .table
9375                .get(9)
9376                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9377        }
9378    }
9379
9380    impl ::fidl_next::Constrained for BufferMemoryConstraints<'_> {
9381        type Constraint = ();
9382
9383        fn validate(
9384            _: ::fidl_next::Slot<'_, Self>,
9385            _: Self::Constraint,
9386        ) -> Result<(), ::fidl_next::ValidationError> {
9387            Ok(())
9388        }
9389    }
9390
9391    unsafe impl ::fidl_next::Wire for BufferMemoryConstraints<'static> {
9392        type Narrowed<'de> = BufferMemoryConstraints<'de>;
9393
9394        #[inline]
9395        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9396            ::fidl_next::munge!(let Self { table } = out);
9397            ::fidl_next::wire::Table::zero_padding(table);
9398        }
9399    }
9400
9401    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferMemoryConstraints<'de>
9402    where
9403        ___D: ::fidl_next::Decoder<'de> + ?Sized,
9404    {
9405        fn decode(
9406            slot: ::fidl_next::Slot<'_, Self>,
9407            decoder: &mut ___D,
9408            _: (),
9409        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9410            ::fidl_next::munge!(let Self { table } = slot);
9411
9412            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9413                match ordinal {
9414                    0 => unsafe { ::core::hint::unreachable_unchecked() },
9415
9416                    1 => {
9417                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9418                            slot.as_mut(),
9419                            decoder,
9420                            (),
9421                        )?;
9422
9423                        Ok(())
9424                    }
9425
9426                    2 => {
9427                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9428                            slot.as_mut(),
9429                            decoder,
9430                            (),
9431                        )?;
9432
9433                        Ok(())
9434                    }
9435
9436                    3 => {
9437                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9438                            slot.as_mut(),
9439                            decoder,
9440                            (),
9441                        )?;
9442
9443                        Ok(())
9444                    }
9445
9446                    4 => {
9447                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9448                            slot.as_mut(),
9449                            decoder,
9450                            (),
9451                        )?;
9452
9453                        Ok(())
9454                    }
9455
9456                    5 => {
9457                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9458                            slot.as_mut(),
9459                            decoder,
9460                            (),
9461                        )?;
9462
9463                        Ok(())
9464                    }
9465
9466                    6 => {
9467                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9468                            slot.as_mut(),
9469                            decoder,
9470                            (),
9471                        )?;
9472
9473                        Ok(())
9474                    }
9475
9476                    7 => {
9477                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9478                            slot.as_mut(),
9479                            decoder,
9480                            (),
9481                        )?;
9482
9483                        Ok(())
9484                    }
9485
9486                    8 => {
9487                        ::fidl_next::wire::Envelope::decode_as::<
9488                            ___D,
9489                            ::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>,
9490                        >(slot.as_mut(), decoder, (64, ()))?;
9491
9492                        let value = unsafe {
9493                            slot
9494                                            .deref_unchecked()
9495                                            .deref_unchecked::<
9496                                                ::fidl_next::wire::Vector<'_, crate::wire::Heap<'_>>
9497                                            >()
9498                        };
9499
9500                        if value.len() > 64 {
9501                            return Err(::fidl_next::DecodeError::VectorTooLong {
9502                                size: value.len() as u64,
9503                                limit: 64,
9504                            });
9505                        }
9506
9507                        Ok(())
9508                    }
9509
9510                    9 => {
9511                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9512                            slot.as_mut(),
9513                            decoder,
9514                            (),
9515                        )?;
9516
9517                        Ok(())
9518                    }
9519
9520                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9521                }
9522            })
9523        }
9524    }
9525
9526    impl<'de> BufferMemoryConstraints<'de> {
9527        pub fn min_size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9528            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9529        }
9530
9531        pub fn take_min_size_bytes(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9532            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
9533        }
9534
9535        pub fn max_size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9536            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9537        }
9538
9539        pub fn take_max_size_bytes(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9540            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
9541        }
9542
9543        pub fn physically_contiguous_required(&self) -> ::core::option::Option<&bool> {
9544            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9545        }
9546
9547        pub fn take_physically_contiguous_required(&mut self) -> ::core::option::Option<bool> {
9548            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
9549        }
9550
9551        pub fn secure_required(&self) -> ::core::option::Option<&bool> {
9552            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9553        }
9554
9555        pub fn take_secure_required(&mut self) -> ::core::option::Option<bool> {
9556            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
9557        }
9558
9559        pub fn cpu_domain_supported(&self) -> ::core::option::Option<&bool> {
9560            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9561        }
9562
9563        pub fn take_cpu_domain_supported(&mut self) -> ::core::option::Option<bool> {
9564            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
9565        }
9566
9567        pub fn ram_domain_supported(&self) -> ::core::option::Option<&bool> {
9568            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9569        }
9570
9571        pub fn take_ram_domain_supported(&mut self) -> ::core::option::Option<bool> {
9572            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
9573        }
9574
9575        pub fn inaccessible_domain_supported(&self) -> ::core::option::Option<&bool> {
9576            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
9577        }
9578
9579        pub fn take_inaccessible_domain_supported(&mut self) -> ::core::option::Option<bool> {
9580            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
9581        }
9582
9583        pub fn permitted_heaps(
9584            &self,
9585        ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>
9586        {
9587            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
9588        }
9589
9590        pub fn take_permitted_heaps(
9591            &mut self,
9592        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>
9593        {
9594            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
9595        }
9596
9597        pub fn min_physical_base_alignment(
9598            &self,
9599        ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9600            unsafe { Some(self.table.get(9)?.deref_unchecked()) }
9601        }
9602
9603        pub fn take_min_physical_base_alignment(
9604            &mut self,
9605        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9606            unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
9607        }
9608    }
9609
9610    impl<'de> ::core::fmt::Debug for BufferMemoryConstraints<'de> {
9611        fn fmt(
9612            &self,
9613            f: &mut ::core::fmt::Formatter<'_>,
9614        ) -> ::core::result::Result<(), ::core::fmt::Error> {
9615            f.debug_struct("BufferMemoryConstraints")
9616                .field("min_size_bytes", &self.min_size_bytes())
9617                .field("max_size_bytes", &self.max_size_bytes())
9618                .field("physically_contiguous_required", &self.physically_contiguous_required())
9619                .field("secure_required", &self.secure_required())
9620                .field("cpu_domain_supported", &self.cpu_domain_supported())
9621                .field("ram_domain_supported", &self.ram_domain_supported())
9622                .field("inaccessible_domain_supported", &self.inaccessible_domain_supported())
9623                .field("permitted_heaps", &self.permitted_heaps())
9624                .field("min_physical_base_alignment", &self.min_physical_base_alignment())
9625                .finish()
9626        }
9627    }
9628
9629    impl<'de> ::fidl_next::IntoNatural for BufferMemoryConstraints<'de> {
9630        type Natural = crate::natural::BufferMemoryConstraints;
9631    }
9632
9633    /// The wire type corresponding to [`PixelFormatAndModifier`].
9634    #[derive(Clone, Debug)]
9635    #[repr(C)]
9636    pub struct PixelFormatAndModifier {
9637        pub pixel_format: ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
9638
9639        pub pixel_format_modifier: ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
9640    }
9641
9642    static_assertions::const_assert_eq!(std::mem::size_of::<PixelFormatAndModifier>(), 16);
9643    static_assertions::const_assert_eq!(std::mem::align_of::<PixelFormatAndModifier>(), 8);
9644
9645    static_assertions::const_assert_eq!(
9646        std::mem::offset_of!(PixelFormatAndModifier, pixel_format),
9647        0
9648    );
9649
9650    static_assertions::const_assert_eq!(
9651        std::mem::offset_of!(PixelFormatAndModifier, pixel_format_modifier),
9652        8
9653    );
9654
9655    impl ::fidl_next::Constrained for PixelFormatAndModifier {
9656        type Constraint = ();
9657
9658        fn validate(
9659            _: ::fidl_next::Slot<'_, Self>,
9660            _: Self::Constraint,
9661        ) -> Result<(), ::fidl_next::ValidationError> {
9662            Ok(())
9663        }
9664    }
9665
9666    unsafe impl ::fidl_next::Wire for PixelFormatAndModifier {
9667        type Narrowed<'de> = PixelFormatAndModifier;
9668
9669        #[inline]
9670        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
9671            ::fidl_next::munge! {
9672                let Self {
9673                    pixel_format,
9674                    pixel_format_modifier,
9675
9676                } = &mut *out_;
9677            }
9678
9679            ::fidl_next::Wire::zero_padding(pixel_format);
9680
9681            ::fidl_next::Wire::zero_padding(pixel_format_modifier);
9682
9683            unsafe {
9684                out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
9685            }
9686        }
9687    }
9688
9689    unsafe impl<___D> ::fidl_next::Decode<___D> for PixelFormatAndModifier
9690    where
9691        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9692    {
9693        fn decode(
9694            slot_: ::fidl_next::Slot<'_, Self>,
9695            decoder_: &mut ___D,
9696            _: (),
9697        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9698            if slot_.as_bytes()[4..8] != [0u8; 4] {
9699                return Err(::fidl_next::DecodeError::InvalidPadding);
9700            }
9701
9702            ::fidl_next::munge! {
9703                let Self {
9704                    mut pixel_format,
9705                    mut pixel_format_modifier,
9706
9707                } = slot_;
9708            }
9709
9710            let _field = pixel_format.as_mut();
9711
9712            ::fidl_next::Decode::decode(pixel_format.as_mut(), decoder_, ())?;
9713
9714            let _field = pixel_format_modifier.as_mut();
9715
9716            ::fidl_next::Decode::decode(pixel_format_modifier.as_mut(), decoder_, ())?;
9717
9718            Ok(())
9719        }
9720    }
9721
9722    impl ::fidl_next::IntoNatural for PixelFormatAndModifier {
9723        type Natural = crate::natural::PixelFormatAndModifier;
9724    }
9725
9726    /// The wire type corresponding to [`ImageFormatConstraints`].
9727    #[repr(C)]
9728    pub struct ImageFormatConstraints<'de> {
9729        pub(crate) table: ::fidl_next::wire::Table<'de>,
9730    }
9731
9732    impl<'de> Drop for ImageFormatConstraints<'de> {
9733        fn drop(&mut self) {
9734            let _ = self.table.get(1).map(|envelope| unsafe {
9735                envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>()
9736            });
9737
9738            let _ = self.table.get(2)
9739                .map(|envelope| unsafe {
9740                    envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>()
9741                });
9742
9743            let _ = self.table.get(3).map(|envelope| unsafe {
9744                envelope.read_unchecked::<::fidl_next::wire::Vector<
9745                    'de,
9746                    ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
9747                >>()
9748            });
9749
9750            let _ = self.table.get(4).map(|envelope| unsafe {
9751                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9752            });
9753
9754            let _ = self.table.get(5).map(|envelope| unsafe {
9755                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9756            });
9757
9758            let _ = self
9759                .table
9760                .get(6)
9761                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9762
9763            let _ = self
9764                .table
9765                .get(7)
9766                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9767
9768            let _ = self
9769                .table
9770                .get(8)
9771                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9772
9773            let _ = self.table.get(9).map(|envelope| unsafe {
9774                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9775            });
9776
9777            let _ = self.table.get(10).map(|envelope| unsafe {
9778                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9779            });
9780
9781            let _ = self.table.get(11).map(|envelope| unsafe {
9782                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9783            });
9784
9785            let _ = self.table.get(12).map(|envelope| unsafe {
9786                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9787            });
9788
9789            let _ = self
9790                .table
9791                .get(13)
9792                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9793
9794            let _ = self
9795                .table
9796                .get(14)
9797                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9798
9799            let _ = self.table.get(15)
9800                .map(|envelope| unsafe {
9801                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>>()
9802                });
9803
9804            let _ = self.table.get(16).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9805
9806            let _ = self.table.get(17).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9807
9808            let _ = self.table.get(18)
9809                .map(|envelope| unsafe {
9810                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>>()
9811                });
9812
9813            let _ = self.table.get(19).map(|envelope| unsafe {
9814                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9815            });
9816
9817            let _ = self
9818                .table
9819                .get(20)
9820                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9821        }
9822    }
9823
9824    impl ::fidl_next::Constrained for ImageFormatConstraints<'_> {
9825        type Constraint = ();
9826
9827        fn validate(
9828            _: ::fidl_next::Slot<'_, Self>,
9829            _: Self::Constraint,
9830        ) -> Result<(), ::fidl_next::ValidationError> {
9831            Ok(())
9832        }
9833    }
9834
9835    unsafe impl ::fidl_next::Wire for ImageFormatConstraints<'static> {
9836        type Narrowed<'de> = ImageFormatConstraints<'de>;
9837
9838        #[inline]
9839        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9840            ::fidl_next::munge!(let Self { table } = out);
9841            ::fidl_next::wire::Table::zero_padding(table);
9842        }
9843    }
9844
9845    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ImageFormatConstraints<'de>
9846    where
9847        ___D: ::fidl_next::Decoder<'de> + ?Sized,
9848    {
9849        fn decode(
9850            slot: ::fidl_next::Slot<'_, Self>,
9851            decoder: &mut ___D,
9852            _: (),
9853        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9854            ::fidl_next::munge!(let Self { table } = slot);
9855
9856            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9857                match ordinal {
9858                    0 => unsafe { ::core::hint::unreachable_unchecked() },
9859
9860                    1 => {
9861                        ::fidl_next::wire::Envelope::decode_as::<
9862                            ___D,
9863                            ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
9864                        >(slot.as_mut(), decoder, ())?;
9865
9866                        Ok(())
9867                    }
9868
9869                    2 => {
9870                        ::fidl_next::wire::Envelope::decode_as::<
9871                            ___D,
9872                            ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
9873                        >(slot.as_mut(), decoder, ())?;
9874
9875                        Ok(())
9876                    }
9877
9878                    3 => {
9879                        ::fidl_next::wire::Envelope::decode_as::<
9880                            ___D,
9881                            ::fidl_next::wire::Vector<
9882                                'de,
9883                                ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
9884                            >,
9885                        >(slot.as_mut(), decoder, (32, ()))?;
9886
9887                        let value = unsafe {
9888                            slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
9889                                '_,
9890                                ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
9891                            >>()
9892                        };
9893
9894                        if value.len() > 32 {
9895                            return Err(::fidl_next::DecodeError::VectorTooLong {
9896                                size: value.len() as u64,
9897                                limit: 32,
9898                            });
9899                        }
9900
9901                        Ok(())
9902                    }
9903
9904                    4 => {
9905                        ::fidl_next::wire::Envelope::decode_as::<
9906                            ___D,
9907                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9908                        >(slot.as_mut(), decoder, ())?;
9909
9910                        Ok(())
9911                    }
9912
9913                    5 => {
9914                        ::fidl_next::wire::Envelope::decode_as::<
9915                            ___D,
9916                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9917                        >(slot.as_mut(), decoder, ())?;
9918
9919                        Ok(())
9920                    }
9921
9922                    6 => {
9923                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9924                            slot.as_mut(),
9925                            decoder,
9926                            (),
9927                        )?;
9928
9929                        Ok(())
9930                    }
9931
9932                    7 => {
9933                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9934                            slot.as_mut(),
9935                            decoder,
9936                            (),
9937                        )?;
9938
9939                        Ok(())
9940                    }
9941
9942                    8 => {
9943                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9944                            slot.as_mut(),
9945                            decoder,
9946                            (),
9947                        )?;
9948
9949                        Ok(())
9950                    }
9951
9952                    9 => {
9953                        ::fidl_next::wire::Envelope::decode_as::<
9954                            ___D,
9955                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9956                        >(slot.as_mut(), decoder, ())?;
9957
9958                        Ok(())
9959                    }
9960
9961                    10 => {
9962                        ::fidl_next::wire::Envelope::decode_as::<
9963                            ___D,
9964                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9965                        >(slot.as_mut(), decoder, ())?;
9966
9967                        Ok(())
9968                    }
9969
9970                    11 => {
9971                        ::fidl_next::wire::Envelope::decode_as::<
9972                            ___D,
9973                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9974                        >(slot.as_mut(), decoder, ())?;
9975
9976                        Ok(())
9977                    }
9978
9979                    12 => {
9980                        ::fidl_next::wire::Envelope::decode_as::<
9981                            ___D,
9982                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9983                        >(slot.as_mut(), decoder, ())?;
9984
9985                        Ok(())
9986                    }
9987
9988                    13 => {
9989                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9990                            slot.as_mut(),
9991                            decoder,
9992                            (),
9993                        )?;
9994
9995                        Ok(())
9996                    }
9997
9998                    14 => {
9999                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10000                            slot.as_mut(),
10001                            decoder,
10002                            (),
10003                        )?;
10004
10005                        Ok(())
10006                    }
10007
10008                    15 => {
10009                        ::fidl_next::wire::Envelope::decode_as::<
10010                            ___D,
10011                            ::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>,
10012                        >(slot.as_mut(), decoder, (64, ()))?;
10013
10014                        let value = unsafe {
10015                            slot
10016                                            .deref_unchecked()
10017                                            .deref_unchecked::<
10018                                                ::fidl_next::wire::Vector<'_, crate::wire::PixelFormatAndModifier>
10019                                            >()
10020                        };
10021
10022                        if value.len() > 64 {
10023                            return Err(::fidl_next::DecodeError::VectorTooLong {
10024                                size: value.len() as u64,
10025                                limit: 64,
10026                            });
10027                        }
10028
10029                        Ok(())
10030                    }
10031
10032                    16 => {
10033                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10034                            slot.as_mut(),
10035                            decoder,
10036                            (),
10037                        )?;
10038
10039                        Ok(())
10040                    }
10041
10042                    17 => {
10043                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10044                            slot.as_mut(),
10045                            decoder,
10046                            (),
10047                        )?;
10048
10049                        Ok(())
10050                    }
10051
10052                    18 => {
10053                        ::fidl_next::wire::Envelope::decode_as::<
10054                            ___D,
10055                            ::fidl_next::wire::Vector<
10056                                'de,
10057                                ::fidl_next_common_fuchsia_math::wire::SizeU,
10058                            >,
10059                        >(slot.as_mut(), decoder, (64, ()))?;
10060
10061                        let value = unsafe {
10062                            slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
10063                                '_,
10064                                ::fidl_next_common_fuchsia_math::wire::SizeU,
10065                            >>()
10066                        };
10067
10068                        if value.len() > 64 {
10069                            return Err(::fidl_next::DecodeError::VectorTooLong {
10070                                size: value.len() as u64,
10071                                limit: 64,
10072                            });
10073                        }
10074
10075                        Ok(())
10076                    }
10077
10078                    19 => {
10079                        ::fidl_next::wire::Envelope::decode_as::<
10080                            ___D,
10081                            ::fidl_next_common_fuchsia_math::wire::SizeU,
10082                        >(slot.as_mut(), decoder, ())?;
10083
10084                        Ok(())
10085                    }
10086
10087                    20 => {
10088                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
10089                            slot.as_mut(),
10090                            decoder,
10091                            (),
10092                        )?;
10093
10094                        Ok(())
10095                    }
10096
10097                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10098                }
10099            })
10100        }
10101    }
10102
10103    impl<'de> ImageFormatConstraints<'de> {
10104        pub fn pixel_format(
10105            &self,
10106        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormat>
10107        {
10108            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10109        }
10110
10111        pub fn take_pixel_format(
10112            &mut self,
10113        ) -> ::core::option::Option<::fidl_next_common_fuchsia_images2::wire::PixelFormat> {
10114            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
10115        }
10116
10117        pub fn pixel_format_modifier(
10118            &self,
10119        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
10120        {
10121            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10122        }
10123
10124        pub fn take_pixel_format_modifier(
10125            &mut self,
10126        ) -> ::core::option::Option<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
10127        {
10128            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
10129        }
10130
10131        pub fn color_spaces(
10132            &self,
10133        ) -> ::core::option::Option<
10134            &::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>,
10135        > {
10136            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10137        }
10138
10139        pub fn take_color_spaces(
10140            &mut self,
10141        ) -> ::core::option::Option<
10142            ::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>,
10143        > {
10144            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
10145        }
10146
10147        pub fn min_size(
10148            &self,
10149        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10150            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10151        }
10152
10153        pub fn take_min_size(
10154            &mut self,
10155        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10156            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
10157        }
10158
10159        pub fn max_size(
10160            &self,
10161        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10162            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10163        }
10164
10165        pub fn take_max_size(
10166            &mut self,
10167        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10168            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
10169        }
10170
10171        pub fn min_bytes_per_row(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10172            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10173        }
10174
10175        pub fn take_min_bytes_per_row(
10176            &mut self,
10177        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10178            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
10179        }
10180
10181        pub fn max_bytes_per_row(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10182            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10183        }
10184
10185        pub fn take_max_bytes_per_row(
10186            &mut self,
10187        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10188            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
10189        }
10190
10191        pub fn max_width_times_height(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10192            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10193        }
10194
10195        pub fn take_max_width_times_height(
10196            &mut self,
10197        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
10198            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
10199        }
10200
10201        pub fn size_alignment(
10202            &self,
10203        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10204            unsafe { Some(self.table.get(9)?.deref_unchecked()) }
10205        }
10206
10207        pub fn take_size_alignment(
10208            &mut self,
10209        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10210            unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
10211        }
10212
10213        pub fn display_rect_alignment(
10214            &self,
10215        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10216            unsafe { Some(self.table.get(10)?.deref_unchecked()) }
10217        }
10218
10219        pub fn take_display_rect_alignment(
10220            &mut self,
10221        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10222            unsafe { Some(self.table.get_mut(10)?.take_unchecked()) }
10223        }
10224
10225        pub fn required_min_size(
10226            &self,
10227        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10228            unsafe { Some(self.table.get(11)?.deref_unchecked()) }
10229        }
10230
10231        pub fn take_required_min_size(
10232            &mut self,
10233        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10234            unsafe { Some(self.table.get_mut(11)?.take_unchecked()) }
10235        }
10236
10237        pub fn required_max_size(
10238            &self,
10239        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10240            unsafe { Some(self.table.get(12)?.deref_unchecked()) }
10241        }
10242
10243        pub fn take_required_max_size(
10244            &mut self,
10245        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10246            unsafe { Some(self.table.get_mut(12)?.take_unchecked()) }
10247        }
10248
10249        pub fn bytes_per_row_divisor(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10250            unsafe { Some(self.table.get(13)?.deref_unchecked()) }
10251        }
10252
10253        pub fn take_bytes_per_row_divisor(
10254            &mut self,
10255        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10256            unsafe { Some(self.table.get_mut(13)?.take_unchecked()) }
10257        }
10258
10259        pub fn start_offset_divisor(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10260            unsafe { Some(self.table.get(14)?.deref_unchecked()) }
10261        }
10262
10263        pub fn take_start_offset_divisor(
10264            &mut self,
10265        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10266            unsafe { Some(self.table.get_mut(14)?.take_unchecked()) }
10267        }
10268
10269        pub fn pixel_format_and_modifiers(
10270            &self,
10271        ) -> ::core::option::Option<
10272            &::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>,
10273        > {
10274            unsafe { Some(self.table.get(15)?.deref_unchecked()) }
10275        }
10276
10277        pub fn take_pixel_format_and_modifiers(
10278            &mut self,
10279        ) -> ::core::option::Option<
10280            ::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>,
10281        > {
10282            unsafe { Some(self.table.get_mut(15)?.take_unchecked()) }
10283        }
10284
10285        pub fn require_bytes_per_row_at_pixel_boundary(&self) -> ::core::option::Option<&bool> {
10286            unsafe { Some(self.table.get(16)?.deref_unchecked()) }
10287        }
10288
10289        pub fn take_require_bytes_per_row_at_pixel_boundary(
10290            &mut self,
10291        ) -> ::core::option::Option<bool> {
10292            unsafe { Some(self.table.get_mut(16)?.take_unchecked()) }
10293        }
10294
10295        pub fn is_alpha_present(&self) -> ::core::option::Option<&bool> {
10296            unsafe { Some(self.table.get(17)?.deref_unchecked()) }
10297        }
10298
10299        pub fn take_is_alpha_present(&mut self) -> ::core::option::Option<bool> {
10300            unsafe { Some(self.table.get_mut(17)?.take_unchecked()) }
10301        }
10302
10303        pub fn required_max_size_list(
10304            &self,
10305        ) -> ::core::option::Option<
10306            &::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>,
10307        > {
10308            unsafe { Some(self.table.get(18)?.deref_unchecked()) }
10309        }
10310
10311        pub fn take_required_max_size_list(
10312            &mut self,
10313        ) -> ::core::option::Option<
10314            ::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>,
10315        > {
10316            unsafe { Some(self.table.get_mut(18)?.take_unchecked()) }
10317        }
10318
10319        pub fn pad_for_block_size(
10320            &self,
10321        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10322            unsafe { Some(self.table.get(19)?.deref_unchecked()) }
10323        }
10324
10325        pub fn take_pad_for_block_size(
10326            &mut self,
10327        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10328            unsafe { Some(self.table.get_mut(19)?.take_unchecked()) }
10329        }
10330
10331        pub fn pad_beyond_image_size_bytes(
10332            &self,
10333        ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10334            unsafe { Some(self.table.get(20)?.deref_unchecked()) }
10335        }
10336
10337        pub fn take_pad_beyond_image_size_bytes(
10338            &mut self,
10339        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
10340            unsafe { Some(self.table.get_mut(20)?.take_unchecked()) }
10341        }
10342    }
10343
10344    impl<'de> ::core::fmt::Debug for ImageFormatConstraints<'de> {
10345        fn fmt(
10346            &self,
10347            f: &mut ::core::fmt::Formatter<'_>,
10348        ) -> ::core::result::Result<(), ::core::fmt::Error> {
10349            f.debug_struct("ImageFormatConstraints")
10350                .field("pixel_format", &self.pixel_format())
10351                .field("pixel_format_modifier", &self.pixel_format_modifier())
10352                .field("color_spaces", &self.color_spaces())
10353                .field("min_size", &self.min_size())
10354                .field("max_size", &self.max_size())
10355                .field("min_bytes_per_row", &self.min_bytes_per_row())
10356                .field("max_bytes_per_row", &self.max_bytes_per_row())
10357                .field("max_width_times_height", &self.max_width_times_height())
10358                .field("size_alignment", &self.size_alignment())
10359                .field("display_rect_alignment", &self.display_rect_alignment())
10360                .field("required_min_size", &self.required_min_size())
10361                .field("required_max_size", &self.required_max_size())
10362                .field("bytes_per_row_divisor", &self.bytes_per_row_divisor())
10363                .field("start_offset_divisor", &self.start_offset_divisor())
10364                .field("pixel_format_and_modifiers", &self.pixel_format_and_modifiers())
10365                .field(
10366                    "require_bytes_per_row_at_pixel_boundary",
10367                    &self.require_bytes_per_row_at_pixel_boundary(),
10368                )
10369                .field("is_alpha_present", &self.is_alpha_present())
10370                .field("required_max_size_list", &self.required_max_size_list())
10371                .field("pad_for_block_size", &self.pad_for_block_size())
10372                .field("pad_beyond_image_size_bytes", &self.pad_beyond_image_size_bytes())
10373                .finish()
10374        }
10375    }
10376
10377    impl<'de> ::fidl_next::IntoNatural for ImageFormatConstraints<'de> {
10378        type Natural = crate::natural::ImageFormatConstraints;
10379    }
10380
10381    /// The wire type corresponding to [`BufferCollectionConstraints`].
10382    #[repr(C)]
10383    pub struct BufferCollectionConstraints<'de> {
10384        pub(crate) table: ::fidl_next::wire::Table<'de>,
10385    }
10386
10387    impl<'de> Drop for BufferCollectionConstraints<'de> {
10388        fn drop(&mut self) {
10389            let _ = self.table.get(1).map(|envelope| unsafe {
10390                envelope.read_unchecked::<crate::wire::BufferUsage<'de>>()
10391            });
10392
10393            let _ = self
10394                .table
10395                .get(2)
10396                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10397
10398            let _ = self
10399                .table
10400                .get(3)
10401                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10402
10403            let _ = self
10404                .table
10405                .get(4)
10406                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10407
10408            let _ = self
10409                .table
10410                .get(5)
10411                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10412
10413            let _ = self
10414                .table
10415                .get(6)
10416                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10417
10418            let _ = self.table.get(7).map(|envelope| unsafe {
10419                envelope.read_unchecked::<crate::wire::BufferMemoryConstraints<'de>>()
10420            });
10421
10422            let _ = self.table.get(8)
10423                .map(|envelope| unsafe {
10424                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ImageFormatConstraints<'de>>>()
10425                });
10426        }
10427    }
10428
10429    impl ::fidl_next::Constrained for BufferCollectionConstraints<'_> {
10430        type Constraint = ();
10431
10432        fn validate(
10433            _: ::fidl_next::Slot<'_, Self>,
10434            _: Self::Constraint,
10435        ) -> Result<(), ::fidl_next::ValidationError> {
10436            Ok(())
10437        }
10438    }
10439
10440    unsafe impl ::fidl_next::Wire for BufferCollectionConstraints<'static> {
10441        type Narrowed<'de> = BufferCollectionConstraints<'de>;
10442
10443        #[inline]
10444        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10445            ::fidl_next::munge!(let Self { table } = out);
10446            ::fidl_next::wire::Table::zero_padding(table);
10447        }
10448    }
10449
10450    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferCollectionConstraints<'de>
10451    where
10452        ___D: ::fidl_next::Decoder<'de> + ?Sized,
10453    {
10454        fn decode(
10455            slot: ::fidl_next::Slot<'_, Self>,
10456            decoder: &mut ___D,
10457            _: (),
10458        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10459            ::fidl_next::munge!(let Self { table } = slot);
10460
10461            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10462                match ordinal {
10463                    0 => unsafe { ::core::hint::unreachable_unchecked() },
10464
10465                    1 => {
10466                        ::fidl_next::wire::Envelope::decode_as::<
10467                            ___D,
10468                            crate::wire::BufferUsage<'de>,
10469                        >(slot.as_mut(), decoder, ())?;
10470
10471                        Ok(())
10472                    }
10473
10474                    2 => {
10475                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10476                            slot.as_mut(),
10477                            decoder,
10478                            (),
10479                        )?;
10480
10481                        Ok(())
10482                    }
10483
10484                    3 => {
10485                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10486                            slot.as_mut(),
10487                            decoder,
10488                            (),
10489                        )?;
10490
10491                        Ok(())
10492                    }
10493
10494                    4 => {
10495                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10496                            slot.as_mut(),
10497                            decoder,
10498                            (),
10499                        )?;
10500
10501                        Ok(())
10502                    }
10503
10504                    5 => {
10505                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10506                            slot.as_mut(),
10507                            decoder,
10508                            (),
10509                        )?;
10510
10511                        Ok(())
10512                    }
10513
10514                    6 => {
10515                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10516                            slot.as_mut(),
10517                            decoder,
10518                            (),
10519                        )?;
10520
10521                        Ok(())
10522                    }
10523
10524                    7 => {
10525                        ::fidl_next::wire::Envelope::decode_as::<
10526                            ___D,
10527                            crate::wire::BufferMemoryConstraints<'de>,
10528                        >(slot.as_mut(), decoder, ())?;
10529
10530                        Ok(())
10531                    }
10532
10533                    8 => {
10534                        ::fidl_next::wire::Envelope::decode_as::<
10535                            ___D,
10536                            ::fidl_next::wire::Vector<
10537                                'de,
10538                                crate::wire::ImageFormatConstraints<'de>,
10539                            >,
10540                        >(slot.as_mut(), decoder, (64, ()))?;
10541
10542                        let value = unsafe {
10543                            slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
10544                                '_,
10545                                crate::wire::ImageFormatConstraints<'_>,
10546                            >>()
10547                        };
10548
10549                        if value.len() > 64 {
10550                            return Err(::fidl_next::DecodeError::VectorTooLong {
10551                                size: value.len() as u64,
10552                                limit: 64,
10553                            });
10554                        }
10555
10556                        Ok(())
10557                    }
10558
10559                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10560                }
10561            })
10562        }
10563    }
10564
10565    impl<'de> BufferCollectionConstraints<'de> {
10566        pub fn usage(&self) -> ::core::option::Option<&crate::wire::BufferUsage<'de>> {
10567            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10568        }
10569
10570        pub fn take_usage(&mut self) -> ::core::option::Option<crate::wire::BufferUsage<'de>> {
10571            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
10572        }
10573
10574        pub fn min_buffer_count_for_camping(
10575            &self,
10576        ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10577            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10578        }
10579
10580        pub fn take_min_buffer_count_for_camping(
10581            &mut self,
10582        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10583            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
10584        }
10585
10586        pub fn min_buffer_count_for_dedicated_slack(
10587            &self,
10588        ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10589            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10590        }
10591
10592        pub fn take_min_buffer_count_for_dedicated_slack(
10593            &mut self,
10594        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10595            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
10596        }
10597
10598        pub fn min_buffer_count_for_shared_slack(
10599            &self,
10600        ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10601            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10602        }
10603
10604        pub fn take_min_buffer_count_for_shared_slack(
10605            &mut self,
10606        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10607            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
10608        }
10609
10610        pub fn min_buffer_count(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10611            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10612        }
10613
10614        pub fn take_min_buffer_count(
10615            &mut self,
10616        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10617            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
10618        }
10619
10620        pub fn max_buffer_count(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10621            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10622        }
10623
10624        pub fn take_max_buffer_count(
10625            &mut self,
10626        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10627            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
10628        }
10629
10630        pub fn buffer_memory_constraints(
10631            &self,
10632        ) -> ::core::option::Option<&crate::wire::BufferMemoryConstraints<'de>> {
10633            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10634        }
10635
10636        pub fn take_buffer_memory_constraints(
10637            &mut self,
10638        ) -> ::core::option::Option<crate::wire::BufferMemoryConstraints<'de>> {
10639            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
10640        }
10641
10642        pub fn image_format_constraints(
10643            &self,
10644        ) -> ::core::option::Option<
10645            &::fidl_next::wire::Vector<'de, crate::wire::ImageFormatConstraints<'de>>,
10646        > {
10647            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10648        }
10649
10650        pub fn take_image_format_constraints(
10651            &mut self,
10652        ) -> ::core::option::Option<
10653            ::fidl_next::wire::Vector<'de, crate::wire::ImageFormatConstraints<'de>>,
10654        > {
10655            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
10656        }
10657    }
10658
10659    impl<'de> ::core::fmt::Debug for BufferCollectionConstraints<'de> {
10660        fn fmt(
10661            &self,
10662            f: &mut ::core::fmt::Formatter<'_>,
10663        ) -> ::core::result::Result<(), ::core::fmt::Error> {
10664            f.debug_struct("BufferCollectionConstraints")
10665                .field("usage", &self.usage())
10666                .field("min_buffer_count_for_camping", &self.min_buffer_count_for_camping())
10667                .field(
10668                    "min_buffer_count_for_dedicated_slack",
10669                    &self.min_buffer_count_for_dedicated_slack(),
10670                )
10671                .field(
10672                    "min_buffer_count_for_shared_slack",
10673                    &self.min_buffer_count_for_shared_slack(),
10674                )
10675                .field("min_buffer_count", &self.min_buffer_count())
10676                .field("max_buffer_count", &self.max_buffer_count())
10677                .field("buffer_memory_constraints", &self.buffer_memory_constraints())
10678                .field("image_format_constraints", &self.image_format_constraints())
10679                .finish()
10680        }
10681    }
10682
10683    impl<'de> ::fidl_next::IntoNatural for BufferCollectionConstraints<'de> {
10684        type Natural = crate::natural::BufferCollectionConstraints;
10685    }
10686
10687    /// The wire type corresponding to [`CoherencyDomain`].
10688    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
10689    #[repr(transparent)]
10690    pub struct CoherencyDomain {
10691        pub(crate) value: ::fidl_next::wire::Uint32,
10692    }
10693
10694    impl ::fidl_next::Constrained for CoherencyDomain {
10695        type Constraint = ();
10696
10697        fn validate(
10698            _: ::fidl_next::Slot<'_, Self>,
10699            _: Self::Constraint,
10700        ) -> Result<(), ::fidl_next::ValidationError> {
10701            Ok(())
10702        }
10703    }
10704
10705    unsafe impl ::fidl_next::Wire for CoherencyDomain {
10706        type Narrowed<'de> = Self;
10707
10708        #[inline]
10709        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10710            // Wire enums have no padding
10711        }
10712    }
10713
10714    impl CoherencyDomain {
10715        pub const CPU: CoherencyDomain = CoherencyDomain { value: ::fidl_next::wire::Uint32(0) };
10716
10717        pub const RAM: CoherencyDomain = CoherencyDomain { value: ::fidl_next::wire::Uint32(1) };
10718
10719        pub const INACCESSIBLE: CoherencyDomain =
10720            CoherencyDomain { value: ::fidl_next::wire::Uint32(2) };
10721    }
10722
10723    unsafe impl<___D> ::fidl_next::Decode<___D> for CoherencyDomain
10724    where
10725        ___D: ?Sized,
10726    {
10727        fn decode(
10728            slot: ::fidl_next::Slot<'_, Self>,
10729            _: &mut ___D,
10730            _: (),
10731        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10732            Ok(())
10733        }
10734    }
10735
10736    impl ::core::convert::From<crate::natural::CoherencyDomain> for CoherencyDomain {
10737        fn from(natural: crate::natural::CoherencyDomain) -> Self {
10738            match natural {
10739                crate::natural::CoherencyDomain::Cpu => CoherencyDomain::CPU,
10740
10741                crate::natural::CoherencyDomain::Ram => CoherencyDomain::RAM,
10742
10743                crate::natural::CoherencyDomain::Inaccessible => CoherencyDomain::INACCESSIBLE,
10744
10745                crate::natural::CoherencyDomain::UnknownOrdinal_(value) => {
10746                    CoherencyDomain { value: ::fidl_next::wire::Uint32::from(value) }
10747                }
10748            }
10749        }
10750    }
10751
10752    impl ::fidl_next::IntoNatural for CoherencyDomain {
10753        type Natural = crate::natural::CoherencyDomain;
10754    }
10755
10756    /// The wire type corresponding to [`BufferMemorySettings`].
10757    #[repr(C)]
10758    pub struct BufferMemorySettings<'de> {
10759        pub(crate) table: ::fidl_next::wire::Table<'de>,
10760    }
10761
10762    impl<'de> Drop for BufferMemorySettings<'de> {
10763        fn drop(&mut self) {
10764            let _ = self
10765                .table
10766                .get(1)
10767                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
10768
10769            let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10770
10771            let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10772
10773            let _ = self.table.get(4).map(|envelope| unsafe {
10774                envelope.read_unchecked::<crate::wire::CoherencyDomain>()
10775            });
10776
10777            let _ = self
10778                .table
10779                .get(5)
10780                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
10781
10782            let _ = self
10783                .table
10784                .get(6)
10785                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
10786        }
10787    }
10788
10789    impl ::fidl_next::Constrained for BufferMemorySettings<'_> {
10790        type Constraint = ();
10791
10792        fn validate(
10793            _: ::fidl_next::Slot<'_, Self>,
10794            _: Self::Constraint,
10795        ) -> Result<(), ::fidl_next::ValidationError> {
10796            Ok(())
10797        }
10798    }
10799
10800    unsafe impl ::fidl_next::Wire for BufferMemorySettings<'static> {
10801        type Narrowed<'de> = BufferMemorySettings<'de>;
10802
10803        #[inline]
10804        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10805            ::fidl_next::munge!(let Self { table } = out);
10806            ::fidl_next::wire::Table::zero_padding(table);
10807        }
10808    }
10809
10810    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferMemorySettings<'de>
10811    where
10812        ___D: ::fidl_next::Decoder<'de> + ?Sized,
10813    {
10814        fn decode(
10815            slot: ::fidl_next::Slot<'_, Self>,
10816            decoder: &mut ___D,
10817            _: (),
10818        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10819            ::fidl_next::munge!(let Self { table } = slot);
10820
10821            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10822                match ordinal {
10823                    0 => unsafe { ::core::hint::unreachable_unchecked() },
10824
10825                    1 => {
10826                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
10827                            slot.as_mut(),
10828                            decoder,
10829                            (),
10830                        )?;
10831
10832                        Ok(())
10833                    }
10834
10835                    2 => {
10836                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10837                            slot.as_mut(),
10838                            decoder,
10839                            (),
10840                        )?;
10841
10842                        Ok(())
10843                    }
10844
10845                    3 => {
10846                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10847                            slot.as_mut(),
10848                            decoder,
10849                            (),
10850                        )?;
10851
10852                        Ok(())
10853                    }
10854
10855                    4 => {
10856                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::CoherencyDomain>(
10857                            slot.as_mut(),
10858                            decoder,
10859                            (),
10860                        )?;
10861
10862                        Ok(())
10863                    }
10864
10865                    5 => {
10866                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
10867                            slot.as_mut(),
10868                            decoder,
10869                            (),
10870                        )?;
10871
10872                        Ok(())
10873                    }
10874
10875                    6 => {
10876                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
10877                            slot.as_mut(),
10878                            decoder,
10879                            (),
10880                        )?;
10881
10882                        Ok(())
10883                    }
10884
10885                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10886                }
10887            })
10888        }
10889    }
10890
10891    impl<'de> BufferMemorySettings<'de> {
10892        pub fn size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10893            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10894        }
10895
10896        pub fn take_size_bytes(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
10897            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
10898        }
10899
10900        pub fn is_physically_contiguous(&self) -> ::core::option::Option<&bool> {
10901            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10902        }
10903
10904        pub fn take_is_physically_contiguous(&mut self) -> ::core::option::Option<bool> {
10905            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
10906        }
10907
10908        pub fn is_secure(&self) -> ::core::option::Option<&bool> {
10909            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10910        }
10911
10912        pub fn take_is_secure(&mut self) -> ::core::option::Option<bool> {
10913            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
10914        }
10915
10916        pub fn coherency_domain(&self) -> ::core::option::Option<&crate::wire::CoherencyDomain> {
10917            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10918        }
10919
10920        pub fn take_coherency_domain(
10921            &mut self,
10922        ) -> ::core::option::Option<crate::wire::CoherencyDomain> {
10923            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
10924        }
10925
10926        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
10927            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10928        }
10929
10930        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
10931            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
10932        }
10933
10934        pub fn raw_vmo_size(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10935            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10936        }
10937
10938        pub fn take_raw_vmo_size(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
10939            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
10940        }
10941    }
10942
10943    impl<'de> ::core::fmt::Debug for BufferMemorySettings<'de> {
10944        fn fmt(
10945            &self,
10946            f: &mut ::core::fmt::Formatter<'_>,
10947        ) -> ::core::result::Result<(), ::core::fmt::Error> {
10948            f.debug_struct("BufferMemorySettings")
10949                .field("size_bytes", &self.size_bytes())
10950                .field("is_physically_contiguous", &self.is_physically_contiguous())
10951                .field("is_secure", &self.is_secure())
10952                .field("coherency_domain", &self.coherency_domain())
10953                .field("heap", &self.heap())
10954                .field("raw_vmo_size", &self.raw_vmo_size())
10955                .finish()
10956        }
10957    }
10958
10959    impl<'de> ::fidl_next::IntoNatural for BufferMemorySettings<'de> {
10960        type Natural = crate::natural::BufferMemorySettings;
10961    }
10962
10963    /// The wire type corresponding to [`SingleBufferSettings`].
10964    #[repr(C)]
10965    pub struct SingleBufferSettings<'de> {
10966        pub(crate) table: ::fidl_next::wire::Table<'de>,
10967    }
10968
10969    impl<'de> Drop for SingleBufferSettings<'de> {
10970        fn drop(&mut self) {
10971            let _ = self.table.get(1).map(|envelope| unsafe {
10972                envelope.read_unchecked::<crate::wire::BufferMemorySettings<'de>>()
10973            });
10974
10975            let _ = self.table.get(2).map(|envelope| unsafe {
10976                envelope.read_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
10977            });
10978        }
10979    }
10980
10981    impl ::fidl_next::Constrained for SingleBufferSettings<'_> {
10982        type Constraint = ();
10983
10984        fn validate(
10985            _: ::fidl_next::Slot<'_, Self>,
10986            _: Self::Constraint,
10987        ) -> Result<(), ::fidl_next::ValidationError> {
10988            Ok(())
10989        }
10990    }
10991
10992    unsafe impl ::fidl_next::Wire for SingleBufferSettings<'static> {
10993        type Narrowed<'de> = SingleBufferSettings<'de>;
10994
10995        #[inline]
10996        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10997            ::fidl_next::munge!(let Self { table } = out);
10998            ::fidl_next::wire::Table::zero_padding(table);
10999        }
11000    }
11001
11002    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SingleBufferSettings<'de>
11003    where
11004        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11005    {
11006        fn decode(
11007            slot: ::fidl_next::Slot<'_, Self>,
11008            decoder: &mut ___D,
11009            _: (),
11010        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11011            ::fidl_next::munge!(let Self { table } = slot);
11012
11013            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11014                match ordinal {
11015                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11016
11017                    1 => {
11018                        ::fidl_next::wire::Envelope::decode_as::<
11019                            ___D,
11020                            crate::wire::BufferMemorySettings<'de>,
11021                        >(slot.as_mut(), decoder, ())?;
11022
11023                        Ok(())
11024                    }
11025
11026                    2 => {
11027                        ::fidl_next::wire::Envelope::decode_as::<
11028                            ___D,
11029                            crate::wire::ImageFormatConstraints<'de>,
11030                        >(slot.as_mut(), decoder, ())?;
11031
11032                        Ok(())
11033                    }
11034
11035                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11036                }
11037            })
11038        }
11039    }
11040
11041    impl<'de> SingleBufferSettings<'de> {
11042        pub fn buffer_settings(
11043            &self,
11044        ) -> ::core::option::Option<&crate::wire::BufferMemorySettings<'de>> {
11045            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11046        }
11047
11048        pub fn take_buffer_settings(
11049            &mut self,
11050        ) -> ::core::option::Option<crate::wire::BufferMemorySettings<'de>> {
11051            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11052        }
11053
11054        pub fn image_format_constraints(
11055            &self,
11056        ) -> ::core::option::Option<&crate::wire::ImageFormatConstraints<'de>> {
11057            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11058        }
11059
11060        pub fn take_image_format_constraints(
11061            &mut self,
11062        ) -> ::core::option::Option<crate::wire::ImageFormatConstraints<'de>> {
11063            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
11064        }
11065    }
11066
11067    impl<'de> ::core::fmt::Debug for SingleBufferSettings<'de> {
11068        fn fmt(
11069            &self,
11070            f: &mut ::core::fmt::Formatter<'_>,
11071        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11072            f.debug_struct("SingleBufferSettings")
11073                .field("buffer_settings", &self.buffer_settings())
11074                .field("image_format_constraints", &self.image_format_constraints())
11075                .finish()
11076        }
11077    }
11078
11079    impl<'de> ::fidl_next::IntoNatural for SingleBufferSettings<'de> {
11080        type Natural = crate::natural::SingleBufferSettings;
11081    }
11082
11083    /// The wire type corresponding to [`Error`].
11084    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
11085    #[repr(transparent)]
11086    pub struct Error {
11087        pub(crate) value: ::fidl_next::wire::Uint32,
11088    }
11089
11090    impl ::fidl_next::Constrained for Error {
11091        type Constraint = ();
11092
11093        fn validate(
11094            _: ::fidl_next::Slot<'_, Self>,
11095            _: Self::Constraint,
11096        ) -> Result<(), ::fidl_next::ValidationError> {
11097            Ok(())
11098        }
11099    }
11100
11101    unsafe impl ::fidl_next::Wire for Error {
11102        type Narrowed<'de> = Self;
11103
11104        #[inline]
11105        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11106            // Wire enums have no padding
11107        }
11108    }
11109
11110    impl Error {
11111        pub const INVALID: Error = Error { value: ::fidl_next::wire::Uint32(0) };
11112
11113        pub const UNSPECIFIED: Error = Error { value: ::fidl_next::wire::Uint32(1) };
11114
11115        pub const PROTOCOL_DEVIATION: Error = Error { value: ::fidl_next::wire::Uint32(2) };
11116
11117        pub const NOT_FOUND: Error = Error { value: ::fidl_next::wire::Uint32(3) };
11118
11119        pub const HANDLE_ACCESS_DENIED: Error = Error { value: ::fidl_next::wire::Uint32(4) };
11120
11121        pub const NO_MEMORY: Error = Error { value: ::fidl_next::wire::Uint32(5) };
11122
11123        pub const CONSTRAINTS_INTERSECTION_EMPTY: Error =
11124            Error { value: ::fidl_next::wire::Uint32(6) };
11125
11126        pub const PENDING: Error = Error { value: ::fidl_next::wire::Uint32(7) };
11127
11128        pub const TOO_MANY_GROUP_CHILD_COMBINATIONS: Error =
11129            Error { value: ::fidl_next::wire::Uint32(8) };
11130
11131        pub const NO_MORE_STRONG_VMO_HANDLES: Error = Error { value: ::fidl_next::wire::Uint32(9) };
11132    }
11133
11134    unsafe impl<___D> ::fidl_next::Decode<___D> for Error
11135    where
11136        ___D: ?Sized,
11137    {
11138        fn decode(
11139            slot: ::fidl_next::Slot<'_, Self>,
11140            _: &mut ___D,
11141            _: (),
11142        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11143            Ok(())
11144        }
11145    }
11146
11147    impl ::core::convert::From<crate::natural::Error> for Error {
11148        fn from(natural: crate::natural::Error) -> Self {
11149            match natural {
11150                crate::natural::Error::Invalid => Error::INVALID,
11151
11152                crate::natural::Error::Unspecified => Error::UNSPECIFIED,
11153
11154                crate::natural::Error::ProtocolDeviation => Error::PROTOCOL_DEVIATION,
11155
11156                crate::natural::Error::NotFound => Error::NOT_FOUND,
11157
11158                crate::natural::Error::HandleAccessDenied => Error::HANDLE_ACCESS_DENIED,
11159
11160                crate::natural::Error::NoMemory => Error::NO_MEMORY,
11161
11162                crate::natural::Error::ConstraintsIntersectionEmpty => {
11163                    Error::CONSTRAINTS_INTERSECTION_EMPTY
11164                }
11165
11166                crate::natural::Error::Pending => Error::PENDING,
11167
11168                crate::natural::Error::TooManyGroupChildCombinations => {
11169                    Error::TOO_MANY_GROUP_CHILD_COMBINATIONS
11170                }
11171
11172                crate::natural::Error::NoMoreStrongVmoHandles => Error::NO_MORE_STRONG_VMO_HANDLES,
11173
11174                crate::natural::Error::UnknownOrdinal_(value) => {
11175                    Error { value: ::fidl_next::wire::Uint32::from(value) }
11176                }
11177            }
11178        }
11179    }
11180
11181    impl ::fidl_next::IntoNatural for Error {
11182        type Natural = crate::natural::Error;
11183    }
11184
11185    /// The wire type corresponding to [`NodeSyncResponse`].
11186    pub type NodeSyncResponse = ::fidl_next::wire::Unit;
11187
11188    /// The wire type corresponding to [`NodeSetNameRequest`].
11189    #[repr(C)]
11190    pub struct NodeSetNameRequest<'de> {
11191        pub(crate) table: ::fidl_next::wire::Table<'de>,
11192    }
11193
11194    impl<'de> Drop for NodeSetNameRequest<'de> {
11195        fn drop(&mut self) {
11196            let _ = self
11197                .table
11198                .get(1)
11199                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
11200
11201            let _ = self.table.get(2).map(|envelope| unsafe {
11202                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11203            });
11204        }
11205    }
11206
11207    impl ::fidl_next::Constrained for NodeSetNameRequest<'_> {
11208        type Constraint = ();
11209
11210        fn validate(
11211            _: ::fidl_next::Slot<'_, Self>,
11212            _: Self::Constraint,
11213        ) -> Result<(), ::fidl_next::ValidationError> {
11214            Ok(())
11215        }
11216    }
11217
11218    unsafe impl ::fidl_next::Wire for NodeSetNameRequest<'static> {
11219        type Narrowed<'de> = NodeSetNameRequest<'de>;
11220
11221        #[inline]
11222        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11223            ::fidl_next::munge!(let Self { table } = out);
11224            ::fidl_next::wire::Table::zero_padding(table);
11225        }
11226    }
11227
11228    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetNameRequest<'de>
11229    where
11230        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11231    {
11232        fn decode(
11233            slot: ::fidl_next::Slot<'_, Self>,
11234            decoder: &mut ___D,
11235            _: (),
11236        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11237            ::fidl_next::munge!(let Self { table } = slot);
11238
11239            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11240                match ordinal {
11241                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11242
11243                    1 => {
11244                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
11245                            slot.as_mut(),
11246                            decoder,
11247                            (),
11248                        )?;
11249
11250                        Ok(())
11251                    }
11252
11253                    2 => {
11254                        ::fidl_next::wire::Envelope::decode_as::<
11255                            ___D,
11256                            ::fidl_next::wire::String<'de>,
11257                        >(slot.as_mut(), decoder, 64)?;
11258
11259                        let value = unsafe {
11260                            slot.deref_unchecked()
11261                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
11262                        };
11263
11264                        if value.len() > 64 {
11265                            return Err(::fidl_next::DecodeError::VectorTooLong {
11266                                size: value.len() as u64,
11267                                limit: 64,
11268                            });
11269                        }
11270
11271                        Ok(())
11272                    }
11273
11274                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11275                }
11276            })
11277        }
11278    }
11279
11280    impl<'de> NodeSetNameRequest<'de> {
11281        pub fn priority(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
11282            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11283        }
11284
11285        pub fn take_priority(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
11286            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11287        }
11288
11289        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
11290            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11291        }
11292
11293        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
11294            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
11295        }
11296    }
11297
11298    impl<'de> ::core::fmt::Debug for NodeSetNameRequest<'de> {
11299        fn fmt(
11300            &self,
11301            f: &mut ::core::fmt::Formatter<'_>,
11302        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11303            f.debug_struct("NodeSetNameRequest")
11304                .field("priority", &self.priority())
11305                .field("name", &self.name())
11306                .finish()
11307        }
11308    }
11309
11310    impl<'de> ::fidl_next::IntoNatural for NodeSetNameRequest<'de> {
11311        type Natural = crate::natural::NodeSetNameRequest;
11312    }
11313
11314    /// The wire type corresponding to [`NodeSetDebugClientInfoRequest`].
11315    #[repr(C)]
11316    pub struct NodeSetDebugClientInfoRequest<'de> {
11317        pub(crate) table: ::fidl_next::wire::Table<'de>,
11318    }
11319
11320    impl<'de> Drop for NodeSetDebugClientInfoRequest<'de> {
11321        fn drop(&mut self) {
11322            let _ = self.table.get(1).map(|envelope| unsafe {
11323                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11324            });
11325
11326            let _ = self
11327                .table
11328                .get(2)
11329                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
11330        }
11331    }
11332
11333    impl ::fidl_next::Constrained for NodeSetDebugClientInfoRequest<'_> {
11334        type Constraint = ();
11335
11336        fn validate(
11337            _: ::fidl_next::Slot<'_, Self>,
11338            _: Self::Constraint,
11339        ) -> Result<(), ::fidl_next::ValidationError> {
11340            Ok(())
11341        }
11342    }
11343
11344    unsafe impl ::fidl_next::Wire for NodeSetDebugClientInfoRequest<'static> {
11345        type Narrowed<'de> = NodeSetDebugClientInfoRequest<'de>;
11346
11347        #[inline]
11348        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11349            ::fidl_next::munge!(let Self { table } = out);
11350            ::fidl_next::wire::Table::zero_padding(table);
11351        }
11352    }
11353
11354    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetDebugClientInfoRequest<'de>
11355    where
11356        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11357    {
11358        fn decode(
11359            slot: ::fidl_next::Slot<'_, Self>,
11360            decoder: &mut ___D,
11361            _: (),
11362        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11363            ::fidl_next::munge!(let Self { table } = slot);
11364
11365            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11366                match ordinal {
11367                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11368
11369                    1 => {
11370                        ::fidl_next::wire::Envelope::decode_as::<
11371                            ___D,
11372                            ::fidl_next::wire::String<'de>,
11373                        >(slot.as_mut(), decoder, 256)?;
11374
11375                        let value = unsafe {
11376                            slot.deref_unchecked()
11377                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
11378                        };
11379
11380                        if value.len() > 256 {
11381                            return Err(::fidl_next::DecodeError::VectorTooLong {
11382                                size: value.len() as u64,
11383                                limit: 256,
11384                            });
11385                        }
11386
11387                        Ok(())
11388                    }
11389
11390                    2 => {
11391                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
11392                            slot.as_mut(),
11393                            decoder,
11394                            (),
11395                        )?;
11396
11397                        Ok(())
11398                    }
11399
11400                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11401                }
11402            })
11403        }
11404    }
11405
11406    impl<'de> NodeSetDebugClientInfoRequest<'de> {
11407        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
11408            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11409        }
11410
11411        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
11412            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11413        }
11414
11415        pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
11416            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11417        }
11418
11419        pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
11420            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
11421        }
11422    }
11423
11424    impl<'de> ::core::fmt::Debug for NodeSetDebugClientInfoRequest<'de> {
11425        fn fmt(
11426            &self,
11427            f: &mut ::core::fmt::Formatter<'_>,
11428        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11429            f.debug_struct("NodeSetDebugClientInfoRequest")
11430                .field("name", &self.name())
11431                .field("id", &self.id())
11432                .finish()
11433        }
11434    }
11435
11436    impl<'de> ::fidl_next::IntoNatural for NodeSetDebugClientInfoRequest<'de> {
11437        type Natural = crate::natural::NodeSetDebugClientInfoRequest;
11438    }
11439
11440    /// The wire type corresponding to [`NodeSetDebugTimeoutLogDeadlineRequest`].
11441    #[repr(C)]
11442    pub struct NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11443        pub(crate) table: ::fidl_next::wire::Table<'de>,
11444    }
11445
11446    impl<'de> Drop for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11447        fn drop(&mut self) {
11448            let _ = self
11449                .table
11450                .get(1)
11451                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
11452        }
11453    }
11454
11455    impl ::fidl_next::Constrained for NodeSetDebugTimeoutLogDeadlineRequest<'_> {
11456        type Constraint = ();
11457
11458        fn validate(
11459            _: ::fidl_next::Slot<'_, Self>,
11460            _: Self::Constraint,
11461        ) -> Result<(), ::fidl_next::ValidationError> {
11462            Ok(())
11463        }
11464    }
11465
11466    unsafe impl ::fidl_next::Wire for NodeSetDebugTimeoutLogDeadlineRequest<'static> {
11467        type Narrowed<'de> = NodeSetDebugTimeoutLogDeadlineRequest<'de>;
11468
11469        #[inline]
11470        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11471            ::fidl_next::munge!(let Self { table } = out);
11472            ::fidl_next::wire::Table::zero_padding(table);
11473        }
11474    }
11475
11476    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetDebugTimeoutLogDeadlineRequest<'de>
11477    where
11478        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11479    {
11480        fn decode(
11481            slot: ::fidl_next::Slot<'_, Self>,
11482            decoder: &mut ___D,
11483            _: (),
11484        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11485            ::fidl_next::munge!(let Self { table } = slot);
11486
11487            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11488                match ordinal {
11489                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11490
11491                    1 => {
11492                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
11493                            slot.as_mut(),
11494                            decoder,
11495                            (),
11496                        )?;
11497
11498                        Ok(())
11499                    }
11500
11501                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11502                }
11503            })
11504        }
11505    }
11506
11507    impl<'de> NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11508        pub fn deadline(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
11509            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11510        }
11511
11512        pub fn take_deadline(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
11513            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11514        }
11515    }
11516
11517    impl<'de> ::core::fmt::Debug for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11518        fn fmt(
11519            &self,
11520            f: &mut ::core::fmt::Formatter<'_>,
11521        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11522            f.debug_struct("NodeSetDebugTimeoutLogDeadlineRequest")
11523                .field("deadline", &self.deadline())
11524                .finish()
11525        }
11526    }
11527
11528    impl<'de> ::fidl_next::IntoNatural for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11529        type Natural = crate::natural::NodeSetDebugTimeoutLogDeadlineRequest;
11530    }
11531
11532    /// The wire type corresponding to [`NodeIsAlternateForResponse`].
11533    #[repr(C)]
11534    pub struct NodeIsAlternateForResponse<'de> {
11535        pub(crate) table: ::fidl_next::wire::Table<'de>,
11536    }
11537
11538    impl<'de> Drop for NodeIsAlternateForResponse<'de> {
11539        fn drop(&mut self) {
11540            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
11541        }
11542    }
11543
11544    impl ::fidl_next::Constrained for NodeIsAlternateForResponse<'_> {
11545        type Constraint = ();
11546
11547        fn validate(
11548            _: ::fidl_next::Slot<'_, Self>,
11549            _: Self::Constraint,
11550        ) -> Result<(), ::fidl_next::ValidationError> {
11551            Ok(())
11552        }
11553    }
11554
11555    unsafe impl ::fidl_next::Wire for NodeIsAlternateForResponse<'static> {
11556        type Narrowed<'de> = NodeIsAlternateForResponse<'de>;
11557
11558        #[inline]
11559        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11560            ::fidl_next::munge!(let Self { table } = out);
11561            ::fidl_next::wire::Table::zero_padding(table);
11562        }
11563    }
11564
11565    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeIsAlternateForResponse<'de>
11566    where
11567        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11568    {
11569        fn decode(
11570            slot: ::fidl_next::Slot<'_, Self>,
11571            decoder: &mut ___D,
11572            _: (),
11573        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11574            ::fidl_next::munge!(let Self { table } = slot);
11575
11576            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11577                match ordinal {
11578                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11579
11580                    1 => {
11581                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
11582                            slot.as_mut(),
11583                            decoder,
11584                            (),
11585                        )?;
11586
11587                        Ok(())
11588                    }
11589
11590                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11591                }
11592            })
11593        }
11594    }
11595
11596    impl<'de> NodeIsAlternateForResponse<'de> {
11597        pub fn is_alternate(&self) -> ::core::option::Option<&bool> {
11598            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11599        }
11600
11601        pub fn take_is_alternate(&mut self) -> ::core::option::Option<bool> {
11602            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11603        }
11604    }
11605
11606    impl<'de> ::core::fmt::Debug for NodeIsAlternateForResponse<'de> {
11607        fn fmt(
11608            &self,
11609            f: &mut ::core::fmt::Formatter<'_>,
11610        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11611            f.debug_struct("NodeIsAlternateForResponse")
11612                .field("is_alternate", &self.is_alternate())
11613                .finish()
11614        }
11615    }
11616
11617    impl<'de> ::fidl_next::IntoNatural for NodeIsAlternateForResponse<'de> {
11618        type Natural = crate::natural::NodeIsAlternateForResponse;
11619    }
11620
11621    /// The wire type corresponding to [`NodeGetBufferCollectionIdResponse`].
11622    #[repr(C)]
11623    pub struct NodeGetBufferCollectionIdResponse<'de> {
11624        pub(crate) table: ::fidl_next::wire::Table<'de>,
11625    }
11626
11627    impl<'de> Drop for NodeGetBufferCollectionIdResponse<'de> {
11628        fn drop(&mut self) {
11629            let _ = self
11630                .table
11631                .get(1)
11632                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
11633        }
11634    }
11635
11636    impl ::fidl_next::Constrained for NodeGetBufferCollectionIdResponse<'_> {
11637        type Constraint = ();
11638
11639        fn validate(
11640            _: ::fidl_next::Slot<'_, Self>,
11641            _: Self::Constraint,
11642        ) -> Result<(), ::fidl_next::ValidationError> {
11643            Ok(())
11644        }
11645    }
11646
11647    unsafe impl ::fidl_next::Wire for NodeGetBufferCollectionIdResponse<'static> {
11648        type Narrowed<'de> = NodeGetBufferCollectionIdResponse<'de>;
11649
11650        #[inline]
11651        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11652            ::fidl_next::munge!(let Self { table } = out);
11653            ::fidl_next::wire::Table::zero_padding(table);
11654        }
11655    }
11656
11657    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeGetBufferCollectionIdResponse<'de>
11658    where
11659        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11660    {
11661        fn decode(
11662            slot: ::fidl_next::Slot<'_, Self>,
11663            decoder: &mut ___D,
11664            _: (),
11665        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11666            ::fidl_next::munge!(let Self { table } = slot);
11667
11668            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11669                match ordinal {
11670                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11671
11672                    1 => {
11673                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
11674                            slot.as_mut(),
11675                            decoder,
11676                            (),
11677                        )?;
11678
11679                        Ok(())
11680                    }
11681
11682                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11683                }
11684            })
11685        }
11686    }
11687
11688    impl<'de> NodeGetBufferCollectionIdResponse<'de> {
11689        pub fn buffer_collection_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
11690            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11691        }
11692
11693        pub fn take_buffer_collection_id(
11694            &mut self,
11695        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
11696            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11697        }
11698    }
11699
11700    impl<'de> ::core::fmt::Debug for NodeGetBufferCollectionIdResponse<'de> {
11701        fn fmt(
11702            &self,
11703            f: &mut ::core::fmt::Formatter<'_>,
11704        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11705            f.debug_struct("NodeGetBufferCollectionIdResponse")
11706                .field("buffer_collection_id", &self.buffer_collection_id())
11707                .finish()
11708        }
11709    }
11710
11711    impl<'de> ::fidl_next::IntoNatural for NodeGetBufferCollectionIdResponse<'de> {
11712        type Natural = crate::natural::NodeGetBufferCollectionIdResponse;
11713    }
11714
11715    /// The wire type corresponding to [`BufferCollectionCheckAllBuffersAllocatedResponse`].
11716    pub type BufferCollectionCheckAllBuffersAllocatedResponse = ::fidl_next::wire::Unit;
11717
11718    /// The wire type corresponding to [`BufferCollectionTokenDuplicateSyncRequest`].
11719    #[repr(C)]
11720    pub struct BufferCollectionTokenDuplicateSyncRequest<'de> {
11721        pub(crate) table: ::fidl_next::wire::Table<'de>,
11722    }
11723
11724    impl<'de> Drop for BufferCollectionTokenDuplicateSyncRequest<'de> {
11725        fn drop(&mut self) {
11726            let _ = self.table.get(1)
11727                .map(|envelope| unsafe {
11728                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>()
11729                });
11730        }
11731    }
11732
11733    impl ::fidl_next::Constrained for BufferCollectionTokenDuplicateSyncRequest<'_> {
11734        type Constraint = ();
11735
11736        fn validate(
11737            _: ::fidl_next::Slot<'_, Self>,
11738            _: Self::Constraint,
11739        ) -> Result<(), ::fidl_next::ValidationError> {
11740            Ok(())
11741        }
11742    }
11743
11744    unsafe impl ::fidl_next::Wire for BufferCollectionTokenDuplicateSyncRequest<'static> {
11745        type Narrowed<'de> = BufferCollectionTokenDuplicateSyncRequest<'de>;
11746
11747        #[inline]
11748        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11749            ::fidl_next::munge!(let Self { table } = out);
11750            ::fidl_next::wire::Table::zero_padding(table);
11751        }
11752    }
11753
11754    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferCollectionTokenDuplicateSyncRequest<'de>
11755    where
11756        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11757    {
11758        fn decode(
11759            slot: ::fidl_next::Slot<'_, Self>,
11760            decoder: &mut ___D,
11761            _: (),
11762        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11763            ::fidl_next::munge!(let Self { table } = slot);
11764
11765            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11766                match ordinal {
11767                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11768
11769                    1 => {
11770                        ::fidl_next::wire::Envelope::decode_as::<
11771                            ___D,
11772                            ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11773                        >(slot.as_mut(), decoder, (64, ()))?;
11774
11775                        let value = unsafe {
11776                            slot
11777                                            .deref_unchecked()
11778                                            .deref_unchecked::<
11779                                                ::fidl_next::wire::Vector<'_, ::fidl_next::wire::fuchsia::Rights>
11780                                            >()
11781                        };
11782
11783                        if value.len() > 64 {
11784                            return Err(::fidl_next::DecodeError::VectorTooLong {
11785                                size: value.len() as u64,
11786                                limit: 64,
11787                            });
11788                        }
11789
11790                        Ok(())
11791                    }
11792
11793                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11794                }
11795            })
11796        }
11797    }
11798
11799    impl<'de> BufferCollectionTokenDuplicateSyncRequest<'de> {
11800        pub fn rights_attenuation_masks(
11801            &self,
11802        ) -> ::core::option::Option<
11803            &::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11804        > {
11805            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11806        }
11807
11808        pub fn take_rights_attenuation_masks(
11809            &mut self,
11810        ) -> ::core::option::Option<
11811            ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11812        > {
11813            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11814        }
11815    }
11816
11817    impl<'de> ::core::fmt::Debug for BufferCollectionTokenDuplicateSyncRequest<'de> {
11818        fn fmt(
11819            &self,
11820            f: &mut ::core::fmt::Formatter<'_>,
11821        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11822            f.debug_struct("BufferCollectionTokenDuplicateSyncRequest")
11823                .field("rights_attenuation_masks", &self.rights_attenuation_masks())
11824                .finish()
11825        }
11826    }
11827
11828    impl<'de> ::fidl_next::IntoNatural for BufferCollectionTokenDuplicateSyncRequest<'de> {
11829        type Natural = crate::natural::BufferCollectionTokenDuplicateSyncRequest;
11830    }
11831
11832    /// The wire type corresponding to [`BufferCollectionTokenGroupCreateChildrenSyncRequest`].
11833    #[repr(C)]
11834    pub struct BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11835        pub(crate) table: ::fidl_next::wire::Table<'de>,
11836    }
11837
11838    impl<'de> Drop for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11839        fn drop(&mut self) {
11840            let _ = self.table.get(1)
11841                .map(|envelope| unsafe {
11842                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>()
11843                });
11844        }
11845    }
11846
11847    impl ::fidl_next::Constrained for BufferCollectionTokenGroupCreateChildrenSyncRequest<'_> {
11848        type Constraint = ();
11849
11850        fn validate(
11851            _: ::fidl_next::Slot<'_, Self>,
11852            _: Self::Constraint,
11853        ) -> Result<(), ::fidl_next::ValidationError> {
11854            Ok(())
11855        }
11856    }
11857
11858    unsafe impl ::fidl_next::Wire for BufferCollectionTokenGroupCreateChildrenSyncRequest<'static> {
11859        type Narrowed<'de> = BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>;
11860
11861        #[inline]
11862        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11863            ::fidl_next::munge!(let Self { table } = out);
11864            ::fidl_next::wire::Table::zero_padding(table);
11865        }
11866    }
11867
11868    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
11869        for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>
11870    where
11871        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11872    {
11873        fn decode(
11874            slot: ::fidl_next::Slot<'_, Self>,
11875            decoder: &mut ___D,
11876            _: (),
11877        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11878            ::fidl_next::munge!(let Self { table } = slot);
11879
11880            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11881                match ordinal {
11882                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11883
11884                    1 => {
11885                        ::fidl_next::wire::Envelope::decode_as::<
11886                            ___D,
11887                            ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11888                        >(slot.as_mut(), decoder, (64, ()))?;
11889
11890                        let value = unsafe {
11891                            slot
11892                                            .deref_unchecked()
11893                                            .deref_unchecked::<
11894                                                ::fidl_next::wire::Vector<'_, ::fidl_next::wire::fuchsia::Rights>
11895                                            >()
11896                        };
11897
11898                        if value.len() > 64 {
11899                            return Err(::fidl_next::DecodeError::VectorTooLong {
11900                                size: value.len() as u64,
11901                                limit: 64,
11902                            });
11903                        }
11904
11905                        Ok(())
11906                    }
11907
11908                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11909                }
11910            })
11911        }
11912    }
11913
11914    impl<'de> BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11915        pub fn rights_attenuation_masks(
11916            &self,
11917        ) -> ::core::option::Option<
11918            &::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11919        > {
11920            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11921        }
11922
11923        pub fn take_rights_attenuation_masks(
11924            &mut self,
11925        ) -> ::core::option::Option<
11926            ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11927        > {
11928            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11929        }
11930    }
11931
11932    impl<'de> ::core::fmt::Debug for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11933        fn fmt(
11934            &self,
11935            f: &mut ::core::fmt::Formatter<'_>,
11936        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11937            f.debug_struct("BufferCollectionTokenGroupCreateChildrenSyncRequest")
11938                .field("rights_attenuation_masks", &self.rights_attenuation_masks())
11939                .finish()
11940        }
11941    }
11942
11943    impl<'de> ::fidl_next::IntoNatural for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11944        type Natural = crate::natural::BufferCollectionTokenGroupCreateChildrenSyncRequest;
11945    }
11946
11947    /// The wire type corresponding to [`FormatCostKey`].
11948    #[repr(C)]
11949    pub struct FormatCostKey<'de> {
11950        pub(crate) table: ::fidl_next::wire::Table<'de>,
11951    }
11952
11953    impl<'de> Drop for FormatCostKey<'de> {
11954        fn drop(&mut self) {
11955            let _ = self.table.get(1).map(|envelope| unsafe {
11956                envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>()
11957            });
11958
11959            let _ = self.table.get(2)
11960                .map(|envelope| unsafe {
11961                    envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>()
11962                });
11963
11964            let _ = self.table.get(3).map(|envelope| unsafe {
11965                envelope.read_unchecked::<crate::wire::BufferUsage<'de>>()
11966            });
11967        }
11968    }
11969
11970    impl ::fidl_next::Constrained for FormatCostKey<'_> {
11971        type Constraint = ();
11972
11973        fn validate(
11974            _: ::fidl_next::Slot<'_, Self>,
11975            _: Self::Constraint,
11976        ) -> Result<(), ::fidl_next::ValidationError> {
11977            Ok(())
11978        }
11979    }
11980
11981    unsafe impl ::fidl_next::Wire for FormatCostKey<'static> {
11982        type Narrowed<'de> = FormatCostKey<'de>;
11983
11984        #[inline]
11985        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11986            ::fidl_next::munge!(let Self { table } = out);
11987            ::fidl_next::wire::Table::zero_padding(table);
11988        }
11989    }
11990
11991    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCostKey<'de>
11992    where
11993        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11994    {
11995        fn decode(
11996            slot: ::fidl_next::Slot<'_, Self>,
11997            decoder: &mut ___D,
11998            _: (),
11999        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12000            ::fidl_next::munge!(let Self { table } = slot);
12001
12002            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12003                match ordinal {
12004                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12005
12006                    1 => {
12007                        ::fidl_next::wire::Envelope::decode_as::<
12008                            ___D,
12009                            ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
12010                        >(slot.as_mut(), decoder, ())?;
12011
12012                        Ok(())
12013                    }
12014
12015                    2 => {
12016                        ::fidl_next::wire::Envelope::decode_as::<
12017                            ___D,
12018                            ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
12019                        >(slot.as_mut(), decoder, ())?;
12020
12021                        Ok(())
12022                    }
12023
12024                    3 => {
12025                        ::fidl_next::wire::Envelope::decode_as::<
12026                            ___D,
12027                            crate::wire::BufferUsage<'de>,
12028                        >(slot.as_mut(), decoder, ())?;
12029
12030                        Ok(())
12031                    }
12032
12033                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12034                }
12035            })
12036        }
12037    }
12038
12039    impl<'de> FormatCostKey<'de> {
12040        pub fn pixel_format(
12041            &self,
12042        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormat>
12043        {
12044            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12045        }
12046
12047        pub fn take_pixel_format(
12048            &mut self,
12049        ) -> ::core::option::Option<::fidl_next_common_fuchsia_images2::wire::PixelFormat> {
12050            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12051        }
12052
12053        pub fn pixel_format_modifier(
12054            &self,
12055        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
12056        {
12057            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12058        }
12059
12060        pub fn take_pixel_format_modifier(
12061            &mut self,
12062        ) -> ::core::option::Option<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
12063        {
12064            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12065        }
12066
12067        pub fn buffer_usage_bits(&self) -> ::core::option::Option<&crate::wire::BufferUsage<'de>> {
12068            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12069        }
12070
12071        pub fn take_buffer_usage_bits(
12072            &mut self,
12073        ) -> ::core::option::Option<crate::wire::BufferUsage<'de>> {
12074            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
12075        }
12076    }
12077
12078    impl<'de> ::core::fmt::Debug for FormatCostKey<'de> {
12079        fn fmt(
12080            &self,
12081            f: &mut ::core::fmt::Formatter<'_>,
12082        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12083            f.debug_struct("FormatCostKey")
12084                .field("pixel_format", &self.pixel_format())
12085                .field("pixel_format_modifier", &self.pixel_format_modifier())
12086                .field("buffer_usage_bits", &self.buffer_usage_bits())
12087                .finish()
12088        }
12089    }
12090
12091    impl<'de> ::fidl_next::IntoNatural for FormatCostKey<'de> {
12092        type Natural = crate::natural::FormatCostKey;
12093    }
12094
12095    /// The wire type corresponding to [`FormatCostEntry`].
12096    #[repr(C)]
12097    pub struct FormatCostEntry<'de> {
12098        pub(crate) table: ::fidl_next::wire::Table<'de>,
12099    }
12100
12101    impl<'de> Drop for FormatCostEntry<'de> {
12102        fn drop(&mut self) {
12103            let _ = self.table.get(1).map(|envelope| unsafe {
12104                envelope.read_unchecked::<crate::wire::FormatCostKey<'de>>()
12105            });
12106
12107            let _ = self
12108                .table
12109                .get(2)
12110                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Float32>() });
12111        }
12112    }
12113
12114    impl ::fidl_next::Constrained for FormatCostEntry<'_> {
12115        type Constraint = ();
12116
12117        fn validate(
12118            _: ::fidl_next::Slot<'_, Self>,
12119            _: Self::Constraint,
12120        ) -> Result<(), ::fidl_next::ValidationError> {
12121            Ok(())
12122        }
12123    }
12124
12125    unsafe impl ::fidl_next::Wire for FormatCostEntry<'static> {
12126        type Narrowed<'de> = FormatCostEntry<'de>;
12127
12128        #[inline]
12129        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12130            ::fidl_next::munge!(let Self { table } = out);
12131            ::fidl_next::wire::Table::zero_padding(table);
12132        }
12133    }
12134
12135    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCostEntry<'de>
12136    where
12137        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12138    {
12139        fn decode(
12140            slot: ::fidl_next::Slot<'_, Self>,
12141            decoder: &mut ___D,
12142            _: (),
12143        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12144            ::fidl_next::munge!(let Self { table } = slot);
12145
12146            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12147                match ordinal {
12148                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12149
12150                    1 => {
12151                        ::fidl_next::wire::Envelope::decode_as::<
12152                            ___D,
12153                            crate::wire::FormatCostKey<'de>,
12154                        >(slot.as_mut(), decoder, ())?;
12155
12156                        Ok(())
12157                    }
12158
12159                    2 => {
12160                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Float32>(
12161                            slot.as_mut(),
12162                            decoder,
12163                            (),
12164                        )?;
12165
12166                        Ok(())
12167                    }
12168
12169                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12170                }
12171            })
12172        }
12173    }
12174
12175    impl<'de> FormatCostEntry<'de> {
12176        pub fn key(&self) -> ::core::option::Option<&crate::wire::FormatCostKey<'de>> {
12177            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12178        }
12179
12180        pub fn take_key(&mut self) -> ::core::option::Option<crate::wire::FormatCostKey<'de>> {
12181            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12182        }
12183
12184        pub fn cost(&self) -> ::core::option::Option<&::fidl_next::wire::Float32> {
12185            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12186        }
12187
12188        pub fn take_cost(&mut self) -> ::core::option::Option<::fidl_next::wire::Float32> {
12189            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12190        }
12191    }
12192
12193    impl<'de> ::core::fmt::Debug for FormatCostEntry<'de> {
12194        fn fmt(
12195            &self,
12196            f: &mut ::core::fmt::Formatter<'_>,
12197        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12198            f.debug_struct("FormatCostEntry")
12199                .field("key", &self.key())
12200                .field("cost", &self.cost())
12201                .finish()
12202        }
12203    }
12204
12205    impl<'de> ::fidl_next::IntoNatural for FormatCostEntry<'de> {
12206        type Natural = crate::natural::FormatCostEntry;
12207    }
12208
12209    /// The wire type corresponding to [`Config`].
12210    #[repr(C)]
12211    pub struct Config<'de> {
12212        pub(crate) table: ::fidl_next::wire::Table<'de>,
12213    }
12214
12215    impl<'de> Drop for Config<'de> {
12216        fn drop(&mut self) {
12217            let _ = self.table.get(1)
12218                .map(|envelope| unsafe {
12219                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>()
12220                });
12221        }
12222    }
12223
12224    impl ::fidl_next::Constrained for Config<'_> {
12225        type Constraint = ();
12226
12227        fn validate(
12228            _: ::fidl_next::Slot<'_, Self>,
12229            _: Self::Constraint,
12230        ) -> Result<(), ::fidl_next::ValidationError> {
12231            Ok(())
12232        }
12233    }
12234
12235    unsafe impl ::fidl_next::Wire for Config<'static> {
12236        type Narrowed<'de> = Config<'de>;
12237
12238        #[inline]
12239        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12240            ::fidl_next::munge!(let Self { table } = out);
12241            ::fidl_next::wire::Table::zero_padding(table);
12242        }
12243    }
12244
12245    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Config<'de>
12246    where
12247        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12248    {
12249        fn decode(
12250            slot: ::fidl_next::Slot<'_, Self>,
12251            decoder: &mut ___D,
12252            _: (),
12253        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12254            ::fidl_next::munge!(let Self { table } = slot);
12255
12256            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12257                match ordinal {
12258                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12259
12260                    1 => {
12261                        ::fidl_next::wire::Envelope::decode_as::<
12262                            ___D,
12263                            ::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12264                        >(slot.as_mut(), decoder, (4294967295, ()))?;
12265
12266                        Ok(())
12267                    }
12268
12269                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12270                }
12271            })
12272        }
12273    }
12274
12275    impl<'de> Config<'de> {
12276        pub fn format_costs(
12277            &self,
12278        ) -> ::core::option::Option<
12279            &::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12280        > {
12281            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12282        }
12283
12284        pub fn take_format_costs(
12285            &mut self,
12286        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>
12287        {
12288            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12289        }
12290    }
12291
12292    impl<'de> ::core::fmt::Debug for Config<'de> {
12293        fn fmt(
12294            &self,
12295            f: &mut ::core::fmt::Formatter<'_>,
12296        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12297            f.debug_struct("Config").field("format_costs", &self.format_costs()).finish()
12298        }
12299    }
12300
12301    impl<'de> ::fidl_next::IntoNatural for Config<'de> {
12302        type Natural = crate::natural::Config;
12303    }
12304
12305    /// The wire type corresponding to [`DynamicSecureHeap`].
12306    #[repr(C)]
12307    pub struct DynamicSecureHeap<'de> {
12308        pub(crate) table: ::fidl_next::wire::Table<'de>,
12309    }
12310
12311    impl<'de> Drop for DynamicSecureHeap<'de> {
12312        fn drop(&mut self) {
12313            let _ = self
12314                .table
12315                .get(1)
12316                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12317        }
12318    }
12319
12320    impl ::fidl_next::Constrained for DynamicSecureHeap<'_> {
12321        type Constraint = ();
12322
12323        fn validate(
12324            _: ::fidl_next::Slot<'_, Self>,
12325            _: Self::Constraint,
12326        ) -> Result<(), ::fidl_next::ValidationError> {
12327            Ok(())
12328        }
12329    }
12330
12331    unsafe impl ::fidl_next::Wire for DynamicSecureHeap<'static> {
12332        type Narrowed<'de> = DynamicSecureHeap<'de>;
12333
12334        #[inline]
12335        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12336            ::fidl_next::munge!(let Self { table } = out);
12337            ::fidl_next::wire::Table::zero_padding(table);
12338        }
12339    }
12340
12341    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DynamicSecureHeap<'de>
12342    where
12343        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12344    {
12345        fn decode(
12346            slot: ::fidl_next::Slot<'_, Self>,
12347            decoder: &mut ___D,
12348            _: (),
12349        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12350            ::fidl_next::munge!(let Self { table } = slot);
12351
12352            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12353                match ordinal {
12354                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12355
12356                    1 => {
12357                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12358                            slot.as_mut(),
12359                            decoder,
12360                            (),
12361                        )?;
12362
12363                        Ok(())
12364                    }
12365
12366                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12367                }
12368            })
12369        }
12370    }
12371
12372    impl<'de> DynamicSecureHeap<'de> {
12373        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12374            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12375        }
12376
12377        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
12378            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12379        }
12380    }
12381
12382    impl<'de> ::core::fmt::Debug for DynamicSecureHeap<'de> {
12383        fn fmt(
12384            &self,
12385            f: &mut ::core::fmt::Formatter<'_>,
12386        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12387            f.debug_struct("DynamicSecureHeap").field("heap", &self.heap()).finish()
12388        }
12389    }
12390
12391    impl<'de> ::fidl_next::IntoNatural for DynamicSecureHeap<'de> {
12392        type Natural = crate::natural::DynamicSecureHeap;
12393    }
12394
12395    /// The wire type corresponding to [`FormatCosts`].
12396    #[repr(C)]
12397    pub struct FormatCosts<'de> {
12398        pub(crate) table: ::fidl_next::wire::Table<'de>,
12399    }
12400
12401    impl<'de> Drop for FormatCosts<'de> {
12402        fn drop(&mut self) {
12403            let _ = self.table.get(1)
12404                .map(|envelope| unsafe {
12405                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>()
12406                });
12407        }
12408    }
12409
12410    impl ::fidl_next::Constrained for FormatCosts<'_> {
12411        type Constraint = ();
12412
12413        fn validate(
12414            _: ::fidl_next::Slot<'_, Self>,
12415            _: Self::Constraint,
12416        ) -> Result<(), ::fidl_next::ValidationError> {
12417            Ok(())
12418        }
12419    }
12420
12421    unsafe impl ::fidl_next::Wire for FormatCosts<'static> {
12422        type Narrowed<'de> = FormatCosts<'de>;
12423
12424        #[inline]
12425        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12426            ::fidl_next::munge!(let Self { table } = out);
12427            ::fidl_next::wire::Table::zero_padding(table);
12428        }
12429    }
12430
12431    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCosts<'de>
12432    where
12433        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12434    {
12435        fn decode(
12436            slot: ::fidl_next::Slot<'_, Self>,
12437            decoder: &mut ___D,
12438            _: (),
12439        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12440            ::fidl_next::munge!(let Self { table } = slot);
12441
12442            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12443                match ordinal {
12444                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12445
12446                    1 => {
12447                        ::fidl_next::wire::Envelope::decode_as::<
12448                            ___D,
12449                            ::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12450                        >(slot.as_mut(), decoder, (4294967295, ()))?;
12451
12452                        Ok(())
12453                    }
12454
12455                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12456                }
12457            })
12458        }
12459    }
12460
12461    impl<'de> FormatCosts<'de> {
12462        pub fn format_costs(
12463            &self,
12464        ) -> ::core::option::Option<
12465            &::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12466        > {
12467            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12468        }
12469
12470        pub fn take_format_costs(
12471            &mut self,
12472        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>
12473        {
12474            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12475        }
12476    }
12477
12478    impl<'de> ::core::fmt::Debug for FormatCosts<'de> {
12479        fn fmt(
12480            &self,
12481            f: &mut ::core::fmt::Formatter<'_>,
12482        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12483            f.debug_struct("FormatCosts").field("format_costs", &self.format_costs()).finish()
12484        }
12485    }
12486
12487    impl<'de> ::fidl_next::IntoNatural for FormatCosts<'de> {
12488        type Natural = crate::natural::FormatCosts;
12489    }
12490
12491    /// The wire type corresponding to [`SecureHeapRange`].
12492    #[repr(C)]
12493    pub struct SecureHeapRange<'de> {
12494        pub(crate) table: ::fidl_next::wire::Table<'de>,
12495    }
12496
12497    impl<'de> Drop for SecureHeapRange<'de> {
12498        fn drop(&mut self) {
12499            let _ = self
12500                .table
12501                .get(1)
12502                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
12503
12504            let _ = self
12505                .table
12506                .get(2)
12507                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
12508        }
12509    }
12510
12511    impl ::fidl_next::Constrained for SecureHeapRange<'_> {
12512        type Constraint = ();
12513
12514        fn validate(
12515            _: ::fidl_next::Slot<'_, Self>,
12516            _: Self::Constraint,
12517        ) -> Result<(), ::fidl_next::ValidationError> {
12518            Ok(())
12519        }
12520    }
12521
12522    unsafe impl ::fidl_next::Wire for SecureHeapRange<'static> {
12523        type Narrowed<'de> = SecureHeapRange<'de>;
12524
12525        #[inline]
12526        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12527            ::fidl_next::munge!(let Self { table } = out);
12528            ::fidl_next::wire::Table::zero_padding(table);
12529        }
12530    }
12531
12532    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapRange<'de>
12533    where
12534        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12535    {
12536        fn decode(
12537            slot: ::fidl_next::Slot<'_, Self>,
12538            decoder: &mut ___D,
12539            _: (),
12540        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12541            ::fidl_next::munge!(let Self { table } = slot);
12542
12543            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12544                match ordinal {
12545                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12546
12547                    1 => {
12548                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
12549                            slot.as_mut(),
12550                            decoder,
12551                            (),
12552                        )?;
12553
12554                        Ok(())
12555                    }
12556
12557                    2 => {
12558                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
12559                            slot.as_mut(),
12560                            decoder,
12561                            (),
12562                        )?;
12563
12564                        Ok(())
12565                    }
12566
12567                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12568                }
12569            })
12570        }
12571    }
12572
12573    impl<'de> SecureHeapRange<'de> {
12574        pub fn physical_address(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
12575            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12576        }
12577
12578        pub fn take_physical_address(
12579            &mut self,
12580        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
12581            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12582        }
12583
12584        pub fn size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
12585            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12586        }
12587
12588        pub fn take_size_bytes(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
12589            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12590        }
12591    }
12592
12593    impl<'de> ::core::fmt::Debug for SecureHeapRange<'de> {
12594        fn fmt(
12595            &self,
12596            f: &mut ::core::fmt::Formatter<'_>,
12597        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12598            f.debug_struct("SecureHeapRange")
12599                .field("physical_address", &self.physical_address())
12600                .field("size_bytes", &self.size_bytes())
12601                .finish()
12602        }
12603    }
12604
12605    impl<'de> ::fidl_next::IntoNatural for SecureHeapRange<'de> {
12606        type Natural = crate::natural::SecureHeapRange;
12607    }
12608
12609    /// The wire type corresponding to [`SecureHeapAndRange`].
12610    #[repr(C)]
12611    pub struct SecureHeapAndRange<'de> {
12612        pub(crate) table: ::fidl_next::wire::Table<'de>,
12613    }
12614
12615    impl<'de> Drop for SecureHeapAndRange<'de> {
12616        fn drop(&mut self) {
12617            let _ = self
12618                .table
12619                .get(1)
12620                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12621
12622            let _ = self.table.get(2).map(|envelope| unsafe {
12623                envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12624            });
12625        }
12626    }
12627
12628    impl ::fidl_next::Constrained for SecureHeapAndRange<'_> {
12629        type Constraint = ();
12630
12631        fn validate(
12632            _: ::fidl_next::Slot<'_, Self>,
12633            _: Self::Constraint,
12634        ) -> Result<(), ::fidl_next::ValidationError> {
12635            Ok(())
12636        }
12637    }
12638
12639    unsafe impl ::fidl_next::Wire for SecureHeapAndRange<'static> {
12640        type Narrowed<'de> = SecureHeapAndRange<'de>;
12641
12642        #[inline]
12643        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12644            ::fidl_next::munge!(let Self { table } = out);
12645            ::fidl_next::wire::Table::zero_padding(table);
12646        }
12647    }
12648
12649    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRange<'de>
12650    where
12651        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12652    {
12653        fn decode(
12654            slot: ::fidl_next::Slot<'_, Self>,
12655            decoder: &mut ___D,
12656            _: (),
12657        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12658            ::fidl_next::munge!(let Self { table } = slot);
12659
12660            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12661                match ordinal {
12662                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12663
12664                    1 => {
12665                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12666                            slot.as_mut(),
12667                            decoder,
12668                            (),
12669                        )?;
12670
12671                        Ok(())
12672                    }
12673
12674                    2 => {
12675                        ::fidl_next::wire::Envelope::decode_as::<
12676                            ___D,
12677                            crate::wire::SecureHeapRange<'de>,
12678                        >(slot.as_mut(), decoder, ())?;
12679
12680                        Ok(())
12681                    }
12682
12683                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12684                }
12685            })
12686        }
12687    }
12688
12689    impl<'de> SecureHeapAndRange<'de> {
12690        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12691            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12692        }
12693
12694        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
12695            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12696        }
12697
12698        pub fn range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12699            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12700        }
12701
12702        pub fn take_range(&mut self) -> ::core::option::Option<crate::wire::SecureHeapRange<'de>> {
12703            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12704        }
12705    }
12706
12707    impl<'de> ::core::fmt::Debug for SecureHeapAndRange<'de> {
12708        fn fmt(
12709            &self,
12710            f: &mut ::core::fmt::Formatter<'_>,
12711        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12712            f.debug_struct("SecureHeapAndRange")
12713                .field("heap", &self.heap())
12714                .field("range", &self.range())
12715                .finish()
12716        }
12717    }
12718
12719    impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRange<'de> {
12720        type Natural = crate::natural::SecureHeapAndRange;
12721    }
12722
12723    /// The wire type corresponding to [`SecureHeapAndRangeModification`].
12724    #[repr(C)]
12725    pub struct SecureHeapAndRangeModification<'de> {
12726        pub(crate) table: ::fidl_next::wire::Table<'de>,
12727    }
12728
12729    impl<'de> Drop for SecureHeapAndRangeModification<'de> {
12730        fn drop(&mut self) {
12731            let _ = self
12732                .table
12733                .get(1)
12734                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12735
12736            let _ = self.table.get(2).map(|envelope| unsafe {
12737                envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12738            });
12739
12740            let _ = self.table.get(3).map(|envelope| unsafe {
12741                envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12742            });
12743        }
12744    }
12745
12746    impl ::fidl_next::Constrained for SecureHeapAndRangeModification<'_> {
12747        type Constraint = ();
12748
12749        fn validate(
12750            _: ::fidl_next::Slot<'_, Self>,
12751            _: Self::Constraint,
12752        ) -> Result<(), ::fidl_next::ValidationError> {
12753            Ok(())
12754        }
12755    }
12756
12757    unsafe impl ::fidl_next::Wire for SecureHeapAndRangeModification<'static> {
12758        type Narrowed<'de> = SecureHeapAndRangeModification<'de>;
12759
12760        #[inline]
12761        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12762            ::fidl_next::munge!(let Self { table } = out);
12763            ::fidl_next::wire::Table::zero_padding(table);
12764        }
12765    }
12766
12767    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRangeModification<'de>
12768    where
12769        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12770    {
12771        fn decode(
12772            slot: ::fidl_next::Slot<'_, Self>,
12773            decoder: &mut ___D,
12774            _: (),
12775        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12776            ::fidl_next::munge!(let Self { table } = slot);
12777
12778            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12779                match ordinal {
12780                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12781
12782                    1 => {
12783                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12784                            slot.as_mut(),
12785                            decoder,
12786                            (),
12787                        )?;
12788
12789                        Ok(())
12790                    }
12791
12792                    2 => {
12793                        ::fidl_next::wire::Envelope::decode_as::<
12794                            ___D,
12795                            crate::wire::SecureHeapRange<'de>,
12796                        >(slot.as_mut(), decoder, ())?;
12797
12798                        Ok(())
12799                    }
12800
12801                    3 => {
12802                        ::fidl_next::wire::Envelope::decode_as::<
12803                            ___D,
12804                            crate::wire::SecureHeapRange<'de>,
12805                        >(slot.as_mut(), decoder, ())?;
12806
12807                        Ok(())
12808                    }
12809
12810                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12811                }
12812            })
12813        }
12814    }
12815
12816    impl<'de> SecureHeapAndRangeModification<'de> {
12817        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12818            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12819        }
12820
12821        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
12822            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12823        }
12824
12825        pub fn old_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12826            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12827        }
12828
12829        pub fn take_old_range(
12830            &mut self,
12831        ) -> ::core::option::Option<crate::wire::SecureHeapRange<'de>> {
12832            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12833        }
12834
12835        pub fn new_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12836            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12837        }
12838
12839        pub fn take_new_range(
12840            &mut self,
12841        ) -> ::core::option::Option<crate::wire::SecureHeapRange<'de>> {
12842            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
12843        }
12844    }
12845
12846    impl<'de> ::core::fmt::Debug for SecureHeapAndRangeModification<'de> {
12847        fn fmt(
12848            &self,
12849            f: &mut ::core::fmt::Formatter<'_>,
12850        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12851            f.debug_struct("SecureHeapAndRangeModification")
12852                .field("heap", &self.heap())
12853                .field("old_range", &self.old_range())
12854                .field("new_range", &self.new_range())
12855                .finish()
12856        }
12857    }
12858
12859    impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRangeModification<'de> {
12860        type Natural = crate::natural::SecureHeapAndRangeModification;
12861    }
12862
12863    /// The wire type corresponding to [`SecureHeapAndRanges`].
12864    #[repr(C)]
12865    pub struct SecureHeapAndRanges<'de> {
12866        pub(crate) table: ::fidl_next::wire::Table<'de>,
12867    }
12868
12869    impl<'de> Drop for SecureHeapAndRanges<'de> {
12870        fn drop(&mut self) {
12871            let _ = self
12872                .table
12873                .get(1)
12874                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12875
12876            let _ = self.table.get(2)
12877                .map(|envelope| unsafe {
12878                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>()
12879                });
12880        }
12881    }
12882
12883    impl ::fidl_next::Constrained for SecureHeapAndRanges<'_> {
12884        type Constraint = ();
12885
12886        fn validate(
12887            _: ::fidl_next::Slot<'_, Self>,
12888            _: Self::Constraint,
12889        ) -> Result<(), ::fidl_next::ValidationError> {
12890            Ok(())
12891        }
12892    }
12893
12894    unsafe impl ::fidl_next::Wire for SecureHeapAndRanges<'static> {
12895        type Narrowed<'de> = SecureHeapAndRanges<'de>;
12896
12897        #[inline]
12898        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12899            ::fidl_next::munge!(let Self { table } = out);
12900            ::fidl_next::wire::Table::zero_padding(table);
12901        }
12902    }
12903
12904    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRanges<'de>
12905    where
12906        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12907    {
12908        fn decode(
12909            slot: ::fidl_next::Slot<'_, Self>,
12910            decoder: &mut ___D,
12911            _: (),
12912        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12913            ::fidl_next::munge!(let Self { table } = slot);
12914
12915            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12916                match ordinal {
12917                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12918
12919                    1 => {
12920                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12921                            slot.as_mut(),
12922                            decoder,
12923                            (),
12924                        )?;
12925
12926                        Ok(())
12927                    }
12928
12929                    2 => {
12930                        ::fidl_next::wire::Envelope::decode_as::<
12931                            ___D,
12932                            ::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>,
12933                        >(slot.as_mut(), decoder, (128, ()))?;
12934
12935                        let value = unsafe {
12936                            slot
12937                                            .deref_unchecked()
12938                                            .deref_unchecked::<
12939                                                ::fidl_next::wire::Vector<'_, crate::wire::SecureHeapRange<'_>>
12940                                            >()
12941                        };
12942
12943                        if value.len() > 128 {
12944                            return Err(::fidl_next::DecodeError::VectorTooLong {
12945                                size: value.len() as u64,
12946                                limit: 128,
12947                            });
12948                        }
12949
12950                        Ok(())
12951                    }
12952
12953                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12954                }
12955            })
12956        }
12957    }
12958
12959    impl<'de> SecureHeapAndRanges<'de> {
12960        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12961            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12962        }
12963
12964        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
12965            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12966        }
12967
12968        pub fn ranges(
12969            &self,
12970        ) -> ::core::option::Option<
12971            &::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>,
12972        > {
12973            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12974        }
12975
12976        pub fn take_ranges(
12977            &mut self,
12978        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>
12979        {
12980            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12981        }
12982    }
12983
12984    impl<'de> ::core::fmt::Debug for SecureHeapAndRanges<'de> {
12985        fn fmt(
12986            &self,
12987            f: &mut ::core::fmt::Formatter<'_>,
12988        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12989            f.debug_struct("SecureHeapAndRanges")
12990                .field("heap", &self.heap())
12991                .field("ranges", &self.ranges())
12992                .finish()
12993        }
12994    }
12995
12996    impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRanges<'de> {
12997        type Natural = crate::natural::SecureHeapAndRanges;
12998    }
12999
13000    /// The wire type corresponding to [`SecureHeapProperties`].
13001    #[repr(C)]
13002    pub struct SecureHeapProperties<'de> {
13003        pub(crate) table: ::fidl_next::wire::Table<'de>,
13004    }
13005
13006    impl<'de> Drop for SecureHeapProperties<'de> {
13007        fn drop(&mut self) {
13008            let _ = self
13009                .table
13010                .get(1)
13011                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
13012
13013            let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
13014
13015            let _ = self
13016                .table
13017                .get(3)
13018                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
13019
13020            let _ = self
13021                .table
13022                .get(4)
13023                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
13024
13025            let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
13026        }
13027    }
13028
13029    impl ::fidl_next::Constrained for SecureHeapProperties<'_> {
13030        type Constraint = ();
13031
13032        fn validate(
13033            _: ::fidl_next::Slot<'_, Self>,
13034            _: Self::Constraint,
13035        ) -> Result<(), ::fidl_next::ValidationError> {
13036            Ok(())
13037        }
13038    }
13039
13040    unsafe impl ::fidl_next::Wire for SecureHeapProperties<'static> {
13041        type Narrowed<'de> = SecureHeapProperties<'de>;
13042
13043        #[inline]
13044        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13045            ::fidl_next::munge!(let Self { table } = out);
13046            ::fidl_next::wire::Table::zero_padding(table);
13047        }
13048    }
13049
13050    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapProperties<'de>
13051    where
13052        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13053    {
13054        fn decode(
13055            slot: ::fidl_next::Slot<'_, Self>,
13056            decoder: &mut ___D,
13057            _: (),
13058        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13059            ::fidl_next::munge!(let Self { table } = slot);
13060
13061            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13062                match ordinal {
13063                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13064
13065                    1 => {
13066                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
13067                            slot.as_mut(),
13068                            decoder,
13069                            (),
13070                        )?;
13071
13072                        Ok(())
13073                    }
13074
13075                    2 => {
13076                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
13077                            slot.as_mut(),
13078                            decoder,
13079                            (),
13080                        )?;
13081
13082                        Ok(())
13083                    }
13084
13085                    3 => {
13086                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
13087                            slot.as_mut(),
13088                            decoder,
13089                            (),
13090                        )?;
13091
13092                        Ok(())
13093                    }
13094
13095                    4 => {
13096                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
13097                            slot.as_mut(),
13098                            decoder,
13099                            (),
13100                        )?;
13101
13102                        Ok(())
13103                    }
13104
13105                    5 => {
13106                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
13107                            slot.as_mut(),
13108                            decoder,
13109                            (),
13110                        )?;
13111
13112                        Ok(())
13113                    }
13114
13115                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13116                }
13117            })
13118        }
13119    }
13120
13121    impl<'de> SecureHeapProperties<'de> {
13122        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
13123            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13124        }
13125
13126        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
13127            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13128        }
13129
13130        pub fn dynamic_protection_ranges(&self) -> ::core::option::Option<&bool> {
13131            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13132        }
13133
13134        pub fn take_dynamic_protection_ranges(&mut self) -> ::core::option::Option<bool> {
13135            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
13136        }
13137
13138        pub fn protected_range_granularity(
13139            &self,
13140        ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
13141            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
13142        }
13143
13144        pub fn take_protected_range_granularity(
13145            &mut self,
13146        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
13147            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
13148        }
13149
13150        pub fn max_protected_range_count(
13151            &self,
13152        ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
13153            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
13154        }
13155
13156        pub fn take_max_protected_range_count(
13157            &mut self,
13158        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
13159            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
13160        }
13161
13162        pub fn is_mod_protected_range_available(&self) -> ::core::option::Option<&bool> {
13163            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
13164        }
13165
13166        pub fn take_is_mod_protected_range_available(&mut self) -> ::core::option::Option<bool> {
13167            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
13168        }
13169    }
13170
13171    impl<'de> ::core::fmt::Debug for SecureHeapProperties<'de> {
13172        fn fmt(
13173            &self,
13174            f: &mut ::core::fmt::Formatter<'_>,
13175        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13176            f.debug_struct("SecureHeapProperties")
13177                .field("heap", &self.heap())
13178                .field("dynamic_protection_ranges", &self.dynamic_protection_ranges())
13179                .field("protected_range_granularity", &self.protected_range_granularity())
13180                .field("max_protected_range_count", &self.max_protected_range_count())
13181                .field("is_mod_protected_range_available", &self.is_mod_protected_range_available())
13182                .finish()
13183        }
13184    }
13185
13186    impl<'de> ::fidl_next::IntoNatural for SecureHeapProperties<'de> {
13187        type Natural = crate::natural::SecureHeapProperties;
13188    }
13189
13190    /// The wire type corresponding to [`SecureMemGetPhysicalSecureHeapsResponse`].
13191    #[repr(C)]
13192    pub struct SecureMemGetPhysicalSecureHeapsResponse<'de> {
13193        pub(crate) table: ::fidl_next::wire::Table<'de>,
13194    }
13195
13196    impl<'de> Drop for SecureMemGetPhysicalSecureHeapsResponse<'de> {
13197        fn drop(&mut self) {
13198            let _ = self.table.get(1)
13199                .map(|envelope| unsafe {
13200                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>>()
13201                });
13202        }
13203    }
13204
13205    impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapsResponse<'_> {
13206        type Constraint = ();
13207
13208        fn validate(
13209            _: ::fidl_next::Slot<'_, Self>,
13210            _: Self::Constraint,
13211        ) -> Result<(), ::fidl_next::ValidationError> {
13212            Ok(())
13213        }
13214    }
13215
13216    unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapsResponse<'static> {
13217        type Narrowed<'de> = SecureMemGetPhysicalSecureHeapsResponse<'de>;
13218
13219        #[inline]
13220        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13221            ::fidl_next::munge!(let Self { table } = out);
13222            ::fidl_next::wire::Table::zero_padding(table);
13223        }
13224    }
13225
13226    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemGetPhysicalSecureHeapsResponse<'de>
13227    where
13228        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13229    {
13230        fn decode(
13231            slot: ::fidl_next::Slot<'_, Self>,
13232            decoder: &mut ___D,
13233            _: (),
13234        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13235            ::fidl_next::munge!(let Self { table } = slot);
13236
13237            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13238                match ordinal {
13239                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13240
13241                    1 => {
13242                        ::fidl_next::wire::Envelope::decode_as::<
13243                            ___D,
13244                            ::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>,
13245                        >(slot.as_mut(), decoder, (32, ()))?;
13246
13247                        let value = unsafe {
13248                            slot
13249                                            .deref_unchecked()
13250                                            .deref_unchecked::<
13251                                                ::fidl_next::wire::Vector<'_, crate::wire::SecureHeapAndRanges<'_>>
13252                                            >()
13253                        };
13254
13255                        if value.len() > 32 {
13256                            return Err(::fidl_next::DecodeError::VectorTooLong {
13257                                size: value.len() as u64,
13258                                limit: 32,
13259                            });
13260                        }
13261
13262                        Ok(())
13263                    }
13264
13265                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13266                }
13267            })
13268        }
13269    }
13270
13271    impl<'de> SecureMemGetPhysicalSecureHeapsResponse<'de> {
13272        pub fn heaps(
13273            &self,
13274        ) -> ::core::option::Option<
13275            &::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>,
13276        > {
13277            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13278        }
13279
13280        pub fn take_heaps(
13281            &mut self,
13282        ) -> ::core::option::Option<
13283            ::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>,
13284        > {
13285            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13286        }
13287    }
13288
13289    impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapsResponse<'de> {
13290        fn fmt(
13291            &self,
13292            f: &mut ::core::fmt::Formatter<'_>,
13293        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13294            f.debug_struct("SecureMemGetPhysicalSecureHeapsResponse")
13295                .field("heaps", &self.heaps())
13296                .finish()
13297        }
13298    }
13299
13300    impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapsResponse<'de> {
13301        type Natural = crate::natural::SecureMemGetPhysicalSecureHeapsResponse;
13302    }
13303
13304    /// The wire type corresponding to [`SecureMemGetDynamicSecureHeapsResponse`].
13305    #[repr(C)]
13306    pub struct SecureMemGetDynamicSecureHeapsResponse<'de> {
13307        pub(crate) table: ::fidl_next::wire::Table<'de>,
13308    }
13309
13310    impl<'de> Drop for SecureMemGetDynamicSecureHeapsResponse<'de> {
13311        fn drop(&mut self) {
13312            let _ = self.table.get(1)
13313                .map(|envelope| unsafe {
13314                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>()
13315                });
13316        }
13317    }
13318
13319    impl ::fidl_next::Constrained for SecureMemGetDynamicSecureHeapsResponse<'_> {
13320        type Constraint = ();
13321
13322        fn validate(
13323            _: ::fidl_next::Slot<'_, Self>,
13324            _: Self::Constraint,
13325        ) -> Result<(), ::fidl_next::ValidationError> {
13326            Ok(())
13327        }
13328    }
13329
13330    unsafe impl ::fidl_next::Wire for SecureMemGetDynamicSecureHeapsResponse<'static> {
13331        type Narrowed<'de> = SecureMemGetDynamicSecureHeapsResponse<'de>;
13332
13333        #[inline]
13334        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13335            ::fidl_next::munge!(let Self { table } = out);
13336            ::fidl_next::wire::Table::zero_padding(table);
13337        }
13338    }
13339
13340    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemGetDynamicSecureHeapsResponse<'de>
13341    where
13342        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13343    {
13344        fn decode(
13345            slot: ::fidl_next::Slot<'_, Self>,
13346            decoder: &mut ___D,
13347            _: (),
13348        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13349            ::fidl_next::munge!(let Self { table } = slot);
13350
13351            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13352                match ordinal {
13353                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13354
13355                    1 => {
13356                        ::fidl_next::wire::Envelope::decode_as::<
13357                            ___D,
13358                            ::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>,
13359                        >(slot.as_mut(), decoder, (32, ()))?;
13360
13361                        let value = unsafe {
13362                            slot
13363                                            .deref_unchecked()
13364                                            .deref_unchecked::<
13365                                                ::fidl_next::wire::Vector<'_, crate::wire::DynamicSecureHeap<'_>>
13366                                            >()
13367                        };
13368
13369                        if value.len() > 32 {
13370                            return Err(::fidl_next::DecodeError::VectorTooLong {
13371                                size: value.len() as u64,
13372                                limit: 32,
13373                            });
13374                        }
13375
13376                        Ok(())
13377                    }
13378
13379                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13380                }
13381            })
13382        }
13383    }
13384
13385    impl<'de> SecureMemGetDynamicSecureHeapsResponse<'de> {
13386        pub fn heaps(
13387            &self,
13388        ) -> ::core::option::Option<
13389            &::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>,
13390        > {
13391            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13392        }
13393
13394        pub fn take_heaps(
13395            &mut self,
13396        ) -> ::core::option::Option<
13397            ::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>,
13398        > {
13399            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13400        }
13401    }
13402
13403    impl<'de> ::core::fmt::Debug for SecureMemGetDynamicSecureHeapsResponse<'de> {
13404        fn fmt(
13405            &self,
13406            f: &mut ::core::fmt::Formatter<'_>,
13407        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13408            f.debug_struct("SecureMemGetDynamicSecureHeapsResponse")
13409                .field("heaps", &self.heaps())
13410                .finish()
13411        }
13412    }
13413
13414    impl<'de> ::fidl_next::IntoNatural for SecureMemGetDynamicSecureHeapsResponse<'de> {
13415        type Natural = crate::natural::SecureMemGetDynamicSecureHeapsResponse;
13416    }
13417
13418    /// The wire type corresponding to [`SecureMemGetPhysicalSecureHeapPropertiesRequest`].
13419    #[repr(C)]
13420    pub struct SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13421        pub(crate) table: ::fidl_next::wire::Table<'de>,
13422    }
13423
13424    impl<'de> Drop for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13425        fn drop(&mut self) {
13426            let _ = self.table.get(1).map(|envelope| unsafe {
13427                envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13428            });
13429        }
13430    }
13431
13432    impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapPropertiesRequest<'_> {
13433        type Constraint = ();
13434
13435        fn validate(
13436            _: ::fidl_next::Slot<'_, Self>,
13437            _: Self::Constraint,
13438        ) -> Result<(), ::fidl_next::ValidationError> {
13439            Ok(())
13440        }
13441    }
13442
13443    unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapPropertiesRequest<'static> {
13444        type Narrowed<'de> = SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>;
13445
13446        #[inline]
13447        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13448            ::fidl_next::munge!(let Self { table } = out);
13449            ::fidl_next::wire::Table::zero_padding(table);
13450        }
13451    }
13452
13453    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13454        for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>
13455    where
13456        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13457    {
13458        fn decode(
13459            slot: ::fidl_next::Slot<'_, Self>,
13460            decoder: &mut ___D,
13461            _: (),
13462        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13463            ::fidl_next::munge!(let Self { table } = slot);
13464
13465            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13466                match ordinal {
13467                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13468
13469                    1 => {
13470                        ::fidl_next::wire::Envelope::decode_as::<
13471                            ___D,
13472                            crate::wire::SecureHeapAndRange<'de>,
13473                        >(slot.as_mut(), decoder, ())?;
13474
13475                        Ok(())
13476                    }
13477
13478                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13479                }
13480            })
13481        }
13482    }
13483
13484    impl<'de> SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13485        pub fn entire_heap(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13486            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13487        }
13488
13489        pub fn take_entire_heap(
13490            &mut self,
13491        ) -> ::core::option::Option<crate::wire::SecureHeapAndRange<'de>> {
13492            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13493        }
13494    }
13495
13496    impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13497        fn fmt(
13498            &self,
13499            f: &mut ::core::fmt::Formatter<'_>,
13500        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13501            f.debug_struct("SecureMemGetPhysicalSecureHeapPropertiesRequest")
13502                .field("entire_heap", &self.entire_heap())
13503                .finish()
13504        }
13505    }
13506
13507    impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13508        type Natural = crate::natural::SecureMemGetPhysicalSecureHeapPropertiesRequest;
13509    }
13510
13511    /// The wire type corresponding to [`SecureMemGetPhysicalSecureHeapPropertiesResponse`].
13512    #[repr(C)]
13513    pub struct SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13514        pub(crate) table: ::fidl_next::wire::Table<'de>,
13515    }
13516
13517    impl<'de> Drop for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13518        fn drop(&mut self) {
13519            let _ = self.table.get(1).map(|envelope| unsafe {
13520                envelope.read_unchecked::<crate::wire::SecureHeapProperties<'de>>()
13521            });
13522        }
13523    }
13524
13525    impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapPropertiesResponse<'_> {
13526        type Constraint = ();
13527
13528        fn validate(
13529            _: ::fidl_next::Slot<'_, Self>,
13530            _: Self::Constraint,
13531        ) -> Result<(), ::fidl_next::ValidationError> {
13532            Ok(())
13533        }
13534    }
13535
13536    unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapPropertiesResponse<'static> {
13537        type Narrowed<'de> = SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>;
13538
13539        #[inline]
13540        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13541            ::fidl_next::munge!(let Self { table } = out);
13542            ::fidl_next::wire::Table::zero_padding(table);
13543        }
13544    }
13545
13546    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13547        for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>
13548    where
13549        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13550    {
13551        fn decode(
13552            slot: ::fidl_next::Slot<'_, Self>,
13553            decoder: &mut ___D,
13554            _: (),
13555        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13556            ::fidl_next::munge!(let Self { table } = slot);
13557
13558            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13559                match ordinal {
13560                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13561
13562                    1 => {
13563                        ::fidl_next::wire::Envelope::decode_as::<
13564                            ___D,
13565                            crate::wire::SecureHeapProperties<'de>,
13566                        >(slot.as_mut(), decoder, ())?;
13567
13568                        Ok(())
13569                    }
13570
13571                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13572                }
13573            })
13574        }
13575    }
13576
13577    impl<'de> SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13578        pub fn properties(
13579            &self,
13580        ) -> ::core::option::Option<&crate::wire::SecureHeapProperties<'de>> {
13581            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13582        }
13583
13584        pub fn take_properties(
13585            &mut self,
13586        ) -> ::core::option::Option<crate::wire::SecureHeapProperties<'de>> {
13587            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13588        }
13589    }
13590
13591    impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13592        fn fmt(
13593            &self,
13594            f: &mut ::core::fmt::Formatter<'_>,
13595        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13596            f.debug_struct("SecureMemGetPhysicalSecureHeapPropertiesResponse")
13597                .field("properties", &self.properties())
13598                .finish()
13599        }
13600    }
13601
13602    impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13603        type Natural = crate::natural::SecureMemGetPhysicalSecureHeapPropertiesResponse;
13604    }
13605
13606    /// The wire type corresponding to [`SecureMemAddSecureHeapPhysicalRangeRequest`].
13607    #[repr(C)]
13608    pub struct SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13609        pub(crate) table: ::fidl_next::wire::Table<'de>,
13610    }
13611
13612    impl<'de> Drop for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13613        fn drop(&mut self) {
13614            let _ = self.table.get(1).map(|envelope| unsafe {
13615                envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13616            });
13617        }
13618    }
13619
13620    impl ::fidl_next::Constrained for SecureMemAddSecureHeapPhysicalRangeRequest<'_> {
13621        type Constraint = ();
13622
13623        fn validate(
13624            _: ::fidl_next::Slot<'_, Self>,
13625            _: Self::Constraint,
13626        ) -> Result<(), ::fidl_next::ValidationError> {
13627            Ok(())
13628        }
13629    }
13630
13631    unsafe impl ::fidl_next::Wire for SecureMemAddSecureHeapPhysicalRangeRequest<'static> {
13632        type Narrowed<'de> = SecureMemAddSecureHeapPhysicalRangeRequest<'de>;
13633
13634        #[inline]
13635        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13636            ::fidl_next::munge!(let Self { table } = out);
13637            ::fidl_next::wire::Table::zero_padding(table);
13638        }
13639    }
13640
13641    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemAddSecureHeapPhysicalRangeRequest<'de>
13642    where
13643        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13644    {
13645        fn decode(
13646            slot: ::fidl_next::Slot<'_, Self>,
13647            decoder: &mut ___D,
13648            _: (),
13649        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13650            ::fidl_next::munge!(let Self { table } = slot);
13651
13652            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13653                match ordinal {
13654                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13655
13656                    1 => {
13657                        ::fidl_next::wire::Envelope::decode_as::<
13658                            ___D,
13659                            crate::wire::SecureHeapAndRange<'de>,
13660                        >(slot.as_mut(), decoder, ())?;
13661
13662                        Ok(())
13663                    }
13664
13665                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13666                }
13667            })
13668        }
13669    }
13670
13671    impl<'de> SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13672        pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13673            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13674        }
13675
13676        pub fn take_heap_range(
13677            &mut self,
13678        ) -> ::core::option::Option<crate::wire::SecureHeapAndRange<'de>> {
13679            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13680        }
13681    }
13682
13683    impl<'de> ::core::fmt::Debug for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13684        fn fmt(
13685            &self,
13686            f: &mut ::core::fmt::Formatter<'_>,
13687        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13688            f.debug_struct("SecureMemAddSecureHeapPhysicalRangeRequest")
13689                .field("heap_range", &self.heap_range())
13690                .finish()
13691        }
13692    }
13693
13694    impl<'de> ::fidl_next::IntoNatural for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13695        type Natural = crate::natural::SecureMemAddSecureHeapPhysicalRangeRequest;
13696    }
13697
13698    /// The wire type corresponding to [`SecureMemAddSecureHeapPhysicalRangeResponse`].
13699    pub type SecureMemAddSecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13700
13701    /// The wire type corresponding to [`SecureMemDeleteSecureHeapPhysicalRangeRequest`].
13702    #[repr(C)]
13703    pub struct SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13704        pub(crate) table: ::fidl_next::wire::Table<'de>,
13705    }
13706
13707    impl<'de> Drop for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13708        fn drop(&mut self) {
13709            let _ = self.table.get(1).map(|envelope| unsafe {
13710                envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13711            });
13712        }
13713    }
13714
13715    impl ::fidl_next::Constrained for SecureMemDeleteSecureHeapPhysicalRangeRequest<'_> {
13716        type Constraint = ();
13717
13718        fn validate(
13719            _: ::fidl_next::Slot<'_, Self>,
13720            _: Self::Constraint,
13721        ) -> Result<(), ::fidl_next::ValidationError> {
13722            Ok(())
13723        }
13724    }
13725
13726    unsafe impl ::fidl_next::Wire for SecureMemDeleteSecureHeapPhysicalRangeRequest<'static> {
13727        type Narrowed<'de> = SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>;
13728
13729        #[inline]
13730        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13731            ::fidl_next::munge!(let Self { table } = out);
13732            ::fidl_next::wire::Table::zero_padding(table);
13733        }
13734    }
13735
13736    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13737        for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>
13738    where
13739        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13740    {
13741        fn decode(
13742            slot: ::fidl_next::Slot<'_, Self>,
13743            decoder: &mut ___D,
13744            _: (),
13745        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13746            ::fidl_next::munge!(let Self { table } = slot);
13747
13748            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13749                match ordinal {
13750                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13751
13752                    1 => {
13753                        ::fidl_next::wire::Envelope::decode_as::<
13754                            ___D,
13755                            crate::wire::SecureHeapAndRange<'de>,
13756                        >(slot.as_mut(), decoder, ())?;
13757
13758                        Ok(())
13759                    }
13760
13761                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13762                }
13763            })
13764        }
13765    }
13766
13767    impl<'de> SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13768        pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13769            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13770        }
13771
13772        pub fn take_heap_range(
13773            &mut self,
13774        ) -> ::core::option::Option<crate::wire::SecureHeapAndRange<'de>> {
13775            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13776        }
13777    }
13778
13779    impl<'de> ::core::fmt::Debug for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13780        fn fmt(
13781            &self,
13782            f: &mut ::core::fmt::Formatter<'_>,
13783        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13784            f.debug_struct("SecureMemDeleteSecureHeapPhysicalRangeRequest")
13785                .field("heap_range", &self.heap_range())
13786                .finish()
13787        }
13788    }
13789
13790    impl<'de> ::fidl_next::IntoNatural for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13791        type Natural = crate::natural::SecureMemDeleteSecureHeapPhysicalRangeRequest;
13792    }
13793
13794    /// The wire type corresponding to [`SecureMemDeleteSecureHeapPhysicalRangeResponse`].
13795    pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13796
13797    /// The wire type corresponding to [`SecureMemModifySecureHeapPhysicalRangeRequest`].
13798    #[repr(C)]
13799    pub struct SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13800        pub(crate) table: ::fidl_next::wire::Table<'de>,
13801    }
13802
13803    impl<'de> Drop for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13804        fn drop(&mut self) {
13805            let _ = self.table.get(1).map(|envelope| unsafe {
13806                envelope.read_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
13807            });
13808        }
13809    }
13810
13811    impl ::fidl_next::Constrained for SecureMemModifySecureHeapPhysicalRangeRequest<'_> {
13812        type Constraint = ();
13813
13814        fn validate(
13815            _: ::fidl_next::Slot<'_, Self>,
13816            _: Self::Constraint,
13817        ) -> Result<(), ::fidl_next::ValidationError> {
13818            Ok(())
13819        }
13820    }
13821
13822    unsafe impl ::fidl_next::Wire for SecureMemModifySecureHeapPhysicalRangeRequest<'static> {
13823        type Narrowed<'de> = SecureMemModifySecureHeapPhysicalRangeRequest<'de>;
13824
13825        #[inline]
13826        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13827            ::fidl_next::munge!(let Self { table } = out);
13828            ::fidl_next::wire::Table::zero_padding(table);
13829        }
13830    }
13831
13832    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13833        for SecureMemModifySecureHeapPhysicalRangeRequest<'de>
13834    where
13835        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13836    {
13837        fn decode(
13838            slot: ::fidl_next::Slot<'_, Self>,
13839            decoder: &mut ___D,
13840            _: (),
13841        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13842            ::fidl_next::munge!(let Self { table } = slot);
13843
13844            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13845                match ordinal {
13846                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13847
13848                    1 => {
13849                        ::fidl_next::wire::Envelope::decode_as::<
13850                            ___D,
13851                            crate::wire::SecureHeapAndRangeModification<'de>,
13852                        >(slot.as_mut(), decoder, ())?;
13853
13854                        Ok(())
13855                    }
13856
13857                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13858                }
13859            })
13860        }
13861    }
13862
13863    impl<'de> SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13864        pub fn range_modification(
13865            &self,
13866        ) -> ::core::option::Option<&crate::wire::SecureHeapAndRangeModification<'de>> {
13867            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13868        }
13869
13870        pub fn take_range_modification(
13871            &mut self,
13872        ) -> ::core::option::Option<crate::wire::SecureHeapAndRangeModification<'de>> {
13873            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13874        }
13875    }
13876
13877    impl<'de> ::core::fmt::Debug for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13878        fn fmt(
13879            &self,
13880            f: &mut ::core::fmt::Formatter<'_>,
13881        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13882            f.debug_struct("SecureMemModifySecureHeapPhysicalRangeRequest")
13883                .field("range_modification", &self.range_modification())
13884                .finish()
13885        }
13886    }
13887
13888    impl<'de> ::fidl_next::IntoNatural for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13889        type Natural = crate::natural::SecureMemModifySecureHeapPhysicalRangeRequest;
13890    }
13891
13892    /// The wire type corresponding to [`SecureMemModifySecureHeapPhysicalRangeResponse`].
13893    pub type SecureMemModifySecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13894
13895    /// The wire type corresponding to [`SecureMemZeroSubRangeRequest`].
13896    #[repr(C)]
13897    pub struct SecureMemZeroSubRangeRequest<'de> {
13898        pub(crate) table: ::fidl_next::wire::Table<'de>,
13899    }
13900
13901    impl<'de> Drop for SecureMemZeroSubRangeRequest<'de> {
13902        fn drop(&mut self) {
13903            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
13904
13905            let _ = self.table.get(2).map(|envelope| unsafe {
13906                envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13907            });
13908        }
13909    }
13910
13911    impl ::fidl_next::Constrained for SecureMemZeroSubRangeRequest<'_> {
13912        type Constraint = ();
13913
13914        fn validate(
13915            _: ::fidl_next::Slot<'_, Self>,
13916            _: Self::Constraint,
13917        ) -> Result<(), ::fidl_next::ValidationError> {
13918            Ok(())
13919        }
13920    }
13921
13922    unsafe impl ::fidl_next::Wire for SecureMemZeroSubRangeRequest<'static> {
13923        type Narrowed<'de> = SecureMemZeroSubRangeRequest<'de>;
13924
13925        #[inline]
13926        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13927            ::fidl_next::munge!(let Self { table } = out);
13928            ::fidl_next::wire::Table::zero_padding(table);
13929        }
13930    }
13931
13932    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemZeroSubRangeRequest<'de>
13933    where
13934        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13935    {
13936        fn decode(
13937            slot: ::fidl_next::Slot<'_, Self>,
13938            decoder: &mut ___D,
13939            _: (),
13940        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13941            ::fidl_next::munge!(let Self { table } = slot);
13942
13943            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13944                match ordinal {
13945                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13946
13947                    1 => {
13948                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
13949                            slot.as_mut(),
13950                            decoder,
13951                            (),
13952                        )?;
13953
13954                        Ok(())
13955                    }
13956
13957                    2 => {
13958                        ::fidl_next::wire::Envelope::decode_as::<
13959                            ___D,
13960                            crate::wire::SecureHeapAndRange<'de>,
13961                        >(slot.as_mut(), decoder, ())?;
13962
13963                        Ok(())
13964                    }
13965
13966                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13967                }
13968            })
13969        }
13970    }
13971
13972    impl<'de> SecureMemZeroSubRangeRequest<'de> {
13973        pub fn is_covering_range_explicit(&self) -> ::core::option::Option<&bool> {
13974            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13975        }
13976
13977        pub fn take_is_covering_range_explicit(&mut self) -> ::core::option::Option<bool> {
13978            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13979        }
13980
13981        pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13982            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13983        }
13984
13985        pub fn take_heap_range(
13986            &mut self,
13987        ) -> ::core::option::Option<crate::wire::SecureHeapAndRange<'de>> {
13988            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
13989        }
13990    }
13991
13992    impl<'de> ::core::fmt::Debug for SecureMemZeroSubRangeRequest<'de> {
13993        fn fmt(
13994            &self,
13995            f: &mut ::core::fmt::Formatter<'_>,
13996        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13997            f.debug_struct("SecureMemZeroSubRangeRequest")
13998                .field("is_covering_range_explicit", &self.is_covering_range_explicit())
13999                .field("heap_range", &self.heap_range())
14000                .finish()
14001        }
14002    }
14003
14004    impl<'de> ::fidl_next::IntoNatural for SecureMemZeroSubRangeRequest<'de> {
14005        type Natural = crate::natural::SecureMemZeroSubRangeRequest;
14006    }
14007
14008    /// The wire type corresponding to [`SecureMemZeroSubRangeResponse`].
14009    pub type SecureMemZeroSubRangeResponse = ::fidl_next::wire::Unit;
14010}
14011
14012pub mod wire_optional {}
14013
14014pub mod generic {
14015
14016    /// The generic type corresponding to [`PixelFormatAndModifier`].
14017    pub struct PixelFormatAndModifier<T0, T1> {
14018        pub pixel_format: T0,
14019
14020        pub pixel_format_modifier: T1,
14021    }
14022
14023    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>
14024        for PixelFormatAndModifier<T0, T1>
14025    where
14026        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14027        T0: ::fidl_next::Encode<::fidl_next_common_fuchsia_images2::wire::PixelFormat, ___E>,
14028        T1: ::fidl_next::Encode<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier, ___E>,
14029    {
14030        #[inline]
14031        fn encode(
14032            self,
14033            encoder_: &mut ___E,
14034            out_: &mut ::core::mem::MaybeUninit<crate::wire::PixelFormatAndModifier>,
14035            _: (),
14036        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14037            ::fidl_next::munge! {
14038                let crate::wire::PixelFormatAndModifier {
14039                    pixel_format,
14040                    pixel_format_modifier,
14041
14042                } = out_;
14043            }
14044
14045            ::fidl_next::Encode::encode(self.pixel_format, encoder_, pixel_format, ())?;
14046
14047            ::fidl_next::Encode::encode(
14048                self.pixel_format_modifier,
14049                encoder_,
14050                pixel_format_modifier,
14051                (),
14052            )?;
14053
14054            Ok(())
14055        }
14056    }
14057
14058    /// The generic type corresponding to [`NodeSyncResponse`].
14059    pub type NodeSyncResponse = ();
14060
14061    /// The generic type corresponding to [`BufferCollectionCheckAllBuffersAllocatedResponse`].
14062    pub type BufferCollectionCheckAllBuffersAllocatedResponse = ();
14063
14064    /// The generic type corresponding to [`SecureMemAddSecureHeapPhysicalRangeResponse`].
14065    pub type SecureMemAddSecureHeapPhysicalRangeResponse = ();
14066
14067    /// The generic type corresponding to [`SecureMemDeleteSecureHeapPhysicalRangeResponse`].
14068    pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ();
14069
14070    /// The generic type corresponding to [`SecureMemModifySecureHeapPhysicalRangeResponse`].
14071    pub type SecureMemModifySecureHeapPhysicalRangeResponse = ();
14072
14073    /// The generic type corresponding to [`SecureMemZeroSubRangeResponse`].
14074    pub type SecureMemZeroSubRangeResponse = ();
14075}
14076
14077pub use self::natural::*;
14078
14079#[doc = " The max length in bytes of the `name` request field in\n [`fuchsia.sysmem2/Allocator.SetDebugClientInfo`] and\n [`fuchsia.sysmem2/Node.SetDebugClientInfo`].\n"]
14080pub const MAX_CLIENT_NAME_LENGTH: i32 = 256 as i32;
14081
14082#[doc = " The maximum size of\n [`fuchsia.sysmem2/BufferMemoryConstraints.permitted_heaps`].\n"]
14083pub const MAX_COUNT_BUFFER_MEMORY_CONSTRAINTS_PERMITTED_HEAPS: u32 = 64 as u32;
14084
14085#[doc = " The maximum size of [`fuchsia.sysmem2/ImageFormatConstraints.color_spaces`].\n"]
14086pub const MAX_COUNT_IMAGE_FORMAT_CONSTRAINTS_COLOR_SPACES: u32 = 32 as u32;
14087
14088#[doc = " The maximum size of\n [`fuchsia.sysmem2/ImageFormatConstraints.pixel_format_and_modifiers`].\n"]
14089pub const MAX_COUNT_PIXEL_FORMAT_AND_MODIFIERS: u32 = 64 as u32;
14090
14091pub const MAX_COUNT_IMAGE_FORMAT_CONSTRAINTS_REQUIRED_MAX_SIZE_LIST: u32 = 64 as u32;
14092
14093#[doc = " The maximum size of\n [`fuchsia.sysmem2/BufferCollectionConstraints.image_format_constraints`].\n"]
14094pub const MAX_COUNT_BUFFER_COLLECTION_CONSTRAINTS_IMAGE_FORMAT_CONSTRAINTS: u32 = 64 as u32;
14095
14096#[doc = " The maximum entries that can be in the\n [`fuchsia.sysmem2/BufferCollectionInfo.buffers`] field.\n"]
14097pub const MAX_COUNT_BUFFER_COLLECTION_INFO_BUFFERS: u32 = 128 as u32;
14098
14099pub const MAX_COUNT_DUPLICATES: u32 = 64 as u32;
14100
14101#[doc = " The maximum number of token children of an OR group that can be created per\n call to [`fuchsia.sysmem2/BufferCollectionTokenGroup.CreateChildrenSync`].\n\n Actually creating this many children isn\'t recommended in most typical\n scenarios, but isn\'t prevented, for testing reasons, and just in case an\n unusual scenario needs it. Mitigation of potentially high time complexity in\n sysmem will limit the actual number of group child combinations considered\n in aggregation attempts to a separate maximum that is not settable via\n sysmem protocols. The maximum number of total nodes in a sysmem token tree\n is limited to a separate maximum that is not settable via these protocols.\n"]
14102pub const MAX_COUNT_CREATE_CHILDREN: i32 = 64 as i32;
14103
14104pub const CPU_USAGE_READ: u32 = 1 as u32;
14105
14106pub const CPU_USAGE_READ_OFTEN: u32 = 2 as u32;
14107
14108pub const CPU_USAGE_WRITE: u32 = 4 as u32;
14109
14110pub const CPU_USAGE_WRITE_OFTEN: u32 = 8 as u32;
14111
14112pub const DISPLAY_USAGE_CURSOR: u32 = 2 as u32;
14113
14114pub const DISPLAY_USAGE_LAYER: u32 = 1 as u32;
14115
14116pub const MAX_HEAPS_COUNT: u32 = 32 as u32;
14117
14118pub const MAX_RANGES_COUNT: u32 = 128 as u32;
14119
14120pub const NONE_USAGE: u32 = 1 as u32;
14121
14122pub const NONE_USAGE_PERMIT_ALLOCATION: u32 = 2 as u32;
14123
14124/// The type corresponding to the SecureMem protocol.
14125#[doc = " SecureMem\n\n The client is sysmem.  The server is securemem driver.\n\n TEE - Trusted Execution Environment.\n\n REE - Rich Execution Environment.\n\n Enables sysmem to call the securemem driver to get any secure heaps\n configured via the TEE (or via the securemem driver), and set any physical\n secure heaps configured via sysmem.\n\n Presently, dynamically-allocated secure heaps are configured via sysmem, as\n it starts quite early during boot and can successfully reserve contiguous\n physical memory.  Presently, fixed-location secure heaps are configured via\n TEE, as the plumbing goes from the bootloader to the TEE.  However, this\n protocol intentionally doesn\'t care which heaps are dynamically-allocated\n and which are fixed-location.\n"]
14126#[derive(PartialEq, Debug)]
14127pub struct SecureMem;
14128
14129#[cfg(target_os = "fuchsia")]
14130impl ::fidl_next::HasTransport for SecureMem {
14131    type Transport = ::fidl_next::fuchsia::zx::Channel;
14132}
14133
14134pub mod secure_mem {
14135    pub mod prelude {
14136        pub use crate::{
14137            SecureMem, SecureMemClientHandler, SecureMemLocalClientHandler,
14138            SecureMemLocalServerHandler, SecureMemServerHandler, secure_mem,
14139        };
14140
14141        pub use crate::natural::Error;
14142
14143        pub use crate::natural::SecureMemAddSecureHeapPhysicalRangeRequest;
14144
14145        pub use crate::natural::SecureMemDeleteSecureHeapPhysicalRangeRequest;
14146
14147        pub use crate::natural::SecureMemGetPhysicalSecureHeapPropertiesRequest;
14148
14149        pub use crate::natural::SecureMemModifySecureHeapPhysicalRangeRequest;
14150
14151        pub use crate::natural::SecureMemZeroSubRangeRequest;
14152
14153        pub use crate::natural::SecureMemAddSecureHeapPhysicalRangeResponse;
14154
14155        pub use crate::natural::SecureMemDeleteSecureHeapPhysicalRangeResponse;
14156
14157        pub use crate::natural::SecureMemGetDynamicSecureHeapsResponse;
14158
14159        pub use crate::natural::SecureMemGetPhysicalSecureHeapPropertiesResponse;
14160
14161        pub use crate::natural::SecureMemGetPhysicalSecureHeapsResponse;
14162
14163        pub use crate::natural::SecureMemModifySecureHeapPhysicalRangeResponse;
14164
14165        pub use crate::natural::SecureMemZeroSubRangeResponse;
14166    }
14167
14168    pub struct GetPhysicalSecureHeaps;
14169
14170    impl ::fidl_next::Method for GetPhysicalSecureHeaps {
14171        const ORDINAL: u64 = 4067140791638717411;
14172        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14173            ::fidl_next::protocol::Flexibility::Flexible;
14174
14175        type Protocol = crate::SecureMem;
14176
14177        type Request = ::fidl_next::wire::EmptyMessageBody;
14178    }
14179
14180    impl ::fidl_next::TwoWayMethod for GetPhysicalSecureHeaps {
14181        type Response = ::fidl_next::wire::Result<
14182            'static,
14183            crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
14184            crate::wire::Error,
14185        >;
14186    }
14187
14188    impl<___R> ::fidl_next::Respond<___R> for GetPhysicalSecureHeaps {
14189        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14190
14191        fn respond(response: ___R) -> Self::Output {
14192            ::core::result::Result::Ok(response)
14193        }
14194    }
14195
14196    impl<___R> ::fidl_next::RespondErr<___R> for GetPhysicalSecureHeaps {
14197        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14198
14199        fn respond_err(response: ___R) -> Self::Output {
14200            ::core::result::Result::Err(response)
14201        }
14202    }
14203
14204    pub struct GetDynamicSecureHeaps;
14205
14206    impl ::fidl_next::Method for GetDynamicSecureHeaps {
14207        const ORDINAL: u64 = 1265657178863511604;
14208        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14209            ::fidl_next::protocol::Flexibility::Flexible;
14210
14211        type Protocol = crate::SecureMem;
14212
14213        type Request = ::fidl_next::wire::EmptyMessageBody;
14214    }
14215
14216    impl ::fidl_next::TwoWayMethod for GetDynamicSecureHeaps {
14217        type Response = ::fidl_next::wire::Result<
14218            'static,
14219            crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
14220            crate::wire::Error,
14221        >;
14222    }
14223
14224    impl<___R> ::fidl_next::Respond<___R> for GetDynamicSecureHeaps {
14225        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14226
14227        fn respond(response: ___R) -> Self::Output {
14228            ::core::result::Result::Ok(response)
14229        }
14230    }
14231
14232    impl<___R> ::fidl_next::RespondErr<___R> for GetDynamicSecureHeaps {
14233        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14234
14235        fn respond_err(response: ___R) -> Self::Output {
14236            ::core::result::Result::Err(response)
14237        }
14238    }
14239
14240    pub struct GetPhysicalSecureHeapProperties;
14241
14242    impl ::fidl_next::Method for GetPhysicalSecureHeapProperties {
14243        const ORDINAL: u64 = 895942034471897020;
14244        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14245            ::fidl_next::protocol::Flexibility::Flexible;
14246
14247        type Protocol = crate::SecureMem;
14248
14249        type Request = crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>;
14250    }
14251
14252    impl ::fidl_next::TwoWayMethod for GetPhysicalSecureHeapProperties {
14253        type Response = ::fidl_next::wire::Result<
14254            'static,
14255            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
14256            crate::wire::Error,
14257        >;
14258    }
14259
14260    impl<___R> ::fidl_next::Respond<___R> for GetPhysicalSecureHeapProperties {
14261        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14262
14263        fn respond(response: ___R) -> Self::Output {
14264            ::core::result::Result::Ok(response)
14265        }
14266    }
14267
14268    impl<___R> ::fidl_next::RespondErr<___R> for GetPhysicalSecureHeapProperties {
14269        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14270
14271        fn respond_err(response: ___R) -> Self::Output {
14272            ::core::result::Result::Err(response)
14273        }
14274    }
14275
14276    pub struct AddSecureHeapPhysicalRange;
14277
14278    impl ::fidl_next::Method for AddSecureHeapPhysicalRange {
14279        const ORDINAL: u64 = 3888459953148993914;
14280        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14281            ::fidl_next::protocol::Flexibility::Flexible;
14282
14283        type Protocol = crate::SecureMem;
14284
14285        type Request = crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>;
14286    }
14287
14288    impl ::fidl_next::TwoWayMethod for AddSecureHeapPhysicalRange {
14289        type Response = ::fidl_next::wire::Result<
14290            'static,
14291            crate::wire::SecureMemAddSecureHeapPhysicalRangeResponse,
14292            crate::wire::Error,
14293        >;
14294    }
14295
14296    impl<___R> ::fidl_next::Respond<___R> for AddSecureHeapPhysicalRange {
14297        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14298
14299        fn respond(response: ___R) -> Self::Output {
14300            ::core::result::Result::Ok(response)
14301        }
14302    }
14303
14304    impl<___R> ::fidl_next::RespondErr<___R> for AddSecureHeapPhysicalRange {
14305        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14306
14307        fn respond_err(response: ___R) -> Self::Output {
14308            ::core::result::Result::Err(response)
14309        }
14310    }
14311
14312    pub struct DeleteSecureHeapPhysicalRange;
14313
14314    impl ::fidl_next::Method for DeleteSecureHeapPhysicalRange {
14315        const ORDINAL: u64 = 1056754671343258782;
14316        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14317            ::fidl_next::protocol::Flexibility::Flexible;
14318
14319        type Protocol = crate::SecureMem;
14320
14321        type Request = crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>;
14322    }
14323
14324    impl ::fidl_next::TwoWayMethod for DeleteSecureHeapPhysicalRange {
14325        type Response = ::fidl_next::wire::Result<
14326            'static,
14327            crate::wire::SecureMemDeleteSecureHeapPhysicalRangeResponse,
14328            crate::wire::Error,
14329        >;
14330    }
14331
14332    impl<___R> ::fidl_next::Respond<___R> for DeleteSecureHeapPhysicalRange {
14333        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14334
14335        fn respond(response: ___R) -> Self::Output {
14336            ::core::result::Result::Ok(response)
14337        }
14338    }
14339
14340    impl<___R> ::fidl_next::RespondErr<___R> for DeleteSecureHeapPhysicalRange {
14341        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14342
14343        fn respond_err(response: ___R) -> Self::Output {
14344            ::core::result::Result::Err(response)
14345        }
14346    }
14347
14348    pub struct ModifySecureHeapPhysicalRange;
14349
14350    impl ::fidl_next::Method for ModifySecureHeapPhysicalRange {
14351        const ORDINAL: u64 = 6969114310578042676;
14352        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14353            ::fidl_next::protocol::Flexibility::Flexible;
14354
14355        type Protocol = crate::SecureMem;
14356
14357        type Request = crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>;
14358    }
14359
14360    impl ::fidl_next::TwoWayMethod for ModifySecureHeapPhysicalRange {
14361        type Response = ::fidl_next::wire::Result<
14362            'static,
14363            crate::wire::SecureMemModifySecureHeapPhysicalRangeResponse,
14364            crate::wire::Error,
14365        >;
14366    }
14367
14368    impl<___R> ::fidl_next::Respond<___R> for ModifySecureHeapPhysicalRange {
14369        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14370
14371        fn respond(response: ___R) -> Self::Output {
14372            ::core::result::Result::Ok(response)
14373        }
14374    }
14375
14376    impl<___R> ::fidl_next::RespondErr<___R> for ModifySecureHeapPhysicalRange {
14377        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14378
14379        fn respond_err(response: ___R) -> Self::Output {
14380            ::core::result::Result::Err(response)
14381        }
14382    }
14383
14384    pub struct ZeroSubRange;
14385
14386    impl ::fidl_next::Method for ZeroSubRange {
14387        const ORDINAL: u64 = 6567857461132811493;
14388        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14389            ::fidl_next::protocol::Flexibility::Flexible;
14390
14391        type Protocol = crate::SecureMem;
14392
14393        type Request = crate::wire::SecureMemZeroSubRangeRequest<'static>;
14394    }
14395
14396    impl ::fidl_next::TwoWayMethod for ZeroSubRange {
14397        type Response = ::fidl_next::wire::Result<
14398            'static,
14399            crate::wire::SecureMemZeroSubRangeResponse,
14400            crate::wire::Error,
14401        >;
14402    }
14403
14404    impl<___R> ::fidl_next::Respond<___R> for ZeroSubRange {
14405        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14406
14407        fn respond(response: ___R) -> Self::Output {
14408            ::core::result::Result::Ok(response)
14409        }
14410    }
14411
14412    impl<___R> ::fidl_next::RespondErr<___R> for ZeroSubRange {
14413        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14414
14415        fn respond_err(response: ___R) -> Self::Output {
14416            ::core::result::Result::Err(response)
14417        }
14418    }
14419
14420    mod ___detail {
14421        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::SecureMem
14422        where
14423            ___T: ::fidl_next::Transport,
14424        {
14425            type Client = SecureMemClient<___T>;
14426            type Server = SecureMemServer<___T>;
14427        }
14428
14429        /// The client for the `SecureMem` protocol.
14430        #[repr(transparent)]
14431        pub struct SecureMemClient<___T: ::fidl_next::Transport> {
14432            #[allow(dead_code)]
14433            client: ::fidl_next::protocol::Client<___T>,
14434        }
14435
14436        impl<___T> SecureMemClient<___T>
14437        where
14438            ___T: ::fidl_next::Transport,
14439        {
14440            #[doc = " Gets the physical address and length of any secure heap whose physical\n range is configured via the TEE.\n\n Presently, these will be fixed physical addresses and lengths, with the\n location plumbed via the TEE.\n\n This is preferred over [\'fuchsia.hardware.sysmem.Sysmem/RegisterHeap\']\n when there isn\'t any special heap-specific per-VMO setup or teardown\n required.\n\n The physical range must be secured/protected by the TEE before the\n securemem driver responds to this request with success.\n\n Sysmem should only call this once.  Returning zero heaps is not a\n failure.\n\n Errors:\n  * PROTOCOL_DEVIATION - called more than once.\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14441            pub fn get_physical_secure_heaps(
14442                &self,
14443            ) -> ::fidl_next::TwoWayFuture<'_, super::GetPhysicalSecureHeaps, ___T> {
14444                ::fidl_next::TwoWayFuture::from_untyped(
14445                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
14446                        4067140791638717411,
14447                        <super::GetPhysicalSecureHeaps as ::fidl_next::Method>::FLEXIBILITY,
14448                        (),
14449                    ),
14450                )
14451            }
14452
14453            #[doc = " Gets information about any secure heaps whose physical pages are not\n configured by the TEE, but by sysmem.\n\n Sysmem should only call this once. Returning zero heaps is not a\n failure.\n\n Errors:\n  * PROTOCOL_DEVIATION - called more than once.\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14454            pub fn get_dynamic_secure_heaps(
14455                &self,
14456            ) -> ::fidl_next::TwoWayFuture<'_, super::GetDynamicSecureHeaps, ___T> {
14457                ::fidl_next::TwoWayFuture::from_untyped(
14458                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
14459                        1265657178863511604,
14460                        <super::GetDynamicSecureHeaps as ::fidl_next::Method>::FLEXIBILITY,
14461                        (),
14462                    ),
14463                )
14464            }
14465
14466            #[doc = " This request from sysmem to the securemem driver gets the properties of\n a protected/secure heap.\n\n This only handles heaps with a single contiguous physical extent.\n\n The heap\'s entire physical range is indicated in case this request needs\n some physical space to auto-detect how many ranges are REE-usable.  Any\n temporary HW protection ranges will be deleted before this request\n completes.\n\n Errors:\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14467            pub fn get_physical_secure_heap_properties_with<___R>(
14468                &self,
14469                request: ___R,
14470            ) -> ::fidl_next::TwoWayFuture<'_, super::GetPhysicalSecureHeapProperties, ___T>
14471            where
14472                ___R: ::fidl_next::Encode<
14473                        crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
14474                        <___T as ::fidl_next::Transport>::SendBuffer,
14475                    >,
14476            {
14477                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14478                    895942034471897020,
14479                    <super::GetPhysicalSecureHeapProperties as ::fidl_next::Method>::FLEXIBILITY,
14480                    request,
14481                ))
14482            }
14483
14484            #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to add, for a heap whose physical range(s) are set up via\n sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure all the covered offsets as protected\n before responding to this message with success.\n\n On failure, the securemem driver must ensure the protected range was not\n created.\n\n Sysmem must only call this up to once if dynamic_protection_ranges\n false.\n\n If dynamic_protection_ranges is true, sysmem can call this multiple\n times as long as the current number of ranges never exceeds\n max_protected_range_count.\n\n The caller must not attempt to add a range that matches an\n already-existing range.  Added ranges can overlap each other as long as\n no two ranges match exactly.\n\n Errors:\n   * PROTOCOL_DEVIATION - called more than once when\n     !dynamic_protection_ranges.  Adding a heap that would cause overall\n     heap count to exceed max_protected_range_count. Unexpected heap, or\n     range that doesn\'t conform to protected_range_granularity. See log.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14485            pub fn add_secure_heap_physical_range_with<___R>(
14486                &self,
14487                request: ___R,
14488            ) -> ::fidl_next::TwoWayFuture<'_, super::AddSecureHeapPhysicalRange, ___T>
14489            where
14490                ___R: ::fidl_next::Encode<
14491                        crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
14492                        <___T as ::fidl_next::Transport>::SendBuffer,
14493                    >,
14494            {
14495                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14496                    3888459953148993914,
14497                    <super::AddSecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
14498                    request,
14499                ))
14500            }
14501
14502            #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to delete, for a heap whose physical range(s) are set up via\n sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure all the covered offsets as not\n protected before responding to this message with success.\n\n On failure, the securemem driver must ensure the protected range was not\n deleted.\n\n Sysmem must not call this if dynamic_protection_ranges false.\n\n If dynamic_protection_ranges is true, sysmem can call this repeatedly,\n on various ranges that exist at the time of the call.\n\n If any portion of the range being deleted is not also covered by another\n protected range, then any ongoing DMA to any part of the entire range\n may be interrupted / may fail, potentially in a way that\'s disruptive to\n the entire system (bus lockup or similar, depending on device details).\n Therefore, the caller must ensure that no ongoing DMA is occurring to\n any portion of the range being deleted, unless the caller has other\n active ranges covering every block of the range being deleted.  Ongoing\n DMA to/from blocks outside the range being deleted is never impacted by\n the deletion.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap, or range that doesn\'t conform to\n     protected_range_granularity.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * NOT_FOUND - the specified range is not found.\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14503            pub fn delete_secure_heap_physical_range_with<___R>(
14504                &self,
14505                request: ___R,
14506            ) -> ::fidl_next::TwoWayFuture<'_, super::DeleteSecureHeapPhysicalRange, ___T>
14507            where
14508                ___R: ::fidl_next::Encode<
14509                        crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
14510                        <___T as ::fidl_next::Transport>::SendBuffer,
14511                    >,
14512            {
14513                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14514                    1056754671343258782,
14515                    <super::DeleteSecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
14516                    request,
14517                ))
14518            }
14519
14520            #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to modify and its new base and length, for a heap whose physical\n range(s) are set up via sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure the range to cover only the new\n offsets before responding to this message with success.\n\n On failure, the securemem driver must ensure the range was not changed.\n\n Sysmem must not call this if dynamic_protection_ranges false.  Sysmem\n must not call this if !is_mod_protected_range_available.\n\n If dynamic_protection_ranges is true, sysmem can call this repeatedly,\n on various ranges that exist at the time of the call.\n\n The range must only be modified at one end or the other, but not both.\n If the range is getting shorter, and the un-covered blocks are not\n covered by other active ranges, any ongoing DMA to the entire range\n that\'s geting shorter may fail in a way that disrupts the entire system\n (bus lockup or similar), so the caller must ensure that no DMA is\n ongoing to any portion of a range that is getting shorter, unless the\n blocks being un-covered by the modification to this range are all\n covered by other active ranges, in which case no disruption to ongoing\n DMA will occur.\n\n If a range is modified to become <= zero length, the range is deleted.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap, or old_range or new_range that doesn\'t conform to\n     protected_range_granularity, or old_range and new_range differ in\n     both begin and end (disallowed).\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * NOT_FOUND - the specified range is not found.\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14521            pub fn modify_secure_heap_physical_range_with<___R>(
14522                &self,
14523                request: ___R,
14524            ) -> ::fidl_next::TwoWayFuture<'_, super::ModifySecureHeapPhysicalRange, ___T>
14525            where
14526                ___R: ::fidl_next::Encode<
14527                        crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
14528                        <___T as ::fidl_next::Transport>::SendBuffer,
14529                    >,
14530            {
14531                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14532                    6969114310578042676,
14533                    <super::ModifySecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
14534                    request,
14535                ))
14536            }
14537
14538            #[doc = " Zero a sub-range of a currently-existing physical range added via\n AddSecureHeapPhysicalRange().  The sub-range must be fully covered by\n exactly one physical range, and must not overlap with any other\n physical range.\n\n is_covering_range_explicit - When true, the covering range must be one\n     of the ranges explicitly created via AddSecureHeapPhysicalRange(),\n     possibly modified since.  When false, the covering range must not\n     be one of the ranges explicitly created via\n     AddSecureHeapPhysicalRange(), but the covering range must exist as\n     a covering range not created via AddSecureHeapPhysicalRange().  The\n     covering range is typically the entire physical range (or a range\n     which covers even more) of a heap configured by the TEE and whose\n     configuration is conveyed to sysmem via GetPhysicalSecureHeaps().\n\n Ongoing DMA is not disrupted by this request.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14539            pub fn zero_sub_range_with<___R>(
14540                &self,
14541                request: ___R,
14542            ) -> ::fidl_next::TwoWayFuture<'_, super::ZeroSubRange, ___T>
14543            where
14544                ___R: ::fidl_next::Encode<
14545                        crate::wire::SecureMemZeroSubRangeRequest<'static>,
14546                        <___T as ::fidl_next::Transport>::SendBuffer,
14547                    >,
14548            {
14549                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14550                    6567857461132811493,
14551                    <super::ZeroSubRange as ::fidl_next::Method>::FLEXIBILITY,
14552                    request,
14553                ))
14554            }
14555        }
14556
14557        /// The server for the `SecureMem` protocol.
14558        #[repr(transparent)]
14559        pub struct SecureMemServer<___T: ::fidl_next::Transport> {
14560            server: ::fidl_next::protocol::Server<___T>,
14561        }
14562
14563        impl<___T> SecureMemServer<___T> where ___T: ::fidl_next::Transport {}
14564    }
14565}
14566
14567#[diagnostic::on_unimplemented(
14568    note = "If {Self} implements the non-local SecureMemClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
14569)]
14570
14571/// A client handler for the SecureMem protocol.
14572///
14573/// See [`SecureMem`] for more details.
14574pub trait SecureMemLocalClientHandler<
14575    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14576    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14577>
14578{
14579    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
14580        ::core::future::ready(())
14581    }
14582}
14583
14584impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for SecureMem
14585where
14586    ___H: SecureMemLocalClientHandler<___T>,
14587    ___T: ::fidl_next::Transport,
14588{
14589    async fn on_event(
14590        handler: &mut ___H,
14591        mut message: ::fidl_next::Message<___T>,
14592    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
14593        match *message.header().ordinal {
14594            ordinal => {
14595                handler.on_unknown_interaction(ordinal).await;
14596                if ::core::matches!(
14597                    message.header().flexibility(),
14598                    ::fidl_next::protocol::Flexibility::Strict
14599                ) {
14600                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14601                } else {
14602                    Ok(())
14603                }
14604            }
14605        }
14606    }
14607}
14608
14609#[diagnostic::on_unimplemented(
14610    note = "If {Self} implements the non-local SecureMemServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
14611)]
14612
14613/// A server handler for the SecureMem protocol.
14614///
14615/// See [`SecureMem`] for more details.
14616pub trait SecureMemLocalServerHandler<
14617    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14618    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14619>
14620{
14621    #[doc = " Gets the physical address and length of any secure heap whose physical\n range is configured via the TEE.\n\n Presently, these will be fixed physical addresses and lengths, with the\n location plumbed via the TEE.\n\n This is preferred over [\'fuchsia.hardware.sysmem.Sysmem/RegisterHeap\']\n when there isn\'t any special heap-specific per-VMO setup or teardown\n required.\n\n The physical range must be secured/protected by the TEE before the\n securemem driver responds to this request with success.\n\n Sysmem should only call this once.  Returning zero heaps is not a\n failure.\n\n Errors:\n  * PROTOCOL_DEVIATION - called more than once.\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14622    fn get_physical_secure_heaps(
14623        &mut self,
14624
14625        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
14626    ) -> impl ::core::future::Future<Output = ()>;
14627
14628    #[doc = " Gets information about any secure heaps whose physical pages are not\n configured by the TEE, but by sysmem.\n\n Sysmem should only call this once. Returning zero heaps is not a\n failure.\n\n Errors:\n  * PROTOCOL_DEVIATION - called more than once.\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14629    fn get_dynamic_secure_heaps(
14630        &mut self,
14631
14632        responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
14633    ) -> impl ::core::future::Future<Output = ()>;
14634
14635    #[doc = " This request from sysmem to the securemem driver gets the properties of\n a protected/secure heap.\n\n This only handles heaps with a single contiguous physical extent.\n\n The heap\'s entire physical range is indicated in case this request needs\n some physical space to auto-detect how many ranges are REE-usable.  Any\n temporary HW protection ranges will be deleted before this request\n completes.\n\n Errors:\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14636    fn get_physical_secure_heap_properties(
14637        &mut self,
14638
14639        request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14640
14641        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14642    ) -> impl ::core::future::Future<Output = ()>;
14643
14644    #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to add, for a heap whose physical range(s) are set up via\n sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure all the covered offsets as protected\n before responding to this message with success.\n\n On failure, the securemem driver must ensure the protected range was not\n created.\n\n Sysmem must only call this up to once if dynamic_protection_ranges\n false.\n\n If dynamic_protection_ranges is true, sysmem can call this multiple\n times as long as the current number of ranges never exceeds\n max_protected_range_count.\n\n The caller must not attempt to add a range that matches an\n already-existing range.  Added ranges can overlap each other as long as\n no two ranges match exactly.\n\n Errors:\n   * PROTOCOL_DEVIATION - called more than once when\n     !dynamic_protection_ranges.  Adding a heap that would cause overall\n     heap count to exceed max_protected_range_count. Unexpected heap, or\n     range that doesn\'t conform to protected_range_granularity. See log.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14645    fn add_secure_heap_physical_range(
14646        &mut self,
14647
14648        request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14649
14650        responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14651    ) -> impl ::core::future::Future<Output = ()>;
14652
14653    #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to delete, for a heap whose physical range(s) are set up via\n sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure all the covered offsets as not\n protected before responding to this message with success.\n\n On failure, the securemem driver must ensure the protected range was not\n deleted.\n\n Sysmem must not call this if dynamic_protection_ranges false.\n\n If dynamic_protection_ranges is true, sysmem can call this repeatedly,\n on various ranges that exist at the time of the call.\n\n If any portion of the range being deleted is not also covered by another\n protected range, then any ongoing DMA to any part of the entire range\n may be interrupted / may fail, potentially in a way that\'s disruptive to\n the entire system (bus lockup or similar, depending on device details).\n Therefore, the caller must ensure that no ongoing DMA is occurring to\n any portion of the range being deleted, unless the caller has other\n active ranges covering every block of the range being deleted.  Ongoing\n DMA to/from blocks outside the range being deleted is never impacted by\n the deletion.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap, or range that doesn\'t conform to\n     protected_range_granularity.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * NOT_FOUND - the specified range is not found.\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14654    fn delete_secure_heap_physical_range(
14655        &mut self,
14656
14657        request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14658
14659        responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14660    ) -> impl ::core::future::Future<Output = ()>;
14661
14662    #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to modify and its new base and length, for a heap whose physical\n range(s) are set up via sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure the range to cover only the new\n offsets before responding to this message with success.\n\n On failure, the securemem driver must ensure the range was not changed.\n\n Sysmem must not call this if dynamic_protection_ranges false.  Sysmem\n must not call this if !is_mod_protected_range_available.\n\n If dynamic_protection_ranges is true, sysmem can call this repeatedly,\n on various ranges that exist at the time of the call.\n\n The range must only be modified at one end or the other, but not both.\n If the range is getting shorter, and the un-covered blocks are not\n covered by other active ranges, any ongoing DMA to the entire range\n that\'s geting shorter may fail in a way that disrupts the entire system\n (bus lockup or similar), so the caller must ensure that no DMA is\n ongoing to any portion of a range that is getting shorter, unless the\n blocks being un-covered by the modification to this range are all\n covered by other active ranges, in which case no disruption to ongoing\n DMA will occur.\n\n If a range is modified to become <= zero length, the range is deleted.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap, or old_range or new_range that doesn\'t conform to\n     protected_range_granularity, or old_range and new_range differ in\n     both begin and end (disallowed).\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * NOT_FOUND - the specified range is not found.\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14663    fn modify_secure_heap_physical_range(
14664        &mut self,
14665
14666        request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14667
14668        responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14669    ) -> impl ::core::future::Future<Output = ()>;
14670
14671    #[doc = " Zero a sub-range of a currently-existing physical range added via\n AddSecureHeapPhysicalRange().  The sub-range must be fully covered by\n exactly one physical range, and must not overlap with any other\n physical range.\n\n is_covering_range_explicit - When true, the covering range must be one\n     of the ranges explicitly created via AddSecureHeapPhysicalRange(),\n     possibly modified since.  When false, the covering range must not\n     be one of the ranges explicitly created via\n     AddSecureHeapPhysicalRange(), but the covering range must exist as\n     a covering range not created via AddSecureHeapPhysicalRange().  The\n     covering range is typically the entire physical range (or a range\n     which covers even more) of a heap configured by the TEE and whose\n     configuration is conveyed to sysmem via GetPhysicalSecureHeaps().\n\n Ongoing DMA is not disrupted by this request.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14672    fn zero_sub_range(
14673        &mut self,
14674
14675        request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
14676
14677        responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
14678    ) -> impl ::core::future::Future<Output = ()>;
14679
14680    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
14681        ::core::future::ready(())
14682    }
14683}
14684
14685impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for SecureMem
14686where
14687    ___H: SecureMemLocalServerHandler<___T>,
14688    ___T: ::fidl_next::Transport,
14689    for<'de> crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>: ::fidl_next::Decode<
14690            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14691            Constraint = (),
14692        >,
14693    for<'de> crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14694            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14695            Constraint = (),
14696        >,
14697    for<'de> crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14698            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14699            Constraint = (),
14700        >,
14701    for<'de> crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14702            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14703            Constraint = (),
14704        >,
14705    for<'de> crate::wire::SecureMemZeroSubRangeRequest<'de>: ::fidl_next::Decode<
14706            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14707            Constraint = (),
14708        >,
14709{
14710    async fn on_one_way(
14711        handler: &mut ___H,
14712        mut message: ::fidl_next::Message<___T>,
14713    ) -> ::core::result::Result<
14714        (),
14715        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14716    > {
14717        match *message.header().ordinal {
14718            ordinal => {
14719                handler.on_unknown_interaction(ordinal).await;
14720                if ::core::matches!(
14721                    message.header().flexibility(),
14722                    ::fidl_next::protocol::Flexibility::Strict
14723                ) {
14724                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14725                } else {
14726                    Ok(())
14727                }
14728            }
14729        }
14730    }
14731
14732    async fn on_two_way(
14733        handler: &mut ___H,
14734        mut message: ::fidl_next::Message<___T>,
14735        responder: ::fidl_next::protocol::Responder<___T>,
14736    ) -> ::core::result::Result<
14737        (),
14738        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14739    > {
14740        match *message.header().ordinal {
14741            4067140791638717411 => {
14742                let responder = ::fidl_next::Responder::from_untyped(responder);
14743
14744                handler.get_physical_secure_heaps(responder).await;
14745                Ok(())
14746            }
14747
14748            1265657178863511604 => {
14749                let responder = ::fidl_next::Responder::from_untyped(responder);
14750
14751                handler.get_dynamic_secure_heaps(responder).await;
14752                Ok(())
14753            }
14754
14755            895942034471897020 => {
14756                let responder = ::fidl_next::Responder::from_untyped(responder);
14757
14758                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14759                    Ok(decoded) => {
14760                        handler
14761                            .get_physical_secure_heap_properties(
14762                                ::fidl_next::Request::from_decoded(decoded),
14763                                responder,
14764                            )
14765                            .await;
14766                        Ok(())
14767                    }
14768                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14769                        ordinal: 895942034471897020,
14770                        error,
14771                    }),
14772                }
14773            }
14774
14775            3888459953148993914 => {
14776                let responder = ::fidl_next::Responder::from_untyped(responder);
14777
14778                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14779                    Ok(decoded) => {
14780                        handler
14781                            .add_secure_heap_physical_range(
14782                                ::fidl_next::Request::from_decoded(decoded),
14783                                responder,
14784                            )
14785                            .await;
14786                        Ok(())
14787                    }
14788                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14789                        ordinal: 3888459953148993914,
14790                        error,
14791                    }),
14792                }
14793            }
14794
14795            1056754671343258782 => {
14796                let responder = ::fidl_next::Responder::from_untyped(responder);
14797
14798                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14799                    Ok(decoded) => {
14800                        handler
14801                            .delete_secure_heap_physical_range(
14802                                ::fidl_next::Request::from_decoded(decoded),
14803                                responder,
14804                            )
14805                            .await;
14806                        Ok(())
14807                    }
14808                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14809                        ordinal: 1056754671343258782,
14810                        error,
14811                    }),
14812                }
14813            }
14814
14815            6969114310578042676 => {
14816                let responder = ::fidl_next::Responder::from_untyped(responder);
14817
14818                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14819                    Ok(decoded) => {
14820                        handler
14821                            .modify_secure_heap_physical_range(
14822                                ::fidl_next::Request::from_decoded(decoded),
14823                                responder,
14824                            )
14825                            .await;
14826                        Ok(())
14827                    }
14828                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14829                        ordinal: 6969114310578042676,
14830                        error,
14831                    }),
14832                }
14833            }
14834
14835            6567857461132811493 => {
14836                let responder = ::fidl_next::Responder::from_untyped(responder);
14837
14838                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14839                    Ok(decoded) => {
14840                        handler
14841                            .zero_sub_range(::fidl_next::Request::from_decoded(decoded), responder)
14842                            .await;
14843                        Ok(())
14844                    }
14845                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14846                        ordinal: 6567857461132811493,
14847                        error,
14848                    }),
14849                }
14850            }
14851
14852            ordinal => {
14853                handler.on_unknown_interaction(ordinal).await;
14854                if ::core::matches!(
14855                    message.header().flexibility(),
14856                    ::fidl_next::protocol::Flexibility::Strict
14857                ) {
14858                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14859                } else {
14860                    responder
14861                        .respond_framework_error(
14862                            ordinal,
14863                            ::fidl_next::FrameworkError::UnknownMethod,
14864                        )
14865                        .expect("encoding a framework error should never fail")
14866                        .await?;
14867                    Ok(())
14868                }
14869            }
14870        }
14871    }
14872}
14873
14874/// A client handler for the SecureMem protocol.
14875///
14876/// See [`SecureMem`] for more details.
14877pub trait SecureMemClientHandler<
14878    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14879    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14880>
14881{
14882    fn on_unknown_interaction(
14883        &mut self,
14884        ordinal: u64,
14885    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
14886        ::core::future::ready(())
14887    }
14888}
14889
14890impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for SecureMem
14891where
14892    ___H: SecureMemClientHandler<___T> + ::core::marker::Send,
14893    ___T: ::fidl_next::Transport,
14894{
14895    async fn on_event(
14896        handler: &mut ___H,
14897        mut message: ::fidl_next::Message<___T>,
14898    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
14899        match *message.header().ordinal {
14900            ordinal => {
14901                handler.on_unknown_interaction(ordinal).await;
14902                if ::core::matches!(
14903                    message.header().flexibility(),
14904                    ::fidl_next::protocol::Flexibility::Strict
14905                ) {
14906                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14907                } else {
14908                    Ok(())
14909                }
14910            }
14911        }
14912    }
14913}
14914
14915/// A server handler for the SecureMem protocol.
14916///
14917/// See [`SecureMem`] for more details.
14918pub trait SecureMemServerHandler<
14919    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14920    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14921>
14922{
14923    #[doc = " Gets the physical address and length of any secure heap whose physical\n range is configured via the TEE.\n\n Presently, these will be fixed physical addresses and lengths, with the\n location plumbed via the TEE.\n\n This is preferred over [\'fuchsia.hardware.sysmem.Sysmem/RegisterHeap\']\n when there isn\'t any special heap-specific per-VMO setup or teardown\n required.\n\n The physical range must be secured/protected by the TEE before the\n securemem driver responds to this request with success.\n\n Sysmem should only call this once.  Returning zero heaps is not a\n failure.\n\n Errors:\n  * PROTOCOL_DEVIATION - called more than once.\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14924    fn get_physical_secure_heaps(
14925        &mut self,
14926
14927        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
14928    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14929
14930    #[doc = " Gets information about any secure heaps whose physical pages are not\n configured by the TEE, but by sysmem.\n\n Sysmem should only call this once. Returning zero heaps is not a\n failure.\n\n Errors:\n  * PROTOCOL_DEVIATION - called more than once.\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14931    fn get_dynamic_secure_heaps(
14932        &mut self,
14933
14934        responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
14935    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14936
14937    #[doc = " This request from sysmem to the securemem driver gets the properties of\n a protected/secure heap.\n\n This only handles heaps with a single contiguous physical extent.\n\n The heap\'s entire physical range is indicated in case this request needs\n some physical space to auto-detect how many ranges are REE-usable.  Any\n temporary HW protection ranges will be deleted before this request\n completes.\n\n Errors:\n  * UNSPECIFIED - generic internal error (such as in communication\n    with TEE which doesn\'t generate zx_status_t errors).\n  * other errors are allowed; any other errors should be treated the same\n    as UNSPECIFIED.\n"]
14938    fn get_physical_secure_heap_properties(
14939        &mut self,
14940
14941        request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14942
14943        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14944    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14945
14946    #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to add, for a heap whose physical range(s) are set up via\n sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure all the covered offsets as protected\n before responding to this message with success.\n\n On failure, the securemem driver must ensure the protected range was not\n created.\n\n Sysmem must only call this up to once if dynamic_protection_ranges\n false.\n\n If dynamic_protection_ranges is true, sysmem can call this multiple\n times as long as the current number of ranges never exceeds\n max_protected_range_count.\n\n The caller must not attempt to add a range that matches an\n already-existing range.  Added ranges can overlap each other as long as\n no two ranges match exactly.\n\n Errors:\n   * PROTOCOL_DEVIATION - called more than once when\n     !dynamic_protection_ranges.  Adding a heap that would cause overall\n     heap count to exceed max_protected_range_count. Unexpected heap, or\n     range that doesn\'t conform to protected_range_granularity. See log.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14947    fn add_secure_heap_physical_range(
14948        &mut self,
14949
14950        request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14951
14952        responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14953    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14954
14955    #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to delete, for a heap whose physical range(s) are set up via\n sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure all the covered offsets as not\n protected before responding to this message with success.\n\n On failure, the securemem driver must ensure the protected range was not\n deleted.\n\n Sysmem must not call this if dynamic_protection_ranges false.\n\n If dynamic_protection_ranges is true, sysmem can call this repeatedly,\n on various ranges that exist at the time of the call.\n\n If any portion of the range being deleted is not also covered by another\n protected range, then any ongoing DMA to any part of the entire range\n may be interrupted / may fail, potentially in a way that\'s disruptive to\n the entire system (bus lockup or similar, depending on device details).\n Therefore, the caller must ensure that no ongoing DMA is occurring to\n any portion of the range being deleted, unless the caller has other\n active ranges covering every block of the range being deleted.  Ongoing\n DMA to/from blocks outside the range being deleted is never impacted by\n the deletion.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap, or range that doesn\'t conform to\n     protected_range_granularity.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * NOT_FOUND - the specified range is not found.\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14956    fn delete_secure_heap_physical_range(
14957        &mut self,
14958
14959        request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14960
14961        responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14962    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14963
14964    #[doc = " This request from sysmem to the securemem driver conveys a physical\n range to modify and its new base and length, for a heap whose physical\n range(s) are set up via sysmem.\n\n Only sysmem can call this because only sysmem is handed the client end\n of a FIDL channel serving this protocol, via RegisterSecureMem().  The\n securemem driver is the server end of this protocol.\n\n The securemem driver must configure the range to cover only the new\n offsets before responding to this message with success.\n\n On failure, the securemem driver must ensure the range was not changed.\n\n Sysmem must not call this if dynamic_protection_ranges false.  Sysmem\n must not call this if !is_mod_protected_range_available.\n\n If dynamic_protection_ranges is true, sysmem can call this repeatedly,\n on various ranges that exist at the time of the call.\n\n The range must only be modified at one end or the other, but not both.\n If the range is getting shorter, and the un-covered blocks are not\n covered by other active ranges, any ongoing DMA to the entire range\n that\'s geting shorter may fail in a way that disrupts the entire system\n (bus lockup or similar), so the caller must ensure that no DMA is\n ongoing to any portion of a range that is getting shorter, unless the\n blocks being un-covered by the modification to this range are all\n covered by other active ranges, in which case no disruption to ongoing\n DMA will occur.\n\n If a range is modified to become <= zero length, the range is deleted.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap, or old_range or new_range that doesn\'t conform to\n     protected_range_granularity, or old_range and new_range differ in\n     both begin and end (disallowed).\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * NOT_FOUND - the specified range is not found.\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14965    fn modify_secure_heap_physical_range(
14966        &mut self,
14967
14968        request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14969
14970        responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14971    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14972
14973    #[doc = " Zero a sub-range of a currently-existing physical range added via\n AddSecureHeapPhysicalRange().  The sub-range must be fully covered by\n exactly one physical range, and must not overlap with any other\n physical range.\n\n is_covering_range_explicit - When true, the covering range must be one\n     of the ranges explicitly created via AddSecureHeapPhysicalRange(),\n     possibly modified since.  When false, the covering range must not\n     be one of the ranges explicitly created via\n     AddSecureHeapPhysicalRange(), but the covering range must exist as\n     a covering range not created via AddSecureHeapPhysicalRange().  The\n     covering range is typically the entire physical range (or a range\n     which covers even more) of a heap configured by the TEE and whose\n     configuration is conveyed to sysmem via GetPhysicalSecureHeaps().\n\n Ongoing DMA is not disrupted by this request.\n\n Errors:\n   * PROTOCOL_DEVIATION - called when !dynamic_protection_ranges.\n     Unexpected heap.\n   * UNSPECIFIED - generic internal error (such as in communication\n     with TEE which doesn\'t generate zx_status_t errors).\n   * other errors are possible, such as from communication failures or\n     server propagation of failures.\n"]
14974    fn zero_sub_range(
14975        &mut self,
14976
14977        request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
14978
14979        responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
14980    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14981
14982    fn on_unknown_interaction(
14983        &mut self,
14984        ordinal: u64,
14985    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
14986        ::core::future::ready(())
14987    }
14988}
14989
14990impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for SecureMem
14991where
14992    ___H: SecureMemServerHandler<___T> + ::core::marker::Send,
14993    ___T: ::fidl_next::Transport,
14994    for<'de> crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>: ::fidl_next::Decode<
14995            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14996            Constraint = (),
14997        >,
14998    for<'de> crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14999            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15000            Constraint = (),
15001        >,
15002    for<'de> crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
15003            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15004            Constraint = (),
15005        >,
15006    for<'de> crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
15007            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15008            Constraint = (),
15009        >,
15010    for<'de> crate::wire::SecureMemZeroSubRangeRequest<'de>: ::fidl_next::Decode<
15011            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15012            Constraint = (),
15013        >,
15014{
15015    async fn on_one_way(
15016        handler: &mut ___H,
15017        mut message: ::fidl_next::Message<___T>,
15018    ) -> ::core::result::Result<
15019        (),
15020        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
15021    > {
15022        match *message.header().ordinal {
15023            ordinal => {
15024                handler.on_unknown_interaction(ordinal).await;
15025                if ::core::matches!(
15026                    message.header().flexibility(),
15027                    ::fidl_next::protocol::Flexibility::Strict
15028                ) {
15029                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
15030                } else {
15031                    Ok(())
15032                }
15033            }
15034        }
15035    }
15036
15037    async fn on_two_way(
15038        handler: &mut ___H,
15039        mut message: ::fidl_next::Message<___T>,
15040        responder: ::fidl_next::protocol::Responder<___T>,
15041    ) -> ::core::result::Result<
15042        (),
15043        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
15044    > {
15045        match *message.header().ordinal {
15046            4067140791638717411 => {
15047                let responder = ::fidl_next::Responder::from_untyped(responder);
15048
15049                handler.get_physical_secure_heaps(responder).await;
15050                Ok(())
15051            }
15052
15053            1265657178863511604 => {
15054                let responder = ::fidl_next::Responder::from_untyped(responder);
15055
15056                handler.get_dynamic_secure_heaps(responder).await;
15057                Ok(())
15058            }
15059
15060            895942034471897020 => {
15061                let responder = ::fidl_next::Responder::from_untyped(responder);
15062
15063                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15064                    Ok(decoded) => {
15065                        handler
15066                            .get_physical_secure_heap_properties(
15067                                ::fidl_next::Request::from_decoded(decoded),
15068                                responder,
15069                            )
15070                            .await;
15071                        Ok(())
15072                    }
15073                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15074                        ordinal: 895942034471897020,
15075                        error,
15076                    }),
15077                }
15078            }
15079
15080            3888459953148993914 => {
15081                let responder = ::fidl_next::Responder::from_untyped(responder);
15082
15083                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15084                    Ok(decoded) => {
15085                        handler
15086                            .add_secure_heap_physical_range(
15087                                ::fidl_next::Request::from_decoded(decoded),
15088                                responder,
15089                            )
15090                            .await;
15091                        Ok(())
15092                    }
15093                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15094                        ordinal: 3888459953148993914,
15095                        error,
15096                    }),
15097                }
15098            }
15099
15100            1056754671343258782 => {
15101                let responder = ::fidl_next::Responder::from_untyped(responder);
15102
15103                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15104                    Ok(decoded) => {
15105                        handler
15106                            .delete_secure_heap_physical_range(
15107                                ::fidl_next::Request::from_decoded(decoded),
15108                                responder,
15109                            )
15110                            .await;
15111                        Ok(())
15112                    }
15113                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15114                        ordinal: 1056754671343258782,
15115                        error,
15116                    }),
15117                }
15118            }
15119
15120            6969114310578042676 => {
15121                let responder = ::fidl_next::Responder::from_untyped(responder);
15122
15123                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15124                    Ok(decoded) => {
15125                        handler
15126                            .modify_secure_heap_physical_range(
15127                                ::fidl_next::Request::from_decoded(decoded),
15128                                responder,
15129                            )
15130                            .await;
15131                        Ok(())
15132                    }
15133                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15134                        ordinal: 6969114310578042676,
15135                        error,
15136                    }),
15137                }
15138            }
15139
15140            6567857461132811493 => {
15141                let responder = ::fidl_next::Responder::from_untyped(responder);
15142
15143                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15144                    Ok(decoded) => {
15145                        handler
15146                            .zero_sub_range(::fidl_next::Request::from_decoded(decoded), responder)
15147                            .await;
15148                        Ok(())
15149                    }
15150                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15151                        ordinal: 6567857461132811493,
15152                        error,
15153                    }),
15154                }
15155            }
15156
15157            ordinal => {
15158                handler.on_unknown_interaction(ordinal).await;
15159                if ::core::matches!(
15160                    message.header().flexibility(),
15161                    ::fidl_next::protocol::Flexibility::Strict
15162                ) {
15163                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
15164                } else {
15165                    responder
15166                        .respond_framework_error(
15167                            ordinal,
15168                            ::fidl_next::FrameworkError::UnknownMethod,
15169                        )
15170                        .expect("encoding a framework error should never fail")
15171                        .await?;
15172                    Ok(())
15173                }
15174            }
15175        }
15176    }
15177}
15178
15179impl<___T> SecureMemClientHandler<___T> for ::fidl_next::IgnoreEvents
15180where
15181    ___T: ::fidl_next::Transport,
15182{
15183    async fn on_unknown_interaction(&mut self, _: u64) {}
15184}
15185
15186impl<___H, ___T> SecureMemLocalClientHandler<___T> for ::fidl_next::Local<___H>
15187where
15188    ___H: SecureMemClientHandler<___T>,
15189    ___T: ::fidl_next::Transport,
15190{
15191    async fn on_unknown_interaction(&mut self, ordinal: u64) {
15192        ___H::on_unknown_interaction(&mut self.0, ordinal).await
15193    }
15194}
15195
15196impl<___H, ___T> SecureMemLocalServerHandler<___T> for ::fidl_next::Local<___H>
15197where
15198    ___H: SecureMemServerHandler<___T>,
15199    ___T: ::fidl_next::Transport,
15200{
15201    async fn get_physical_secure_heaps(
15202        &mut self,
15203
15204        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
15205    ) {
15206        ___H::get_physical_secure_heaps(&mut self.0, responder).await
15207    }
15208
15209    async fn get_dynamic_secure_heaps(
15210        &mut self,
15211
15212        responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
15213    ) {
15214        ___H::get_dynamic_secure_heaps(&mut self.0, responder).await
15215    }
15216
15217    async fn get_physical_secure_heap_properties(
15218        &mut self,
15219
15220        request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
15221
15222        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
15223    ) {
15224        ___H::get_physical_secure_heap_properties(&mut self.0, request, responder).await
15225    }
15226
15227    async fn add_secure_heap_physical_range(
15228        &mut self,
15229
15230        request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
15231
15232        responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
15233    ) {
15234        ___H::add_secure_heap_physical_range(&mut self.0, request, responder).await
15235    }
15236
15237    async fn delete_secure_heap_physical_range(
15238        &mut self,
15239
15240        request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
15241
15242        responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
15243    ) {
15244        ___H::delete_secure_heap_physical_range(&mut self.0, request, responder).await
15245    }
15246
15247    async fn modify_secure_heap_physical_range(
15248        &mut self,
15249
15250        request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
15251
15252        responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
15253    ) {
15254        ___H::modify_secure_heap_physical_range(&mut self.0, request, responder).await
15255    }
15256
15257    async fn zero_sub_range(
15258        &mut self,
15259
15260        request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
15261
15262        responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
15263    ) {
15264        ___H::zero_sub_range(&mut self.0, request, responder).await
15265    }
15266
15267    async fn on_unknown_interaction(&mut self, ordinal: u64) {
15268        ___H::on_unknown_interaction(&mut self.0, ordinal).await
15269    }
15270}
15271
15272pub const VIDEO_USAGE_CAPTURE: u32 = 8 as u32;
15273
15274pub const VIDEO_USAGE_DECRYPTOR_OUTPUT: u32 = 16 as u32;
15275
15276pub const VIDEO_USAGE_HW_DECODER: u32 = 1 as u32;
15277
15278pub const VIDEO_USAGE_HW_DECODER_INTERNAL: u32 = 32 as u32;
15279
15280pub const VIDEO_USAGE_HW_ENCODER: u32 = 2 as u32;
15281
15282pub const VULKAN_BUFFER_USAGE_INDEX_BUFFER: u32 = 4194304 as u32;
15283
15284pub const VULKAN_BUFFER_USAGE_INDIRECT_BUFFER: u32 = 16777216 as u32;
15285
15286pub const VULKAN_BUFFER_USAGE_STORAGE_BUFFER: u32 = 2097152 as u32;
15287
15288pub const VULKAN_BUFFER_USAGE_STORAGE_TEXEL_BUFFER: u32 = 524288 as u32;
15289
15290pub const VULKAN_BUFFER_USAGE_TRANSFER_DST: u32 = 131072 as u32;
15291
15292pub const VULKAN_BUFFER_USAGE_TRANSFER_SRC: u32 = 65536 as u32;
15293
15294pub const VULKAN_BUFFER_USAGE_UNIFORM_BUFFER: u32 = 1048576 as u32;
15295
15296pub const VULKAN_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER: u32 = 262144 as u32;
15297
15298pub const VULKAN_BUFFER_USAGE_VERTEX_BUFFER: u32 = 8388608 as u32;
15299
15300pub const VULKAN_IMAGE_USAGE_COLOR_ATTACHMENT: u32 = 16 as u32;
15301
15302pub const VULKAN_IMAGE_USAGE_INPUT_ATTACHMENT: u32 = 128 as u32;
15303
15304pub const VULKAN_IMAGE_USAGE_SAMPLED: u32 = 4 as u32;
15305
15306pub const VULKAN_IMAGE_USAGE_STENCIL_ATTACHMENT: u32 = 32 as u32;
15307
15308pub const VULKAN_IMAGE_USAGE_STORAGE: u32 = 8 as u32;
15309
15310pub const VULKAN_IMAGE_USAGE_TRANSFER_DST: u32 = 2 as u32;
15311
15312pub const VULKAN_IMAGE_USAGE_TRANSFER_SRC: u32 = 1 as u32;
15313
15314pub const VULKAN_IMAGE_USAGE_TRANSIENT_ATTACHMENT: u32 = 64 as u32;