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: image_format_constraints.map(|envelope| {
3205                    ::fidl_next::FromWire::from_wire(unsafe {
3206                        envelope.read_unchecked::<::fidl_next::wire::Vector<
3207                                'de,
3208                                crate::wire::ImageFormatConstraints<'de>,
3209                            >>()
3210                    })
3211                }),
3212            }
3213        }
3214    }
3215
3216    impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferCollectionConstraints<'de>>
3217        for BufferCollectionConstraints
3218    {
3219        #[inline]
3220        fn from_wire_ref(wire: &crate::wire::BufferCollectionConstraints<'de>) -> Self {
3221            Self {
3222                usage: wire.table.get(1).map(|envelope| {
3223                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3224                        envelope.deref_unchecked::<crate::wire::BufferUsage<'de>>()
3225                    })
3226                }),
3227
3228                min_buffer_count_for_camping: wire.table.get(2).map(|envelope| {
3229                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3230                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3231                    })
3232                }),
3233
3234                min_buffer_count_for_dedicated_slack: wire.table.get(3).map(|envelope| {
3235                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3236                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3237                    })
3238                }),
3239
3240                min_buffer_count_for_shared_slack: wire.table.get(4).map(|envelope| {
3241                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3242                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3243                    })
3244                }),
3245
3246                min_buffer_count: wire.table.get(5).map(|envelope| {
3247                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3248                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3249                    })
3250                }),
3251
3252                max_buffer_count: wire.table.get(6).map(|envelope| {
3253                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3254                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3255                    })
3256                }),
3257
3258                buffer_memory_constraints: wire.table.get(7).map(|envelope| {
3259                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3260                        envelope.deref_unchecked::<crate::wire::BufferMemoryConstraints<'de>>()
3261                    })
3262                }),
3263
3264                image_format_constraints: wire.table.get(8).map(|envelope| {
3265                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3266                        envelope.deref_unchecked::<::fidl_next::wire::Vector<
3267                                'de,
3268                                crate::wire::ImageFormatConstraints<'de>,
3269                            >>()
3270                    })
3271                }),
3272            }
3273        }
3274    }
3275
3276    #[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"]
3277    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3278    #[repr(u32)]
3279    pub enum CoherencyDomain {
3280        Cpu = 0,
3281        Ram = 1,
3282        Inaccessible = 2,
3283        UnknownOrdinal_(u32) = 3,
3284    }
3285    impl ::std::convert::From<u32> for CoherencyDomain {
3286        fn from(value: u32) -> Self {
3287            match value {
3288                0 => Self::Cpu,
3289                1 => Self::Ram,
3290                2 => Self::Inaccessible,
3291
3292                _ => Self::UnknownOrdinal_(value),
3293            }
3294        }
3295    }
3296
3297    impl ::std::convert::From<CoherencyDomain> for u32 {
3298        fn from(value: CoherencyDomain) -> Self {
3299            match value {
3300                CoherencyDomain::Cpu => 0,
3301                CoherencyDomain::Ram => 1,
3302                CoherencyDomain::Inaccessible => 2,
3303
3304                CoherencyDomain::UnknownOrdinal_(value) => value,
3305            }
3306        }
3307    }
3308
3309    unsafe impl<___E> ::fidl_next::Encode<crate::wire::CoherencyDomain, ___E> for CoherencyDomain
3310    where
3311        ___E: ?Sized,
3312    {
3313        #[inline]
3314        fn encode(
3315            self,
3316            encoder: &mut ___E,
3317            out: &mut ::core::mem::MaybeUninit<crate::wire::CoherencyDomain>,
3318            _: (),
3319        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3320            ::fidl_next::Encode::encode(&self, encoder, out, ())
3321        }
3322    }
3323
3324    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CoherencyDomain, ___E>
3325        for &'a CoherencyDomain
3326    where
3327        ___E: ?Sized,
3328    {
3329        #[inline]
3330        fn encode(
3331            self,
3332            encoder: &mut ___E,
3333            out: &mut ::core::mem::MaybeUninit<crate::wire::CoherencyDomain>,
3334            _: (),
3335        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3336            ::fidl_next::munge!(let crate::wire::CoherencyDomain { value } = out);
3337            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
3338                CoherencyDomain::Cpu => 0,
3339
3340                CoherencyDomain::Ram => 1,
3341
3342                CoherencyDomain::Inaccessible => 2,
3343
3344                CoherencyDomain::UnknownOrdinal_(value) => value,
3345            }));
3346
3347            Ok(())
3348        }
3349    }
3350
3351    impl ::core::convert::From<crate::wire::CoherencyDomain> for CoherencyDomain {
3352        fn from(wire: crate::wire::CoherencyDomain) -> Self {
3353            match u32::from(wire.value) {
3354                0 => Self::Cpu,
3355
3356                1 => Self::Ram,
3357
3358                2 => Self::Inaccessible,
3359
3360                value => Self::UnknownOrdinal_(value),
3361            }
3362        }
3363    }
3364
3365    impl ::fidl_next::FromWire<crate::wire::CoherencyDomain> for CoherencyDomain {
3366        #[inline]
3367        fn from_wire(wire: crate::wire::CoherencyDomain) -> Self {
3368            Self::from(wire)
3369        }
3370    }
3371
3372    impl ::fidl_next::FromWireRef<crate::wire::CoherencyDomain> for CoherencyDomain {
3373        #[inline]
3374        fn from_wire_ref(wire: &crate::wire::CoherencyDomain) -> Self {
3375            Self::from(*wire)
3376        }
3377    }
3378
3379    #[doc = " These are memory-related settings for all buffers of a buffer collection.\n"]
3380    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3381    pub struct BufferMemorySettings {
3382        pub size_bytes: ::core::option::Option<u64>,
3383
3384        pub is_physically_contiguous: ::core::option::Option<bool>,
3385
3386        pub is_secure: ::core::option::Option<bool>,
3387
3388        pub coherency_domain: ::core::option::Option<crate::natural::CoherencyDomain>,
3389
3390        pub heap: ::core::option::Option<crate::natural::Heap>,
3391
3392        pub raw_vmo_size: ::core::option::Option<u64>,
3393    }
3394
3395    impl BufferMemorySettings {
3396        fn __max_ordinal(&self) -> usize {
3397            if self.raw_vmo_size.is_some() {
3398                return 6;
3399            }
3400
3401            if self.heap.is_some() {
3402                return 5;
3403            }
3404
3405            if self.coherency_domain.is_some() {
3406                return 4;
3407            }
3408
3409            if self.is_secure.is_some() {
3410                return 3;
3411            }
3412
3413            if self.is_physically_contiguous.is_some() {
3414                return 2;
3415            }
3416
3417            if self.size_bytes.is_some() {
3418                return 1;
3419            }
3420
3421            0
3422        }
3423    }
3424
3425    unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferMemorySettings<'static>, ___E>
3426        for BufferMemorySettings
3427    where
3428        ___E: ::fidl_next::Encoder + ?Sized,
3429    {
3430        #[inline]
3431        fn encode(
3432            mut self,
3433            encoder: &mut ___E,
3434            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemorySettings<'static>>,
3435            _: (),
3436        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3437            ::fidl_next::munge!(let crate::wire::BufferMemorySettings { table } = out);
3438
3439            let max_ord = self.__max_ordinal();
3440
3441            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3442            ::fidl_next::Wire::zero_padding(&mut out);
3443
3444            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3445                ::fidl_next::wire::Envelope,
3446            >(encoder, max_ord);
3447
3448            for i in 1..=max_ord {
3449                match i {
3450                    6 => {
3451                        if let Some(value) = self.raw_vmo_size.take() {
3452                            ::fidl_next::wire::Envelope::encode_value::<
3453                                ::fidl_next::wire::Uint64,
3454                                ___E,
3455                            >(
3456                                value, preallocated.encoder, &mut out, ()
3457                            )?;
3458                        } else {
3459                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3460                        }
3461                    }
3462
3463                    5 => {
3464                        if let Some(value) = self.heap.take() {
3465                            ::fidl_next::wire::Envelope::encode_value::<
3466                                crate::wire::Heap<'static>,
3467                                ___E,
3468                            >(
3469                                value, preallocated.encoder, &mut out, ()
3470                            )?;
3471                        } else {
3472                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3473                        }
3474                    }
3475
3476                    4 => {
3477                        if let Some(value) = self.coherency_domain.take() {
3478                            ::fidl_next::wire::Envelope::encode_value::<
3479                                crate::wire::CoherencyDomain,
3480                                ___E,
3481                            >(
3482                                value, preallocated.encoder, &mut out, ()
3483                            )?;
3484                        } else {
3485                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3486                        }
3487                    }
3488
3489                    3 => {
3490                        if let Some(value) = self.is_secure.take() {
3491                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3492                                value,
3493                                preallocated.encoder,
3494                                &mut out,
3495                                (),
3496                            )?;
3497                        } else {
3498                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3499                        }
3500                    }
3501
3502                    2 => {
3503                        if let Some(value) = self.is_physically_contiguous.take() {
3504                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3505                                value,
3506                                preallocated.encoder,
3507                                &mut out,
3508                                (),
3509                            )?;
3510                        } else {
3511                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3512                        }
3513                    }
3514
3515                    1 => {
3516                        if let Some(value) = self.size_bytes.take() {
3517                            ::fidl_next::wire::Envelope::encode_value::<
3518                                ::fidl_next::wire::Uint64,
3519                                ___E,
3520                            >(
3521                                value, preallocated.encoder, &mut out, ()
3522                            )?;
3523                        } else {
3524                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3525                        }
3526                    }
3527
3528                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3529                }
3530                unsafe {
3531                    preallocated.write_next(out.assume_init_ref());
3532                }
3533            }
3534
3535            ::fidl_next::wire::Table::encode_len(table, max_ord);
3536
3537            Ok(())
3538        }
3539    }
3540
3541    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BufferMemorySettings<'static>, ___E>
3542        for &'a BufferMemorySettings
3543    where
3544        ___E: ::fidl_next::Encoder + ?Sized,
3545    {
3546        #[inline]
3547        fn encode(
3548            self,
3549            encoder: &mut ___E,
3550            out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemorySettings<'static>>,
3551            _: (),
3552        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3553            ::fidl_next::munge!(let crate::wire::BufferMemorySettings { table } = out);
3554
3555            let max_ord = self.__max_ordinal();
3556
3557            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3558            ::fidl_next::Wire::zero_padding(&mut out);
3559
3560            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3561                ::fidl_next::wire::Envelope,
3562            >(encoder, max_ord);
3563
3564            for i in 1..=max_ord {
3565                match i {
3566                    6 => {
3567                        if let Some(value) = &self.raw_vmo_size {
3568                            ::fidl_next::wire::Envelope::encode_value::<
3569                                ::fidl_next::wire::Uint64,
3570                                ___E,
3571                            >(
3572                                value, preallocated.encoder, &mut out, ()
3573                            )?;
3574                        } else {
3575                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3576                        }
3577                    }
3578
3579                    5 => {
3580                        if let Some(value) = &self.heap {
3581                            ::fidl_next::wire::Envelope::encode_value::<
3582                                crate::wire::Heap<'static>,
3583                                ___E,
3584                            >(
3585                                value, preallocated.encoder, &mut out, ()
3586                            )?;
3587                        } else {
3588                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3589                        }
3590                    }
3591
3592                    4 => {
3593                        if let Some(value) = &self.coherency_domain {
3594                            ::fidl_next::wire::Envelope::encode_value::<
3595                                crate::wire::CoherencyDomain,
3596                                ___E,
3597                            >(
3598                                value, preallocated.encoder, &mut out, ()
3599                            )?;
3600                        } else {
3601                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3602                        }
3603                    }
3604
3605                    3 => {
3606                        if let Some(value) = &self.is_secure {
3607                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3608                                value,
3609                                preallocated.encoder,
3610                                &mut out,
3611                                (),
3612                            )?;
3613                        } else {
3614                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3615                        }
3616                    }
3617
3618                    2 => {
3619                        if let Some(value) = &self.is_physically_contiguous {
3620                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3621                                value,
3622                                preallocated.encoder,
3623                                &mut out,
3624                                (),
3625                            )?;
3626                        } else {
3627                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3628                        }
3629                    }
3630
3631                    1 => {
3632                        if let Some(value) = &self.size_bytes {
3633                            ::fidl_next::wire::Envelope::encode_value::<
3634                                ::fidl_next::wire::Uint64,
3635                                ___E,
3636                            >(
3637                                value, preallocated.encoder, &mut out, ()
3638                            )?;
3639                        } else {
3640                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3641                        }
3642                    }
3643
3644                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3645                }
3646                unsafe {
3647                    preallocated.write_next(out.assume_init_ref());
3648                }
3649            }
3650
3651            ::fidl_next::wire::Table::encode_len(table, max_ord);
3652
3653            Ok(())
3654        }
3655    }
3656
3657    impl<'de> ::fidl_next::FromWire<crate::wire::BufferMemorySettings<'de>> for BufferMemorySettings {
3658        #[inline]
3659        fn from_wire(wire_: crate::wire::BufferMemorySettings<'de>) -> Self {
3660            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3661
3662            let size_bytes = wire_.table.get(1);
3663
3664            let is_physically_contiguous = wire_.table.get(2);
3665
3666            let is_secure = wire_.table.get(3);
3667
3668            let coherency_domain = wire_.table.get(4);
3669
3670            let heap = wire_.table.get(5);
3671
3672            let raw_vmo_size = wire_.table.get(6);
3673
3674            Self {
3675                size_bytes: size_bytes.map(|envelope| {
3676                    ::fidl_next::FromWire::from_wire(unsafe {
3677                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
3678                    })
3679                }),
3680
3681                is_physically_contiguous: is_physically_contiguous.map(|envelope| {
3682                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3683                }),
3684
3685                is_secure: is_secure.map(|envelope| {
3686                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3687                }),
3688
3689                coherency_domain: coherency_domain.map(|envelope| {
3690                    ::fidl_next::FromWire::from_wire(unsafe {
3691                        envelope.read_unchecked::<crate::wire::CoherencyDomain>()
3692                    })
3693                }),
3694
3695                heap: heap.map(|envelope| {
3696                    ::fidl_next::FromWire::from_wire(unsafe {
3697                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
3698                    })
3699                }),
3700
3701                raw_vmo_size: raw_vmo_size.map(|envelope| {
3702                    ::fidl_next::FromWire::from_wire(unsafe {
3703                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
3704                    })
3705                }),
3706            }
3707        }
3708    }
3709
3710    impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferMemorySettings<'de>>
3711        for BufferMemorySettings
3712    {
3713        #[inline]
3714        fn from_wire_ref(wire: &crate::wire::BufferMemorySettings<'de>) -> Self {
3715            Self {
3716                size_bytes: wire.table.get(1).map(|envelope| {
3717                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3718                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
3719                    })
3720                }),
3721
3722                is_physically_contiguous: wire.table.get(2).map(|envelope| {
3723                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3724                        envelope.deref_unchecked::<bool>()
3725                    })
3726                }),
3727
3728                is_secure: wire.table.get(3).map(|envelope| {
3729                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3730                        envelope.deref_unchecked::<bool>()
3731                    })
3732                }),
3733
3734                coherency_domain: wire.table.get(4).map(|envelope| {
3735                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3736                        envelope.deref_unchecked::<crate::wire::CoherencyDomain>()
3737                    })
3738                }),
3739
3740                heap: wire.table.get(5).map(|envelope| {
3741                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3742                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
3743                    })
3744                }),
3745
3746                raw_vmo_size: wire.table.get(6).map(|envelope| {
3747                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3748                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
3749                    })
3750                }),
3751            }
3752        }
3753    }
3754
3755    #[doc = " These settings and constraints apply to all the buffers in the collection.\n"]
3756    #[derive(Debug, Default, Clone, PartialEq)]
3757    pub struct SingleBufferSettings {
3758        pub buffer_settings: ::core::option::Option<crate::natural::BufferMemorySettings>,
3759
3760        pub image_format_constraints:
3761            ::core::option::Option<crate::natural::ImageFormatConstraints>,
3762    }
3763
3764    impl SingleBufferSettings {
3765        fn __max_ordinal(&self) -> usize {
3766            if self.image_format_constraints.is_some() {
3767                return 2;
3768            }
3769
3770            if self.buffer_settings.is_some() {
3771                return 1;
3772            }
3773
3774            0
3775        }
3776    }
3777
3778    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SingleBufferSettings<'static>, ___E>
3779        for SingleBufferSettings
3780    where
3781        ___E: ::fidl_next::Encoder + ?Sized,
3782    {
3783        #[inline]
3784        fn encode(
3785            mut self,
3786            encoder: &mut ___E,
3787            out: &mut ::core::mem::MaybeUninit<crate::wire::SingleBufferSettings<'static>>,
3788            _: (),
3789        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3790            ::fidl_next::munge!(let crate::wire::SingleBufferSettings { table } = out);
3791
3792            let max_ord = self.__max_ordinal();
3793
3794            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3795            ::fidl_next::Wire::zero_padding(&mut out);
3796
3797            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3798                ::fidl_next::wire::Envelope,
3799            >(encoder, max_ord);
3800
3801            for i in 1..=max_ord {
3802                match i {
3803                    2 => {
3804                        if let Some(value) = self.image_format_constraints.take() {
3805                            ::fidl_next::wire::Envelope::encode_value::<
3806                                crate::wire::ImageFormatConstraints<'static>,
3807                                ___E,
3808                            >(
3809                                value, preallocated.encoder, &mut out, ()
3810                            )?;
3811                        } else {
3812                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3813                        }
3814                    }
3815
3816                    1 => {
3817                        if let Some(value) = self.buffer_settings.take() {
3818                            ::fidl_next::wire::Envelope::encode_value::<
3819                                crate::wire::BufferMemorySettings<'static>,
3820                                ___E,
3821                            >(
3822                                value, preallocated.encoder, &mut out, ()
3823                            )?;
3824                        } else {
3825                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3826                        }
3827                    }
3828
3829                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3830                }
3831                unsafe {
3832                    preallocated.write_next(out.assume_init_ref());
3833                }
3834            }
3835
3836            ::fidl_next::wire::Table::encode_len(table, max_ord);
3837
3838            Ok(())
3839        }
3840    }
3841
3842    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SingleBufferSettings<'static>, ___E>
3843        for &'a SingleBufferSettings
3844    where
3845        ___E: ::fidl_next::Encoder + ?Sized,
3846    {
3847        #[inline]
3848        fn encode(
3849            self,
3850            encoder: &mut ___E,
3851            out: &mut ::core::mem::MaybeUninit<crate::wire::SingleBufferSettings<'static>>,
3852            _: (),
3853        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3854            ::fidl_next::munge!(let crate::wire::SingleBufferSettings { table } = out);
3855
3856            let max_ord = self.__max_ordinal();
3857
3858            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3859            ::fidl_next::Wire::zero_padding(&mut out);
3860
3861            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3862                ::fidl_next::wire::Envelope,
3863            >(encoder, max_ord);
3864
3865            for i in 1..=max_ord {
3866                match i {
3867                    2 => {
3868                        if let Some(value) = &self.image_format_constraints {
3869                            ::fidl_next::wire::Envelope::encode_value::<
3870                                crate::wire::ImageFormatConstraints<'static>,
3871                                ___E,
3872                            >(
3873                                value, preallocated.encoder, &mut out, ()
3874                            )?;
3875                        } else {
3876                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3877                        }
3878                    }
3879
3880                    1 => {
3881                        if let Some(value) = &self.buffer_settings {
3882                            ::fidl_next::wire::Envelope::encode_value::<
3883                                crate::wire::BufferMemorySettings<'static>,
3884                                ___E,
3885                            >(
3886                                value, preallocated.encoder, &mut out, ()
3887                            )?;
3888                        } else {
3889                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
3890                        }
3891                    }
3892
3893                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3894                }
3895                unsafe {
3896                    preallocated.write_next(out.assume_init_ref());
3897                }
3898            }
3899
3900            ::fidl_next::wire::Table::encode_len(table, max_ord);
3901
3902            Ok(())
3903        }
3904    }
3905
3906    impl<'de> ::fidl_next::FromWire<crate::wire::SingleBufferSettings<'de>> for SingleBufferSettings {
3907        #[inline]
3908        fn from_wire(wire_: crate::wire::SingleBufferSettings<'de>) -> Self {
3909            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3910
3911            let buffer_settings = wire_.table.get(1);
3912
3913            let image_format_constraints = wire_.table.get(2);
3914
3915            Self {
3916                buffer_settings: buffer_settings.map(|envelope| {
3917                    ::fidl_next::FromWire::from_wire(unsafe {
3918                        envelope.read_unchecked::<crate::wire::BufferMemorySettings<'de>>()
3919                    })
3920                }),
3921
3922                image_format_constraints: image_format_constraints.map(|envelope| {
3923                    ::fidl_next::FromWire::from_wire(unsafe {
3924                        envelope.read_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
3925                    })
3926                }),
3927            }
3928        }
3929    }
3930
3931    impl<'de> ::fidl_next::FromWireRef<crate::wire::SingleBufferSettings<'de>>
3932        for SingleBufferSettings
3933    {
3934        #[inline]
3935        fn from_wire_ref(wire: &crate::wire::SingleBufferSettings<'de>) -> Self {
3936            Self {
3937                buffer_settings: wire.table.get(1).map(|envelope| {
3938                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3939                        envelope.deref_unchecked::<crate::wire::BufferMemorySettings<'de>>()
3940                    })
3941                }),
3942
3943                image_format_constraints: wire.table.get(2).map(|envelope| {
3944                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3945                        envelope.deref_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
3946                    })
3947                }),
3948            }
3949        }
3950    }
3951
3952    #[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"]
3953    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3954    #[repr(u32)]
3955    pub enum Error {
3956        Invalid = 0,
3957        Unspecified = 1,
3958        ProtocolDeviation = 2,
3959        NotFound = 3,
3960        HandleAccessDenied = 4,
3961        NoMemory = 5,
3962        ConstraintsIntersectionEmpty = 6,
3963        Pending = 7,
3964        TooManyGroupChildCombinations = 8,
3965        NoMoreStrongVmoHandles = 9,
3966        UnknownOrdinal_(u32) = 10,
3967    }
3968    impl ::std::convert::From<u32> for Error {
3969        fn from(value: u32) -> Self {
3970            match value {
3971                0 => Self::Invalid,
3972                1 => Self::Unspecified,
3973                2 => Self::ProtocolDeviation,
3974                3 => Self::NotFound,
3975                4 => Self::HandleAccessDenied,
3976                5 => Self::NoMemory,
3977                6 => Self::ConstraintsIntersectionEmpty,
3978                7 => Self::Pending,
3979                8 => Self::TooManyGroupChildCombinations,
3980                9 => Self::NoMoreStrongVmoHandles,
3981
3982                _ => Self::UnknownOrdinal_(value),
3983            }
3984        }
3985    }
3986
3987    impl ::std::convert::From<Error> for u32 {
3988        fn from(value: Error) -> Self {
3989            match value {
3990                Error::Invalid => 0,
3991                Error::Unspecified => 1,
3992                Error::ProtocolDeviation => 2,
3993                Error::NotFound => 3,
3994                Error::HandleAccessDenied => 4,
3995                Error::NoMemory => 5,
3996                Error::ConstraintsIntersectionEmpty => 6,
3997                Error::Pending => 7,
3998                Error::TooManyGroupChildCombinations => 8,
3999                Error::NoMoreStrongVmoHandles => 9,
4000
4001                Error::UnknownOrdinal_(value) => value,
4002            }
4003        }
4004    }
4005
4006    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Error, ___E> for Error
4007    where
4008        ___E: ?Sized,
4009    {
4010        #[inline]
4011        fn encode(
4012            self,
4013            encoder: &mut ___E,
4014            out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
4015            _: (),
4016        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4017            ::fidl_next::Encode::encode(&self, encoder, out, ())
4018        }
4019    }
4020
4021    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Error, ___E> for &'a Error
4022    where
4023        ___E: ?Sized,
4024    {
4025        #[inline]
4026        fn encode(
4027            self,
4028            encoder: &mut ___E,
4029            out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
4030            _: (),
4031        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4032            ::fidl_next::munge!(let crate::wire::Error { value } = out);
4033            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
4034                Error::Invalid => 0,
4035
4036                Error::Unspecified => 1,
4037
4038                Error::ProtocolDeviation => 2,
4039
4040                Error::NotFound => 3,
4041
4042                Error::HandleAccessDenied => 4,
4043
4044                Error::NoMemory => 5,
4045
4046                Error::ConstraintsIntersectionEmpty => 6,
4047
4048                Error::Pending => 7,
4049
4050                Error::TooManyGroupChildCombinations => 8,
4051
4052                Error::NoMoreStrongVmoHandles => 9,
4053
4054                Error::UnknownOrdinal_(value) => value,
4055            }));
4056
4057            Ok(())
4058        }
4059    }
4060
4061    impl ::core::convert::From<crate::wire::Error> for Error {
4062        fn from(wire: crate::wire::Error) -> Self {
4063            match u32::from(wire.value) {
4064                0 => Self::Invalid,
4065
4066                1 => Self::Unspecified,
4067
4068                2 => Self::ProtocolDeviation,
4069
4070                3 => Self::NotFound,
4071
4072                4 => Self::HandleAccessDenied,
4073
4074                5 => Self::NoMemory,
4075
4076                6 => Self::ConstraintsIntersectionEmpty,
4077
4078                7 => Self::Pending,
4079
4080                8 => Self::TooManyGroupChildCombinations,
4081
4082                9 => Self::NoMoreStrongVmoHandles,
4083
4084                value => Self::UnknownOrdinal_(value),
4085            }
4086        }
4087    }
4088
4089    impl ::fidl_next::FromWire<crate::wire::Error> for Error {
4090        #[inline]
4091        fn from_wire(wire: crate::wire::Error) -> Self {
4092            Self::from(wire)
4093        }
4094    }
4095
4096    impl ::fidl_next::FromWireRef<crate::wire::Error> for Error {
4097        #[inline]
4098        fn from_wire_ref(wire: &crate::wire::Error) -> Self {
4099            Self::from(*wire)
4100        }
4101    }
4102
4103    pub type NodeSyncResponse = ();
4104
4105    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4106    pub struct NodeSetNameRequest {
4107        pub priority: ::core::option::Option<u32>,
4108
4109        pub name: ::core::option::Option<::std::string::String>,
4110    }
4111
4112    impl NodeSetNameRequest {
4113        fn __max_ordinal(&self) -> usize {
4114            if self.name.is_some() {
4115                return 2;
4116            }
4117
4118            if self.priority.is_some() {
4119                return 1;
4120            }
4121
4122            0
4123        }
4124    }
4125
4126    unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeSetNameRequest<'static>, ___E>
4127        for NodeSetNameRequest
4128    where
4129        ___E: ::fidl_next::Encoder + ?Sized,
4130    {
4131        #[inline]
4132        fn encode(
4133            mut self,
4134            encoder: &mut ___E,
4135            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetNameRequest<'static>>,
4136            _: (),
4137        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4138            ::fidl_next::munge!(let crate::wire::NodeSetNameRequest { table } = out);
4139
4140            let max_ord = self.__max_ordinal();
4141
4142            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4143            ::fidl_next::Wire::zero_padding(&mut out);
4144
4145            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4146                ::fidl_next::wire::Envelope,
4147            >(encoder, max_ord);
4148
4149            for i in 1..=max_ord {
4150                match i {
4151                    2 => {
4152                        if let Some(value) = self.name.take() {
4153                            ::fidl_next::wire::Envelope::encode_value::<
4154                                ::fidl_next::wire::String<'static>,
4155                                ___E,
4156                            >(
4157                                value, preallocated.encoder, &mut out, 64
4158                            )?;
4159                        } else {
4160                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4161                        }
4162                    }
4163
4164                    1 => {
4165                        if let Some(value) = self.priority.take() {
4166                            ::fidl_next::wire::Envelope::encode_value::<
4167                                ::fidl_next::wire::Uint32,
4168                                ___E,
4169                            >(
4170                                value, preallocated.encoder, &mut out, ()
4171                            )?;
4172                        } else {
4173                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4174                        }
4175                    }
4176
4177                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4178                }
4179                unsafe {
4180                    preallocated.write_next(out.assume_init_ref());
4181                }
4182            }
4183
4184            ::fidl_next::wire::Table::encode_len(table, max_ord);
4185
4186            Ok(())
4187        }
4188    }
4189
4190    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeSetNameRequest<'static>, ___E>
4191        for &'a NodeSetNameRequest
4192    where
4193        ___E: ::fidl_next::Encoder + ?Sized,
4194    {
4195        #[inline]
4196        fn encode(
4197            self,
4198            encoder: &mut ___E,
4199            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetNameRequest<'static>>,
4200            _: (),
4201        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4202            ::fidl_next::munge!(let crate::wire::NodeSetNameRequest { table } = out);
4203
4204            let max_ord = self.__max_ordinal();
4205
4206            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4207            ::fidl_next::Wire::zero_padding(&mut out);
4208
4209            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4210                ::fidl_next::wire::Envelope,
4211            >(encoder, max_ord);
4212
4213            for i in 1..=max_ord {
4214                match i {
4215                    2 => {
4216                        if let Some(value) = &self.name {
4217                            ::fidl_next::wire::Envelope::encode_value::<
4218                                ::fidl_next::wire::String<'static>,
4219                                ___E,
4220                            >(
4221                                value, preallocated.encoder, &mut out, 64
4222                            )?;
4223                        } else {
4224                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4225                        }
4226                    }
4227
4228                    1 => {
4229                        if let Some(value) = &self.priority {
4230                            ::fidl_next::wire::Envelope::encode_value::<
4231                                ::fidl_next::wire::Uint32,
4232                                ___E,
4233                            >(
4234                                value, preallocated.encoder, &mut out, ()
4235                            )?;
4236                        } else {
4237                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4238                        }
4239                    }
4240
4241                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4242                }
4243                unsafe {
4244                    preallocated.write_next(out.assume_init_ref());
4245                }
4246            }
4247
4248            ::fidl_next::wire::Table::encode_len(table, max_ord);
4249
4250            Ok(())
4251        }
4252    }
4253
4254    impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetNameRequest<'de>> for NodeSetNameRequest {
4255        #[inline]
4256        fn from_wire(wire_: crate::wire::NodeSetNameRequest<'de>) -> Self {
4257            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4258
4259            let priority = wire_.table.get(1);
4260
4261            let name = wire_.table.get(2);
4262
4263            Self {
4264                priority: priority.map(|envelope| {
4265                    ::fidl_next::FromWire::from_wire(unsafe {
4266                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
4267                    })
4268                }),
4269
4270                name: name.map(|envelope| {
4271                    ::fidl_next::FromWire::from_wire(unsafe {
4272                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4273                    })
4274                }),
4275            }
4276        }
4277    }
4278
4279    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetNameRequest<'de>> for NodeSetNameRequest {
4280        #[inline]
4281        fn from_wire_ref(wire: &crate::wire::NodeSetNameRequest<'de>) -> Self {
4282            Self {
4283                priority: wire.table.get(1).map(|envelope| {
4284                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4285                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
4286                    })
4287                }),
4288
4289                name: wire.table.get(2).map(|envelope| {
4290                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4291                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4292                    })
4293                }),
4294            }
4295        }
4296    }
4297
4298    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4299    pub struct NodeSetDebugClientInfoRequest {
4300        pub name: ::core::option::Option<::std::string::String>,
4301
4302        pub id: ::core::option::Option<u64>,
4303    }
4304
4305    impl NodeSetDebugClientInfoRequest {
4306        fn __max_ordinal(&self) -> usize {
4307            if self.id.is_some() {
4308                return 2;
4309            }
4310
4311            if self.name.is_some() {
4312                return 1;
4313            }
4314
4315            0
4316        }
4317    }
4318
4319    unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeSetDebugClientInfoRequest<'static>, ___E>
4320        for NodeSetDebugClientInfoRequest
4321    where
4322        ___E: ::fidl_next::Encoder + ?Sized,
4323    {
4324        #[inline]
4325        fn encode(
4326            mut self,
4327            encoder: &mut ___E,
4328            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetDebugClientInfoRequest<'static>>,
4329            _: (),
4330        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4331            ::fidl_next::munge!(let crate::wire::NodeSetDebugClientInfoRequest { table } = out);
4332
4333            let max_ord = self.__max_ordinal();
4334
4335            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4336            ::fidl_next::Wire::zero_padding(&mut out);
4337
4338            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4339                ::fidl_next::wire::Envelope,
4340            >(encoder, max_ord);
4341
4342            for i in 1..=max_ord {
4343                match i {
4344                    2 => {
4345                        if let Some(value) = self.id.take() {
4346                            ::fidl_next::wire::Envelope::encode_value::<
4347                                ::fidl_next::wire::Uint64,
4348                                ___E,
4349                            >(
4350                                value, preallocated.encoder, &mut out, ()
4351                            )?;
4352                        } else {
4353                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4354                        }
4355                    }
4356
4357                    1 => {
4358                        if let Some(value) = self.name.take() {
4359                            ::fidl_next::wire::Envelope::encode_value::<
4360                                ::fidl_next::wire::String<'static>,
4361                                ___E,
4362                            >(
4363                                value, preallocated.encoder, &mut out, 256
4364                            )?;
4365                        } else {
4366                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4367                        }
4368                    }
4369
4370                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4371                }
4372                unsafe {
4373                    preallocated.write_next(out.assume_init_ref());
4374                }
4375            }
4376
4377            ::fidl_next::wire::Table::encode_len(table, max_ord);
4378
4379            Ok(())
4380        }
4381    }
4382
4383    unsafe impl<'a, ___E>
4384        ::fidl_next::Encode<crate::wire::NodeSetDebugClientInfoRequest<'static>, ___E>
4385        for &'a NodeSetDebugClientInfoRequest
4386    where
4387        ___E: ::fidl_next::Encoder + ?Sized,
4388    {
4389        #[inline]
4390        fn encode(
4391            self,
4392            encoder: &mut ___E,
4393            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetDebugClientInfoRequest<'static>>,
4394            _: (),
4395        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4396            ::fidl_next::munge!(let crate::wire::NodeSetDebugClientInfoRequest { table } = out);
4397
4398            let max_ord = self.__max_ordinal();
4399
4400            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4401            ::fidl_next::Wire::zero_padding(&mut out);
4402
4403            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4404                ::fidl_next::wire::Envelope,
4405            >(encoder, max_ord);
4406
4407            for i in 1..=max_ord {
4408                match i {
4409                    2 => {
4410                        if let Some(value) = &self.id {
4411                            ::fidl_next::wire::Envelope::encode_value::<
4412                                ::fidl_next::wire::Uint64,
4413                                ___E,
4414                            >(
4415                                value, preallocated.encoder, &mut out, ()
4416                            )?;
4417                        } else {
4418                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4419                        }
4420                    }
4421
4422                    1 => {
4423                        if let Some(value) = &self.name {
4424                            ::fidl_next::wire::Envelope::encode_value::<
4425                                ::fidl_next::wire::String<'static>,
4426                                ___E,
4427                            >(
4428                                value, preallocated.encoder, &mut out, 256
4429                            )?;
4430                        } else {
4431                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4432                        }
4433                    }
4434
4435                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4436                }
4437                unsafe {
4438                    preallocated.write_next(out.assume_init_ref());
4439                }
4440            }
4441
4442            ::fidl_next::wire::Table::encode_len(table, max_ord);
4443
4444            Ok(())
4445        }
4446    }
4447
4448    impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetDebugClientInfoRequest<'de>>
4449        for NodeSetDebugClientInfoRequest
4450    {
4451        #[inline]
4452        fn from_wire(wire_: crate::wire::NodeSetDebugClientInfoRequest<'de>) -> Self {
4453            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4454
4455            let name = wire_.table.get(1);
4456
4457            let id = wire_.table.get(2);
4458
4459            Self {
4460                name: name.map(|envelope| {
4461                    ::fidl_next::FromWire::from_wire(unsafe {
4462                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4463                    })
4464                }),
4465
4466                id: id.map(|envelope| {
4467                    ::fidl_next::FromWire::from_wire(unsafe {
4468                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
4469                    })
4470                }),
4471            }
4472        }
4473    }
4474
4475    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetDebugClientInfoRequest<'de>>
4476        for NodeSetDebugClientInfoRequest
4477    {
4478        #[inline]
4479        fn from_wire_ref(wire: &crate::wire::NodeSetDebugClientInfoRequest<'de>) -> Self {
4480            Self {
4481                name: wire.table.get(1).map(|envelope| {
4482                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4483                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4484                    })
4485                }),
4486
4487                id: wire.table.get(2).map(|envelope| {
4488                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4489                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
4490                    })
4491                }),
4492            }
4493        }
4494    }
4495
4496    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4497    pub struct NodeSetDebugTimeoutLogDeadlineRequest {
4498        pub deadline: ::core::option::Option<i64>,
4499    }
4500
4501    impl NodeSetDebugTimeoutLogDeadlineRequest {
4502        fn __max_ordinal(&self) -> usize {
4503            if self.deadline.is_some() {
4504                return 1;
4505            }
4506
4507            0
4508        }
4509    }
4510
4511    unsafe impl<___E>
4512        ::fidl_next::Encode<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>, ___E>
4513        for NodeSetDebugTimeoutLogDeadlineRequest
4514    where
4515        ___E: ::fidl_next::Encoder + ?Sized,
4516    {
4517        #[inline]
4518        fn encode(
4519            mut self,
4520            encoder: &mut ___E,
4521            out: &mut ::core::mem::MaybeUninit<
4522                crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>,
4523            >,
4524            _: (),
4525        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4526            ::fidl_next::munge!(let crate::wire::NodeSetDebugTimeoutLogDeadlineRequest { table } = out);
4527
4528            let max_ord = self.__max_ordinal();
4529
4530            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4531            ::fidl_next::Wire::zero_padding(&mut out);
4532
4533            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4534                ::fidl_next::wire::Envelope,
4535            >(encoder, max_ord);
4536
4537            for i in 1..=max_ord {
4538                match i {
4539                    1 => {
4540                        if let Some(value) = self.deadline.take() {
4541                            ::fidl_next::wire::Envelope::encode_value::<
4542                                ::fidl_next::wire::Int64,
4543                                ___E,
4544                            >(
4545                                value, preallocated.encoder, &mut out, ()
4546                            )?;
4547                        } else {
4548                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4549                        }
4550                    }
4551
4552                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4553                }
4554                unsafe {
4555                    preallocated.write_next(out.assume_init_ref());
4556                }
4557            }
4558
4559            ::fidl_next::wire::Table::encode_len(table, max_ord);
4560
4561            Ok(())
4562        }
4563    }
4564
4565    unsafe impl<'a, ___E>
4566        ::fidl_next::Encode<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>, ___E>
4567        for &'a NodeSetDebugTimeoutLogDeadlineRequest
4568    where
4569        ___E: ::fidl_next::Encoder + ?Sized,
4570    {
4571        #[inline]
4572        fn encode(
4573            self,
4574            encoder: &mut ___E,
4575            out: &mut ::core::mem::MaybeUninit<
4576                crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>,
4577            >,
4578            _: (),
4579        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4580            ::fidl_next::munge!(let crate::wire::NodeSetDebugTimeoutLogDeadlineRequest { table } = out);
4581
4582            let max_ord = self.__max_ordinal();
4583
4584            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4585            ::fidl_next::Wire::zero_padding(&mut out);
4586
4587            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4588                ::fidl_next::wire::Envelope,
4589            >(encoder, max_ord);
4590
4591            for i in 1..=max_ord {
4592                match i {
4593                    1 => {
4594                        if let Some(value) = &self.deadline {
4595                            ::fidl_next::wire::Envelope::encode_value::<
4596                                ::fidl_next::wire::Int64,
4597                                ___E,
4598                            >(
4599                                value, preallocated.encoder, &mut out, ()
4600                            )?;
4601                        } else {
4602                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4603                        }
4604                    }
4605
4606                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4607                }
4608                unsafe {
4609                    preallocated.write_next(out.assume_init_ref());
4610                }
4611            }
4612
4613            ::fidl_next::wire::Table::encode_len(table, max_ord);
4614
4615            Ok(())
4616        }
4617    }
4618
4619    impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>>
4620        for NodeSetDebugTimeoutLogDeadlineRequest
4621    {
4622        #[inline]
4623        fn from_wire(wire_: crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>) -> Self {
4624            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4625
4626            let deadline = wire_.table.get(1);
4627
4628            Self {
4629                deadline: deadline.map(|envelope| {
4630                    ::fidl_next::FromWire::from_wire(unsafe {
4631                        envelope.read_unchecked::<::fidl_next::wire::Int64>()
4632                    })
4633                }),
4634            }
4635        }
4636    }
4637
4638    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>>
4639        for NodeSetDebugTimeoutLogDeadlineRequest
4640    {
4641        #[inline]
4642        fn from_wire_ref(wire: &crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>) -> Self {
4643            Self {
4644                deadline: wire.table.get(1).map(|envelope| {
4645                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4646                        envelope.deref_unchecked::<::fidl_next::wire::Int64>()
4647                    })
4648                }),
4649            }
4650        }
4651    }
4652
4653    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4654    pub struct NodeIsAlternateForResponse {
4655        pub is_alternate: ::core::option::Option<bool>,
4656    }
4657
4658    impl NodeIsAlternateForResponse {
4659        fn __max_ordinal(&self) -> usize {
4660            if self.is_alternate.is_some() {
4661                return 1;
4662            }
4663
4664            0
4665        }
4666    }
4667
4668    unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeIsAlternateForResponse<'static>, ___E>
4669        for NodeIsAlternateForResponse
4670    where
4671        ___E: ::fidl_next::Encoder + ?Sized,
4672    {
4673        #[inline]
4674        fn encode(
4675            mut self,
4676            encoder: &mut ___E,
4677            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeIsAlternateForResponse<'static>>,
4678            _: (),
4679        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4680            ::fidl_next::munge!(let crate::wire::NodeIsAlternateForResponse { table } = out);
4681
4682            let max_ord = self.__max_ordinal();
4683
4684            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4685            ::fidl_next::Wire::zero_padding(&mut out);
4686
4687            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4688                ::fidl_next::wire::Envelope,
4689            >(encoder, max_ord);
4690
4691            for i in 1..=max_ord {
4692                match i {
4693                    1 => {
4694                        if let Some(value) = self.is_alternate.take() {
4695                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
4696                                value,
4697                                preallocated.encoder,
4698                                &mut out,
4699                                (),
4700                            )?;
4701                        } else {
4702                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4703                        }
4704                    }
4705
4706                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4707                }
4708                unsafe {
4709                    preallocated.write_next(out.assume_init_ref());
4710                }
4711            }
4712
4713            ::fidl_next::wire::Table::encode_len(table, max_ord);
4714
4715            Ok(())
4716        }
4717    }
4718
4719    unsafe impl<'a, ___E>
4720        ::fidl_next::Encode<crate::wire::NodeIsAlternateForResponse<'static>, ___E>
4721        for &'a NodeIsAlternateForResponse
4722    where
4723        ___E: ::fidl_next::Encoder + ?Sized,
4724    {
4725        #[inline]
4726        fn encode(
4727            self,
4728            encoder: &mut ___E,
4729            out: &mut ::core::mem::MaybeUninit<crate::wire::NodeIsAlternateForResponse<'static>>,
4730            _: (),
4731        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4732            ::fidl_next::munge!(let crate::wire::NodeIsAlternateForResponse { table } = out);
4733
4734            let max_ord = self.__max_ordinal();
4735
4736            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4737            ::fidl_next::Wire::zero_padding(&mut out);
4738
4739            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4740                ::fidl_next::wire::Envelope,
4741            >(encoder, max_ord);
4742
4743            for i in 1..=max_ord {
4744                match i {
4745                    1 => {
4746                        if let Some(value) = &self.is_alternate {
4747                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
4748                                value,
4749                                preallocated.encoder,
4750                                &mut out,
4751                                (),
4752                            )?;
4753                        } else {
4754                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4755                        }
4756                    }
4757
4758                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4759                }
4760                unsafe {
4761                    preallocated.write_next(out.assume_init_ref());
4762                }
4763            }
4764
4765            ::fidl_next::wire::Table::encode_len(table, max_ord);
4766
4767            Ok(())
4768        }
4769    }
4770
4771    impl<'de> ::fidl_next::FromWire<crate::wire::NodeIsAlternateForResponse<'de>>
4772        for NodeIsAlternateForResponse
4773    {
4774        #[inline]
4775        fn from_wire(wire_: crate::wire::NodeIsAlternateForResponse<'de>) -> Self {
4776            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4777
4778            let is_alternate = wire_.table.get(1);
4779
4780            Self {
4781                is_alternate: is_alternate.map(|envelope| {
4782                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
4783                }),
4784            }
4785        }
4786    }
4787
4788    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeIsAlternateForResponse<'de>>
4789        for NodeIsAlternateForResponse
4790    {
4791        #[inline]
4792        fn from_wire_ref(wire: &crate::wire::NodeIsAlternateForResponse<'de>) -> Self {
4793            Self {
4794                is_alternate: wire.table.get(1).map(|envelope| {
4795                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4796                        envelope.deref_unchecked::<bool>()
4797                    })
4798                }),
4799            }
4800        }
4801    }
4802
4803    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4804    pub struct NodeGetBufferCollectionIdResponse {
4805        pub buffer_collection_id: ::core::option::Option<u64>,
4806    }
4807
4808    impl NodeGetBufferCollectionIdResponse {
4809        fn __max_ordinal(&self) -> usize {
4810            if self.buffer_collection_id.is_some() {
4811                return 1;
4812            }
4813
4814            0
4815        }
4816    }
4817
4818    unsafe impl<___E>
4819        ::fidl_next::Encode<crate::wire::NodeGetBufferCollectionIdResponse<'static>, ___E>
4820        for NodeGetBufferCollectionIdResponse
4821    where
4822        ___E: ::fidl_next::Encoder + ?Sized,
4823    {
4824        #[inline]
4825        fn encode(
4826            mut self,
4827            encoder: &mut ___E,
4828            out: &mut ::core::mem::MaybeUninit<
4829                crate::wire::NodeGetBufferCollectionIdResponse<'static>,
4830            >,
4831            _: (),
4832        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4833            ::fidl_next::munge!(let crate::wire::NodeGetBufferCollectionIdResponse { table } = out);
4834
4835            let max_ord = self.__max_ordinal();
4836
4837            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4838            ::fidl_next::Wire::zero_padding(&mut out);
4839
4840            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4841                ::fidl_next::wire::Envelope,
4842            >(encoder, max_ord);
4843
4844            for i in 1..=max_ord {
4845                match i {
4846                    1 => {
4847                        if let Some(value) = self.buffer_collection_id.take() {
4848                            ::fidl_next::wire::Envelope::encode_value::<
4849                                ::fidl_next::wire::Uint64,
4850                                ___E,
4851                            >(
4852                                value, preallocated.encoder, &mut out, ()
4853                            )?;
4854                        } else {
4855                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4856                        }
4857                    }
4858
4859                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4860                }
4861                unsafe {
4862                    preallocated.write_next(out.assume_init_ref());
4863                }
4864            }
4865
4866            ::fidl_next::wire::Table::encode_len(table, max_ord);
4867
4868            Ok(())
4869        }
4870    }
4871
4872    unsafe impl<'a, ___E>
4873        ::fidl_next::Encode<crate::wire::NodeGetBufferCollectionIdResponse<'static>, ___E>
4874        for &'a NodeGetBufferCollectionIdResponse
4875    where
4876        ___E: ::fidl_next::Encoder + ?Sized,
4877    {
4878        #[inline]
4879        fn encode(
4880            self,
4881            encoder: &mut ___E,
4882            out: &mut ::core::mem::MaybeUninit<
4883                crate::wire::NodeGetBufferCollectionIdResponse<'static>,
4884            >,
4885            _: (),
4886        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4887            ::fidl_next::munge!(let crate::wire::NodeGetBufferCollectionIdResponse { table } = out);
4888
4889            let max_ord = self.__max_ordinal();
4890
4891            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4892            ::fidl_next::Wire::zero_padding(&mut out);
4893
4894            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4895                ::fidl_next::wire::Envelope,
4896            >(encoder, max_ord);
4897
4898            for i in 1..=max_ord {
4899                match i {
4900                    1 => {
4901                        if let Some(value) = &self.buffer_collection_id {
4902                            ::fidl_next::wire::Envelope::encode_value::<
4903                                ::fidl_next::wire::Uint64,
4904                                ___E,
4905                            >(
4906                                value, preallocated.encoder, &mut out, ()
4907                            )?;
4908                        } else {
4909                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
4910                        }
4911                    }
4912
4913                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4914                }
4915                unsafe {
4916                    preallocated.write_next(out.assume_init_ref());
4917                }
4918            }
4919
4920            ::fidl_next::wire::Table::encode_len(table, max_ord);
4921
4922            Ok(())
4923        }
4924    }
4925
4926    impl<'de> ::fidl_next::FromWire<crate::wire::NodeGetBufferCollectionIdResponse<'de>>
4927        for NodeGetBufferCollectionIdResponse
4928    {
4929        #[inline]
4930        fn from_wire(wire_: crate::wire::NodeGetBufferCollectionIdResponse<'de>) -> Self {
4931            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4932
4933            let buffer_collection_id = wire_.table.get(1);
4934
4935            Self {
4936                buffer_collection_id: buffer_collection_id.map(|envelope| {
4937                    ::fidl_next::FromWire::from_wire(unsafe {
4938                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
4939                    })
4940                }),
4941            }
4942        }
4943    }
4944
4945    impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeGetBufferCollectionIdResponse<'de>>
4946        for NodeGetBufferCollectionIdResponse
4947    {
4948        #[inline]
4949        fn from_wire_ref(wire: &crate::wire::NodeGetBufferCollectionIdResponse<'de>) -> Self {
4950            Self {
4951                buffer_collection_id: wire.table.get(1).map(|envelope| {
4952                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4953                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
4954                    })
4955                }),
4956            }
4957        }
4958    }
4959
4960    pub type BufferCollectionCheckAllBuffersAllocatedResponse = ();
4961
4962    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4963    pub struct BufferCollectionTokenDuplicateSyncRequest {
4964        pub rights_attenuation_masks:
4965            ::core::option::Option<::std::vec::Vec<::fidl_next::fuchsia::zx::Rights>>,
4966    }
4967
4968    impl BufferCollectionTokenDuplicateSyncRequest {
4969        fn __max_ordinal(&self) -> usize {
4970            if self.rights_attenuation_masks.is_some() {
4971                return 1;
4972            }
4973
4974            0
4975        }
4976    }
4977
4978    unsafe impl<___E>
4979        ::fidl_next::Encode<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>, ___E>
4980        for BufferCollectionTokenDuplicateSyncRequest
4981    where
4982        ___E: ::fidl_next::Encoder + ?Sized,
4983    {
4984        #[inline]
4985        fn encode(
4986            mut self,
4987            encoder: &mut ___E,
4988            out: &mut ::core::mem::MaybeUninit<
4989                crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>,
4990            >,
4991            _: (),
4992        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4993            ::fidl_next::munge!(let crate::wire::BufferCollectionTokenDuplicateSyncRequest { table } = out);
4994
4995            let max_ord = self.__max_ordinal();
4996
4997            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4998            ::fidl_next::Wire::zero_padding(&mut out);
4999
5000            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5001                ::fidl_next::wire::Envelope,
5002            >(encoder, max_ord);
5003
5004            for i in 1..=max_ord {
5005                match i {
5006                    1 => {
5007                        if let Some(value) = self.rights_attenuation_masks.take() {
5008                            ::fidl_next::wire::Envelope::encode_value::<
5009                                ::fidl_next::wire::Vector<
5010                                    'static,
5011                                    ::fidl_next::wire::fuchsia::Rights,
5012                                >,
5013                                ___E,
5014                            >(
5015                                value, preallocated.encoder, &mut out, (64, ())
5016                            )?;
5017                        } else {
5018                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5019                        }
5020                    }
5021
5022                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5023                }
5024                unsafe {
5025                    preallocated.write_next(out.assume_init_ref());
5026                }
5027            }
5028
5029            ::fidl_next::wire::Table::encode_len(table, max_ord);
5030
5031            Ok(())
5032        }
5033    }
5034
5035    unsafe impl<'a, ___E>
5036        ::fidl_next::Encode<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>, ___E>
5037        for &'a BufferCollectionTokenDuplicateSyncRequest
5038    where
5039        ___E: ::fidl_next::Encoder + ?Sized,
5040    {
5041        #[inline]
5042        fn encode(
5043            self,
5044            encoder: &mut ___E,
5045            out: &mut ::core::mem::MaybeUninit<
5046                crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>,
5047            >,
5048            _: (),
5049        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5050            ::fidl_next::munge!(let crate::wire::BufferCollectionTokenDuplicateSyncRequest { table } = out);
5051
5052            let max_ord = self.__max_ordinal();
5053
5054            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5055            ::fidl_next::Wire::zero_padding(&mut out);
5056
5057            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5058                ::fidl_next::wire::Envelope,
5059            >(encoder, max_ord);
5060
5061            for i in 1..=max_ord {
5062                match i {
5063                    1 => {
5064                        if let Some(value) = &self.rights_attenuation_masks {
5065                            ::fidl_next::wire::Envelope::encode_value::<
5066                                ::fidl_next::wire::Vector<
5067                                    'static,
5068                                    ::fidl_next::wire::fuchsia::Rights,
5069                                >,
5070                                ___E,
5071                            >(
5072                                value, preallocated.encoder, &mut out, (64, ())
5073                            )?;
5074                        } else {
5075                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5076                        }
5077                    }
5078
5079                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5080                }
5081                unsafe {
5082                    preallocated.write_next(out.assume_init_ref());
5083                }
5084            }
5085
5086            ::fidl_next::wire::Table::encode_len(table, max_ord);
5087
5088            Ok(())
5089        }
5090    }
5091
5092    impl<'de> ::fidl_next::FromWire<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>>
5093        for BufferCollectionTokenDuplicateSyncRequest
5094    {
5095        #[inline]
5096        fn from_wire(wire_: crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>) -> Self {
5097            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5098
5099            let rights_attenuation_masks = wire_.table.get(1);
5100
5101            Self {
5102
5103
5104                rights_attenuation_masks: rights_attenuation_masks.map(|envelope| ::fidl_next::FromWire::from_wire(
5105                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5106                )),
5107
5108        }
5109        }
5110    }
5111
5112    impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>>
5113        for BufferCollectionTokenDuplicateSyncRequest
5114    {
5115        #[inline]
5116        fn from_wire_ref(
5117            wire: &crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>,
5118        ) -> Self {
5119            Self {
5120
5121
5122                rights_attenuation_masks: wire.table.get(1)
5123                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5124                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5125                    )),
5126
5127        }
5128        }
5129    }
5130
5131    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5132    pub struct BufferCollectionTokenGroupCreateChildrenSyncRequest {
5133        pub rights_attenuation_masks:
5134            ::core::option::Option<::std::vec::Vec<::fidl_next::fuchsia::zx::Rights>>,
5135    }
5136
5137    impl BufferCollectionTokenGroupCreateChildrenSyncRequest {
5138        fn __max_ordinal(&self) -> usize {
5139            if self.rights_attenuation_masks.is_some() {
5140                return 1;
5141            }
5142
5143            0
5144        }
5145    }
5146
5147    unsafe impl<___E>
5148        ::fidl_next::Encode<
5149            crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5150            ___E,
5151        > for BufferCollectionTokenGroupCreateChildrenSyncRequest
5152    where
5153        ___E: ::fidl_next::Encoder + ?Sized,
5154    {
5155        #[inline]
5156        fn encode(
5157            mut self,
5158            encoder: &mut ___E,
5159            out: &mut ::core::mem::MaybeUninit<
5160                crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5161            >,
5162            _: (),
5163        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5164            ::fidl_next::munge!(let crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest { table } = out);
5165
5166            let max_ord = self.__max_ordinal();
5167
5168            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5169            ::fidl_next::Wire::zero_padding(&mut out);
5170
5171            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5172                ::fidl_next::wire::Envelope,
5173            >(encoder, max_ord);
5174
5175            for i in 1..=max_ord {
5176                match i {
5177                    1 => {
5178                        if let Some(value) = self.rights_attenuation_masks.take() {
5179                            ::fidl_next::wire::Envelope::encode_value::<
5180                                ::fidl_next::wire::Vector<
5181                                    'static,
5182                                    ::fidl_next::wire::fuchsia::Rights,
5183                                >,
5184                                ___E,
5185                            >(
5186                                value, preallocated.encoder, &mut out, (64, ())
5187                            )?;
5188                        } else {
5189                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5190                        }
5191                    }
5192
5193                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5194                }
5195                unsafe {
5196                    preallocated.write_next(out.assume_init_ref());
5197                }
5198            }
5199
5200            ::fidl_next::wire::Table::encode_len(table, max_ord);
5201
5202            Ok(())
5203        }
5204    }
5205
5206    unsafe impl<'a, ___E>
5207        ::fidl_next::Encode<
5208            crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5209            ___E,
5210        > for &'a BufferCollectionTokenGroupCreateChildrenSyncRequest
5211    where
5212        ___E: ::fidl_next::Encoder + ?Sized,
5213    {
5214        #[inline]
5215        fn encode(
5216            self,
5217            encoder: &mut ___E,
5218            out: &mut ::core::mem::MaybeUninit<
5219                crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5220            >,
5221            _: (),
5222        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5223            ::fidl_next::munge!(let crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest { table } = out);
5224
5225            let max_ord = self.__max_ordinal();
5226
5227            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5228            ::fidl_next::Wire::zero_padding(&mut out);
5229
5230            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5231                ::fidl_next::wire::Envelope,
5232            >(encoder, max_ord);
5233
5234            for i in 1..=max_ord {
5235                match i {
5236                    1 => {
5237                        if let Some(value) = &self.rights_attenuation_masks {
5238                            ::fidl_next::wire::Envelope::encode_value::<
5239                                ::fidl_next::wire::Vector<
5240                                    'static,
5241                                    ::fidl_next::wire::fuchsia::Rights,
5242                                >,
5243                                ___E,
5244                            >(
5245                                value, preallocated.encoder, &mut out, (64, ())
5246                            )?;
5247                        } else {
5248                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5249                        }
5250                    }
5251
5252                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5253                }
5254                unsafe {
5255                    preallocated.write_next(out.assume_init_ref());
5256                }
5257            }
5258
5259            ::fidl_next::wire::Table::encode_len(table, max_ord);
5260
5261            Ok(())
5262        }
5263    }
5264
5265    impl<'de>
5266        ::fidl_next::FromWire<crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>>
5267        for BufferCollectionTokenGroupCreateChildrenSyncRequest
5268    {
5269        #[inline]
5270        fn from_wire(
5271            wire_: crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5272        ) -> Self {
5273            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5274
5275            let rights_attenuation_masks = wire_.table.get(1);
5276
5277            Self {
5278
5279
5280                rights_attenuation_masks: rights_attenuation_masks.map(|envelope| ::fidl_next::FromWire::from_wire(
5281                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5282                )),
5283
5284        }
5285        }
5286    }
5287
5288    impl<'de>
5289        ::fidl_next::FromWireRef<
5290            crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5291        > for BufferCollectionTokenGroupCreateChildrenSyncRequest
5292    {
5293        #[inline]
5294        fn from_wire_ref(
5295            wire: &crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5296        ) -> Self {
5297            Self {
5298
5299
5300                rights_attenuation_masks: wire.table.get(1)
5301                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5302                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5303                    )),
5304
5305        }
5306        }
5307    }
5308
5309    #[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"]
5310    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5311    pub struct FormatCostKey {
5312        pub pixel_format:
5313            ::core::option::Option<::fidl_next_common_fuchsia_images2::natural::PixelFormat>,
5314
5315        pub pixel_format_modifier: ::core::option::Option<
5316            ::fidl_next_common_fuchsia_images2::natural::PixelFormatModifier,
5317        >,
5318
5319        pub buffer_usage_bits: ::core::option::Option<crate::natural::BufferUsage>,
5320    }
5321
5322    impl FormatCostKey {
5323        fn __max_ordinal(&self) -> usize {
5324            if self.buffer_usage_bits.is_some() {
5325                return 3;
5326            }
5327
5328            if self.pixel_format_modifier.is_some() {
5329                return 2;
5330            }
5331
5332            if self.pixel_format.is_some() {
5333                return 1;
5334            }
5335
5336            0
5337        }
5338    }
5339
5340    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCostKey<'static>, ___E> for FormatCostKey
5341    where
5342        ___E: ::fidl_next::Encoder + ?Sized,
5343    {
5344        #[inline]
5345        fn encode(
5346            mut self,
5347            encoder: &mut ___E,
5348            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostKey<'static>>,
5349            _: (),
5350        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5351            ::fidl_next::munge!(let crate::wire::FormatCostKey { table } = out);
5352
5353            let max_ord = self.__max_ordinal();
5354
5355            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5356            ::fidl_next::Wire::zero_padding(&mut out);
5357
5358            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5359                ::fidl_next::wire::Envelope,
5360            >(encoder, max_ord);
5361
5362            for i in 1..=max_ord {
5363                match i {
5364                    3 => {
5365                        if let Some(value) = self.buffer_usage_bits.take() {
5366                            ::fidl_next::wire::Envelope::encode_value::<
5367                                crate::wire::BufferUsage<'static>,
5368                                ___E,
5369                            >(
5370                                value, preallocated.encoder, &mut out, ()
5371                            )?;
5372                        } else {
5373                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5374                        }
5375                    }
5376
5377                    2 => {
5378                        if let Some(value) = self.pixel_format_modifier.take() {
5379                            ::fidl_next::wire::Envelope::encode_value::<
5380                                ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
5381                                ___E,
5382                            >(
5383                                value, preallocated.encoder, &mut out, ()
5384                            )?;
5385                        } else {
5386                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5387                        }
5388                    }
5389
5390                    1 => {
5391                        if let Some(value) = self.pixel_format.take() {
5392                            ::fidl_next::wire::Envelope::encode_value::<
5393                                ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
5394                                ___E,
5395                            >(
5396                                value, preallocated.encoder, &mut out, ()
5397                            )?;
5398                        } else {
5399                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5400                        }
5401                    }
5402
5403                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5404                }
5405                unsafe {
5406                    preallocated.write_next(out.assume_init_ref());
5407                }
5408            }
5409
5410            ::fidl_next::wire::Table::encode_len(table, max_ord);
5411
5412            Ok(())
5413        }
5414    }
5415
5416    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCostKey<'static>, ___E>
5417        for &'a FormatCostKey
5418    where
5419        ___E: ::fidl_next::Encoder + ?Sized,
5420    {
5421        #[inline]
5422        fn encode(
5423            self,
5424            encoder: &mut ___E,
5425            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostKey<'static>>,
5426            _: (),
5427        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5428            ::fidl_next::munge!(let crate::wire::FormatCostKey { table } = out);
5429
5430            let max_ord = self.__max_ordinal();
5431
5432            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5433            ::fidl_next::Wire::zero_padding(&mut out);
5434
5435            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5436                ::fidl_next::wire::Envelope,
5437            >(encoder, max_ord);
5438
5439            for i in 1..=max_ord {
5440                match i {
5441                    3 => {
5442                        if let Some(value) = &self.buffer_usage_bits {
5443                            ::fidl_next::wire::Envelope::encode_value::<
5444                                crate::wire::BufferUsage<'static>,
5445                                ___E,
5446                            >(
5447                                value, preallocated.encoder, &mut out, ()
5448                            )?;
5449                        } else {
5450                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5451                        }
5452                    }
5453
5454                    2 => {
5455                        if let Some(value) = &self.pixel_format_modifier {
5456                            ::fidl_next::wire::Envelope::encode_value::<
5457                                ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
5458                                ___E,
5459                            >(
5460                                value, preallocated.encoder, &mut out, ()
5461                            )?;
5462                        } else {
5463                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5464                        }
5465                    }
5466
5467                    1 => {
5468                        if let Some(value) = &self.pixel_format {
5469                            ::fidl_next::wire::Envelope::encode_value::<
5470                                ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
5471                                ___E,
5472                            >(
5473                                value, preallocated.encoder, &mut out, ()
5474                            )?;
5475                        } else {
5476                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5477                        }
5478                    }
5479
5480                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5481                }
5482                unsafe {
5483                    preallocated.write_next(out.assume_init_ref());
5484                }
5485            }
5486
5487            ::fidl_next::wire::Table::encode_len(table, max_ord);
5488
5489            Ok(())
5490        }
5491    }
5492
5493    impl<'de> ::fidl_next::FromWire<crate::wire::FormatCostKey<'de>> for FormatCostKey {
5494        #[inline]
5495        fn from_wire(wire_: crate::wire::FormatCostKey<'de>) -> Self {
5496            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5497
5498            let pixel_format = wire_.table.get(1);
5499
5500            let pixel_format_modifier = wire_.table.get(2);
5501
5502            let buffer_usage_bits = wire_.table.get(3);
5503
5504            Self {
5505
5506
5507                pixel_format: pixel_format.map(|envelope| ::fidl_next::FromWire::from_wire(
5508                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
5509                )),
5510
5511
5512                pixel_format_modifier: pixel_format_modifier.map(|envelope| ::fidl_next::FromWire::from_wire(
5513                    unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
5514                )),
5515
5516
5517                buffer_usage_bits: buffer_usage_bits.map(|envelope| ::fidl_next::FromWire::from_wire(
5518                    unsafe { envelope.read_unchecked::<crate::wire::BufferUsage<'de>>() }
5519                )),
5520
5521        }
5522        }
5523    }
5524
5525    impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCostKey<'de>> for FormatCostKey {
5526        #[inline]
5527        fn from_wire_ref(wire: &crate::wire::FormatCostKey<'de>) -> Self {
5528            Self {
5529
5530
5531                pixel_format: wire.table.get(1)
5532                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5533                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
5534                    )),
5535
5536
5537                pixel_format_modifier: wire.table.get(2)
5538                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5539                        unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
5540                    )),
5541
5542
5543                buffer_usage_bits: wire.table.get(3)
5544                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5545                        unsafe { envelope.deref_unchecked::<crate::wire::BufferUsage<'de>>() }
5546                    )),
5547
5548        }
5549        }
5550    }
5551
5552    #[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"]
5553    #[derive(Debug, Default, Copy, Clone, PartialEq, PartialOrd)]
5554    pub struct FormatCostEntry {
5555        pub key: ::core::option::Option<crate::natural::FormatCostKey>,
5556
5557        pub cost: ::core::option::Option<f32>,
5558    }
5559
5560    impl FormatCostEntry {
5561        fn __max_ordinal(&self) -> usize {
5562            if self.cost.is_some() {
5563                return 2;
5564            }
5565
5566            if self.key.is_some() {
5567                return 1;
5568            }
5569
5570            0
5571        }
5572    }
5573
5574    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCostEntry<'static>, ___E>
5575        for FormatCostEntry
5576    where
5577        ___E: ::fidl_next::Encoder + ?Sized,
5578    {
5579        #[inline]
5580        fn encode(
5581            mut self,
5582            encoder: &mut ___E,
5583            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostEntry<'static>>,
5584            _: (),
5585        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5586            ::fidl_next::munge!(let crate::wire::FormatCostEntry { table } = out);
5587
5588            let max_ord = self.__max_ordinal();
5589
5590            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5591            ::fidl_next::Wire::zero_padding(&mut out);
5592
5593            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5594                ::fidl_next::wire::Envelope,
5595            >(encoder, max_ord);
5596
5597            for i in 1..=max_ord {
5598                match i {
5599                    2 => {
5600                        if let Some(value) = self.cost.take() {
5601                            ::fidl_next::wire::Envelope::encode_value::<
5602                                ::fidl_next::wire::Float32,
5603                                ___E,
5604                            >(
5605                                value, preallocated.encoder, &mut out, ()
5606                            )?;
5607                        } else {
5608                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5609                        }
5610                    }
5611
5612                    1 => {
5613                        if let Some(value) = self.key.take() {
5614                            ::fidl_next::wire::Envelope::encode_value::<
5615                                crate::wire::FormatCostKey<'static>,
5616                                ___E,
5617                            >(
5618                                value, preallocated.encoder, &mut out, ()
5619                            )?;
5620                        } else {
5621                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5622                        }
5623                    }
5624
5625                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5626                }
5627                unsafe {
5628                    preallocated.write_next(out.assume_init_ref());
5629                }
5630            }
5631
5632            ::fidl_next::wire::Table::encode_len(table, max_ord);
5633
5634            Ok(())
5635        }
5636    }
5637
5638    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCostEntry<'static>, ___E>
5639        for &'a FormatCostEntry
5640    where
5641        ___E: ::fidl_next::Encoder + ?Sized,
5642    {
5643        #[inline]
5644        fn encode(
5645            self,
5646            encoder: &mut ___E,
5647            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostEntry<'static>>,
5648            _: (),
5649        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5650            ::fidl_next::munge!(let crate::wire::FormatCostEntry { table } = out);
5651
5652            let max_ord = self.__max_ordinal();
5653
5654            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5655            ::fidl_next::Wire::zero_padding(&mut out);
5656
5657            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5658                ::fidl_next::wire::Envelope,
5659            >(encoder, max_ord);
5660
5661            for i in 1..=max_ord {
5662                match i {
5663                    2 => {
5664                        if let Some(value) = &self.cost {
5665                            ::fidl_next::wire::Envelope::encode_value::<
5666                                ::fidl_next::wire::Float32,
5667                                ___E,
5668                            >(
5669                                value, preallocated.encoder, &mut out, ()
5670                            )?;
5671                        } else {
5672                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5673                        }
5674                    }
5675
5676                    1 => {
5677                        if let Some(value) = &self.key {
5678                            ::fidl_next::wire::Envelope::encode_value::<
5679                                crate::wire::FormatCostKey<'static>,
5680                                ___E,
5681                            >(
5682                                value, preallocated.encoder, &mut out, ()
5683                            )?;
5684                        } else {
5685                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5686                        }
5687                    }
5688
5689                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5690                }
5691                unsafe {
5692                    preallocated.write_next(out.assume_init_ref());
5693                }
5694            }
5695
5696            ::fidl_next::wire::Table::encode_len(table, max_ord);
5697
5698            Ok(())
5699        }
5700    }
5701
5702    impl<'de> ::fidl_next::FromWire<crate::wire::FormatCostEntry<'de>> for FormatCostEntry {
5703        #[inline]
5704        fn from_wire(wire_: crate::wire::FormatCostEntry<'de>) -> Self {
5705            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5706
5707            let key = wire_.table.get(1);
5708
5709            let cost = wire_.table.get(2);
5710
5711            Self {
5712                key: key.map(|envelope| {
5713                    ::fidl_next::FromWire::from_wire(unsafe {
5714                        envelope.read_unchecked::<crate::wire::FormatCostKey<'de>>()
5715                    })
5716                }),
5717
5718                cost: cost.map(|envelope| {
5719                    ::fidl_next::FromWire::from_wire(unsafe {
5720                        envelope.read_unchecked::<::fidl_next::wire::Float32>()
5721                    })
5722                }),
5723            }
5724        }
5725    }
5726
5727    impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCostEntry<'de>> for FormatCostEntry {
5728        #[inline]
5729        fn from_wire_ref(wire: &crate::wire::FormatCostEntry<'de>) -> Self {
5730            Self {
5731                key: wire.table.get(1).map(|envelope| {
5732                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5733                        envelope.deref_unchecked::<crate::wire::FormatCostKey<'de>>()
5734                    })
5735                }),
5736
5737                cost: wire.table.get(2).map(|envelope| {
5738                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5739                        envelope.deref_unchecked::<::fidl_next::wire::Float32>()
5740                    })
5741                }),
5742            }
5743        }
5744    }
5745
5746    #[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"]
5747    #[derive(Debug, Default, Clone, PartialEq, PartialOrd)]
5748    pub struct Config {
5749        pub format_costs: ::core::option::Option<::std::vec::Vec<crate::natural::FormatCostEntry>>,
5750    }
5751
5752    impl Config {
5753        fn __max_ordinal(&self) -> usize {
5754            if self.format_costs.is_some() {
5755                return 1;
5756            }
5757
5758            0
5759        }
5760    }
5761
5762    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Config<'static>, ___E> for Config
5763    where
5764        ___E: ::fidl_next::Encoder + ?Sized,
5765    {
5766        #[inline]
5767        fn encode(
5768            mut self,
5769            encoder: &mut ___E,
5770            out: &mut ::core::mem::MaybeUninit<crate::wire::Config<'static>>,
5771            _: (),
5772        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5773            ::fidl_next::munge!(let crate::wire::Config { table } = out);
5774
5775            let max_ord = self.__max_ordinal();
5776
5777            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5778            ::fidl_next::Wire::zero_padding(&mut out);
5779
5780            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5781                ::fidl_next::wire::Envelope,
5782            >(encoder, max_ord);
5783
5784            for i in 1..=max_ord {
5785                match i {
5786                    1 => {
5787                        if let Some(value) = self.format_costs.take() {
5788                            ::fidl_next::wire::Envelope::encode_value::<
5789                                ::fidl_next::wire::Vector<
5790                                    'static,
5791                                    crate::wire::FormatCostEntry<'static>,
5792                                >,
5793                                ___E,
5794                            >(
5795                                value, preallocated.encoder, &mut out, (4294967295, ())
5796                            )?;
5797                        } else {
5798                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5799                        }
5800                    }
5801
5802                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5803                }
5804                unsafe {
5805                    preallocated.write_next(out.assume_init_ref());
5806                }
5807            }
5808
5809            ::fidl_next::wire::Table::encode_len(table, max_ord);
5810
5811            Ok(())
5812        }
5813    }
5814
5815    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Config<'static>, ___E> for &'a Config
5816    where
5817        ___E: ::fidl_next::Encoder + ?Sized,
5818    {
5819        #[inline]
5820        fn encode(
5821            self,
5822            encoder: &mut ___E,
5823            out: &mut ::core::mem::MaybeUninit<crate::wire::Config<'static>>,
5824            _: (),
5825        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5826            ::fidl_next::munge!(let crate::wire::Config { table } = out);
5827
5828            let max_ord = self.__max_ordinal();
5829
5830            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5831            ::fidl_next::Wire::zero_padding(&mut out);
5832
5833            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5834                ::fidl_next::wire::Envelope,
5835            >(encoder, max_ord);
5836
5837            for i in 1..=max_ord {
5838                match i {
5839                    1 => {
5840                        if let Some(value) = &self.format_costs {
5841                            ::fidl_next::wire::Envelope::encode_value::<
5842                                ::fidl_next::wire::Vector<
5843                                    'static,
5844                                    crate::wire::FormatCostEntry<'static>,
5845                                >,
5846                                ___E,
5847                            >(
5848                                value, preallocated.encoder, &mut out, (4294967295, ())
5849                            )?;
5850                        } else {
5851                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5852                        }
5853                    }
5854
5855                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5856                }
5857                unsafe {
5858                    preallocated.write_next(out.assume_init_ref());
5859                }
5860            }
5861
5862            ::fidl_next::wire::Table::encode_len(table, max_ord);
5863
5864            Ok(())
5865        }
5866    }
5867
5868    impl<'de> ::fidl_next::FromWire<crate::wire::Config<'de>> for Config {
5869        #[inline]
5870        fn from_wire(wire_: crate::wire::Config<'de>) -> Self {
5871            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5872
5873            let format_costs = wire_.table.get(1);
5874
5875            Self {
5876
5877
5878                format_costs: format_costs.map(|envelope| ::fidl_next::FromWire::from_wire(
5879                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
5880                )),
5881
5882        }
5883        }
5884    }
5885
5886    impl<'de> ::fidl_next::FromWireRef<crate::wire::Config<'de>> for Config {
5887        #[inline]
5888        fn from_wire_ref(wire: &crate::wire::Config<'de>) -> Self {
5889            Self {
5890
5891
5892                format_costs: wire.table.get(1)
5893                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5894                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
5895                    )),
5896
5897        }
5898        }
5899    }
5900
5901    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5902    pub struct DynamicSecureHeap {
5903        pub heap: ::core::option::Option<crate::natural::Heap>,
5904    }
5905
5906    impl DynamicSecureHeap {
5907        fn __max_ordinal(&self) -> usize {
5908            if self.heap.is_some() {
5909                return 1;
5910            }
5911
5912            0
5913        }
5914    }
5915
5916    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DynamicSecureHeap<'static>, ___E>
5917        for DynamicSecureHeap
5918    where
5919        ___E: ::fidl_next::Encoder + ?Sized,
5920    {
5921        #[inline]
5922        fn encode(
5923            mut self,
5924            encoder: &mut ___E,
5925            out: &mut ::core::mem::MaybeUninit<crate::wire::DynamicSecureHeap<'static>>,
5926            _: (),
5927        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5928            ::fidl_next::munge!(let crate::wire::DynamicSecureHeap { table } = out);
5929
5930            let max_ord = self.__max_ordinal();
5931
5932            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5933            ::fidl_next::Wire::zero_padding(&mut out);
5934
5935            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5936                ::fidl_next::wire::Envelope,
5937            >(encoder, max_ord);
5938
5939            for i in 1..=max_ord {
5940                match i {
5941                    1 => {
5942                        if let Some(value) = self.heap.take() {
5943                            ::fidl_next::wire::Envelope::encode_value::<
5944                                crate::wire::Heap<'static>,
5945                                ___E,
5946                            >(
5947                                value, preallocated.encoder, &mut out, ()
5948                            )?;
5949                        } else {
5950                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
5951                        }
5952                    }
5953
5954                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5955                }
5956                unsafe {
5957                    preallocated.write_next(out.assume_init_ref());
5958                }
5959            }
5960
5961            ::fidl_next::wire::Table::encode_len(table, max_ord);
5962
5963            Ok(())
5964        }
5965    }
5966
5967    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DynamicSecureHeap<'static>, ___E>
5968        for &'a DynamicSecureHeap
5969    where
5970        ___E: ::fidl_next::Encoder + ?Sized,
5971    {
5972        #[inline]
5973        fn encode(
5974            self,
5975            encoder: &mut ___E,
5976            out: &mut ::core::mem::MaybeUninit<crate::wire::DynamicSecureHeap<'static>>,
5977            _: (),
5978        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5979            ::fidl_next::munge!(let crate::wire::DynamicSecureHeap { table } = out);
5980
5981            let max_ord = self.__max_ordinal();
5982
5983            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5984            ::fidl_next::Wire::zero_padding(&mut out);
5985
5986            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5987                ::fidl_next::wire::Envelope,
5988            >(encoder, max_ord);
5989
5990            for i in 1..=max_ord {
5991                match i {
5992                    1 => {
5993                        if let Some(value) = &self.heap {
5994                            ::fidl_next::wire::Envelope::encode_value::<
5995                                crate::wire::Heap<'static>,
5996                                ___E,
5997                            >(
5998                                value, preallocated.encoder, &mut out, ()
5999                            )?;
6000                        } else {
6001                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6002                        }
6003                    }
6004
6005                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6006                }
6007                unsafe {
6008                    preallocated.write_next(out.assume_init_ref());
6009                }
6010            }
6011
6012            ::fidl_next::wire::Table::encode_len(table, max_ord);
6013
6014            Ok(())
6015        }
6016    }
6017
6018    impl<'de> ::fidl_next::FromWire<crate::wire::DynamicSecureHeap<'de>> for DynamicSecureHeap {
6019        #[inline]
6020        fn from_wire(wire_: crate::wire::DynamicSecureHeap<'de>) -> Self {
6021            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6022
6023            let heap = wire_.table.get(1);
6024
6025            Self {
6026                heap: heap.map(|envelope| {
6027                    ::fidl_next::FromWire::from_wire(unsafe {
6028                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
6029                    })
6030                }),
6031            }
6032        }
6033    }
6034
6035    impl<'de> ::fidl_next::FromWireRef<crate::wire::DynamicSecureHeap<'de>> for DynamicSecureHeap {
6036        #[inline]
6037        fn from_wire_ref(wire: &crate::wire::DynamicSecureHeap<'de>) -> Self {
6038            Self {
6039                heap: wire.table.get(1).map(|envelope| {
6040                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6041                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
6042                    })
6043                }),
6044            }
6045        }
6046    }
6047
6048    #[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"]
6049    #[derive(Debug, Default, Clone, PartialEq, PartialOrd)]
6050    pub struct FormatCosts {
6051        pub format_costs: ::core::option::Option<::std::vec::Vec<crate::natural::FormatCostEntry>>,
6052    }
6053
6054    impl FormatCosts {
6055        fn __max_ordinal(&self) -> usize {
6056            if self.format_costs.is_some() {
6057                return 1;
6058            }
6059
6060            0
6061        }
6062    }
6063
6064    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCosts<'static>, ___E> for FormatCosts
6065    where
6066        ___E: ::fidl_next::Encoder + ?Sized,
6067    {
6068        #[inline]
6069        fn encode(
6070            mut self,
6071            encoder: &mut ___E,
6072            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCosts<'static>>,
6073            _: (),
6074        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6075            ::fidl_next::munge!(let crate::wire::FormatCosts { table } = out);
6076
6077            let max_ord = self.__max_ordinal();
6078
6079            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6080            ::fidl_next::Wire::zero_padding(&mut out);
6081
6082            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6083                ::fidl_next::wire::Envelope,
6084            >(encoder, max_ord);
6085
6086            for i in 1..=max_ord {
6087                match i {
6088                    1 => {
6089                        if let Some(value) = self.format_costs.take() {
6090                            ::fidl_next::wire::Envelope::encode_value::<
6091                                ::fidl_next::wire::Vector<
6092                                    'static,
6093                                    crate::wire::FormatCostEntry<'static>,
6094                                >,
6095                                ___E,
6096                            >(
6097                                value, preallocated.encoder, &mut out, (4294967295, ())
6098                            )?;
6099                        } else {
6100                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6101                        }
6102                    }
6103
6104                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6105                }
6106                unsafe {
6107                    preallocated.write_next(out.assume_init_ref());
6108                }
6109            }
6110
6111            ::fidl_next::wire::Table::encode_len(table, max_ord);
6112
6113            Ok(())
6114        }
6115    }
6116
6117    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCosts<'static>, ___E>
6118        for &'a FormatCosts
6119    where
6120        ___E: ::fidl_next::Encoder + ?Sized,
6121    {
6122        #[inline]
6123        fn encode(
6124            self,
6125            encoder: &mut ___E,
6126            out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCosts<'static>>,
6127            _: (),
6128        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6129            ::fidl_next::munge!(let crate::wire::FormatCosts { table } = out);
6130
6131            let max_ord = self.__max_ordinal();
6132
6133            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6134            ::fidl_next::Wire::zero_padding(&mut out);
6135
6136            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6137                ::fidl_next::wire::Envelope,
6138            >(encoder, max_ord);
6139
6140            for i in 1..=max_ord {
6141                match i {
6142                    1 => {
6143                        if let Some(value) = &self.format_costs {
6144                            ::fidl_next::wire::Envelope::encode_value::<
6145                                ::fidl_next::wire::Vector<
6146                                    'static,
6147                                    crate::wire::FormatCostEntry<'static>,
6148                                >,
6149                                ___E,
6150                            >(
6151                                value, preallocated.encoder, &mut out, (4294967295, ())
6152                            )?;
6153                        } else {
6154                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6155                        }
6156                    }
6157
6158                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6159                }
6160                unsafe {
6161                    preallocated.write_next(out.assume_init_ref());
6162                }
6163            }
6164
6165            ::fidl_next::wire::Table::encode_len(table, max_ord);
6166
6167            Ok(())
6168        }
6169    }
6170
6171    impl<'de> ::fidl_next::FromWire<crate::wire::FormatCosts<'de>> for FormatCosts {
6172        #[inline]
6173        fn from_wire(wire_: crate::wire::FormatCosts<'de>) -> Self {
6174            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6175
6176            let format_costs = wire_.table.get(1);
6177
6178            Self {
6179
6180
6181                format_costs: format_costs.map(|envelope| ::fidl_next::FromWire::from_wire(
6182                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
6183                )),
6184
6185        }
6186        }
6187    }
6188
6189    impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCosts<'de>> for FormatCosts {
6190        #[inline]
6191        fn from_wire_ref(wire: &crate::wire::FormatCosts<'de>) -> Self {
6192            Self {
6193
6194
6195                format_costs: wire.table.get(1)
6196                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6197                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
6198                    )),
6199
6200        }
6201        }
6202    }
6203
6204    #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6205    pub struct SecureHeapRange {
6206        pub physical_address: ::core::option::Option<u64>,
6207
6208        pub size_bytes: ::core::option::Option<u64>,
6209    }
6210
6211    impl SecureHeapRange {
6212        fn __max_ordinal(&self) -> usize {
6213            if self.size_bytes.is_some() {
6214                return 2;
6215            }
6216
6217            if self.physical_address.is_some() {
6218                return 1;
6219            }
6220
6221            0
6222        }
6223    }
6224
6225    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapRange<'static>, ___E>
6226        for SecureHeapRange
6227    where
6228        ___E: ::fidl_next::Encoder + ?Sized,
6229    {
6230        #[inline]
6231        fn encode(
6232            mut self,
6233            encoder: &mut ___E,
6234            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapRange<'static>>,
6235            _: (),
6236        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6237            ::fidl_next::munge!(let crate::wire::SecureHeapRange { table } = out);
6238
6239            let max_ord = self.__max_ordinal();
6240
6241            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6242            ::fidl_next::Wire::zero_padding(&mut out);
6243
6244            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6245                ::fidl_next::wire::Envelope,
6246            >(encoder, max_ord);
6247
6248            for i in 1..=max_ord {
6249                match i {
6250                    2 => {
6251                        if let Some(value) = self.size_bytes.take() {
6252                            ::fidl_next::wire::Envelope::encode_value::<
6253                                ::fidl_next::wire::Uint64,
6254                                ___E,
6255                            >(
6256                                value, preallocated.encoder, &mut out, ()
6257                            )?;
6258                        } else {
6259                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6260                        }
6261                    }
6262
6263                    1 => {
6264                        if let Some(value) = self.physical_address.take() {
6265                            ::fidl_next::wire::Envelope::encode_value::<
6266                                ::fidl_next::wire::Uint64,
6267                                ___E,
6268                            >(
6269                                value, preallocated.encoder, &mut out, ()
6270                            )?;
6271                        } else {
6272                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6273                        }
6274                    }
6275
6276                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6277                }
6278                unsafe {
6279                    preallocated.write_next(out.assume_init_ref());
6280                }
6281            }
6282
6283            ::fidl_next::wire::Table::encode_len(table, max_ord);
6284
6285            Ok(())
6286        }
6287    }
6288
6289    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapRange<'static>, ___E>
6290        for &'a SecureHeapRange
6291    where
6292        ___E: ::fidl_next::Encoder + ?Sized,
6293    {
6294        #[inline]
6295        fn encode(
6296            self,
6297            encoder: &mut ___E,
6298            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapRange<'static>>,
6299            _: (),
6300        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6301            ::fidl_next::munge!(let crate::wire::SecureHeapRange { table } = out);
6302
6303            let max_ord = self.__max_ordinal();
6304
6305            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6306            ::fidl_next::Wire::zero_padding(&mut out);
6307
6308            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6309                ::fidl_next::wire::Envelope,
6310            >(encoder, max_ord);
6311
6312            for i in 1..=max_ord {
6313                match i {
6314                    2 => {
6315                        if let Some(value) = &self.size_bytes {
6316                            ::fidl_next::wire::Envelope::encode_value::<
6317                                ::fidl_next::wire::Uint64,
6318                                ___E,
6319                            >(
6320                                value, preallocated.encoder, &mut out, ()
6321                            )?;
6322                        } else {
6323                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6324                        }
6325                    }
6326
6327                    1 => {
6328                        if let Some(value) = &self.physical_address {
6329                            ::fidl_next::wire::Envelope::encode_value::<
6330                                ::fidl_next::wire::Uint64,
6331                                ___E,
6332                            >(
6333                                value, preallocated.encoder, &mut out, ()
6334                            )?;
6335                        } else {
6336                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6337                        }
6338                    }
6339
6340                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6341                }
6342                unsafe {
6343                    preallocated.write_next(out.assume_init_ref());
6344                }
6345            }
6346
6347            ::fidl_next::wire::Table::encode_len(table, max_ord);
6348
6349            Ok(())
6350        }
6351    }
6352
6353    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapRange<'de>> for SecureHeapRange {
6354        #[inline]
6355        fn from_wire(wire_: crate::wire::SecureHeapRange<'de>) -> Self {
6356            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6357
6358            let physical_address = wire_.table.get(1);
6359
6360            let size_bytes = wire_.table.get(2);
6361
6362            Self {
6363                physical_address: physical_address.map(|envelope| {
6364                    ::fidl_next::FromWire::from_wire(unsafe {
6365                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6366                    })
6367                }),
6368
6369                size_bytes: size_bytes.map(|envelope| {
6370                    ::fidl_next::FromWire::from_wire(unsafe {
6371                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6372                    })
6373                }),
6374            }
6375        }
6376    }
6377
6378    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapRange<'de>> for SecureHeapRange {
6379        #[inline]
6380        fn from_wire_ref(wire: &crate::wire::SecureHeapRange<'de>) -> Self {
6381            Self {
6382                physical_address: wire.table.get(1).map(|envelope| {
6383                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6384                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6385                    })
6386                }),
6387
6388                size_bytes: wire.table.get(2).map(|envelope| {
6389                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6390                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6391                    })
6392                }),
6393            }
6394        }
6395    }
6396
6397    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6398    pub struct SecureHeapAndRange {
6399        pub heap: ::core::option::Option<crate::natural::Heap>,
6400
6401        pub range: ::core::option::Option<crate::natural::SecureHeapRange>,
6402    }
6403
6404    impl SecureHeapAndRange {
6405        fn __max_ordinal(&self) -> usize {
6406            if self.range.is_some() {
6407                return 2;
6408            }
6409
6410            if self.heap.is_some() {
6411                return 1;
6412            }
6413
6414            0
6415        }
6416    }
6417
6418    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRange<'static>, ___E>
6419        for SecureHeapAndRange
6420    where
6421        ___E: ::fidl_next::Encoder + ?Sized,
6422    {
6423        #[inline]
6424        fn encode(
6425            mut self,
6426            encoder: &mut ___E,
6427            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRange<'static>>,
6428            _: (),
6429        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6430            ::fidl_next::munge!(let crate::wire::SecureHeapAndRange { table } = out);
6431
6432            let max_ord = self.__max_ordinal();
6433
6434            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6435            ::fidl_next::Wire::zero_padding(&mut out);
6436
6437            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6438                ::fidl_next::wire::Envelope,
6439            >(encoder, max_ord);
6440
6441            for i in 1..=max_ord {
6442                match i {
6443                    2 => {
6444                        if let Some(value) = self.range.take() {
6445                            ::fidl_next::wire::Envelope::encode_value::<
6446                                crate::wire::SecureHeapRange<'static>,
6447                                ___E,
6448                            >(
6449                                value, preallocated.encoder, &mut out, ()
6450                            )?;
6451                        } else {
6452                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6453                        }
6454                    }
6455
6456                    1 => {
6457                        if let Some(value) = self.heap.take() {
6458                            ::fidl_next::wire::Envelope::encode_value::<
6459                                crate::wire::Heap<'static>,
6460                                ___E,
6461                            >(
6462                                value, preallocated.encoder, &mut out, ()
6463                            )?;
6464                        } else {
6465                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6466                        }
6467                    }
6468
6469                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6470                }
6471                unsafe {
6472                    preallocated.write_next(out.assume_init_ref());
6473                }
6474            }
6475
6476            ::fidl_next::wire::Table::encode_len(table, max_ord);
6477
6478            Ok(())
6479        }
6480    }
6481
6482    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRange<'static>, ___E>
6483        for &'a SecureHeapAndRange
6484    where
6485        ___E: ::fidl_next::Encoder + ?Sized,
6486    {
6487        #[inline]
6488        fn encode(
6489            self,
6490            encoder: &mut ___E,
6491            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRange<'static>>,
6492            _: (),
6493        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6494            ::fidl_next::munge!(let crate::wire::SecureHeapAndRange { table } = out);
6495
6496            let max_ord = self.__max_ordinal();
6497
6498            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6499            ::fidl_next::Wire::zero_padding(&mut out);
6500
6501            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6502                ::fidl_next::wire::Envelope,
6503            >(encoder, max_ord);
6504
6505            for i in 1..=max_ord {
6506                match i {
6507                    2 => {
6508                        if let Some(value) = &self.range {
6509                            ::fidl_next::wire::Envelope::encode_value::<
6510                                crate::wire::SecureHeapRange<'static>,
6511                                ___E,
6512                            >(
6513                                value, preallocated.encoder, &mut out, ()
6514                            )?;
6515                        } else {
6516                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6517                        }
6518                    }
6519
6520                    1 => {
6521                        if let Some(value) = &self.heap {
6522                            ::fidl_next::wire::Envelope::encode_value::<
6523                                crate::wire::Heap<'static>,
6524                                ___E,
6525                            >(
6526                                value, preallocated.encoder, &mut out, ()
6527                            )?;
6528                        } else {
6529                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6530                        }
6531                    }
6532
6533                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6534                }
6535                unsafe {
6536                    preallocated.write_next(out.assume_init_ref());
6537                }
6538            }
6539
6540            ::fidl_next::wire::Table::encode_len(table, max_ord);
6541
6542            Ok(())
6543        }
6544    }
6545
6546    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRange<'de>> for SecureHeapAndRange {
6547        #[inline]
6548        fn from_wire(wire_: crate::wire::SecureHeapAndRange<'de>) -> Self {
6549            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6550
6551            let heap = wire_.table.get(1);
6552
6553            let range = wire_.table.get(2);
6554
6555            Self {
6556                heap: heap.map(|envelope| {
6557                    ::fidl_next::FromWire::from_wire(unsafe {
6558                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
6559                    })
6560                }),
6561
6562                range: range.map(|envelope| {
6563                    ::fidl_next::FromWire::from_wire(unsafe {
6564                        envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6565                    })
6566                }),
6567            }
6568        }
6569    }
6570
6571    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRange<'de>> for SecureHeapAndRange {
6572        #[inline]
6573        fn from_wire_ref(wire: &crate::wire::SecureHeapAndRange<'de>) -> Self {
6574            Self {
6575                heap: wire.table.get(1).map(|envelope| {
6576                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6577                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
6578                    })
6579                }),
6580
6581                range: wire.table.get(2).map(|envelope| {
6582                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6583                        envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6584                    })
6585                }),
6586            }
6587        }
6588    }
6589
6590    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6591    pub struct SecureHeapAndRangeModification {
6592        pub heap: ::core::option::Option<crate::natural::Heap>,
6593
6594        pub old_range: ::core::option::Option<crate::natural::SecureHeapRange>,
6595
6596        pub new_range: ::core::option::Option<crate::natural::SecureHeapRange>,
6597    }
6598
6599    impl SecureHeapAndRangeModification {
6600        fn __max_ordinal(&self) -> usize {
6601            if self.new_range.is_some() {
6602                return 3;
6603            }
6604
6605            if self.old_range.is_some() {
6606                return 2;
6607            }
6608
6609            if self.heap.is_some() {
6610                return 1;
6611            }
6612
6613            0
6614        }
6615    }
6616
6617    unsafe impl<___E>
6618        ::fidl_next::Encode<crate::wire::SecureHeapAndRangeModification<'static>, ___E>
6619        for SecureHeapAndRangeModification
6620    where
6621        ___E: ::fidl_next::Encoder + ?Sized,
6622    {
6623        #[inline]
6624        fn encode(
6625            mut self,
6626            encoder: &mut ___E,
6627            out: &mut ::core::mem::MaybeUninit<
6628                crate::wire::SecureHeapAndRangeModification<'static>,
6629            >,
6630            _: (),
6631        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6632            ::fidl_next::munge!(let crate::wire::SecureHeapAndRangeModification { table } = out);
6633
6634            let max_ord = self.__max_ordinal();
6635
6636            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6637            ::fidl_next::Wire::zero_padding(&mut out);
6638
6639            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6640                ::fidl_next::wire::Envelope,
6641            >(encoder, max_ord);
6642
6643            for i in 1..=max_ord {
6644                match i {
6645                    3 => {
6646                        if let Some(value) = self.new_range.take() {
6647                            ::fidl_next::wire::Envelope::encode_value::<
6648                                crate::wire::SecureHeapRange<'static>,
6649                                ___E,
6650                            >(
6651                                value, preallocated.encoder, &mut out, ()
6652                            )?;
6653                        } else {
6654                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6655                        }
6656                    }
6657
6658                    2 => {
6659                        if let Some(value) = self.old_range.take() {
6660                            ::fidl_next::wire::Envelope::encode_value::<
6661                                crate::wire::SecureHeapRange<'static>,
6662                                ___E,
6663                            >(
6664                                value, preallocated.encoder, &mut out, ()
6665                            )?;
6666                        } else {
6667                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6668                        }
6669                    }
6670
6671                    1 => {
6672                        if let Some(value) = self.heap.take() {
6673                            ::fidl_next::wire::Envelope::encode_value::<
6674                                crate::wire::Heap<'static>,
6675                                ___E,
6676                            >(
6677                                value, preallocated.encoder, &mut out, ()
6678                            )?;
6679                        } else {
6680                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6681                        }
6682                    }
6683
6684                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6685                }
6686                unsafe {
6687                    preallocated.write_next(out.assume_init_ref());
6688                }
6689            }
6690
6691            ::fidl_next::wire::Table::encode_len(table, max_ord);
6692
6693            Ok(())
6694        }
6695    }
6696
6697    unsafe impl<'a, ___E>
6698        ::fidl_next::Encode<crate::wire::SecureHeapAndRangeModification<'static>, ___E>
6699        for &'a SecureHeapAndRangeModification
6700    where
6701        ___E: ::fidl_next::Encoder + ?Sized,
6702    {
6703        #[inline]
6704        fn encode(
6705            self,
6706            encoder: &mut ___E,
6707            out: &mut ::core::mem::MaybeUninit<
6708                crate::wire::SecureHeapAndRangeModification<'static>,
6709            >,
6710            _: (),
6711        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6712            ::fidl_next::munge!(let crate::wire::SecureHeapAndRangeModification { table } = out);
6713
6714            let max_ord = self.__max_ordinal();
6715
6716            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6717            ::fidl_next::Wire::zero_padding(&mut out);
6718
6719            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6720                ::fidl_next::wire::Envelope,
6721            >(encoder, max_ord);
6722
6723            for i in 1..=max_ord {
6724                match i {
6725                    3 => {
6726                        if let Some(value) = &self.new_range {
6727                            ::fidl_next::wire::Envelope::encode_value::<
6728                                crate::wire::SecureHeapRange<'static>,
6729                                ___E,
6730                            >(
6731                                value, preallocated.encoder, &mut out, ()
6732                            )?;
6733                        } else {
6734                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6735                        }
6736                    }
6737
6738                    2 => {
6739                        if let Some(value) = &self.old_range {
6740                            ::fidl_next::wire::Envelope::encode_value::<
6741                                crate::wire::SecureHeapRange<'static>,
6742                                ___E,
6743                            >(
6744                                value, preallocated.encoder, &mut out, ()
6745                            )?;
6746                        } else {
6747                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6748                        }
6749                    }
6750
6751                    1 => {
6752                        if let Some(value) = &self.heap {
6753                            ::fidl_next::wire::Envelope::encode_value::<
6754                                crate::wire::Heap<'static>,
6755                                ___E,
6756                            >(
6757                                value, preallocated.encoder, &mut out, ()
6758                            )?;
6759                        } else {
6760                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6761                        }
6762                    }
6763
6764                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6765                }
6766                unsafe {
6767                    preallocated.write_next(out.assume_init_ref());
6768                }
6769            }
6770
6771            ::fidl_next::wire::Table::encode_len(table, max_ord);
6772
6773            Ok(())
6774        }
6775    }
6776
6777    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRangeModification<'de>>
6778        for SecureHeapAndRangeModification
6779    {
6780        #[inline]
6781        fn from_wire(wire_: crate::wire::SecureHeapAndRangeModification<'de>) -> Self {
6782            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6783
6784            let heap = wire_.table.get(1);
6785
6786            let old_range = wire_.table.get(2);
6787
6788            let new_range = wire_.table.get(3);
6789
6790            Self {
6791                heap: heap.map(|envelope| {
6792                    ::fidl_next::FromWire::from_wire(unsafe {
6793                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
6794                    })
6795                }),
6796
6797                old_range: old_range.map(|envelope| {
6798                    ::fidl_next::FromWire::from_wire(unsafe {
6799                        envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6800                    })
6801                }),
6802
6803                new_range: new_range.map(|envelope| {
6804                    ::fidl_next::FromWire::from_wire(unsafe {
6805                        envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6806                    })
6807                }),
6808            }
6809        }
6810    }
6811
6812    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRangeModification<'de>>
6813        for SecureHeapAndRangeModification
6814    {
6815        #[inline]
6816        fn from_wire_ref(wire: &crate::wire::SecureHeapAndRangeModification<'de>) -> Self {
6817            Self {
6818                heap: wire.table.get(1).map(|envelope| {
6819                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6820                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
6821                    })
6822                }),
6823
6824                old_range: wire.table.get(2).map(|envelope| {
6825                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6826                        envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6827                    })
6828                }),
6829
6830                new_range: wire.table.get(3).map(|envelope| {
6831                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6832                        envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6833                    })
6834                }),
6835            }
6836        }
6837    }
6838
6839    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6840    pub struct SecureHeapAndRanges {
6841        pub heap: ::core::option::Option<crate::natural::Heap>,
6842
6843        pub ranges: ::core::option::Option<::std::vec::Vec<crate::natural::SecureHeapRange>>,
6844    }
6845
6846    impl SecureHeapAndRanges {
6847        fn __max_ordinal(&self) -> usize {
6848            if self.ranges.is_some() {
6849                return 2;
6850            }
6851
6852            if self.heap.is_some() {
6853                return 1;
6854            }
6855
6856            0
6857        }
6858    }
6859
6860    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRanges<'static>, ___E>
6861        for SecureHeapAndRanges
6862    where
6863        ___E: ::fidl_next::Encoder + ?Sized,
6864    {
6865        #[inline]
6866        fn encode(
6867            mut self,
6868            encoder: &mut ___E,
6869            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRanges<'static>>,
6870            _: (),
6871        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6872            ::fidl_next::munge!(let crate::wire::SecureHeapAndRanges { table } = out);
6873
6874            let max_ord = self.__max_ordinal();
6875
6876            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6877            ::fidl_next::Wire::zero_padding(&mut out);
6878
6879            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6880                ::fidl_next::wire::Envelope,
6881            >(encoder, max_ord);
6882
6883            for i in 1..=max_ord {
6884                match i {
6885                    2 => {
6886                        if let Some(value) = self.ranges.take() {
6887                            ::fidl_next::wire::Envelope::encode_value::<
6888                                ::fidl_next::wire::Vector<
6889                                    'static,
6890                                    crate::wire::SecureHeapRange<'static>,
6891                                >,
6892                                ___E,
6893                            >(
6894                                value, preallocated.encoder, &mut out, (128, ())
6895                            )?;
6896                        } else {
6897                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6898                        }
6899                    }
6900
6901                    1 => {
6902                        if let Some(value) = self.heap.take() {
6903                            ::fidl_next::wire::Envelope::encode_value::<
6904                                crate::wire::Heap<'static>,
6905                                ___E,
6906                            >(
6907                                value, preallocated.encoder, &mut out, ()
6908                            )?;
6909                        } else {
6910                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6911                        }
6912                    }
6913
6914                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6915                }
6916                unsafe {
6917                    preallocated.write_next(out.assume_init_ref());
6918                }
6919            }
6920
6921            ::fidl_next::wire::Table::encode_len(table, max_ord);
6922
6923            Ok(())
6924        }
6925    }
6926
6927    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRanges<'static>, ___E>
6928        for &'a SecureHeapAndRanges
6929    where
6930        ___E: ::fidl_next::Encoder + ?Sized,
6931    {
6932        #[inline]
6933        fn encode(
6934            self,
6935            encoder: &mut ___E,
6936            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRanges<'static>>,
6937            _: (),
6938        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6939            ::fidl_next::munge!(let crate::wire::SecureHeapAndRanges { table } = out);
6940
6941            let max_ord = self.__max_ordinal();
6942
6943            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6944            ::fidl_next::Wire::zero_padding(&mut out);
6945
6946            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6947                ::fidl_next::wire::Envelope,
6948            >(encoder, max_ord);
6949
6950            for i in 1..=max_ord {
6951                match i {
6952                    2 => {
6953                        if let Some(value) = &self.ranges {
6954                            ::fidl_next::wire::Envelope::encode_value::<
6955                                ::fidl_next::wire::Vector<
6956                                    'static,
6957                                    crate::wire::SecureHeapRange<'static>,
6958                                >,
6959                                ___E,
6960                            >(
6961                                value, preallocated.encoder, &mut out, (128, ())
6962                            )?;
6963                        } else {
6964                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6965                        }
6966                    }
6967
6968                    1 => {
6969                        if let Some(value) = &self.heap {
6970                            ::fidl_next::wire::Envelope::encode_value::<
6971                                crate::wire::Heap<'static>,
6972                                ___E,
6973                            >(
6974                                value, preallocated.encoder, &mut out, ()
6975                            )?;
6976                        } else {
6977                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
6978                        }
6979                    }
6980
6981                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6982                }
6983                unsafe {
6984                    preallocated.write_next(out.assume_init_ref());
6985                }
6986            }
6987
6988            ::fidl_next::wire::Table::encode_len(table, max_ord);
6989
6990            Ok(())
6991        }
6992    }
6993
6994    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRanges<'de>> for SecureHeapAndRanges {
6995        #[inline]
6996        fn from_wire(wire_: crate::wire::SecureHeapAndRanges<'de>) -> Self {
6997            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6998
6999            let heap = wire_.table.get(1);
7000
7001            let ranges = wire_.table.get(2);
7002
7003            Self {
7004
7005
7006                heap: heap.map(|envelope| ::fidl_next::FromWire::from_wire(
7007                    unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() }
7008                )),
7009
7010
7011                ranges: ranges.map(|envelope| ::fidl_next::FromWire::from_wire(
7012                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>() }
7013                )),
7014
7015        }
7016        }
7017    }
7018
7019    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRanges<'de>> for SecureHeapAndRanges {
7020        #[inline]
7021        fn from_wire_ref(wire: &crate::wire::SecureHeapAndRanges<'de>) -> Self {
7022            Self {
7023
7024
7025                heap: wire.table.get(1)
7026                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7027                        unsafe { envelope.deref_unchecked::<crate::wire::Heap<'de>>() }
7028                    )),
7029
7030
7031                ranges: wire.table.get(2)
7032                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7033                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>() }
7034                    )),
7035
7036        }
7037        }
7038    }
7039
7040    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7041    pub struct SecureHeapProperties {
7042        pub heap: ::core::option::Option<crate::natural::Heap>,
7043
7044        pub dynamic_protection_ranges: ::core::option::Option<bool>,
7045
7046        pub protected_range_granularity: ::core::option::Option<u32>,
7047
7048        pub max_protected_range_count: ::core::option::Option<u64>,
7049
7050        pub is_mod_protected_range_available: ::core::option::Option<bool>,
7051    }
7052
7053    impl SecureHeapProperties {
7054        fn __max_ordinal(&self) -> usize {
7055            if self.is_mod_protected_range_available.is_some() {
7056                return 5;
7057            }
7058
7059            if self.max_protected_range_count.is_some() {
7060                return 4;
7061            }
7062
7063            if self.protected_range_granularity.is_some() {
7064                return 3;
7065            }
7066
7067            if self.dynamic_protection_ranges.is_some() {
7068                return 2;
7069            }
7070
7071            if self.heap.is_some() {
7072                return 1;
7073            }
7074
7075            0
7076        }
7077    }
7078
7079    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapProperties<'static>, ___E>
7080        for SecureHeapProperties
7081    where
7082        ___E: ::fidl_next::Encoder + ?Sized,
7083    {
7084        #[inline]
7085        fn encode(
7086            mut self,
7087            encoder: &mut ___E,
7088            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapProperties<'static>>,
7089            _: (),
7090        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7091            ::fidl_next::munge!(let crate::wire::SecureHeapProperties { table } = out);
7092
7093            let max_ord = self.__max_ordinal();
7094
7095            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7096            ::fidl_next::Wire::zero_padding(&mut out);
7097
7098            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7099                ::fidl_next::wire::Envelope,
7100            >(encoder, max_ord);
7101
7102            for i in 1..=max_ord {
7103                match i {
7104                    5 => {
7105                        if let Some(value) = self.is_mod_protected_range_available.take() {
7106                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7107                                value,
7108                                preallocated.encoder,
7109                                &mut out,
7110                                (),
7111                            )?;
7112                        } else {
7113                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7114                        }
7115                    }
7116
7117                    4 => {
7118                        if let Some(value) = self.max_protected_range_count.take() {
7119                            ::fidl_next::wire::Envelope::encode_value::<
7120                                ::fidl_next::wire::Uint64,
7121                                ___E,
7122                            >(
7123                                value, preallocated.encoder, &mut out, ()
7124                            )?;
7125                        } else {
7126                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7127                        }
7128                    }
7129
7130                    3 => {
7131                        if let Some(value) = self.protected_range_granularity.take() {
7132                            ::fidl_next::wire::Envelope::encode_value::<
7133                                ::fidl_next::wire::Uint32,
7134                                ___E,
7135                            >(
7136                                value, preallocated.encoder, &mut out, ()
7137                            )?;
7138                        } else {
7139                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7140                        }
7141                    }
7142
7143                    2 => {
7144                        if let Some(value) = self.dynamic_protection_ranges.take() {
7145                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7146                                value,
7147                                preallocated.encoder,
7148                                &mut out,
7149                                (),
7150                            )?;
7151                        } else {
7152                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7153                        }
7154                    }
7155
7156                    1 => {
7157                        if let Some(value) = self.heap.take() {
7158                            ::fidl_next::wire::Envelope::encode_value::<
7159                                crate::wire::Heap<'static>,
7160                                ___E,
7161                            >(
7162                                value, preallocated.encoder, &mut out, ()
7163                            )?;
7164                        } else {
7165                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7166                        }
7167                    }
7168
7169                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7170                }
7171                unsafe {
7172                    preallocated.write_next(out.assume_init_ref());
7173                }
7174            }
7175
7176            ::fidl_next::wire::Table::encode_len(table, max_ord);
7177
7178            Ok(())
7179        }
7180    }
7181
7182    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapProperties<'static>, ___E>
7183        for &'a SecureHeapProperties
7184    where
7185        ___E: ::fidl_next::Encoder + ?Sized,
7186    {
7187        #[inline]
7188        fn encode(
7189            self,
7190            encoder: &mut ___E,
7191            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapProperties<'static>>,
7192            _: (),
7193        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7194            ::fidl_next::munge!(let crate::wire::SecureHeapProperties { table } = out);
7195
7196            let max_ord = self.__max_ordinal();
7197
7198            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7199            ::fidl_next::Wire::zero_padding(&mut out);
7200
7201            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7202                ::fidl_next::wire::Envelope,
7203            >(encoder, max_ord);
7204
7205            for i in 1..=max_ord {
7206                match i {
7207                    5 => {
7208                        if let Some(value) = &self.is_mod_protected_range_available {
7209                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7210                                value,
7211                                preallocated.encoder,
7212                                &mut out,
7213                                (),
7214                            )?;
7215                        } else {
7216                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7217                        }
7218                    }
7219
7220                    4 => {
7221                        if let Some(value) = &self.max_protected_range_count {
7222                            ::fidl_next::wire::Envelope::encode_value::<
7223                                ::fidl_next::wire::Uint64,
7224                                ___E,
7225                            >(
7226                                value, preallocated.encoder, &mut out, ()
7227                            )?;
7228                        } else {
7229                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7230                        }
7231                    }
7232
7233                    3 => {
7234                        if let Some(value) = &self.protected_range_granularity {
7235                            ::fidl_next::wire::Envelope::encode_value::<
7236                                ::fidl_next::wire::Uint32,
7237                                ___E,
7238                            >(
7239                                value, preallocated.encoder, &mut out, ()
7240                            )?;
7241                        } else {
7242                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7243                        }
7244                    }
7245
7246                    2 => {
7247                        if let Some(value) = &self.dynamic_protection_ranges {
7248                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7249                                value,
7250                                preallocated.encoder,
7251                                &mut out,
7252                                (),
7253                            )?;
7254                        } else {
7255                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7256                        }
7257                    }
7258
7259                    1 => {
7260                        if let Some(value) = &self.heap {
7261                            ::fidl_next::wire::Envelope::encode_value::<
7262                                crate::wire::Heap<'static>,
7263                                ___E,
7264                            >(
7265                                value, preallocated.encoder, &mut out, ()
7266                            )?;
7267                        } else {
7268                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7269                        }
7270                    }
7271
7272                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7273                }
7274                unsafe {
7275                    preallocated.write_next(out.assume_init_ref());
7276                }
7277            }
7278
7279            ::fidl_next::wire::Table::encode_len(table, max_ord);
7280
7281            Ok(())
7282        }
7283    }
7284
7285    impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapProperties<'de>> for SecureHeapProperties {
7286        #[inline]
7287        fn from_wire(wire_: crate::wire::SecureHeapProperties<'de>) -> Self {
7288            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7289
7290            let heap = wire_.table.get(1);
7291
7292            let dynamic_protection_ranges = wire_.table.get(2);
7293
7294            let protected_range_granularity = wire_.table.get(3);
7295
7296            let max_protected_range_count = wire_.table.get(4);
7297
7298            let is_mod_protected_range_available = wire_.table.get(5);
7299
7300            Self {
7301                heap: heap.map(|envelope| {
7302                    ::fidl_next::FromWire::from_wire(unsafe {
7303                        envelope.read_unchecked::<crate::wire::Heap<'de>>()
7304                    })
7305                }),
7306
7307                dynamic_protection_ranges: dynamic_protection_ranges.map(|envelope| {
7308                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
7309                }),
7310
7311                protected_range_granularity: protected_range_granularity.map(|envelope| {
7312                    ::fidl_next::FromWire::from_wire(unsafe {
7313                        envelope.read_unchecked::<::fidl_next::wire::Uint32>()
7314                    })
7315                }),
7316
7317                max_protected_range_count: max_protected_range_count.map(|envelope| {
7318                    ::fidl_next::FromWire::from_wire(unsafe {
7319                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
7320                    })
7321                }),
7322
7323                is_mod_protected_range_available: is_mod_protected_range_available.map(
7324                    |envelope| {
7325                        ::fidl_next::FromWire::from_wire(unsafe {
7326                            envelope.read_unchecked::<bool>()
7327                        })
7328                    },
7329                ),
7330            }
7331        }
7332    }
7333
7334    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapProperties<'de>>
7335        for SecureHeapProperties
7336    {
7337        #[inline]
7338        fn from_wire_ref(wire: &crate::wire::SecureHeapProperties<'de>) -> Self {
7339            Self {
7340                heap: wire.table.get(1).map(|envelope| {
7341                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7342                        envelope.deref_unchecked::<crate::wire::Heap<'de>>()
7343                    })
7344                }),
7345
7346                dynamic_protection_ranges: wire.table.get(2).map(|envelope| {
7347                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7348                        envelope.deref_unchecked::<bool>()
7349                    })
7350                }),
7351
7352                protected_range_granularity: wire.table.get(3).map(|envelope| {
7353                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7354                        envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
7355                    })
7356                }),
7357
7358                max_protected_range_count: wire.table.get(4).map(|envelope| {
7359                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7360                        envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
7361                    })
7362                }),
7363
7364                is_mod_protected_range_available: wire.table.get(5).map(|envelope| {
7365                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7366                        envelope.deref_unchecked::<bool>()
7367                    })
7368                }),
7369            }
7370        }
7371    }
7372
7373    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7374    pub struct SecureMemGetPhysicalSecureHeapsResponse {
7375        pub heaps: ::core::option::Option<::std::vec::Vec<crate::natural::SecureHeapAndRanges>>,
7376    }
7377
7378    impl SecureMemGetPhysicalSecureHeapsResponse {
7379        fn __max_ordinal(&self) -> usize {
7380            if self.heaps.is_some() {
7381                return 1;
7382            }
7383
7384            0
7385        }
7386    }
7387
7388    unsafe impl<___E>
7389        ::fidl_next::Encode<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>, ___E>
7390        for SecureMemGetPhysicalSecureHeapsResponse
7391    where
7392        ___E: ::fidl_next::Encoder + ?Sized,
7393    {
7394        #[inline]
7395        fn encode(
7396            mut self,
7397            encoder: &mut ___E,
7398            out: &mut ::core::mem::MaybeUninit<
7399                crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
7400            >,
7401            _: (),
7402        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7403            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapsResponse { table } = out);
7404
7405            let max_ord = self.__max_ordinal();
7406
7407            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7408            ::fidl_next::Wire::zero_padding(&mut out);
7409
7410            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7411                ::fidl_next::wire::Envelope,
7412            >(encoder, max_ord);
7413
7414            for i in 1..=max_ord {
7415                match i {
7416                    1 => {
7417                        if let Some(value) = self.heaps.take() {
7418                            ::fidl_next::wire::Envelope::encode_value::<
7419                                ::fidl_next::wire::Vector<
7420                                    'static,
7421                                    crate::wire::SecureHeapAndRanges<'static>,
7422                                >,
7423                                ___E,
7424                            >(
7425                                value, preallocated.encoder, &mut out, (32, ())
7426                            )?;
7427                        } else {
7428                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7429                        }
7430                    }
7431
7432                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7433                }
7434                unsafe {
7435                    preallocated.write_next(out.assume_init_ref());
7436                }
7437            }
7438
7439            ::fidl_next::wire::Table::encode_len(table, max_ord);
7440
7441            Ok(())
7442        }
7443    }
7444
7445    unsafe impl<'a, ___E>
7446        ::fidl_next::Encode<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>, ___E>
7447        for &'a SecureMemGetPhysicalSecureHeapsResponse
7448    where
7449        ___E: ::fidl_next::Encoder + ?Sized,
7450    {
7451        #[inline]
7452        fn encode(
7453            self,
7454            encoder: &mut ___E,
7455            out: &mut ::core::mem::MaybeUninit<
7456                crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
7457            >,
7458            _: (),
7459        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7460            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapsResponse { table } = out);
7461
7462            let max_ord = self.__max_ordinal();
7463
7464            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7465            ::fidl_next::Wire::zero_padding(&mut out);
7466
7467            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7468                ::fidl_next::wire::Envelope,
7469            >(encoder, max_ord);
7470
7471            for i in 1..=max_ord {
7472                match i {
7473                    1 => {
7474                        if let Some(value) = &self.heaps {
7475                            ::fidl_next::wire::Envelope::encode_value::<
7476                                ::fidl_next::wire::Vector<
7477                                    'static,
7478                                    crate::wire::SecureHeapAndRanges<'static>,
7479                                >,
7480                                ___E,
7481                            >(
7482                                value, preallocated.encoder, &mut out, (32, ())
7483                            )?;
7484                        } else {
7485                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7486                        }
7487                    }
7488
7489                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7490                }
7491                unsafe {
7492                    preallocated.write_next(out.assume_init_ref());
7493                }
7494            }
7495
7496            ::fidl_next::wire::Table::encode_len(table, max_ord);
7497
7498            Ok(())
7499        }
7500    }
7501
7502    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>>
7503        for SecureMemGetPhysicalSecureHeapsResponse
7504    {
7505        #[inline]
7506        fn from_wire(wire_: crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>) -> Self {
7507            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7508
7509            let heaps = wire_.table.get(1);
7510
7511            Self {
7512                heaps: heaps.map(|envelope| {
7513                    ::fidl_next::FromWire::from_wire(unsafe {
7514                        envelope.read_unchecked::<::fidl_next::wire::Vector<
7515                                'de,
7516                                crate::wire::SecureHeapAndRanges<'de>,
7517                            >>()
7518                    })
7519                }),
7520            }
7521        }
7522    }
7523
7524    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>>
7525        for SecureMemGetPhysicalSecureHeapsResponse
7526    {
7527        #[inline]
7528        fn from_wire_ref(wire: &crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>) -> Self {
7529            Self {
7530                heaps: wire.table.get(1).map(|envelope| {
7531                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7532                        envelope.deref_unchecked::<::fidl_next::wire::Vector<
7533                                'de,
7534                                crate::wire::SecureHeapAndRanges<'de>,
7535                            >>()
7536                    })
7537                }),
7538            }
7539        }
7540    }
7541
7542    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7543    pub struct SecureMemGetDynamicSecureHeapsResponse {
7544        pub heaps: ::core::option::Option<::std::vec::Vec<crate::natural::DynamicSecureHeap>>,
7545    }
7546
7547    impl SecureMemGetDynamicSecureHeapsResponse {
7548        fn __max_ordinal(&self) -> usize {
7549            if self.heaps.is_some() {
7550                return 1;
7551            }
7552
7553            0
7554        }
7555    }
7556
7557    unsafe impl<___E>
7558        ::fidl_next::Encode<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>, ___E>
7559        for SecureMemGetDynamicSecureHeapsResponse
7560    where
7561        ___E: ::fidl_next::Encoder + ?Sized,
7562    {
7563        #[inline]
7564        fn encode(
7565            mut self,
7566            encoder: &mut ___E,
7567            out: &mut ::core::mem::MaybeUninit<
7568                crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
7569            >,
7570            _: (),
7571        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7572            ::fidl_next::munge!(let crate::wire::SecureMemGetDynamicSecureHeapsResponse { table } = out);
7573
7574            let max_ord = self.__max_ordinal();
7575
7576            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7577            ::fidl_next::Wire::zero_padding(&mut out);
7578
7579            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7580                ::fidl_next::wire::Envelope,
7581            >(encoder, max_ord);
7582
7583            for i in 1..=max_ord {
7584                match i {
7585                    1 => {
7586                        if let Some(value) = self.heaps.take() {
7587                            ::fidl_next::wire::Envelope::encode_value::<
7588                                ::fidl_next::wire::Vector<
7589                                    'static,
7590                                    crate::wire::DynamicSecureHeap<'static>,
7591                                >,
7592                                ___E,
7593                            >(
7594                                value, preallocated.encoder, &mut out, (32, ())
7595                            )?;
7596                        } else {
7597                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7598                        }
7599                    }
7600
7601                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7602                }
7603                unsafe {
7604                    preallocated.write_next(out.assume_init_ref());
7605                }
7606            }
7607
7608            ::fidl_next::wire::Table::encode_len(table, max_ord);
7609
7610            Ok(())
7611        }
7612    }
7613
7614    unsafe impl<'a, ___E>
7615        ::fidl_next::Encode<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>, ___E>
7616        for &'a SecureMemGetDynamicSecureHeapsResponse
7617    where
7618        ___E: ::fidl_next::Encoder + ?Sized,
7619    {
7620        #[inline]
7621        fn encode(
7622            self,
7623            encoder: &mut ___E,
7624            out: &mut ::core::mem::MaybeUninit<
7625                crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
7626            >,
7627            _: (),
7628        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7629            ::fidl_next::munge!(let crate::wire::SecureMemGetDynamicSecureHeapsResponse { table } = out);
7630
7631            let max_ord = self.__max_ordinal();
7632
7633            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7634            ::fidl_next::Wire::zero_padding(&mut out);
7635
7636            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7637                ::fidl_next::wire::Envelope,
7638            >(encoder, max_ord);
7639
7640            for i in 1..=max_ord {
7641                match i {
7642                    1 => {
7643                        if let Some(value) = &self.heaps {
7644                            ::fidl_next::wire::Envelope::encode_value::<
7645                                ::fidl_next::wire::Vector<
7646                                    'static,
7647                                    crate::wire::DynamicSecureHeap<'static>,
7648                                >,
7649                                ___E,
7650                            >(
7651                                value, preallocated.encoder, &mut out, (32, ())
7652                            )?;
7653                        } else {
7654                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7655                        }
7656                    }
7657
7658                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7659                }
7660                unsafe {
7661                    preallocated.write_next(out.assume_init_ref());
7662                }
7663            }
7664
7665            ::fidl_next::wire::Table::encode_len(table, max_ord);
7666
7667            Ok(())
7668        }
7669    }
7670
7671    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>>
7672        for SecureMemGetDynamicSecureHeapsResponse
7673    {
7674        #[inline]
7675        fn from_wire(wire_: crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>) -> Self {
7676            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7677
7678            let heaps = wire_.table.get(1);
7679
7680            Self {
7681
7682
7683                heaps: heaps.map(|envelope| ::fidl_next::FromWire::from_wire(
7684                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>() }
7685                )),
7686
7687        }
7688        }
7689    }
7690
7691    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>>
7692        for SecureMemGetDynamicSecureHeapsResponse
7693    {
7694        #[inline]
7695        fn from_wire_ref(wire: &crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>) -> Self {
7696            Self {
7697
7698
7699                heaps: wire.table.get(1)
7700                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7701                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>() }
7702                    )),
7703
7704        }
7705        }
7706    }
7707
7708    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7709    pub struct SecureMemGetPhysicalSecureHeapPropertiesRequest {
7710        pub entire_heap: ::core::option::Option<crate::natural::SecureHeapAndRange>,
7711    }
7712
7713    impl SecureMemGetPhysicalSecureHeapPropertiesRequest {
7714        fn __max_ordinal(&self) -> usize {
7715            if self.entire_heap.is_some() {
7716                return 1;
7717            }
7718
7719            0
7720        }
7721    }
7722
7723    unsafe impl<___E>
7724        ::fidl_next::Encode<
7725            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7726            ___E,
7727        > for SecureMemGetPhysicalSecureHeapPropertiesRequest
7728    where
7729        ___E: ::fidl_next::Encoder + ?Sized,
7730    {
7731        #[inline]
7732        fn encode(
7733            mut self,
7734            encoder: &mut ___E,
7735            out: &mut ::core::mem::MaybeUninit<
7736                crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7737            >,
7738            _: (),
7739        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7740            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest { table } = out);
7741
7742            let max_ord = self.__max_ordinal();
7743
7744            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7745            ::fidl_next::Wire::zero_padding(&mut out);
7746
7747            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7748                ::fidl_next::wire::Envelope,
7749            >(encoder, max_ord);
7750
7751            for i in 1..=max_ord {
7752                match i {
7753                    1 => {
7754                        if let Some(value) = self.entire_heap.take() {
7755                            ::fidl_next::wire::Envelope::encode_value::<
7756                                crate::wire::SecureHeapAndRange<'static>,
7757                                ___E,
7758                            >(
7759                                value, preallocated.encoder, &mut out, ()
7760                            )?;
7761                        } else {
7762                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7763                        }
7764                    }
7765
7766                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7767                }
7768                unsafe {
7769                    preallocated.write_next(out.assume_init_ref());
7770                }
7771            }
7772
7773            ::fidl_next::wire::Table::encode_len(table, max_ord);
7774
7775            Ok(())
7776        }
7777    }
7778
7779    unsafe impl<'a, ___E>
7780        ::fidl_next::Encode<
7781            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7782            ___E,
7783        > for &'a SecureMemGetPhysicalSecureHeapPropertiesRequest
7784    where
7785        ___E: ::fidl_next::Encoder + ?Sized,
7786    {
7787        #[inline]
7788        fn encode(
7789            self,
7790            encoder: &mut ___E,
7791            out: &mut ::core::mem::MaybeUninit<
7792                crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7793            >,
7794            _: (),
7795        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7796            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest { table } = out);
7797
7798            let max_ord = self.__max_ordinal();
7799
7800            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7801            ::fidl_next::Wire::zero_padding(&mut out);
7802
7803            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7804                ::fidl_next::wire::Envelope,
7805            >(encoder, max_ord);
7806
7807            for i in 1..=max_ord {
7808                match i {
7809                    1 => {
7810                        if let Some(value) = &self.entire_heap {
7811                            ::fidl_next::wire::Envelope::encode_value::<
7812                                crate::wire::SecureHeapAndRange<'static>,
7813                                ___E,
7814                            >(
7815                                value, preallocated.encoder, &mut out, ()
7816                            )?;
7817                        } else {
7818                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7819                        }
7820                    }
7821
7822                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7823                }
7824                unsafe {
7825                    preallocated.write_next(out.assume_init_ref());
7826                }
7827            }
7828
7829            ::fidl_next::wire::Table::encode_len(table, max_ord);
7830
7831            Ok(())
7832        }
7833    }
7834
7835    impl<'de>
7836        ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>>
7837        for SecureMemGetPhysicalSecureHeapPropertiesRequest
7838    {
7839        #[inline]
7840        fn from_wire(
7841            wire_: crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>,
7842        ) -> Self {
7843            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7844
7845            let entire_heap = wire_.table.get(1);
7846
7847            Self {
7848                entire_heap: entire_heap.map(|envelope| {
7849                    ::fidl_next::FromWire::from_wire(unsafe {
7850                        envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
7851                    })
7852                }),
7853            }
7854        }
7855    }
7856
7857    impl<'de>
7858        ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>>
7859        for SecureMemGetPhysicalSecureHeapPropertiesRequest
7860    {
7861        #[inline]
7862        fn from_wire_ref(
7863            wire: &crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>,
7864        ) -> Self {
7865            Self {
7866                entire_heap: wire.table.get(1).map(|envelope| {
7867                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7868                        envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
7869                    })
7870                }),
7871            }
7872        }
7873    }
7874
7875    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7876    pub struct SecureMemGetPhysicalSecureHeapPropertiesResponse {
7877        pub properties: ::core::option::Option<crate::natural::SecureHeapProperties>,
7878    }
7879
7880    impl SecureMemGetPhysicalSecureHeapPropertiesResponse {
7881        fn __max_ordinal(&self) -> usize {
7882            if self.properties.is_some() {
7883                return 1;
7884            }
7885
7886            0
7887        }
7888    }
7889
7890    unsafe impl<___E>
7891        ::fidl_next::Encode<
7892            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7893            ___E,
7894        > for SecureMemGetPhysicalSecureHeapPropertiesResponse
7895    where
7896        ___E: ::fidl_next::Encoder + ?Sized,
7897    {
7898        #[inline]
7899        fn encode(
7900            mut self,
7901            encoder: &mut ___E,
7902            out: &mut ::core::mem::MaybeUninit<
7903                crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7904            >,
7905            _: (),
7906        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7907            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse { table } = out);
7908
7909            let max_ord = self.__max_ordinal();
7910
7911            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7912            ::fidl_next::Wire::zero_padding(&mut out);
7913
7914            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7915                ::fidl_next::wire::Envelope,
7916            >(encoder, max_ord);
7917
7918            for i in 1..=max_ord {
7919                match i {
7920                    1 => {
7921                        if let Some(value) = self.properties.take() {
7922                            ::fidl_next::wire::Envelope::encode_value::<
7923                                crate::wire::SecureHeapProperties<'static>,
7924                                ___E,
7925                            >(
7926                                value, preallocated.encoder, &mut out, ()
7927                            )?;
7928                        } else {
7929                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7930                        }
7931                    }
7932
7933                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7934                }
7935                unsafe {
7936                    preallocated.write_next(out.assume_init_ref());
7937                }
7938            }
7939
7940            ::fidl_next::wire::Table::encode_len(table, max_ord);
7941
7942            Ok(())
7943        }
7944    }
7945
7946    unsafe impl<'a, ___E>
7947        ::fidl_next::Encode<
7948            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7949            ___E,
7950        > for &'a SecureMemGetPhysicalSecureHeapPropertiesResponse
7951    where
7952        ___E: ::fidl_next::Encoder + ?Sized,
7953    {
7954        #[inline]
7955        fn encode(
7956            self,
7957            encoder: &mut ___E,
7958            out: &mut ::core::mem::MaybeUninit<
7959                crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7960            >,
7961            _: (),
7962        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7963            ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse { table } = out);
7964
7965            let max_ord = self.__max_ordinal();
7966
7967            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7968            ::fidl_next::Wire::zero_padding(&mut out);
7969
7970            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7971                ::fidl_next::wire::Envelope,
7972            >(encoder, max_ord);
7973
7974            for i in 1..=max_ord {
7975                match i {
7976                    1 => {
7977                        if let Some(value) = &self.properties {
7978                            ::fidl_next::wire::Envelope::encode_value::<
7979                                crate::wire::SecureHeapProperties<'static>,
7980                                ___E,
7981                            >(
7982                                value, preallocated.encoder, &mut out, ()
7983                            )?;
7984                        } else {
7985                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
7986                        }
7987                    }
7988
7989                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7990                }
7991                unsafe {
7992                    preallocated.write_next(out.assume_init_ref());
7993                }
7994            }
7995
7996            ::fidl_next::wire::Table::encode_len(table, max_ord);
7997
7998            Ok(())
7999        }
8000    }
8001
8002    impl<'de>
8003        ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>>
8004        for SecureMemGetPhysicalSecureHeapPropertiesResponse
8005    {
8006        #[inline]
8007        fn from_wire(
8008            wire_: crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>,
8009        ) -> Self {
8010            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8011
8012            let properties = wire_.table.get(1);
8013
8014            Self {
8015                properties: properties.map(|envelope| {
8016                    ::fidl_next::FromWire::from_wire(unsafe {
8017                        envelope.read_unchecked::<crate::wire::SecureHeapProperties<'de>>()
8018                    })
8019                }),
8020            }
8021        }
8022    }
8023
8024    impl<'de>
8025        ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>>
8026        for SecureMemGetPhysicalSecureHeapPropertiesResponse
8027    {
8028        #[inline]
8029        fn from_wire_ref(
8030            wire: &crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>,
8031        ) -> Self {
8032            Self {
8033                properties: wire.table.get(1).map(|envelope| {
8034                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8035                        envelope.deref_unchecked::<crate::wire::SecureHeapProperties<'de>>()
8036                    })
8037                }),
8038            }
8039        }
8040    }
8041
8042    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8043    pub struct SecureMemAddSecureHeapPhysicalRangeRequest {
8044        pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
8045    }
8046
8047    impl SecureMemAddSecureHeapPhysicalRangeRequest {
8048        fn __max_ordinal(&self) -> usize {
8049            if self.heap_range.is_some() {
8050                return 1;
8051            }
8052
8053            0
8054        }
8055    }
8056
8057    unsafe impl<___E>
8058        ::fidl_next::Encode<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>, ___E>
8059        for SecureMemAddSecureHeapPhysicalRangeRequest
8060    where
8061        ___E: ::fidl_next::Encoder + ?Sized,
8062    {
8063        #[inline]
8064        fn encode(
8065            mut self,
8066            encoder: &mut ___E,
8067            out: &mut ::core::mem::MaybeUninit<
8068                crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
8069            >,
8070            _: (),
8071        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8072            ::fidl_next::munge!(let crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest { table } = out);
8073
8074            let max_ord = self.__max_ordinal();
8075
8076            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8077            ::fidl_next::Wire::zero_padding(&mut out);
8078
8079            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8080                ::fidl_next::wire::Envelope,
8081            >(encoder, max_ord);
8082
8083            for i in 1..=max_ord {
8084                match i {
8085                    1 => {
8086                        if let Some(value) = self.heap_range.take() {
8087                            ::fidl_next::wire::Envelope::encode_value::<
8088                                crate::wire::SecureHeapAndRange<'static>,
8089                                ___E,
8090                            >(
8091                                value, preallocated.encoder, &mut out, ()
8092                            )?;
8093                        } else {
8094                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8095                        }
8096                    }
8097
8098                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8099                }
8100                unsafe {
8101                    preallocated.write_next(out.assume_init_ref());
8102                }
8103            }
8104
8105            ::fidl_next::wire::Table::encode_len(table, max_ord);
8106
8107            Ok(())
8108        }
8109    }
8110
8111    unsafe impl<'a, ___E>
8112        ::fidl_next::Encode<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>, ___E>
8113        for &'a SecureMemAddSecureHeapPhysicalRangeRequest
8114    where
8115        ___E: ::fidl_next::Encoder + ?Sized,
8116    {
8117        #[inline]
8118        fn encode(
8119            self,
8120            encoder: &mut ___E,
8121            out: &mut ::core::mem::MaybeUninit<
8122                crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
8123            >,
8124            _: (),
8125        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8126            ::fidl_next::munge!(let crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest { table } = out);
8127
8128            let max_ord = self.__max_ordinal();
8129
8130            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8131            ::fidl_next::Wire::zero_padding(&mut out);
8132
8133            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8134                ::fidl_next::wire::Envelope,
8135            >(encoder, max_ord);
8136
8137            for i in 1..=max_ord {
8138                match i {
8139                    1 => {
8140                        if let Some(value) = &self.heap_range {
8141                            ::fidl_next::wire::Envelope::encode_value::<
8142                                crate::wire::SecureHeapAndRange<'static>,
8143                                ___E,
8144                            >(
8145                                value, preallocated.encoder, &mut out, ()
8146                            )?;
8147                        } else {
8148                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8149                        }
8150                    }
8151
8152                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8153                }
8154                unsafe {
8155                    preallocated.write_next(out.assume_init_ref());
8156                }
8157            }
8158
8159            ::fidl_next::wire::Table::encode_len(table, max_ord);
8160
8161            Ok(())
8162        }
8163    }
8164
8165    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>>
8166        for SecureMemAddSecureHeapPhysicalRangeRequest
8167    {
8168        #[inline]
8169        fn from_wire(wire_: crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>) -> Self {
8170            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8171
8172            let heap_range = wire_.table.get(1);
8173
8174            Self {
8175                heap_range: heap_range.map(|envelope| {
8176                    ::fidl_next::FromWire::from_wire(unsafe {
8177                        envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8178                    })
8179                }),
8180            }
8181        }
8182    }
8183
8184    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>>
8185        for SecureMemAddSecureHeapPhysicalRangeRequest
8186    {
8187        #[inline]
8188        fn from_wire_ref(
8189            wire: &crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>,
8190        ) -> Self {
8191            Self {
8192                heap_range: wire.table.get(1).map(|envelope| {
8193                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8194                        envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8195                    })
8196                }),
8197            }
8198        }
8199    }
8200
8201    pub type SecureMemAddSecureHeapPhysicalRangeResponse = ();
8202
8203    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8204    pub struct SecureMemDeleteSecureHeapPhysicalRangeRequest {
8205        pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
8206    }
8207
8208    impl SecureMemDeleteSecureHeapPhysicalRangeRequest {
8209        fn __max_ordinal(&self) -> usize {
8210            if self.heap_range.is_some() {
8211                return 1;
8212            }
8213
8214            0
8215        }
8216    }
8217
8218    unsafe impl<___E>
8219        ::fidl_next::Encode<
8220            crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8221            ___E,
8222        > for SecureMemDeleteSecureHeapPhysicalRangeRequest
8223    where
8224        ___E: ::fidl_next::Encoder + ?Sized,
8225    {
8226        #[inline]
8227        fn encode(
8228            mut self,
8229            encoder: &mut ___E,
8230            out: &mut ::core::mem::MaybeUninit<
8231                crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8232            >,
8233            _: (),
8234        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8235            ::fidl_next::munge!(let crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest { table } = out);
8236
8237            let max_ord = self.__max_ordinal();
8238
8239            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8240            ::fidl_next::Wire::zero_padding(&mut out);
8241
8242            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8243                ::fidl_next::wire::Envelope,
8244            >(encoder, max_ord);
8245
8246            for i in 1..=max_ord {
8247                match i {
8248                    1 => {
8249                        if let Some(value) = self.heap_range.take() {
8250                            ::fidl_next::wire::Envelope::encode_value::<
8251                                crate::wire::SecureHeapAndRange<'static>,
8252                                ___E,
8253                            >(
8254                                value, preallocated.encoder, &mut out, ()
8255                            )?;
8256                        } else {
8257                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8258                        }
8259                    }
8260
8261                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8262                }
8263                unsafe {
8264                    preallocated.write_next(out.assume_init_ref());
8265                }
8266            }
8267
8268            ::fidl_next::wire::Table::encode_len(table, max_ord);
8269
8270            Ok(())
8271        }
8272    }
8273
8274    unsafe impl<'a, ___E>
8275        ::fidl_next::Encode<
8276            crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8277            ___E,
8278        > for &'a SecureMemDeleteSecureHeapPhysicalRangeRequest
8279    where
8280        ___E: ::fidl_next::Encoder + ?Sized,
8281    {
8282        #[inline]
8283        fn encode(
8284            self,
8285            encoder: &mut ___E,
8286            out: &mut ::core::mem::MaybeUninit<
8287                crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8288            >,
8289            _: (),
8290        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8291            ::fidl_next::munge!(let crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest { table } = out);
8292
8293            let max_ord = self.__max_ordinal();
8294
8295            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8296            ::fidl_next::Wire::zero_padding(&mut out);
8297
8298            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8299                ::fidl_next::wire::Envelope,
8300            >(encoder, max_ord);
8301
8302            for i in 1..=max_ord {
8303                match i {
8304                    1 => {
8305                        if let Some(value) = &self.heap_range {
8306                            ::fidl_next::wire::Envelope::encode_value::<
8307                                crate::wire::SecureHeapAndRange<'static>,
8308                                ___E,
8309                            >(
8310                                value, preallocated.encoder, &mut out, ()
8311                            )?;
8312                        } else {
8313                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8314                        }
8315                    }
8316
8317                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8318                }
8319                unsafe {
8320                    preallocated.write_next(out.assume_init_ref());
8321                }
8322            }
8323
8324            ::fidl_next::wire::Table::encode_len(table, max_ord);
8325
8326            Ok(())
8327        }
8328    }
8329
8330    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>>
8331        for SecureMemDeleteSecureHeapPhysicalRangeRequest
8332    {
8333        #[inline]
8334        fn from_wire(
8335            wire_: crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>,
8336        ) -> Self {
8337            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8338
8339            let heap_range = wire_.table.get(1);
8340
8341            Self {
8342                heap_range: heap_range.map(|envelope| {
8343                    ::fidl_next::FromWire::from_wire(unsafe {
8344                        envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8345                    })
8346                }),
8347            }
8348        }
8349    }
8350
8351    impl<'de>
8352        ::fidl_next::FromWireRef<crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>>
8353        for SecureMemDeleteSecureHeapPhysicalRangeRequest
8354    {
8355        #[inline]
8356        fn from_wire_ref(
8357            wire: &crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>,
8358        ) -> Self {
8359            Self {
8360                heap_range: wire.table.get(1).map(|envelope| {
8361                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8362                        envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8363                    })
8364                }),
8365            }
8366        }
8367    }
8368
8369    pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ();
8370
8371    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8372    pub struct SecureMemModifySecureHeapPhysicalRangeRequest {
8373        pub range_modification:
8374            ::core::option::Option<crate::natural::SecureHeapAndRangeModification>,
8375    }
8376
8377    impl SecureMemModifySecureHeapPhysicalRangeRequest {
8378        fn __max_ordinal(&self) -> usize {
8379            if self.range_modification.is_some() {
8380                return 1;
8381            }
8382
8383            0
8384        }
8385    }
8386
8387    unsafe impl<___E>
8388        ::fidl_next::Encode<
8389            crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8390            ___E,
8391        > for SecureMemModifySecureHeapPhysicalRangeRequest
8392    where
8393        ___E: ::fidl_next::Encoder + ?Sized,
8394    {
8395        #[inline]
8396        fn encode(
8397            mut self,
8398            encoder: &mut ___E,
8399            out: &mut ::core::mem::MaybeUninit<
8400                crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8401            >,
8402            _: (),
8403        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8404            ::fidl_next::munge!(let crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest { table } = out);
8405
8406            let max_ord = self.__max_ordinal();
8407
8408            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8409            ::fidl_next::Wire::zero_padding(&mut out);
8410
8411            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8412                ::fidl_next::wire::Envelope,
8413            >(encoder, max_ord);
8414
8415            for i in 1..=max_ord {
8416                match i {
8417                    1 => {
8418                        if let Some(value) = self.range_modification.take() {
8419                            ::fidl_next::wire::Envelope::encode_value::<
8420                                crate::wire::SecureHeapAndRangeModification<'static>,
8421                                ___E,
8422                            >(
8423                                value, preallocated.encoder, &mut out, ()
8424                            )?;
8425                        } else {
8426                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8427                        }
8428                    }
8429
8430                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8431                }
8432                unsafe {
8433                    preallocated.write_next(out.assume_init_ref());
8434                }
8435            }
8436
8437            ::fidl_next::wire::Table::encode_len(table, max_ord);
8438
8439            Ok(())
8440        }
8441    }
8442
8443    unsafe impl<'a, ___E>
8444        ::fidl_next::Encode<
8445            crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8446            ___E,
8447        > for &'a SecureMemModifySecureHeapPhysicalRangeRequest
8448    where
8449        ___E: ::fidl_next::Encoder + ?Sized,
8450    {
8451        #[inline]
8452        fn encode(
8453            self,
8454            encoder: &mut ___E,
8455            out: &mut ::core::mem::MaybeUninit<
8456                crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8457            >,
8458            _: (),
8459        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8460            ::fidl_next::munge!(let crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest { table } = out);
8461
8462            let max_ord = self.__max_ordinal();
8463
8464            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8465            ::fidl_next::Wire::zero_padding(&mut out);
8466
8467            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8468                ::fidl_next::wire::Envelope,
8469            >(encoder, max_ord);
8470
8471            for i in 1..=max_ord {
8472                match i {
8473                    1 => {
8474                        if let Some(value) = &self.range_modification {
8475                            ::fidl_next::wire::Envelope::encode_value::<
8476                                crate::wire::SecureHeapAndRangeModification<'static>,
8477                                ___E,
8478                            >(
8479                                value, preallocated.encoder, &mut out, ()
8480                            )?;
8481                        } else {
8482                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8483                        }
8484                    }
8485
8486                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8487                }
8488                unsafe {
8489                    preallocated.write_next(out.assume_init_ref());
8490                }
8491            }
8492
8493            ::fidl_next::wire::Table::encode_len(table, max_ord);
8494
8495            Ok(())
8496        }
8497    }
8498
8499    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>>
8500        for SecureMemModifySecureHeapPhysicalRangeRequest
8501    {
8502        #[inline]
8503        fn from_wire(
8504            wire_: crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>,
8505        ) -> Self {
8506            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8507
8508            let range_modification = wire_.table.get(1);
8509
8510            Self {
8511                range_modification: range_modification.map(|envelope| {
8512                    ::fidl_next::FromWire::from_wire(unsafe {
8513                        envelope
8514                            .read_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
8515                    })
8516                }),
8517            }
8518        }
8519    }
8520
8521    impl<'de>
8522        ::fidl_next::FromWireRef<crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>>
8523        for SecureMemModifySecureHeapPhysicalRangeRequest
8524    {
8525        #[inline]
8526        fn from_wire_ref(
8527            wire: &crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>,
8528        ) -> Self {
8529            Self {
8530                range_modification: wire.table.get(1).map(|envelope| {
8531                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8532                        envelope
8533                            .deref_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
8534                    })
8535                }),
8536            }
8537        }
8538    }
8539
8540    pub type SecureMemModifySecureHeapPhysicalRangeResponse = ();
8541
8542    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8543    pub struct SecureMemZeroSubRangeRequest {
8544        pub is_covering_range_explicit: ::core::option::Option<bool>,
8545
8546        pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
8547    }
8548
8549    impl SecureMemZeroSubRangeRequest {
8550        fn __max_ordinal(&self) -> usize {
8551            if self.heap_range.is_some() {
8552                return 2;
8553            }
8554
8555            if self.is_covering_range_explicit.is_some() {
8556                return 1;
8557            }
8558
8559            0
8560        }
8561    }
8562
8563    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureMemZeroSubRangeRequest<'static>, ___E>
8564        for SecureMemZeroSubRangeRequest
8565    where
8566        ___E: ::fidl_next::Encoder + ?Sized,
8567    {
8568        #[inline]
8569        fn encode(
8570            mut self,
8571            encoder: &mut ___E,
8572            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureMemZeroSubRangeRequest<'static>>,
8573            _: (),
8574        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8575            ::fidl_next::munge!(let crate::wire::SecureMemZeroSubRangeRequest { table } = out);
8576
8577            let max_ord = self.__max_ordinal();
8578
8579            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8580            ::fidl_next::Wire::zero_padding(&mut out);
8581
8582            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8583                ::fidl_next::wire::Envelope,
8584            >(encoder, max_ord);
8585
8586            for i in 1..=max_ord {
8587                match i {
8588                    2 => {
8589                        if let Some(value) = self.heap_range.take() {
8590                            ::fidl_next::wire::Envelope::encode_value::<
8591                                crate::wire::SecureHeapAndRange<'static>,
8592                                ___E,
8593                            >(
8594                                value, preallocated.encoder, &mut out, ()
8595                            )?;
8596                        } else {
8597                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8598                        }
8599                    }
8600
8601                    1 => {
8602                        if let Some(value) = self.is_covering_range_explicit.take() {
8603                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
8604                                value,
8605                                preallocated.encoder,
8606                                &mut out,
8607                                (),
8608                            )?;
8609                        } else {
8610                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8611                        }
8612                    }
8613
8614                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8615                }
8616                unsafe {
8617                    preallocated.write_next(out.assume_init_ref());
8618                }
8619            }
8620
8621            ::fidl_next::wire::Table::encode_len(table, max_ord);
8622
8623            Ok(())
8624        }
8625    }
8626
8627    unsafe impl<'a, ___E>
8628        ::fidl_next::Encode<crate::wire::SecureMemZeroSubRangeRequest<'static>, ___E>
8629        for &'a SecureMemZeroSubRangeRequest
8630    where
8631        ___E: ::fidl_next::Encoder + ?Sized,
8632    {
8633        #[inline]
8634        fn encode(
8635            self,
8636            encoder: &mut ___E,
8637            out: &mut ::core::mem::MaybeUninit<crate::wire::SecureMemZeroSubRangeRequest<'static>>,
8638            _: (),
8639        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8640            ::fidl_next::munge!(let crate::wire::SecureMemZeroSubRangeRequest { table } = out);
8641
8642            let max_ord = self.__max_ordinal();
8643
8644            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8645            ::fidl_next::Wire::zero_padding(&mut out);
8646
8647            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8648                ::fidl_next::wire::Envelope,
8649            >(encoder, max_ord);
8650
8651            for i in 1..=max_ord {
8652                match i {
8653                    2 => {
8654                        if let Some(value) = &self.heap_range {
8655                            ::fidl_next::wire::Envelope::encode_value::<
8656                                crate::wire::SecureHeapAndRange<'static>,
8657                                ___E,
8658                            >(
8659                                value, preallocated.encoder, &mut out, ()
8660                            )?;
8661                        } else {
8662                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8663                        }
8664                    }
8665
8666                    1 => {
8667                        if let Some(value) = &self.is_covering_range_explicit {
8668                            ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
8669                                value,
8670                                preallocated.encoder,
8671                                &mut out,
8672                                (),
8673                            )?;
8674                        } else {
8675                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
8676                        }
8677                    }
8678
8679                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8680                }
8681                unsafe {
8682                    preallocated.write_next(out.assume_init_ref());
8683                }
8684            }
8685
8686            ::fidl_next::wire::Table::encode_len(table, max_ord);
8687
8688            Ok(())
8689        }
8690    }
8691
8692    impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemZeroSubRangeRequest<'de>>
8693        for SecureMemZeroSubRangeRequest
8694    {
8695        #[inline]
8696        fn from_wire(wire_: crate::wire::SecureMemZeroSubRangeRequest<'de>) -> Self {
8697            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8698
8699            let is_covering_range_explicit = wire_.table.get(1);
8700
8701            let heap_range = wire_.table.get(2);
8702
8703            Self {
8704                is_covering_range_explicit: is_covering_range_explicit.map(|envelope| {
8705                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
8706                }),
8707
8708                heap_range: heap_range.map(|envelope| {
8709                    ::fidl_next::FromWire::from_wire(unsafe {
8710                        envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8711                    })
8712                }),
8713            }
8714        }
8715    }
8716
8717    impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemZeroSubRangeRequest<'de>>
8718        for SecureMemZeroSubRangeRequest
8719    {
8720        #[inline]
8721        fn from_wire_ref(wire: &crate::wire::SecureMemZeroSubRangeRequest<'de>) -> Self {
8722            Self {
8723                is_covering_range_explicit: wire.table.get(1).map(|envelope| {
8724                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8725                        envelope.deref_unchecked::<bool>()
8726                    })
8727                }),
8728
8729                heap_range: wire.table.get(2).map(|envelope| {
8730                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8731                        envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8732                    })
8733                }),
8734            }
8735        }
8736    }
8737
8738    pub type SecureMemZeroSubRangeResponse = ();
8739}
8740
8741pub mod wire {
8742
8743    /// The wire type corresponding to [`AllocatorValidateBufferCollectionTokenRequest`].
8744    #[repr(C)]
8745    pub struct AllocatorValidateBufferCollectionTokenRequest<'de> {
8746        pub(crate) table: ::fidl_next::wire::Table<'de>,
8747    }
8748
8749    impl<'de> Drop for AllocatorValidateBufferCollectionTokenRequest<'de> {
8750        fn drop(&mut self) {
8751            let _ = self
8752                .table
8753                .get(1)
8754                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
8755        }
8756    }
8757
8758    impl ::fidl_next::Constrained for AllocatorValidateBufferCollectionTokenRequest<'_> {
8759        type Constraint = ();
8760
8761        fn validate(
8762            _: ::fidl_next::Slot<'_, Self>,
8763            _: Self::Constraint,
8764        ) -> Result<(), ::fidl_next::ValidationError> {
8765            Ok(())
8766        }
8767    }
8768
8769    unsafe impl ::fidl_next::Wire for AllocatorValidateBufferCollectionTokenRequest<'static> {
8770        type Narrowed<'de> = AllocatorValidateBufferCollectionTokenRequest<'de>;
8771
8772        #[inline]
8773        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8774            ::fidl_next::munge!(let Self { table } = out);
8775            ::fidl_next::wire::Table::zero_padding(table);
8776        }
8777    }
8778
8779    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
8780        for AllocatorValidateBufferCollectionTokenRequest<'de>
8781    where
8782        ___D: ::fidl_next::Decoder<'de> + ?Sized,
8783    {
8784        fn decode(
8785            slot: ::fidl_next::Slot<'_, Self>,
8786            decoder: &mut ___D,
8787            _: (),
8788        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8789            ::fidl_next::munge!(let Self { table } = slot);
8790
8791            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8792                match ordinal {
8793                    0 => unsafe { ::core::hint::unreachable_unchecked() },
8794
8795                    1 => {
8796                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
8797                            slot.as_mut(),
8798                            decoder,
8799                            (),
8800                        )?;
8801
8802                        Ok(())
8803                    }
8804
8805                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
8806                }
8807            })
8808        }
8809    }
8810
8811    impl<'de> AllocatorValidateBufferCollectionTokenRequest<'de> {
8812        pub fn token_server_koid(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
8813            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8814        }
8815
8816        pub fn take_token_server_koid(
8817            &mut self,
8818        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
8819            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
8820        }
8821    }
8822
8823    impl<'de> ::core::fmt::Debug for AllocatorValidateBufferCollectionTokenRequest<'de> {
8824        fn fmt(
8825            &self,
8826            f: &mut ::core::fmt::Formatter<'_>,
8827        ) -> ::core::result::Result<(), ::core::fmt::Error> {
8828            f.debug_struct("AllocatorValidateBufferCollectionTokenRequest")
8829                .field("token_server_koid", &self.token_server_koid())
8830                .finish()
8831        }
8832    }
8833
8834    impl<'de> ::fidl_next::IntoNatural for AllocatorValidateBufferCollectionTokenRequest<'de> {
8835        type Natural = crate::natural::AllocatorValidateBufferCollectionTokenRequest;
8836    }
8837
8838    /// The wire type corresponding to [`AllocatorValidateBufferCollectionTokenResponse`].
8839    #[repr(C)]
8840    pub struct AllocatorValidateBufferCollectionTokenResponse<'de> {
8841        pub(crate) table: ::fidl_next::wire::Table<'de>,
8842    }
8843
8844    impl<'de> Drop for AllocatorValidateBufferCollectionTokenResponse<'de> {
8845        fn drop(&mut self) {
8846            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
8847        }
8848    }
8849
8850    impl ::fidl_next::Constrained for AllocatorValidateBufferCollectionTokenResponse<'_> {
8851        type Constraint = ();
8852
8853        fn validate(
8854            _: ::fidl_next::Slot<'_, Self>,
8855            _: Self::Constraint,
8856        ) -> Result<(), ::fidl_next::ValidationError> {
8857            Ok(())
8858        }
8859    }
8860
8861    unsafe impl ::fidl_next::Wire for AllocatorValidateBufferCollectionTokenResponse<'static> {
8862        type Narrowed<'de> = AllocatorValidateBufferCollectionTokenResponse<'de>;
8863
8864        #[inline]
8865        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8866            ::fidl_next::munge!(let Self { table } = out);
8867            ::fidl_next::wire::Table::zero_padding(table);
8868        }
8869    }
8870
8871    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
8872        for AllocatorValidateBufferCollectionTokenResponse<'de>
8873    where
8874        ___D: ::fidl_next::Decoder<'de> + ?Sized,
8875    {
8876        fn decode(
8877            slot: ::fidl_next::Slot<'_, Self>,
8878            decoder: &mut ___D,
8879            _: (),
8880        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8881            ::fidl_next::munge!(let Self { table } = slot);
8882
8883            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8884                match ordinal {
8885                    0 => unsafe { ::core::hint::unreachable_unchecked() },
8886
8887                    1 => {
8888                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
8889                            slot.as_mut(),
8890                            decoder,
8891                            (),
8892                        )?;
8893
8894                        Ok(())
8895                    }
8896
8897                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
8898                }
8899            })
8900        }
8901    }
8902
8903    impl<'de> AllocatorValidateBufferCollectionTokenResponse<'de> {
8904        pub fn is_known(&self) -> ::core::option::Option<&bool> {
8905            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8906        }
8907
8908        pub fn take_is_known(&mut self) -> ::core::option::Option<bool> {
8909            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
8910        }
8911    }
8912
8913    impl<'de> ::core::fmt::Debug for AllocatorValidateBufferCollectionTokenResponse<'de> {
8914        fn fmt(
8915            &self,
8916            f: &mut ::core::fmt::Formatter<'_>,
8917        ) -> ::core::result::Result<(), ::core::fmt::Error> {
8918            f.debug_struct("AllocatorValidateBufferCollectionTokenResponse")
8919                .field("is_known", &self.is_known())
8920                .finish()
8921        }
8922    }
8923
8924    impl<'de> ::fidl_next::IntoNatural for AllocatorValidateBufferCollectionTokenResponse<'de> {
8925        type Natural = crate::natural::AllocatorValidateBufferCollectionTokenResponse;
8926    }
8927
8928    /// The wire type corresponding to [`AllocatorSetDebugClientInfoRequest`].
8929    #[repr(C)]
8930    pub struct AllocatorSetDebugClientInfoRequest<'de> {
8931        pub(crate) table: ::fidl_next::wire::Table<'de>,
8932    }
8933
8934    impl<'de> Drop for AllocatorSetDebugClientInfoRequest<'de> {
8935        fn drop(&mut self) {
8936            let _ = self.table.get(1).map(|envelope| unsafe {
8937                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8938            });
8939
8940            let _ = self
8941                .table
8942                .get(2)
8943                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
8944        }
8945    }
8946
8947    impl ::fidl_next::Constrained for AllocatorSetDebugClientInfoRequest<'_> {
8948        type Constraint = ();
8949
8950        fn validate(
8951            _: ::fidl_next::Slot<'_, Self>,
8952            _: Self::Constraint,
8953        ) -> Result<(), ::fidl_next::ValidationError> {
8954            Ok(())
8955        }
8956    }
8957
8958    unsafe impl ::fidl_next::Wire for AllocatorSetDebugClientInfoRequest<'static> {
8959        type Narrowed<'de> = AllocatorSetDebugClientInfoRequest<'de>;
8960
8961        #[inline]
8962        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8963            ::fidl_next::munge!(let Self { table } = out);
8964            ::fidl_next::wire::Table::zero_padding(table);
8965        }
8966    }
8967
8968    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for AllocatorSetDebugClientInfoRequest<'de>
8969    where
8970        ___D: ::fidl_next::Decoder<'de> + ?Sized,
8971    {
8972        fn decode(
8973            slot: ::fidl_next::Slot<'_, Self>,
8974            decoder: &mut ___D,
8975            _: (),
8976        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8977            ::fidl_next::munge!(let Self { table } = slot);
8978
8979            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8980                match ordinal {
8981                    0 => unsafe { ::core::hint::unreachable_unchecked() },
8982
8983                    1 => {
8984                        ::fidl_next::wire::Envelope::decode_as::<
8985                            ___D,
8986                            ::fidl_next::wire::String<'de>,
8987                        >(slot.as_mut(), decoder, 256)?;
8988
8989                        let value = unsafe {
8990                            slot.deref_unchecked()
8991                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
8992                        };
8993
8994                        if value.len() > 256 {
8995                            return Err(::fidl_next::DecodeError::VectorTooLong {
8996                                size: value.len() as u64,
8997                                limit: 256,
8998                            });
8999                        }
9000
9001                        Ok(())
9002                    }
9003
9004                    2 => {
9005                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9006                            slot.as_mut(),
9007                            decoder,
9008                            (),
9009                        )?;
9010
9011                        Ok(())
9012                    }
9013
9014                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9015                }
9016            })
9017        }
9018    }
9019
9020    impl<'de> AllocatorSetDebugClientInfoRequest<'de> {
9021        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
9022            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9023        }
9024
9025        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
9026            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
9027        }
9028
9029        pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9030            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9031        }
9032
9033        pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9034            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
9035        }
9036    }
9037
9038    impl<'de> ::core::fmt::Debug for AllocatorSetDebugClientInfoRequest<'de> {
9039        fn fmt(
9040            &self,
9041            f: &mut ::core::fmt::Formatter<'_>,
9042        ) -> ::core::result::Result<(), ::core::fmt::Error> {
9043            f.debug_struct("AllocatorSetDebugClientInfoRequest")
9044                .field("name", &self.name())
9045                .field("id", &self.id())
9046                .finish()
9047        }
9048    }
9049
9050    impl<'de> ::fidl_next::IntoNatural for AllocatorSetDebugClientInfoRequest<'de> {
9051        type Natural = crate::natural::AllocatorSetDebugClientInfoRequest;
9052    }
9053
9054    /// The wire type corresponding to [`BufferUsage`].
9055    #[repr(C)]
9056    pub struct BufferUsage<'de> {
9057        pub(crate) table: ::fidl_next::wire::Table<'de>,
9058    }
9059
9060    impl<'de> Drop for BufferUsage<'de> {
9061        fn drop(&mut self) {
9062            let _ = self
9063                .table
9064                .get(1)
9065                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9066
9067            let _ = self
9068                .table
9069                .get(2)
9070                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9071
9072            let _ = self
9073                .table
9074                .get(3)
9075                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9076
9077            let _ = self
9078                .table
9079                .get(4)
9080                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9081
9082            let _ = self
9083                .table
9084                .get(5)
9085                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9086        }
9087    }
9088
9089    impl ::fidl_next::Constrained for BufferUsage<'_> {
9090        type Constraint = ();
9091
9092        fn validate(
9093            _: ::fidl_next::Slot<'_, Self>,
9094            _: Self::Constraint,
9095        ) -> Result<(), ::fidl_next::ValidationError> {
9096            Ok(())
9097        }
9098    }
9099
9100    unsafe impl ::fidl_next::Wire for BufferUsage<'static> {
9101        type Narrowed<'de> = BufferUsage<'de>;
9102
9103        #[inline]
9104        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9105            ::fidl_next::munge!(let Self { table } = out);
9106            ::fidl_next::wire::Table::zero_padding(table);
9107        }
9108    }
9109
9110    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferUsage<'de>
9111    where
9112        ___D: ::fidl_next::Decoder<'de> + ?Sized,
9113    {
9114        fn decode(
9115            slot: ::fidl_next::Slot<'_, Self>,
9116            decoder: &mut ___D,
9117            _: (),
9118        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9119            ::fidl_next::munge!(let Self { table } = slot);
9120
9121            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9122                match ordinal {
9123                    0 => unsafe { ::core::hint::unreachable_unchecked() },
9124
9125                    1 => {
9126                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9127                            slot.as_mut(),
9128                            decoder,
9129                            (),
9130                        )?;
9131
9132                        Ok(())
9133                    }
9134
9135                    2 => {
9136                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9137                            slot.as_mut(),
9138                            decoder,
9139                            (),
9140                        )?;
9141
9142                        Ok(())
9143                    }
9144
9145                    3 => {
9146                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9147                            slot.as_mut(),
9148                            decoder,
9149                            (),
9150                        )?;
9151
9152                        Ok(())
9153                    }
9154
9155                    4 => {
9156                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9157                            slot.as_mut(),
9158                            decoder,
9159                            (),
9160                        )?;
9161
9162                        Ok(())
9163                    }
9164
9165                    5 => {
9166                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9167                            slot.as_mut(),
9168                            decoder,
9169                            (),
9170                        )?;
9171
9172                        Ok(())
9173                    }
9174
9175                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9176                }
9177            })
9178        }
9179    }
9180
9181    impl<'de> BufferUsage<'de> {
9182        pub fn none(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9183            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9184        }
9185
9186        pub fn take_none(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9187            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
9188        }
9189
9190        pub fn cpu(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9191            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9192        }
9193
9194        pub fn take_cpu(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9195            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
9196        }
9197
9198        pub fn vulkan(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9199            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9200        }
9201
9202        pub fn take_vulkan(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9203            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
9204        }
9205
9206        pub fn display(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9207            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9208        }
9209
9210        pub fn take_display(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9211            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
9212        }
9213
9214        pub fn video(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9215            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9216        }
9217
9218        pub fn take_video(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
9219            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
9220        }
9221    }
9222
9223    impl<'de> ::core::fmt::Debug for BufferUsage<'de> {
9224        fn fmt(
9225            &self,
9226            f: &mut ::core::fmt::Formatter<'_>,
9227        ) -> ::core::result::Result<(), ::core::fmt::Error> {
9228            f.debug_struct("BufferUsage")
9229                .field("none", &self.none())
9230                .field("cpu", &self.cpu())
9231                .field("vulkan", &self.vulkan())
9232                .field("display", &self.display())
9233                .field("video", &self.video())
9234                .finish()
9235        }
9236    }
9237
9238    impl<'de> ::fidl_next::IntoNatural for BufferUsage<'de> {
9239        type Natural = crate::natural::BufferUsage;
9240    }
9241
9242    /// The wire type corresponding to [`Heap`].
9243    #[repr(C)]
9244    pub struct Heap<'de> {
9245        pub(crate) table: ::fidl_next::wire::Table<'de>,
9246    }
9247
9248    impl<'de> Drop for Heap<'de> {
9249        fn drop(&mut self) {
9250            let _ = self.table.get(1).map(|envelope| unsafe {
9251                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9252            });
9253
9254            let _ = self
9255                .table
9256                .get(2)
9257                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9258        }
9259    }
9260
9261    impl ::fidl_next::Constrained for Heap<'_> {
9262        type Constraint = ();
9263
9264        fn validate(
9265            _: ::fidl_next::Slot<'_, Self>,
9266            _: Self::Constraint,
9267        ) -> Result<(), ::fidl_next::ValidationError> {
9268            Ok(())
9269        }
9270    }
9271
9272    unsafe impl ::fidl_next::Wire for Heap<'static> {
9273        type Narrowed<'de> = Heap<'de>;
9274
9275        #[inline]
9276        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9277            ::fidl_next::munge!(let Self { table } = out);
9278            ::fidl_next::wire::Table::zero_padding(table);
9279        }
9280    }
9281
9282    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Heap<'de>
9283    where
9284        ___D: ::fidl_next::Decoder<'de> + ?Sized,
9285    {
9286        fn decode(
9287            slot: ::fidl_next::Slot<'_, Self>,
9288            decoder: &mut ___D,
9289            _: (),
9290        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9291            ::fidl_next::munge!(let Self { table } = slot);
9292
9293            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9294                match ordinal {
9295                    0 => unsafe { ::core::hint::unreachable_unchecked() },
9296
9297                    1 => {
9298                        ::fidl_next::wire::Envelope::decode_as::<
9299                            ___D,
9300                            ::fidl_next::wire::String<'de>,
9301                        >(slot.as_mut(), decoder, 128)?;
9302
9303                        let value = unsafe {
9304                            slot.deref_unchecked()
9305                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
9306                        };
9307
9308                        if value.len() > 128 {
9309                            return Err(::fidl_next::DecodeError::VectorTooLong {
9310                                size: value.len() as u64,
9311                                limit: 128,
9312                            });
9313                        }
9314
9315                        Ok(())
9316                    }
9317
9318                    2 => {
9319                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9320                            slot.as_mut(),
9321                            decoder,
9322                            (),
9323                        )?;
9324
9325                        Ok(())
9326                    }
9327
9328                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9329                }
9330            })
9331        }
9332    }
9333
9334    impl<'de> Heap<'de> {
9335        pub fn heap_type(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
9336            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9337        }
9338
9339        pub fn take_heap_type(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
9340            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
9341        }
9342
9343        pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9344            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9345        }
9346
9347        pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9348            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
9349        }
9350    }
9351
9352    impl<'de> ::core::fmt::Debug for Heap<'de> {
9353        fn fmt(
9354            &self,
9355            f: &mut ::core::fmt::Formatter<'_>,
9356        ) -> ::core::result::Result<(), ::core::fmt::Error> {
9357            f.debug_struct("Heap")
9358                .field("heap_type", &self.heap_type())
9359                .field("id", &self.id())
9360                .finish()
9361        }
9362    }
9363
9364    impl<'de> ::fidl_next::IntoNatural for Heap<'de> {
9365        type Natural = crate::natural::Heap;
9366    }
9367
9368    /// The wire type corresponding to [`BufferMemoryConstraints`].
9369    #[repr(C)]
9370    pub struct BufferMemoryConstraints<'de> {
9371        pub(crate) table: ::fidl_next::wire::Table<'de>,
9372    }
9373
9374    impl<'de> Drop for BufferMemoryConstraints<'de> {
9375        fn drop(&mut self) {
9376            let _ = self
9377                .table
9378                .get(1)
9379                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9380
9381            let _ = self
9382                .table
9383                .get(2)
9384                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9385
9386            let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9387
9388            let _ = self.table.get(4).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9389
9390            let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9391
9392            let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9393
9394            let _ = self.table.get(7).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9395
9396            let _ = self.table.get(8).map(|envelope| unsafe {
9397                envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>()
9398            });
9399
9400            let _ = self
9401                .table
9402                .get(9)
9403                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9404        }
9405    }
9406
9407    impl ::fidl_next::Constrained for BufferMemoryConstraints<'_> {
9408        type Constraint = ();
9409
9410        fn validate(
9411            _: ::fidl_next::Slot<'_, Self>,
9412            _: Self::Constraint,
9413        ) -> Result<(), ::fidl_next::ValidationError> {
9414            Ok(())
9415        }
9416    }
9417
9418    unsafe impl ::fidl_next::Wire for BufferMemoryConstraints<'static> {
9419        type Narrowed<'de> = BufferMemoryConstraints<'de>;
9420
9421        #[inline]
9422        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9423            ::fidl_next::munge!(let Self { table } = out);
9424            ::fidl_next::wire::Table::zero_padding(table);
9425        }
9426    }
9427
9428    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferMemoryConstraints<'de>
9429    where
9430        ___D: ::fidl_next::Decoder<'de> + ?Sized,
9431    {
9432        fn decode(
9433            slot: ::fidl_next::Slot<'_, Self>,
9434            decoder: &mut ___D,
9435            _: (),
9436        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9437            ::fidl_next::munge!(let Self { table } = slot);
9438
9439            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9440                match ordinal {
9441                    0 => unsafe { ::core::hint::unreachable_unchecked() },
9442
9443                    1 => {
9444                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9445                            slot.as_mut(),
9446                            decoder,
9447                            (),
9448                        )?;
9449
9450                        Ok(())
9451                    }
9452
9453                    2 => {
9454                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9455                            slot.as_mut(),
9456                            decoder,
9457                            (),
9458                        )?;
9459
9460                        Ok(())
9461                    }
9462
9463                    3 => {
9464                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9465                            slot.as_mut(),
9466                            decoder,
9467                            (),
9468                        )?;
9469
9470                        Ok(())
9471                    }
9472
9473                    4 => {
9474                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9475                            slot.as_mut(),
9476                            decoder,
9477                            (),
9478                        )?;
9479
9480                        Ok(())
9481                    }
9482
9483                    5 => {
9484                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9485                            slot.as_mut(),
9486                            decoder,
9487                            (),
9488                        )?;
9489
9490                        Ok(())
9491                    }
9492
9493                    6 => {
9494                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9495                            slot.as_mut(),
9496                            decoder,
9497                            (),
9498                        )?;
9499
9500                        Ok(())
9501                    }
9502
9503                    7 => {
9504                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9505                            slot.as_mut(),
9506                            decoder,
9507                            (),
9508                        )?;
9509
9510                        Ok(())
9511                    }
9512
9513                    8 => {
9514                        ::fidl_next::wire::Envelope::decode_as::<
9515                            ___D,
9516                            ::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>,
9517                        >(slot.as_mut(), decoder, (64, ()))?;
9518
9519                        let value = unsafe {
9520                            slot
9521                                            .deref_unchecked()
9522                                            .deref_unchecked::<
9523                                                ::fidl_next::wire::Vector<'_, crate::wire::Heap<'_>>
9524                                            >()
9525                        };
9526
9527                        if value.len() > 64 {
9528                            return Err(::fidl_next::DecodeError::VectorTooLong {
9529                                size: value.len() as u64,
9530                                limit: 64,
9531                            });
9532                        }
9533
9534                        Ok(())
9535                    }
9536
9537                    9 => {
9538                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9539                            slot.as_mut(),
9540                            decoder,
9541                            (),
9542                        )?;
9543
9544                        Ok(())
9545                    }
9546
9547                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9548                }
9549            })
9550        }
9551    }
9552
9553    impl<'de> BufferMemoryConstraints<'de> {
9554        pub fn min_size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9555            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9556        }
9557
9558        pub fn take_min_size_bytes(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9559            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
9560        }
9561
9562        pub fn max_size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9563            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9564        }
9565
9566        pub fn take_max_size_bytes(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9567            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
9568        }
9569
9570        pub fn physically_contiguous_required(&self) -> ::core::option::Option<&bool> {
9571            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9572        }
9573
9574        pub fn take_physically_contiguous_required(&mut self) -> ::core::option::Option<bool> {
9575            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
9576        }
9577
9578        pub fn secure_required(&self) -> ::core::option::Option<&bool> {
9579            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9580        }
9581
9582        pub fn take_secure_required(&mut self) -> ::core::option::Option<bool> {
9583            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
9584        }
9585
9586        pub fn cpu_domain_supported(&self) -> ::core::option::Option<&bool> {
9587            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9588        }
9589
9590        pub fn take_cpu_domain_supported(&mut self) -> ::core::option::Option<bool> {
9591            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
9592        }
9593
9594        pub fn ram_domain_supported(&self) -> ::core::option::Option<&bool> {
9595            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9596        }
9597
9598        pub fn take_ram_domain_supported(&mut self) -> ::core::option::Option<bool> {
9599            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
9600        }
9601
9602        pub fn inaccessible_domain_supported(&self) -> ::core::option::Option<&bool> {
9603            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
9604        }
9605
9606        pub fn take_inaccessible_domain_supported(&mut self) -> ::core::option::Option<bool> {
9607            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
9608        }
9609
9610        pub fn permitted_heaps(
9611            &self,
9612        ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>
9613        {
9614            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
9615        }
9616
9617        pub fn take_permitted_heaps(
9618            &mut self,
9619        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>
9620        {
9621            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
9622        }
9623
9624        pub fn min_physical_base_alignment(
9625            &self,
9626        ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9627            unsafe { Some(self.table.get(9)?.deref_unchecked()) }
9628        }
9629
9630        pub fn take_min_physical_base_alignment(
9631            &mut self,
9632        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
9633            unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
9634        }
9635    }
9636
9637    impl<'de> ::core::fmt::Debug for BufferMemoryConstraints<'de> {
9638        fn fmt(
9639            &self,
9640            f: &mut ::core::fmt::Formatter<'_>,
9641        ) -> ::core::result::Result<(), ::core::fmt::Error> {
9642            f.debug_struct("BufferMemoryConstraints")
9643                .field("min_size_bytes", &self.min_size_bytes())
9644                .field("max_size_bytes", &self.max_size_bytes())
9645                .field("physically_contiguous_required", &self.physically_contiguous_required())
9646                .field("secure_required", &self.secure_required())
9647                .field("cpu_domain_supported", &self.cpu_domain_supported())
9648                .field("ram_domain_supported", &self.ram_domain_supported())
9649                .field("inaccessible_domain_supported", &self.inaccessible_domain_supported())
9650                .field("permitted_heaps", &self.permitted_heaps())
9651                .field("min_physical_base_alignment", &self.min_physical_base_alignment())
9652                .finish()
9653        }
9654    }
9655
9656    impl<'de> ::fidl_next::IntoNatural for BufferMemoryConstraints<'de> {
9657        type Natural = crate::natural::BufferMemoryConstraints;
9658    }
9659
9660    /// The wire type corresponding to [`PixelFormatAndModifier`].
9661    #[derive(Clone, Debug)]
9662    #[repr(C)]
9663    pub struct PixelFormatAndModifier {
9664        pub pixel_format: ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
9665
9666        pub pixel_format_modifier: ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
9667    }
9668
9669    static_assertions::const_assert_eq!(std::mem::size_of::<PixelFormatAndModifier>(), 16);
9670    static_assertions::const_assert_eq!(std::mem::align_of::<PixelFormatAndModifier>(), 8);
9671
9672    static_assertions::const_assert_eq!(
9673        std::mem::offset_of!(PixelFormatAndModifier, pixel_format),
9674        0
9675    );
9676
9677    static_assertions::const_assert_eq!(
9678        std::mem::offset_of!(PixelFormatAndModifier, pixel_format_modifier),
9679        8
9680    );
9681
9682    impl ::fidl_next::Constrained for PixelFormatAndModifier {
9683        type Constraint = ();
9684
9685        fn validate(
9686            _: ::fidl_next::Slot<'_, Self>,
9687            _: Self::Constraint,
9688        ) -> Result<(), ::fidl_next::ValidationError> {
9689            Ok(())
9690        }
9691    }
9692
9693    unsafe impl ::fidl_next::Wire for PixelFormatAndModifier {
9694        type Narrowed<'de> = PixelFormatAndModifier;
9695
9696        #[inline]
9697        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
9698            ::fidl_next::munge! {
9699                let Self {
9700                    pixel_format,
9701                    pixel_format_modifier,
9702
9703                } = &mut *out_;
9704            }
9705
9706            ::fidl_next::Wire::zero_padding(pixel_format);
9707
9708            ::fidl_next::Wire::zero_padding(pixel_format_modifier);
9709
9710            unsafe {
9711                out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
9712            }
9713        }
9714    }
9715
9716    unsafe impl<___D> ::fidl_next::Decode<___D> for PixelFormatAndModifier
9717    where
9718        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9719    {
9720        fn decode(
9721            slot_: ::fidl_next::Slot<'_, Self>,
9722            decoder_: &mut ___D,
9723            _: (),
9724        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9725            if slot_.as_bytes()[4..8] != [0u8; 4] {
9726                return Err(::fidl_next::DecodeError::InvalidPadding);
9727            }
9728
9729            ::fidl_next::munge! {
9730                let Self {
9731                    mut pixel_format,
9732                    mut pixel_format_modifier,
9733
9734                } = slot_;
9735            }
9736
9737            let _field = pixel_format.as_mut();
9738
9739            ::fidl_next::Decode::decode(pixel_format.as_mut(), decoder_, ())?;
9740
9741            let _field = pixel_format_modifier.as_mut();
9742
9743            ::fidl_next::Decode::decode(pixel_format_modifier.as_mut(), decoder_, ())?;
9744
9745            Ok(())
9746        }
9747    }
9748
9749    impl ::fidl_next::IntoNatural for PixelFormatAndModifier {
9750        type Natural = crate::natural::PixelFormatAndModifier;
9751    }
9752
9753    /// The wire type corresponding to [`ImageFormatConstraints`].
9754    #[repr(C)]
9755    pub struct ImageFormatConstraints<'de> {
9756        pub(crate) table: ::fidl_next::wire::Table<'de>,
9757    }
9758
9759    impl<'de> Drop for ImageFormatConstraints<'de> {
9760        fn drop(&mut self) {
9761            let _ = self.table.get(1).map(|envelope| unsafe {
9762                envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>()
9763            });
9764
9765            let _ = self.table.get(2)
9766                .map(|envelope| unsafe {
9767                    envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>()
9768                });
9769
9770            let _ = self.table.get(3).map(|envelope| unsafe {
9771                envelope.read_unchecked::<::fidl_next::wire::Vector<
9772                    'de,
9773                    ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
9774                >>()
9775            });
9776
9777            let _ = self.table.get(4).map(|envelope| unsafe {
9778                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9779            });
9780
9781            let _ = self.table.get(5).map(|envelope| unsafe {
9782                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9783            });
9784
9785            let _ = self
9786                .table
9787                .get(6)
9788                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9789
9790            let _ = self
9791                .table
9792                .get(7)
9793                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9794
9795            let _ = self
9796                .table
9797                .get(8)
9798                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9799
9800            let _ = self.table.get(9).map(|envelope| unsafe {
9801                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9802            });
9803
9804            let _ = self.table.get(10).map(|envelope| unsafe {
9805                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9806            });
9807
9808            let _ = self.table.get(11).map(|envelope| unsafe {
9809                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9810            });
9811
9812            let _ = self.table.get(12).map(|envelope| unsafe {
9813                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9814            });
9815
9816            let _ = self
9817                .table
9818                .get(13)
9819                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9820
9821            let _ = self
9822                .table
9823                .get(14)
9824                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9825
9826            let _ = self.table.get(15)
9827                .map(|envelope| unsafe {
9828                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>>()
9829                });
9830
9831            let _ = self.table.get(16).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9832
9833            let _ = self.table.get(17).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9834
9835            let _ = self.table.get(18)
9836                .map(|envelope| unsafe {
9837                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>>()
9838                });
9839
9840            let _ = self.table.get(19).map(|envelope| unsafe {
9841                envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
9842            });
9843
9844            let _ = self
9845                .table
9846                .get(20)
9847                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9848        }
9849    }
9850
9851    impl ::fidl_next::Constrained for ImageFormatConstraints<'_> {
9852        type Constraint = ();
9853
9854        fn validate(
9855            _: ::fidl_next::Slot<'_, Self>,
9856            _: Self::Constraint,
9857        ) -> Result<(), ::fidl_next::ValidationError> {
9858            Ok(())
9859        }
9860    }
9861
9862    unsafe impl ::fidl_next::Wire for ImageFormatConstraints<'static> {
9863        type Narrowed<'de> = ImageFormatConstraints<'de>;
9864
9865        #[inline]
9866        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9867            ::fidl_next::munge!(let Self { table } = out);
9868            ::fidl_next::wire::Table::zero_padding(table);
9869        }
9870    }
9871
9872    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ImageFormatConstraints<'de>
9873    where
9874        ___D: ::fidl_next::Decoder<'de> + ?Sized,
9875    {
9876        fn decode(
9877            slot: ::fidl_next::Slot<'_, Self>,
9878            decoder: &mut ___D,
9879            _: (),
9880        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9881            ::fidl_next::munge!(let Self { table } = slot);
9882
9883            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9884                match ordinal {
9885                    0 => unsafe { ::core::hint::unreachable_unchecked() },
9886
9887                    1 => {
9888                        ::fidl_next::wire::Envelope::decode_as::<
9889                            ___D,
9890                            ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
9891                        >(slot.as_mut(), decoder, ())?;
9892
9893                        Ok(())
9894                    }
9895
9896                    2 => {
9897                        ::fidl_next::wire::Envelope::decode_as::<
9898                            ___D,
9899                            ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
9900                        >(slot.as_mut(), decoder, ())?;
9901
9902                        Ok(())
9903                    }
9904
9905                    3 => {
9906                        ::fidl_next::wire::Envelope::decode_as::<
9907                            ___D,
9908                            ::fidl_next::wire::Vector<
9909                                'de,
9910                                ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
9911                            >,
9912                        >(slot.as_mut(), decoder, (32, ()))?;
9913
9914                        let value = unsafe {
9915                            slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
9916                                '_,
9917                                ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
9918                            >>()
9919                        };
9920
9921                        if value.len() > 32 {
9922                            return Err(::fidl_next::DecodeError::VectorTooLong {
9923                                size: value.len() as u64,
9924                                limit: 32,
9925                            });
9926                        }
9927
9928                        Ok(())
9929                    }
9930
9931                    4 => {
9932                        ::fidl_next::wire::Envelope::decode_as::<
9933                            ___D,
9934                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9935                        >(slot.as_mut(), decoder, ())?;
9936
9937                        Ok(())
9938                    }
9939
9940                    5 => {
9941                        ::fidl_next::wire::Envelope::decode_as::<
9942                            ___D,
9943                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9944                        >(slot.as_mut(), decoder, ())?;
9945
9946                        Ok(())
9947                    }
9948
9949                    6 => {
9950                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9951                            slot.as_mut(),
9952                            decoder,
9953                            (),
9954                        )?;
9955
9956                        Ok(())
9957                    }
9958
9959                    7 => {
9960                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9961                            slot.as_mut(),
9962                            decoder,
9963                            (),
9964                        )?;
9965
9966                        Ok(())
9967                    }
9968
9969                    8 => {
9970                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9971                            slot.as_mut(),
9972                            decoder,
9973                            (),
9974                        )?;
9975
9976                        Ok(())
9977                    }
9978
9979                    9 => {
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                    10 => {
9989                        ::fidl_next::wire::Envelope::decode_as::<
9990                            ___D,
9991                            ::fidl_next_common_fuchsia_math::wire::SizeU,
9992                        >(slot.as_mut(), decoder, ())?;
9993
9994                        Ok(())
9995                    }
9996
9997                    11 => {
9998                        ::fidl_next::wire::Envelope::decode_as::<
9999                            ___D,
10000                            ::fidl_next_common_fuchsia_math::wire::SizeU,
10001                        >(slot.as_mut(), decoder, ())?;
10002
10003                        Ok(())
10004                    }
10005
10006                    12 => {
10007                        ::fidl_next::wire::Envelope::decode_as::<
10008                            ___D,
10009                            ::fidl_next_common_fuchsia_math::wire::SizeU,
10010                        >(slot.as_mut(), decoder, ())?;
10011
10012                        Ok(())
10013                    }
10014
10015                    13 => {
10016                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10017                            slot.as_mut(),
10018                            decoder,
10019                            (),
10020                        )?;
10021
10022                        Ok(())
10023                    }
10024
10025                    14 => {
10026                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10027                            slot.as_mut(),
10028                            decoder,
10029                            (),
10030                        )?;
10031
10032                        Ok(())
10033                    }
10034
10035                    15 => {
10036                        ::fidl_next::wire::Envelope::decode_as::<
10037                            ___D,
10038                            ::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>,
10039                        >(slot.as_mut(), decoder, (64, ()))?;
10040
10041                        let value = unsafe {
10042                            slot
10043                                            .deref_unchecked()
10044                                            .deref_unchecked::<
10045                                                ::fidl_next::wire::Vector<'_, crate::wire::PixelFormatAndModifier>
10046                                            >()
10047                        };
10048
10049                        if value.len() > 64 {
10050                            return Err(::fidl_next::DecodeError::VectorTooLong {
10051                                size: value.len() as u64,
10052                                limit: 64,
10053                            });
10054                        }
10055
10056                        Ok(())
10057                    }
10058
10059                    16 => {
10060                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10061                            slot.as_mut(),
10062                            decoder,
10063                            (),
10064                        )?;
10065
10066                        Ok(())
10067                    }
10068
10069                    17 => {
10070                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10071                            slot.as_mut(),
10072                            decoder,
10073                            (),
10074                        )?;
10075
10076                        Ok(())
10077                    }
10078
10079                    18 => {
10080                        ::fidl_next::wire::Envelope::decode_as::<
10081                            ___D,
10082                            ::fidl_next::wire::Vector<
10083                                'de,
10084                                ::fidl_next_common_fuchsia_math::wire::SizeU,
10085                            >,
10086                        >(slot.as_mut(), decoder, (64, ()))?;
10087
10088                        let value = unsafe {
10089                            slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
10090                                '_,
10091                                ::fidl_next_common_fuchsia_math::wire::SizeU,
10092                            >>()
10093                        };
10094
10095                        if value.len() > 64 {
10096                            return Err(::fidl_next::DecodeError::VectorTooLong {
10097                                size: value.len() as u64,
10098                                limit: 64,
10099                            });
10100                        }
10101
10102                        Ok(())
10103                    }
10104
10105                    19 => {
10106                        ::fidl_next::wire::Envelope::decode_as::<
10107                            ___D,
10108                            ::fidl_next_common_fuchsia_math::wire::SizeU,
10109                        >(slot.as_mut(), decoder, ())?;
10110
10111                        Ok(())
10112                    }
10113
10114                    20 => {
10115                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
10116                            slot.as_mut(),
10117                            decoder,
10118                            (),
10119                        )?;
10120
10121                        Ok(())
10122                    }
10123
10124                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10125                }
10126            })
10127        }
10128    }
10129
10130    impl<'de> ImageFormatConstraints<'de> {
10131        pub fn pixel_format(
10132            &self,
10133        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormat>
10134        {
10135            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10136        }
10137
10138        pub fn take_pixel_format(
10139            &mut self,
10140        ) -> ::core::option::Option<::fidl_next_common_fuchsia_images2::wire::PixelFormat> {
10141            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
10142        }
10143
10144        pub fn pixel_format_modifier(
10145            &self,
10146        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
10147        {
10148            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10149        }
10150
10151        pub fn take_pixel_format_modifier(
10152            &mut self,
10153        ) -> ::core::option::Option<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
10154        {
10155            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
10156        }
10157
10158        pub fn color_spaces(
10159            &self,
10160        ) -> ::core::option::Option<
10161            &::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>,
10162        > {
10163            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10164        }
10165
10166        pub fn take_color_spaces(
10167            &mut self,
10168        ) -> ::core::option::Option<
10169            ::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>,
10170        > {
10171            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
10172        }
10173
10174        pub fn min_size(
10175            &self,
10176        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10177            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10178        }
10179
10180        pub fn take_min_size(
10181            &mut self,
10182        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10183            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
10184        }
10185
10186        pub fn max_size(
10187            &self,
10188        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10189            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10190        }
10191
10192        pub fn take_max_size(
10193            &mut self,
10194        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10195            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
10196        }
10197
10198        pub fn min_bytes_per_row(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10199            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10200        }
10201
10202        pub fn take_min_bytes_per_row(
10203            &mut self,
10204        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10205            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
10206        }
10207
10208        pub fn max_bytes_per_row(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10209            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10210        }
10211
10212        pub fn take_max_bytes_per_row(
10213            &mut self,
10214        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10215            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
10216        }
10217
10218        pub fn max_width_times_height(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10219            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10220        }
10221
10222        pub fn take_max_width_times_height(
10223            &mut self,
10224        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
10225            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
10226        }
10227
10228        pub fn size_alignment(
10229            &self,
10230        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10231            unsafe { Some(self.table.get(9)?.deref_unchecked()) }
10232        }
10233
10234        pub fn take_size_alignment(
10235            &mut self,
10236        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10237            unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
10238        }
10239
10240        pub fn display_rect_alignment(
10241            &self,
10242        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10243            unsafe { Some(self.table.get(10)?.deref_unchecked()) }
10244        }
10245
10246        pub fn take_display_rect_alignment(
10247            &mut self,
10248        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10249            unsafe { Some(self.table.get_mut(10)?.take_unchecked()) }
10250        }
10251
10252        pub fn required_min_size(
10253            &self,
10254        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10255            unsafe { Some(self.table.get(11)?.deref_unchecked()) }
10256        }
10257
10258        pub fn take_required_min_size(
10259            &mut self,
10260        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10261            unsafe { Some(self.table.get_mut(11)?.take_unchecked()) }
10262        }
10263
10264        pub fn required_max_size(
10265            &self,
10266        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10267            unsafe { Some(self.table.get(12)?.deref_unchecked()) }
10268        }
10269
10270        pub fn take_required_max_size(
10271            &mut self,
10272        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10273            unsafe { Some(self.table.get_mut(12)?.take_unchecked()) }
10274        }
10275
10276        pub fn bytes_per_row_divisor(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10277            unsafe { Some(self.table.get(13)?.deref_unchecked()) }
10278        }
10279
10280        pub fn take_bytes_per_row_divisor(
10281            &mut self,
10282        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10283            unsafe { Some(self.table.get_mut(13)?.take_unchecked()) }
10284        }
10285
10286        pub fn start_offset_divisor(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10287            unsafe { Some(self.table.get(14)?.deref_unchecked()) }
10288        }
10289
10290        pub fn take_start_offset_divisor(
10291            &mut self,
10292        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10293            unsafe { Some(self.table.get_mut(14)?.take_unchecked()) }
10294        }
10295
10296        pub fn pixel_format_and_modifiers(
10297            &self,
10298        ) -> ::core::option::Option<
10299            &::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>,
10300        > {
10301            unsafe { Some(self.table.get(15)?.deref_unchecked()) }
10302        }
10303
10304        pub fn take_pixel_format_and_modifiers(
10305            &mut self,
10306        ) -> ::core::option::Option<
10307            ::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>,
10308        > {
10309            unsafe { Some(self.table.get_mut(15)?.take_unchecked()) }
10310        }
10311
10312        pub fn require_bytes_per_row_at_pixel_boundary(&self) -> ::core::option::Option<&bool> {
10313            unsafe { Some(self.table.get(16)?.deref_unchecked()) }
10314        }
10315
10316        pub fn take_require_bytes_per_row_at_pixel_boundary(
10317            &mut self,
10318        ) -> ::core::option::Option<bool> {
10319            unsafe { Some(self.table.get_mut(16)?.take_unchecked()) }
10320        }
10321
10322        pub fn is_alpha_present(&self) -> ::core::option::Option<&bool> {
10323            unsafe { Some(self.table.get(17)?.deref_unchecked()) }
10324        }
10325
10326        pub fn take_is_alpha_present(&mut self) -> ::core::option::Option<bool> {
10327            unsafe { Some(self.table.get_mut(17)?.take_unchecked()) }
10328        }
10329
10330        pub fn required_max_size_list(
10331            &self,
10332        ) -> ::core::option::Option<
10333            &::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>,
10334        > {
10335            unsafe { Some(self.table.get(18)?.deref_unchecked()) }
10336        }
10337
10338        pub fn take_required_max_size_list(
10339            &mut self,
10340        ) -> ::core::option::Option<
10341            ::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>,
10342        > {
10343            unsafe { Some(self.table.get_mut(18)?.take_unchecked()) }
10344        }
10345
10346        pub fn pad_for_block_size(
10347            &self,
10348        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10349            unsafe { Some(self.table.get(19)?.deref_unchecked()) }
10350        }
10351
10352        pub fn take_pad_for_block_size(
10353            &mut self,
10354        ) -> ::core::option::Option<::fidl_next_common_fuchsia_math::wire::SizeU> {
10355            unsafe { Some(self.table.get_mut(19)?.take_unchecked()) }
10356        }
10357
10358        pub fn pad_beyond_image_size_bytes(
10359            &self,
10360        ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10361            unsafe { Some(self.table.get(20)?.deref_unchecked()) }
10362        }
10363
10364        pub fn take_pad_beyond_image_size_bytes(
10365            &mut self,
10366        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
10367            unsafe { Some(self.table.get_mut(20)?.take_unchecked()) }
10368        }
10369    }
10370
10371    impl<'de> ::core::fmt::Debug for ImageFormatConstraints<'de> {
10372        fn fmt(
10373            &self,
10374            f: &mut ::core::fmt::Formatter<'_>,
10375        ) -> ::core::result::Result<(), ::core::fmt::Error> {
10376            f.debug_struct("ImageFormatConstraints")
10377                .field("pixel_format", &self.pixel_format())
10378                .field("pixel_format_modifier", &self.pixel_format_modifier())
10379                .field("color_spaces", &self.color_spaces())
10380                .field("min_size", &self.min_size())
10381                .field("max_size", &self.max_size())
10382                .field("min_bytes_per_row", &self.min_bytes_per_row())
10383                .field("max_bytes_per_row", &self.max_bytes_per_row())
10384                .field("max_width_times_height", &self.max_width_times_height())
10385                .field("size_alignment", &self.size_alignment())
10386                .field("display_rect_alignment", &self.display_rect_alignment())
10387                .field("required_min_size", &self.required_min_size())
10388                .field("required_max_size", &self.required_max_size())
10389                .field("bytes_per_row_divisor", &self.bytes_per_row_divisor())
10390                .field("start_offset_divisor", &self.start_offset_divisor())
10391                .field("pixel_format_and_modifiers", &self.pixel_format_and_modifiers())
10392                .field(
10393                    "require_bytes_per_row_at_pixel_boundary",
10394                    &self.require_bytes_per_row_at_pixel_boundary(),
10395                )
10396                .field("is_alpha_present", &self.is_alpha_present())
10397                .field("required_max_size_list", &self.required_max_size_list())
10398                .field("pad_for_block_size", &self.pad_for_block_size())
10399                .field("pad_beyond_image_size_bytes", &self.pad_beyond_image_size_bytes())
10400                .finish()
10401        }
10402    }
10403
10404    impl<'de> ::fidl_next::IntoNatural for ImageFormatConstraints<'de> {
10405        type Natural = crate::natural::ImageFormatConstraints;
10406    }
10407
10408    /// The wire type corresponding to [`BufferCollectionConstraints`].
10409    #[repr(C)]
10410    pub struct BufferCollectionConstraints<'de> {
10411        pub(crate) table: ::fidl_next::wire::Table<'de>,
10412    }
10413
10414    impl<'de> Drop for BufferCollectionConstraints<'de> {
10415        fn drop(&mut self) {
10416            let _ = self.table.get(1).map(|envelope| unsafe {
10417                envelope.read_unchecked::<crate::wire::BufferUsage<'de>>()
10418            });
10419
10420            let _ = self
10421                .table
10422                .get(2)
10423                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10424
10425            let _ = self
10426                .table
10427                .get(3)
10428                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10429
10430            let _ = self
10431                .table
10432                .get(4)
10433                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10434
10435            let _ = self
10436                .table
10437                .get(5)
10438                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10439
10440            let _ = self
10441                .table
10442                .get(6)
10443                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10444
10445            let _ = self.table.get(7).map(|envelope| unsafe {
10446                envelope.read_unchecked::<crate::wire::BufferMemoryConstraints<'de>>()
10447            });
10448
10449            let _ = self.table.get(8)
10450                .map(|envelope| unsafe {
10451                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ImageFormatConstraints<'de>>>()
10452                });
10453        }
10454    }
10455
10456    impl ::fidl_next::Constrained for BufferCollectionConstraints<'_> {
10457        type Constraint = ();
10458
10459        fn validate(
10460            _: ::fidl_next::Slot<'_, Self>,
10461            _: Self::Constraint,
10462        ) -> Result<(), ::fidl_next::ValidationError> {
10463            Ok(())
10464        }
10465    }
10466
10467    unsafe impl ::fidl_next::Wire for BufferCollectionConstraints<'static> {
10468        type Narrowed<'de> = BufferCollectionConstraints<'de>;
10469
10470        #[inline]
10471        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10472            ::fidl_next::munge!(let Self { table } = out);
10473            ::fidl_next::wire::Table::zero_padding(table);
10474        }
10475    }
10476
10477    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferCollectionConstraints<'de>
10478    where
10479        ___D: ::fidl_next::Decoder<'de> + ?Sized,
10480    {
10481        fn decode(
10482            slot: ::fidl_next::Slot<'_, Self>,
10483            decoder: &mut ___D,
10484            _: (),
10485        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10486            ::fidl_next::munge!(let Self { table } = slot);
10487
10488            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10489                match ordinal {
10490                    0 => unsafe { ::core::hint::unreachable_unchecked() },
10491
10492                    1 => {
10493                        ::fidl_next::wire::Envelope::decode_as::<
10494                            ___D,
10495                            crate::wire::BufferUsage<'de>,
10496                        >(slot.as_mut(), decoder, ())?;
10497
10498                        Ok(())
10499                    }
10500
10501                    2 => {
10502                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10503                            slot.as_mut(),
10504                            decoder,
10505                            (),
10506                        )?;
10507
10508                        Ok(())
10509                    }
10510
10511                    3 => {
10512                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10513                            slot.as_mut(),
10514                            decoder,
10515                            (),
10516                        )?;
10517
10518                        Ok(())
10519                    }
10520
10521                    4 => {
10522                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10523                            slot.as_mut(),
10524                            decoder,
10525                            (),
10526                        )?;
10527
10528                        Ok(())
10529                    }
10530
10531                    5 => {
10532                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10533                            slot.as_mut(),
10534                            decoder,
10535                            (),
10536                        )?;
10537
10538                        Ok(())
10539                    }
10540
10541                    6 => {
10542                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10543                            slot.as_mut(),
10544                            decoder,
10545                            (),
10546                        )?;
10547
10548                        Ok(())
10549                    }
10550
10551                    7 => {
10552                        ::fidl_next::wire::Envelope::decode_as::<
10553                            ___D,
10554                            crate::wire::BufferMemoryConstraints<'de>,
10555                        >(slot.as_mut(), decoder, ())?;
10556
10557                        Ok(())
10558                    }
10559
10560                    8 => {
10561                        ::fidl_next::wire::Envelope::decode_as::<
10562                            ___D,
10563                            ::fidl_next::wire::Vector<
10564                                'de,
10565                                crate::wire::ImageFormatConstraints<'de>,
10566                            >,
10567                        >(slot.as_mut(), decoder, (64, ()))?;
10568
10569                        let value = unsafe {
10570                            slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
10571                                '_,
10572                                crate::wire::ImageFormatConstraints<'_>,
10573                            >>()
10574                        };
10575
10576                        if value.len() > 64 {
10577                            return Err(::fidl_next::DecodeError::VectorTooLong {
10578                                size: value.len() as u64,
10579                                limit: 64,
10580                            });
10581                        }
10582
10583                        Ok(())
10584                    }
10585
10586                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10587                }
10588            })
10589        }
10590    }
10591
10592    impl<'de> BufferCollectionConstraints<'de> {
10593        pub fn usage(&self) -> ::core::option::Option<&crate::wire::BufferUsage<'de>> {
10594            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10595        }
10596
10597        pub fn take_usage(&mut self) -> ::core::option::Option<crate::wire::BufferUsage<'de>> {
10598            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
10599        }
10600
10601        pub fn min_buffer_count_for_camping(
10602            &self,
10603        ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10604            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10605        }
10606
10607        pub fn take_min_buffer_count_for_camping(
10608            &mut self,
10609        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10610            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
10611        }
10612
10613        pub fn min_buffer_count_for_dedicated_slack(
10614            &self,
10615        ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10616            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10617        }
10618
10619        pub fn take_min_buffer_count_for_dedicated_slack(
10620            &mut self,
10621        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10622            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
10623        }
10624
10625        pub fn min_buffer_count_for_shared_slack(
10626            &self,
10627        ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10628            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10629        }
10630
10631        pub fn take_min_buffer_count_for_shared_slack(
10632            &mut self,
10633        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10634            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
10635        }
10636
10637        pub fn min_buffer_count(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10638            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10639        }
10640
10641        pub fn take_min_buffer_count(
10642            &mut self,
10643        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10644            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
10645        }
10646
10647        pub fn max_buffer_count(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10648            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10649        }
10650
10651        pub fn take_max_buffer_count(
10652            &mut self,
10653        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
10654            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
10655        }
10656
10657        pub fn buffer_memory_constraints(
10658            &self,
10659        ) -> ::core::option::Option<&crate::wire::BufferMemoryConstraints<'de>> {
10660            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10661        }
10662
10663        pub fn take_buffer_memory_constraints(
10664            &mut self,
10665        ) -> ::core::option::Option<crate::wire::BufferMemoryConstraints<'de>> {
10666            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
10667        }
10668
10669        pub fn image_format_constraints(
10670            &self,
10671        ) -> ::core::option::Option<
10672            &::fidl_next::wire::Vector<'de, crate::wire::ImageFormatConstraints<'de>>,
10673        > {
10674            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10675        }
10676
10677        pub fn take_image_format_constraints(
10678            &mut self,
10679        ) -> ::core::option::Option<
10680            ::fidl_next::wire::Vector<'de, crate::wire::ImageFormatConstraints<'de>>,
10681        > {
10682            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
10683        }
10684    }
10685
10686    impl<'de> ::core::fmt::Debug for BufferCollectionConstraints<'de> {
10687        fn fmt(
10688            &self,
10689            f: &mut ::core::fmt::Formatter<'_>,
10690        ) -> ::core::result::Result<(), ::core::fmt::Error> {
10691            f.debug_struct("BufferCollectionConstraints")
10692                .field("usage", &self.usage())
10693                .field("min_buffer_count_for_camping", &self.min_buffer_count_for_camping())
10694                .field(
10695                    "min_buffer_count_for_dedicated_slack",
10696                    &self.min_buffer_count_for_dedicated_slack(),
10697                )
10698                .field(
10699                    "min_buffer_count_for_shared_slack",
10700                    &self.min_buffer_count_for_shared_slack(),
10701                )
10702                .field("min_buffer_count", &self.min_buffer_count())
10703                .field("max_buffer_count", &self.max_buffer_count())
10704                .field("buffer_memory_constraints", &self.buffer_memory_constraints())
10705                .field("image_format_constraints", &self.image_format_constraints())
10706                .finish()
10707        }
10708    }
10709
10710    impl<'de> ::fidl_next::IntoNatural for BufferCollectionConstraints<'de> {
10711        type Natural = crate::natural::BufferCollectionConstraints;
10712    }
10713
10714    /// The wire type corresponding to [`CoherencyDomain`].
10715    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
10716    #[repr(transparent)]
10717    pub struct CoherencyDomain {
10718        pub(crate) value: ::fidl_next::wire::Uint32,
10719    }
10720
10721    impl ::fidl_next::Constrained for CoherencyDomain {
10722        type Constraint = ();
10723
10724        fn validate(
10725            _: ::fidl_next::Slot<'_, Self>,
10726            _: Self::Constraint,
10727        ) -> Result<(), ::fidl_next::ValidationError> {
10728            Ok(())
10729        }
10730    }
10731
10732    unsafe impl ::fidl_next::Wire for CoherencyDomain {
10733        type Narrowed<'de> = Self;
10734
10735        #[inline]
10736        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10737            // Wire enums have no padding
10738        }
10739    }
10740
10741    impl CoherencyDomain {
10742        pub const CPU: CoherencyDomain = CoherencyDomain { value: ::fidl_next::wire::Uint32(0) };
10743
10744        pub const RAM: CoherencyDomain = CoherencyDomain { value: ::fidl_next::wire::Uint32(1) };
10745
10746        pub const INACCESSIBLE: CoherencyDomain =
10747            CoherencyDomain { value: ::fidl_next::wire::Uint32(2) };
10748    }
10749
10750    unsafe impl<___D> ::fidl_next::Decode<___D> for CoherencyDomain
10751    where
10752        ___D: ?Sized,
10753    {
10754        fn decode(
10755            slot: ::fidl_next::Slot<'_, Self>,
10756            _: &mut ___D,
10757            _: (),
10758        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10759            Ok(())
10760        }
10761    }
10762
10763    impl ::core::convert::From<crate::natural::CoherencyDomain> for CoherencyDomain {
10764        fn from(natural: crate::natural::CoherencyDomain) -> Self {
10765            match natural {
10766                crate::natural::CoherencyDomain::Cpu => CoherencyDomain::CPU,
10767
10768                crate::natural::CoherencyDomain::Ram => CoherencyDomain::RAM,
10769
10770                crate::natural::CoherencyDomain::Inaccessible => CoherencyDomain::INACCESSIBLE,
10771
10772                crate::natural::CoherencyDomain::UnknownOrdinal_(value) => {
10773                    CoherencyDomain { value: ::fidl_next::wire::Uint32::from(value) }
10774                }
10775            }
10776        }
10777    }
10778
10779    impl ::fidl_next::IntoNatural for CoherencyDomain {
10780        type Natural = crate::natural::CoherencyDomain;
10781    }
10782
10783    /// The wire type corresponding to [`BufferMemorySettings`].
10784    #[repr(C)]
10785    pub struct BufferMemorySettings<'de> {
10786        pub(crate) table: ::fidl_next::wire::Table<'de>,
10787    }
10788
10789    impl<'de> Drop for BufferMemorySettings<'de> {
10790        fn drop(&mut self) {
10791            let _ = self
10792                .table
10793                .get(1)
10794                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
10795
10796            let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10797
10798            let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10799
10800            let _ = self.table.get(4).map(|envelope| unsafe {
10801                envelope.read_unchecked::<crate::wire::CoherencyDomain>()
10802            });
10803
10804            let _ = self
10805                .table
10806                .get(5)
10807                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
10808
10809            let _ = self
10810                .table
10811                .get(6)
10812                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
10813        }
10814    }
10815
10816    impl ::fidl_next::Constrained for BufferMemorySettings<'_> {
10817        type Constraint = ();
10818
10819        fn validate(
10820            _: ::fidl_next::Slot<'_, Self>,
10821            _: Self::Constraint,
10822        ) -> Result<(), ::fidl_next::ValidationError> {
10823            Ok(())
10824        }
10825    }
10826
10827    unsafe impl ::fidl_next::Wire for BufferMemorySettings<'static> {
10828        type Narrowed<'de> = BufferMemorySettings<'de>;
10829
10830        #[inline]
10831        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10832            ::fidl_next::munge!(let Self { table } = out);
10833            ::fidl_next::wire::Table::zero_padding(table);
10834        }
10835    }
10836
10837    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferMemorySettings<'de>
10838    where
10839        ___D: ::fidl_next::Decoder<'de> + ?Sized,
10840    {
10841        fn decode(
10842            slot: ::fidl_next::Slot<'_, Self>,
10843            decoder: &mut ___D,
10844            _: (),
10845        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10846            ::fidl_next::munge!(let Self { table } = slot);
10847
10848            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10849                match ordinal {
10850                    0 => unsafe { ::core::hint::unreachable_unchecked() },
10851
10852                    1 => {
10853                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
10854                            slot.as_mut(),
10855                            decoder,
10856                            (),
10857                        )?;
10858
10859                        Ok(())
10860                    }
10861
10862                    2 => {
10863                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10864                            slot.as_mut(),
10865                            decoder,
10866                            (),
10867                        )?;
10868
10869                        Ok(())
10870                    }
10871
10872                    3 => {
10873                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10874                            slot.as_mut(),
10875                            decoder,
10876                            (),
10877                        )?;
10878
10879                        Ok(())
10880                    }
10881
10882                    4 => {
10883                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::CoherencyDomain>(
10884                            slot.as_mut(),
10885                            decoder,
10886                            (),
10887                        )?;
10888
10889                        Ok(())
10890                    }
10891
10892                    5 => {
10893                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
10894                            slot.as_mut(),
10895                            decoder,
10896                            (),
10897                        )?;
10898
10899                        Ok(())
10900                    }
10901
10902                    6 => {
10903                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
10904                            slot.as_mut(),
10905                            decoder,
10906                            (),
10907                        )?;
10908
10909                        Ok(())
10910                    }
10911
10912                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10913                }
10914            })
10915        }
10916    }
10917
10918    impl<'de> BufferMemorySettings<'de> {
10919        pub fn size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10920            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10921        }
10922
10923        pub fn take_size_bytes(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
10924            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
10925        }
10926
10927        pub fn is_physically_contiguous(&self) -> ::core::option::Option<&bool> {
10928            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10929        }
10930
10931        pub fn take_is_physically_contiguous(&mut self) -> ::core::option::Option<bool> {
10932            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
10933        }
10934
10935        pub fn is_secure(&self) -> ::core::option::Option<&bool> {
10936            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10937        }
10938
10939        pub fn take_is_secure(&mut self) -> ::core::option::Option<bool> {
10940            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
10941        }
10942
10943        pub fn coherency_domain(&self) -> ::core::option::Option<&crate::wire::CoherencyDomain> {
10944            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10945        }
10946
10947        pub fn take_coherency_domain(
10948            &mut self,
10949        ) -> ::core::option::Option<crate::wire::CoherencyDomain> {
10950            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
10951        }
10952
10953        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
10954            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10955        }
10956
10957        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
10958            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
10959        }
10960
10961        pub fn raw_vmo_size(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10962            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10963        }
10964
10965        pub fn take_raw_vmo_size(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
10966            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
10967        }
10968    }
10969
10970    impl<'de> ::core::fmt::Debug for BufferMemorySettings<'de> {
10971        fn fmt(
10972            &self,
10973            f: &mut ::core::fmt::Formatter<'_>,
10974        ) -> ::core::result::Result<(), ::core::fmt::Error> {
10975            f.debug_struct("BufferMemorySettings")
10976                .field("size_bytes", &self.size_bytes())
10977                .field("is_physically_contiguous", &self.is_physically_contiguous())
10978                .field("is_secure", &self.is_secure())
10979                .field("coherency_domain", &self.coherency_domain())
10980                .field("heap", &self.heap())
10981                .field("raw_vmo_size", &self.raw_vmo_size())
10982                .finish()
10983        }
10984    }
10985
10986    impl<'de> ::fidl_next::IntoNatural for BufferMemorySettings<'de> {
10987        type Natural = crate::natural::BufferMemorySettings;
10988    }
10989
10990    /// The wire type corresponding to [`SingleBufferSettings`].
10991    #[repr(C)]
10992    pub struct SingleBufferSettings<'de> {
10993        pub(crate) table: ::fidl_next::wire::Table<'de>,
10994    }
10995
10996    impl<'de> Drop for SingleBufferSettings<'de> {
10997        fn drop(&mut self) {
10998            let _ = self.table.get(1).map(|envelope| unsafe {
10999                envelope.read_unchecked::<crate::wire::BufferMemorySettings<'de>>()
11000            });
11001
11002            let _ = self.table.get(2).map(|envelope| unsafe {
11003                envelope.read_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
11004            });
11005        }
11006    }
11007
11008    impl ::fidl_next::Constrained for SingleBufferSettings<'_> {
11009        type Constraint = ();
11010
11011        fn validate(
11012            _: ::fidl_next::Slot<'_, Self>,
11013            _: Self::Constraint,
11014        ) -> Result<(), ::fidl_next::ValidationError> {
11015            Ok(())
11016        }
11017    }
11018
11019    unsafe impl ::fidl_next::Wire for SingleBufferSettings<'static> {
11020        type Narrowed<'de> = SingleBufferSettings<'de>;
11021
11022        #[inline]
11023        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11024            ::fidl_next::munge!(let Self { table } = out);
11025            ::fidl_next::wire::Table::zero_padding(table);
11026        }
11027    }
11028
11029    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SingleBufferSettings<'de>
11030    where
11031        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11032    {
11033        fn decode(
11034            slot: ::fidl_next::Slot<'_, Self>,
11035            decoder: &mut ___D,
11036            _: (),
11037        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11038            ::fidl_next::munge!(let Self { table } = slot);
11039
11040            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11041                match ordinal {
11042                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11043
11044                    1 => {
11045                        ::fidl_next::wire::Envelope::decode_as::<
11046                            ___D,
11047                            crate::wire::BufferMemorySettings<'de>,
11048                        >(slot.as_mut(), decoder, ())?;
11049
11050                        Ok(())
11051                    }
11052
11053                    2 => {
11054                        ::fidl_next::wire::Envelope::decode_as::<
11055                            ___D,
11056                            crate::wire::ImageFormatConstraints<'de>,
11057                        >(slot.as_mut(), decoder, ())?;
11058
11059                        Ok(())
11060                    }
11061
11062                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11063                }
11064            })
11065        }
11066    }
11067
11068    impl<'de> SingleBufferSettings<'de> {
11069        pub fn buffer_settings(
11070            &self,
11071        ) -> ::core::option::Option<&crate::wire::BufferMemorySettings<'de>> {
11072            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11073        }
11074
11075        pub fn take_buffer_settings(
11076            &mut self,
11077        ) -> ::core::option::Option<crate::wire::BufferMemorySettings<'de>> {
11078            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11079        }
11080
11081        pub fn image_format_constraints(
11082            &self,
11083        ) -> ::core::option::Option<&crate::wire::ImageFormatConstraints<'de>> {
11084            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11085        }
11086
11087        pub fn take_image_format_constraints(
11088            &mut self,
11089        ) -> ::core::option::Option<crate::wire::ImageFormatConstraints<'de>> {
11090            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
11091        }
11092    }
11093
11094    impl<'de> ::core::fmt::Debug for SingleBufferSettings<'de> {
11095        fn fmt(
11096            &self,
11097            f: &mut ::core::fmt::Formatter<'_>,
11098        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11099            f.debug_struct("SingleBufferSettings")
11100                .field("buffer_settings", &self.buffer_settings())
11101                .field("image_format_constraints", &self.image_format_constraints())
11102                .finish()
11103        }
11104    }
11105
11106    impl<'de> ::fidl_next::IntoNatural for SingleBufferSettings<'de> {
11107        type Natural = crate::natural::SingleBufferSettings;
11108    }
11109
11110    /// The wire type corresponding to [`Error`].
11111    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
11112    #[repr(transparent)]
11113    pub struct Error {
11114        pub(crate) value: ::fidl_next::wire::Uint32,
11115    }
11116
11117    impl ::fidl_next::Constrained for Error {
11118        type Constraint = ();
11119
11120        fn validate(
11121            _: ::fidl_next::Slot<'_, Self>,
11122            _: Self::Constraint,
11123        ) -> Result<(), ::fidl_next::ValidationError> {
11124            Ok(())
11125        }
11126    }
11127
11128    unsafe impl ::fidl_next::Wire for Error {
11129        type Narrowed<'de> = Self;
11130
11131        #[inline]
11132        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11133            // Wire enums have no padding
11134        }
11135    }
11136
11137    impl Error {
11138        pub const INVALID: Error = Error { value: ::fidl_next::wire::Uint32(0) };
11139
11140        pub const UNSPECIFIED: Error = Error { value: ::fidl_next::wire::Uint32(1) };
11141
11142        pub const PROTOCOL_DEVIATION: Error = Error { value: ::fidl_next::wire::Uint32(2) };
11143
11144        pub const NOT_FOUND: Error = Error { value: ::fidl_next::wire::Uint32(3) };
11145
11146        pub const HANDLE_ACCESS_DENIED: Error = Error { value: ::fidl_next::wire::Uint32(4) };
11147
11148        pub const NO_MEMORY: Error = Error { value: ::fidl_next::wire::Uint32(5) };
11149
11150        pub const CONSTRAINTS_INTERSECTION_EMPTY: Error =
11151            Error { value: ::fidl_next::wire::Uint32(6) };
11152
11153        pub const PENDING: Error = Error { value: ::fidl_next::wire::Uint32(7) };
11154
11155        pub const TOO_MANY_GROUP_CHILD_COMBINATIONS: Error =
11156            Error { value: ::fidl_next::wire::Uint32(8) };
11157
11158        pub const NO_MORE_STRONG_VMO_HANDLES: Error = Error { value: ::fidl_next::wire::Uint32(9) };
11159    }
11160
11161    unsafe impl<___D> ::fidl_next::Decode<___D> for Error
11162    where
11163        ___D: ?Sized,
11164    {
11165        fn decode(
11166            slot: ::fidl_next::Slot<'_, Self>,
11167            _: &mut ___D,
11168            _: (),
11169        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11170            Ok(())
11171        }
11172    }
11173
11174    impl ::core::convert::From<crate::natural::Error> for Error {
11175        fn from(natural: crate::natural::Error) -> Self {
11176            match natural {
11177                crate::natural::Error::Invalid => Error::INVALID,
11178
11179                crate::natural::Error::Unspecified => Error::UNSPECIFIED,
11180
11181                crate::natural::Error::ProtocolDeviation => Error::PROTOCOL_DEVIATION,
11182
11183                crate::natural::Error::NotFound => Error::NOT_FOUND,
11184
11185                crate::natural::Error::HandleAccessDenied => Error::HANDLE_ACCESS_DENIED,
11186
11187                crate::natural::Error::NoMemory => Error::NO_MEMORY,
11188
11189                crate::natural::Error::ConstraintsIntersectionEmpty => {
11190                    Error::CONSTRAINTS_INTERSECTION_EMPTY
11191                }
11192
11193                crate::natural::Error::Pending => Error::PENDING,
11194
11195                crate::natural::Error::TooManyGroupChildCombinations => {
11196                    Error::TOO_MANY_GROUP_CHILD_COMBINATIONS
11197                }
11198
11199                crate::natural::Error::NoMoreStrongVmoHandles => Error::NO_MORE_STRONG_VMO_HANDLES,
11200
11201                crate::natural::Error::UnknownOrdinal_(value) => {
11202                    Error { value: ::fidl_next::wire::Uint32::from(value) }
11203                }
11204            }
11205        }
11206    }
11207
11208    impl ::fidl_next::IntoNatural for Error {
11209        type Natural = crate::natural::Error;
11210    }
11211
11212    /// The wire type corresponding to [`NodeSyncResponse`].
11213    pub type NodeSyncResponse = ::fidl_next::wire::Unit;
11214
11215    /// The wire type corresponding to [`NodeSetNameRequest`].
11216    #[repr(C)]
11217    pub struct NodeSetNameRequest<'de> {
11218        pub(crate) table: ::fidl_next::wire::Table<'de>,
11219    }
11220
11221    impl<'de> Drop for NodeSetNameRequest<'de> {
11222        fn drop(&mut self) {
11223            let _ = self
11224                .table
11225                .get(1)
11226                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
11227
11228            let _ = self.table.get(2).map(|envelope| unsafe {
11229                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11230            });
11231        }
11232    }
11233
11234    impl ::fidl_next::Constrained for NodeSetNameRequest<'_> {
11235        type Constraint = ();
11236
11237        fn validate(
11238            _: ::fidl_next::Slot<'_, Self>,
11239            _: Self::Constraint,
11240        ) -> Result<(), ::fidl_next::ValidationError> {
11241            Ok(())
11242        }
11243    }
11244
11245    unsafe impl ::fidl_next::Wire for NodeSetNameRequest<'static> {
11246        type Narrowed<'de> = NodeSetNameRequest<'de>;
11247
11248        #[inline]
11249        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11250            ::fidl_next::munge!(let Self { table } = out);
11251            ::fidl_next::wire::Table::zero_padding(table);
11252        }
11253    }
11254
11255    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetNameRequest<'de>
11256    where
11257        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11258    {
11259        fn decode(
11260            slot: ::fidl_next::Slot<'_, Self>,
11261            decoder: &mut ___D,
11262            _: (),
11263        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11264            ::fidl_next::munge!(let Self { table } = slot);
11265
11266            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11267                match ordinal {
11268                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11269
11270                    1 => {
11271                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
11272                            slot.as_mut(),
11273                            decoder,
11274                            (),
11275                        )?;
11276
11277                        Ok(())
11278                    }
11279
11280                    2 => {
11281                        ::fidl_next::wire::Envelope::decode_as::<
11282                            ___D,
11283                            ::fidl_next::wire::String<'de>,
11284                        >(slot.as_mut(), decoder, 64)?;
11285
11286                        let value = unsafe {
11287                            slot.deref_unchecked()
11288                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
11289                        };
11290
11291                        if value.len() > 64 {
11292                            return Err(::fidl_next::DecodeError::VectorTooLong {
11293                                size: value.len() as u64,
11294                                limit: 64,
11295                            });
11296                        }
11297
11298                        Ok(())
11299                    }
11300
11301                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11302                }
11303            })
11304        }
11305    }
11306
11307    impl<'de> NodeSetNameRequest<'de> {
11308        pub fn priority(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
11309            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11310        }
11311
11312        pub fn take_priority(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
11313            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11314        }
11315
11316        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
11317            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11318        }
11319
11320        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
11321            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
11322        }
11323    }
11324
11325    impl<'de> ::core::fmt::Debug for NodeSetNameRequest<'de> {
11326        fn fmt(
11327            &self,
11328            f: &mut ::core::fmt::Formatter<'_>,
11329        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11330            f.debug_struct("NodeSetNameRequest")
11331                .field("priority", &self.priority())
11332                .field("name", &self.name())
11333                .finish()
11334        }
11335    }
11336
11337    impl<'de> ::fidl_next::IntoNatural for NodeSetNameRequest<'de> {
11338        type Natural = crate::natural::NodeSetNameRequest;
11339    }
11340
11341    /// The wire type corresponding to [`NodeSetDebugClientInfoRequest`].
11342    #[repr(C)]
11343    pub struct NodeSetDebugClientInfoRequest<'de> {
11344        pub(crate) table: ::fidl_next::wire::Table<'de>,
11345    }
11346
11347    impl<'de> Drop for NodeSetDebugClientInfoRequest<'de> {
11348        fn drop(&mut self) {
11349            let _ = self.table.get(1).map(|envelope| unsafe {
11350                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11351            });
11352
11353            let _ = self
11354                .table
11355                .get(2)
11356                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
11357        }
11358    }
11359
11360    impl ::fidl_next::Constrained for NodeSetDebugClientInfoRequest<'_> {
11361        type Constraint = ();
11362
11363        fn validate(
11364            _: ::fidl_next::Slot<'_, Self>,
11365            _: Self::Constraint,
11366        ) -> Result<(), ::fidl_next::ValidationError> {
11367            Ok(())
11368        }
11369    }
11370
11371    unsafe impl ::fidl_next::Wire for NodeSetDebugClientInfoRequest<'static> {
11372        type Narrowed<'de> = NodeSetDebugClientInfoRequest<'de>;
11373
11374        #[inline]
11375        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11376            ::fidl_next::munge!(let Self { table } = out);
11377            ::fidl_next::wire::Table::zero_padding(table);
11378        }
11379    }
11380
11381    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetDebugClientInfoRequest<'de>
11382    where
11383        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11384    {
11385        fn decode(
11386            slot: ::fidl_next::Slot<'_, Self>,
11387            decoder: &mut ___D,
11388            _: (),
11389        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11390            ::fidl_next::munge!(let Self { table } = slot);
11391
11392            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11393                match ordinal {
11394                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11395
11396                    1 => {
11397                        ::fidl_next::wire::Envelope::decode_as::<
11398                            ___D,
11399                            ::fidl_next::wire::String<'de>,
11400                        >(slot.as_mut(), decoder, 256)?;
11401
11402                        let value = unsafe {
11403                            slot.deref_unchecked()
11404                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
11405                        };
11406
11407                        if value.len() > 256 {
11408                            return Err(::fidl_next::DecodeError::VectorTooLong {
11409                                size: value.len() as u64,
11410                                limit: 256,
11411                            });
11412                        }
11413
11414                        Ok(())
11415                    }
11416
11417                    2 => {
11418                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
11419                            slot.as_mut(),
11420                            decoder,
11421                            (),
11422                        )?;
11423
11424                        Ok(())
11425                    }
11426
11427                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11428                }
11429            })
11430        }
11431    }
11432
11433    impl<'de> NodeSetDebugClientInfoRequest<'de> {
11434        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
11435            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11436        }
11437
11438        pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
11439            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11440        }
11441
11442        pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
11443            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11444        }
11445
11446        pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
11447            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
11448        }
11449    }
11450
11451    impl<'de> ::core::fmt::Debug for NodeSetDebugClientInfoRequest<'de> {
11452        fn fmt(
11453            &self,
11454            f: &mut ::core::fmt::Formatter<'_>,
11455        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11456            f.debug_struct("NodeSetDebugClientInfoRequest")
11457                .field("name", &self.name())
11458                .field("id", &self.id())
11459                .finish()
11460        }
11461    }
11462
11463    impl<'de> ::fidl_next::IntoNatural for NodeSetDebugClientInfoRequest<'de> {
11464        type Natural = crate::natural::NodeSetDebugClientInfoRequest;
11465    }
11466
11467    /// The wire type corresponding to [`NodeSetDebugTimeoutLogDeadlineRequest`].
11468    #[repr(C)]
11469    pub struct NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11470        pub(crate) table: ::fidl_next::wire::Table<'de>,
11471    }
11472
11473    impl<'de> Drop for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11474        fn drop(&mut self) {
11475            let _ = self
11476                .table
11477                .get(1)
11478                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
11479        }
11480    }
11481
11482    impl ::fidl_next::Constrained for NodeSetDebugTimeoutLogDeadlineRequest<'_> {
11483        type Constraint = ();
11484
11485        fn validate(
11486            _: ::fidl_next::Slot<'_, Self>,
11487            _: Self::Constraint,
11488        ) -> Result<(), ::fidl_next::ValidationError> {
11489            Ok(())
11490        }
11491    }
11492
11493    unsafe impl ::fidl_next::Wire for NodeSetDebugTimeoutLogDeadlineRequest<'static> {
11494        type Narrowed<'de> = NodeSetDebugTimeoutLogDeadlineRequest<'de>;
11495
11496        #[inline]
11497        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11498            ::fidl_next::munge!(let Self { table } = out);
11499            ::fidl_next::wire::Table::zero_padding(table);
11500        }
11501    }
11502
11503    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetDebugTimeoutLogDeadlineRequest<'de>
11504    where
11505        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11506    {
11507        fn decode(
11508            slot: ::fidl_next::Slot<'_, Self>,
11509            decoder: &mut ___D,
11510            _: (),
11511        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11512            ::fidl_next::munge!(let Self { table } = slot);
11513
11514            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11515                match ordinal {
11516                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11517
11518                    1 => {
11519                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
11520                            slot.as_mut(),
11521                            decoder,
11522                            (),
11523                        )?;
11524
11525                        Ok(())
11526                    }
11527
11528                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11529                }
11530            })
11531        }
11532    }
11533
11534    impl<'de> NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11535        pub fn deadline(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
11536            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11537        }
11538
11539        pub fn take_deadline(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
11540            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11541        }
11542    }
11543
11544    impl<'de> ::core::fmt::Debug for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11545        fn fmt(
11546            &self,
11547            f: &mut ::core::fmt::Formatter<'_>,
11548        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11549            f.debug_struct("NodeSetDebugTimeoutLogDeadlineRequest")
11550                .field("deadline", &self.deadline())
11551                .finish()
11552        }
11553    }
11554
11555    impl<'de> ::fidl_next::IntoNatural for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
11556        type Natural = crate::natural::NodeSetDebugTimeoutLogDeadlineRequest;
11557    }
11558
11559    /// The wire type corresponding to [`NodeIsAlternateForResponse`].
11560    #[repr(C)]
11561    pub struct NodeIsAlternateForResponse<'de> {
11562        pub(crate) table: ::fidl_next::wire::Table<'de>,
11563    }
11564
11565    impl<'de> Drop for NodeIsAlternateForResponse<'de> {
11566        fn drop(&mut self) {
11567            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
11568        }
11569    }
11570
11571    impl ::fidl_next::Constrained for NodeIsAlternateForResponse<'_> {
11572        type Constraint = ();
11573
11574        fn validate(
11575            _: ::fidl_next::Slot<'_, Self>,
11576            _: Self::Constraint,
11577        ) -> Result<(), ::fidl_next::ValidationError> {
11578            Ok(())
11579        }
11580    }
11581
11582    unsafe impl ::fidl_next::Wire for NodeIsAlternateForResponse<'static> {
11583        type Narrowed<'de> = NodeIsAlternateForResponse<'de>;
11584
11585        #[inline]
11586        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11587            ::fidl_next::munge!(let Self { table } = out);
11588            ::fidl_next::wire::Table::zero_padding(table);
11589        }
11590    }
11591
11592    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeIsAlternateForResponse<'de>
11593    where
11594        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11595    {
11596        fn decode(
11597            slot: ::fidl_next::Slot<'_, Self>,
11598            decoder: &mut ___D,
11599            _: (),
11600        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11601            ::fidl_next::munge!(let Self { table } = slot);
11602
11603            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11604                match ordinal {
11605                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11606
11607                    1 => {
11608                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
11609                            slot.as_mut(),
11610                            decoder,
11611                            (),
11612                        )?;
11613
11614                        Ok(())
11615                    }
11616
11617                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11618                }
11619            })
11620        }
11621    }
11622
11623    impl<'de> NodeIsAlternateForResponse<'de> {
11624        pub fn is_alternate(&self) -> ::core::option::Option<&bool> {
11625            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11626        }
11627
11628        pub fn take_is_alternate(&mut self) -> ::core::option::Option<bool> {
11629            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11630        }
11631    }
11632
11633    impl<'de> ::core::fmt::Debug for NodeIsAlternateForResponse<'de> {
11634        fn fmt(
11635            &self,
11636            f: &mut ::core::fmt::Formatter<'_>,
11637        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11638            f.debug_struct("NodeIsAlternateForResponse")
11639                .field("is_alternate", &self.is_alternate())
11640                .finish()
11641        }
11642    }
11643
11644    impl<'de> ::fidl_next::IntoNatural for NodeIsAlternateForResponse<'de> {
11645        type Natural = crate::natural::NodeIsAlternateForResponse;
11646    }
11647
11648    /// The wire type corresponding to [`NodeGetBufferCollectionIdResponse`].
11649    #[repr(C)]
11650    pub struct NodeGetBufferCollectionIdResponse<'de> {
11651        pub(crate) table: ::fidl_next::wire::Table<'de>,
11652    }
11653
11654    impl<'de> Drop for NodeGetBufferCollectionIdResponse<'de> {
11655        fn drop(&mut self) {
11656            let _ = self
11657                .table
11658                .get(1)
11659                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
11660        }
11661    }
11662
11663    impl ::fidl_next::Constrained for NodeGetBufferCollectionIdResponse<'_> {
11664        type Constraint = ();
11665
11666        fn validate(
11667            _: ::fidl_next::Slot<'_, Self>,
11668            _: Self::Constraint,
11669        ) -> Result<(), ::fidl_next::ValidationError> {
11670            Ok(())
11671        }
11672    }
11673
11674    unsafe impl ::fidl_next::Wire for NodeGetBufferCollectionIdResponse<'static> {
11675        type Narrowed<'de> = NodeGetBufferCollectionIdResponse<'de>;
11676
11677        #[inline]
11678        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11679            ::fidl_next::munge!(let Self { table } = out);
11680            ::fidl_next::wire::Table::zero_padding(table);
11681        }
11682    }
11683
11684    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeGetBufferCollectionIdResponse<'de>
11685    where
11686        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11687    {
11688        fn decode(
11689            slot: ::fidl_next::Slot<'_, Self>,
11690            decoder: &mut ___D,
11691            _: (),
11692        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11693            ::fidl_next::munge!(let Self { table } = slot);
11694
11695            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11696                match ordinal {
11697                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11698
11699                    1 => {
11700                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
11701                            slot.as_mut(),
11702                            decoder,
11703                            (),
11704                        )?;
11705
11706                        Ok(())
11707                    }
11708
11709                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11710                }
11711            })
11712        }
11713    }
11714
11715    impl<'de> NodeGetBufferCollectionIdResponse<'de> {
11716        pub fn buffer_collection_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
11717            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11718        }
11719
11720        pub fn take_buffer_collection_id(
11721            &mut self,
11722        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
11723            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11724        }
11725    }
11726
11727    impl<'de> ::core::fmt::Debug for NodeGetBufferCollectionIdResponse<'de> {
11728        fn fmt(
11729            &self,
11730            f: &mut ::core::fmt::Formatter<'_>,
11731        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11732            f.debug_struct("NodeGetBufferCollectionIdResponse")
11733                .field("buffer_collection_id", &self.buffer_collection_id())
11734                .finish()
11735        }
11736    }
11737
11738    impl<'de> ::fidl_next::IntoNatural for NodeGetBufferCollectionIdResponse<'de> {
11739        type Natural = crate::natural::NodeGetBufferCollectionIdResponse;
11740    }
11741
11742    /// The wire type corresponding to [`BufferCollectionCheckAllBuffersAllocatedResponse`].
11743    pub type BufferCollectionCheckAllBuffersAllocatedResponse = ::fidl_next::wire::Unit;
11744
11745    /// The wire type corresponding to [`BufferCollectionTokenDuplicateSyncRequest`].
11746    #[repr(C)]
11747    pub struct BufferCollectionTokenDuplicateSyncRequest<'de> {
11748        pub(crate) table: ::fidl_next::wire::Table<'de>,
11749    }
11750
11751    impl<'de> Drop for BufferCollectionTokenDuplicateSyncRequest<'de> {
11752        fn drop(&mut self) {
11753            let _ = self.table.get(1)
11754                .map(|envelope| unsafe {
11755                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>()
11756                });
11757        }
11758    }
11759
11760    impl ::fidl_next::Constrained for BufferCollectionTokenDuplicateSyncRequest<'_> {
11761        type Constraint = ();
11762
11763        fn validate(
11764            _: ::fidl_next::Slot<'_, Self>,
11765            _: Self::Constraint,
11766        ) -> Result<(), ::fidl_next::ValidationError> {
11767            Ok(())
11768        }
11769    }
11770
11771    unsafe impl ::fidl_next::Wire for BufferCollectionTokenDuplicateSyncRequest<'static> {
11772        type Narrowed<'de> = BufferCollectionTokenDuplicateSyncRequest<'de>;
11773
11774        #[inline]
11775        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11776            ::fidl_next::munge!(let Self { table } = out);
11777            ::fidl_next::wire::Table::zero_padding(table);
11778        }
11779    }
11780
11781    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferCollectionTokenDuplicateSyncRequest<'de>
11782    where
11783        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11784    {
11785        fn decode(
11786            slot: ::fidl_next::Slot<'_, Self>,
11787            decoder: &mut ___D,
11788            _: (),
11789        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11790            ::fidl_next::munge!(let Self { table } = slot);
11791
11792            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11793                match ordinal {
11794                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11795
11796                    1 => {
11797                        ::fidl_next::wire::Envelope::decode_as::<
11798                            ___D,
11799                            ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11800                        >(slot.as_mut(), decoder, (64, ()))?;
11801
11802                        let value = unsafe {
11803                            slot
11804                                            .deref_unchecked()
11805                                            .deref_unchecked::<
11806                                                ::fidl_next::wire::Vector<'_, ::fidl_next::wire::fuchsia::Rights>
11807                                            >()
11808                        };
11809
11810                        if value.len() > 64 {
11811                            return Err(::fidl_next::DecodeError::VectorTooLong {
11812                                size: value.len() as u64,
11813                                limit: 64,
11814                            });
11815                        }
11816
11817                        Ok(())
11818                    }
11819
11820                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11821                }
11822            })
11823        }
11824    }
11825
11826    impl<'de> BufferCollectionTokenDuplicateSyncRequest<'de> {
11827        pub fn rights_attenuation_masks(
11828            &self,
11829        ) -> ::core::option::Option<
11830            &::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11831        > {
11832            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11833        }
11834
11835        pub fn take_rights_attenuation_masks(
11836            &mut self,
11837        ) -> ::core::option::Option<
11838            ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11839        > {
11840            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11841        }
11842    }
11843
11844    impl<'de> ::core::fmt::Debug for BufferCollectionTokenDuplicateSyncRequest<'de> {
11845        fn fmt(
11846            &self,
11847            f: &mut ::core::fmt::Formatter<'_>,
11848        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11849            f.debug_struct("BufferCollectionTokenDuplicateSyncRequest")
11850                .field("rights_attenuation_masks", &self.rights_attenuation_masks())
11851                .finish()
11852        }
11853    }
11854
11855    impl<'de> ::fidl_next::IntoNatural for BufferCollectionTokenDuplicateSyncRequest<'de> {
11856        type Natural = crate::natural::BufferCollectionTokenDuplicateSyncRequest;
11857    }
11858
11859    /// The wire type corresponding to [`BufferCollectionTokenGroupCreateChildrenSyncRequest`].
11860    #[repr(C)]
11861    pub struct BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11862        pub(crate) table: ::fidl_next::wire::Table<'de>,
11863    }
11864
11865    impl<'de> Drop for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11866        fn drop(&mut self) {
11867            let _ = self.table.get(1)
11868                .map(|envelope| unsafe {
11869                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>()
11870                });
11871        }
11872    }
11873
11874    impl ::fidl_next::Constrained for BufferCollectionTokenGroupCreateChildrenSyncRequest<'_> {
11875        type Constraint = ();
11876
11877        fn validate(
11878            _: ::fidl_next::Slot<'_, Self>,
11879            _: Self::Constraint,
11880        ) -> Result<(), ::fidl_next::ValidationError> {
11881            Ok(())
11882        }
11883    }
11884
11885    unsafe impl ::fidl_next::Wire for BufferCollectionTokenGroupCreateChildrenSyncRequest<'static> {
11886        type Narrowed<'de> = BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>;
11887
11888        #[inline]
11889        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11890            ::fidl_next::munge!(let Self { table } = out);
11891            ::fidl_next::wire::Table::zero_padding(table);
11892        }
11893    }
11894
11895    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
11896        for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>
11897    where
11898        ___D: ::fidl_next::Decoder<'de> + ?Sized,
11899    {
11900        fn decode(
11901            slot: ::fidl_next::Slot<'_, Self>,
11902            decoder: &mut ___D,
11903            _: (),
11904        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11905            ::fidl_next::munge!(let Self { table } = slot);
11906
11907            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11908                match ordinal {
11909                    0 => unsafe { ::core::hint::unreachable_unchecked() },
11910
11911                    1 => {
11912                        ::fidl_next::wire::Envelope::decode_as::<
11913                            ___D,
11914                            ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11915                        >(slot.as_mut(), decoder, (64, ()))?;
11916
11917                        let value = unsafe {
11918                            slot
11919                                            .deref_unchecked()
11920                                            .deref_unchecked::<
11921                                                ::fidl_next::wire::Vector<'_, ::fidl_next::wire::fuchsia::Rights>
11922                                            >()
11923                        };
11924
11925                        if value.len() > 64 {
11926                            return Err(::fidl_next::DecodeError::VectorTooLong {
11927                                size: value.len() as u64,
11928                                limit: 64,
11929                            });
11930                        }
11931
11932                        Ok(())
11933                    }
11934
11935                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11936                }
11937            })
11938        }
11939    }
11940
11941    impl<'de> BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11942        pub fn rights_attenuation_masks(
11943            &self,
11944        ) -> ::core::option::Option<
11945            &::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11946        > {
11947            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11948        }
11949
11950        pub fn take_rights_attenuation_masks(
11951            &mut self,
11952        ) -> ::core::option::Option<
11953            ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11954        > {
11955            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
11956        }
11957    }
11958
11959    impl<'de> ::core::fmt::Debug for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11960        fn fmt(
11961            &self,
11962            f: &mut ::core::fmt::Formatter<'_>,
11963        ) -> ::core::result::Result<(), ::core::fmt::Error> {
11964            f.debug_struct("BufferCollectionTokenGroupCreateChildrenSyncRequest")
11965                .field("rights_attenuation_masks", &self.rights_attenuation_masks())
11966                .finish()
11967        }
11968    }
11969
11970    impl<'de> ::fidl_next::IntoNatural for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11971        type Natural = crate::natural::BufferCollectionTokenGroupCreateChildrenSyncRequest;
11972    }
11973
11974    /// The wire type corresponding to [`FormatCostKey`].
11975    #[repr(C)]
11976    pub struct FormatCostKey<'de> {
11977        pub(crate) table: ::fidl_next::wire::Table<'de>,
11978    }
11979
11980    impl<'de> Drop for FormatCostKey<'de> {
11981        fn drop(&mut self) {
11982            let _ = self.table.get(1).map(|envelope| unsafe {
11983                envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>()
11984            });
11985
11986            let _ = self.table.get(2)
11987                .map(|envelope| unsafe {
11988                    envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>()
11989                });
11990
11991            let _ = self.table.get(3).map(|envelope| unsafe {
11992                envelope.read_unchecked::<crate::wire::BufferUsage<'de>>()
11993            });
11994        }
11995    }
11996
11997    impl ::fidl_next::Constrained for FormatCostKey<'_> {
11998        type Constraint = ();
11999
12000        fn validate(
12001            _: ::fidl_next::Slot<'_, Self>,
12002            _: Self::Constraint,
12003        ) -> Result<(), ::fidl_next::ValidationError> {
12004            Ok(())
12005        }
12006    }
12007
12008    unsafe impl ::fidl_next::Wire for FormatCostKey<'static> {
12009        type Narrowed<'de> = FormatCostKey<'de>;
12010
12011        #[inline]
12012        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12013            ::fidl_next::munge!(let Self { table } = out);
12014            ::fidl_next::wire::Table::zero_padding(table);
12015        }
12016    }
12017
12018    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCostKey<'de>
12019    where
12020        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12021    {
12022        fn decode(
12023            slot: ::fidl_next::Slot<'_, Self>,
12024            decoder: &mut ___D,
12025            _: (),
12026        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12027            ::fidl_next::munge!(let Self { table } = slot);
12028
12029            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12030                match ordinal {
12031                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12032
12033                    1 => {
12034                        ::fidl_next::wire::Envelope::decode_as::<
12035                            ___D,
12036                            ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
12037                        >(slot.as_mut(), decoder, ())?;
12038
12039                        Ok(())
12040                    }
12041
12042                    2 => {
12043                        ::fidl_next::wire::Envelope::decode_as::<
12044                            ___D,
12045                            ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
12046                        >(slot.as_mut(), decoder, ())?;
12047
12048                        Ok(())
12049                    }
12050
12051                    3 => {
12052                        ::fidl_next::wire::Envelope::decode_as::<
12053                            ___D,
12054                            crate::wire::BufferUsage<'de>,
12055                        >(slot.as_mut(), decoder, ())?;
12056
12057                        Ok(())
12058                    }
12059
12060                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12061                }
12062            })
12063        }
12064    }
12065
12066    impl<'de> FormatCostKey<'de> {
12067        pub fn pixel_format(
12068            &self,
12069        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormat>
12070        {
12071            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12072        }
12073
12074        pub fn take_pixel_format(
12075            &mut self,
12076        ) -> ::core::option::Option<::fidl_next_common_fuchsia_images2::wire::PixelFormat> {
12077            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12078        }
12079
12080        pub fn pixel_format_modifier(
12081            &self,
12082        ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
12083        {
12084            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12085        }
12086
12087        pub fn take_pixel_format_modifier(
12088            &mut self,
12089        ) -> ::core::option::Option<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
12090        {
12091            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12092        }
12093
12094        pub fn buffer_usage_bits(&self) -> ::core::option::Option<&crate::wire::BufferUsage<'de>> {
12095            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12096        }
12097
12098        pub fn take_buffer_usage_bits(
12099            &mut self,
12100        ) -> ::core::option::Option<crate::wire::BufferUsage<'de>> {
12101            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
12102        }
12103    }
12104
12105    impl<'de> ::core::fmt::Debug for FormatCostKey<'de> {
12106        fn fmt(
12107            &self,
12108            f: &mut ::core::fmt::Formatter<'_>,
12109        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12110            f.debug_struct("FormatCostKey")
12111                .field("pixel_format", &self.pixel_format())
12112                .field("pixel_format_modifier", &self.pixel_format_modifier())
12113                .field("buffer_usage_bits", &self.buffer_usage_bits())
12114                .finish()
12115        }
12116    }
12117
12118    impl<'de> ::fidl_next::IntoNatural for FormatCostKey<'de> {
12119        type Natural = crate::natural::FormatCostKey;
12120    }
12121
12122    /// The wire type corresponding to [`FormatCostEntry`].
12123    #[repr(C)]
12124    pub struct FormatCostEntry<'de> {
12125        pub(crate) table: ::fidl_next::wire::Table<'de>,
12126    }
12127
12128    impl<'de> Drop for FormatCostEntry<'de> {
12129        fn drop(&mut self) {
12130            let _ = self.table.get(1).map(|envelope| unsafe {
12131                envelope.read_unchecked::<crate::wire::FormatCostKey<'de>>()
12132            });
12133
12134            let _ = self
12135                .table
12136                .get(2)
12137                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Float32>() });
12138        }
12139    }
12140
12141    impl ::fidl_next::Constrained for FormatCostEntry<'_> {
12142        type Constraint = ();
12143
12144        fn validate(
12145            _: ::fidl_next::Slot<'_, Self>,
12146            _: Self::Constraint,
12147        ) -> Result<(), ::fidl_next::ValidationError> {
12148            Ok(())
12149        }
12150    }
12151
12152    unsafe impl ::fidl_next::Wire for FormatCostEntry<'static> {
12153        type Narrowed<'de> = FormatCostEntry<'de>;
12154
12155        #[inline]
12156        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12157            ::fidl_next::munge!(let Self { table } = out);
12158            ::fidl_next::wire::Table::zero_padding(table);
12159        }
12160    }
12161
12162    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCostEntry<'de>
12163    where
12164        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12165    {
12166        fn decode(
12167            slot: ::fidl_next::Slot<'_, Self>,
12168            decoder: &mut ___D,
12169            _: (),
12170        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12171            ::fidl_next::munge!(let Self { table } = slot);
12172
12173            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12174                match ordinal {
12175                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12176
12177                    1 => {
12178                        ::fidl_next::wire::Envelope::decode_as::<
12179                            ___D,
12180                            crate::wire::FormatCostKey<'de>,
12181                        >(slot.as_mut(), decoder, ())?;
12182
12183                        Ok(())
12184                    }
12185
12186                    2 => {
12187                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Float32>(
12188                            slot.as_mut(),
12189                            decoder,
12190                            (),
12191                        )?;
12192
12193                        Ok(())
12194                    }
12195
12196                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12197                }
12198            })
12199        }
12200    }
12201
12202    impl<'de> FormatCostEntry<'de> {
12203        pub fn key(&self) -> ::core::option::Option<&crate::wire::FormatCostKey<'de>> {
12204            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12205        }
12206
12207        pub fn take_key(&mut self) -> ::core::option::Option<crate::wire::FormatCostKey<'de>> {
12208            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12209        }
12210
12211        pub fn cost(&self) -> ::core::option::Option<&::fidl_next::wire::Float32> {
12212            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12213        }
12214
12215        pub fn take_cost(&mut self) -> ::core::option::Option<::fidl_next::wire::Float32> {
12216            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12217        }
12218    }
12219
12220    impl<'de> ::core::fmt::Debug for FormatCostEntry<'de> {
12221        fn fmt(
12222            &self,
12223            f: &mut ::core::fmt::Formatter<'_>,
12224        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12225            f.debug_struct("FormatCostEntry")
12226                .field("key", &self.key())
12227                .field("cost", &self.cost())
12228                .finish()
12229        }
12230    }
12231
12232    impl<'de> ::fidl_next::IntoNatural for FormatCostEntry<'de> {
12233        type Natural = crate::natural::FormatCostEntry;
12234    }
12235
12236    /// The wire type corresponding to [`Config`].
12237    #[repr(C)]
12238    pub struct Config<'de> {
12239        pub(crate) table: ::fidl_next::wire::Table<'de>,
12240    }
12241
12242    impl<'de> Drop for Config<'de> {
12243        fn drop(&mut self) {
12244            let _ = self.table.get(1)
12245                .map(|envelope| unsafe {
12246                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>()
12247                });
12248        }
12249    }
12250
12251    impl ::fidl_next::Constrained for Config<'_> {
12252        type Constraint = ();
12253
12254        fn validate(
12255            _: ::fidl_next::Slot<'_, Self>,
12256            _: Self::Constraint,
12257        ) -> Result<(), ::fidl_next::ValidationError> {
12258            Ok(())
12259        }
12260    }
12261
12262    unsafe impl ::fidl_next::Wire for Config<'static> {
12263        type Narrowed<'de> = Config<'de>;
12264
12265        #[inline]
12266        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12267            ::fidl_next::munge!(let Self { table } = out);
12268            ::fidl_next::wire::Table::zero_padding(table);
12269        }
12270    }
12271
12272    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Config<'de>
12273    where
12274        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12275    {
12276        fn decode(
12277            slot: ::fidl_next::Slot<'_, Self>,
12278            decoder: &mut ___D,
12279            _: (),
12280        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12281            ::fidl_next::munge!(let Self { table } = slot);
12282
12283            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12284                match ordinal {
12285                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12286
12287                    1 => {
12288                        ::fidl_next::wire::Envelope::decode_as::<
12289                            ___D,
12290                            ::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12291                        >(slot.as_mut(), decoder, (4294967295, ()))?;
12292
12293                        Ok(())
12294                    }
12295
12296                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12297                }
12298            })
12299        }
12300    }
12301
12302    impl<'de> Config<'de> {
12303        pub fn format_costs(
12304            &self,
12305        ) -> ::core::option::Option<
12306            &::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12307        > {
12308            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12309        }
12310
12311        pub fn take_format_costs(
12312            &mut self,
12313        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>
12314        {
12315            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12316        }
12317    }
12318
12319    impl<'de> ::core::fmt::Debug for Config<'de> {
12320        fn fmt(
12321            &self,
12322            f: &mut ::core::fmt::Formatter<'_>,
12323        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12324            f.debug_struct("Config").field("format_costs", &self.format_costs()).finish()
12325        }
12326    }
12327
12328    impl<'de> ::fidl_next::IntoNatural for Config<'de> {
12329        type Natural = crate::natural::Config;
12330    }
12331
12332    /// The wire type corresponding to [`DynamicSecureHeap`].
12333    #[repr(C)]
12334    pub struct DynamicSecureHeap<'de> {
12335        pub(crate) table: ::fidl_next::wire::Table<'de>,
12336    }
12337
12338    impl<'de> Drop for DynamicSecureHeap<'de> {
12339        fn drop(&mut self) {
12340            let _ = self
12341                .table
12342                .get(1)
12343                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12344        }
12345    }
12346
12347    impl ::fidl_next::Constrained for DynamicSecureHeap<'_> {
12348        type Constraint = ();
12349
12350        fn validate(
12351            _: ::fidl_next::Slot<'_, Self>,
12352            _: Self::Constraint,
12353        ) -> Result<(), ::fidl_next::ValidationError> {
12354            Ok(())
12355        }
12356    }
12357
12358    unsafe impl ::fidl_next::Wire for DynamicSecureHeap<'static> {
12359        type Narrowed<'de> = DynamicSecureHeap<'de>;
12360
12361        #[inline]
12362        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12363            ::fidl_next::munge!(let Self { table } = out);
12364            ::fidl_next::wire::Table::zero_padding(table);
12365        }
12366    }
12367
12368    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DynamicSecureHeap<'de>
12369    where
12370        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12371    {
12372        fn decode(
12373            slot: ::fidl_next::Slot<'_, Self>,
12374            decoder: &mut ___D,
12375            _: (),
12376        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12377            ::fidl_next::munge!(let Self { table } = slot);
12378
12379            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12380                match ordinal {
12381                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12382
12383                    1 => {
12384                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12385                            slot.as_mut(),
12386                            decoder,
12387                            (),
12388                        )?;
12389
12390                        Ok(())
12391                    }
12392
12393                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12394                }
12395            })
12396        }
12397    }
12398
12399    impl<'de> DynamicSecureHeap<'de> {
12400        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12401            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12402        }
12403
12404        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
12405            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12406        }
12407    }
12408
12409    impl<'de> ::core::fmt::Debug for DynamicSecureHeap<'de> {
12410        fn fmt(
12411            &self,
12412            f: &mut ::core::fmt::Formatter<'_>,
12413        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12414            f.debug_struct("DynamicSecureHeap").field("heap", &self.heap()).finish()
12415        }
12416    }
12417
12418    impl<'de> ::fidl_next::IntoNatural for DynamicSecureHeap<'de> {
12419        type Natural = crate::natural::DynamicSecureHeap;
12420    }
12421
12422    /// The wire type corresponding to [`FormatCosts`].
12423    #[repr(C)]
12424    pub struct FormatCosts<'de> {
12425        pub(crate) table: ::fidl_next::wire::Table<'de>,
12426    }
12427
12428    impl<'de> Drop for FormatCosts<'de> {
12429        fn drop(&mut self) {
12430            let _ = self.table.get(1)
12431                .map(|envelope| unsafe {
12432                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>()
12433                });
12434        }
12435    }
12436
12437    impl ::fidl_next::Constrained for FormatCosts<'_> {
12438        type Constraint = ();
12439
12440        fn validate(
12441            _: ::fidl_next::Slot<'_, Self>,
12442            _: Self::Constraint,
12443        ) -> Result<(), ::fidl_next::ValidationError> {
12444            Ok(())
12445        }
12446    }
12447
12448    unsafe impl ::fidl_next::Wire for FormatCosts<'static> {
12449        type Narrowed<'de> = FormatCosts<'de>;
12450
12451        #[inline]
12452        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12453            ::fidl_next::munge!(let Self { table } = out);
12454            ::fidl_next::wire::Table::zero_padding(table);
12455        }
12456    }
12457
12458    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCosts<'de>
12459    where
12460        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12461    {
12462        fn decode(
12463            slot: ::fidl_next::Slot<'_, Self>,
12464            decoder: &mut ___D,
12465            _: (),
12466        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12467            ::fidl_next::munge!(let Self { table } = slot);
12468
12469            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12470                match ordinal {
12471                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12472
12473                    1 => {
12474                        ::fidl_next::wire::Envelope::decode_as::<
12475                            ___D,
12476                            ::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12477                        >(slot.as_mut(), decoder, (4294967295, ()))?;
12478
12479                        Ok(())
12480                    }
12481
12482                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12483                }
12484            })
12485        }
12486    }
12487
12488    impl<'de> FormatCosts<'de> {
12489        pub fn format_costs(
12490            &self,
12491        ) -> ::core::option::Option<
12492            &::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12493        > {
12494            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12495        }
12496
12497        pub fn take_format_costs(
12498            &mut self,
12499        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>
12500        {
12501            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12502        }
12503    }
12504
12505    impl<'de> ::core::fmt::Debug for FormatCosts<'de> {
12506        fn fmt(
12507            &self,
12508            f: &mut ::core::fmt::Formatter<'_>,
12509        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12510            f.debug_struct("FormatCosts").field("format_costs", &self.format_costs()).finish()
12511        }
12512    }
12513
12514    impl<'de> ::fidl_next::IntoNatural for FormatCosts<'de> {
12515        type Natural = crate::natural::FormatCosts;
12516    }
12517
12518    /// The wire type corresponding to [`SecureHeapRange`].
12519    #[repr(C)]
12520    pub struct SecureHeapRange<'de> {
12521        pub(crate) table: ::fidl_next::wire::Table<'de>,
12522    }
12523
12524    impl<'de> Drop for SecureHeapRange<'de> {
12525        fn drop(&mut self) {
12526            let _ = self
12527                .table
12528                .get(1)
12529                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
12530
12531            let _ = self
12532                .table
12533                .get(2)
12534                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
12535        }
12536    }
12537
12538    impl ::fidl_next::Constrained for SecureHeapRange<'_> {
12539        type Constraint = ();
12540
12541        fn validate(
12542            _: ::fidl_next::Slot<'_, Self>,
12543            _: Self::Constraint,
12544        ) -> Result<(), ::fidl_next::ValidationError> {
12545            Ok(())
12546        }
12547    }
12548
12549    unsafe impl ::fidl_next::Wire for SecureHeapRange<'static> {
12550        type Narrowed<'de> = SecureHeapRange<'de>;
12551
12552        #[inline]
12553        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12554            ::fidl_next::munge!(let Self { table } = out);
12555            ::fidl_next::wire::Table::zero_padding(table);
12556        }
12557    }
12558
12559    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapRange<'de>
12560    where
12561        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12562    {
12563        fn decode(
12564            slot: ::fidl_next::Slot<'_, Self>,
12565            decoder: &mut ___D,
12566            _: (),
12567        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12568            ::fidl_next::munge!(let Self { table } = slot);
12569
12570            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12571                match ordinal {
12572                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12573
12574                    1 => {
12575                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
12576                            slot.as_mut(),
12577                            decoder,
12578                            (),
12579                        )?;
12580
12581                        Ok(())
12582                    }
12583
12584                    2 => {
12585                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
12586                            slot.as_mut(),
12587                            decoder,
12588                            (),
12589                        )?;
12590
12591                        Ok(())
12592                    }
12593
12594                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12595                }
12596            })
12597        }
12598    }
12599
12600    impl<'de> SecureHeapRange<'de> {
12601        pub fn physical_address(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
12602            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12603        }
12604
12605        pub fn take_physical_address(
12606            &mut self,
12607        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
12608            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12609        }
12610
12611        pub fn size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
12612            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12613        }
12614
12615        pub fn take_size_bytes(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
12616            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12617        }
12618    }
12619
12620    impl<'de> ::core::fmt::Debug for SecureHeapRange<'de> {
12621        fn fmt(
12622            &self,
12623            f: &mut ::core::fmt::Formatter<'_>,
12624        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12625            f.debug_struct("SecureHeapRange")
12626                .field("physical_address", &self.physical_address())
12627                .field("size_bytes", &self.size_bytes())
12628                .finish()
12629        }
12630    }
12631
12632    impl<'de> ::fidl_next::IntoNatural for SecureHeapRange<'de> {
12633        type Natural = crate::natural::SecureHeapRange;
12634    }
12635
12636    /// The wire type corresponding to [`SecureHeapAndRange`].
12637    #[repr(C)]
12638    pub struct SecureHeapAndRange<'de> {
12639        pub(crate) table: ::fidl_next::wire::Table<'de>,
12640    }
12641
12642    impl<'de> Drop for SecureHeapAndRange<'de> {
12643        fn drop(&mut self) {
12644            let _ = self
12645                .table
12646                .get(1)
12647                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12648
12649            let _ = self.table.get(2).map(|envelope| unsafe {
12650                envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12651            });
12652        }
12653    }
12654
12655    impl ::fidl_next::Constrained for SecureHeapAndRange<'_> {
12656        type Constraint = ();
12657
12658        fn validate(
12659            _: ::fidl_next::Slot<'_, Self>,
12660            _: Self::Constraint,
12661        ) -> Result<(), ::fidl_next::ValidationError> {
12662            Ok(())
12663        }
12664    }
12665
12666    unsafe impl ::fidl_next::Wire for SecureHeapAndRange<'static> {
12667        type Narrowed<'de> = SecureHeapAndRange<'de>;
12668
12669        #[inline]
12670        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12671            ::fidl_next::munge!(let Self { table } = out);
12672            ::fidl_next::wire::Table::zero_padding(table);
12673        }
12674    }
12675
12676    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRange<'de>
12677    where
12678        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12679    {
12680        fn decode(
12681            slot: ::fidl_next::Slot<'_, Self>,
12682            decoder: &mut ___D,
12683            _: (),
12684        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12685            ::fidl_next::munge!(let Self { table } = slot);
12686
12687            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12688                match ordinal {
12689                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12690
12691                    1 => {
12692                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12693                            slot.as_mut(),
12694                            decoder,
12695                            (),
12696                        )?;
12697
12698                        Ok(())
12699                    }
12700
12701                    2 => {
12702                        ::fidl_next::wire::Envelope::decode_as::<
12703                            ___D,
12704                            crate::wire::SecureHeapRange<'de>,
12705                        >(slot.as_mut(), decoder, ())?;
12706
12707                        Ok(())
12708                    }
12709
12710                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12711                }
12712            })
12713        }
12714    }
12715
12716    impl<'de> SecureHeapAndRange<'de> {
12717        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12718            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12719        }
12720
12721        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
12722            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12723        }
12724
12725        pub fn range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12726            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12727        }
12728
12729        pub fn take_range(&mut self) -> ::core::option::Option<crate::wire::SecureHeapRange<'de>> {
12730            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12731        }
12732    }
12733
12734    impl<'de> ::core::fmt::Debug for SecureHeapAndRange<'de> {
12735        fn fmt(
12736            &self,
12737            f: &mut ::core::fmt::Formatter<'_>,
12738        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12739            f.debug_struct("SecureHeapAndRange")
12740                .field("heap", &self.heap())
12741                .field("range", &self.range())
12742                .finish()
12743        }
12744    }
12745
12746    impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRange<'de> {
12747        type Natural = crate::natural::SecureHeapAndRange;
12748    }
12749
12750    /// The wire type corresponding to [`SecureHeapAndRangeModification`].
12751    #[repr(C)]
12752    pub struct SecureHeapAndRangeModification<'de> {
12753        pub(crate) table: ::fidl_next::wire::Table<'de>,
12754    }
12755
12756    impl<'de> Drop for SecureHeapAndRangeModification<'de> {
12757        fn drop(&mut self) {
12758            let _ = self
12759                .table
12760                .get(1)
12761                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12762
12763            let _ = self.table.get(2).map(|envelope| unsafe {
12764                envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12765            });
12766
12767            let _ = self.table.get(3).map(|envelope| unsafe {
12768                envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12769            });
12770        }
12771    }
12772
12773    impl ::fidl_next::Constrained for SecureHeapAndRangeModification<'_> {
12774        type Constraint = ();
12775
12776        fn validate(
12777            _: ::fidl_next::Slot<'_, Self>,
12778            _: Self::Constraint,
12779        ) -> Result<(), ::fidl_next::ValidationError> {
12780            Ok(())
12781        }
12782    }
12783
12784    unsafe impl ::fidl_next::Wire for SecureHeapAndRangeModification<'static> {
12785        type Narrowed<'de> = SecureHeapAndRangeModification<'de>;
12786
12787        #[inline]
12788        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12789            ::fidl_next::munge!(let Self { table } = out);
12790            ::fidl_next::wire::Table::zero_padding(table);
12791        }
12792    }
12793
12794    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRangeModification<'de>
12795    where
12796        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12797    {
12798        fn decode(
12799            slot: ::fidl_next::Slot<'_, Self>,
12800            decoder: &mut ___D,
12801            _: (),
12802        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12803            ::fidl_next::munge!(let Self { table } = slot);
12804
12805            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12806                match ordinal {
12807                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12808
12809                    1 => {
12810                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12811                            slot.as_mut(),
12812                            decoder,
12813                            (),
12814                        )?;
12815
12816                        Ok(())
12817                    }
12818
12819                    2 => {
12820                        ::fidl_next::wire::Envelope::decode_as::<
12821                            ___D,
12822                            crate::wire::SecureHeapRange<'de>,
12823                        >(slot.as_mut(), decoder, ())?;
12824
12825                        Ok(())
12826                    }
12827
12828                    3 => {
12829                        ::fidl_next::wire::Envelope::decode_as::<
12830                            ___D,
12831                            crate::wire::SecureHeapRange<'de>,
12832                        >(slot.as_mut(), decoder, ())?;
12833
12834                        Ok(())
12835                    }
12836
12837                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12838                }
12839            })
12840        }
12841    }
12842
12843    impl<'de> SecureHeapAndRangeModification<'de> {
12844        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12845            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12846        }
12847
12848        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
12849            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12850        }
12851
12852        pub fn old_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12853            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12854        }
12855
12856        pub fn take_old_range(
12857            &mut self,
12858        ) -> ::core::option::Option<crate::wire::SecureHeapRange<'de>> {
12859            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
12860        }
12861
12862        pub fn new_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12863            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12864        }
12865
12866        pub fn take_new_range(
12867            &mut self,
12868        ) -> ::core::option::Option<crate::wire::SecureHeapRange<'de>> {
12869            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
12870        }
12871    }
12872
12873    impl<'de> ::core::fmt::Debug for SecureHeapAndRangeModification<'de> {
12874        fn fmt(
12875            &self,
12876            f: &mut ::core::fmt::Formatter<'_>,
12877        ) -> ::core::result::Result<(), ::core::fmt::Error> {
12878            f.debug_struct("SecureHeapAndRangeModification")
12879                .field("heap", &self.heap())
12880                .field("old_range", &self.old_range())
12881                .field("new_range", &self.new_range())
12882                .finish()
12883        }
12884    }
12885
12886    impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRangeModification<'de> {
12887        type Natural = crate::natural::SecureHeapAndRangeModification;
12888    }
12889
12890    /// The wire type corresponding to [`SecureHeapAndRanges`].
12891    #[repr(C)]
12892    pub struct SecureHeapAndRanges<'de> {
12893        pub(crate) table: ::fidl_next::wire::Table<'de>,
12894    }
12895
12896    impl<'de> Drop for SecureHeapAndRanges<'de> {
12897        fn drop(&mut self) {
12898            let _ = self
12899                .table
12900                .get(1)
12901                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12902
12903            let _ = self.table.get(2)
12904                .map(|envelope| unsafe {
12905                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>()
12906                });
12907        }
12908    }
12909
12910    impl ::fidl_next::Constrained for SecureHeapAndRanges<'_> {
12911        type Constraint = ();
12912
12913        fn validate(
12914            _: ::fidl_next::Slot<'_, Self>,
12915            _: Self::Constraint,
12916        ) -> Result<(), ::fidl_next::ValidationError> {
12917            Ok(())
12918        }
12919    }
12920
12921    unsafe impl ::fidl_next::Wire for SecureHeapAndRanges<'static> {
12922        type Narrowed<'de> = SecureHeapAndRanges<'de>;
12923
12924        #[inline]
12925        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12926            ::fidl_next::munge!(let Self { table } = out);
12927            ::fidl_next::wire::Table::zero_padding(table);
12928        }
12929    }
12930
12931    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRanges<'de>
12932    where
12933        ___D: ::fidl_next::Decoder<'de> + ?Sized,
12934    {
12935        fn decode(
12936            slot: ::fidl_next::Slot<'_, Self>,
12937            decoder: &mut ___D,
12938            _: (),
12939        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12940            ::fidl_next::munge!(let Self { table } = slot);
12941
12942            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12943                match ordinal {
12944                    0 => unsafe { ::core::hint::unreachable_unchecked() },
12945
12946                    1 => {
12947                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12948                            slot.as_mut(),
12949                            decoder,
12950                            (),
12951                        )?;
12952
12953                        Ok(())
12954                    }
12955
12956                    2 => {
12957                        ::fidl_next::wire::Envelope::decode_as::<
12958                            ___D,
12959                            ::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>,
12960                        >(slot.as_mut(), decoder, (128, ()))?;
12961
12962                        let value = unsafe {
12963                            slot
12964                                            .deref_unchecked()
12965                                            .deref_unchecked::<
12966                                                ::fidl_next::wire::Vector<'_, crate::wire::SecureHeapRange<'_>>
12967                                            >()
12968                        };
12969
12970                        if value.len() > 128 {
12971                            return Err(::fidl_next::DecodeError::VectorTooLong {
12972                                size: value.len() as u64,
12973                                limit: 128,
12974                            });
12975                        }
12976
12977                        Ok(())
12978                    }
12979
12980                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12981                }
12982            })
12983        }
12984    }
12985
12986    impl<'de> SecureHeapAndRanges<'de> {
12987        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12988            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12989        }
12990
12991        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
12992            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12993        }
12994
12995        pub fn ranges(
12996            &self,
12997        ) -> ::core::option::Option<
12998            &::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>,
12999        > {
13000            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13001        }
13002
13003        pub fn take_ranges(
13004            &mut self,
13005        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>
13006        {
13007            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
13008        }
13009    }
13010
13011    impl<'de> ::core::fmt::Debug for SecureHeapAndRanges<'de> {
13012        fn fmt(
13013            &self,
13014            f: &mut ::core::fmt::Formatter<'_>,
13015        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13016            f.debug_struct("SecureHeapAndRanges")
13017                .field("heap", &self.heap())
13018                .field("ranges", &self.ranges())
13019                .finish()
13020        }
13021    }
13022
13023    impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRanges<'de> {
13024        type Natural = crate::natural::SecureHeapAndRanges;
13025    }
13026
13027    /// The wire type corresponding to [`SecureHeapProperties`].
13028    #[repr(C)]
13029    pub struct SecureHeapProperties<'de> {
13030        pub(crate) table: ::fidl_next::wire::Table<'de>,
13031    }
13032
13033    impl<'de> Drop for SecureHeapProperties<'de> {
13034        fn drop(&mut self) {
13035            let _ = self
13036                .table
13037                .get(1)
13038                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
13039
13040            let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
13041
13042            let _ = self
13043                .table
13044                .get(3)
13045                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
13046
13047            let _ = self
13048                .table
13049                .get(4)
13050                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
13051
13052            let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
13053        }
13054    }
13055
13056    impl ::fidl_next::Constrained for SecureHeapProperties<'_> {
13057        type Constraint = ();
13058
13059        fn validate(
13060            _: ::fidl_next::Slot<'_, Self>,
13061            _: Self::Constraint,
13062        ) -> Result<(), ::fidl_next::ValidationError> {
13063            Ok(())
13064        }
13065    }
13066
13067    unsafe impl ::fidl_next::Wire for SecureHeapProperties<'static> {
13068        type Narrowed<'de> = SecureHeapProperties<'de>;
13069
13070        #[inline]
13071        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13072            ::fidl_next::munge!(let Self { table } = out);
13073            ::fidl_next::wire::Table::zero_padding(table);
13074        }
13075    }
13076
13077    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapProperties<'de>
13078    where
13079        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13080    {
13081        fn decode(
13082            slot: ::fidl_next::Slot<'_, Self>,
13083            decoder: &mut ___D,
13084            _: (),
13085        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13086            ::fidl_next::munge!(let Self { table } = slot);
13087
13088            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13089                match ordinal {
13090                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13091
13092                    1 => {
13093                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
13094                            slot.as_mut(),
13095                            decoder,
13096                            (),
13097                        )?;
13098
13099                        Ok(())
13100                    }
13101
13102                    2 => {
13103                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
13104                            slot.as_mut(),
13105                            decoder,
13106                            (),
13107                        )?;
13108
13109                        Ok(())
13110                    }
13111
13112                    3 => {
13113                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
13114                            slot.as_mut(),
13115                            decoder,
13116                            (),
13117                        )?;
13118
13119                        Ok(())
13120                    }
13121
13122                    4 => {
13123                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
13124                            slot.as_mut(),
13125                            decoder,
13126                            (),
13127                        )?;
13128
13129                        Ok(())
13130                    }
13131
13132                    5 => {
13133                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
13134                            slot.as_mut(),
13135                            decoder,
13136                            (),
13137                        )?;
13138
13139                        Ok(())
13140                    }
13141
13142                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13143                }
13144            })
13145        }
13146    }
13147
13148    impl<'de> SecureHeapProperties<'de> {
13149        pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
13150            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13151        }
13152
13153        pub fn take_heap(&mut self) -> ::core::option::Option<crate::wire::Heap<'de>> {
13154            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13155        }
13156
13157        pub fn dynamic_protection_ranges(&self) -> ::core::option::Option<&bool> {
13158            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13159        }
13160
13161        pub fn take_dynamic_protection_ranges(&mut self) -> ::core::option::Option<bool> {
13162            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
13163        }
13164
13165        pub fn protected_range_granularity(
13166            &self,
13167        ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
13168            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
13169        }
13170
13171        pub fn take_protected_range_granularity(
13172            &mut self,
13173        ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
13174            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
13175        }
13176
13177        pub fn max_protected_range_count(
13178            &self,
13179        ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
13180            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
13181        }
13182
13183        pub fn take_max_protected_range_count(
13184            &mut self,
13185        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
13186            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
13187        }
13188
13189        pub fn is_mod_protected_range_available(&self) -> ::core::option::Option<&bool> {
13190            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
13191        }
13192
13193        pub fn take_is_mod_protected_range_available(&mut self) -> ::core::option::Option<bool> {
13194            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
13195        }
13196    }
13197
13198    impl<'de> ::core::fmt::Debug for SecureHeapProperties<'de> {
13199        fn fmt(
13200            &self,
13201            f: &mut ::core::fmt::Formatter<'_>,
13202        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13203            f.debug_struct("SecureHeapProperties")
13204                .field("heap", &self.heap())
13205                .field("dynamic_protection_ranges", &self.dynamic_protection_ranges())
13206                .field("protected_range_granularity", &self.protected_range_granularity())
13207                .field("max_protected_range_count", &self.max_protected_range_count())
13208                .field("is_mod_protected_range_available", &self.is_mod_protected_range_available())
13209                .finish()
13210        }
13211    }
13212
13213    impl<'de> ::fidl_next::IntoNatural for SecureHeapProperties<'de> {
13214        type Natural = crate::natural::SecureHeapProperties;
13215    }
13216
13217    /// The wire type corresponding to [`SecureMemGetPhysicalSecureHeapsResponse`].
13218    #[repr(C)]
13219    pub struct SecureMemGetPhysicalSecureHeapsResponse<'de> {
13220        pub(crate) table: ::fidl_next::wire::Table<'de>,
13221    }
13222
13223    impl<'de> Drop for SecureMemGetPhysicalSecureHeapsResponse<'de> {
13224        fn drop(&mut self) {
13225            let _ = self.table.get(1)
13226                .map(|envelope| unsafe {
13227                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>>()
13228                });
13229        }
13230    }
13231
13232    impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapsResponse<'_> {
13233        type Constraint = ();
13234
13235        fn validate(
13236            _: ::fidl_next::Slot<'_, Self>,
13237            _: Self::Constraint,
13238        ) -> Result<(), ::fidl_next::ValidationError> {
13239            Ok(())
13240        }
13241    }
13242
13243    unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapsResponse<'static> {
13244        type Narrowed<'de> = SecureMemGetPhysicalSecureHeapsResponse<'de>;
13245
13246        #[inline]
13247        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13248            ::fidl_next::munge!(let Self { table } = out);
13249            ::fidl_next::wire::Table::zero_padding(table);
13250        }
13251    }
13252
13253    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemGetPhysicalSecureHeapsResponse<'de>
13254    where
13255        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13256    {
13257        fn decode(
13258            slot: ::fidl_next::Slot<'_, Self>,
13259            decoder: &mut ___D,
13260            _: (),
13261        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13262            ::fidl_next::munge!(let Self { table } = slot);
13263
13264            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13265                match ordinal {
13266                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13267
13268                    1 => {
13269                        ::fidl_next::wire::Envelope::decode_as::<
13270                            ___D,
13271                            ::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>,
13272                        >(slot.as_mut(), decoder, (32, ()))?;
13273
13274                        let value = unsafe {
13275                            slot
13276                                            .deref_unchecked()
13277                                            .deref_unchecked::<
13278                                                ::fidl_next::wire::Vector<'_, crate::wire::SecureHeapAndRanges<'_>>
13279                                            >()
13280                        };
13281
13282                        if value.len() > 32 {
13283                            return Err(::fidl_next::DecodeError::VectorTooLong {
13284                                size: value.len() as u64,
13285                                limit: 32,
13286                            });
13287                        }
13288
13289                        Ok(())
13290                    }
13291
13292                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13293                }
13294            })
13295        }
13296    }
13297
13298    impl<'de> SecureMemGetPhysicalSecureHeapsResponse<'de> {
13299        pub fn heaps(
13300            &self,
13301        ) -> ::core::option::Option<
13302            &::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>,
13303        > {
13304            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13305        }
13306
13307        pub fn take_heaps(
13308            &mut self,
13309        ) -> ::core::option::Option<
13310            ::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>,
13311        > {
13312            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13313        }
13314    }
13315
13316    impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapsResponse<'de> {
13317        fn fmt(
13318            &self,
13319            f: &mut ::core::fmt::Formatter<'_>,
13320        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13321            f.debug_struct("SecureMemGetPhysicalSecureHeapsResponse")
13322                .field("heaps", &self.heaps())
13323                .finish()
13324        }
13325    }
13326
13327    impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapsResponse<'de> {
13328        type Natural = crate::natural::SecureMemGetPhysicalSecureHeapsResponse;
13329    }
13330
13331    /// The wire type corresponding to [`SecureMemGetDynamicSecureHeapsResponse`].
13332    #[repr(C)]
13333    pub struct SecureMemGetDynamicSecureHeapsResponse<'de> {
13334        pub(crate) table: ::fidl_next::wire::Table<'de>,
13335    }
13336
13337    impl<'de> Drop for SecureMemGetDynamicSecureHeapsResponse<'de> {
13338        fn drop(&mut self) {
13339            let _ = self.table.get(1)
13340                .map(|envelope| unsafe {
13341                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>()
13342                });
13343        }
13344    }
13345
13346    impl ::fidl_next::Constrained for SecureMemGetDynamicSecureHeapsResponse<'_> {
13347        type Constraint = ();
13348
13349        fn validate(
13350            _: ::fidl_next::Slot<'_, Self>,
13351            _: Self::Constraint,
13352        ) -> Result<(), ::fidl_next::ValidationError> {
13353            Ok(())
13354        }
13355    }
13356
13357    unsafe impl ::fidl_next::Wire for SecureMemGetDynamicSecureHeapsResponse<'static> {
13358        type Narrowed<'de> = SecureMemGetDynamicSecureHeapsResponse<'de>;
13359
13360        #[inline]
13361        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13362            ::fidl_next::munge!(let Self { table } = out);
13363            ::fidl_next::wire::Table::zero_padding(table);
13364        }
13365    }
13366
13367    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemGetDynamicSecureHeapsResponse<'de>
13368    where
13369        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13370    {
13371        fn decode(
13372            slot: ::fidl_next::Slot<'_, Self>,
13373            decoder: &mut ___D,
13374            _: (),
13375        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13376            ::fidl_next::munge!(let Self { table } = slot);
13377
13378            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13379                match ordinal {
13380                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13381
13382                    1 => {
13383                        ::fidl_next::wire::Envelope::decode_as::<
13384                            ___D,
13385                            ::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>,
13386                        >(slot.as_mut(), decoder, (32, ()))?;
13387
13388                        let value = unsafe {
13389                            slot
13390                                            .deref_unchecked()
13391                                            .deref_unchecked::<
13392                                                ::fidl_next::wire::Vector<'_, crate::wire::DynamicSecureHeap<'_>>
13393                                            >()
13394                        };
13395
13396                        if value.len() > 32 {
13397                            return Err(::fidl_next::DecodeError::VectorTooLong {
13398                                size: value.len() as u64,
13399                                limit: 32,
13400                            });
13401                        }
13402
13403                        Ok(())
13404                    }
13405
13406                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13407                }
13408            })
13409        }
13410    }
13411
13412    impl<'de> SecureMemGetDynamicSecureHeapsResponse<'de> {
13413        pub fn heaps(
13414            &self,
13415        ) -> ::core::option::Option<
13416            &::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>,
13417        > {
13418            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13419        }
13420
13421        pub fn take_heaps(
13422            &mut self,
13423        ) -> ::core::option::Option<
13424            ::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>,
13425        > {
13426            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13427        }
13428    }
13429
13430    impl<'de> ::core::fmt::Debug for SecureMemGetDynamicSecureHeapsResponse<'de> {
13431        fn fmt(
13432            &self,
13433            f: &mut ::core::fmt::Formatter<'_>,
13434        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13435            f.debug_struct("SecureMemGetDynamicSecureHeapsResponse")
13436                .field("heaps", &self.heaps())
13437                .finish()
13438        }
13439    }
13440
13441    impl<'de> ::fidl_next::IntoNatural for SecureMemGetDynamicSecureHeapsResponse<'de> {
13442        type Natural = crate::natural::SecureMemGetDynamicSecureHeapsResponse;
13443    }
13444
13445    /// The wire type corresponding to [`SecureMemGetPhysicalSecureHeapPropertiesRequest`].
13446    #[repr(C)]
13447    pub struct SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13448        pub(crate) table: ::fidl_next::wire::Table<'de>,
13449    }
13450
13451    impl<'de> Drop for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13452        fn drop(&mut self) {
13453            let _ = self.table.get(1).map(|envelope| unsafe {
13454                envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13455            });
13456        }
13457    }
13458
13459    impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapPropertiesRequest<'_> {
13460        type Constraint = ();
13461
13462        fn validate(
13463            _: ::fidl_next::Slot<'_, Self>,
13464            _: Self::Constraint,
13465        ) -> Result<(), ::fidl_next::ValidationError> {
13466            Ok(())
13467        }
13468    }
13469
13470    unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapPropertiesRequest<'static> {
13471        type Narrowed<'de> = SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>;
13472
13473        #[inline]
13474        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13475            ::fidl_next::munge!(let Self { table } = out);
13476            ::fidl_next::wire::Table::zero_padding(table);
13477        }
13478    }
13479
13480    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13481        for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>
13482    where
13483        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13484    {
13485        fn decode(
13486            slot: ::fidl_next::Slot<'_, Self>,
13487            decoder: &mut ___D,
13488            _: (),
13489        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13490            ::fidl_next::munge!(let Self { table } = slot);
13491
13492            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13493                match ordinal {
13494                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13495
13496                    1 => {
13497                        ::fidl_next::wire::Envelope::decode_as::<
13498                            ___D,
13499                            crate::wire::SecureHeapAndRange<'de>,
13500                        >(slot.as_mut(), decoder, ())?;
13501
13502                        Ok(())
13503                    }
13504
13505                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13506                }
13507            })
13508        }
13509    }
13510
13511    impl<'de> SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13512        pub fn entire_heap(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13513            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13514        }
13515
13516        pub fn take_entire_heap(
13517            &mut self,
13518        ) -> ::core::option::Option<crate::wire::SecureHeapAndRange<'de>> {
13519            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13520        }
13521    }
13522
13523    impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13524        fn fmt(
13525            &self,
13526            f: &mut ::core::fmt::Formatter<'_>,
13527        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13528            f.debug_struct("SecureMemGetPhysicalSecureHeapPropertiesRequest")
13529                .field("entire_heap", &self.entire_heap())
13530                .finish()
13531        }
13532    }
13533
13534    impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
13535        type Natural = crate::natural::SecureMemGetPhysicalSecureHeapPropertiesRequest;
13536    }
13537
13538    /// The wire type corresponding to [`SecureMemGetPhysicalSecureHeapPropertiesResponse`].
13539    #[repr(C)]
13540    pub struct SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13541        pub(crate) table: ::fidl_next::wire::Table<'de>,
13542    }
13543
13544    impl<'de> Drop for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13545        fn drop(&mut self) {
13546            let _ = self.table.get(1).map(|envelope| unsafe {
13547                envelope.read_unchecked::<crate::wire::SecureHeapProperties<'de>>()
13548            });
13549        }
13550    }
13551
13552    impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapPropertiesResponse<'_> {
13553        type Constraint = ();
13554
13555        fn validate(
13556            _: ::fidl_next::Slot<'_, Self>,
13557            _: Self::Constraint,
13558        ) -> Result<(), ::fidl_next::ValidationError> {
13559            Ok(())
13560        }
13561    }
13562
13563    unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapPropertiesResponse<'static> {
13564        type Narrowed<'de> = SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>;
13565
13566        #[inline]
13567        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13568            ::fidl_next::munge!(let Self { table } = out);
13569            ::fidl_next::wire::Table::zero_padding(table);
13570        }
13571    }
13572
13573    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13574        for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>
13575    where
13576        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13577    {
13578        fn decode(
13579            slot: ::fidl_next::Slot<'_, Self>,
13580            decoder: &mut ___D,
13581            _: (),
13582        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13583            ::fidl_next::munge!(let Self { table } = slot);
13584
13585            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13586                match ordinal {
13587                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13588
13589                    1 => {
13590                        ::fidl_next::wire::Envelope::decode_as::<
13591                            ___D,
13592                            crate::wire::SecureHeapProperties<'de>,
13593                        >(slot.as_mut(), decoder, ())?;
13594
13595                        Ok(())
13596                    }
13597
13598                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13599                }
13600            })
13601        }
13602    }
13603
13604    impl<'de> SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13605        pub fn properties(
13606            &self,
13607        ) -> ::core::option::Option<&crate::wire::SecureHeapProperties<'de>> {
13608            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13609        }
13610
13611        pub fn take_properties(
13612            &mut self,
13613        ) -> ::core::option::Option<crate::wire::SecureHeapProperties<'de>> {
13614            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13615        }
13616    }
13617
13618    impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13619        fn fmt(
13620            &self,
13621            f: &mut ::core::fmt::Formatter<'_>,
13622        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13623            f.debug_struct("SecureMemGetPhysicalSecureHeapPropertiesResponse")
13624                .field("properties", &self.properties())
13625                .finish()
13626        }
13627    }
13628
13629    impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13630        type Natural = crate::natural::SecureMemGetPhysicalSecureHeapPropertiesResponse;
13631    }
13632
13633    /// The wire type corresponding to [`SecureMemAddSecureHeapPhysicalRangeRequest`].
13634    #[repr(C)]
13635    pub struct SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13636        pub(crate) table: ::fidl_next::wire::Table<'de>,
13637    }
13638
13639    impl<'de> Drop for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13640        fn drop(&mut self) {
13641            let _ = self.table.get(1).map(|envelope| unsafe {
13642                envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13643            });
13644        }
13645    }
13646
13647    impl ::fidl_next::Constrained for SecureMemAddSecureHeapPhysicalRangeRequest<'_> {
13648        type Constraint = ();
13649
13650        fn validate(
13651            _: ::fidl_next::Slot<'_, Self>,
13652            _: Self::Constraint,
13653        ) -> Result<(), ::fidl_next::ValidationError> {
13654            Ok(())
13655        }
13656    }
13657
13658    unsafe impl ::fidl_next::Wire for SecureMemAddSecureHeapPhysicalRangeRequest<'static> {
13659        type Narrowed<'de> = SecureMemAddSecureHeapPhysicalRangeRequest<'de>;
13660
13661        #[inline]
13662        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13663            ::fidl_next::munge!(let Self { table } = out);
13664            ::fidl_next::wire::Table::zero_padding(table);
13665        }
13666    }
13667
13668    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemAddSecureHeapPhysicalRangeRequest<'de>
13669    where
13670        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13671    {
13672        fn decode(
13673            slot: ::fidl_next::Slot<'_, Self>,
13674            decoder: &mut ___D,
13675            _: (),
13676        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13677            ::fidl_next::munge!(let Self { table } = slot);
13678
13679            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13680                match ordinal {
13681                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13682
13683                    1 => {
13684                        ::fidl_next::wire::Envelope::decode_as::<
13685                            ___D,
13686                            crate::wire::SecureHeapAndRange<'de>,
13687                        >(slot.as_mut(), decoder, ())?;
13688
13689                        Ok(())
13690                    }
13691
13692                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13693                }
13694            })
13695        }
13696    }
13697
13698    impl<'de> SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13699        pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13700            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13701        }
13702
13703        pub fn take_heap_range(
13704            &mut self,
13705        ) -> ::core::option::Option<crate::wire::SecureHeapAndRange<'de>> {
13706            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13707        }
13708    }
13709
13710    impl<'de> ::core::fmt::Debug for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13711        fn fmt(
13712            &self,
13713            f: &mut ::core::fmt::Formatter<'_>,
13714        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13715            f.debug_struct("SecureMemAddSecureHeapPhysicalRangeRequest")
13716                .field("heap_range", &self.heap_range())
13717                .finish()
13718        }
13719    }
13720
13721    impl<'de> ::fidl_next::IntoNatural for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13722        type Natural = crate::natural::SecureMemAddSecureHeapPhysicalRangeRequest;
13723    }
13724
13725    /// The wire type corresponding to [`SecureMemAddSecureHeapPhysicalRangeResponse`].
13726    pub type SecureMemAddSecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13727
13728    /// The wire type corresponding to [`SecureMemDeleteSecureHeapPhysicalRangeRequest`].
13729    #[repr(C)]
13730    pub struct SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13731        pub(crate) table: ::fidl_next::wire::Table<'de>,
13732    }
13733
13734    impl<'de> Drop for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13735        fn drop(&mut self) {
13736            let _ = self.table.get(1).map(|envelope| unsafe {
13737                envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13738            });
13739        }
13740    }
13741
13742    impl ::fidl_next::Constrained for SecureMemDeleteSecureHeapPhysicalRangeRequest<'_> {
13743        type Constraint = ();
13744
13745        fn validate(
13746            _: ::fidl_next::Slot<'_, Self>,
13747            _: Self::Constraint,
13748        ) -> Result<(), ::fidl_next::ValidationError> {
13749            Ok(())
13750        }
13751    }
13752
13753    unsafe impl ::fidl_next::Wire for SecureMemDeleteSecureHeapPhysicalRangeRequest<'static> {
13754        type Narrowed<'de> = SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>;
13755
13756        #[inline]
13757        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13758            ::fidl_next::munge!(let Self { table } = out);
13759            ::fidl_next::wire::Table::zero_padding(table);
13760        }
13761    }
13762
13763    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13764        for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>
13765    where
13766        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13767    {
13768        fn decode(
13769            slot: ::fidl_next::Slot<'_, Self>,
13770            decoder: &mut ___D,
13771            _: (),
13772        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13773            ::fidl_next::munge!(let Self { table } = slot);
13774
13775            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13776                match ordinal {
13777                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13778
13779                    1 => {
13780                        ::fidl_next::wire::Envelope::decode_as::<
13781                            ___D,
13782                            crate::wire::SecureHeapAndRange<'de>,
13783                        >(slot.as_mut(), decoder, ())?;
13784
13785                        Ok(())
13786                    }
13787
13788                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13789                }
13790            })
13791        }
13792    }
13793
13794    impl<'de> SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13795        pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13796            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13797        }
13798
13799        pub fn take_heap_range(
13800            &mut self,
13801        ) -> ::core::option::Option<crate::wire::SecureHeapAndRange<'de>> {
13802            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13803        }
13804    }
13805
13806    impl<'de> ::core::fmt::Debug for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13807        fn fmt(
13808            &self,
13809            f: &mut ::core::fmt::Formatter<'_>,
13810        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13811            f.debug_struct("SecureMemDeleteSecureHeapPhysicalRangeRequest")
13812                .field("heap_range", &self.heap_range())
13813                .finish()
13814        }
13815    }
13816
13817    impl<'de> ::fidl_next::IntoNatural for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13818        type Natural = crate::natural::SecureMemDeleteSecureHeapPhysicalRangeRequest;
13819    }
13820
13821    /// The wire type corresponding to [`SecureMemDeleteSecureHeapPhysicalRangeResponse`].
13822    pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13823
13824    /// The wire type corresponding to [`SecureMemModifySecureHeapPhysicalRangeRequest`].
13825    #[repr(C)]
13826    pub struct SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13827        pub(crate) table: ::fidl_next::wire::Table<'de>,
13828    }
13829
13830    impl<'de> Drop for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13831        fn drop(&mut self) {
13832            let _ = self.table.get(1).map(|envelope| unsafe {
13833                envelope.read_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
13834            });
13835        }
13836    }
13837
13838    impl ::fidl_next::Constrained for SecureMemModifySecureHeapPhysicalRangeRequest<'_> {
13839        type Constraint = ();
13840
13841        fn validate(
13842            _: ::fidl_next::Slot<'_, Self>,
13843            _: Self::Constraint,
13844        ) -> Result<(), ::fidl_next::ValidationError> {
13845            Ok(())
13846        }
13847    }
13848
13849    unsafe impl ::fidl_next::Wire for SecureMemModifySecureHeapPhysicalRangeRequest<'static> {
13850        type Narrowed<'de> = SecureMemModifySecureHeapPhysicalRangeRequest<'de>;
13851
13852        #[inline]
13853        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13854            ::fidl_next::munge!(let Self { table } = out);
13855            ::fidl_next::wire::Table::zero_padding(table);
13856        }
13857    }
13858
13859    unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13860        for SecureMemModifySecureHeapPhysicalRangeRequest<'de>
13861    where
13862        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13863    {
13864        fn decode(
13865            slot: ::fidl_next::Slot<'_, Self>,
13866            decoder: &mut ___D,
13867            _: (),
13868        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13869            ::fidl_next::munge!(let Self { table } = slot);
13870
13871            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13872                match ordinal {
13873                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13874
13875                    1 => {
13876                        ::fidl_next::wire::Envelope::decode_as::<
13877                            ___D,
13878                            crate::wire::SecureHeapAndRangeModification<'de>,
13879                        >(slot.as_mut(), decoder, ())?;
13880
13881                        Ok(())
13882                    }
13883
13884                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13885                }
13886            })
13887        }
13888    }
13889
13890    impl<'de> SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13891        pub fn range_modification(
13892            &self,
13893        ) -> ::core::option::Option<&crate::wire::SecureHeapAndRangeModification<'de>> {
13894            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13895        }
13896
13897        pub fn take_range_modification(
13898            &mut self,
13899        ) -> ::core::option::Option<crate::wire::SecureHeapAndRangeModification<'de>> {
13900            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13901        }
13902    }
13903
13904    impl<'de> ::core::fmt::Debug for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13905        fn fmt(
13906            &self,
13907            f: &mut ::core::fmt::Formatter<'_>,
13908        ) -> ::core::result::Result<(), ::core::fmt::Error> {
13909            f.debug_struct("SecureMemModifySecureHeapPhysicalRangeRequest")
13910                .field("range_modification", &self.range_modification())
13911                .finish()
13912        }
13913    }
13914
13915    impl<'de> ::fidl_next::IntoNatural for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13916        type Natural = crate::natural::SecureMemModifySecureHeapPhysicalRangeRequest;
13917    }
13918
13919    /// The wire type corresponding to [`SecureMemModifySecureHeapPhysicalRangeResponse`].
13920    pub type SecureMemModifySecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13921
13922    /// The wire type corresponding to [`SecureMemZeroSubRangeRequest`].
13923    #[repr(C)]
13924    pub struct SecureMemZeroSubRangeRequest<'de> {
13925        pub(crate) table: ::fidl_next::wire::Table<'de>,
13926    }
13927
13928    impl<'de> Drop for SecureMemZeroSubRangeRequest<'de> {
13929        fn drop(&mut self) {
13930            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
13931
13932            let _ = self.table.get(2).map(|envelope| unsafe {
13933                envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13934            });
13935        }
13936    }
13937
13938    impl ::fidl_next::Constrained for SecureMemZeroSubRangeRequest<'_> {
13939        type Constraint = ();
13940
13941        fn validate(
13942            _: ::fidl_next::Slot<'_, Self>,
13943            _: Self::Constraint,
13944        ) -> Result<(), ::fidl_next::ValidationError> {
13945            Ok(())
13946        }
13947    }
13948
13949    unsafe impl ::fidl_next::Wire for SecureMemZeroSubRangeRequest<'static> {
13950        type Narrowed<'de> = SecureMemZeroSubRangeRequest<'de>;
13951
13952        #[inline]
13953        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13954            ::fidl_next::munge!(let Self { table } = out);
13955            ::fidl_next::wire::Table::zero_padding(table);
13956        }
13957    }
13958
13959    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemZeroSubRangeRequest<'de>
13960    where
13961        ___D: ::fidl_next::Decoder<'de> + ?Sized,
13962    {
13963        fn decode(
13964            slot: ::fidl_next::Slot<'_, Self>,
13965            decoder: &mut ___D,
13966            _: (),
13967        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13968            ::fidl_next::munge!(let Self { table } = slot);
13969
13970            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13971                match ordinal {
13972                    0 => unsafe { ::core::hint::unreachable_unchecked() },
13973
13974                    1 => {
13975                        ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
13976                            slot.as_mut(),
13977                            decoder,
13978                            (),
13979                        )?;
13980
13981                        Ok(())
13982                    }
13983
13984                    2 => {
13985                        ::fidl_next::wire::Envelope::decode_as::<
13986                            ___D,
13987                            crate::wire::SecureHeapAndRange<'de>,
13988                        >(slot.as_mut(), decoder, ())?;
13989
13990                        Ok(())
13991                    }
13992
13993                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13994                }
13995            })
13996        }
13997    }
13998
13999    impl<'de> SecureMemZeroSubRangeRequest<'de> {
14000        pub fn is_covering_range_explicit(&self) -> ::core::option::Option<&bool> {
14001            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14002        }
14003
14004        pub fn take_is_covering_range_explicit(&mut self) -> ::core::option::Option<bool> {
14005            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
14006        }
14007
14008        pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
14009            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14010        }
14011
14012        pub fn take_heap_range(
14013            &mut self,
14014        ) -> ::core::option::Option<crate::wire::SecureHeapAndRange<'de>> {
14015            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
14016        }
14017    }
14018
14019    impl<'de> ::core::fmt::Debug for SecureMemZeroSubRangeRequest<'de> {
14020        fn fmt(
14021            &self,
14022            f: &mut ::core::fmt::Formatter<'_>,
14023        ) -> ::core::result::Result<(), ::core::fmt::Error> {
14024            f.debug_struct("SecureMemZeroSubRangeRequest")
14025                .field("is_covering_range_explicit", &self.is_covering_range_explicit())
14026                .field("heap_range", &self.heap_range())
14027                .finish()
14028        }
14029    }
14030
14031    impl<'de> ::fidl_next::IntoNatural for SecureMemZeroSubRangeRequest<'de> {
14032        type Natural = crate::natural::SecureMemZeroSubRangeRequest;
14033    }
14034
14035    /// The wire type corresponding to [`SecureMemZeroSubRangeResponse`].
14036    pub type SecureMemZeroSubRangeResponse = ::fidl_next::wire::Unit;
14037}
14038
14039pub mod wire_optional {}
14040
14041pub mod generic {
14042
14043    /// The generic type corresponding to [`PixelFormatAndModifier`].
14044    pub struct PixelFormatAndModifier<T0, T1> {
14045        pub pixel_format: T0,
14046
14047        pub pixel_format_modifier: T1,
14048    }
14049
14050    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>
14051        for PixelFormatAndModifier<T0, T1>
14052    where
14053        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14054        T0: ::fidl_next::Encode<::fidl_next_common_fuchsia_images2::wire::PixelFormat, ___E>,
14055        T1: ::fidl_next::Encode<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier, ___E>,
14056    {
14057        #[inline]
14058        fn encode(
14059            self,
14060            encoder_: &mut ___E,
14061            out_: &mut ::core::mem::MaybeUninit<crate::wire::PixelFormatAndModifier>,
14062            _: (),
14063        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14064            ::fidl_next::munge! {
14065                let crate::wire::PixelFormatAndModifier {
14066                    pixel_format,
14067                    pixel_format_modifier,
14068
14069                } = out_;
14070            }
14071
14072            ::fidl_next::Encode::encode(self.pixel_format, encoder_, pixel_format, ())?;
14073
14074            ::fidl_next::Encode::encode(
14075                self.pixel_format_modifier,
14076                encoder_,
14077                pixel_format_modifier,
14078                (),
14079            )?;
14080
14081            Ok(())
14082        }
14083    }
14084
14085    /// The generic type corresponding to [`NodeSyncResponse`].
14086    pub type NodeSyncResponse = ();
14087
14088    /// The generic type corresponding to [`BufferCollectionCheckAllBuffersAllocatedResponse`].
14089    pub type BufferCollectionCheckAllBuffersAllocatedResponse = ();
14090
14091    /// The generic type corresponding to [`SecureMemAddSecureHeapPhysicalRangeResponse`].
14092    pub type SecureMemAddSecureHeapPhysicalRangeResponse = ();
14093
14094    /// The generic type corresponding to [`SecureMemDeleteSecureHeapPhysicalRangeResponse`].
14095    pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ();
14096
14097    /// The generic type corresponding to [`SecureMemModifySecureHeapPhysicalRangeResponse`].
14098    pub type SecureMemModifySecureHeapPhysicalRangeResponse = ();
14099
14100    /// The generic type corresponding to [`SecureMemZeroSubRangeResponse`].
14101    pub type SecureMemZeroSubRangeResponse = ();
14102}
14103
14104pub use self::natural::*;
14105
14106#[doc = " The max length in bytes of the `name` request field in\n [`fuchsia.sysmem2/Allocator.SetDebugClientInfo`] and\n [`fuchsia.sysmem2/Node.SetDebugClientInfo`].\n"]
14107pub const MAX_CLIENT_NAME_LENGTH: i32 = 256 as i32;
14108
14109#[doc = " The maximum size of\n [`fuchsia.sysmem2/BufferMemoryConstraints.permitted_heaps`].\n"]
14110pub const MAX_COUNT_BUFFER_MEMORY_CONSTRAINTS_PERMITTED_HEAPS: u32 = 64 as u32;
14111
14112#[doc = " The maximum size of [`fuchsia.sysmem2/ImageFormatConstraints.color_spaces`].\n"]
14113pub const MAX_COUNT_IMAGE_FORMAT_CONSTRAINTS_COLOR_SPACES: u32 = 32 as u32;
14114
14115#[doc = " The maximum size of\n [`fuchsia.sysmem2/ImageFormatConstraints.pixel_format_and_modifiers`].\n"]
14116pub const MAX_COUNT_PIXEL_FORMAT_AND_MODIFIERS: u32 = 64 as u32;
14117
14118pub const MAX_COUNT_IMAGE_FORMAT_CONSTRAINTS_REQUIRED_MAX_SIZE_LIST: u32 = 64 as u32;
14119
14120#[doc = " The maximum size of\n [`fuchsia.sysmem2/BufferCollectionConstraints.image_format_constraints`].\n"]
14121pub const MAX_COUNT_BUFFER_COLLECTION_CONSTRAINTS_IMAGE_FORMAT_CONSTRAINTS: u32 = 64 as u32;
14122
14123#[doc = " The maximum entries that can be in the\n [`fuchsia.sysmem2/BufferCollectionInfo.buffers`] field.\n"]
14124pub const MAX_COUNT_BUFFER_COLLECTION_INFO_BUFFERS: u32 = 128 as u32;
14125
14126pub const MAX_COUNT_DUPLICATES: u32 = 64 as u32;
14127
14128#[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"]
14129pub const MAX_COUNT_CREATE_CHILDREN: i32 = 64 as i32;
14130
14131pub const CPU_USAGE_READ: u32 = 1 as u32;
14132
14133pub const CPU_USAGE_READ_OFTEN: u32 = 2 as u32;
14134
14135pub const CPU_USAGE_WRITE: u32 = 4 as u32;
14136
14137pub const CPU_USAGE_WRITE_OFTEN: u32 = 8 as u32;
14138
14139pub const DISPLAY_USAGE_CURSOR: u32 = 2 as u32;
14140
14141pub const DISPLAY_USAGE_LAYER: u32 = 1 as u32;
14142
14143pub const MAX_HEAPS_COUNT: u32 = 32 as u32;
14144
14145pub const MAX_RANGES_COUNT: u32 = 128 as u32;
14146
14147pub const NONE_USAGE: u32 = 1 as u32;
14148
14149pub const NONE_USAGE_PERMIT_ALLOCATION: u32 = 2 as u32;
14150
14151/// The type corresponding to the SecureMem protocol.
14152#[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"]
14153#[derive(PartialEq, Debug)]
14154pub struct SecureMem;
14155
14156#[cfg(target_os = "fuchsia")]
14157impl ::fidl_next::HasTransport for SecureMem {
14158    type Transport = ::fidl_next::fuchsia::zx::Channel;
14159}
14160
14161pub mod secure_mem {
14162    pub mod prelude {
14163        pub use crate::{
14164            SecureMem, SecureMemClientHandler, SecureMemLocalClientHandler,
14165            SecureMemLocalServerHandler, SecureMemServerHandler, secure_mem,
14166        };
14167
14168        pub use crate::natural::Error;
14169
14170        pub use crate::natural::SecureMemAddSecureHeapPhysicalRangeRequest;
14171
14172        pub use crate::natural::SecureMemDeleteSecureHeapPhysicalRangeRequest;
14173
14174        pub use crate::natural::SecureMemGetPhysicalSecureHeapPropertiesRequest;
14175
14176        pub use crate::natural::SecureMemModifySecureHeapPhysicalRangeRequest;
14177
14178        pub use crate::natural::SecureMemZeroSubRangeRequest;
14179
14180        pub use crate::natural::SecureMemAddSecureHeapPhysicalRangeResponse;
14181
14182        pub use crate::natural::SecureMemDeleteSecureHeapPhysicalRangeResponse;
14183
14184        pub use crate::natural::SecureMemGetDynamicSecureHeapsResponse;
14185
14186        pub use crate::natural::SecureMemGetPhysicalSecureHeapPropertiesResponse;
14187
14188        pub use crate::natural::SecureMemGetPhysicalSecureHeapsResponse;
14189
14190        pub use crate::natural::SecureMemModifySecureHeapPhysicalRangeResponse;
14191
14192        pub use crate::natural::SecureMemZeroSubRangeResponse;
14193    }
14194
14195    pub struct GetPhysicalSecureHeaps;
14196
14197    impl ::fidl_next::Method for GetPhysicalSecureHeaps {
14198        const ORDINAL: u64 = 4067140791638717411;
14199        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14200            ::fidl_next::protocol::Flexibility::Flexible;
14201
14202        type Protocol = crate::SecureMem;
14203
14204        type Request = ::fidl_next::wire::EmptyMessageBody;
14205    }
14206
14207    impl ::fidl_next::TwoWayMethod for GetPhysicalSecureHeaps {
14208        type Response = ::fidl_next::wire::Result<
14209            'static,
14210            crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
14211            crate::wire::Error,
14212        >;
14213    }
14214
14215    impl<___R> ::fidl_next::Respond<___R> for GetPhysicalSecureHeaps {
14216        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14217
14218        fn respond(response: ___R) -> Self::Output {
14219            ::core::result::Result::Ok(response)
14220        }
14221    }
14222
14223    impl<___R> ::fidl_next::RespondErr<___R> for GetPhysicalSecureHeaps {
14224        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14225
14226        fn respond_err(response: ___R) -> Self::Output {
14227            ::core::result::Result::Err(response)
14228        }
14229    }
14230
14231    pub struct GetDynamicSecureHeaps;
14232
14233    impl ::fidl_next::Method for GetDynamicSecureHeaps {
14234        const ORDINAL: u64 = 1265657178863511604;
14235        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14236            ::fidl_next::protocol::Flexibility::Flexible;
14237
14238        type Protocol = crate::SecureMem;
14239
14240        type Request = ::fidl_next::wire::EmptyMessageBody;
14241    }
14242
14243    impl ::fidl_next::TwoWayMethod for GetDynamicSecureHeaps {
14244        type Response = ::fidl_next::wire::Result<
14245            'static,
14246            crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
14247            crate::wire::Error,
14248        >;
14249    }
14250
14251    impl<___R> ::fidl_next::Respond<___R> for GetDynamicSecureHeaps {
14252        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14253
14254        fn respond(response: ___R) -> Self::Output {
14255            ::core::result::Result::Ok(response)
14256        }
14257    }
14258
14259    impl<___R> ::fidl_next::RespondErr<___R> for GetDynamicSecureHeaps {
14260        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14261
14262        fn respond_err(response: ___R) -> Self::Output {
14263            ::core::result::Result::Err(response)
14264        }
14265    }
14266
14267    pub struct GetPhysicalSecureHeapProperties;
14268
14269    impl ::fidl_next::Method for GetPhysicalSecureHeapProperties {
14270        const ORDINAL: u64 = 895942034471897020;
14271        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14272            ::fidl_next::protocol::Flexibility::Flexible;
14273
14274        type Protocol = crate::SecureMem;
14275
14276        type Request = crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>;
14277    }
14278
14279    impl ::fidl_next::TwoWayMethod for GetPhysicalSecureHeapProperties {
14280        type Response = ::fidl_next::wire::Result<
14281            'static,
14282            crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
14283            crate::wire::Error,
14284        >;
14285    }
14286
14287    impl<___R> ::fidl_next::Respond<___R> for GetPhysicalSecureHeapProperties {
14288        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14289
14290        fn respond(response: ___R) -> Self::Output {
14291            ::core::result::Result::Ok(response)
14292        }
14293    }
14294
14295    impl<___R> ::fidl_next::RespondErr<___R> for GetPhysicalSecureHeapProperties {
14296        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14297
14298        fn respond_err(response: ___R) -> Self::Output {
14299            ::core::result::Result::Err(response)
14300        }
14301    }
14302
14303    pub struct AddSecureHeapPhysicalRange;
14304
14305    impl ::fidl_next::Method for AddSecureHeapPhysicalRange {
14306        const ORDINAL: u64 = 3888459953148993914;
14307        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14308            ::fidl_next::protocol::Flexibility::Flexible;
14309
14310        type Protocol = crate::SecureMem;
14311
14312        type Request = crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>;
14313    }
14314
14315    impl ::fidl_next::TwoWayMethod for AddSecureHeapPhysicalRange {
14316        type Response = ::fidl_next::wire::Result<
14317            'static,
14318            crate::wire::SecureMemAddSecureHeapPhysicalRangeResponse,
14319            crate::wire::Error,
14320        >;
14321    }
14322
14323    impl<___R> ::fidl_next::Respond<___R> for AddSecureHeapPhysicalRange {
14324        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14325
14326        fn respond(response: ___R) -> Self::Output {
14327            ::core::result::Result::Ok(response)
14328        }
14329    }
14330
14331    impl<___R> ::fidl_next::RespondErr<___R> for AddSecureHeapPhysicalRange {
14332        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14333
14334        fn respond_err(response: ___R) -> Self::Output {
14335            ::core::result::Result::Err(response)
14336        }
14337    }
14338
14339    pub struct DeleteSecureHeapPhysicalRange;
14340
14341    impl ::fidl_next::Method for DeleteSecureHeapPhysicalRange {
14342        const ORDINAL: u64 = 1056754671343258782;
14343        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14344            ::fidl_next::protocol::Flexibility::Flexible;
14345
14346        type Protocol = crate::SecureMem;
14347
14348        type Request = crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>;
14349    }
14350
14351    impl ::fidl_next::TwoWayMethod for DeleteSecureHeapPhysicalRange {
14352        type Response = ::fidl_next::wire::Result<
14353            'static,
14354            crate::wire::SecureMemDeleteSecureHeapPhysicalRangeResponse,
14355            crate::wire::Error,
14356        >;
14357    }
14358
14359    impl<___R> ::fidl_next::Respond<___R> for DeleteSecureHeapPhysicalRange {
14360        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14361
14362        fn respond(response: ___R) -> Self::Output {
14363            ::core::result::Result::Ok(response)
14364        }
14365    }
14366
14367    impl<___R> ::fidl_next::RespondErr<___R> for DeleteSecureHeapPhysicalRange {
14368        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14369
14370        fn respond_err(response: ___R) -> Self::Output {
14371            ::core::result::Result::Err(response)
14372        }
14373    }
14374
14375    pub struct ModifySecureHeapPhysicalRange;
14376
14377    impl ::fidl_next::Method for ModifySecureHeapPhysicalRange {
14378        const ORDINAL: u64 = 6969114310578042676;
14379        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14380            ::fidl_next::protocol::Flexibility::Flexible;
14381
14382        type Protocol = crate::SecureMem;
14383
14384        type Request = crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>;
14385    }
14386
14387    impl ::fidl_next::TwoWayMethod for ModifySecureHeapPhysicalRange {
14388        type Response = ::fidl_next::wire::Result<
14389            'static,
14390            crate::wire::SecureMemModifySecureHeapPhysicalRangeResponse,
14391            crate::wire::Error,
14392        >;
14393    }
14394
14395    impl<___R> ::fidl_next::Respond<___R> for ModifySecureHeapPhysicalRange {
14396        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14397
14398        fn respond(response: ___R) -> Self::Output {
14399            ::core::result::Result::Ok(response)
14400        }
14401    }
14402
14403    impl<___R> ::fidl_next::RespondErr<___R> for ModifySecureHeapPhysicalRange {
14404        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14405
14406        fn respond_err(response: ___R) -> Self::Output {
14407            ::core::result::Result::Err(response)
14408        }
14409    }
14410
14411    pub struct ZeroSubRange;
14412
14413    impl ::fidl_next::Method for ZeroSubRange {
14414        const ORDINAL: u64 = 6567857461132811493;
14415        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
14416            ::fidl_next::protocol::Flexibility::Flexible;
14417
14418        type Protocol = crate::SecureMem;
14419
14420        type Request = crate::wire::SecureMemZeroSubRangeRequest<'static>;
14421    }
14422
14423    impl ::fidl_next::TwoWayMethod for ZeroSubRange {
14424        type Response = ::fidl_next::wire::Result<
14425            'static,
14426            crate::wire::SecureMemZeroSubRangeResponse,
14427            crate::wire::Error,
14428        >;
14429    }
14430
14431    impl<___R> ::fidl_next::Respond<___R> for ZeroSubRange {
14432        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
14433
14434        fn respond(response: ___R) -> Self::Output {
14435            ::core::result::Result::Ok(response)
14436        }
14437    }
14438
14439    impl<___R> ::fidl_next::RespondErr<___R> for ZeroSubRange {
14440        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
14441
14442        fn respond_err(response: ___R) -> Self::Output {
14443            ::core::result::Result::Err(response)
14444        }
14445    }
14446
14447    mod ___detail {
14448        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::SecureMem
14449        where
14450            ___T: ::fidl_next::Transport,
14451        {
14452            type Client = SecureMemClient<___T>;
14453            type Server = SecureMemServer<___T>;
14454        }
14455
14456        /// The client for the `SecureMem` protocol.
14457        #[repr(transparent)]
14458        pub struct SecureMemClient<___T: ::fidl_next::Transport> {
14459            #[allow(dead_code)]
14460            client: ::fidl_next::protocol::Client<___T>,
14461        }
14462
14463        impl<___T> SecureMemClient<___T>
14464        where
14465            ___T: ::fidl_next::Transport,
14466        {
14467            #[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"]
14468            pub fn get_physical_secure_heaps(
14469                &self,
14470            ) -> ::fidl_next::TwoWayFuture<'_, super::GetPhysicalSecureHeaps, ___T> {
14471                ::fidl_next::TwoWayFuture::from_untyped(
14472                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
14473                        4067140791638717411,
14474                        <super::GetPhysicalSecureHeaps as ::fidl_next::Method>::FLEXIBILITY,
14475                        (),
14476                    ),
14477                )
14478            }
14479
14480            #[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"]
14481            pub fn get_dynamic_secure_heaps(
14482                &self,
14483            ) -> ::fidl_next::TwoWayFuture<'_, super::GetDynamicSecureHeaps, ___T> {
14484                ::fidl_next::TwoWayFuture::from_untyped(
14485                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
14486                        1265657178863511604,
14487                        <super::GetDynamicSecureHeaps as ::fidl_next::Method>::FLEXIBILITY,
14488                        (),
14489                    ),
14490                )
14491            }
14492
14493            #[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"]
14494            pub fn get_physical_secure_heap_properties_with<___R>(
14495                &self,
14496                request: ___R,
14497            ) -> ::fidl_next::TwoWayFuture<'_, super::GetPhysicalSecureHeapProperties, ___T>
14498            where
14499                ___R: ::fidl_next::Encode<
14500                        crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
14501                        <___T as ::fidl_next::Transport>::SendBuffer,
14502                    >,
14503            {
14504                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14505                    895942034471897020,
14506                    <super::GetPhysicalSecureHeapProperties as ::fidl_next::Method>::FLEXIBILITY,
14507                    request,
14508                ))
14509            }
14510
14511            #[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"]
14512            pub fn add_secure_heap_physical_range_with<___R>(
14513                &self,
14514                request: ___R,
14515            ) -> ::fidl_next::TwoWayFuture<'_, super::AddSecureHeapPhysicalRange, ___T>
14516            where
14517                ___R: ::fidl_next::Encode<
14518                        crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
14519                        <___T as ::fidl_next::Transport>::SendBuffer,
14520                    >,
14521            {
14522                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14523                    3888459953148993914,
14524                    <super::AddSecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
14525                    request,
14526                ))
14527            }
14528
14529            #[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"]
14530            pub fn delete_secure_heap_physical_range_with<___R>(
14531                &self,
14532                request: ___R,
14533            ) -> ::fidl_next::TwoWayFuture<'_, super::DeleteSecureHeapPhysicalRange, ___T>
14534            where
14535                ___R: ::fidl_next::Encode<
14536                        crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
14537                        <___T as ::fidl_next::Transport>::SendBuffer,
14538                    >,
14539            {
14540                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14541                    1056754671343258782,
14542                    <super::DeleteSecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
14543                    request,
14544                ))
14545            }
14546
14547            #[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"]
14548            pub fn modify_secure_heap_physical_range_with<___R>(
14549                &self,
14550                request: ___R,
14551            ) -> ::fidl_next::TwoWayFuture<'_, super::ModifySecureHeapPhysicalRange, ___T>
14552            where
14553                ___R: ::fidl_next::Encode<
14554                        crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
14555                        <___T as ::fidl_next::Transport>::SendBuffer,
14556                    >,
14557            {
14558                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14559                    6969114310578042676,
14560                    <super::ModifySecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
14561                    request,
14562                ))
14563            }
14564
14565            #[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"]
14566            pub fn zero_sub_range_with<___R>(
14567                &self,
14568                request: ___R,
14569            ) -> ::fidl_next::TwoWayFuture<'_, super::ZeroSubRange, ___T>
14570            where
14571                ___R: ::fidl_next::Encode<
14572                        crate::wire::SecureMemZeroSubRangeRequest<'static>,
14573                        <___T as ::fidl_next::Transport>::SendBuffer,
14574                    >,
14575            {
14576                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
14577                    6567857461132811493,
14578                    <super::ZeroSubRange as ::fidl_next::Method>::FLEXIBILITY,
14579                    request,
14580                ))
14581            }
14582        }
14583
14584        /// The server for the `SecureMem` protocol.
14585        #[repr(transparent)]
14586        pub struct SecureMemServer<___T: ::fidl_next::Transport> {
14587            server: ::fidl_next::protocol::Server<___T>,
14588        }
14589
14590        impl<___T> SecureMemServer<___T> where ___T: ::fidl_next::Transport {}
14591    }
14592}
14593
14594#[diagnostic::on_unimplemented(
14595    note = "If {Self} implements the non-local SecureMemClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
14596)]
14597
14598/// A client handler for the SecureMem protocol.
14599///
14600/// See [`SecureMem`] for more details.
14601pub trait SecureMemLocalClientHandler<
14602    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14603    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14604>
14605{
14606    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
14607        ::core::future::ready(())
14608    }
14609}
14610
14611impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for SecureMem
14612where
14613    ___H: SecureMemLocalClientHandler<___T>,
14614    ___T: ::fidl_next::Transport,
14615{
14616    async fn on_event(
14617        handler: &mut ___H,
14618        mut message: ::fidl_next::Message<___T>,
14619    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
14620        match *message.header().ordinal {
14621            ordinal => {
14622                handler.on_unknown_interaction(ordinal).await;
14623                if ::core::matches!(
14624                    message.header().flexibility(),
14625                    ::fidl_next::protocol::Flexibility::Strict
14626                ) {
14627                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14628                } else {
14629                    Ok(())
14630                }
14631            }
14632        }
14633    }
14634}
14635
14636#[diagnostic::on_unimplemented(
14637    note = "If {Self} implements the non-local SecureMemServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
14638)]
14639
14640/// A server handler for the SecureMem protocol.
14641///
14642/// See [`SecureMem`] for more details.
14643pub trait SecureMemLocalServerHandler<
14644    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14645    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14646>
14647{
14648    #[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"]
14649    fn get_physical_secure_heaps(
14650        &mut self,
14651
14652        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
14653    ) -> impl ::core::future::Future<Output = ()>;
14654
14655    #[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"]
14656    fn get_dynamic_secure_heaps(
14657        &mut self,
14658
14659        responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
14660    ) -> impl ::core::future::Future<Output = ()>;
14661
14662    #[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"]
14663    fn get_physical_secure_heap_properties(
14664        &mut self,
14665
14666        request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14667
14668        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14669    ) -> impl ::core::future::Future<Output = ()>;
14670
14671    #[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"]
14672    fn add_secure_heap_physical_range(
14673        &mut self,
14674
14675        request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14676
14677        responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14678    ) -> impl ::core::future::Future<Output = ()>;
14679
14680    #[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"]
14681    fn delete_secure_heap_physical_range(
14682        &mut self,
14683
14684        request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14685
14686        responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14687    ) -> impl ::core::future::Future<Output = ()>;
14688
14689    #[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"]
14690    fn modify_secure_heap_physical_range(
14691        &mut self,
14692
14693        request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14694
14695        responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14696    ) -> impl ::core::future::Future<Output = ()>;
14697
14698    #[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"]
14699    fn zero_sub_range(
14700        &mut self,
14701
14702        request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
14703
14704        responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
14705    ) -> impl ::core::future::Future<Output = ()>;
14706
14707    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
14708        ::core::future::ready(())
14709    }
14710}
14711
14712impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for SecureMem
14713where
14714    ___H: SecureMemLocalServerHandler<___T>,
14715    ___T: ::fidl_next::Transport,
14716    for<'de> crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>: ::fidl_next::Decode<
14717            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14718            Constraint = (),
14719        >,
14720    for<'de> crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14721            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14722            Constraint = (),
14723        >,
14724    for<'de> crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14725            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14726            Constraint = (),
14727        >,
14728    for<'de> crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14729            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14730            Constraint = (),
14731        >,
14732    for<'de> crate::wire::SecureMemZeroSubRangeRequest<'de>: ::fidl_next::Decode<
14733            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14734            Constraint = (),
14735        >,
14736{
14737    async fn on_one_way(
14738        handler: &mut ___H,
14739        mut message: ::fidl_next::Message<___T>,
14740    ) -> ::core::result::Result<
14741        (),
14742        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14743    > {
14744        match *message.header().ordinal {
14745            ordinal => {
14746                handler.on_unknown_interaction(ordinal).await;
14747                if ::core::matches!(
14748                    message.header().flexibility(),
14749                    ::fidl_next::protocol::Flexibility::Strict
14750                ) {
14751                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14752                } else {
14753                    Ok(())
14754                }
14755            }
14756        }
14757    }
14758
14759    async fn on_two_way(
14760        handler: &mut ___H,
14761        mut message: ::fidl_next::Message<___T>,
14762        responder: ::fidl_next::protocol::Responder<___T>,
14763    ) -> ::core::result::Result<
14764        (),
14765        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14766    > {
14767        match *message.header().ordinal {
14768            4067140791638717411 => {
14769                let responder = ::fidl_next::Responder::from_untyped(responder);
14770
14771                handler.get_physical_secure_heaps(responder).await;
14772                Ok(())
14773            }
14774
14775            1265657178863511604 => {
14776                let responder = ::fidl_next::Responder::from_untyped(responder);
14777
14778                handler.get_dynamic_secure_heaps(responder).await;
14779                Ok(())
14780            }
14781
14782            895942034471897020 => {
14783                let responder = ::fidl_next::Responder::from_untyped(responder);
14784
14785                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14786                    Ok(decoded) => {
14787                        handler
14788                            .get_physical_secure_heap_properties(
14789                                ::fidl_next::Request::from_decoded(decoded),
14790                                responder,
14791                            )
14792                            .await;
14793                        Ok(())
14794                    }
14795                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14796                        ordinal: 895942034471897020,
14797                        error,
14798                    }),
14799                }
14800            }
14801
14802            3888459953148993914 => {
14803                let responder = ::fidl_next::Responder::from_untyped(responder);
14804
14805                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14806                    Ok(decoded) => {
14807                        handler
14808                            .add_secure_heap_physical_range(
14809                                ::fidl_next::Request::from_decoded(decoded),
14810                                responder,
14811                            )
14812                            .await;
14813                        Ok(())
14814                    }
14815                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14816                        ordinal: 3888459953148993914,
14817                        error,
14818                    }),
14819                }
14820            }
14821
14822            1056754671343258782 => {
14823                let responder = ::fidl_next::Responder::from_untyped(responder);
14824
14825                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14826                    Ok(decoded) => {
14827                        handler
14828                            .delete_secure_heap_physical_range(
14829                                ::fidl_next::Request::from_decoded(decoded),
14830                                responder,
14831                            )
14832                            .await;
14833                        Ok(())
14834                    }
14835                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14836                        ordinal: 1056754671343258782,
14837                        error,
14838                    }),
14839                }
14840            }
14841
14842            6969114310578042676 => {
14843                let responder = ::fidl_next::Responder::from_untyped(responder);
14844
14845                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14846                    Ok(decoded) => {
14847                        handler
14848                            .modify_secure_heap_physical_range(
14849                                ::fidl_next::Request::from_decoded(decoded),
14850                                responder,
14851                            )
14852                            .await;
14853                        Ok(())
14854                    }
14855                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14856                        ordinal: 6969114310578042676,
14857                        error,
14858                    }),
14859                }
14860            }
14861
14862            6567857461132811493 => {
14863                let responder = ::fidl_next::Responder::from_untyped(responder);
14864
14865                match ::fidl_next::AsDecoderExt::into_decoded(message) {
14866                    Ok(decoded) => {
14867                        handler
14868                            .zero_sub_range(::fidl_next::Request::from_decoded(decoded), responder)
14869                            .await;
14870                        Ok(())
14871                    }
14872                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14873                        ordinal: 6567857461132811493,
14874                        error,
14875                    }),
14876                }
14877            }
14878
14879            ordinal => {
14880                handler.on_unknown_interaction(ordinal).await;
14881                if ::core::matches!(
14882                    message.header().flexibility(),
14883                    ::fidl_next::protocol::Flexibility::Strict
14884                ) {
14885                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14886                } else {
14887                    responder
14888                        .respond_framework_error(
14889                            ordinal,
14890                            ::fidl_next::FrameworkError::UnknownMethod,
14891                        )
14892                        .expect("encoding a framework error should never fail")
14893                        .await?;
14894                    Ok(())
14895                }
14896            }
14897        }
14898    }
14899}
14900
14901/// A client handler for the SecureMem protocol.
14902///
14903/// See [`SecureMem`] for more details.
14904pub trait SecureMemClientHandler<
14905    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14906    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14907>
14908{
14909    fn on_unknown_interaction(
14910        &mut self,
14911        ordinal: u64,
14912    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
14913        ::core::future::ready(())
14914    }
14915}
14916
14917impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for SecureMem
14918where
14919    ___H: SecureMemClientHandler<___T> + ::core::marker::Send,
14920    ___T: ::fidl_next::Transport,
14921{
14922    async fn on_event(
14923        handler: &mut ___H,
14924        mut message: ::fidl_next::Message<___T>,
14925    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
14926        match *message.header().ordinal {
14927            ordinal => {
14928                handler.on_unknown_interaction(ordinal).await;
14929                if ::core::matches!(
14930                    message.header().flexibility(),
14931                    ::fidl_next::protocol::Flexibility::Strict
14932                ) {
14933                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14934                } else {
14935                    Ok(())
14936                }
14937            }
14938        }
14939    }
14940}
14941
14942/// A server handler for the SecureMem protocol.
14943///
14944/// See [`SecureMem`] for more details.
14945pub trait SecureMemServerHandler<
14946    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14947    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14948>
14949{
14950    #[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"]
14951    fn get_physical_secure_heaps(
14952        &mut self,
14953
14954        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
14955    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14956
14957    #[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"]
14958    fn get_dynamic_secure_heaps(
14959        &mut self,
14960
14961        responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
14962    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14963
14964    #[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"]
14965    fn get_physical_secure_heap_properties(
14966        &mut self,
14967
14968        request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14969
14970        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14971    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14972
14973    #[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"]
14974    fn add_secure_heap_physical_range(
14975        &mut self,
14976
14977        request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14978
14979        responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14980    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14981
14982    #[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"]
14983    fn delete_secure_heap_physical_range(
14984        &mut self,
14985
14986        request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14987
14988        responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14989    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14990
14991    #[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"]
14992    fn modify_secure_heap_physical_range(
14993        &mut self,
14994
14995        request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14996
14997        responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14998    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14999
15000    #[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"]
15001    fn zero_sub_range(
15002        &mut self,
15003
15004        request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
15005
15006        responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
15007    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
15008
15009    fn on_unknown_interaction(
15010        &mut self,
15011        ordinal: u64,
15012    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
15013        ::core::future::ready(())
15014    }
15015}
15016
15017impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for SecureMem
15018where
15019    ___H: SecureMemServerHandler<___T> + ::core::marker::Send,
15020    ___T: ::fidl_next::Transport,
15021    for<'de> crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>: ::fidl_next::Decode<
15022            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15023            Constraint = (),
15024        >,
15025    for<'de> crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
15026            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15027            Constraint = (),
15028        >,
15029    for<'de> crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
15030            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15031            Constraint = (),
15032        >,
15033    for<'de> crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
15034            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15035            Constraint = (),
15036        >,
15037    for<'de> crate::wire::SecureMemZeroSubRangeRequest<'de>: ::fidl_next::Decode<
15038            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
15039            Constraint = (),
15040        >,
15041{
15042    async fn on_one_way(
15043        handler: &mut ___H,
15044        mut message: ::fidl_next::Message<___T>,
15045    ) -> ::core::result::Result<
15046        (),
15047        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
15048    > {
15049        match *message.header().ordinal {
15050            ordinal => {
15051                handler.on_unknown_interaction(ordinal).await;
15052                if ::core::matches!(
15053                    message.header().flexibility(),
15054                    ::fidl_next::protocol::Flexibility::Strict
15055                ) {
15056                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
15057                } else {
15058                    Ok(())
15059                }
15060            }
15061        }
15062    }
15063
15064    async fn on_two_way(
15065        handler: &mut ___H,
15066        mut message: ::fidl_next::Message<___T>,
15067        responder: ::fidl_next::protocol::Responder<___T>,
15068    ) -> ::core::result::Result<
15069        (),
15070        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
15071    > {
15072        match *message.header().ordinal {
15073            4067140791638717411 => {
15074                let responder = ::fidl_next::Responder::from_untyped(responder);
15075
15076                handler.get_physical_secure_heaps(responder).await;
15077                Ok(())
15078            }
15079
15080            1265657178863511604 => {
15081                let responder = ::fidl_next::Responder::from_untyped(responder);
15082
15083                handler.get_dynamic_secure_heaps(responder).await;
15084                Ok(())
15085            }
15086
15087            895942034471897020 => {
15088                let responder = ::fidl_next::Responder::from_untyped(responder);
15089
15090                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15091                    Ok(decoded) => {
15092                        handler
15093                            .get_physical_secure_heap_properties(
15094                                ::fidl_next::Request::from_decoded(decoded),
15095                                responder,
15096                            )
15097                            .await;
15098                        Ok(())
15099                    }
15100                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15101                        ordinal: 895942034471897020,
15102                        error,
15103                    }),
15104                }
15105            }
15106
15107            3888459953148993914 => {
15108                let responder = ::fidl_next::Responder::from_untyped(responder);
15109
15110                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15111                    Ok(decoded) => {
15112                        handler
15113                            .add_secure_heap_physical_range(
15114                                ::fidl_next::Request::from_decoded(decoded),
15115                                responder,
15116                            )
15117                            .await;
15118                        Ok(())
15119                    }
15120                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15121                        ordinal: 3888459953148993914,
15122                        error,
15123                    }),
15124                }
15125            }
15126
15127            1056754671343258782 => {
15128                let responder = ::fidl_next::Responder::from_untyped(responder);
15129
15130                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15131                    Ok(decoded) => {
15132                        handler
15133                            .delete_secure_heap_physical_range(
15134                                ::fidl_next::Request::from_decoded(decoded),
15135                                responder,
15136                            )
15137                            .await;
15138                        Ok(())
15139                    }
15140                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15141                        ordinal: 1056754671343258782,
15142                        error,
15143                    }),
15144                }
15145            }
15146
15147            6969114310578042676 => {
15148                let responder = ::fidl_next::Responder::from_untyped(responder);
15149
15150                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15151                    Ok(decoded) => {
15152                        handler
15153                            .modify_secure_heap_physical_range(
15154                                ::fidl_next::Request::from_decoded(decoded),
15155                                responder,
15156                            )
15157                            .await;
15158                        Ok(())
15159                    }
15160                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15161                        ordinal: 6969114310578042676,
15162                        error,
15163                    }),
15164                }
15165            }
15166
15167            6567857461132811493 => {
15168                let responder = ::fidl_next::Responder::from_untyped(responder);
15169
15170                match ::fidl_next::AsDecoderExt::into_decoded(message) {
15171                    Ok(decoded) => {
15172                        handler
15173                            .zero_sub_range(::fidl_next::Request::from_decoded(decoded), responder)
15174                            .await;
15175                        Ok(())
15176                    }
15177                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15178                        ordinal: 6567857461132811493,
15179                        error,
15180                    }),
15181                }
15182            }
15183
15184            ordinal => {
15185                handler.on_unknown_interaction(ordinal).await;
15186                if ::core::matches!(
15187                    message.header().flexibility(),
15188                    ::fidl_next::protocol::Flexibility::Strict
15189                ) {
15190                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
15191                } else {
15192                    responder
15193                        .respond_framework_error(
15194                            ordinal,
15195                            ::fidl_next::FrameworkError::UnknownMethod,
15196                        )
15197                        .expect("encoding a framework error should never fail")
15198                        .await?;
15199                    Ok(())
15200                }
15201            }
15202        }
15203    }
15204}
15205
15206impl<___T> SecureMemClientHandler<___T> for ::fidl_next::IgnoreEvents
15207where
15208    ___T: ::fidl_next::Transport,
15209{
15210    async fn on_unknown_interaction(&mut self, _: u64) {}
15211}
15212
15213impl<___H, ___T> SecureMemLocalClientHandler<___T> for ::fidl_next::Local<___H>
15214where
15215    ___H: SecureMemClientHandler<___T>,
15216    ___T: ::fidl_next::Transport,
15217{
15218    async fn on_unknown_interaction(&mut self, ordinal: u64) {
15219        ___H::on_unknown_interaction(&mut self.0, ordinal).await
15220    }
15221}
15222
15223impl<___H, ___T> SecureMemLocalServerHandler<___T> for ::fidl_next::Local<___H>
15224where
15225    ___H: SecureMemServerHandler<___T>,
15226    ___T: ::fidl_next::Transport,
15227{
15228    async fn get_physical_secure_heaps(
15229        &mut self,
15230
15231        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
15232    ) {
15233        ___H::get_physical_secure_heaps(&mut self.0, responder).await
15234    }
15235
15236    async fn get_dynamic_secure_heaps(
15237        &mut self,
15238
15239        responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
15240    ) {
15241        ___H::get_dynamic_secure_heaps(&mut self.0, responder).await
15242    }
15243
15244    async fn get_physical_secure_heap_properties(
15245        &mut self,
15246
15247        request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
15248
15249        responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
15250    ) {
15251        ___H::get_physical_secure_heap_properties(&mut self.0, request, responder).await
15252    }
15253
15254    async fn add_secure_heap_physical_range(
15255        &mut self,
15256
15257        request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
15258
15259        responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
15260    ) {
15261        ___H::add_secure_heap_physical_range(&mut self.0, request, responder).await
15262    }
15263
15264    async fn delete_secure_heap_physical_range(
15265        &mut self,
15266
15267        request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
15268
15269        responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
15270    ) {
15271        ___H::delete_secure_heap_physical_range(&mut self.0, request, responder).await
15272    }
15273
15274    async fn modify_secure_heap_physical_range(
15275        &mut self,
15276
15277        request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
15278
15279        responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
15280    ) {
15281        ___H::modify_secure_heap_physical_range(&mut self.0, request, responder).await
15282    }
15283
15284    async fn zero_sub_range(
15285        &mut self,
15286
15287        request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
15288
15289        responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
15290    ) {
15291        ___H::zero_sub_range(&mut self.0, request, responder).await
15292    }
15293
15294    async fn on_unknown_interaction(&mut self, ordinal: u64) {
15295        ___H::on_unknown_interaction(&mut self.0, ordinal).await
15296    }
15297}
15298
15299pub const VIDEO_USAGE_CAPTURE: u32 = 8 as u32;
15300
15301pub const VIDEO_USAGE_DECRYPTOR_OUTPUT: u32 = 16 as u32;
15302
15303pub const VIDEO_USAGE_HW_DECODER: u32 = 1 as u32;
15304
15305pub const VIDEO_USAGE_HW_DECODER_INTERNAL: u32 = 32 as u32;
15306
15307pub const VIDEO_USAGE_HW_ENCODER: u32 = 2 as u32;
15308
15309pub const VULKAN_BUFFER_USAGE_INDEX_BUFFER: u32 = 4194304 as u32;
15310
15311pub const VULKAN_BUFFER_USAGE_INDIRECT_BUFFER: u32 = 16777216 as u32;
15312
15313pub const VULKAN_BUFFER_USAGE_STORAGE_BUFFER: u32 = 2097152 as u32;
15314
15315pub const VULKAN_BUFFER_USAGE_STORAGE_TEXEL_BUFFER: u32 = 524288 as u32;
15316
15317pub const VULKAN_BUFFER_USAGE_TRANSFER_DST: u32 = 131072 as u32;
15318
15319pub const VULKAN_BUFFER_USAGE_TRANSFER_SRC: u32 = 65536 as u32;
15320
15321pub const VULKAN_BUFFER_USAGE_UNIFORM_BUFFER: u32 = 1048576 as u32;
15322
15323pub const VULKAN_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER: u32 = 262144 as u32;
15324
15325pub const VULKAN_BUFFER_USAGE_VERTEX_BUFFER: u32 = 8388608 as u32;
15326
15327pub const VULKAN_IMAGE_USAGE_COLOR_ATTACHMENT: u32 = 16 as u32;
15328
15329pub const VULKAN_IMAGE_USAGE_INPUT_ATTACHMENT: u32 = 128 as u32;
15330
15331pub const VULKAN_IMAGE_USAGE_SAMPLED: u32 = 4 as u32;
15332
15333pub const VULKAN_IMAGE_USAGE_STENCIL_ATTACHMENT: u32 = 32 as u32;
15334
15335pub const VULKAN_IMAGE_USAGE_STORAGE: u32 = 8 as u32;
15336
15337pub const VULKAN_IMAGE_USAGE_TRANSFER_DST: u32 = 2 as u32;
15338
15339pub const VULKAN_IMAGE_USAGE_TRANSFER_SRC: u32 = 1 as u32;
15340
15341pub const VULKAN_IMAGE_USAGE_TRANSIENT_ATTACHMENT: u32 = 64 as u32;