1#![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 = " 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"]
542 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
543 #[repr(u32)]
544 pub enum Error {
545 Invalid = 0,
546 Unspecified = 1,
547 ProtocolDeviation = 2,
548 NotFound = 3,
549 HandleAccessDenied = 4,
550 NoMemory = 5,
551 ConstraintsIntersectionEmpty = 6,
552 Pending = 7,
553 TooManyGroupChildCombinations = 8,
554 UnknownOrdinal_(u32) = 9,
555 }
556 impl ::std::convert::From<u32> for Error {
557 fn from(value: u32) -> Self {
558 match value {
559 0 => Self::Invalid,
560 1 => Self::Unspecified,
561 2 => Self::ProtocolDeviation,
562 3 => Self::NotFound,
563 4 => Self::HandleAccessDenied,
564 5 => Self::NoMemory,
565 6 => Self::ConstraintsIntersectionEmpty,
566 7 => Self::Pending,
567 8 => Self::TooManyGroupChildCombinations,
568
569 _ => Self::UnknownOrdinal_(value),
570 }
571 }
572 }
573
574 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Error, ___E> for Error
575 where
576 ___E: ?Sized,
577 {
578 #[inline]
579 fn encode(
580 self,
581 encoder: &mut ___E,
582 out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
583 _: (),
584 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
585 ::fidl_next::Encode::encode(&self, encoder, out, ())
586 }
587 }
588
589 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Error, ___E> for &'a Error
590 where
591 ___E: ?Sized,
592 {
593 #[inline]
594 fn encode(
595 self,
596 encoder: &mut ___E,
597 out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
598 _: (),
599 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
600 ::fidl_next::munge!(let crate::wire::Error { value } = out);
601 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
602 Error::Invalid => 0,
603
604 Error::Unspecified => 1,
605
606 Error::ProtocolDeviation => 2,
607
608 Error::NotFound => 3,
609
610 Error::HandleAccessDenied => 4,
611
612 Error::NoMemory => 5,
613
614 Error::ConstraintsIntersectionEmpty => 6,
615
616 Error::Pending => 7,
617
618 Error::TooManyGroupChildCombinations => 8,
619
620 Error::UnknownOrdinal_(value) => value,
621 }));
622
623 Ok(())
624 }
625 }
626
627 impl ::core::convert::From<crate::wire::Error> for Error {
628 fn from(wire: crate::wire::Error) -> Self {
629 match u32::from(wire.value) {
630 0 => Self::Invalid,
631
632 1 => Self::Unspecified,
633
634 2 => Self::ProtocolDeviation,
635
636 3 => Self::NotFound,
637
638 4 => Self::HandleAccessDenied,
639
640 5 => Self::NoMemory,
641
642 6 => Self::ConstraintsIntersectionEmpty,
643
644 7 => Self::Pending,
645
646 8 => Self::TooManyGroupChildCombinations,
647
648 value => Self::UnknownOrdinal_(value),
649 }
650 }
651 }
652
653 impl ::fidl_next::FromWire<crate::wire::Error> for Error {
654 #[inline]
655 fn from_wire(wire: crate::wire::Error) -> Self {
656 Self::from(wire)
657 }
658 }
659
660 impl ::fidl_next::FromWireRef<crate::wire::Error> for Error {
661 #[inline]
662 fn from_wire_ref(wire: &crate::wire::Error) -> Self {
663 Self::from(*wire)
664 }
665 }
666
667 pub type NodeSyncResponse = ();
668
669 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
670 pub struct NodeSetNameRequest {
671 pub priority: ::core::option::Option<u32>,
672
673 pub name: ::core::option::Option<::std::string::String>,
674 }
675
676 impl NodeSetNameRequest {
677 fn __max_ordinal(&self) -> usize {
678 if self.name.is_some() {
679 return 2;
680 }
681
682 if self.priority.is_some() {
683 return 1;
684 }
685
686 0
687 }
688 }
689
690 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeSetNameRequest<'static>, ___E>
691 for NodeSetNameRequest
692 where
693 ___E: ::fidl_next::Encoder + ?Sized,
694 {
695 #[inline]
696 fn encode(
697 mut self,
698 encoder: &mut ___E,
699 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetNameRequest<'static>>,
700 _: (),
701 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
702 ::fidl_next::munge!(let crate::wire::NodeSetNameRequest { table } = out);
703
704 let max_ord = self.__max_ordinal();
705
706 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
707 ::fidl_next::Wire::zero_padding(&mut out);
708
709 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
710 ::fidl_next::wire::Envelope,
711 >(encoder, max_ord);
712
713 for i in 1..=max_ord {
714 match i {
715 2 => {
716 if let Some(value) = self.name.take() {
717 ::fidl_next::wire::Envelope::encode_value::<
718 ::fidl_next::wire::String<'static>,
719 ___E,
720 >(
721 value, preallocated.encoder, &mut out, 64
722 )?;
723 } else {
724 ::fidl_next::wire::Envelope::encode_zero(&mut out)
725 }
726 }
727
728 1 => {
729 if let Some(value) = self.priority.take() {
730 ::fidl_next::wire::Envelope::encode_value::<
731 ::fidl_next::wire::Uint32,
732 ___E,
733 >(
734 value, preallocated.encoder, &mut out, ()
735 )?;
736 } else {
737 ::fidl_next::wire::Envelope::encode_zero(&mut out)
738 }
739 }
740
741 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
742 }
743 unsafe {
744 preallocated.write_next(out.assume_init_ref());
745 }
746 }
747
748 ::fidl_next::wire::Table::encode_len(table, max_ord);
749
750 Ok(())
751 }
752 }
753
754 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeSetNameRequest<'static>, ___E>
755 for &'a NodeSetNameRequest
756 where
757 ___E: ::fidl_next::Encoder + ?Sized,
758 {
759 #[inline]
760 fn encode(
761 self,
762 encoder: &mut ___E,
763 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetNameRequest<'static>>,
764 _: (),
765 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
766 ::fidl_next::munge!(let crate::wire::NodeSetNameRequest { table } = out);
767
768 let max_ord = self.__max_ordinal();
769
770 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
771 ::fidl_next::Wire::zero_padding(&mut out);
772
773 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
774 ::fidl_next::wire::Envelope,
775 >(encoder, max_ord);
776
777 for i in 1..=max_ord {
778 match i {
779 2 => {
780 if let Some(value) = &self.name {
781 ::fidl_next::wire::Envelope::encode_value::<
782 ::fidl_next::wire::String<'static>,
783 ___E,
784 >(
785 value, preallocated.encoder, &mut out, 64
786 )?;
787 } else {
788 ::fidl_next::wire::Envelope::encode_zero(&mut out)
789 }
790 }
791
792 1 => {
793 if let Some(value) = &self.priority {
794 ::fidl_next::wire::Envelope::encode_value::<
795 ::fidl_next::wire::Uint32,
796 ___E,
797 >(
798 value, preallocated.encoder, &mut out, ()
799 )?;
800 } else {
801 ::fidl_next::wire::Envelope::encode_zero(&mut out)
802 }
803 }
804
805 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
806 }
807 unsafe {
808 preallocated.write_next(out.assume_init_ref());
809 }
810 }
811
812 ::fidl_next::wire::Table::encode_len(table, max_ord);
813
814 Ok(())
815 }
816 }
817
818 impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetNameRequest<'de>> for NodeSetNameRequest {
819 #[inline]
820 fn from_wire(wire_: crate::wire::NodeSetNameRequest<'de>) -> Self {
821 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
822
823 let priority = wire_.table.get(1);
824
825 let name = wire_.table.get(2);
826
827 Self {
828 priority: priority.map(|envelope| {
829 ::fidl_next::FromWire::from_wire(unsafe {
830 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
831 })
832 }),
833
834 name: name.map(|envelope| {
835 ::fidl_next::FromWire::from_wire(unsafe {
836 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
837 })
838 }),
839 }
840 }
841 }
842
843 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetNameRequest<'de>> for NodeSetNameRequest {
844 #[inline]
845 fn from_wire_ref(wire: &crate::wire::NodeSetNameRequest<'de>) -> Self {
846 Self {
847 priority: wire.table.get(1).map(|envelope| {
848 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
849 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
850 })
851 }),
852
853 name: wire.table.get(2).map(|envelope| {
854 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
855 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
856 })
857 }),
858 }
859 }
860 }
861
862 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
863 pub struct NodeSetDebugClientInfoRequest {
864 pub name: ::core::option::Option<::std::string::String>,
865
866 pub id: ::core::option::Option<u64>,
867 }
868
869 impl NodeSetDebugClientInfoRequest {
870 fn __max_ordinal(&self) -> usize {
871 if self.id.is_some() {
872 return 2;
873 }
874
875 if self.name.is_some() {
876 return 1;
877 }
878
879 0
880 }
881 }
882
883 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeSetDebugClientInfoRequest<'static>, ___E>
884 for NodeSetDebugClientInfoRequest
885 where
886 ___E: ::fidl_next::Encoder + ?Sized,
887 {
888 #[inline]
889 fn encode(
890 mut self,
891 encoder: &mut ___E,
892 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetDebugClientInfoRequest<'static>>,
893 _: (),
894 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
895 ::fidl_next::munge!(let crate::wire::NodeSetDebugClientInfoRequest { table } = out);
896
897 let max_ord = self.__max_ordinal();
898
899 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
900 ::fidl_next::Wire::zero_padding(&mut out);
901
902 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
903 ::fidl_next::wire::Envelope,
904 >(encoder, max_ord);
905
906 for i in 1..=max_ord {
907 match i {
908 2 => {
909 if let Some(value) = self.id.take() {
910 ::fidl_next::wire::Envelope::encode_value::<
911 ::fidl_next::wire::Uint64,
912 ___E,
913 >(
914 value, preallocated.encoder, &mut out, ()
915 )?;
916 } else {
917 ::fidl_next::wire::Envelope::encode_zero(&mut out)
918 }
919 }
920
921 1 => {
922 if let Some(value) = self.name.take() {
923 ::fidl_next::wire::Envelope::encode_value::<
924 ::fidl_next::wire::String<'static>,
925 ___E,
926 >(
927 value, preallocated.encoder, &mut out, 256
928 )?;
929 } else {
930 ::fidl_next::wire::Envelope::encode_zero(&mut out)
931 }
932 }
933
934 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
935 }
936 unsafe {
937 preallocated.write_next(out.assume_init_ref());
938 }
939 }
940
941 ::fidl_next::wire::Table::encode_len(table, max_ord);
942
943 Ok(())
944 }
945 }
946
947 unsafe impl<'a, ___E>
948 ::fidl_next::Encode<crate::wire::NodeSetDebugClientInfoRequest<'static>, ___E>
949 for &'a NodeSetDebugClientInfoRequest
950 where
951 ___E: ::fidl_next::Encoder + ?Sized,
952 {
953 #[inline]
954 fn encode(
955 self,
956 encoder: &mut ___E,
957 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetDebugClientInfoRequest<'static>>,
958 _: (),
959 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
960 ::fidl_next::munge!(let crate::wire::NodeSetDebugClientInfoRequest { table } = out);
961
962 let max_ord = self.__max_ordinal();
963
964 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
965 ::fidl_next::Wire::zero_padding(&mut out);
966
967 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
968 ::fidl_next::wire::Envelope,
969 >(encoder, max_ord);
970
971 for i in 1..=max_ord {
972 match i {
973 2 => {
974 if let Some(value) = &self.id {
975 ::fidl_next::wire::Envelope::encode_value::<
976 ::fidl_next::wire::Uint64,
977 ___E,
978 >(
979 value, preallocated.encoder, &mut out, ()
980 )?;
981 } else {
982 ::fidl_next::wire::Envelope::encode_zero(&mut out)
983 }
984 }
985
986 1 => {
987 if let Some(value) = &self.name {
988 ::fidl_next::wire::Envelope::encode_value::<
989 ::fidl_next::wire::String<'static>,
990 ___E,
991 >(
992 value, preallocated.encoder, &mut out, 256
993 )?;
994 } else {
995 ::fidl_next::wire::Envelope::encode_zero(&mut out)
996 }
997 }
998
999 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1000 }
1001 unsafe {
1002 preallocated.write_next(out.assume_init_ref());
1003 }
1004 }
1005
1006 ::fidl_next::wire::Table::encode_len(table, max_ord);
1007
1008 Ok(())
1009 }
1010 }
1011
1012 impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetDebugClientInfoRequest<'de>>
1013 for NodeSetDebugClientInfoRequest
1014 {
1015 #[inline]
1016 fn from_wire(wire_: crate::wire::NodeSetDebugClientInfoRequest<'de>) -> Self {
1017 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1018
1019 let name = wire_.table.get(1);
1020
1021 let id = wire_.table.get(2);
1022
1023 Self {
1024 name: name.map(|envelope| {
1025 ::fidl_next::FromWire::from_wire(unsafe {
1026 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1027 })
1028 }),
1029
1030 id: id.map(|envelope| {
1031 ::fidl_next::FromWire::from_wire(unsafe {
1032 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
1033 })
1034 }),
1035 }
1036 }
1037 }
1038
1039 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetDebugClientInfoRequest<'de>>
1040 for NodeSetDebugClientInfoRequest
1041 {
1042 #[inline]
1043 fn from_wire_ref(wire: &crate::wire::NodeSetDebugClientInfoRequest<'de>) -> Self {
1044 Self {
1045 name: wire.table.get(1).map(|envelope| {
1046 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1047 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1048 })
1049 }),
1050
1051 id: wire.table.get(2).map(|envelope| {
1052 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1053 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
1054 })
1055 }),
1056 }
1057 }
1058 }
1059
1060 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1061 pub struct NodeSetDebugTimeoutLogDeadlineRequest {
1062 pub deadline: ::core::option::Option<i64>,
1063 }
1064
1065 impl NodeSetDebugTimeoutLogDeadlineRequest {
1066 fn __max_ordinal(&self) -> usize {
1067 if self.deadline.is_some() {
1068 return 1;
1069 }
1070
1071 0
1072 }
1073 }
1074
1075 unsafe impl<___E>
1076 ::fidl_next::Encode<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>, ___E>
1077 for NodeSetDebugTimeoutLogDeadlineRequest
1078 where
1079 ___E: ::fidl_next::Encoder + ?Sized,
1080 {
1081 #[inline]
1082 fn encode(
1083 mut self,
1084 encoder: &mut ___E,
1085 out: &mut ::core::mem::MaybeUninit<
1086 crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>,
1087 >,
1088 _: (),
1089 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1090 ::fidl_next::munge!(let crate::wire::NodeSetDebugTimeoutLogDeadlineRequest { table } = out);
1091
1092 let max_ord = self.__max_ordinal();
1093
1094 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1095 ::fidl_next::Wire::zero_padding(&mut out);
1096
1097 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1098 ::fidl_next::wire::Envelope,
1099 >(encoder, max_ord);
1100
1101 for i in 1..=max_ord {
1102 match i {
1103 1 => {
1104 if let Some(value) = self.deadline.take() {
1105 ::fidl_next::wire::Envelope::encode_value::<
1106 ::fidl_next::wire::Int64,
1107 ___E,
1108 >(
1109 value, preallocated.encoder, &mut out, ()
1110 )?;
1111 } else {
1112 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1113 }
1114 }
1115
1116 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1117 }
1118 unsafe {
1119 preallocated.write_next(out.assume_init_ref());
1120 }
1121 }
1122
1123 ::fidl_next::wire::Table::encode_len(table, max_ord);
1124
1125 Ok(())
1126 }
1127 }
1128
1129 unsafe impl<'a, ___E>
1130 ::fidl_next::Encode<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>, ___E>
1131 for &'a NodeSetDebugTimeoutLogDeadlineRequest
1132 where
1133 ___E: ::fidl_next::Encoder + ?Sized,
1134 {
1135 #[inline]
1136 fn encode(
1137 self,
1138 encoder: &mut ___E,
1139 out: &mut ::core::mem::MaybeUninit<
1140 crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'static>,
1141 >,
1142 _: (),
1143 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1144 ::fidl_next::munge!(let crate::wire::NodeSetDebugTimeoutLogDeadlineRequest { table } = out);
1145
1146 let max_ord = self.__max_ordinal();
1147
1148 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1149 ::fidl_next::Wire::zero_padding(&mut out);
1150
1151 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1152 ::fidl_next::wire::Envelope,
1153 >(encoder, max_ord);
1154
1155 for i in 1..=max_ord {
1156 match i {
1157 1 => {
1158 if let Some(value) = &self.deadline {
1159 ::fidl_next::wire::Envelope::encode_value::<
1160 ::fidl_next::wire::Int64,
1161 ___E,
1162 >(
1163 value, preallocated.encoder, &mut out, ()
1164 )?;
1165 } else {
1166 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1167 }
1168 }
1169
1170 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1171 }
1172 unsafe {
1173 preallocated.write_next(out.assume_init_ref());
1174 }
1175 }
1176
1177 ::fidl_next::wire::Table::encode_len(table, max_ord);
1178
1179 Ok(())
1180 }
1181 }
1182
1183 impl<'de> ::fidl_next::FromWire<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>>
1184 for NodeSetDebugTimeoutLogDeadlineRequest
1185 {
1186 #[inline]
1187 fn from_wire(wire_: crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>) -> Self {
1188 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1189
1190 let deadline = wire_.table.get(1);
1191
1192 Self {
1193 deadline: deadline.map(|envelope| {
1194 ::fidl_next::FromWire::from_wire(unsafe {
1195 envelope.read_unchecked::<::fidl_next::wire::Int64>()
1196 })
1197 }),
1198 }
1199 }
1200 }
1201
1202 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>>
1203 for NodeSetDebugTimeoutLogDeadlineRequest
1204 {
1205 #[inline]
1206 fn from_wire_ref(wire: &crate::wire::NodeSetDebugTimeoutLogDeadlineRequest<'de>) -> Self {
1207 Self {
1208 deadline: wire.table.get(1).map(|envelope| {
1209 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1210 envelope.deref_unchecked::<::fidl_next::wire::Int64>()
1211 })
1212 }),
1213 }
1214 }
1215 }
1216
1217 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1218 pub struct NodeIsAlternateForResponse {
1219 pub is_alternate: ::core::option::Option<bool>,
1220 }
1221
1222 impl NodeIsAlternateForResponse {
1223 fn __max_ordinal(&self) -> usize {
1224 if self.is_alternate.is_some() {
1225 return 1;
1226 }
1227
1228 0
1229 }
1230 }
1231
1232 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeIsAlternateForResponse<'static>, ___E>
1233 for NodeIsAlternateForResponse
1234 where
1235 ___E: ::fidl_next::Encoder + ?Sized,
1236 {
1237 #[inline]
1238 fn encode(
1239 mut self,
1240 encoder: &mut ___E,
1241 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeIsAlternateForResponse<'static>>,
1242 _: (),
1243 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1244 ::fidl_next::munge!(let crate::wire::NodeIsAlternateForResponse { table } = out);
1245
1246 let max_ord = self.__max_ordinal();
1247
1248 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1249 ::fidl_next::Wire::zero_padding(&mut out);
1250
1251 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1252 ::fidl_next::wire::Envelope,
1253 >(encoder, max_ord);
1254
1255 for i in 1..=max_ord {
1256 match i {
1257 1 => {
1258 if let Some(value) = self.is_alternate.take() {
1259 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1260 value,
1261 preallocated.encoder,
1262 &mut out,
1263 (),
1264 )?;
1265 } else {
1266 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1267 }
1268 }
1269
1270 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1271 }
1272 unsafe {
1273 preallocated.write_next(out.assume_init_ref());
1274 }
1275 }
1276
1277 ::fidl_next::wire::Table::encode_len(table, max_ord);
1278
1279 Ok(())
1280 }
1281 }
1282
1283 unsafe impl<'a, ___E>
1284 ::fidl_next::Encode<crate::wire::NodeIsAlternateForResponse<'static>, ___E>
1285 for &'a NodeIsAlternateForResponse
1286 where
1287 ___E: ::fidl_next::Encoder + ?Sized,
1288 {
1289 #[inline]
1290 fn encode(
1291 self,
1292 encoder: &mut ___E,
1293 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeIsAlternateForResponse<'static>>,
1294 _: (),
1295 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1296 ::fidl_next::munge!(let crate::wire::NodeIsAlternateForResponse { table } = out);
1297
1298 let max_ord = self.__max_ordinal();
1299
1300 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1301 ::fidl_next::Wire::zero_padding(&mut out);
1302
1303 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1304 ::fidl_next::wire::Envelope,
1305 >(encoder, max_ord);
1306
1307 for i in 1..=max_ord {
1308 match i {
1309 1 => {
1310 if let Some(value) = &self.is_alternate {
1311 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
1312 value,
1313 preallocated.encoder,
1314 &mut out,
1315 (),
1316 )?;
1317 } else {
1318 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1319 }
1320 }
1321
1322 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1323 }
1324 unsafe {
1325 preallocated.write_next(out.assume_init_ref());
1326 }
1327 }
1328
1329 ::fidl_next::wire::Table::encode_len(table, max_ord);
1330
1331 Ok(())
1332 }
1333 }
1334
1335 impl<'de> ::fidl_next::FromWire<crate::wire::NodeIsAlternateForResponse<'de>>
1336 for NodeIsAlternateForResponse
1337 {
1338 #[inline]
1339 fn from_wire(wire_: crate::wire::NodeIsAlternateForResponse<'de>) -> Self {
1340 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1341
1342 let is_alternate = wire_.table.get(1);
1343
1344 Self {
1345 is_alternate: is_alternate.map(|envelope| {
1346 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
1347 }),
1348 }
1349 }
1350 }
1351
1352 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeIsAlternateForResponse<'de>>
1353 for NodeIsAlternateForResponse
1354 {
1355 #[inline]
1356 fn from_wire_ref(wire: &crate::wire::NodeIsAlternateForResponse<'de>) -> Self {
1357 Self {
1358 is_alternate: wire.table.get(1).map(|envelope| {
1359 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1360 envelope.deref_unchecked::<bool>()
1361 })
1362 }),
1363 }
1364 }
1365 }
1366
1367 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1368 pub struct NodeGetBufferCollectionIdResponse {
1369 pub buffer_collection_id: ::core::option::Option<u64>,
1370 }
1371
1372 impl NodeGetBufferCollectionIdResponse {
1373 fn __max_ordinal(&self) -> usize {
1374 if self.buffer_collection_id.is_some() {
1375 return 1;
1376 }
1377
1378 0
1379 }
1380 }
1381
1382 unsafe impl<___E>
1383 ::fidl_next::Encode<crate::wire::NodeGetBufferCollectionIdResponse<'static>, ___E>
1384 for NodeGetBufferCollectionIdResponse
1385 where
1386 ___E: ::fidl_next::Encoder + ?Sized,
1387 {
1388 #[inline]
1389 fn encode(
1390 mut self,
1391 encoder: &mut ___E,
1392 out: &mut ::core::mem::MaybeUninit<
1393 crate::wire::NodeGetBufferCollectionIdResponse<'static>,
1394 >,
1395 _: (),
1396 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1397 ::fidl_next::munge!(let crate::wire::NodeGetBufferCollectionIdResponse { table } = out);
1398
1399 let max_ord = self.__max_ordinal();
1400
1401 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1402 ::fidl_next::Wire::zero_padding(&mut out);
1403
1404 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1405 ::fidl_next::wire::Envelope,
1406 >(encoder, max_ord);
1407
1408 for i in 1..=max_ord {
1409 match i {
1410 1 => {
1411 if let Some(value) = self.buffer_collection_id.take() {
1412 ::fidl_next::wire::Envelope::encode_value::<
1413 ::fidl_next::wire::Uint64,
1414 ___E,
1415 >(
1416 value, preallocated.encoder, &mut out, ()
1417 )?;
1418 } else {
1419 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1420 }
1421 }
1422
1423 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1424 }
1425 unsafe {
1426 preallocated.write_next(out.assume_init_ref());
1427 }
1428 }
1429
1430 ::fidl_next::wire::Table::encode_len(table, max_ord);
1431
1432 Ok(())
1433 }
1434 }
1435
1436 unsafe impl<'a, ___E>
1437 ::fidl_next::Encode<crate::wire::NodeGetBufferCollectionIdResponse<'static>, ___E>
1438 for &'a NodeGetBufferCollectionIdResponse
1439 where
1440 ___E: ::fidl_next::Encoder + ?Sized,
1441 {
1442 #[inline]
1443 fn encode(
1444 self,
1445 encoder: &mut ___E,
1446 out: &mut ::core::mem::MaybeUninit<
1447 crate::wire::NodeGetBufferCollectionIdResponse<'static>,
1448 >,
1449 _: (),
1450 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1451 ::fidl_next::munge!(let crate::wire::NodeGetBufferCollectionIdResponse { table } = out);
1452
1453 let max_ord = self.__max_ordinal();
1454
1455 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1456 ::fidl_next::Wire::zero_padding(&mut out);
1457
1458 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1459 ::fidl_next::wire::Envelope,
1460 >(encoder, max_ord);
1461
1462 for i in 1..=max_ord {
1463 match i {
1464 1 => {
1465 if let Some(value) = &self.buffer_collection_id {
1466 ::fidl_next::wire::Envelope::encode_value::<
1467 ::fidl_next::wire::Uint64,
1468 ___E,
1469 >(
1470 value, preallocated.encoder, &mut out, ()
1471 )?;
1472 } else {
1473 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1474 }
1475 }
1476
1477 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1478 }
1479 unsafe {
1480 preallocated.write_next(out.assume_init_ref());
1481 }
1482 }
1483
1484 ::fidl_next::wire::Table::encode_len(table, max_ord);
1485
1486 Ok(())
1487 }
1488 }
1489
1490 impl<'de> ::fidl_next::FromWire<crate::wire::NodeGetBufferCollectionIdResponse<'de>>
1491 for NodeGetBufferCollectionIdResponse
1492 {
1493 #[inline]
1494 fn from_wire(wire_: crate::wire::NodeGetBufferCollectionIdResponse<'de>) -> Self {
1495 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1496
1497 let buffer_collection_id = wire_.table.get(1);
1498
1499 Self {
1500 buffer_collection_id: buffer_collection_id.map(|envelope| {
1501 ::fidl_next::FromWire::from_wire(unsafe {
1502 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
1503 })
1504 }),
1505 }
1506 }
1507 }
1508
1509 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeGetBufferCollectionIdResponse<'de>>
1510 for NodeGetBufferCollectionIdResponse
1511 {
1512 #[inline]
1513 fn from_wire_ref(wire: &crate::wire::NodeGetBufferCollectionIdResponse<'de>) -> Self {
1514 Self {
1515 buffer_collection_id: wire.table.get(1).map(|envelope| {
1516 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1517 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
1518 })
1519 }),
1520 }
1521 }
1522 }
1523
1524 #[doc = " Describes how a client will access the contents of a buffer.\n"]
1525 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1526 pub struct BufferUsage {
1527 pub none: ::core::option::Option<u32>,
1528
1529 pub cpu: ::core::option::Option<u32>,
1530
1531 pub vulkan: ::core::option::Option<u32>,
1532
1533 pub display: ::core::option::Option<u32>,
1534
1535 pub video: ::core::option::Option<u32>,
1536 }
1537
1538 impl BufferUsage {
1539 fn __max_ordinal(&self) -> usize {
1540 if self.video.is_some() {
1541 return 5;
1542 }
1543
1544 if self.display.is_some() {
1545 return 4;
1546 }
1547
1548 if self.vulkan.is_some() {
1549 return 3;
1550 }
1551
1552 if self.cpu.is_some() {
1553 return 2;
1554 }
1555
1556 if self.none.is_some() {
1557 return 1;
1558 }
1559
1560 0
1561 }
1562 }
1563
1564 unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferUsage<'static>, ___E> for BufferUsage
1565 where
1566 ___E: ::fidl_next::Encoder + ?Sized,
1567 {
1568 #[inline]
1569 fn encode(
1570 mut self,
1571 encoder: &mut ___E,
1572 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferUsage<'static>>,
1573 _: (),
1574 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1575 ::fidl_next::munge!(let crate::wire::BufferUsage { table } = out);
1576
1577 let max_ord = self.__max_ordinal();
1578
1579 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1580 ::fidl_next::Wire::zero_padding(&mut out);
1581
1582 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1583 ::fidl_next::wire::Envelope,
1584 >(encoder, max_ord);
1585
1586 for i in 1..=max_ord {
1587 match i {
1588 5 => {
1589 if let Some(value) = self.video.take() {
1590 ::fidl_next::wire::Envelope::encode_value::<
1591 ::fidl_next::wire::Uint32,
1592 ___E,
1593 >(
1594 value, preallocated.encoder, &mut out, ()
1595 )?;
1596 } else {
1597 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1598 }
1599 }
1600
1601 4 => {
1602 if let Some(value) = self.display.take() {
1603 ::fidl_next::wire::Envelope::encode_value::<
1604 ::fidl_next::wire::Uint32,
1605 ___E,
1606 >(
1607 value, preallocated.encoder, &mut out, ()
1608 )?;
1609 } else {
1610 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1611 }
1612 }
1613
1614 3 => {
1615 if let Some(value) = self.vulkan.take() {
1616 ::fidl_next::wire::Envelope::encode_value::<
1617 ::fidl_next::wire::Uint32,
1618 ___E,
1619 >(
1620 value, preallocated.encoder, &mut out, ()
1621 )?;
1622 } else {
1623 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1624 }
1625 }
1626
1627 2 => {
1628 if let Some(value) = self.cpu.take() {
1629 ::fidl_next::wire::Envelope::encode_value::<
1630 ::fidl_next::wire::Uint32,
1631 ___E,
1632 >(
1633 value, preallocated.encoder, &mut out, ()
1634 )?;
1635 } else {
1636 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1637 }
1638 }
1639
1640 1 => {
1641 if let Some(value) = self.none.take() {
1642 ::fidl_next::wire::Envelope::encode_value::<
1643 ::fidl_next::wire::Uint32,
1644 ___E,
1645 >(
1646 value, preallocated.encoder, &mut out, ()
1647 )?;
1648 } else {
1649 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1650 }
1651 }
1652
1653 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1654 }
1655 unsafe {
1656 preallocated.write_next(out.assume_init_ref());
1657 }
1658 }
1659
1660 ::fidl_next::wire::Table::encode_len(table, max_ord);
1661
1662 Ok(())
1663 }
1664 }
1665
1666 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BufferUsage<'static>, ___E>
1667 for &'a BufferUsage
1668 where
1669 ___E: ::fidl_next::Encoder + ?Sized,
1670 {
1671 #[inline]
1672 fn encode(
1673 self,
1674 encoder: &mut ___E,
1675 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferUsage<'static>>,
1676 _: (),
1677 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1678 ::fidl_next::munge!(let crate::wire::BufferUsage { table } = out);
1679
1680 let max_ord = self.__max_ordinal();
1681
1682 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1683 ::fidl_next::Wire::zero_padding(&mut out);
1684
1685 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1686 ::fidl_next::wire::Envelope,
1687 >(encoder, max_ord);
1688
1689 for i in 1..=max_ord {
1690 match i {
1691 5 => {
1692 if let Some(value) = &self.video {
1693 ::fidl_next::wire::Envelope::encode_value::<
1694 ::fidl_next::wire::Uint32,
1695 ___E,
1696 >(
1697 value, preallocated.encoder, &mut out, ()
1698 )?;
1699 } else {
1700 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1701 }
1702 }
1703
1704 4 => {
1705 if let Some(value) = &self.display {
1706 ::fidl_next::wire::Envelope::encode_value::<
1707 ::fidl_next::wire::Uint32,
1708 ___E,
1709 >(
1710 value, preallocated.encoder, &mut out, ()
1711 )?;
1712 } else {
1713 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1714 }
1715 }
1716
1717 3 => {
1718 if let Some(value) = &self.vulkan {
1719 ::fidl_next::wire::Envelope::encode_value::<
1720 ::fidl_next::wire::Uint32,
1721 ___E,
1722 >(
1723 value, preallocated.encoder, &mut out, ()
1724 )?;
1725 } else {
1726 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1727 }
1728 }
1729
1730 2 => {
1731 if let Some(value) = &self.cpu {
1732 ::fidl_next::wire::Envelope::encode_value::<
1733 ::fidl_next::wire::Uint32,
1734 ___E,
1735 >(
1736 value, preallocated.encoder, &mut out, ()
1737 )?;
1738 } else {
1739 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1740 }
1741 }
1742
1743 1 => {
1744 if let Some(value) = &self.none {
1745 ::fidl_next::wire::Envelope::encode_value::<
1746 ::fidl_next::wire::Uint32,
1747 ___E,
1748 >(
1749 value, preallocated.encoder, &mut out, ()
1750 )?;
1751 } else {
1752 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1753 }
1754 }
1755
1756 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1757 }
1758 unsafe {
1759 preallocated.write_next(out.assume_init_ref());
1760 }
1761 }
1762
1763 ::fidl_next::wire::Table::encode_len(table, max_ord);
1764
1765 Ok(())
1766 }
1767 }
1768
1769 impl<'de> ::fidl_next::FromWire<crate::wire::BufferUsage<'de>> for BufferUsage {
1770 #[inline]
1771 fn from_wire(wire_: crate::wire::BufferUsage<'de>) -> Self {
1772 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1773
1774 let none = wire_.table.get(1);
1775
1776 let cpu = wire_.table.get(2);
1777
1778 let vulkan = wire_.table.get(3);
1779
1780 let display = wire_.table.get(4);
1781
1782 let video = wire_.table.get(5);
1783
1784 Self {
1785 none: none.map(|envelope| {
1786 ::fidl_next::FromWire::from_wire(unsafe {
1787 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1788 })
1789 }),
1790
1791 cpu: cpu.map(|envelope| {
1792 ::fidl_next::FromWire::from_wire(unsafe {
1793 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1794 })
1795 }),
1796
1797 vulkan: vulkan.map(|envelope| {
1798 ::fidl_next::FromWire::from_wire(unsafe {
1799 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1800 })
1801 }),
1802
1803 display: display.map(|envelope| {
1804 ::fidl_next::FromWire::from_wire(unsafe {
1805 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1806 })
1807 }),
1808
1809 video: video.map(|envelope| {
1810 ::fidl_next::FromWire::from_wire(unsafe {
1811 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1812 })
1813 }),
1814 }
1815 }
1816 }
1817
1818 impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferUsage<'de>> for BufferUsage {
1819 #[inline]
1820 fn from_wire_ref(wire: &crate::wire::BufferUsage<'de>) -> Self {
1821 Self {
1822 none: wire.table.get(1).map(|envelope| {
1823 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1824 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1825 })
1826 }),
1827
1828 cpu: wire.table.get(2).map(|envelope| {
1829 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1830 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1831 })
1832 }),
1833
1834 vulkan: wire.table.get(3).map(|envelope| {
1835 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1836 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1837 })
1838 }),
1839
1840 display: wire.table.get(4).map(|envelope| {
1841 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1842 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1843 })
1844 }),
1845
1846 video: wire.table.get(5).map(|envelope| {
1847 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1848 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1849 })
1850 }),
1851 }
1852 }
1853 }
1854
1855 #[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"]
1856 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1857 pub struct Heap {
1858 pub heap_type: ::core::option::Option<::std::string::String>,
1859
1860 pub id: ::core::option::Option<u64>,
1861 }
1862
1863 impl Heap {
1864 fn __max_ordinal(&self) -> usize {
1865 if self.id.is_some() {
1866 return 2;
1867 }
1868
1869 if self.heap_type.is_some() {
1870 return 1;
1871 }
1872
1873 0
1874 }
1875 }
1876
1877 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Heap<'static>, ___E> for Heap
1878 where
1879 ___E: ::fidl_next::Encoder + ?Sized,
1880 {
1881 #[inline]
1882 fn encode(
1883 mut self,
1884 encoder: &mut ___E,
1885 out: &mut ::core::mem::MaybeUninit<crate::wire::Heap<'static>>,
1886 _: (),
1887 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1888 ::fidl_next::munge!(let crate::wire::Heap { table } = out);
1889
1890 let max_ord = self.__max_ordinal();
1891
1892 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1893 ::fidl_next::Wire::zero_padding(&mut out);
1894
1895 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1896 ::fidl_next::wire::Envelope,
1897 >(encoder, max_ord);
1898
1899 for i in 1..=max_ord {
1900 match i {
1901 2 => {
1902 if let Some(value) = self.id.take() {
1903 ::fidl_next::wire::Envelope::encode_value::<
1904 ::fidl_next::wire::Uint64,
1905 ___E,
1906 >(
1907 value, preallocated.encoder, &mut out, ()
1908 )?;
1909 } else {
1910 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1911 }
1912 }
1913
1914 1 => {
1915 if let Some(value) = self.heap_type.take() {
1916 ::fidl_next::wire::Envelope::encode_value::<
1917 ::fidl_next::wire::String<'static>,
1918 ___E,
1919 >(
1920 value, preallocated.encoder, &mut out, 128
1921 )?;
1922 } else {
1923 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1924 }
1925 }
1926
1927 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1928 }
1929 unsafe {
1930 preallocated.write_next(out.assume_init_ref());
1931 }
1932 }
1933
1934 ::fidl_next::wire::Table::encode_len(table, max_ord);
1935
1936 Ok(())
1937 }
1938 }
1939
1940 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Heap<'static>, ___E> for &'a Heap
1941 where
1942 ___E: ::fidl_next::Encoder + ?Sized,
1943 {
1944 #[inline]
1945 fn encode(
1946 self,
1947 encoder: &mut ___E,
1948 out: &mut ::core::mem::MaybeUninit<crate::wire::Heap<'static>>,
1949 _: (),
1950 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1951 ::fidl_next::munge!(let crate::wire::Heap { table } = out);
1952
1953 let max_ord = self.__max_ordinal();
1954
1955 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1956 ::fidl_next::Wire::zero_padding(&mut out);
1957
1958 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1959 ::fidl_next::wire::Envelope,
1960 >(encoder, max_ord);
1961
1962 for i in 1..=max_ord {
1963 match i {
1964 2 => {
1965 if let Some(value) = &self.id {
1966 ::fidl_next::wire::Envelope::encode_value::<
1967 ::fidl_next::wire::Uint64,
1968 ___E,
1969 >(
1970 value, preallocated.encoder, &mut out, ()
1971 )?;
1972 } else {
1973 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1974 }
1975 }
1976
1977 1 => {
1978 if let Some(value) = &self.heap_type {
1979 ::fidl_next::wire::Envelope::encode_value::<
1980 ::fidl_next::wire::String<'static>,
1981 ___E,
1982 >(
1983 value, preallocated.encoder, &mut out, 128
1984 )?;
1985 } else {
1986 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1987 }
1988 }
1989
1990 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1991 }
1992 unsafe {
1993 preallocated.write_next(out.assume_init_ref());
1994 }
1995 }
1996
1997 ::fidl_next::wire::Table::encode_len(table, max_ord);
1998
1999 Ok(())
2000 }
2001 }
2002
2003 impl<'de> ::fidl_next::FromWire<crate::wire::Heap<'de>> for Heap {
2004 #[inline]
2005 fn from_wire(wire_: crate::wire::Heap<'de>) -> Self {
2006 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2007
2008 let heap_type = wire_.table.get(1);
2009
2010 let id = wire_.table.get(2);
2011
2012 Self {
2013 heap_type: heap_type.map(|envelope| {
2014 ::fidl_next::FromWire::from_wire(unsafe {
2015 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2016 })
2017 }),
2018
2019 id: id.map(|envelope| {
2020 ::fidl_next::FromWire::from_wire(unsafe {
2021 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
2022 })
2023 }),
2024 }
2025 }
2026 }
2027
2028 impl<'de> ::fidl_next::FromWireRef<crate::wire::Heap<'de>> for Heap {
2029 #[inline]
2030 fn from_wire_ref(wire: &crate::wire::Heap<'de>) -> Self {
2031 Self {
2032 heap_type: wire.table.get(1).map(|envelope| {
2033 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2034 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
2035 })
2036 }),
2037
2038 id: wire.table.get(2).map(|envelope| {
2039 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2040 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
2041 })
2042 }),
2043 }
2044 }
2045 }
2046
2047 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2048 pub struct BufferMemoryConstraints {
2049 pub min_size_bytes: ::core::option::Option<u64>,
2050
2051 pub max_size_bytes: ::core::option::Option<u64>,
2052
2053 pub physically_contiguous_required: ::core::option::Option<bool>,
2054
2055 pub secure_required: ::core::option::Option<bool>,
2056
2057 pub cpu_domain_supported: ::core::option::Option<bool>,
2058
2059 pub ram_domain_supported: ::core::option::Option<bool>,
2060
2061 pub inaccessible_domain_supported: ::core::option::Option<bool>,
2062
2063 pub permitted_heaps: ::core::option::Option<::std::vec::Vec<crate::natural::Heap>>,
2064 }
2065
2066 impl BufferMemoryConstraints {
2067 fn __max_ordinal(&self) -> usize {
2068 if self.permitted_heaps.is_some() {
2069 return 8;
2070 }
2071
2072 if self.inaccessible_domain_supported.is_some() {
2073 return 7;
2074 }
2075
2076 if self.ram_domain_supported.is_some() {
2077 return 6;
2078 }
2079
2080 if self.cpu_domain_supported.is_some() {
2081 return 5;
2082 }
2083
2084 if self.secure_required.is_some() {
2085 return 4;
2086 }
2087
2088 if self.physically_contiguous_required.is_some() {
2089 return 3;
2090 }
2091
2092 if self.max_size_bytes.is_some() {
2093 return 2;
2094 }
2095
2096 if self.min_size_bytes.is_some() {
2097 return 1;
2098 }
2099
2100 0
2101 }
2102 }
2103
2104 unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferMemoryConstraints<'static>, ___E>
2105 for BufferMemoryConstraints
2106 where
2107 ___E: ::fidl_next::Encoder + ?Sized,
2108 {
2109 #[inline]
2110 fn encode(
2111 mut self,
2112 encoder: &mut ___E,
2113 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemoryConstraints<'static>>,
2114 _: (),
2115 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2116 ::fidl_next::munge!(let crate::wire::BufferMemoryConstraints { table } = out);
2117
2118 let max_ord = self.__max_ordinal();
2119
2120 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2121 ::fidl_next::Wire::zero_padding(&mut out);
2122
2123 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2124 ::fidl_next::wire::Envelope,
2125 >(encoder, max_ord);
2126
2127 for i in 1..=max_ord {
2128 match i {
2129 8 => {
2130 if let Some(value) = self.permitted_heaps.take() {
2131 ::fidl_next::wire::Envelope::encode_value::<
2132 ::fidl_next::wire::Vector<'static, crate::wire::Heap<'static>>,
2133 ___E,
2134 >(
2135 value, preallocated.encoder, &mut out, (64, ())
2136 )?;
2137 } else {
2138 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2139 }
2140 }
2141
2142 7 => {
2143 if let Some(value) = self.inaccessible_domain_supported.take() {
2144 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2145 value,
2146 preallocated.encoder,
2147 &mut out,
2148 (),
2149 )?;
2150 } else {
2151 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2152 }
2153 }
2154
2155 6 => {
2156 if let Some(value) = self.ram_domain_supported.take() {
2157 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2158 value,
2159 preallocated.encoder,
2160 &mut out,
2161 (),
2162 )?;
2163 } else {
2164 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2165 }
2166 }
2167
2168 5 => {
2169 if let Some(value) = self.cpu_domain_supported.take() {
2170 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2171 value,
2172 preallocated.encoder,
2173 &mut out,
2174 (),
2175 )?;
2176 } else {
2177 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2178 }
2179 }
2180
2181 4 => {
2182 if let Some(value) = self.secure_required.take() {
2183 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2184 value,
2185 preallocated.encoder,
2186 &mut out,
2187 (),
2188 )?;
2189 } else {
2190 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2191 }
2192 }
2193
2194 3 => {
2195 if let Some(value) = self.physically_contiguous_required.take() {
2196 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2197 value,
2198 preallocated.encoder,
2199 &mut out,
2200 (),
2201 )?;
2202 } else {
2203 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2204 }
2205 }
2206
2207 2 => {
2208 if let Some(value) = self.max_size_bytes.take() {
2209 ::fidl_next::wire::Envelope::encode_value::<
2210 ::fidl_next::wire::Uint64,
2211 ___E,
2212 >(
2213 value, preallocated.encoder, &mut out, ()
2214 )?;
2215 } else {
2216 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2217 }
2218 }
2219
2220 1 => {
2221 if let Some(value) = self.min_size_bytes.take() {
2222 ::fidl_next::wire::Envelope::encode_value::<
2223 ::fidl_next::wire::Uint64,
2224 ___E,
2225 >(
2226 value, preallocated.encoder, &mut out, ()
2227 )?;
2228 } else {
2229 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2230 }
2231 }
2232
2233 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2234 }
2235 unsafe {
2236 preallocated.write_next(out.assume_init_ref());
2237 }
2238 }
2239
2240 ::fidl_next::wire::Table::encode_len(table, max_ord);
2241
2242 Ok(())
2243 }
2244 }
2245
2246 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BufferMemoryConstraints<'static>, ___E>
2247 for &'a BufferMemoryConstraints
2248 where
2249 ___E: ::fidl_next::Encoder + ?Sized,
2250 {
2251 #[inline]
2252 fn encode(
2253 self,
2254 encoder: &mut ___E,
2255 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemoryConstraints<'static>>,
2256 _: (),
2257 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2258 ::fidl_next::munge!(let crate::wire::BufferMemoryConstraints { table } = out);
2259
2260 let max_ord = self.__max_ordinal();
2261
2262 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2263 ::fidl_next::Wire::zero_padding(&mut out);
2264
2265 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2266 ::fidl_next::wire::Envelope,
2267 >(encoder, max_ord);
2268
2269 for i in 1..=max_ord {
2270 match i {
2271 8 => {
2272 if let Some(value) = &self.permitted_heaps {
2273 ::fidl_next::wire::Envelope::encode_value::<
2274 ::fidl_next::wire::Vector<'static, crate::wire::Heap<'static>>,
2275 ___E,
2276 >(
2277 value, preallocated.encoder, &mut out, (64, ())
2278 )?;
2279 } else {
2280 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2281 }
2282 }
2283
2284 7 => {
2285 if let Some(value) = &self.inaccessible_domain_supported {
2286 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2287 value,
2288 preallocated.encoder,
2289 &mut out,
2290 (),
2291 )?;
2292 } else {
2293 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2294 }
2295 }
2296
2297 6 => {
2298 if let Some(value) = &self.ram_domain_supported {
2299 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2300 value,
2301 preallocated.encoder,
2302 &mut out,
2303 (),
2304 )?;
2305 } else {
2306 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2307 }
2308 }
2309
2310 5 => {
2311 if let Some(value) = &self.cpu_domain_supported {
2312 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2313 value,
2314 preallocated.encoder,
2315 &mut out,
2316 (),
2317 )?;
2318 } else {
2319 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2320 }
2321 }
2322
2323 4 => {
2324 if let Some(value) = &self.secure_required {
2325 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2326 value,
2327 preallocated.encoder,
2328 &mut out,
2329 (),
2330 )?;
2331 } else {
2332 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2333 }
2334 }
2335
2336 3 => {
2337 if let Some(value) = &self.physically_contiguous_required {
2338 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2339 value,
2340 preallocated.encoder,
2341 &mut out,
2342 (),
2343 )?;
2344 } else {
2345 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2346 }
2347 }
2348
2349 2 => {
2350 if let Some(value) = &self.max_size_bytes {
2351 ::fidl_next::wire::Envelope::encode_value::<
2352 ::fidl_next::wire::Uint64,
2353 ___E,
2354 >(
2355 value, preallocated.encoder, &mut out, ()
2356 )?;
2357 } else {
2358 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2359 }
2360 }
2361
2362 1 => {
2363 if let Some(value) = &self.min_size_bytes {
2364 ::fidl_next::wire::Envelope::encode_value::<
2365 ::fidl_next::wire::Uint64,
2366 ___E,
2367 >(
2368 value, preallocated.encoder, &mut out, ()
2369 )?;
2370 } else {
2371 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2372 }
2373 }
2374
2375 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2376 }
2377 unsafe {
2378 preallocated.write_next(out.assume_init_ref());
2379 }
2380 }
2381
2382 ::fidl_next::wire::Table::encode_len(table, max_ord);
2383
2384 Ok(())
2385 }
2386 }
2387
2388 impl<'de> ::fidl_next::FromWire<crate::wire::BufferMemoryConstraints<'de>>
2389 for BufferMemoryConstraints
2390 {
2391 #[inline]
2392 fn from_wire(wire_: crate::wire::BufferMemoryConstraints<'de>) -> Self {
2393 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2394
2395 let min_size_bytes = wire_.table.get(1);
2396
2397 let max_size_bytes = wire_.table.get(2);
2398
2399 let physically_contiguous_required = wire_.table.get(3);
2400
2401 let secure_required = wire_.table.get(4);
2402
2403 let cpu_domain_supported = wire_.table.get(5);
2404
2405 let ram_domain_supported = wire_.table.get(6);
2406
2407 let inaccessible_domain_supported = wire_.table.get(7);
2408
2409 let permitted_heaps = wire_.table.get(8);
2410
2411 Self {
2412
2413
2414 min_size_bytes: min_size_bytes.map(|envelope| ::fidl_next::FromWire::from_wire(
2415 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
2416 )),
2417
2418
2419 max_size_bytes: max_size_bytes.map(|envelope| ::fidl_next::FromWire::from_wire(
2420 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
2421 )),
2422
2423
2424 physically_contiguous_required: physically_contiguous_required.map(|envelope| ::fidl_next::FromWire::from_wire(
2425 unsafe { envelope.read_unchecked::<bool>() }
2426 )),
2427
2428
2429 secure_required: secure_required.map(|envelope| ::fidl_next::FromWire::from_wire(
2430 unsafe { envelope.read_unchecked::<bool>() }
2431 )),
2432
2433
2434 cpu_domain_supported: cpu_domain_supported.map(|envelope| ::fidl_next::FromWire::from_wire(
2435 unsafe { envelope.read_unchecked::<bool>() }
2436 )),
2437
2438
2439 ram_domain_supported: ram_domain_supported.map(|envelope| ::fidl_next::FromWire::from_wire(
2440 unsafe { envelope.read_unchecked::<bool>() }
2441 )),
2442
2443
2444 inaccessible_domain_supported: inaccessible_domain_supported.map(|envelope| ::fidl_next::FromWire::from_wire(
2445 unsafe { envelope.read_unchecked::<bool>() }
2446 )),
2447
2448
2449 permitted_heaps: permitted_heaps.map(|envelope| ::fidl_next::FromWire::from_wire(
2450 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>() }
2451 )),
2452
2453 }
2454 }
2455 }
2456
2457 impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferMemoryConstraints<'de>>
2458 for BufferMemoryConstraints
2459 {
2460 #[inline]
2461 fn from_wire_ref(wire: &crate::wire::BufferMemoryConstraints<'de>) -> Self {
2462 Self {
2463
2464
2465 min_size_bytes: wire.table.get(1)
2466 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2467 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
2468 )),
2469
2470
2471 max_size_bytes: wire.table.get(2)
2472 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2473 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
2474 )),
2475
2476
2477 physically_contiguous_required: wire.table.get(3)
2478 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2479 unsafe { envelope.deref_unchecked::<bool>() }
2480 )),
2481
2482
2483 secure_required: wire.table.get(4)
2484 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2485 unsafe { envelope.deref_unchecked::<bool>() }
2486 )),
2487
2488
2489 cpu_domain_supported: wire.table.get(5)
2490 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2491 unsafe { envelope.deref_unchecked::<bool>() }
2492 )),
2493
2494
2495 ram_domain_supported: wire.table.get(6)
2496 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2497 unsafe { envelope.deref_unchecked::<bool>() }
2498 )),
2499
2500
2501 inaccessible_domain_supported: wire.table.get(7)
2502 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2503 unsafe { envelope.deref_unchecked::<bool>() }
2504 )),
2505
2506
2507 permitted_heaps: wire.table.get(8)
2508 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
2509 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>() }
2510 )),
2511
2512 }
2513 }
2514 }
2515
2516 #[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"]
2517 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2518 #[repr(u32)]
2519 pub enum CoherencyDomain {
2520 Cpu = 0,
2521 Ram = 1,
2522 Inaccessible = 2,
2523 UnknownOrdinal_(u32) = 3,
2524 }
2525 impl ::std::convert::From<u32> for CoherencyDomain {
2526 fn from(value: u32) -> Self {
2527 match value {
2528 0 => Self::Cpu,
2529 1 => Self::Ram,
2530 2 => Self::Inaccessible,
2531
2532 _ => Self::UnknownOrdinal_(value),
2533 }
2534 }
2535 }
2536
2537 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CoherencyDomain, ___E> for CoherencyDomain
2538 where
2539 ___E: ?Sized,
2540 {
2541 #[inline]
2542 fn encode(
2543 self,
2544 encoder: &mut ___E,
2545 out: &mut ::core::mem::MaybeUninit<crate::wire::CoherencyDomain>,
2546 _: (),
2547 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2548 ::fidl_next::Encode::encode(&self, encoder, out, ())
2549 }
2550 }
2551
2552 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CoherencyDomain, ___E>
2553 for &'a CoherencyDomain
2554 where
2555 ___E: ?Sized,
2556 {
2557 #[inline]
2558 fn encode(
2559 self,
2560 encoder: &mut ___E,
2561 out: &mut ::core::mem::MaybeUninit<crate::wire::CoherencyDomain>,
2562 _: (),
2563 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2564 ::fidl_next::munge!(let crate::wire::CoherencyDomain { value } = out);
2565 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2566 CoherencyDomain::Cpu => 0,
2567
2568 CoherencyDomain::Ram => 1,
2569
2570 CoherencyDomain::Inaccessible => 2,
2571
2572 CoherencyDomain::UnknownOrdinal_(value) => value,
2573 }));
2574
2575 Ok(())
2576 }
2577 }
2578
2579 impl ::core::convert::From<crate::wire::CoherencyDomain> for CoherencyDomain {
2580 fn from(wire: crate::wire::CoherencyDomain) -> Self {
2581 match u32::from(wire.value) {
2582 0 => Self::Cpu,
2583
2584 1 => Self::Ram,
2585
2586 2 => Self::Inaccessible,
2587
2588 value => Self::UnknownOrdinal_(value),
2589 }
2590 }
2591 }
2592
2593 impl ::fidl_next::FromWire<crate::wire::CoherencyDomain> for CoherencyDomain {
2594 #[inline]
2595 fn from_wire(wire: crate::wire::CoherencyDomain) -> Self {
2596 Self::from(wire)
2597 }
2598 }
2599
2600 impl ::fidl_next::FromWireRef<crate::wire::CoherencyDomain> for CoherencyDomain {
2601 #[inline]
2602 fn from_wire_ref(wire: &crate::wire::CoherencyDomain) -> Self {
2603 Self::from(*wire)
2604 }
2605 }
2606
2607 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2608 pub struct PixelFormatAndModifier {
2609 pub pixel_format: ::fidl_next_common_fuchsia_images2::natural::PixelFormat,
2610
2611 pub pixel_format_modifier: ::fidl_next_common_fuchsia_images2::natural::PixelFormatModifier,
2612 }
2613
2614 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>
2615 for PixelFormatAndModifier
2616 where
2617 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2618 {
2619 #[inline]
2620 fn encode(
2621 self,
2622 encoder_: &mut ___E,
2623 out_: &mut ::core::mem::MaybeUninit<crate::wire::PixelFormatAndModifier>,
2624 _: (),
2625 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2626 ::fidl_next::munge! {
2627 let crate::wire::PixelFormatAndModifier {
2628 pixel_format,
2629 pixel_format_modifier,
2630
2631 } = out_;
2632 }
2633
2634 ::fidl_next::Encode::encode(self.pixel_format, encoder_, pixel_format, ())?;
2635
2636 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(pixel_format.as_mut_ptr()) };
2637
2638 ::fidl_next::Encode::encode(
2639 self.pixel_format_modifier,
2640 encoder_,
2641 pixel_format_modifier,
2642 (),
2643 )?;
2644
2645 let mut _field =
2646 unsafe { ::fidl_next::Slot::new_unchecked(pixel_format_modifier.as_mut_ptr()) };
2647
2648 Ok(())
2649 }
2650 }
2651
2652 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>
2653 for &'a PixelFormatAndModifier
2654 where
2655 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2656 {
2657 #[inline]
2658 fn encode(
2659 self,
2660 encoder_: &mut ___E,
2661 out_: &mut ::core::mem::MaybeUninit<crate::wire::PixelFormatAndModifier>,
2662 _: (),
2663 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2664 ::fidl_next::munge! {
2665 let crate::wire::PixelFormatAndModifier {
2666 pixel_format,
2667 pixel_format_modifier,
2668
2669 } = out_;
2670 }
2671
2672 ::fidl_next::Encode::encode(&self.pixel_format, encoder_, pixel_format, ())?;
2673
2674 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(pixel_format.as_mut_ptr()) };
2675
2676 ::fidl_next::Encode::encode(
2677 &self.pixel_format_modifier,
2678 encoder_,
2679 pixel_format_modifier,
2680 (),
2681 )?;
2682
2683 let mut _field =
2684 unsafe { ::fidl_next::Slot::new_unchecked(pixel_format_modifier.as_mut_ptr()) };
2685
2686 Ok(())
2687 }
2688 }
2689
2690 unsafe impl<___E>
2691 ::fidl_next::EncodeOption<
2692 ::fidl_next::wire::Box<'static, crate::wire::PixelFormatAndModifier>,
2693 ___E,
2694 > for PixelFormatAndModifier
2695 where
2696 ___E: ::fidl_next::Encoder + ?Sized,
2697 PixelFormatAndModifier: ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>,
2698 {
2699 #[inline]
2700 fn encode_option(
2701 this: ::core::option::Option<Self>,
2702 encoder: &mut ___E,
2703 out: &mut ::core::mem::MaybeUninit<
2704 ::fidl_next::wire::Box<'static, crate::wire::PixelFormatAndModifier>,
2705 >,
2706 _: (),
2707 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2708 if let Some(inner) = this {
2709 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2710 ::fidl_next::wire::Box::encode_present(out);
2711 } else {
2712 ::fidl_next::wire::Box::encode_absent(out);
2713 }
2714
2715 Ok(())
2716 }
2717 }
2718
2719 unsafe impl<'a, ___E>
2720 ::fidl_next::EncodeOption<
2721 ::fidl_next::wire::Box<'static, crate::wire::PixelFormatAndModifier>,
2722 ___E,
2723 > for &'a PixelFormatAndModifier
2724 where
2725 ___E: ::fidl_next::Encoder + ?Sized,
2726 &'a PixelFormatAndModifier: ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>,
2727 {
2728 #[inline]
2729 fn encode_option(
2730 this: ::core::option::Option<Self>,
2731 encoder: &mut ___E,
2732 out: &mut ::core::mem::MaybeUninit<
2733 ::fidl_next::wire::Box<'static, crate::wire::PixelFormatAndModifier>,
2734 >,
2735 _: (),
2736 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2737 if let Some(inner) = this {
2738 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2739 ::fidl_next::wire::Box::encode_present(out);
2740 } else {
2741 ::fidl_next::wire::Box::encode_absent(out);
2742 }
2743
2744 Ok(())
2745 }
2746 }
2747
2748 impl ::fidl_next::FromWire<crate::wire::PixelFormatAndModifier> for PixelFormatAndModifier {
2749 #[inline]
2750 fn from_wire(wire: crate::wire::PixelFormatAndModifier) -> Self {
2751 Self {
2752 pixel_format: ::fidl_next::FromWire::from_wire(wire.pixel_format),
2753
2754 pixel_format_modifier: ::fidl_next::FromWire::from_wire(wire.pixel_format_modifier),
2755 }
2756 }
2757 }
2758
2759 impl ::fidl_next::FromWireRef<crate::wire::PixelFormatAndModifier> for PixelFormatAndModifier {
2760 #[inline]
2761 fn from_wire_ref(wire: &crate::wire::PixelFormatAndModifier) -> Self {
2762 Self {
2763 pixel_format: ::fidl_next::FromWireRef::from_wire_ref(&wire.pixel_format),
2764
2765 pixel_format_modifier: ::fidl_next::FromWireRef::from_wire_ref(
2766 &wire.pixel_format_modifier,
2767 ),
2768 }
2769 }
2770 }
2771
2772 pub type BufferCollectionCheckAllBuffersAllocatedResponse = ();
2773
2774 #[doc = " Describes constraints on layout of image data in buffers.\n"]
2775 #[derive(Debug, Default, Clone, PartialEq)]
2776 pub struct ImageFormatConstraints {
2777 pub pixel_format:
2778 ::core::option::Option<::fidl_next_common_fuchsia_images2::natural::PixelFormat>,
2779
2780 pub pixel_format_modifier: ::core::option::Option<
2781 ::fidl_next_common_fuchsia_images2::natural::PixelFormatModifier,
2782 >,
2783
2784 pub color_spaces: ::core::option::Option<
2785 ::std::vec::Vec<::fidl_next_common_fuchsia_images2::natural::ColorSpace>,
2786 >,
2787
2788 pub min_size: ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
2789
2790 pub max_size: ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
2791
2792 pub min_bytes_per_row: ::core::option::Option<u32>,
2793
2794 pub max_bytes_per_row: ::core::option::Option<u32>,
2795
2796 pub max_width_times_height: ::core::option::Option<u64>,
2797
2798 pub size_alignment: ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
2799
2800 pub display_rect_alignment:
2801 ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
2802
2803 pub required_min_size:
2804 ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
2805
2806 pub required_max_size:
2807 ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
2808
2809 pub bytes_per_row_divisor: ::core::option::Option<u32>,
2810
2811 pub start_offset_divisor: ::core::option::Option<u32>,
2812
2813 pub pixel_format_and_modifiers:
2814 ::core::option::Option<::std::vec::Vec<crate::natural::PixelFormatAndModifier>>,
2815
2816 pub require_bytes_per_row_at_pixel_boundary: ::core::option::Option<bool>,
2817
2818 pub is_alpha_present: ::core::option::Option<bool>,
2819
2820 pub required_max_size_list: ::core::option::Option<
2821 ::std::vec::Vec<::fidl_next_common_fuchsia_math::natural::SizeU>,
2822 >,
2823
2824 pub pad_for_block_size:
2825 ::core::option::Option<::fidl_next_common_fuchsia_math::natural::SizeU>,
2826
2827 pub pad_beyond_image_size_bytes: ::core::option::Option<u64>,
2828 }
2829
2830 impl ImageFormatConstraints {
2831 fn __max_ordinal(&self) -> usize {
2832 if self.pad_beyond_image_size_bytes.is_some() {
2833 return 20;
2834 }
2835
2836 if self.pad_for_block_size.is_some() {
2837 return 19;
2838 }
2839
2840 if self.required_max_size_list.is_some() {
2841 return 18;
2842 }
2843
2844 if self.is_alpha_present.is_some() {
2845 return 17;
2846 }
2847
2848 if self.require_bytes_per_row_at_pixel_boundary.is_some() {
2849 return 16;
2850 }
2851
2852 if self.pixel_format_and_modifiers.is_some() {
2853 return 15;
2854 }
2855
2856 if self.start_offset_divisor.is_some() {
2857 return 14;
2858 }
2859
2860 if self.bytes_per_row_divisor.is_some() {
2861 return 13;
2862 }
2863
2864 if self.required_max_size.is_some() {
2865 return 12;
2866 }
2867
2868 if self.required_min_size.is_some() {
2869 return 11;
2870 }
2871
2872 if self.display_rect_alignment.is_some() {
2873 return 10;
2874 }
2875
2876 if self.size_alignment.is_some() {
2877 return 9;
2878 }
2879
2880 if self.max_width_times_height.is_some() {
2881 return 8;
2882 }
2883
2884 if self.max_bytes_per_row.is_some() {
2885 return 7;
2886 }
2887
2888 if self.min_bytes_per_row.is_some() {
2889 return 6;
2890 }
2891
2892 if self.max_size.is_some() {
2893 return 5;
2894 }
2895
2896 if self.min_size.is_some() {
2897 return 4;
2898 }
2899
2900 if self.color_spaces.is_some() {
2901 return 3;
2902 }
2903
2904 if self.pixel_format_modifier.is_some() {
2905 return 2;
2906 }
2907
2908 if self.pixel_format.is_some() {
2909 return 1;
2910 }
2911
2912 0
2913 }
2914 }
2915
2916 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ImageFormatConstraints<'static>, ___E>
2917 for ImageFormatConstraints
2918 where
2919 ___E: ::fidl_next::Encoder + ?Sized,
2920 {
2921 #[inline]
2922 fn encode(
2923 mut self,
2924 encoder: &mut ___E,
2925 out: &mut ::core::mem::MaybeUninit<crate::wire::ImageFormatConstraints<'static>>,
2926 _: (),
2927 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2928 ::fidl_next::munge!(let crate::wire::ImageFormatConstraints { table } = out);
2929
2930 let max_ord = self.__max_ordinal();
2931
2932 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2933 ::fidl_next::Wire::zero_padding(&mut out);
2934
2935 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2936 ::fidl_next::wire::Envelope,
2937 >(encoder, max_ord);
2938
2939 for i in 1..=max_ord {
2940 match i {
2941 20 => {
2942 if let Some(value) = self.pad_beyond_image_size_bytes.take() {
2943 ::fidl_next::wire::Envelope::encode_value::<
2944 ::fidl_next::wire::Uint64,
2945 ___E,
2946 >(
2947 value, preallocated.encoder, &mut out, ()
2948 )?;
2949 } else {
2950 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2951 }
2952 }
2953
2954 19 => {
2955 if let Some(value) = self.pad_for_block_size.take() {
2956 ::fidl_next::wire::Envelope::encode_value::<
2957 ::fidl_next_common_fuchsia_math::wire::SizeU,
2958 ___E,
2959 >(
2960 value, preallocated.encoder, &mut out, ()
2961 )?;
2962 } else {
2963 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2964 }
2965 }
2966
2967 18 => {
2968 if let Some(value) = self.required_max_size_list.take() {
2969 ::fidl_next::wire::Envelope::encode_value::<
2970 ::fidl_next::wire::Vector<
2971 'static,
2972 ::fidl_next_common_fuchsia_math::wire::SizeU,
2973 >,
2974 ___E,
2975 >(
2976 value, preallocated.encoder, &mut out, (64, ())
2977 )?;
2978 } else {
2979 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2980 }
2981 }
2982
2983 17 => {
2984 if let Some(value) = self.is_alpha_present.take() {
2985 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2986 value,
2987 preallocated.encoder,
2988 &mut out,
2989 (),
2990 )?;
2991 } else {
2992 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2993 }
2994 }
2995
2996 16 => {
2997 if let Some(value) = self.require_bytes_per_row_at_pixel_boundary.take() {
2998 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2999 value,
3000 preallocated.encoder,
3001 &mut out,
3002 (),
3003 )?;
3004 } else {
3005 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3006 }
3007 }
3008
3009 15 => {
3010 if let Some(value) = self.pixel_format_and_modifiers.take() {
3011 ::fidl_next::wire::Envelope::encode_value::<
3012 ::fidl_next::wire::Vector<
3013 'static,
3014 crate::wire::PixelFormatAndModifier,
3015 >,
3016 ___E,
3017 >(
3018 value, preallocated.encoder, &mut out, (64, ())
3019 )?;
3020 } else {
3021 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3022 }
3023 }
3024
3025 14 => {
3026 if let Some(value) = self.start_offset_divisor.take() {
3027 ::fidl_next::wire::Envelope::encode_value::<
3028 ::fidl_next::wire::Uint32,
3029 ___E,
3030 >(
3031 value, preallocated.encoder, &mut out, ()
3032 )?;
3033 } else {
3034 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3035 }
3036 }
3037
3038 13 => {
3039 if let Some(value) = self.bytes_per_row_divisor.take() {
3040 ::fidl_next::wire::Envelope::encode_value::<
3041 ::fidl_next::wire::Uint32,
3042 ___E,
3043 >(
3044 value, preallocated.encoder, &mut out, ()
3045 )?;
3046 } else {
3047 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3048 }
3049 }
3050
3051 12 => {
3052 if let Some(value) = self.required_max_size.take() {
3053 ::fidl_next::wire::Envelope::encode_value::<
3054 ::fidl_next_common_fuchsia_math::wire::SizeU,
3055 ___E,
3056 >(
3057 value, preallocated.encoder, &mut out, ()
3058 )?;
3059 } else {
3060 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3061 }
3062 }
3063
3064 11 => {
3065 if let Some(value) = self.required_min_size.take() {
3066 ::fidl_next::wire::Envelope::encode_value::<
3067 ::fidl_next_common_fuchsia_math::wire::SizeU,
3068 ___E,
3069 >(
3070 value, preallocated.encoder, &mut out, ()
3071 )?;
3072 } else {
3073 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3074 }
3075 }
3076
3077 10 => {
3078 if let Some(value) = self.display_rect_alignment.take() {
3079 ::fidl_next::wire::Envelope::encode_value::<
3080 ::fidl_next_common_fuchsia_math::wire::SizeU,
3081 ___E,
3082 >(
3083 value, preallocated.encoder, &mut out, ()
3084 )?;
3085 } else {
3086 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3087 }
3088 }
3089
3090 9 => {
3091 if let Some(value) = self.size_alignment.take() {
3092 ::fidl_next::wire::Envelope::encode_value::<
3093 ::fidl_next_common_fuchsia_math::wire::SizeU,
3094 ___E,
3095 >(
3096 value, preallocated.encoder, &mut out, ()
3097 )?;
3098 } else {
3099 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3100 }
3101 }
3102
3103 8 => {
3104 if let Some(value) = self.max_width_times_height.take() {
3105 ::fidl_next::wire::Envelope::encode_value::<
3106 ::fidl_next::wire::Uint64,
3107 ___E,
3108 >(
3109 value, preallocated.encoder, &mut out, ()
3110 )?;
3111 } else {
3112 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3113 }
3114 }
3115
3116 7 => {
3117 if let Some(value) = self.max_bytes_per_row.take() {
3118 ::fidl_next::wire::Envelope::encode_value::<
3119 ::fidl_next::wire::Uint32,
3120 ___E,
3121 >(
3122 value, preallocated.encoder, &mut out, ()
3123 )?;
3124 } else {
3125 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3126 }
3127 }
3128
3129 6 => {
3130 if let Some(value) = self.min_bytes_per_row.take() {
3131 ::fidl_next::wire::Envelope::encode_value::<
3132 ::fidl_next::wire::Uint32,
3133 ___E,
3134 >(
3135 value, preallocated.encoder, &mut out, ()
3136 )?;
3137 } else {
3138 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3139 }
3140 }
3141
3142 5 => {
3143 if let Some(value) = self.max_size.take() {
3144 ::fidl_next::wire::Envelope::encode_value::<
3145 ::fidl_next_common_fuchsia_math::wire::SizeU,
3146 ___E,
3147 >(
3148 value, preallocated.encoder, &mut out, ()
3149 )?;
3150 } else {
3151 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3152 }
3153 }
3154
3155 4 => {
3156 if let Some(value) = self.min_size.take() {
3157 ::fidl_next::wire::Envelope::encode_value::<
3158 ::fidl_next_common_fuchsia_math::wire::SizeU,
3159 ___E,
3160 >(
3161 value, preallocated.encoder, &mut out, ()
3162 )?;
3163 } else {
3164 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3165 }
3166 }
3167
3168 3 => {
3169 if let Some(value) = self.color_spaces.take() {
3170 ::fidl_next::wire::Envelope::encode_value::<
3171 ::fidl_next::wire::Vector<
3172 'static,
3173 ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
3174 >,
3175 ___E,
3176 >(
3177 value, preallocated.encoder, &mut out, (32, ())
3178 )?;
3179 } else {
3180 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3181 }
3182 }
3183
3184 2 => {
3185 if let Some(value) = self.pixel_format_modifier.take() {
3186 ::fidl_next::wire::Envelope::encode_value::<
3187 ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
3188 ___E,
3189 >(
3190 value, preallocated.encoder, &mut out, ()
3191 )?;
3192 } else {
3193 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3194 }
3195 }
3196
3197 1 => {
3198 if let Some(value) = self.pixel_format.take() {
3199 ::fidl_next::wire::Envelope::encode_value::<
3200 ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
3201 ___E,
3202 >(
3203 value, preallocated.encoder, &mut out, ()
3204 )?;
3205 } else {
3206 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3207 }
3208 }
3209
3210 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3211 }
3212 unsafe {
3213 preallocated.write_next(out.assume_init_ref());
3214 }
3215 }
3216
3217 ::fidl_next::wire::Table::encode_len(table, max_ord);
3218
3219 Ok(())
3220 }
3221 }
3222
3223 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ImageFormatConstraints<'static>, ___E>
3224 for &'a ImageFormatConstraints
3225 where
3226 ___E: ::fidl_next::Encoder + ?Sized,
3227 {
3228 #[inline]
3229 fn encode(
3230 self,
3231 encoder: &mut ___E,
3232 out: &mut ::core::mem::MaybeUninit<crate::wire::ImageFormatConstraints<'static>>,
3233 _: (),
3234 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3235 ::fidl_next::munge!(let crate::wire::ImageFormatConstraints { table } = out);
3236
3237 let max_ord = self.__max_ordinal();
3238
3239 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3240 ::fidl_next::Wire::zero_padding(&mut out);
3241
3242 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3243 ::fidl_next::wire::Envelope,
3244 >(encoder, max_ord);
3245
3246 for i in 1..=max_ord {
3247 match i {
3248 20 => {
3249 if let Some(value) = &self.pad_beyond_image_size_bytes {
3250 ::fidl_next::wire::Envelope::encode_value::<
3251 ::fidl_next::wire::Uint64,
3252 ___E,
3253 >(
3254 value, preallocated.encoder, &mut out, ()
3255 )?;
3256 } else {
3257 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3258 }
3259 }
3260
3261 19 => {
3262 if let Some(value) = &self.pad_for_block_size {
3263 ::fidl_next::wire::Envelope::encode_value::<
3264 ::fidl_next_common_fuchsia_math::wire::SizeU,
3265 ___E,
3266 >(
3267 value, preallocated.encoder, &mut out, ()
3268 )?;
3269 } else {
3270 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3271 }
3272 }
3273
3274 18 => {
3275 if let Some(value) = &self.required_max_size_list {
3276 ::fidl_next::wire::Envelope::encode_value::<
3277 ::fidl_next::wire::Vector<
3278 'static,
3279 ::fidl_next_common_fuchsia_math::wire::SizeU,
3280 >,
3281 ___E,
3282 >(
3283 value, preallocated.encoder, &mut out, (64, ())
3284 )?;
3285 } else {
3286 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3287 }
3288 }
3289
3290 17 => {
3291 if let Some(value) = &self.is_alpha_present {
3292 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3293 value,
3294 preallocated.encoder,
3295 &mut out,
3296 (),
3297 )?;
3298 } else {
3299 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3300 }
3301 }
3302
3303 16 => {
3304 if let Some(value) = &self.require_bytes_per_row_at_pixel_boundary {
3305 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3306 value,
3307 preallocated.encoder,
3308 &mut out,
3309 (),
3310 )?;
3311 } else {
3312 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3313 }
3314 }
3315
3316 15 => {
3317 if let Some(value) = &self.pixel_format_and_modifiers {
3318 ::fidl_next::wire::Envelope::encode_value::<
3319 ::fidl_next::wire::Vector<
3320 'static,
3321 crate::wire::PixelFormatAndModifier,
3322 >,
3323 ___E,
3324 >(
3325 value, preallocated.encoder, &mut out, (64, ())
3326 )?;
3327 } else {
3328 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3329 }
3330 }
3331
3332 14 => {
3333 if let Some(value) = &self.start_offset_divisor {
3334 ::fidl_next::wire::Envelope::encode_value::<
3335 ::fidl_next::wire::Uint32,
3336 ___E,
3337 >(
3338 value, preallocated.encoder, &mut out, ()
3339 )?;
3340 } else {
3341 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3342 }
3343 }
3344
3345 13 => {
3346 if let Some(value) = &self.bytes_per_row_divisor {
3347 ::fidl_next::wire::Envelope::encode_value::<
3348 ::fidl_next::wire::Uint32,
3349 ___E,
3350 >(
3351 value, preallocated.encoder, &mut out, ()
3352 )?;
3353 } else {
3354 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3355 }
3356 }
3357
3358 12 => {
3359 if let Some(value) = &self.required_max_size {
3360 ::fidl_next::wire::Envelope::encode_value::<
3361 ::fidl_next_common_fuchsia_math::wire::SizeU,
3362 ___E,
3363 >(
3364 value, preallocated.encoder, &mut out, ()
3365 )?;
3366 } else {
3367 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3368 }
3369 }
3370
3371 11 => {
3372 if let Some(value) = &self.required_min_size {
3373 ::fidl_next::wire::Envelope::encode_value::<
3374 ::fidl_next_common_fuchsia_math::wire::SizeU,
3375 ___E,
3376 >(
3377 value, preallocated.encoder, &mut out, ()
3378 )?;
3379 } else {
3380 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3381 }
3382 }
3383
3384 10 => {
3385 if let Some(value) = &self.display_rect_alignment {
3386 ::fidl_next::wire::Envelope::encode_value::<
3387 ::fidl_next_common_fuchsia_math::wire::SizeU,
3388 ___E,
3389 >(
3390 value, preallocated.encoder, &mut out, ()
3391 )?;
3392 } else {
3393 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3394 }
3395 }
3396
3397 9 => {
3398 if let Some(value) = &self.size_alignment {
3399 ::fidl_next::wire::Envelope::encode_value::<
3400 ::fidl_next_common_fuchsia_math::wire::SizeU,
3401 ___E,
3402 >(
3403 value, preallocated.encoder, &mut out, ()
3404 )?;
3405 } else {
3406 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3407 }
3408 }
3409
3410 8 => {
3411 if let Some(value) = &self.max_width_times_height {
3412 ::fidl_next::wire::Envelope::encode_value::<
3413 ::fidl_next::wire::Uint64,
3414 ___E,
3415 >(
3416 value, preallocated.encoder, &mut out, ()
3417 )?;
3418 } else {
3419 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3420 }
3421 }
3422
3423 7 => {
3424 if let Some(value) = &self.max_bytes_per_row {
3425 ::fidl_next::wire::Envelope::encode_value::<
3426 ::fidl_next::wire::Uint32,
3427 ___E,
3428 >(
3429 value, preallocated.encoder, &mut out, ()
3430 )?;
3431 } else {
3432 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3433 }
3434 }
3435
3436 6 => {
3437 if let Some(value) = &self.min_bytes_per_row {
3438 ::fidl_next::wire::Envelope::encode_value::<
3439 ::fidl_next::wire::Uint32,
3440 ___E,
3441 >(
3442 value, preallocated.encoder, &mut out, ()
3443 )?;
3444 } else {
3445 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3446 }
3447 }
3448
3449 5 => {
3450 if let Some(value) = &self.max_size {
3451 ::fidl_next::wire::Envelope::encode_value::<
3452 ::fidl_next_common_fuchsia_math::wire::SizeU,
3453 ___E,
3454 >(
3455 value, preallocated.encoder, &mut out, ()
3456 )?;
3457 } else {
3458 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3459 }
3460 }
3461
3462 4 => {
3463 if let Some(value) = &self.min_size {
3464 ::fidl_next::wire::Envelope::encode_value::<
3465 ::fidl_next_common_fuchsia_math::wire::SizeU,
3466 ___E,
3467 >(
3468 value, preallocated.encoder, &mut out, ()
3469 )?;
3470 } else {
3471 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3472 }
3473 }
3474
3475 3 => {
3476 if let Some(value) = &self.color_spaces {
3477 ::fidl_next::wire::Envelope::encode_value::<
3478 ::fidl_next::wire::Vector<
3479 'static,
3480 ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
3481 >,
3482 ___E,
3483 >(
3484 value, preallocated.encoder, &mut out, (32, ())
3485 )?;
3486 } else {
3487 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3488 }
3489 }
3490
3491 2 => {
3492 if let Some(value) = &self.pixel_format_modifier {
3493 ::fidl_next::wire::Envelope::encode_value::<
3494 ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
3495 ___E,
3496 >(
3497 value, preallocated.encoder, &mut out, ()
3498 )?;
3499 } else {
3500 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3501 }
3502 }
3503
3504 1 => {
3505 if let Some(value) = &self.pixel_format {
3506 ::fidl_next::wire::Envelope::encode_value::<
3507 ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
3508 ___E,
3509 >(
3510 value, preallocated.encoder, &mut out, ()
3511 )?;
3512 } else {
3513 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3514 }
3515 }
3516
3517 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3518 }
3519 unsafe {
3520 preallocated.write_next(out.assume_init_ref());
3521 }
3522 }
3523
3524 ::fidl_next::wire::Table::encode_len(table, max_ord);
3525
3526 Ok(())
3527 }
3528 }
3529
3530 impl<'de> ::fidl_next::FromWire<crate::wire::ImageFormatConstraints<'de>>
3531 for ImageFormatConstraints
3532 {
3533 #[inline]
3534 fn from_wire(wire_: crate::wire::ImageFormatConstraints<'de>) -> Self {
3535 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3536
3537 let pixel_format = wire_.table.get(1);
3538
3539 let pixel_format_modifier = wire_.table.get(2);
3540
3541 let color_spaces = wire_.table.get(3);
3542
3543 let min_size = wire_.table.get(4);
3544
3545 let max_size = wire_.table.get(5);
3546
3547 let min_bytes_per_row = wire_.table.get(6);
3548
3549 let max_bytes_per_row = wire_.table.get(7);
3550
3551 let max_width_times_height = wire_.table.get(8);
3552
3553 let size_alignment = wire_.table.get(9);
3554
3555 let display_rect_alignment = wire_.table.get(10);
3556
3557 let required_min_size = wire_.table.get(11);
3558
3559 let required_max_size = wire_.table.get(12);
3560
3561 let bytes_per_row_divisor = wire_.table.get(13);
3562
3563 let start_offset_divisor = wire_.table.get(14);
3564
3565 let pixel_format_and_modifiers = wire_.table.get(15);
3566
3567 let require_bytes_per_row_at_pixel_boundary = wire_.table.get(16);
3568
3569 let is_alpha_present = wire_.table.get(17);
3570
3571 let required_max_size_list = wire_.table.get(18);
3572
3573 let pad_for_block_size = wire_.table.get(19);
3574
3575 let pad_beyond_image_size_bytes = wire_.table.get(20);
3576
3577 Self {
3578
3579
3580 pixel_format: pixel_format.map(|envelope| ::fidl_next::FromWire::from_wire(
3581 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
3582 )),
3583
3584
3585 pixel_format_modifier: pixel_format_modifier.map(|envelope| ::fidl_next::FromWire::from_wire(
3586 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
3587 )),
3588
3589
3590 color_spaces: color_spaces.map(|envelope| ::fidl_next::FromWire::from_wire(
3591 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>>() }
3592 )),
3593
3594
3595 min_size: min_size.map(|envelope| ::fidl_next::FromWire::from_wire(
3596 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3597 )),
3598
3599
3600 max_size: max_size.map(|envelope| ::fidl_next::FromWire::from_wire(
3601 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3602 )),
3603
3604
3605 min_bytes_per_row: min_bytes_per_row.map(|envelope| ::fidl_next::FromWire::from_wire(
3606 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
3607 )),
3608
3609
3610 max_bytes_per_row: max_bytes_per_row.map(|envelope| ::fidl_next::FromWire::from_wire(
3611 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
3612 )),
3613
3614
3615 max_width_times_height: max_width_times_height.map(|envelope| ::fidl_next::FromWire::from_wire(
3616 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
3617 )),
3618
3619
3620 size_alignment: size_alignment.map(|envelope| ::fidl_next::FromWire::from_wire(
3621 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3622 )),
3623
3624
3625 display_rect_alignment: display_rect_alignment.map(|envelope| ::fidl_next::FromWire::from_wire(
3626 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3627 )),
3628
3629
3630 required_min_size: required_min_size.map(|envelope| ::fidl_next::FromWire::from_wire(
3631 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3632 )),
3633
3634
3635 required_max_size: required_max_size.map(|envelope| ::fidl_next::FromWire::from_wire(
3636 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3637 )),
3638
3639
3640 bytes_per_row_divisor: bytes_per_row_divisor.map(|envelope| ::fidl_next::FromWire::from_wire(
3641 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
3642 )),
3643
3644
3645 start_offset_divisor: start_offset_divisor.map(|envelope| ::fidl_next::FromWire::from_wire(
3646 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
3647 )),
3648
3649
3650 pixel_format_and_modifiers: pixel_format_and_modifiers.map(|envelope| ::fidl_next::FromWire::from_wire(
3651 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>>() }
3652 )),
3653
3654
3655 require_bytes_per_row_at_pixel_boundary: require_bytes_per_row_at_pixel_boundary.map(|envelope| ::fidl_next::FromWire::from_wire(
3656 unsafe { envelope.read_unchecked::<bool>() }
3657 )),
3658
3659
3660 is_alpha_present: is_alpha_present.map(|envelope| ::fidl_next::FromWire::from_wire(
3661 unsafe { envelope.read_unchecked::<bool>() }
3662 )),
3663
3664
3665 required_max_size_list: required_max_size_list.map(|envelope| ::fidl_next::FromWire::from_wire(
3666 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>>() }
3667 )),
3668
3669
3670 pad_for_block_size: pad_for_block_size.map(|envelope| ::fidl_next::FromWire::from_wire(
3671 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3672 )),
3673
3674
3675 pad_beyond_image_size_bytes: pad_beyond_image_size_bytes.map(|envelope| ::fidl_next::FromWire::from_wire(
3676 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
3677 )),
3678
3679 }
3680 }
3681 }
3682
3683 impl<'de> ::fidl_next::FromWireRef<crate::wire::ImageFormatConstraints<'de>>
3684 for ImageFormatConstraints
3685 {
3686 #[inline]
3687 fn from_wire_ref(wire: &crate::wire::ImageFormatConstraints<'de>) -> Self {
3688 Self {
3689
3690
3691 pixel_format: wire.table.get(1)
3692 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3693 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
3694 )),
3695
3696
3697 pixel_format_modifier: wire.table.get(2)
3698 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3699 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
3700 )),
3701
3702
3703 color_spaces: wire.table.get(3)
3704 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3705 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>>() }
3706 )),
3707
3708
3709 min_size: wire.table.get(4)
3710 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3711 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3712 )),
3713
3714
3715 max_size: wire.table.get(5)
3716 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3717 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3718 )),
3719
3720
3721 min_bytes_per_row: wire.table.get(6)
3722 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3723 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
3724 )),
3725
3726
3727 max_bytes_per_row: wire.table.get(7)
3728 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3729 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
3730 )),
3731
3732
3733 max_width_times_height: wire.table.get(8)
3734 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3735 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
3736 )),
3737
3738
3739 size_alignment: wire.table.get(9)
3740 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3741 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3742 )),
3743
3744
3745 display_rect_alignment: wire.table.get(10)
3746 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3747 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3748 )),
3749
3750
3751 required_min_size: wire.table.get(11)
3752 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3753 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3754 )),
3755
3756
3757 required_max_size: wire.table.get(12)
3758 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3759 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3760 )),
3761
3762
3763 bytes_per_row_divisor: wire.table.get(13)
3764 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3765 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
3766 )),
3767
3768
3769 start_offset_divisor: wire.table.get(14)
3770 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3771 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
3772 )),
3773
3774
3775 pixel_format_and_modifiers: wire.table.get(15)
3776 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3777 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>>() }
3778 )),
3779
3780
3781 require_bytes_per_row_at_pixel_boundary: wire.table.get(16)
3782 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3783 unsafe { envelope.deref_unchecked::<bool>() }
3784 )),
3785
3786
3787 is_alpha_present: wire.table.get(17)
3788 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3789 unsafe { envelope.deref_unchecked::<bool>() }
3790 )),
3791
3792
3793 required_max_size_list: wire.table.get(18)
3794 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3795 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>>() }
3796 )),
3797
3798
3799 pad_for_block_size: wire.table.get(19)
3800 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3801 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>() }
3802 )),
3803
3804
3805 pad_beyond_image_size_bytes: wire.table.get(20)
3806 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3807 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint64>() }
3808 )),
3809
3810 }
3811 }
3812 }
3813
3814 #[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"]
3815 #[derive(Debug, Default, Clone, PartialEq)]
3816 pub struct BufferCollectionConstraints {
3817 pub usage: ::core::option::Option<crate::natural::BufferUsage>,
3818
3819 pub min_buffer_count_for_camping: ::core::option::Option<u32>,
3820
3821 pub min_buffer_count_for_dedicated_slack: ::core::option::Option<u32>,
3822
3823 pub min_buffer_count_for_shared_slack: ::core::option::Option<u32>,
3824
3825 pub min_buffer_count: ::core::option::Option<u32>,
3826
3827 pub max_buffer_count: ::core::option::Option<u32>,
3828
3829 pub buffer_memory_constraints:
3830 ::core::option::Option<crate::natural::BufferMemoryConstraints>,
3831
3832 pub image_format_constraints:
3833 ::core::option::Option<::std::vec::Vec<crate::natural::ImageFormatConstraints>>,
3834 }
3835
3836 impl BufferCollectionConstraints {
3837 fn __max_ordinal(&self) -> usize {
3838 if self.image_format_constraints.is_some() {
3839 return 8;
3840 }
3841
3842 if self.buffer_memory_constraints.is_some() {
3843 return 7;
3844 }
3845
3846 if self.max_buffer_count.is_some() {
3847 return 6;
3848 }
3849
3850 if self.min_buffer_count.is_some() {
3851 return 5;
3852 }
3853
3854 if self.min_buffer_count_for_shared_slack.is_some() {
3855 return 4;
3856 }
3857
3858 if self.min_buffer_count_for_dedicated_slack.is_some() {
3859 return 3;
3860 }
3861
3862 if self.min_buffer_count_for_camping.is_some() {
3863 return 2;
3864 }
3865
3866 if self.usage.is_some() {
3867 return 1;
3868 }
3869
3870 0
3871 }
3872 }
3873
3874 unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferCollectionConstraints<'static>, ___E>
3875 for BufferCollectionConstraints
3876 where
3877 ___E: ::fidl_next::Encoder + ?Sized,
3878 {
3879 #[inline]
3880 fn encode(
3881 mut self,
3882 encoder: &mut ___E,
3883 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferCollectionConstraints<'static>>,
3884 _: (),
3885 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3886 ::fidl_next::munge!(let crate::wire::BufferCollectionConstraints { table } = out);
3887
3888 let max_ord = self.__max_ordinal();
3889
3890 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3891 ::fidl_next::Wire::zero_padding(&mut out);
3892
3893 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3894 ::fidl_next::wire::Envelope,
3895 >(encoder, max_ord);
3896
3897 for i in 1..=max_ord {
3898 match i {
3899 8 => {
3900 if let Some(value) = self.image_format_constraints.take() {
3901 ::fidl_next::wire::Envelope::encode_value::<
3902 ::fidl_next::wire::Vector<
3903 'static,
3904 crate::wire::ImageFormatConstraints<'static>,
3905 >,
3906 ___E,
3907 >(
3908 value, preallocated.encoder, &mut out, (64, ())
3909 )?;
3910 } else {
3911 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3912 }
3913 }
3914
3915 7 => {
3916 if let Some(value) = self.buffer_memory_constraints.take() {
3917 ::fidl_next::wire::Envelope::encode_value::<
3918 crate::wire::BufferMemoryConstraints<'static>,
3919 ___E,
3920 >(
3921 value, preallocated.encoder, &mut out, ()
3922 )?;
3923 } else {
3924 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3925 }
3926 }
3927
3928 6 => {
3929 if let Some(value) = self.max_buffer_count.take() {
3930 ::fidl_next::wire::Envelope::encode_value::<
3931 ::fidl_next::wire::Uint32,
3932 ___E,
3933 >(
3934 value, preallocated.encoder, &mut out, ()
3935 )?;
3936 } else {
3937 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3938 }
3939 }
3940
3941 5 => {
3942 if let Some(value) = self.min_buffer_count.take() {
3943 ::fidl_next::wire::Envelope::encode_value::<
3944 ::fidl_next::wire::Uint32,
3945 ___E,
3946 >(
3947 value, preallocated.encoder, &mut out, ()
3948 )?;
3949 } else {
3950 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3951 }
3952 }
3953
3954 4 => {
3955 if let Some(value) = self.min_buffer_count_for_shared_slack.take() {
3956 ::fidl_next::wire::Envelope::encode_value::<
3957 ::fidl_next::wire::Uint32,
3958 ___E,
3959 >(
3960 value, preallocated.encoder, &mut out, ()
3961 )?;
3962 } else {
3963 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3964 }
3965 }
3966
3967 3 => {
3968 if let Some(value) = self.min_buffer_count_for_dedicated_slack.take() {
3969 ::fidl_next::wire::Envelope::encode_value::<
3970 ::fidl_next::wire::Uint32,
3971 ___E,
3972 >(
3973 value, preallocated.encoder, &mut out, ()
3974 )?;
3975 } else {
3976 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3977 }
3978 }
3979
3980 2 => {
3981 if let Some(value) = self.min_buffer_count_for_camping.take() {
3982 ::fidl_next::wire::Envelope::encode_value::<
3983 ::fidl_next::wire::Uint32,
3984 ___E,
3985 >(
3986 value, preallocated.encoder, &mut out, ()
3987 )?;
3988 } else {
3989 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3990 }
3991 }
3992
3993 1 => {
3994 if let Some(value) = self.usage.take() {
3995 ::fidl_next::wire::Envelope::encode_value::<
3996 crate::wire::BufferUsage<'static>,
3997 ___E,
3998 >(
3999 value, preallocated.encoder, &mut out, ()
4000 )?;
4001 } else {
4002 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4003 }
4004 }
4005
4006 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4007 }
4008 unsafe {
4009 preallocated.write_next(out.assume_init_ref());
4010 }
4011 }
4012
4013 ::fidl_next::wire::Table::encode_len(table, max_ord);
4014
4015 Ok(())
4016 }
4017 }
4018
4019 unsafe impl<'a, ___E>
4020 ::fidl_next::Encode<crate::wire::BufferCollectionConstraints<'static>, ___E>
4021 for &'a BufferCollectionConstraints
4022 where
4023 ___E: ::fidl_next::Encoder + ?Sized,
4024 {
4025 #[inline]
4026 fn encode(
4027 self,
4028 encoder: &mut ___E,
4029 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferCollectionConstraints<'static>>,
4030 _: (),
4031 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4032 ::fidl_next::munge!(let crate::wire::BufferCollectionConstraints { table } = out);
4033
4034 let max_ord = self.__max_ordinal();
4035
4036 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4037 ::fidl_next::Wire::zero_padding(&mut out);
4038
4039 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4040 ::fidl_next::wire::Envelope,
4041 >(encoder, max_ord);
4042
4043 for i in 1..=max_ord {
4044 match i {
4045 8 => {
4046 if let Some(value) = &self.image_format_constraints {
4047 ::fidl_next::wire::Envelope::encode_value::<
4048 ::fidl_next::wire::Vector<
4049 'static,
4050 crate::wire::ImageFormatConstraints<'static>,
4051 >,
4052 ___E,
4053 >(
4054 value, preallocated.encoder, &mut out, (64, ())
4055 )?;
4056 } else {
4057 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4058 }
4059 }
4060
4061 7 => {
4062 if let Some(value) = &self.buffer_memory_constraints {
4063 ::fidl_next::wire::Envelope::encode_value::<
4064 crate::wire::BufferMemoryConstraints<'static>,
4065 ___E,
4066 >(
4067 value, preallocated.encoder, &mut out, ()
4068 )?;
4069 } else {
4070 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4071 }
4072 }
4073
4074 6 => {
4075 if let Some(value) = &self.max_buffer_count {
4076 ::fidl_next::wire::Envelope::encode_value::<
4077 ::fidl_next::wire::Uint32,
4078 ___E,
4079 >(
4080 value, preallocated.encoder, &mut out, ()
4081 )?;
4082 } else {
4083 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4084 }
4085 }
4086
4087 5 => {
4088 if let Some(value) = &self.min_buffer_count {
4089 ::fidl_next::wire::Envelope::encode_value::<
4090 ::fidl_next::wire::Uint32,
4091 ___E,
4092 >(
4093 value, preallocated.encoder, &mut out, ()
4094 )?;
4095 } else {
4096 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4097 }
4098 }
4099
4100 4 => {
4101 if let Some(value) = &self.min_buffer_count_for_shared_slack {
4102 ::fidl_next::wire::Envelope::encode_value::<
4103 ::fidl_next::wire::Uint32,
4104 ___E,
4105 >(
4106 value, preallocated.encoder, &mut out, ()
4107 )?;
4108 } else {
4109 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4110 }
4111 }
4112
4113 3 => {
4114 if let Some(value) = &self.min_buffer_count_for_dedicated_slack {
4115 ::fidl_next::wire::Envelope::encode_value::<
4116 ::fidl_next::wire::Uint32,
4117 ___E,
4118 >(
4119 value, preallocated.encoder, &mut out, ()
4120 )?;
4121 } else {
4122 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4123 }
4124 }
4125
4126 2 => {
4127 if let Some(value) = &self.min_buffer_count_for_camping {
4128 ::fidl_next::wire::Envelope::encode_value::<
4129 ::fidl_next::wire::Uint32,
4130 ___E,
4131 >(
4132 value, preallocated.encoder, &mut out, ()
4133 )?;
4134 } else {
4135 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4136 }
4137 }
4138
4139 1 => {
4140 if let Some(value) = &self.usage {
4141 ::fidl_next::wire::Envelope::encode_value::<
4142 crate::wire::BufferUsage<'static>,
4143 ___E,
4144 >(
4145 value, preallocated.encoder, &mut out, ()
4146 )?;
4147 } else {
4148 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4149 }
4150 }
4151
4152 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4153 }
4154 unsafe {
4155 preallocated.write_next(out.assume_init_ref());
4156 }
4157 }
4158
4159 ::fidl_next::wire::Table::encode_len(table, max_ord);
4160
4161 Ok(())
4162 }
4163 }
4164
4165 impl<'de> ::fidl_next::FromWire<crate::wire::BufferCollectionConstraints<'de>>
4166 for BufferCollectionConstraints
4167 {
4168 #[inline]
4169 fn from_wire(wire_: crate::wire::BufferCollectionConstraints<'de>) -> Self {
4170 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4171
4172 let usage = wire_.table.get(1);
4173
4174 let min_buffer_count_for_camping = wire_.table.get(2);
4175
4176 let min_buffer_count_for_dedicated_slack = wire_.table.get(3);
4177
4178 let min_buffer_count_for_shared_slack = wire_.table.get(4);
4179
4180 let min_buffer_count = wire_.table.get(5);
4181
4182 let max_buffer_count = wire_.table.get(6);
4183
4184 let buffer_memory_constraints = wire_.table.get(7);
4185
4186 let image_format_constraints = wire_.table.get(8);
4187
4188 Self {
4189 usage: usage.map(|envelope| {
4190 ::fidl_next::FromWire::from_wire(unsafe {
4191 envelope.read_unchecked::<crate::wire::BufferUsage<'de>>()
4192 })
4193 }),
4194
4195 min_buffer_count_for_camping: min_buffer_count_for_camping.map(|envelope| {
4196 ::fidl_next::FromWire::from_wire(unsafe {
4197 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
4198 })
4199 }),
4200
4201 min_buffer_count_for_dedicated_slack: min_buffer_count_for_dedicated_slack.map(
4202 |envelope| {
4203 ::fidl_next::FromWire::from_wire(unsafe {
4204 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
4205 })
4206 },
4207 ),
4208
4209 min_buffer_count_for_shared_slack: min_buffer_count_for_shared_slack.map(
4210 |envelope| {
4211 ::fidl_next::FromWire::from_wire(unsafe {
4212 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
4213 })
4214 },
4215 ),
4216
4217 min_buffer_count: min_buffer_count.map(|envelope| {
4218 ::fidl_next::FromWire::from_wire(unsafe {
4219 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
4220 })
4221 }),
4222
4223 max_buffer_count: max_buffer_count.map(|envelope| {
4224 ::fidl_next::FromWire::from_wire(unsafe {
4225 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
4226 })
4227 }),
4228
4229 buffer_memory_constraints: buffer_memory_constraints.map(|envelope| {
4230 ::fidl_next::FromWire::from_wire(unsafe {
4231 envelope.read_unchecked::<crate::wire::BufferMemoryConstraints<'de>>()
4232 })
4233 }),
4234
4235 image_format_constraints:
4236 image_format_constraints.map(|envelope| {
4237 ::fidl_next::FromWire::from_wire(unsafe {
4238 envelope.read_unchecked::<::fidl_next::wire::Vector<
4239 'de,
4240 crate::wire::ImageFormatConstraints<'de>,
4241 >>()
4242 })
4243 }),
4244 }
4245 }
4246 }
4247
4248 impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferCollectionConstraints<'de>>
4249 for BufferCollectionConstraints
4250 {
4251 #[inline]
4252 fn from_wire_ref(wire: &crate::wire::BufferCollectionConstraints<'de>) -> Self {
4253 Self {
4254 usage: wire.table.get(1).map(|envelope| {
4255 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4256 envelope.deref_unchecked::<crate::wire::BufferUsage<'de>>()
4257 })
4258 }),
4259
4260 min_buffer_count_for_camping: wire.table.get(2).map(|envelope| {
4261 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4262 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
4263 })
4264 }),
4265
4266 min_buffer_count_for_dedicated_slack: wire.table.get(3).map(|envelope| {
4267 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4268 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
4269 })
4270 }),
4271
4272 min_buffer_count_for_shared_slack: wire.table.get(4).map(|envelope| {
4273 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4274 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
4275 })
4276 }),
4277
4278 min_buffer_count: wire.table.get(5).map(|envelope| {
4279 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4280 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
4281 })
4282 }),
4283
4284 max_buffer_count: wire.table.get(6).map(|envelope| {
4285 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4286 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
4287 })
4288 }),
4289
4290 buffer_memory_constraints: wire.table.get(7).map(|envelope| {
4291 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4292 envelope.deref_unchecked::<crate::wire::BufferMemoryConstraints<'de>>()
4293 })
4294 }),
4295
4296 image_format_constraints:
4297 wire.table.get(8).map(|envelope| {
4298 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4299 envelope.deref_unchecked::<::fidl_next::wire::Vector<
4300 'de,
4301 crate::wire::ImageFormatConstraints<'de>,
4302 >>()
4303 })
4304 }),
4305 }
4306 }
4307 }
4308
4309 #[doc = " These are memory-related settings for all buffers of a buffer collection.\n"]
4310 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4311 pub struct BufferMemorySettings {
4312 pub size_bytes: ::core::option::Option<u64>,
4313
4314 pub is_physically_contiguous: ::core::option::Option<bool>,
4315
4316 pub is_secure: ::core::option::Option<bool>,
4317
4318 pub coherency_domain: ::core::option::Option<crate::natural::CoherencyDomain>,
4319
4320 pub heap: ::core::option::Option<crate::natural::Heap>,
4321
4322 pub raw_vmo_size: ::core::option::Option<u64>,
4323 }
4324
4325 impl BufferMemorySettings {
4326 fn __max_ordinal(&self) -> usize {
4327 if self.raw_vmo_size.is_some() {
4328 return 6;
4329 }
4330
4331 if self.heap.is_some() {
4332 return 5;
4333 }
4334
4335 if self.coherency_domain.is_some() {
4336 return 4;
4337 }
4338
4339 if self.is_secure.is_some() {
4340 return 3;
4341 }
4342
4343 if self.is_physically_contiguous.is_some() {
4344 return 2;
4345 }
4346
4347 if self.size_bytes.is_some() {
4348 return 1;
4349 }
4350
4351 0
4352 }
4353 }
4354
4355 unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferMemorySettings<'static>, ___E>
4356 for BufferMemorySettings
4357 where
4358 ___E: ::fidl_next::Encoder + ?Sized,
4359 {
4360 #[inline]
4361 fn encode(
4362 mut self,
4363 encoder: &mut ___E,
4364 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemorySettings<'static>>,
4365 _: (),
4366 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4367 ::fidl_next::munge!(let crate::wire::BufferMemorySettings { table } = out);
4368
4369 let max_ord = self.__max_ordinal();
4370
4371 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4372 ::fidl_next::Wire::zero_padding(&mut out);
4373
4374 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4375 ::fidl_next::wire::Envelope,
4376 >(encoder, max_ord);
4377
4378 for i in 1..=max_ord {
4379 match i {
4380 6 => {
4381 if let Some(value) = self.raw_vmo_size.take() {
4382 ::fidl_next::wire::Envelope::encode_value::<
4383 ::fidl_next::wire::Uint64,
4384 ___E,
4385 >(
4386 value, preallocated.encoder, &mut out, ()
4387 )?;
4388 } else {
4389 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4390 }
4391 }
4392
4393 5 => {
4394 if let Some(value) = self.heap.take() {
4395 ::fidl_next::wire::Envelope::encode_value::<
4396 crate::wire::Heap<'static>,
4397 ___E,
4398 >(
4399 value, preallocated.encoder, &mut out, ()
4400 )?;
4401 } else {
4402 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4403 }
4404 }
4405
4406 4 => {
4407 if let Some(value) = self.coherency_domain.take() {
4408 ::fidl_next::wire::Envelope::encode_value::<
4409 crate::wire::CoherencyDomain,
4410 ___E,
4411 >(
4412 value, preallocated.encoder, &mut out, ()
4413 )?;
4414 } else {
4415 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4416 }
4417 }
4418
4419 3 => {
4420 if let Some(value) = self.is_secure.take() {
4421 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
4422 value,
4423 preallocated.encoder,
4424 &mut out,
4425 (),
4426 )?;
4427 } else {
4428 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4429 }
4430 }
4431
4432 2 => {
4433 if let Some(value) = self.is_physically_contiguous.take() {
4434 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
4435 value,
4436 preallocated.encoder,
4437 &mut out,
4438 (),
4439 )?;
4440 } else {
4441 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4442 }
4443 }
4444
4445 1 => {
4446 if let Some(value) = self.size_bytes.take() {
4447 ::fidl_next::wire::Envelope::encode_value::<
4448 ::fidl_next::wire::Uint64,
4449 ___E,
4450 >(
4451 value, preallocated.encoder, &mut out, ()
4452 )?;
4453 } else {
4454 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4455 }
4456 }
4457
4458 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4459 }
4460 unsafe {
4461 preallocated.write_next(out.assume_init_ref());
4462 }
4463 }
4464
4465 ::fidl_next::wire::Table::encode_len(table, max_ord);
4466
4467 Ok(())
4468 }
4469 }
4470
4471 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BufferMemorySettings<'static>, ___E>
4472 for &'a BufferMemorySettings
4473 where
4474 ___E: ::fidl_next::Encoder + ?Sized,
4475 {
4476 #[inline]
4477 fn encode(
4478 self,
4479 encoder: &mut ___E,
4480 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMemorySettings<'static>>,
4481 _: (),
4482 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4483 ::fidl_next::munge!(let crate::wire::BufferMemorySettings { table } = out);
4484
4485 let max_ord = self.__max_ordinal();
4486
4487 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4488 ::fidl_next::Wire::zero_padding(&mut out);
4489
4490 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4491 ::fidl_next::wire::Envelope,
4492 >(encoder, max_ord);
4493
4494 for i in 1..=max_ord {
4495 match i {
4496 6 => {
4497 if let Some(value) = &self.raw_vmo_size {
4498 ::fidl_next::wire::Envelope::encode_value::<
4499 ::fidl_next::wire::Uint64,
4500 ___E,
4501 >(
4502 value, preallocated.encoder, &mut out, ()
4503 )?;
4504 } else {
4505 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4506 }
4507 }
4508
4509 5 => {
4510 if let Some(value) = &self.heap {
4511 ::fidl_next::wire::Envelope::encode_value::<
4512 crate::wire::Heap<'static>,
4513 ___E,
4514 >(
4515 value, preallocated.encoder, &mut out, ()
4516 )?;
4517 } else {
4518 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4519 }
4520 }
4521
4522 4 => {
4523 if let Some(value) = &self.coherency_domain {
4524 ::fidl_next::wire::Envelope::encode_value::<
4525 crate::wire::CoherencyDomain,
4526 ___E,
4527 >(
4528 value, preallocated.encoder, &mut out, ()
4529 )?;
4530 } else {
4531 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4532 }
4533 }
4534
4535 3 => {
4536 if let Some(value) = &self.is_secure {
4537 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
4538 value,
4539 preallocated.encoder,
4540 &mut out,
4541 (),
4542 )?;
4543 } else {
4544 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4545 }
4546 }
4547
4548 2 => {
4549 if let Some(value) = &self.is_physically_contiguous {
4550 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
4551 value,
4552 preallocated.encoder,
4553 &mut out,
4554 (),
4555 )?;
4556 } else {
4557 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4558 }
4559 }
4560
4561 1 => {
4562 if let Some(value) = &self.size_bytes {
4563 ::fidl_next::wire::Envelope::encode_value::<
4564 ::fidl_next::wire::Uint64,
4565 ___E,
4566 >(
4567 value, preallocated.encoder, &mut out, ()
4568 )?;
4569 } else {
4570 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4571 }
4572 }
4573
4574 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4575 }
4576 unsafe {
4577 preallocated.write_next(out.assume_init_ref());
4578 }
4579 }
4580
4581 ::fidl_next::wire::Table::encode_len(table, max_ord);
4582
4583 Ok(())
4584 }
4585 }
4586
4587 impl<'de> ::fidl_next::FromWire<crate::wire::BufferMemorySettings<'de>> for BufferMemorySettings {
4588 #[inline]
4589 fn from_wire(wire_: crate::wire::BufferMemorySettings<'de>) -> Self {
4590 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4591
4592 let size_bytes = wire_.table.get(1);
4593
4594 let is_physically_contiguous = wire_.table.get(2);
4595
4596 let is_secure = wire_.table.get(3);
4597
4598 let coherency_domain = wire_.table.get(4);
4599
4600 let heap = wire_.table.get(5);
4601
4602 let raw_vmo_size = wire_.table.get(6);
4603
4604 Self {
4605 size_bytes: size_bytes.map(|envelope| {
4606 ::fidl_next::FromWire::from_wire(unsafe {
4607 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
4608 })
4609 }),
4610
4611 is_physically_contiguous: is_physically_contiguous.map(|envelope| {
4612 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
4613 }),
4614
4615 is_secure: is_secure.map(|envelope| {
4616 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
4617 }),
4618
4619 coherency_domain: coherency_domain.map(|envelope| {
4620 ::fidl_next::FromWire::from_wire(unsafe {
4621 envelope.read_unchecked::<crate::wire::CoherencyDomain>()
4622 })
4623 }),
4624
4625 heap: heap.map(|envelope| {
4626 ::fidl_next::FromWire::from_wire(unsafe {
4627 envelope.read_unchecked::<crate::wire::Heap<'de>>()
4628 })
4629 }),
4630
4631 raw_vmo_size: raw_vmo_size.map(|envelope| {
4632 ::fidl_next::FromWire::from_wire(unsafe {
4633 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
4634 })
4635 }),
4636 }
4637 }
4638 }
4639
4640 impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferMemorySettings<'de>>
4641 for BufferMemorySettings
4642 {
4643 #[inline]
4644 fn from_wire_ref(wire: &crate::wire::BufferMemorySettings<'de>) -> Self {
4645 Self {
4646 size_bytes: wire.table.get(1).map(|envelope| {
4647 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4648 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
4649 })
4650 }),
4651
4652 is_physically_contiguous: wire.table.get(2).map(|envelope| {
4653 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4654 envelope.deref_unchecked::<bool>()
4655 })
4656 }),
4657
4658 is_secure: wire.table.get(3).map(|envelope| {
4659 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4660 envelope.deref_unchecked::<bool>()
4661 })
4662 }),
4663
4664 coherency_domain: wire.table.get(4).map(|envelope| {
4665 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4666 envelope.deref_unchecked::<crate::wire::CoherencyDomain>()
4667 })
4668 }),
4669
4670 heap: wire.table.get(5).map(|envelope| {
4671 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4672 envelope.deref_unchecked::<crate::wire::Heap<'de>>()
4673 })
4674 }),
4675
4676 raw_vmo_size: wire.table.get(6).map(|envelope| {
4677 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4678 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
4679 })
4680 }),
4681 }
4682 }
4683 }
4684
4685 #[doc = " These settings and constraints apply to all the buffers in the collection.\n"]
4686 #[derive(Debug, Default, Clone, PartialEq)]
4687 pub struct SingleBufferSettings {
4688 pub buffer_settings: ::core::option::Option<crate::natural::BufferMemorySettings>,
4689
4690 pub image_format_constraints:
4691 ::core::option::Option<crate::natural::ImageFormatConstraints>,
4692 }
4693
4694 impl SingleBufferSettings {
4695 fn __max_ordinal(&self) -> usize {
4696 if self.image_format_constraints.is_some() {
4697 return 2;
4698 }
4699
4700 if self.buffer_settings.is_some() {
4701 return 1;
4702 }
4703
4704 0
4705 }
4706 }
4707
4708 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SingleBufferSettings<'static>, ___E>
4709 for SingleBufferSettings
4710 where
4711 ___E: ::fidl_next::Encoder + ?Sized,
4712 {
4713 #[inline]
4714 fn encode(
4715 mut self,
4716 encoder: &mut ___E,
4717 out: &mut ::core::mem::MaybeUninit<crate::wire::SingleBufferSettings<'static>>,
4718 _: (),
4719 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4720 ::fidl_next::munge!(let crate::wire::SingleBufferSettings { table } = out);
4721
4722 let max_ord = self.__max_ordinal();
4723
4724 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4725 ::fidl_next::Wire::zero_padding(&mut out);
4726
4727 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4728 ::fidl_next::wire::Envelope,
4729 >(encoder, max_ord);
4730
4731 for i in 1..=max_ord {
4732 match i {
4733 2 => {
4734 if let Some(value) = self.image_format_constraints.take() {
4735 ::fidl_next::wire::Envelope::encode_value::<
4736 crate::wire::ImageFormatConstraints<'static>,
4737 ___E,
4738 >(
4739 value, preallocated.encoder, &mut out, ()
4740 )?;
4741 } else {
4742 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4743 }
4744 }
4745
4746 1 => {
4747 if let Some(value) = self.buffer_settings.take() {
4748 ::fidl_next::wire::Envelope::encode_value::<
4749 crate::wire::BufferMemorySettings<'static>,
4750 ___E,
4751 >(
4752 value, preallocated.encoder, &mut out, ()
4753 )?;
4754 } else {
4755 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4756 }
4757 }
4758
4759 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4760 }
4761 unsafe {
4762 preallocated.write_next(out.assume_init_ref());
4763 }
4764 }
4765
4766 ::fidl_next::wire::Table::encode_len(table, max_ord);
4767
4768 Ok(())
4769 }
4770 }
4771
4772 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SingleBufferSettings<'static>, ___E>
4773 for &'a SingleBufferSettings
4774 where
4775 ___E: ::fidl_next::Encoder + ?Sized,
4776 {
4777 #[inline]
4778 fn encode(
4779 self,
4780 encoder: &mut ___E,
4781 out: &mut ::core::mem::MaybeUninit<crate::wire::SingleBufferSettings<'static>>,
4782 _: (),
4783 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4784 ::fidl_next::munge!(let crate::wire::SingleBufferSettings { table } = out);
4785
4786 let max_ord = self.__max_ordinal();
4787
4788 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4789 ::fidl_next::Wire::zero_padding(&mut out);
4790
4791 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4792 ::fidl_next::wire::Envelope,
4793 >(encoder, max_ord);
4794
4795 for i in 1..=max_ord {
4796 match i {
4797 2 => {
4798 if let Some(value) = &self.image_format_constraints {
4799 ::fidl_next::wire::Envelope::encode_value::<
4800 crate::wire::ImageFormatConstraints<'static>,
4801 ___E,
4802 >(
4803 value, preallocated.encoder, &mut out, ()
4804 )?;
4805 } else {
4806 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4807 }
4808 }
4809
4810 1 => {
4811 if let Some(value) = &self.buffer_settings {
4812 ::fidl_next::wire::Envelope::encode_value::<
4813 crate::wire::BufferMemorySettings<'static>,
4814 ___E,
4815 >(
4816 value, preallocated.encoder, &mut out, ()
4817 )?;
4818 } else {
4819 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4820 }
4821 }
4822
4823 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4824 }
4825 unsafe {
4826 preallocated.write_next(out.assume_init_ref());
4827 }
4828 }
4829
4830 ::fidl_next::wire::Table::encode_len(table, max_ord);
4831
4832 Ok(())
4833 }
4834 }
4835
4836 impl<'de> ::fidl_next::FromWire<crate::wire::SingleBufferSettings<'de>> for SingleBufferSettings {
4837 #[inline]
4838 fn from_wire(wire_: crate::wire::SingleBufferSettings<'de>) -> Self {
4839 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4840
4841 let buffer_settings = wire_.table.get(1);
4842
4843 let image_format_constraints = wire_.table.get(2);
4844
4845 Self {
4846 buffer_settings: buffer_settings.map(|envelope| {
4847 ::fidl_next::FromWire::from_wire(unsafe {
4848 envelope.read_unchecked::<crate::wire::BufferMemorySettings<'de>>()
4849 })
4850 }),
4851
4852 image_format_constraints: image_format_constraints.map(|envelope| {
4853 ::fidl_next::FromWire::from_wire(unsafe {
4854 envelope.read_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
4855 })
4856 }),
4857 }
4858 }
4859 }
4860
4861 impl<'de> ::fidl_next::FromWireRef<crate::wire::SingleBufferSettings<'de>>
4862 for SingleBufferSettings
4863 {
4864 #[inline]
4865 fn from_wire_ref(wire: &crate::wire::SingleBufferSettings<'de>) -> Self {
4866 Self {
4867 buffer_settings: wire.table.get(1).map(|envelope| {
4868 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4869 envelope.deref_unchecked::<crate::wire::BufferMemorySettings<'de>>()
4870 })
4871 }),
4872
4873 image_format_constraints: wire.table.get(2).map(|envelope| {
4874 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4875 envelope.deref_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
4876 })
4877 }),
4878 }
4879 }
4880 }
4881
4882 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4883 pub struct BufferCollectionTokenDuplicateSyncRequest {
4884 pub rights_attenuation_masks:
4885 ::core::option::Option<::std::vec::Vec<::fidl_next::fuchsia::zx::Rights>>,
4886 }
4887
4888 impl BufferCollectionTokenDuplicateSyncRequest {
4889 fn __max_ordinal(&self) -> usize {
4890 if self.rights_attenuation_masks.is_some() {
4891 return 1;
4892 }
4893
4894 0
4895 }
4896 }
4897
4898 unsafe impl<___E>
4899 ::fidl_next::Encode<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>, ___E>
4900 for BufferCollectionTokenDuplicateSyncRequest
4901 where
4902 ___E: ::fidl_next::Encoder + ?Sized,
4903 {
4904 #[inline]
4905 fn encode(
4906 mut self,
4907 encoder: &mut ___E,
4908 out: &mut ::core::mem::MaybeUninit<
4909 crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>,
4910 >,
4911 _: (),
4912 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4913 ::fidl_next::munge!(let crate::wire::BufferCollectionTokenDuplicateSyncRequest { table } = out);
4914
4915 let max_ord = self.__max_ordinal();
4916
4917 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4918 ::fidl_next::Wire::zero_padding(&mut out);
4919
4920 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4921 ::fidl_next::wire::Envelope,
4922 >(encoder, max_ord);
4923
4924 for i in 1..=max_ord {
4925 match i {
4926 1 => {
4927 if let Some(value) = self.rights_attenuation_masks.take() {
4928 ::fidl_next::wire::Envelope::encode_value::<
4929 ::fidl_next::wire::Vector<
4930 'static,
4931 ::fidl_next::wire::fuchsia::Rights,
4932 >,
4933 ___E,
4934 >(
4935 value, preallocated.encoder, &mut out, (64, ())
4936 )?;
4937 } else {
4938 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4939 }
4940 }
4941
4942 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4943 }
4944 unsafe {
4945 preallocated.write_next(out.assume_init_ref());
4946 }
4947 }
4948
4949 ::fidl_next::wire::Table::encode_len(table, max_ord);
4950
4951 Ok(())
4952 }
4953 }
4954
4955 unsafe impl<'a, ___E>
4956 ::fidl_next::Encode<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>, ___E>
4957 for &'a BufferCollectionTokenDuplicateSyncRequest
4958 where
4959 ___E: ::fidl_next::Encoder + ?Sized,
4960 {
4961 #[inline]
4962 fn encode(
4963 self,
4964 encoder: &mut ___E,
4965 out: &mut ::core::mem::MaybeUninit<
4966 crate::wire::BufferCollectionTokenDuplicateSyncRequest<'static>,
4967 >,
4968 _: (),
4969 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4970 ::fidl_next::munge!(let crate::wire::BufferCollectionTokenDuplicateSyncRequest { table } = out);
4971
4972 let max_ord = self.__max_ordinal();
4973
4974 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4975 ::fidl_next::Wire::zero_padding(&mut out);
4976
4977 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4978 ::fidl_next::wire::Envelope,
4979 >(encoder, max_ord);
4980
4981 for i in 1..=max_ord {
4982 match i {
4983 1 => {
4984 if let Some(value) = &self.rights_attenuation_masks {
4985 ::fidl_next::wire::Envelope::encode_value::<
4986 ::fidl_next::wire::Vector<
4987 'static,
4988 ::fidl_next::wire::fuchsia::Rights,
4989 >,
4990 ___E,
4991 >(
4992 value, preallocated.encoder, &mut out, (64, ())
4993 )?;
4994 } else {
4995 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4996 }
4997 }
4998
4999 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5000 }
5001 unsafe {
5002 preallocated.write_next(out.assume_init_ref());
5003 }
5004 }
5005
5006 ::fidl_next::wire::Table::encode_len(table, max_ord);
5007
5008 Ok(())
5009 }
5010 }
5011
5012 impl<'de> ::fidl_next::FromWire<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>>
5013 for BufferCollectionTokenDuplicateSyncRequest
5014 {
5015 #[inline]
5016 fn from_wire(wire_: crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>) -> Self {
5017 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5018
5019 let rights_attenuation_masks = wire_.table.get(1);
5020
5021 Self {
5022
5023
5024 rights_attenuation_masks: rights_attenuation_masks.map(|envelope| ::fidl_next::FromWire::from_wire(
5025 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5026 )),
5027
5028 }
5029 }
5030 }
5031
5032 impl<'de> ::fidl_next::FromWireRef<crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>>
5033 for BufferCollectionTokenDuplicateSyncRequest
5034 {
5035 #[inline]
5036 fn from_wire_ref(
5037 wire: &crate::wire::BufferCollectionTokenDuplicateSyncRequest<'de>,
5038 ) -> Self {
5039 Self {
5040
5041
5042 rights_attenuation_masks: wire.table.get(1)
5043 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5044 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5045 )),
5046
5047 }
5048 }
5049 }
5050
5051 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5052 pub struct BufferCollectionTokenGroupCreateChildrenSyncRequest {
5053 pub rights_attenuation_masks:
5054 ::core::option::Option<::std::vec::Vec<::fidl_next::fuchsia::zx::Rights>>,
5055 }
5056
5057 impl BufferCollectionTokenGroupCreateChildrenSyncRequest {
5058 fn __max_ordinal(&self) -> usize {
5059 if self.rights_attenuation_masks.is_some() {
5060 return 1;
5061 }
5062
5063 0
5064 }
5065 }
5066
5067 unsafe impl<___E>
5068 ::fidl_next::Encode<
5069 crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5070 ___E,
5071 > for BufferCollectionTokenGroupCreateChildrenSyncRequest
5072 where
5073 ___E: ::fidl_next::Encoder + ?Sized,
5074 {
5075 #[inline]
5076 fn encode(
5077 mut self,
5078 encoder: &mut ___E,
5079 out: &mut ::core::mem::MaybeUninit<
5080 crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5081 >,
5082 _: (),
5083 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5084 ::fidl_next::munge!(let crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest { table } = out);
5085
5086 let max_ord = self.__max_ordinal();
5087
5088 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5089 ::fidl_next::Wire::zero_padding(&mut out);
5090
5091 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5092 ::fidl_next::wire::Envelope,
5093 >(encoder, max_ord);
5094
5095 for i in 1..=max_ord {
5096 match i {
5097 1 => {
5098 if let Some(value) = self.rights_attenuation_masks.take() {
5099 ::fidl_next::wire::Envelope::encode_value::<
5100 ::fidl_next::wire::Vector<
5101 'static,
5102 ::fidl_next::wire::fuchsia::Rights,
5103 >,
5104 ___E,
5105 >(
5106 value, preallocated.encoder, &mut out, (64, ())
5107 )?;
5108 } else {
5109 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5110 }
5111 }
5112
5113 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5114 }
5115 unsafe {
5116 preallocated.write_next(out.assume_init_ref());
5117 }
5118 }
5119
5120 ::fidl_next::wire::Table::encode_len(table, max_ord);
5121
5122 Ok(())
5123 }
5124 }
5125
5126 unsafe impl<'a, ___E>
5127 ::fidl_next::Encode<
5128 crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5129 ___E,
5130 > for &'a BufferCollectionTokenGroupCreateChildrenSyncRequest
5131 where
5132 ___E: ::fidl_next::Encoder + ?Sized,
5133 {
5134 #[inline]
5135 fn encode(
5136 self,
5137 encoder: &mut ___E,
5138 out: &mut ::core::mem::MaybeUninit<
5139 crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'static>,
5140 >,
5141 _: (),
5142 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5143 ::fidl_next::munge!(let crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest { table } = out);
5144
5145 let max_ord = self.__max_ordinal();
5146
5147 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5148 ::fidl_next::Wire::zero_padding(&mut out);
5149
5150 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5151 ::fidl_next::wire::Envelope,
5152 >(encoder, max_ord);
5153
5154 for i in 1..=max_ord {
5155 match i {
5156 1 => {
5157 if let Some(value) = &self.rights_attenuation_masks {
5158 ::fidl_next::wire::Envelope::encode_value::<
5159 ::fidl_next::wire::Vector<
5160 'static,
5161 ::fidl_next::wire::fuchsia::Rights,
5162 >,
5163 ___E,
5164 >(
5165 value, preallocated.encoder, &mut out, (64, ())
5166 )?;
5167 } else {
5168 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5169 }
5170 }
5171
5172 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5173 }
5174 unsafe {
5175 preallocated.write_next(out.assume_init_ref());
5176 }
5177 }
5178
5179 ::fidl_next::wire::Table::encode_len(table, max_ord);
5180
5181 Ok(())
5182 }
5183 }
5184
5185 impl<'de>
5186 ::fidl_next::FromWire<crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>>
5187 for BufferCollectionTokenGroupCreateChildrenSyncRequest
5188 {
5189 #[inline]
5190 fn from_wire(
5191 wire_: crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5192 ) -> Self {
5193 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5194
5195 let rights_attenuation_masks = wire_.table.get(1);
5196
5197 Self {
5198
5199
5200 rights_attenuation_masks: rights_attenuation_masks.map(|envelope| ::fidl_next::FromWire::from_wire(
5201 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5202 )),
5203
5204 }
5205 }
5206 }
5207
5208 impl<'de>
5209 ::fidl_next::FromWireRef<
5210 crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5211 > for BufferCollectionTokenGroupCreateChildrenSyncRequest
5212 {
5213 #[inline]
5214 fn from_wire_ref(
5215 wire: &crate::wire::BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>,
5216 ) -> Self {
5217 Self {
5218
5219
5220 rights_attenuation_masks: wire.table.get(1)
5221 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5222 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>() }
5223 )),
5224
5225 }
5226 }
5227 }
5228
5229 #[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"]
5230 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5231 pub struct FormatCostKey {
5232 pub pixel_format:
5233 ::core::option::Option<::fidl_next_common_fuchsia_images2::natural::PixelFormat>,
5234
5235 pub pixel_format_modifier: ::core::option::Option<
5236 ::fidl_next_common_fuchsia_images2::natural::PixelFormatModifier,
5237 >,
5238
5239 pub buffer_usage_bits: ::core::option::Option<crate::natural::BufferUsage>,
5240 }
5241
5242 impl FormatCostKey {
5243 fn __max_ordinal(&self) -> usize {
5244 if self.buffer_usage_bits.is_some() {
5245 return 3;
5246 }
5247
5248 if self.pixel_format_modifier.is_some() {
5249 return 2;
5250 }
5251
5252 if self.pixel_format.is_some() {
5253 return 1;
5254 }
5255
5256 0
5257 }
5258 }
5259
5260 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCostKey<'static>, ___E> for FormatCostKey
5261 where
5262 ___E: ::fidl_next::Encoder + ?Sized,
5263 {
5264 #[inline]
5265 fn encode(
5266 mut self,
5267 encoder: &mut ___E,
5268 out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostKey<'static>>,
5269 _: (),
5270 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5271 ::fidl_next::munge!(let crate::wire::FormatCostKey { table } = out);
5272
5273 let max_ord = self.__max_ordinal();
5274
5275 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5276 ::fidl_next::Wire::zero_padding(&mut out);
5277
5278 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5279 ::fidl_next::wire::Envelope,
5280 >(encoder, max_ord);
5281
5282 for i in 1..=max_ord {
5283 match i {
5284 3 => {
5285 if let Some(value) = self.buffer_usage_bits.take() {
5286 ::fidl_next::wire::Envelope::encode_value::<
5287 crate::wire::BufferUsage<'static>,
5288 ___E,
5289 >(
5290 value, preallocated.encoder, &mut out, ()
5291 )?;
5292 } else {
5293 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5294 }
5295 }
5296
5297 2 => {
5298 if let Some(value) = self.pixel_format_modifier.take() {
5299 ::fidl_next::wire::Envelope::encode_value::<
5300 ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
5301 ___E,
5302 >(
5303 value, preallocated.encoder, &mut out, ()
5304 )?;
5305 } else {
5306 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5307 }
5308 }
5309
5310 1 => {
5311 if let Some(value) = self.pixel_format.take() {
5312 ::fidl_next::wire::Envelope::encode_value::<
5313 ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
5314 ___E,
5315 >(
5316 value, preallocated.encoder, &mut out, ()
5317 )?;
5318 } else {
5319 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5320 }
5321 }
5322
5323 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5324 }
5325 unsafe {
5326 preallocated.write_next(out.assume_init_ref());
5327 }
5328 }
5329
5330 ::fidl_next::wire::Table::encode_len(table, max_ord);
5331
5332 Ok(())
5333 }
5334 }
5335
5336 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCostKey<'static>, ___E>
5337 for &'a FormatCostKey
5338 where
5339 ___E: ::fidl_next::Encoder + ?Sized,
5340 {
5341 #[inline]
5342 fn encode(
5343 self,
5344 encoder: &mut ___E,
5345 out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostKey<'static>>,
5346 _: (),
5347 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5348 ::fidl_next::munge!(let crate::wire::FormatCostKey { table } = out);
5349
5350 let max_ord = self.__max_ordinal();
5351
5352 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5353 ::fidl_next::Wire::zero_padding(&mut out);
5354
5355 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5356 ::fidl_next::wire::Envelope,
5357 >(encoder, max_ord);
5358
5359 for i in 1..=max_ord {
5360 match i {
5361 3 => {
5362 if let Some(value) = &self.buffer_usage_bits {
5363 ::fidl_next::wire::Envelope::encode_value::<
5364 crate::wire::BufferUsage<'static>,
5365 ___E,
5366 >(
5367 value, preallocated.encoder, &mut out, ()
5368 )?;
5369 } else {
5370 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5371 }
5372 }
5373
5374 2 => {
5375 if let Some(value) = &self.pixel_format_modifier {
5376 ::fidl_next::wire::Envelope::encode_value::<
5377 ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
5378 ___E,
5379 >(
5380 value, preallocated.encoder, &mut out, ()
5381 )?;
5382 } else {
5383 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5384 }
5385 }
5386
5387 1 => {
5388 if let Some(value) = &self.pixel_format {
5389 ::fidl_next::wire::Envelope::encode_value::<
5390 ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
5391 ___E,
5392 >(
5393 value, preallocated.encoder, &mut out, ()
5394 )?;
5395 } else {
5396 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5397 }
5398 }
5399
5400 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5401 }
5402 unsafe {
5403 preallocated.write_next(out.assume_init_ref());
5404 }
5405 }
5406
5407 ::fidl_next::wire::Table::encode_len(table, max_ord);
5408
5409 Ok(())
5410 }
5411 }
5412
5413 impl<'de> ::fidl_next::FromWire<crate::wire::FormatCostKey<'de>> for FormatCostKey {
5414 #[inline]
5415 fn from_wire(wire_: crate::wire::FormatCostKey<'de>) -> Self {
5416 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5417
5418 let pixel_format = wire_.table.get(1);
5419
5420 let pixel_format_modifier = wire_.table.get(2);
5421
5422 let buffer_usage_bits = wire_.table.get(3);
5423
5424 Self {
5425
5426
5427 pixel_format: pixel_format.map(|envelope| ::fidl_next::FromWire::from_wire(
5428 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
5429 )),
5430
5431
5432 pixel_format_modifier: pixel_format_modifier.map(|envelope| ::fidl_next::FromWire::from_wire(
5433 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
5434 )),
5435
5436
5437 buffer_usage_bits: buffer_usage_bits.map(|envelope| ::fidl_next::FromWire::from_wire(
5438 unsafe { envelope.read_unchecked::<crate::wire::BufferUsage<'de>>() }
5439 )),
5440
5441 }
5442 }
5443 }
5444
5445 impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCostKey<'de>> for FormatCostKey {
5446 #[inline]
5447 fn from_wire_ref(wire: &crate::wire::FormatCostKey<'de>) -> Self {
5448 Self {
5449
5450
5451 pixel_format: wire.table.get(1)
5452 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5453 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>() }
5454 )),
5455
5456
5457 pixel_format_modifier: wire.table.get(2)
5458 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5459 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>() }
5460 )),
5461
5462
5463 buffer_usage_bits: wire.table.get(3)
5464 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5465 unsafe { envelope.deref_unchecked::<crate::wire::BufferUsage<'de>>() }
5466 )),
5467
5468 }
5469 }
5470 }
5471
5472 #[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"]
5473 #[derive(Debug, Default, Copy, Clone, PartialEq, PartialOrd)]
5474 pub struct FormatCostEntry {
5475 pub key: ::core::option::Option<crate::natural::FormatCostKey>,
5476
5477 pub cost: ::core::option::Option<f32>,
5478 }
5479
5480 impl FormatCostEntry {
5481 fn __max_ordinal(&self) -> usize {
5482 if self.cost.is_some() {
5483 return 2;
5484 }
5485
5486 if self.key.is_some() {
5487 return 1;
5488 }
5489
5490 0
5491 }
5492 }
5493
5494 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCostEntry<'static>, ___E>
5495 for FormatCostEntry
5496 where
5497 ___E: ::fidl_next::Encoder + ?Sized,
5498 {
5499 #[inline]
5500 fn encode(
5501 mut self,
5502 encoder: &mut ___E,
5503 out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostEntry<'static>>,
5504 _: (),
5505 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5506 ::fidl_next::munge!(let crate::wire::FormatCostEntry { table } = out);
5507
5508 let max_ord = self.__max_ordinal();
5509
5510 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5511 ::fidl_next::Wire::zero_padding(&mut out);
5512
5513 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5514 ::fidl_next::wire::Envelope,
5515 >(encoder, max_ord);
5516
5517 for i in 1..=max_ord {
5518 match i {
5519 2 => {
5520 if let Some(value) = self.cost.take() {
5521 ::fidl_next::wire::Envelope::encode_value::<
5522 ::fidl_next::wire::Float32,
5523 ___E,
5524 >(
5525 value, preallocated.encoder, &mut out, ()
5526 )?;
5527 } else {
5528 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5529 }
5530 }
5531
5532 1 => {
5533 if let Some(value) = self.key.take() {
5534 ::fidl_next::wire::Envelope::encode_value::<
5535 crate::wire::FormatCostKey<'static>,
5536 ___E,
5537 >(
5538 value, preallocated.encoder, &mut out, ()
5539 )?;
5540 } else {
5541 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5542 }
5543 }
5544
5545 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5546 }
5547 unsafe {
5548 preallocated.write_next(out.assume_init_ref());
5549 }
5550 }
5551
5552 ::fidl_next::wire::Table::encode_len(table, max_ord);
5553
5554 Ok(())
5555 }
5556 }
5557
5558 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCostEntry<'static>, ___E>
5559 for &'a FormatCostEntry
5560 where
5561 ___E: ::fidl_next::Encoder + ?Sized,
5562 {
5563 #[inline]
5564 fn encode(
5565 self,
5566 encoder: &mut ___E,
5567 out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCostEntry<'static>>,
5568 _: (),
5569 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5570 ::fidl_next::munge!(let crate::wire::FormatCostEntry { table } = out);
5571
5572 let max_ord = self.__max_ordinal();
5573
5574 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5575 ::fidl_next::Wire::zero_padding(&mut out);
5576
5577 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5578 ::fidl_next::wire::Envelope,
5579 >(encoder, max_ord);
5580
5581 for i in 1..=max_ord {
5582 match i {
5583 2 => {
5584 if let Some(value) = &self.cost {
5585 ::fidl_next::wire::Envelope::encode_value::<
5586 ::fidl_next::wire::Float32,
5587 ___E,
5588 >(
5589 value, preallocated.encoder, &mut out, ()
5590 )?;
5591 } else {
5592 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5593 }
5594 }
5595
5596 1 => {
5597 if let Some(value) = &self.key {
5598 ::fidl_next::wire::Envelope::encode_value::<
5599 crate::wire::FormatCostKey<'static>,
5600 ___E,
5601 >(
5602 value, preallocated.encoder, &mut out, ()
5603 )?;
5604 } else {
5605 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5606 }
5607 }
5608
5609 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5610 }
5611 unsafe {
5612 preallocated.write_next(out.assume_init_ref());
5613 }
5614 }
5615
5616 ::fidl_next::wire::Table::encode_len(table, max_ord);
5617
5618 Ok(())
5619 }
5620 }
5621
5622 impl<'de> ::fidl_next::FromWire<crate::wire::FormatCostEntry<'de>> for FormatCostEntry {
5623 #[inline]
5624 fn from_wire(wire_: crate::wire::FormatCostEntry<'de>) -> Self {
5625 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5626
5627 let key = wire_.table.get(1);
5628
5629 let cost = wire_.table.get(2);
5630
5631 Self {
5632 key: key.map(|envelope| {
5633 ::fidl_next::FromWire::from_wire(unsafe {
5634 envelope.read_unchecked::<crate::wire::FormatCostKey<'de>>()
5635 })
5636 }),
5637
5638 cost: cost.map(|envelope| {
5639 ::fidl_next::FromWire::from_wire(unsafe {
5640 envelope.read_unchecked::<::fidl_next::wire::Float32>()
5641 })
5642 }),
5643 }
5644 }
5645 }
5646
5647 impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCostEntry<'de>> for FormatCostEntry {
5648 #[inline]
5649 fn from_wire_ref(wire: &crate::wire::FormatCostEntry<'de>) -> Self {
5650 Self {
5651 key: wire.table.get(1).map(|envelope| {
5652 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5653 envelope.deref_unchecked::<crate::wire::FormatCostKey<'de>>()
5654 })
5655 }),
5656
5657 cost: wire.table.get(2).map(|envelope| {
5658 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5659 envelope.deref_unchecked::<::fidl_next::wire::Float32>()
5660 })
5661 }),
5662 }
5663 }
5664 }
5665
5666 #[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"]
5667 #[derive(Debug, Default, Clone, PartialEq, PartialOrd)]
5668 pub struct Config {
5669 pub format_costs: ::core::option::Option<::std::vec::Vec<crate::natural::FormatCostEntry>>,
5670 }
5671
5672 impl Config {
5673 fn __max_ordinal(&self) -> usize {
5674 if self.format_costs.is_some() {
5675 return 1;
5676 }
5677
5678 0
5679 }
5680 }
5681
5682 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Config<'static>, ___E> for Config
5683 where
5684 ___E: ::fidl_next::Encoder + ?Sized,
5685 {
5686 #[inline]
5687 fn encode(
5688 mut self,
5689 encoder: &mut ___E,
5690 out: &mut ::core::mem::MaybeUninit<crate::wire::Config<'static>>,
5691 _: (),
5692 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5693 ::fidl_next::munge!(let crate::wire::Config { table } = out);
5694
5695 let max_ord = self.__max_ordinal();
5696
5697 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5698 ::fidl_next::Wire::zero_padding(&mut out);
5699
5700 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5701 ::fidl_next::wire::Envelope,
5702 >(encoder, max_ord);
5703
5704 for i in 1..=max_ord {
5705 match i {
5706 1 => {
5707 if let Some(value) = self.format_costs.take() {
5708 ::fidl_next::wire::Envelope::encode_value::<
5709 ::fidl_next::wire::Vector<
5710 'static,
5711 crate::wire::FormatCostEntry<'static>,
5712 >,
5713 ___E,
5714 >(
5715 value, preallocated.encoder, &mut out, (4294967295, ())
5716 )?;
5717 } else {
5718 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5719 }
5720 }
5721
5722 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5723 }
5724 unsafe {
5725 preallocated.write_next(out.assume_init_ref());
5726 }
5727 }
5728
5729 ::fidl_next::wire::Table::encode_len(table, max_ord);
5730
5731 Ok(())
5732 }
5733 }
5734
5735 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Config<'static>, ___E> for &'a Config
5736 where
5737 ___E: ::fidl_next::Encoder + ?Sized,
5738 {
5739 #[inline]
5740 fn encode(
5741 self,
5742 encoder: &mut ___E,
5743 out: &mut ::core::mem::MaybeUninit<crate::wire::Config<'static>>,
5744 _: (),
5745 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5746 ::fidl_next::munge!(let crate::wire::Config { table } = out);
5747
5748 let max_ord = self.__max_ordinal();
5749
5750 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5751 ::fidl_next::Wire::zero_padding(&mut out);
5752
5753 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5754 ::fidl_next::wire::Envelope,
5755 >(encoder, max_ord);
5756
5757 for i in 1..=max_ord {
5758 match i {
5759 1 => {
5760 if let Some(value) = &self.format_costs {
5761 ::fidl_next::wire::Envelope::encode_value::<
5762 ::fidl_next::wire::Vector<
5763 'static,
5764 crate::wire::FormatCostEntry<'static>,
5765 >,
5766 ___E,
5767 >(
5768 value, preallocated.encoder, &mut out, (4294967295, ())
5769 )?;
5770 } else {
5771 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5772 }
5773 }
5774
5775 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5776 }
5777 unsafe {
5778 preallocated.write_next(out.assume_init_ref());
5779 }
5780 }
5781
5782 ::fidl_next::wire::Table::encode_len(table, max_ord);
5783
5784 Ok(())
5785 }
5786 }
5787
5788 impl<'de> ::fidl_next::FromWire<crate::wire::Config<'de>> for Config {
5789 #[inline]
5790 fn from_wire(wire_: crate::wire::Config<'de>) -> Self {
5791 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5792
5793 let format_costs = wire_.table.get(1);
5794
5795 Self {
5796
5797
5798 format_costs: format_costs.map(|envelope| ::fidl_next::FromWire::from_wire(
5799 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
5800 )),
5801
5802 }
5803 }
5804 }
5805
5806 impl<'de> ::fidl_next::FromWireRef<crate::wire::Config<'de>> for Config {
5807 #[inline]
5808 fn from_wire_ref(wire: &crate::wire::Config<'de>) -> Self {
5809 Self {
5810
5811
5812 format_costs: wire.table.get(1)
5813 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5814 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
5815 )),
5816
5817 }
5818 }
5819 }
5820
5821 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5822 pub struct DynamicSecureHeap {
5823 pub heap: ::core::option::Option<crate::natural::Heap>,
5824 }
5825
5826 impl DynamicSecureHeap {
5827 fn __max_ordinal(&self) -> usize {
5828 if self.heap.is_some() {
5829 return 1;
5830 }
5831
5832 0
5833 }
5834 }
5835
5836 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DynamicSecureHeap<'static>, ___E>
5837 for DynamicSecureHeap
5838 where
5839 ___E: ::fidl_next::Encoder + ?Sized,
5840 {
5841 #[inline]
5842 fn encode(
5843 mut self,
5844 encoder: &mut ___E,
5845 out: &mut ::core::mem::MaybeUninit<crate::wire::DynamicSecureHeap<'static>>,
5846 _: (),
5847 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5848 ::fidl_next::munge!(let crate::wire::DynamicSecureHeap { table } = out);
5849
5850 let max_ord = self.__max_ordinal();
5851
5852 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5853 ::fidl_next::Wire::zero_padding(&mut out);
5854
5855 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5856 ::fidl_next::wire::Envelope,
5857 >(encoder, max_ord);
5858
5859 for i in 1..=max_ord {
5860 match i {
5861 1 => {
5862 if let Some(value) = self.heap.take() {
5863 ::fidl_next::wire::Envelope::encode_value::<
5864 crate::wire::Heap<'static>,
5865 ___E,
5866 >(
5867 value, preallocated.encoder, &mut out, ()
5868 )?;
5869 } else {
5870 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5871 }
5872 }
5873
5874 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5875 }
5876 unsafe {
5877 preallocated.write_next(out.assume_init_ref());
5878 }
5879 }
5880
5881 ::fidl_next::wire::Table::encode_len(table, max_ord);
5882
5883 Ok(())
5884 }
5885 }
5886
5887 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DynamicSecureHeap<'static>, ___E>
5888 for &'a DynamicSecureHeap
5889 where
5890 ___E: ::fidl_next::Encoder + ?Sized,
5891 {
5892 #[inline]
5893 fn encode(
5894 self,
5895 encoder: &mut ___E,
5896 out: &mut ::core::mem::MaybeUninit<crate::wire::DynamicSecureHeap<'static>>,
5897 _: (),
5898 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5899 ::fidl_next::munge!(let crate::wire::DynamicSecureHeap { table } = out);
5900
5901 let max_ord = self.__max_ordinal();
5902
5903 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5904 ::fidl_next::Wire::zero_padding(&mut out);
5905
5906 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5907 ::fidl_next::wire::Envelope,
5908 >(encoder, max_ord);
5909
5910 for i in 1..=max_ord {
5911 match i {
5912 1 => {
5913 if let Some(value) = &self.heap {
5914 ::fidl_next::wire::Envelope::encode_value::<
5915 crate::wire::Heap<'static>,
5916 ___E,
5917 >(
5918 value, preallocated.encoder, &mut out, ()
5919 )?;
5920 } else {
5921 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5922 }
5923 }
5924
5925 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5926 }
5927 unsafe {
5928 preallocated.write_next(out.assume_init_ref());
5929 }
5930 }
5931
5932 ::fidl_next::wire::Table::encode_len(table, max_ord);
5933
5934 Ok(())
5935 }
5936 }
5937
5938 impl<'de> ::fidl_next::FromWire<crate::wire::DynamicSecureHeap<'de>> for DynamicSecureHeap {
5939 #[inline]
5940 fn from_wire(wire_: crate::wire::DynamicSecureHeap<'de>) -> Self {
5941 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5942
5943 let heap = wire_.table.get(1);
5944
5945 Self {
5946 heap: heap.map(|envelope| {
5947 ::fidl_next::FromWire::from_wire(unsafe {
5948 envelope.read_unchecked::<crate::wire::Heap<'de>>()
5949 })
5950 }),
5951 }
5952 }
5953 }
5954
5955 impl<'de> ::fidl_next::FromWireRef<crate::wire::DynamicSecureHeap<'de>> for DynamicSecureHeap {
5956 #[inline]
5957 fn from_wire_ref(wire: &crate::wire::DynamicSecureHeap<'de>) -> Self {
5958 Self {
5959 heap: wire.table.get(1).map(|envelope| {
5960 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5961 envelope.deref_unchecked::<crate::wire::Heap<'de>>()
5962 })
5963 }),
5964 }
5965 }
5966 }
5967
5968 #[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"]
5969 #[derive(Debug, Default, Clone, PartialEq, PartialOrd)]
5970 pub struct FormatCosts {
5971 pub format_costs: ::core::option::Option<::std::vec::Vec<crate::natural::FormatCostEntry>>,
5972 }
5973
5974 impl FormatCosts {
5975 fn __max_ordinal(&self) -> usize {
5976 if self.format_costs.is_some() {
5977 return 1;
5978 }
5979
5980 0
5981 }
5982 }
5983
5984 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormatCosts<'static>, ___E> for FormatCosts
5985 where
5986 ___E: ::fidl_next::Encoder + ?Sized,
5987 {
5988 #[inline]
5989 fn encode(
5990 mut self,
5991 encoder: &mut ___E,
5992 out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCosts<'static>>,
5993 _: (),
5994 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5995 ::fidl_next::munge!(let crate::wire::FormatCosts { table } = out);
5996
5997 let max_ord = self.__max_ordinal();
5998
5999 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6000 ::fidl_next::Wire::zero_padding(&mut out);
6001
6002 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6003 ::fidl_next::wire::Envelope,
6004 >(encoder, max_ord);
6005
6006 for i in 1..=max_ord {
6007 match i {
6008 1 => {
6009 if let Some(value) = self.format_costs.take() {
6010 ::fidl_next::wire::Envelope::encode_value::<
6011 ::fidl_next::wire::Vector<
6012 'static,
6013 crate::wire::FormatCostEntry<'static>,
6014 >,
6015 ___E,
6016 >(
6017 value, preallocated.encoder, &mut out, (4294967295, ())
6018 )?;
6019 } else {
6020 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6021 }
6022 }
6023
6024 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6025 }
6026 unsafe {
6027 preallocated.write_next(out.assume_init_ref());
6028 }
6029 }
6030
6031 ::fidl_next::wire::Table::encode_len(table, max_ord);
6032
6033 Ok(())
6034 }
6035 }
6036
6037 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FormatCosts<'static>, ___E>
6038 for &'a FormatCosts
6039 where
6040 ___E: ::fidl_next::Encoder + ?Sized,
6041 {
6042 #[inline]
6043 fn encode(
6044 self,
6045 encoder: &mut ___E,
6046 out: &mut ::core::mem::MaybeUninit<crate::wire::FormatCosts<'static>>,
6047 _: (),
6048 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6049 ::fidl_next::munge!(let crate::wire::FormatCosts { table } = out);
6050
6051 let max_ord = self.__max_ordinal();
6052
6053 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6054 ::fidl_next::Wire::zero_padding(&mut out);
6055
6056 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6057 ::fidl_next::wire::Envelope,
6058 >(encoder, max_ord);
6059
6060 for i in 1..=max_ord {
6061 match i {
6062 1 => {
6063 if let Some(value) = &self.format_costs {
6064 ::fidl_next::wire::Envelope::encode_value::<
6065 ::fidl_next::wire::Vector<
6066 'static,
6067 crate::wire::FormatCostEntry<'static>,
6068 >,
6069 ___E,
6070 >(
6071 value, preallocated.encoder, &mut out, (4294967295, ())
6072 )?;
6073 } else {
6074 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6075 }
6076 }
6077
6078 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6079 }
6080 unsafe {
6081 preallocated.write_next(out.assume_init_ref());
6082 }
6083 }
6084
6085 ::fidl_next::wire::Table::encode_len(table, max_ord);
6086
6087 Ok(())
6088 }
6089 }
6090
6091 impl<'de> ::fidl_next::FromWire<crate::wire::FormatCosts<'de>> for FormatCosts {
6092 #[inline]
6093 fn from_wire(wire_: crate::wire::FormatCosts<'de>) -> Self {
6094 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6095
6096 let format_costs = wire_.table.get(1);
6097
6098 Self {
6099
6100
6101 format_costs: format_costs.map(|envelope| ::fidl_next::FromWire::from_wire(
6102 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
6103 )),
6104
6105 }
6106 }
6107 }
6108
6109 impl<'de> ::fidl_next::FromWireRef<crate::wire::FormatCosts<'de>> for FormatCosts {
6110 #[inline]
6111 fn from_wire_ref(wire: &crate::wire::FormatCosts<'de>) -> Self {
6112 Self {
6113
6114
6115 format_costs: wire.table.get(1)
6116 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6117 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>() }
6118 )),
6119
6120 }
6121 }
6122 }
6123
6124 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6125 pub struct SecureHeapRange {
6126 pub physical_address: ::core::option::Option<u64>,
6127
6128 pub size_bytes: ::core::option::Option<u64>,
6129 }
6130
6131 impl SecureHeapRange {
6132 fn __max_ordinal(&self) -> usize {
6133 if self.size_bytes.is_some() {
6134 return 2;
6135 }
6136
6137 if self.physical_address.is_some() {
6138 return 1;
6139 }
6140
6141 0
6142 }
6143 }
6144
6145 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapRange<'static>, ___E>
6146 for SecureHeapRange
6147 where
6148 ___E: ::fidl_next::Encoder + ?Sized,
6149 {
6150 #[inline]
6151 fn encode(
6152 mut self,
6153 encoder: &mut ___E,
6154 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapRange<'static>>,
6155 _: (),
6156 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6157 ::fidl_next::munge!(let crate::wire::SecureHeapRange { table } = out);
6158
6159 let max_ord = self.__max_ordinal();
6160
6161 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6162 ::fidl_next::Wire::zero_padding(&mut out);
6163
6164 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6165 ::fidl_next::wire::Envelope,
6166 >(encoder, max_ord);
6167
6168 for i in 1..=max_ord {
6169 match i {
6170 2 => {
6171 if let Some(value) = self.size_bytes.take() {
6172 ::fidl_next::wire::Envelope::encode_value::<
6173 ::fidl_next::wire::Uint64,
6174 ___E,
6175 >(
6176 value, preallocated.encoder, &mut out, ()
6177 )?;
6178 } else {
6179 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6180 }
6181 }
6182
6183 1 => {
6184 if let Some(value) = self.physical_address.take() {
6185 ::fidl_next::wire::Envelope::encode_value::<
6186 ::fidl_next::wire::Uint64,
6187 ___E,
6188 >(
6189 value, preallocated.encoder, &mut out, ()
6190 )?;
6191 } else {
6192 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6193 }
6194 }
6195
6196 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6197 }
6198 unsafe {
6199 preallocated.write_next(out.assume_init_ref());
6200 }
6201 }
6202
6203 ::fidl_next::wire::Table::encode_len(table, max_ord);
6204
6205 Ok(())
6206 }
6207 }
6208
6209 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapRange<'static>, ___E>
6210 for &'a SecureHeapRange
6211 where
6212 ___E: ::fidl_next::Encoder + ?Sized,
6213 {
6214 #[inline]
6215 fn encode(
6216 self,
6217 encoder: &mut ___E,
6218 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapRange<'static>>,
6219 _: (),
6220 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6221 ::fidl_next::munge!(let crate::wire::SecureHeapRange { table } = out);
6222
6223 let max_ord = self.__max_ordinal();
6224
6225 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6226 ::fidl_next::Wire::zero_padding(&mut out);
6227
6228 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6229 ::fidl_next::wire::Envelope,
6230 >(encoder, max_ord);
6231
6232 for i in 1..=max_ord {
6233 match i {
6234 2 => {
6235 if let Some(value) = &self.size_bytes {
6236 ::fidl_next::wire::Envelope::encode_value::<
6237 ::fidl_next::wire::Uint64,
6238 ___E,
6239 >(
6240 value, preallocated.encoder, &mut out, ()
6241 )?;
6242 } else {
6243 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6244 }
6245 }
6246
6247 1 => {
6248 if let Some(value) = &self.physical_address {
6249 ::fidl_next::wire::Envelope::encode_value::<
6250 ::fidl_next::wire::Uint64,
6251 ___E,
6252 >(
6253 value, preallocated.encoder, &mut out, ()
6254 )?;
6255 } else {
6256 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6257 }
6258 }
6259
6260 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6261 }
6262 unsafe {
6263 preallocated.write_next(out.assume_init_ref());
6264 }
6265 }
6266
6267 ::fidl_next::wire::Table::encode_len(table, max_ord);
6268
6269 Ok(())
6270 }
6271 }
6272
6273 impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapRange<'de>> for SecureHeapRange {
6274 #[inline]
6275 fn from_wire(wire_: crate::wire::SecureHeapRange<'de>) -> Self {
6276 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6277
6278 let physical_address = wire_.table.get(1);
6279
6280 let size_bytes = wire_.table.get(2);
6281
6282 Self {
6283 physical_address: physical_address.map(|envelope| {
6284 ::fidl_next::FromWire::from_wire(unsafe {
6285 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6286 })
6287 }),
6288
6289 size_bytes: size_bytes.map(|envelope| {
6290 ::fidl_next::FromWire::from_wire(unsafe {
6291 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6292 })
6293 }),
6294 }
6295 }
6296 }
6297
6298 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapRange<'de>> for SecureHeapRange {
6299 #[inline]
6300 fn from_wire_ref(wire: &crate::wire::SecureHeapRange<'de>) -> Self {
6301 Self {
6302 physical_address: wire.table.get(1).map(|envelope| {
6303 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6304 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6305 })
6306 }),
6307
6308 size_bytes: wire.table.get(2).map(|envelope| {
6309 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6310 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6311 })
6312 }),
6313 }
6314 }
6315 }
6316
6317 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6318 pub struct SecureHeapAndRange {
6319 pub heap: ::core::option::Option<crate::natural::Heap>,
6320
6321 pub range: ::core::option::Option<crate::natural::SecureHeapRange>,
6322 }
6323
6324 impl SecureHeapAndRange {
6325 fn __max_ordinal(&self) -> usize {
6326 if self.range.is_some() {
6327 return 2;
6328 }
6329
6330 if self.heap.is_some() {
6331 return 1;
6332 }
6333
6334 0
6335 }
6336 }
6337
6338 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRange<'static>, ___E>
6339 for SecureHeapAndRange
6340 where
6341 ___E: ::fidl_next::Encoder + ?Sized,
6342 {
6343 #[inline]
6344 fn encode(
6345 mut self,
6346 encoder: &mut ___E,
6347 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRange<'static>>,
6348 _: (),
6349 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6350 ::fidl_next::munge!(let crate::wire::SecureHeapAndRange { table } = out);
6351
6352 let max_ord = self.__max_ordinal();
6353
6354 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6355 ::fidl_next::Wire::zero_padding(&mut out);
6356
6357 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6358 ::fidl_next::wire::Envelope,
6359 >(encoder, max_ord);
6360
6361 for i in 1..=max_ord {
6362 match i {
6363 2 => {
6364 if let Some(value) = self.range.take() {
6365 ::fidl_next::wire::Envelope::encode_value::<
6366 crate::wire::SecureHeapRange<'static>,
6367 ___E,
6368 >(
6369 value, preallocated.encoder, &mut out, ()
6370 )?;
6371 } else {
6372 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6373 }
6374 }
6375
6376 1 => {
6377 if let Some(value) = self.heap.take() {
6378 ::fidl_next::wire::Envelope::encode_value::<
6379 crate::wire::Heap<'static>,
6380 ___E,
6381 >(
6382 value, preallocated.encoder, &mut out, ()
6383 )?;
6384 } else {
6385 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6386 }
6387 }
6388
6389 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6390 }
6391 unsafe {
6392 preallocated.write_next(out.assume_init_ref());
6393 }
6394 }
6395
6396 ::fidl_next::wire::Table::encode_len(table, max_ord);
6397
6398 Ok(())
6399 }
6400 }
6401
6402 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRange<'static>, ___E>
6403 for &'a SecureHeapAndRange
6404 where
6405 ___E: ::fidl_next::Encoder + ?Sized,
6406 {
6407 #[inline]
6408 fn encode(
6409 self,
6410 encoder: &mut ___E,
6411 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRange<'static>>,
6412 _: (),
6413 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6414 ::fidl_next::munge!(let crate::wire::SecureHeapAndRange { table } = out);
6415
6416 let max_ord = self.__max_ordinal();
6417
6418 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6419 ::fidl_next::Wire::zero_padding(&mut out);
6420
6421 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6422 ::fidl_next::wire::Envelope,
6423 >(encoder, max_ord);
6424
6425 for i in 1..=max_ord {
6426 match i {
6427 2 => {
6428 if let Some(value) = &self.range {
6429 ::fidl_next::wire::Envelope::encode_value::<
6430 crate::wire::SecureHeapRange<'static>,
6431 ___E,
6432 >(
6433 value, preallocated.encoder, &mut out, ()
6434 )?;
6435 } else {
6436 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6437 }
6438 }
6439
6440 1 => {
6441 if let Some(value) = &self.heap {
6442 ::fidl_next::wire::Envelope::encode_value::<
6443 crate::wire::Heap<'static>,
6444 ___E,
6445 >(
6446 value, preallocated.encoder, &mut out, ()
6447 )?;
6448 } else {
6449 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6450 }
6451 }
6452
6453 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6454 }
6455 unsafe {
6456 preallocated.write_next(out.assume_init_ref());
6457 }
6458 }
6459
6460 ::fidl_next::wire::Table::encode_len(table, max_ord);
6461
6462 Ok(())
6463 }
6464 }
6465
6466 impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRange<'de>> for SecureHeapAndRange {
6467 #[inline]
6468 fn from_wire(wire_: crate::wire::SecureHeapAndRange<'de>) -> Self {
6469 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6470
6471 let heap = wire_.table.get(1);
6472
6473 let range = wire_.table.get(2);
6474
6475 Self {
6476 heap: heap.map(|envelope| {
6477 ::fidl_next::FromWire::from_wire(unsafe {
6478 envelope.read_unchecked::<crate::wire::Heap<'de>>()
6479 })
6480 }),
6481
6482 range: range.map(|envelope| {
6483 ::fidl_next::FromWire::from_wire(unsafe {
6484 envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6485 })
6486 }),
6487 }
6488 }
6489 }
6490
6491 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRange<'de>> for SecureHeapAndRange {
6492 #[inline]
6493 fn from_wire_ref(wire: &crate::wire::SecureHeapAndRange<'de>) -> Self {
6494 Self {
6495 heap: wire.table.get(1).map(|envelope| {
6496 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6497 envelope.deref_unchecked::<crate::wire::Heap<'de>>()
6498 })
6499 }),
6500
6501 range: wire.table.get(2).map(|envelope| {
6502 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6503 envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6504 })
6505 }),
6506 }
6507 }
6508 }
6509
6510 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6511 pub struct SecureHeapAndRangeModification {
6512 pub heap: ::core::option::Option<crate::natural::Heap>,
6513
6514 pub old_range: ::core::option::Option<crate::natural::SecureHeapRange>,
6515
6516 pub new_range: ::core::option::Option<crate::natural::SecureHeapRange>,
6517 }
6518
6519 impl SecureHeapAndRangeModification {
6520 fn __max_ordinal(&self) -> usize {
6521 if self.new_range.is_some() {
6522 return 3;
6523 }
6524
6525 if self.old_range.is_some() {
6526 return 2;
6527 }
6528
6529 if self.heap.is_some() {
6530 return 1;
6531 }
6532
6533 0
6534 }
6535 }
6536
6537 unsafe impl<___E>
6538 ::fidl_next::Encode<crate::wire::SecureHeapAndRangeModification<'static>, ___E>
6539 for SecureHeapAndRangeModification
6540 where
6541 ___E: ::fidl_next::Encoder + ?Sized,
6542 {
6543 #[inline]
6544 fn encode(
6545 mut self,
6546 encoder: &mut ___E,
6547 out: &mut ::core::mem::MaybeUninit<
6548 crate::wire::SecureHeapAndRangeModification<'static>,
6549 >,
6550 _: (),
6551 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6552 ::fidl_next::munge!(let crate::wire::SecureHeapAndRangeModification { table } = out);
6553
6554 let max_ord = self.__max_ordinal();
6555
6556 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6557 ::fidl_next::Wire::zero_padding(&mut out);
6558
6559 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6560 ::fidl_next::wire::Envelope,
6561 >(encoder, max_ord);
6562
6563 for i in 1..=max_ord {
6564 match i {
6565 3 => {
6566 if let Some(value) = self.new_range.take() {
6567 ::fidl_next::wire::Envelope::encode_value::<
6568 crate::wire::SecureHeapRange<'static>,
6569 ___E,
6570 >(
6571 value, preallocated.encoder, &mut out, ()
6572 )?;
6573 } else {
6574 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6575 }
6576 }
6577
6578 2 => {
6579 if let Some(value) = self.old_range.take() {
6580 ::fidl_next::wire::Envelope::encode_value::<
6581 crate::wire::SecureHeapRange<'static>,
6582 ___E,
6583 >(
6584 value, preallocated.encoder, &mut out, ()
6585 )?;
6586 } else {
6587 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6588 }
6589 }
6590
6591 1 => {
6592 if let Some(value) = self.heap.take() {
6593 ::fidl_next::wire::Envelope::encode_value::<
6594 crate::wire::Heap<'static>,
6595 ___E,
6596 >(
6597 value, preallocated.encoder, &mut out, ()
6598 )?;
6599 } else {
6600 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6601 }
6602 }
6603
6604 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6605 }
6606 unsafe {
6607 preallocated.write_next(out.assume_init_ref());
6608 }
6609 }
6610
6611 ::fidl_next::wire::Table::encode_len(table, max_ord);
6612
6613 Ok(())
6614 }
6615 }
6616
6617 unsafe impl<'a, ___E>
6618 ::fidl_next::Encode<crate::wire::SecureHeapAndRangeModification<'static>, ___E>
6619 for &'a SecureHeapAndRangeModification
6620 where
6621 ___E: ::fidl_next::Encoder + ?Sized,
6622 {
6623 #[inline]
6624 fn encode(
6625 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 {
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 {
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 {
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 impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRangeModification<'de>>
6698 for SecureHeapAndRangeModification
6699 {
6700 #[inline]
6701 fn from_wire(wire_: crate::wire::SecureHeapAndRangeModification<'de>) -> Self {
6702 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6703
6704 let heap = wire_.table.get(1);
6705
6706 let old_range = wire_.table.get(2);
6707
6708 let new_range = wire_.table.get(3);
6709
6710 Self {
6711 heap: heap.map(|envelope| {
6712 ::fidl_next::FromWire::from_wire(unsafe {
6713 envelope.read_unchecked::<crate::wire::Heap<'de>>()
6714 })
6715 }),
6716
6717 old_range: old_range.map(|envelope| {
6718 ::fidl_next::FromWire::from_wire(unsafe {
6719 envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6720 })
6721 }),
6722
6723 new_range: new_range.map(|envelope| {
6724 ::fidl_next::FromWire::from_wire(unsafe {
6725 envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
6726 })
6727 }),
6728 }
6729 }
6730 }
6731
6732 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRangeModification<'de>>
6733 for SecureHeapAndRangeModification
6734 {
6735 #[inline]
6736 fn from_wire_ref(wire: &crate::wire::SecureHeapAndRangeModification<'de>) -> Self {
6737 Self {
6738 heap: wire.table.get(1).map(|envelope| {
6739 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6740 envelope.deref_unchecked::<crate::wire::Heap<'de>>()
6741 })
6742 }),
6743
6744 old_range: wire.table.get(2).map(|envelope| {
6745 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6746 envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6747 })
6748 }),
6749
6750 new_range: wire.table.get(3).map(|envelope| {
6751 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6752 envelope.deref_unchecked::<crate::wire::SecureHeapRange<'de>>()
6753 })
6754 }),
6755 }
6756 }
6757 }
6758
6759 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6760 pub struct SecureHeapAndRanges {
6761 pub heap: ::core::option::Option<crate::natural::Heap>,
6762
6763 pub ranges: ::core::option::Option<::std::vec::Vec<crate::natural::SecureHeapRange>>,
6764 }
6765
6766 impl SecureHeapAndRanges {
6767 fn __max_ordinal(&self) -> usize {
6768 if self.ranges.is_some() {
6769 return 2;
6770 }
6771
6772 if self.heap.is_some() {
6773 return 1;
6774 }
6775
6776 0
6777 }
6778 }
6779
6780 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRanges<'static>, ___E>
6781 for SecureHeapAndRanges
6782 where
6783 ___E: ::fidl_next::Encoder + ?Sized,
6784 {
6785 #[inline]
6786 fn encode(
6787 mut self,
6788 encoder: &mut ___E,
6789 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRanges<'static>>,
6790 _: (),
6791 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6792 ::fidl_next::munge!(let crate::wire::SecureHeapAndRanges { table } = out);
6793
6794 let max_ord = self.__max_ordinal();
6795
6796 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6797 ::fidl_next::Wire::zero_padding(&mut out);
6798
6799 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6800 ::fidl_next::wire::Envelope,
6801 >(encoder, max_ord);
6802
6803 for i in 1..=max_ord {
6804 match i {
6805 2 => {
6806 if let Some(value) = self.ranges.take() {
6807 ::fidl_next::wire::Envelope::encode_value::<
6808 ::fidl_next::wire::Vector<
6809 'static,
6810 crate::wire::SecureHeapRange<'static>,
6811 >,
6812 ___E,
6813 >(
6814 value, preallocated.encoder, &mut out, (128, ())
6815 )?;
6816 } else {
6817 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6818 }
6819 }
6820
6821 1 => {
6822 if let Some(value) = self.heap.take() {
6823 ::fidl_next::wire::Envelope::encode_value::<
6824 crate::wire::Heap<'static>,
6825 ___E,
6826 >(
6827 value, preallocated.encoder, &mut out, ()
6828 )?;
6829 } else {
6830 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6831 }
6832 }
6833
6834 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6835 }
6836 unsafe {
6837 preallocated.write_next(out.assume_init_ref());
6838 }
6839 }
6840
6841 ::fidl_next::wire::Table::encode_len(table, max_ord);
6842
6843 Ok(())
6844 }
6845 }
6846
6847 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapAndRanges<'static>, ___E>
6848 for &'a SecureHeapAndRanges
6849 where
6850 ___E: ::fidl_next::Encoder + ?Sized,
6851 {
6852 #[inline]
6853 fn encode(
6854 self,
6855 encoder: &mut ___E,
6856 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapAndRanges<'static>>,
6857 _: (),
6858 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6859 ::fidl_next::munge!(let crate::wire::SecureHeapAndRanges { table } = out);
6860
6861 let max_ord = self.__max_ordinal();
6862
6863 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6864 ::fidl_next::Wire::zero_padding(&mut out);
6865
6866 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6867 ::fidl_next::wire::Envelope,
6868 >(encoder, max_ord);
6869
6870 for i in 1..=max_ord {
6871 match i {
6872 2 => {
6873 if let Some(value) = &self.ranges {
6874 ::fidl_next::wire::Envelope::encode_value::<
6875 ::fidl_next::wire::Vector<
6876 'static,
6877 crate::wire::SecureHeapRange<'static>,
6878 >,
6879 ___E,
6880 >(
6881 value, preallocated.encoder, &mut out, (128, ())
6882 )?;
6883 } else {
6884 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6885 }
6886 }
6887
6888 1 => {
6889 if let Some(value) = &self.heap {
6890 ::fidl_next::wire::Envelope::encode_value::<
6891 crate::wire::Heap<'static>,
6892 ___E,
6893 >(
6894 value, preallocated.encoder, &mut out, ()
6895 )?;
6896 } else {
6897 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6898 }
6899 }
6900
6901 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6902 }
6903 unsafe {
6904 preallocated.write_next(out.assume_init_ref());
6905 }
6906 }
6907
6908 ::fidl_next::wire::Table::encode_len(table, max_ord);
6909
6910 Ok(())
6911 }
6912 }
6913
6914 impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapAndRanges<'de>> for SecureHeapAndRanges {
6915 #[inline]
6916 fn from_wire(wire_: crate::wire::SecureHeapAndRanges<'de>) -> Self {
6917 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6918
6919 let heap = wire_.table.get(1);
6920
6921 let ranges = wire_.table.get(2);
6922
6923 Self {
6924
6925
6926 heap: heap.map(|envelope| ::fidl_next::FromWire::from_wire(
6927 unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() }
6928 )),
6929
6930
6931 ranges: ranges.map(|envelope| ::fidl_next::FromWire::from_wire(
6932 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>() }
6933 )),
6934
6935 }
6936 }
6937 }
6938
6939 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapAndRanges<'de>> for SecureHeapAndRanges {
6940 #[inline]
6941 fn from_wire_ref(wire: &crate::wire::SecureHeapAndRanges<'de>) -> Self {
6942 Self {
6943
6944
6945 heap: wire.table.get(1)
6946 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6947 unsafe { envelope.deref_unchecked::<crate::wire::Heap<'de>>() }
6948 )),
6949
6950
6951 ranges: wire.table.get(2)
6952 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6953 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>() }
6954 )),
6955
6956 }
6957 }
6958 }
6959
6960 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6961 pub struct SecureHeapProperties {
6962 pub heap: ::core::option::Option<crate::natural::Heap>,
6963
6964 pub dynamic_protection_ranges: ::core::option::Option<bool>,
6965
6966 pub protected_range_granularity: ::core::option::Option<u32>,
6967
6968 pub max_protected_range_count: ::core::option::Option<u64>,
6969
6970 pub is_mod_protected_range_available: ::core::option::Option<bool>,
6971 }
6972
6973 impl SecureHeapProperties {
6974 fn __max_ordinal(&self) -> usize {
6975 if self.is_mod_protected_range_available.is_some() {
6976 return 5;
6977 }
6978
6979 if self.max_protected_range_count.is_some() {
6980 return 4;
6981 }
6982
6983 if self.protected_range_granularity.is_some() {
6984 return 3;
6985 }
6986
6987 if self.dynamic_protection_ranges.is_some() {
6988 return 2;
6989 }
6990
6991 if self.heap.is_some() {
6992 return 1;
6993 }
6994
6995 0
6996 }
6997 }
6998
6999 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureHeapProperties<'static>, ___E>
7000 for SecureHeapProperties
7001 where
7002 ___E: ::fidl_next::Encoder + ?Sized,
7003 {
7004 #[inline]
7005 fn encode(
7006 mut self,
7007 encoder: &mut ___E,
7008 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapProperties<'static>>,
7009 _: (),
7010 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7011 ::fidl_next::munge!(let crate::wire::SecureHeapProperties { table } = out);
7012
7013 let max_ord = self.__max_ordinal();
7014
7015 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7016 ::fidl_next::Wire::zero_padding(&mut out);
7017
7018 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7019 ::fidl_next::wire::Envelope,
7020 >(encoder, max_ord);
7021
7022 for i in 1..=max_ord {
7023 match i {
7024 5 => {
7025 if let Some(value) = self.is_mod_protected_range_available.take() {
7026 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7027 value,
7028 preallocated.encoder,
7029 &mut out,
7030 (),
7031 )?;
7032 } else {
7033 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7034 }
7035 }
7036
7037 4 => {
7038 if let Some(value) = self.max_protected_range_count.take() {
7039 ::fidl_next::wire::Envelope::encode_value::<
7040 ::fidl_next::wire::Uint64,
7041 ___E,
7042 >(
7043 value, preallocated.encoder, &mut out, ()
7044 )?;
7045 } else {
7046 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7047 }
7048 }
7049
7050 3 => {
7051 if let Some(value) = self.protected_range_granularity.take() {
7052 ::fidl_next::wire::Envelope::encode_value::<
7053 ::fidl_next::wire::Uint32,
7054 ___E,
7055 >(
7056 value, preallocated.encoder, &mut out, ()
7057 )?;
7058 } else {
7059 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7060 }
7061 }
7062
7063 2 => {
7064 if let Some(value) = self.dynamic_protection_ranges.take() {
7065 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7066 value,
7067 preallocated.encoder,
7068 &mut out,
7069 (),
7070 )?;
7071 } else {
7072 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7073 }
7074 }
7075
7076 1 => {
7077 if let Some(value) = self.heap.take() {
7078 ::fidl_next::wire::Envelope::encode_value::<
7079 crate::wire::Heap<'static>,
7080 ___E,
7081 >(
7082 value, preallocated.encoder, &mut out, ()
7083 )?;
7084 } else {
7085 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7086 }
7087 }
7088
7089 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7090 }
7091 unsafe {
7092 preallocated.write_next(out.assume_init_ref());
7093 }
7094 }
7095
7096 ::fidl_next::wire::Table::encode_len(table, max_ord);
7097
7098 Ok(())
7099 }
7100 }
7101
7102 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SecureHeapProperties<'static>, ___E>
7103 for &'a SecureHeapProperties
7104 where
7105 ___E: ::fidl_next::Encoder + ?Sized,
7106 {
7107 #[inline]
7108 fn encode(
7109 self,
7110 encoder: &mut ___E,
7111 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureHeapProperties<'static>>,
7112 _: (),
7113 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7114 ::fidl_next::munge!(let crate::wire::SecureHeapProperties { table } = out);
7115
7116 let max_ord = self.__max_ordinal();
7117
7118 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7119 ::fidl_next::Wire::zero_padding(&mut out);
7120
7121 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7122 ::fidl_next::wire::Envelope,
7123 >(encoder, max_ord);
7124
7125 for i in 1..=max_ord {
7126 match i {
7127 5 => {
7128 if let Some(value) = &self.is_mod_protected_range_available {
7129 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7130 value,
7131 preallocated.encoder,
7132 &mut out,
7133 (),
7134 )?;
7135 } else {
7136 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7137 }
7138 }
7139
7140 4 => {
7141 if let Some(value) = &self.max_protected_range_count {
7142 ::fidl_next::wire::Envelope::encode_value::<
7143 ::fidl_next::wire::Uint64,
7144 ___E,
7145 >(
7146 value, preallocated.encoder, &mut out, ()
7147 )?;
7148 } else {
7149 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7150 }
7151 }
7152
7153 3 => {
7154 if let Some(value) = &self.protected_range_granularity {
7155 ::fidl_next::wire::Envelope::encode_value::<
7156 ::fidl_next::wire::Uint32,
7157 ___E,
7158 >(
7159 value, preallocated.encoder, &mut out, ()
7160 )?;
7161 } else {
7162 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7163 }
7164 }
7165
7166 2 => {
7167 if let Some(value) = &self.dynamic_protection_ranges {
7168 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
7169 value,
7170 preallocated.encoder,
7171 &mut out,
7172 (),
7173 )?;
7174 } else {
7175 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7176 }
7177 }
7178
7179 1 => {
7180 if let Some(value) = &self.heap {
7181 ::fidl_next::wire::Envelope::encode_value::<
7182 crate::wire::Heap<'static>,
7183 ___E,
7184 >(
7185 value, preallocated.encoder, &mut out, ()
7186 )?;
7187 } else {
7188 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7189 }
7190 }
7191
7192 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7193 }
7194 unsafe {
7195 preallocated.write_next(out.assume_init_ref());
7196 }
7197 }
7198
7199 ::fidl_next::wire::Table::encode_len(table, max_ord);
7200
7201 Ok(())
7202 }
7203 }
7204
7205 impl<'de> ::fidl_next::FromWire<crate::wire::SecureHeapProperties<'de>> for SecureHeapProperties {
7206 #[inline]
7207 fn from_wire(wire_: crate::wire::SecureHeapProperties<'de>) -> Self {
7208 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7209
7210 let heap = wire_.table.get(1);
7211
7212 let dynamic_protection_ranges = wire_.table.get(2);
7213
7214 let protected_range_granularity = wire_.table.get(3);
7215
7216 let max_protected_range_count = wire_.table.get(4);
7217
7218 let is_mod_protected_range_available = wire_.table.get(5);
7219
7220 Self {
7221 heap: heap.map(|envelope| {
7222 ::fidl_next::FromWire::from_wire(unsafe {
7223 envelope.read_unchecked::<crate::wire::Heap<'de>>()
7224 })
7225 }),
7226
7227 dynamic_protection_ranges: dynamic_protection_ranges.map(|envelope| {
7228 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
7229 }),
7230
7231 protected_range_granularity: protected_range_granularity.map(|envelope| {
7232 ::fidl_next::FromWire::from_wire(unsafe {
7233 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
7234 })
7235 }),
7236
7237 max_protected_range_count: max_protected_range_count.map(|envelope| {
7238 ::fidl_next::FromWire::from_wire(unsafe {
7239 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
7240 })
7241 }),
7242
7243 is_mod_protected_range_available: is_mod_protected_range_available.map(
7244 |envelope| {
7245 ::fidl_next::FromWire::from_wire(unsafe {
7246 envelope.read_unchecked::<bool>()
7247 })
7248 },
7249 ),
7250 }
7251 }
7252 }
7253
7254 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureHeapProperties<'de>>
7255 for SecureHeapProperties
7256 {
7257 #[inline]
7258 fn from_wire_ref(wire: &crate::wire::SecureHeapProperties<'de>) -> Self {
7259 Self {
7260 heap: wire.table.get(1).map(|envelope| {
7261 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7262 envelope.deref_unchecked::<crate::wire::Heap<'de>>()
7263 })
7264 }),
7265
7266 dynamic_protection_ranges: wire.table.get(2).map(|envelope| {
7267 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7268 envelope.deref_unchecked::<bool>()
7269 })
7270 }),
7271
7272 protected_range_granularity: wire.table.get(3).map(|envelope| {
7273 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7274 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
7275 })
7276 }),
7277
7278 max_protected_range_count: wire.table.get(4).map(|envelope| {
7279 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7280 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
7281 })
7282 }),
7283
7284 is_mod_protected_range_available: wire.table.get(5).map(|envelope| {
7285 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7286 envelope.deref_unchecked::<bool>()
7287 })
7288 }),
7289 }
7290 }
7291 }
7292
7293 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7294 pub struct SecureMemGetPhysicalSecureHeapsResponse {
7295 pub heaps: ::core::option::Option<::std::vec::Vec<crate::natural::SecureHeapAndRanges>>,
7296 }
7297
7298 impl SecureMemGetPhysicalSecureHeapsResponse {
7299 fn __max_ordinal(&self) -> usize {
7300 if self.heaps.is_some() {
7301 return 1;
7302 }
7303
7304 0
7305 }
7306 }
7307
7308 unsafe impl<___E>
7309 ::fidl_next::Encode<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>, ___E>
7310 for SecureMemGetPhysicalSecureHeapsResponse
7311 where
7312 ___E: ::fidl_next::Encoder + ?Sized,
7313 {
7314 #[inline]
7315 fn encode(
7316 mut self,
7317 encoder: &mut ___E,
7318 out: &mut ::core::mem::MaybeUninit<
7319 crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
7320 >,
7321 _: (),
7322 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7323 ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapsResponse { table } = out);
7324
7325 let max_ord = self.__max_ordinal();
7326
7327 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7328 ::fidl_next::Wire::zero_padding(&mut out);
7329
7330 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7331 ::fidl_next::wire::Envelope,
7332 >(encoder, max_ord);
7333
7334 for i in 1..=max_ord {
7335 match i {
7336 1 => {
7337 if let Some(value) = self.heaps.take() {
7338 ::fidl_next::wire::Envelope::encode_value::<
7339 ::fidl_next::wire::Vector<
7340 'static,
7341 crate::wire::SecureHeapAndRanges<'static>,
7342 >,
7343 ___E,
7344 >(
7345 value, preallocated.encoder, &mut out, (32, ())
7346 )?;
7347 } else {
7348 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7349 }
7350 }
7351
7352 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7353 }
7354 unsafe {
7355 preallocated.write_next(out.assume_init_ref());
7356 }
7357 }
7358
7359 ::fidl_next::wire::Table::encode_len(table, max_ord);
7360
7361 Ok(())
7362 }
7363 }
7364
7365 unsafe impl<'a, ___E>
7366 ::fidl_next::Encode<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>, ___E>
7367 for &'a SecureMemGetPhysicalSecureHeapsResponse
7368 where
7369 ___E: ::fidl_next::Encoder + ?Sized,
7370 {
7371 #[inline]
7372 fn encode(
7373 self,
7374 encoder: &mut ___E,
7375 out: &mut ::core::mem::MaybeUninit<
7376 crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
7377 >,
7378 _: (),
7379 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7380 ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapsResponse { table } = out);
7381
7382 let max_ord = self.__max_ordinal();
7383
7384 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7385 ::fidl_next::Wire::zero_padding(&mut out);
7386
7387 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7388 ::fidl_next::wire::Envelope,
7389 >(encoder, max_ord);
7390
7391 for i in 1..=max_ord {
7392 match i {
7393 1 => {
7394 if let Some(value) = &self.heaps {
7395 ::fidl_next::wire::Envelope::encode_value::<
7396 ::fidl_next::wire::Vector<
7397 'static,
7398 crate::wire::SecureHeapAndRanges<'static>,
7399 >,
7400 ___E,
7401 >(
7402 value, preallocated.encoder, &mut out, (32, ())
7403 )?;
7404 } else {
7405 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7406 }
7407 }
7408
7409 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7410 }
7411 unsafe {
7412 preallocated.write_next(out.assume_init_ref());
7413 }
7414 }
7415
7416 ::fidl_next::wire::Table::encode_len(table, max_ord);
7417
7418 Ok(())
7419 }
7420 }
7421
7422 impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>>
7423 for SecureMemGetPhysicalSecureHeapsResponse
7424 {
7425 #[inline]
7426 fn from_wire(wire_: crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>) -> Self {
7427 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7428
7429 let heaps = wire_.table.get(1);
7430
7431 Self {
7432 heaps:
7433 heaps.map(|envelope| {
7434 ::fidl_next::FromWire::from_wire(unsafe {
7435 envelope.read_unchecked::<::fidl_next::wire::Vector<
7436 'de,
7437 crate::wire::SecureHeapAndRanges<'de>,
7438 >>()
7439 })
7440 }),
7441 }
7442 }
7443 }
7444
7445 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>>
7446 for SecureMemGetPhysicalSecureHeapsResponse
7447 {
7448 #[inline]
7449 fn from_wire_ref(wire: &crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'de>) -> Self {
7450 Self {
7451 heaps:
7452 wire.table.get(1).map(|envelope| {
7453 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7454 envelope.deref_unchecked::<::fidl_next::wire::Vector<
7455 'de,
7456 crate::wire::SecureHeapAndRanges<'de>,
7457 >>()
7458 })
7459 }),
7460 }
7461 }
7462 }
7463
7464 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7465 pub struct SecureMemGetDynamicSecureHeapsResponse {
7466 pub heaps: ::core::option::Option<::std::vec::Vec<crate::natural::DynamicSecureHeap>>,
7467 }
7468
7469 impl SecureMemGetDynamicSecureHeapsResponse {
7470 fn __max_ordinal(&self) -> usize {
7471 if self.heaps.is_some() {
7472 return 1;
7473 }
7474
7475 0
7476 }
7477 }
7478
7479 unsafe impl<___E>
7480 ::fidl_next::Encode<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>, ___E>
7481 for SecureMemGetDynamicSecureHeapsResponse
7482 where
7483 ___E: ::fidl_next::Encoder + ?Sized,
7484 {
7485 #[inline]
7486 fn encode(
7487 mut self,
7488 encoder: &mut ___E,
7489 out: &mut ::core::mem::MaybeUninit<
7490 crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
7491 >,
7492 _: (),
7493 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7494 ::fidl_next::munge!(let crate::wire::SecureMemGetDynamicSecureHeapsResponse { table } = out);
7495
7496 let max_ord = self.__max_ordinal();
7497
7498 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7499 ::fidl_next::Wire::zero_padding(&mut out);
7500
7501 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7502 ::fidl_next::wire::Envelope,
7503 >(encoder, max_ord);
7504
7505 for i in 1..=max_ord {
7506 match i {
7507 1 => {
7508 if let Some(value) = self.heaps.take() {
7509 ::fidl_next::wire::Envelope::encode_value::<
7510 ::fidl_next::wire::Vector<
7511 'static,
7512 crate::wire::DynamicSecureHeap<'static>,
7513 >,
7514 ___E,
7515 >(
7516 value, preallocated.encoder, &mut out, (32, ())
7517 )?;
7518 } else {
7519 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7520 }
7521 }
7522
7523 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7524 }
7525 unsafe {
7526 preallocated.write_next(out.assume_init_ref());
7527 }
7528 }
7529
7530 ::fidl_next::wire::Table::encode_len(table, max_ord);
7531
7532 Ok(())
7533 }
7534 }
7535
7536 unsafe impl<'a, ___E>
7537 ::fidl_next::Encode<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>, ___E>
7538 for &'a SecureMemGetDynamicSecureHeapsResponse
7539 where
7540 ___E: ::fidl_next::Encoder + ?Sized,
7541 {
7542 #[inline]
7543 fn encode(
7544 self,
7545 encoder: &mut ___E,
7546 out: &mut ::core::mem::MaybeUninit<
7547 crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
7548 >,
7549 _: (),
7550 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7551 ::fidl_next::munge!(let crate::wire::SecureMemGetDynamicSecureHeapsResponse { table } = out);
7552
7553 let max_ord = self.__max_ordinal();
7554
7555 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7556 ::fidl_next::Wire::zero_padding(&mut out);
7557
7558 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7559 ::fidl_next::wire::Envelope,
7560 >(encoder, max_ord);
7561
7562 for i in 1..=max_ord {
7563 match i {
7564 1 => {
7565 if let Some(value) = &self.heaps {
7566 ::fidl_next::wire::Envelope::encode_value::<
7567 ::fidl_next::wire::Vector<
7568 'static,
7569 crate::wire::DynamicSecureHeap<'static>,
7570 >,
7571 ___E,
7572 >(
7573 value, preallocated.encoder, &mut out, (32, ())
7574 )?;
7575 } else {
7576 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7577 }
7578 }
7579
7580 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7581 }
7582 unsafe {
7583 preallocated.write_next(out.assume_init_ref());
7584 }
7585 }
7586
7587 ::fidl_next::wire::Table::encode_len(table, max_ord);
7588
7589 Ok(())
7590 }
7591 }
7592
7593 impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>>
7594 for SecureMemGetDynamicSecureHeapsResponse
7595 {
7596 #[inline]
7597 fn from_wire(wire_: crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>) -> Self {
7598 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7599
7600 let heaps = wire_.table.get(1);
7601
7602 Self {
7603
7604
7605 heaps: heaps.map(|envelope| ::fidl_next::FromWire::from_wire(
7606 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>() }
7607 )),
7608
7609 }
7610 }
7611 }
7612
7613 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>>
7614 for SecureMemGetDynamicSecureHeapsResponse
7615 {
7616 #[inline]
7617 fn from_wire_ref(wire: &crate::wire::SecureMemGetDynamicSecureHeapsResponse<'de>) -> Self {
7618 Self {
7619
7620
7621 heaps: wire.table.get(1)
7622 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7623 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>() }
7624 )),
7625
7626 }
7627 }
7628 }
7629
7630 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7631 pub struct SecureMemGetPhysicalSecureHeapPropertiesRequest {
7632 pub entire_heap: ::core::option::Option<crate::natural::SecureHeapAndRange>,
7633 }
7634
7635 impl SecureMemGetPhysicalSecureHeapPropertiesRequest {
7636 fn __max_ordinal(&self) -> usize {
7637 if self.entire_heap.is_some() {
7638 return 1;
7639 }
7640
7641 0
7642 }
7643 }
7644
7645 unsafe impl<___E>
7646 ::fidl_next::Encode<
7647 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7648 ___E,
7649 > for SecureMemGetPhysicalSecureHeapPropertiesRequest
7650 where
7651 ___E: ::fidl_next::Encoder + ?Sized,
7652 {
7653 #[inline]
7654 fn encode(
7655 mut self,
7656 encoder: &mut ___E,
7657 out: &mut ::core::mem::MaybeUninit<
7658 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7659 >,
7660 _: (),
7661 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7662 ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest { table } = out);
7663
7664 let max_ord = self.__max_ordinal();
7665
7666 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7667 ::fidl_next::Wire::zero_padding(&mut out);
7668
7669 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7670 ::fidl_next::wire::Envelope,
7671 >(encoder, max_ord);
7672
7673 for i in 1..=max_ord {
7674 match i {
7675 1 => {
7676 if let Some(value) = self.entire_heap.take() {
7677 ::fidl_next::wire::Envelope::encode_value::<
7678 crate::wire::SecureHeapAndRange<'static>,
7679 ___E,
7680 >(
7681 value, preallocated.encoder, &mut out, ()
7682 )?;
7683 } else {
7684 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7685 }
7686 }
7687
7688 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7689 }
7690 unsafe {
7691 preallocated.write_next(out.assume_init_ref());
7692 }
7693 }
7694
7695 ::fidl_next::wire::Table::encode_len(table, max_ord);
7696
7697 Ok(())
7698 }
7699 }
7700
7701 unsafe impl<'a, ___E>
7702 ::fidl_next::Encode<
7703 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7704 ___E,
7705 > for &'a SecureMemGetPhysicalSecureHeapPropertiesRequest
7706 where
7707 ___E: ::fidl_next::Encoder + ?Sized,
7708 {
7709 #[inline]
7710 fn encode(
7711 self,
7712 encoder: &mut ___E,
7713 out: &mut ::core::mem::MaybeUninit<
7714 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
7715 >,
7716 _: (),
7717 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7718 ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest { table } = out);
7719
7720 let max_ord = self.__max_ordinal();
7721
7722 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7723 ::fidl_next::Wire::zero_padding(&mut out);
7724
7725 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7726 ::fidl_next::wire::Envelope,
7727 >(encoder, max_ord);
7728
7729 for i in 1..=max_ord {
7730 match i {
7731 1 => {
7732 if let Some(value) = &self.entire_heap {
7733 ::fidl_next::wire::Envelope::encode_value::<
7734 crate::wire::SecureHeapAndRange<'static>,
7735 ___E,
7736 >(
7737 value, preallocated.encoder, &mut out, ()
7738 )?;
7739 } else {
7740 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7741 }
7742 }
7743
7744 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7745 }
7746 unsafe {
7747 preallocated.write_next(out.assume_init_ref());
7748 }
7749 }
7750
7751 ::fidl_next::wire::Table::encode_len(table, max_ord);
7752
7753 Ok(())
7754 }
7755 }
7756
7757 impl<'de>
7758 ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>>
7759 for SecureMemGetPhysicalSecureHeapPropertiesRequest
7760 {
7761 #[inline]
7762 fn from_wire(
7763 wire_: crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>,
7764 ) -> Self {
7765 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7766
7767 let entire_heap = wire_.table.get(1);
7768
7769 Self {
7770 entire_heap: entire_heap.map(|envelope| {
7771 ::fidl_next::FromWire::from_wire(unsafe {
7772 envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
7773 })
7774 }),
7775 }
7776 }
7777 }
7778
7779 impl<'de>
7780 ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>>
7781 for SecureMemGetPhysicalSecureHeapPropertiesRequest
7782 {
7783 #[inline]
7784 fn from_wire_ref(
7785 wire: &crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>,
7786 ) -> Self {
7787 Self {
7788 entire_heap: wire.table.get(1).map(|envelope| {
7789 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7790 envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
7791 })
7792 }),
7793 }
7794 }
7795 }
7796
7797 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7798 pub struct SecureMemGetPhysicalSecureHeapPropertiesResponse {
7799 pub properties: ::core::option::Option<crate::natural::SecureHeapProperties>,
7800 }
7801
7802 impl SecureMemGetPhysicalSecureHeapPropertiesResponse {
7803 fn __max_ordinal(&self) -> usize {
7804 if self.properties.is_some() {
7805 return 1;
7806 }
7807
7808 0
7809 }
7810 }
7811
7812 unsafe impl<___E>
7813 ::fidl_next::Encode<
7814 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7815 ___E,
7816 > for SecureMemGetPhysicalSecureHeapPropertiesResponse
7817 where
7818 ___E: ::fidl_next::Encoder + ?Sized,
7819 {
7820 #[inline]
7821 fn encode(
7822 mut self,
7823 encoder: &mut ___E,
7824 out: &mut ::core::mem::MaybeUninit<
7825 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7826 >,
7827 _: (),
7828 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7829 ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse { table } = out);
7830
7831 let max_ord = self.__max_ordinal();
7832
7833 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7834 ::fidl_next::Wire::zero_padding(&mut out);
7835
7836 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7837 ::fidl_next::wire::Envelope,
7838 >(encoder, max_ord);
7839
7840 for i in 1..=max_ord {
7841 match i {
7842 1 => {
7843 if let Some(value) = self.properties.take() {
7844 ::fidl_next::wire::Envelope::encode_value::<
7845 crate::wire::SecureHeapProperties<'static>,
7846 ___E,
7847 >(
7848 value, preallocated.encoder, &mut out, ()
7849 )?;
7850 } else {
7851 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7852 }
7853 }
7854
7855 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7856 }
7857 unsafe {
7858 preallocated.write_next(out.assume_init_ref());
7859 }
7860 }
7861
7862 ::fidl_next::wire::Table::encode_len(table, max_ord);
7863
7864 Ok(())
7865 }
7866 }
7867
7868 unsafe impl<'a, ___E>
7869 ::fidl_next::Encode<
7870 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7871 ___E,
7872 > for &'a SecureMemGetPhysicalSecureHeapPropertiesResponse
7873 where
7874 ___E: ::fidl_next::Encoder + ?Sized,
7875 {
7876 #[inline]
7877 fn encode(
7878 self,
7879 encoder: &mut ___E,
7880 out: &mut ::core::mem::MaybeUninit<
7881 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
7882 >,
7883 _: (),
7884 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7885 ::fidl_next::munge!(let crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse { table } = out);
7886
7887 let max_ord = self.__max_ordinal();
7888
7889 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7890 ::fidl_next::Wire::zero_padding(&mut out);
7891
7892 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7893 ::fidl_next::wire::Envelope,
7894 >(encoder, max_ord);
7895
7896 for i in 1..=max_ord {
7897 match i {
7898 1 => {
7899 if let Some(value) = &self.properties {
7900 ::fidl_next::wire::Envelope::encode_value::<
7901 crate::wire::SecureHeapProperties<'static>,
7902 ___E,
7903 >(
7904 value, preallocated.encoder, &mut out, ()
7905 )?;
7906 } else {
7907 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7908 }
7909 }
7910
7911 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7912 }
7913 unsafe {
7914 preallocated.write_next(out.assume_init_ref());
7915 }
7916 }
7917
7918 ::fidl_next::wire::Table::encode_len(table, max_ord);
7919
7920 Ok(())
7921 }
7922 }
7923
7924 impl<'de>
7925 ::fidl_next::FromWire<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>>
7926 for SecureMemGetPhysicalSecureHeapPropertiesResponse
7927 {
7928 #[inline]
7929 fn from_wire(
7930 wire_: crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>,
7931 ) -> Self {
7932 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7933
7934 let properties = wire_.table.get(1);
7935
7936 Self {
7937 properties: properties.map(|envelope| {
7938 ::fidl_next::FromWire::from_wire(unsafe {
7939 envelope.read_unchecked::<crate::wire::SecureHeapProperties<'de>>()
7940 })
7941 }),
7942 }
7943 }
7944 }
7945
7946 impl<'de>
7947 ::fidl_next::FromWireRef<crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>>
7948 for SecureMemGetPhysicalSecureHeapPropertiesResponse
7949 {
7950 #[inline]
7951 fn from_wire_ref(
7952 wire: &crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>,
7953 ) -> Self {
7954 Self {
7955 properties: wire.table.get(1).map(|envelope| {
7956 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7957 envelope.deref_unchecked::<crate::wire::SecureHeapProperties<'de>>()
7958 })
7959 }),
7960 }
7961 }
7962 }
7963
7964 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7965 pub struct SecureMemAddSecureHeapPhysicalRangeRequest {
7966 pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
7967 }
7968
7969 impl SecureMemAddSecureHeapPhysicalRangeRequest {
7970 fn __max_ordinal(&self) -> usize {
7971 if self.heap_range.is_some() {
7972 return 1;
7973 }
7974
7975 0
7976 }
7977 }
7978
7979 unsafe impl<___E>
7980 ::fidl_next::Encode<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>, ___E>
7981 for SecureMemAddSecureHeapPhysicalRangeRequest
7982 where
7983 ___E: ::fidl_next::Encoder + ?Sized,
7984 {
7985 #[inline]
7986 fn encode(
7987 mut self,
7988 encoder: &mut ___E,
7989 out: &mut ::core::mem::MaybeUninit<
7990 crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
7991 >,
7992 _: (),
7993 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7994 ::fidl_next::munge!(let crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest { table } = out);
7995
7996 let max_ord = self.__max_ordinal();
7997
7998 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7999 ::fidl_next::Wire::zero_padding(&mut out);
8000
8001 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8002 ::fidl_next::wire::Envelope,
8003 >(encoder, max_ord);
8004
8005 for i in 1..=max_ord {
8006 match i {
8007 1 => {
8008 if let Some(value) = self.heap_range.take() {
8009 ::fidl_next::wire::Envelope::encode_value::<
8010 crate::wire::SecureHeapAndRange<'static>,
8011 ___E,
8012 >(
8013 value, preallocated.encoder, &mut out, ()
8014 )?;
8015 } else {
8016 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8017 }
8018 }
8019
8020 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8021 }
8022 unsafe {
8023 preallocated.write_next(out.assume_init_ref());
8024 }
8025 }
8026
8027 ::fidl_next::wire::Table::encode_len(table, max_ord);
8028
8029 Ok(())
8030 }
8031 }
8032
8033 unsafe impl<'a, ___E>
8034 ::fidl_next::Encode<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>, ___E>
8035 for &'a SecureMemAddSecureHeapPhysicalRangeRequest
8036 where
8037 ___E: ::fidl_next::Encoder + ?Sized,
8038 {
8039 #[inline]
8040 fn encode(
8041 self,
8042 encoder: &mut ___E,
8043 out: &mut ::core::mem::MaybeUninit<
8044 crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
8045 >,
8046 _: (),
8047 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8048 ::fidl_next::munge!(let crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest { table } = out);
8049
8050 let max_ord = self.__max_ordinal();
8051
8052 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8053 ::fidl_next::Wire::zero_padding(&mut out);
8054
8055 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8056 ::fidl_next::wire::Envelope,
8057 >(encoder, max_ord);
8058
8059 for i in 1..=max_ord {
8060 match i {
8061 1 => {
8062 if let Some(value) = &self.heap_range {
8063 ::fidl_next::wire::Envelope::encode_value::<
8064 crate::wire::SecureHeapAndRange<'static>,
8065 ___E,
8066 >(
8067 value, preallocated.encoder, &mut out, ()
8068 )?;
8069 } else {
8070 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8071 }
8072 }
8073
8074 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8075 }
8076 unsafe {
8077 preallocated.write_next(out.assume_init_ref());
8078 }
8079 }
8080
8081 ::fidl_next::wire::Table::encode_len(table, max_ord);
8082
8083 Ok(())
8084 }
8085 }
8086
8087 impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>>
8088 for SecureMemAddSecureHeapPhysicalRangeRequest
8089 {
8090 #[inline]
8091 fn from_wire(wire_: crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>) -> Self {
8092 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8093
8094 let heap_range = wire_.table.get(1);
8095
8096 Self {
8097 heap_range: heap_range.map(|envelope| {
8098 ::fidl_next::FromWire::from_wire(unsafe {
8099 envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8100 })
8101 }),
8102 }
8103 }
8104 }
8105
8106 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>>
8107 for SecureMemAddSecureHeapPhysicalRangeRequest
8108 {
8109 #[inline]
8110 fn from_wire_ref(
8111 wire: &crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>,
8112 ) -> Self {
8113 Self {
8114 heap_range: wire.table.get(1).map(|envelope| {
8115 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8116 envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8117 })
8118 }),
8119 }
8120 }
8121 }
8122
8123 pub type SecureMemAddSecureHeapPhysicalRangeResponse = ();
8124
8125 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8126 pub struct SecureMemDeleteSecureHeapPhysicalRangeRequest {
8127 pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
8128 }
8129
8130 impl SecureMemDeleteSecureHeapPhysicalRangeRequest {
8131 fn __max_ordinal(&self) -> usize {
8132 if self.heap_range.is_some() {
8133 return 1;
8134 }
8135
8136 0
8137 }
8138 }
8139
8140 unsafe impl<___E>
8141 ::fidl_next::Encode<
8142 crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8143 ___E,
8144 > for SecureMemDeleteSecureHeapPhysicalRangeRequest
8145 where
8146 ___E: ::fidl_next::Encoder + ?Sized,
8147 {
8148 #[inline]
8149 fn encode(
8150 mut self,
8151 encoder: &mut ___E,
8152 out: &mut ::core::mem::MaybeUninit<
8153 crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8154 >,
8155 _: (),
8156 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8157 ::fidl_next::munge!(let crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest { table } = out);
8158
8159 let max_ord = self.__max_ordinal();
8160
8161 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8162 ::fidl_next::Wire::zero_padding(&mut out);
8163
8164 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8165 ::fidl_next::wire::Envelope,
8166 >(encoder, max_ord);
8167
8168 for i in 1..=max_ord {
8169 match i {
8170 1 => {
8171 if let Some(value) = self.heap_range.take() {
8172 ::fidl_next::wire::Envelope::encode_value::<
8173 crate::wire::SecureHeapAndRange<'static>,
8174 ___E,
8175 >(
8176 value, preallocated.encoder, &mut out, ()
8177 )?;
8178 } else {
8179 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8180 }
8181 }
8182
8183 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8184 }
8185 unsafe {
8186 preallocated.write_next(out.assume_init_ref());
8187 }
8188 }
8189
8190 ::fidl_next::wire::Table::encode_len(table, max_ord);
8191
8192 Ok(())
8193 }
8194 }
8195
8196 unsafe impl<'a, ___E>
8197 ::fidl_next::Encode<
8198 crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8199 ___E,
8200 > for &'a SecureMemDeleteSecureHeapPhysicalRangeRequest
8201 where
8202 ___E: ::fidl_next::Encoder + ?Sized,
8203 {
8204 #[inline]
8205 fn encode(
8206 self,
8207 encoder: &mut ___E,
8208 out: &mut ::core::mem::MaybeUninit<
8209 crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
8210 >,
8211 _: (),
8212 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8213 ::fidl_next::munge!(let crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest { table } = out);
8214
8215 let max_ord = self.__max_ordinal();
8216
8217 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8218 ::fidl_next::Wire::zero_padding(&mut out);
8219
8220 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8221 ::fidl_next::wire::Envelope,
8222 >(encoder, max_ord);
8223
8224 for i in 1..=max_ord {
8225 match i {
8226 1 => {
8227 if let Some(value) = &self.heap_range {
8228 ::fidl_next::wire::Envelope::encode_value::<
8229 crate::wire::SecureHeapAndRange<'static>,
8230 ___E,
8231 >(
8232 value, preallocated.encoder, &mut out, ()
8233 )?;
8234 } else {
8235 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8236 }
8237 }
8238
8239 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8240 }
8241 unsafe {
8242 preallocated.write_next(out.assume_init_ref());
8243 }
8244 }
8245
8246 ::fidl_next::wire::Table::encode_len(table, max_ord);
8247
8248 Ok(())
8249 }
8250 }
8251
8252 impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>>
8253 for SecureMemDeleteSecureHeapPhysicalRangeRequest
8254 {
8255 #[inline]
8256 fn from_wire(
8257 wire_: crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>,
8258 ) -> Self {
8259 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8260
8261 let heap_range = wire_.table.get(1);
8262
8263 Self {
8264 heap_range: heap_range.map(|envelope| {
8265 ::fidl_next::FromWire::from_wire(unsafe {
8266 envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8267 })
8268 }),
8269 }
8270 }
8271 }
8272
8273 impl<'de>
8274 ::fidl_next::FromWireRef<crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>>
8275 for SecureMemDeleteSecureHeapPhysicalRangeRequest
8276 {
8277 #[inline]
8278 fn from_wire_ref(
8279 wire: &crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>,
8280 ) -> Self {
8281 Self {
8282 heap_range: wire.table.get(1).map(|envelope| {
8283 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8284 envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8285 })
8286 }),
8287 }
8288 }
8289 }
8290
8291 pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ();
8292
8293 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8294 pub struct SecureMemModifySecureHeapPhysicalRangeRequest {
8295 pub range_modification:
8296 ::core::option::Option<crate::natural::SecureHeapAndRangeModification>,
8297 }
8298
8299 impl SecureMemModifySecureHeapPhysicalRangeRequest {
8300 fn __max_ordinal(&self) -> usize {
8301 if self.range_modification.is_some() {
8302 return 1;
8303 }
8304
8305 0
8306 }
8307 }
8308
8309 unsafe impl<___E>
8310 ::fidl_next::Encode<
8311 crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8312 ___E,
8313 > for SecureMemModifySecureHeapPhysicalRangeRequest
8314 where
8315 ___E: ::fidl_next::Encoder + ?Sized,
8316 {
8317 #[inline]
8318 fn encode(
8319 mut self,
8320 encoder: &mut ___E,
8321 out: &mut ::core::mem::MaybeUninit<
8322 crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8323 >,
8324 _: (),
8325 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8326 ::fidl_next::munge!(let crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest { table } = out);
8327
8328 let max_ord = self.__max_ordinal();
8329
8330 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8331 ::fidl_next::Wire::zero_padding(&mut out);
8332
8333 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8334 ::fidl_next::wire::Envelope,
8335 >(encoder, max_ord);
8336
8337 for i in 1..=max_ord {
8338 match i {
8339 1 => {
8340 if let Some(value) = self.range_modification.take() {
8341 ::fidl_next::wire::Envelope::encode_value::<
8342 crate::wire::SecureHeapAndRangeModification<'static>,
8343 ___E,
8344 >(
8345 value, preallocated.encoder, &mut out, ()
8346 )?;
8347 } else {
8348 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8349 }
8350 }
8351
8352 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8353 }
8354 unsafe {
8355 preallocated.write_next(out.assume_init_ref());
8356 }
8357 }
8358
8359 ::fidl_next::wire::Table::encode_len(table, max_ord);
8360
8361 Ok(())
8362 }
8363 }
8364
8365 unsafe impl<'a, ___E>
8366 ::fidl_next::Encode<
8367 crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8368 ___E,
8369 > for &'a SecureMemModifySecureHeapPhysicalRangeRequest
8370 where
8371 ___E: ::fidl_next::Encoder + ?Sized,
8372 {
8373 #[inline]
8374 fn encode(
8375 self,
8376 encoder: &mut ___E,
8377 out: &mut ::core::mem::MaybeUninit<
8378 crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
8379 >,
8380 _: (),
8381 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8382 ::fidl_next::munge!(let crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest { table } = out);
8383
8384 let max_ord = self.__max_ordinal();
8385
8386 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8387 ::fidl_next::Wire::zero_padding(&mut out);
8388
8389 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8390 ::fidl_next::wire::Envelope,
8391 >(encoder, max_ord);
8392
8393 for i in 1..=max_ord {
8394 match i {
8395 1 => {
8396 if let Some(value) = &self.range_modification {
8397 ::fidl_next::wire::Envelope::encode_value::<
8398 crate::wire::SecureHeapAndRangeModification<'static>,
8399 ___E,
8400 >(
8401 value, preallocated.encoder, &mut out, ()
8402 )?;
8403 } else {
8404 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8405 }
8406 }
8407
8408 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8409 }
8410 unsafe {
8411 preallocated.write_next(out.assume_init_ref());
8412 }
8413 }
8414
8415 ::fidl_next::wire::Table::encode_len(table, max_ord);
8416
8417 Ok(())
8418 }
8419 }
8420
8421 impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>>
8422 for SecureMemModifySecureHeapPhysicalRangeRequest
8423 {
8424 #[inline]
8425 fn from_wire(
8426 wire_: crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>,
8427 ) -> Self {
8428 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8429
8430 let range_modification = wire_.table.get(1);
8431
8432 Self {
8433 range_modification: range_modification.map(|envelope| {
8434 ::fidl_next::FromWire::from_wire(unsafe {
8435 envelope
8436 .read_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
8437 })
8438 }),
8439 }
8440 }
8441 }
8442
8443 impl<'de>
8444 ::fidl_next::FromWireRef<crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>>
8445 for SecureMemModifySecureHeapPhysicalRangeRequest
8446 {
8447 #[inline]
8448 fn from_wire_ref(
8449 wire: &crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>,
8450 ) -> Self {
8451 Self {
8452 range_modification: wire.table.get(1).map(|envelope| {
8453 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8454 envelope
8455 .deref_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
8456 })
8457 }),
8458 }
8459 }
8460 }
8461
8462 pub type SecureMemModifySecureHeapPhysicalRangeResponse = ();
8463
8464 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8465 pub struct SecureMemZeroSubRangeRequest {
8466 pub is_covering_range_explicit: ::core::option::Option<bool>,
8467
8468 pub heap_range: ::core::option::Option<crate::natural::SecureHeapAndRange>,
8469 }
8470
8471 impl SecureMemZeroSubRangeRequest {
8472 fn __max_ordinal(&self) -> usize {
8473 if self.heap_range.is_some() {
8474 return 2;
8475 }
8476
8477 if self.is_covering_range_explicit.is_some() {
8478 return 1;
8479 }
8480
8481 0
8482 }
8483 }
8484
8485 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SecureMemZeroSubRangeRequest<'static>, ___E>
8486 for SecureMemZeroSubRangeRequest
8487 where
8488 ___E: ::fidl_next::Encoder + ?Sized,
8489 {
8490 #[inline]
8491 fn encode(
8492 mut self,
8493 encoder: &mut ___E,
8494 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureMemZeroSubRangeRequest<'static>>,
8495 _: (),
8496 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8497 ::fidl_next::munge!(let crate::wire::SecureMemZeroSubRangeRequest { table } = out);
8498
8499 let max_ord = self.__max_ordinal();
8500
8501 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8502 ::fidl_next::Wire::zero_padding(&mut out);
8503
8504 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8505 ::fidl_next::wire::Envelope,
8506 >(encoder, max_ord);
8507
8508 for i in 1..=max_ord {
8509 match i {
8510 2 => {
8511 if let Some(value) = self.heap_range.take() {
8512 ::fidl_next::wire::Envelope::encode_value::<
8513 crate::wire::SecureHeapAndRange<'static>,
8514 ___E,
8515 >(
8516 value, preallocated.encoder, &mut out, ()
8517 )?;
8518 } else {
8519 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8520 }
8521 }
8522
8523 1 => {
8524 if let Some(value) = self.is_covering_range_explicit.take() {
8525 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
8526 value,
8527 preallocated.encoder,
8528 &mut out,
8529 (),
8530 )?;
8531 } else {
8532 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8533 }
8534 }
8535
8536 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8537 }
8538 unsafe {
8539 preallocated.write_next(out.assume_init_ref());
8540 }
8541 }
8542
8543 ::fidl_next::wire::Table::encode_len(table, max_ord);
8544
8545 Ok(())
8546 }
8547 }
8548
8549 unsafe impl<'a, ___E>
8550 ::fidl_next::Encode<crate::wire::SecureMemZeroSubRangeRequest<'static>, ___E>
8551 for &'a SecureMemZeroSubRangeRequest
8552 where
8553 ___E: ::fidl_next::Encoder + ?Sized,
8554 {
8555 #[inline]
8556 fn encode(
8557 self,
8558 encoder: &mut ___E,
8559 out: &mut ::core::mem::MaybeUninit<crate::wire::SecureMemZeroSubRangeRequest<'static>>,
8560 _: (),
8561 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8562 ::fidl_next::munge!(let crate::wire::SecureMemZeroSubRangeRequest { table } = out);
8563
8564 let max_ord = self.__max_ordinal();
8565
8566 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8567 ::fidl_next::Wire::zero_padding(&mut out);
8568
8569 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8570 ::fidl_next::wire::Envelope,
8571 >(encoder, max_ord);
8572
8573 for i in 1..=max_ord {
8574 match i {
8575 2 => {
8576 if let Some(value) = &self.heap_range {
8577 ::fidl_next::wire::Envelope::encode_value::<
8578 crate::wire::SecureHeapAndRange<'static>,
8579 ___E,
8580 >(
8581 value, preallocated.encoder, &mut out, ()
8582 )?;
8583 } else {
8584 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8585 }
8586 }
8587
8588 1 => {
8589 if let Some(value) = &self.is_covering_range_explicit {
8590 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
8591 value,
8592 preallocated.encoder,
8593 &mut out,
8594 (),
8595 )?;
8596 } else {
8597 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8598 }
8599 }
8600
8601 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8602 }
8603 unsafe {
8604 preallocated.write_next(out.assume_init_ref());
8605 }
8606 }
8607
8608 ::fidl_next::wire::Table::encode_len(table, max_ord);
8609
8610 Ok(())
8611 }
8612 }
8613
8614 impl<'de> ::fidl_next::FromWire<crate::wire::SecureMemZeroSubRangeRequest<'de>>
8615 for SecureMemZeroSubRangeRequest
8616 {
8617 #[inline]
8618 fn from_wire(wire_: crate::wire::SecureMemZeroSubRangeRequest<'de>) -> Self {
8619 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8620
8621 let is_covering_range_explicit = wire_.table.get(1);
8622
8623 let heap_range = wire_.table.get(2);
8624
8625 Self {
8626 is_covering_range_explicit: is_covering_range_explicit.map(|envelope| {
8627 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
8628 }),
8629
8630 heap_range: heap_range.map(|envelope| {
8631 ::fidl_next::FromWire::from_wire(unsafe {
8632 envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8633 })
8634 }),
8635 }
8636 }
8637 }
8638
8639 impl<'de> ::fidl_next::FromWireRef<crate::wire::SecureMemZeroSubRangeRequest<'de>>
8640 for SecureMemZeroSubRangeRequest
8641 {
8642 #[inline]
8643 fn from_wire_ref(wire: &crate::wire::SecureMemZeroSubRangeRequest<'de>) -> Self {
8644 Self {
8645 is_covering_range_explicit: wire.table.get(1).map(|envelope| {
8646 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8647 envelope.deref_unchecked::<bool>()
8648 })
8649 }),
8650
8651 heap_range: wire.table.get(2).map(|envelope| {
8652 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8653 envelope.deref_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
8654 })
8655 }),
8656 }
8657 }
8658 }
8659
8660 pub type SecureMemZeroSubRangeResponse = ();
8661}
8662
8663pub mod wire {
8664
8665 #[repr(C)]
8667 pub struct AllocatorValidateBufferCollectionTokenRequest<'de> {
8668 pub(crate) table: ::fidl_next::wire::Table<'de>,
8669 }
8670
8671 impl<'de> Drop for AllocatorValidateBufferCollectionTokenRequest<'de> {
8672 fn drop(&mut self) {
8673 let _ = self
8674 .table
8675 .get(1)
8676 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
8677 }
8678 }
8679
8680 impl ::fidl_next::Constrained for AllocatorValidateBufferCollectionTokenRequest<'_> {
8681 type Constraint = ();
8682
8683 fn validate(
8684 _: ::fidl_next::Slot<'_, Self>,
8685 _: Self::Constraint,
8686 ) -> Result<(), ::fidl_next::ValidationError> {
8687 Ok(())
8688 }
8689 }
8690
8691 unsafe impl ::fidl_next::Wire for AllocatorValidateBufferCollectionTokenRequest<'static> {
8692 type Narrowed<'de> = AllocatorValidateBufferCollectionTokenRequest<'de>;
8693
8694 #[inline]
8695 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8696 ::fidl_next::munge!(let Self { table } = out);
8697 ::fidl_next::wire::Table::zero_padding(table);
8698 }
8699 }
8700
8701 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
8702 for AllocatorValidateBufferCollectionTokenRequest<'de>
8703 where
8704 ___D: ::fidl_next::Decoder<'de> + ?Sized,
8705 {
8706 fn decode(
8707 slot: ::fidl_next::Slot<'_, Self>,
8708 decoder: &mut ___D,
8709 _: (),
8710 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8711 ::fidl_next::munge!(let Self { table } = slot);
8712
8713 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8714 match ordinal {
8715 0 => unsafe { ::core::hint::unreachable_unchecked() },
8716
8717 1 => {
8718 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
8719 slot.as_mut(),
8720 decoder,
8721 (),
8722 )?;
8723
8724 Ok(())
8725 }
8726
8727 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
8728 }
8729 })
8730 }
8731 }
8732
8733 impl<'de> AllocatorValidateBufferCollectionTokenRequest<'de> {
8734 pub fn token_server_koid(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
8735 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8736 }
8737 }
8738
8739 impl<'de> ::core::fmt::Debug for AllocatorValidateBufferCollectionTokenRequest<'de> {
8740 fn fmt(
8741 &self,
8742 f: &mut ::core::fmt::Formatter<'_>,
8743 ) -> ::core::result::Result<(), ::core::fmt::Error> {
8744 f.debug_struct("AllocatorValidateBufferCollectionTokenRequest")
8745 .field("token_server_koid", &self.token_server_koid())
8746 .finish()
8747 }
8748 }
8749
8750 impl<'de> ::fidl_next::IntoNatural for AllocatorValidateBufferCollectionTokenRequest<'de> {
8751 type Natural = crate::natural::AllocatorValidateBufferCollectionTokenRequest;
8752 }
8753
8754 #[repr(C)]
8756 pub struct AllocatorValidateBufferCollectionTokenResponse<'de> {
8757 pub(crate) table: ::fidl_next::wire::Table<'de>,
8758 }
8759
8760 impl<'de> Drop for AllocatorValidateBufferCollectionTokenResponse<'de> {
8761 fn drop(&mut self) {
8762 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
8763 }
8764 }
8765
8766 impl ::fidl_next::Constrained for AllocatorValidateBufferCollectionTokenResponse<'_> {
8767 type Constraint = ();
8768
8769 fn validate(
8770 _: ::fidl_next::Slot<'_, Self>,
8771 _: Self::Constraint,
8772 ) -> Result<(), ::fidl_next::ValidationError> {
8773 Ok(())
8774 }
8775 }
8776
8777 unsafe impl ::fidl_next::Wire for AllocatorValidateBufferCollectionTokenResponse<'static> {
8778 type Narrowed<'de> = AllocatorValidateBufferCollectionTokenResponse<'de>;
8779
8780 #[inline]
8781 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8782 ::fidl_next::munge!(let Self { table } = out);
8783 ::fidl_next::wire::Table::zero_padding(table);
8784 }
8785 }
8786
8787 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
8788 for AllocatorValidateBufferCollectionTokenResponse<'de>
8789 where
8790 ___D: ::fidl_next::Decoder<'de> + ?Sized,
8791 {
8792 fn decode(
8793 slot: ::fidl_next::Slot<'_, Self>,
8794 decoder: &mut ___D,
8795 _: (),
8796 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8797 ::fidl_next::munge!(let Self { table } = slot);
8798
8799 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8800 match ordinal {
8801 0 => unsafe { ::core::hint::unreachable_unchecked() },
8802
8803 1 => {
8804 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
8805 slot.as_mut(),
8806 decoder,
8807 (),
8808 )?;
8809
8810 Ok(())
8811 }
8812
8813 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
8814 }
8815 })
8816 }
8817 }
8818
8819 impl<'de> AllocatorValidateBufferCollectionTokenResponse<'de> {
8820 pub fn is_known(&self) -> ::core::option::Option<&bool> {
8821 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8822 }
8823 }
8824
8825 impl<'de> ::core::fmt::Debug for AllocatorValidateBufferCollectionTokenResponse<'de> {
8826 fn fmt(
8827 &self,
8828 f: &mut ::core::fmt::Formatter<'_>,
8829 ) -> ::core::result::Result<(), ::core::fmt::Error> {
8830 f.debug_struct("AllocatorValidateBufferCollectionTokenResponse")
8831 .field("is_known", &self.is_known())
8832 .finish()
8833 }
8834 }
8835
8836 impl<'de> ::fidl_next::IntoNatural for AllocatorValidateBufferCollectionTokenResponse<'de> {
8837 type Natural = crate::natural::AllocatorValidateBufferCollectionTokenResponse;
8838 }
8839
8840 #[repr(C)]
8842 pub struct AllocatorSetDebugClientInfoRequest<'de> {
8843 pub(crate) table: ::fidl_next::wire::Table<'de>,
8844 }
8845
8846 impl<'de> Drop for AllocatorSetDebugClientInfoRequest<'de> {
8847 fn drop(&mut self) {
8848 let _ = self.table.get(1).map(|envelope| unsafe {
8849 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8850 });
8851
8852 let _ = self
8853 .table
8854 .get(2)
8855 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
8856 }
8857 }
8858
8859 impl ::fidl_next::Constrained for AllocatorSetDebugClientInfoRequest<'_> {
8860 type Constraint = ();
8861
8862 fn validate(
8863 _: ::fidl_next::Slot<'_, Self>,
8864 _: Self::Constraint,
8865 ) -> Result<(), ::fidl_next::ValidationError> {
8866 Ok(())
8867 }
8868 }
8869
8870 unsafe impl ::fidl_next::Wire for AllocatorSetDebugClientInfoRequest<'static> {
8871 type Narrowed<'de> = AllocatorSetDebugClientInfoRequest<'de>;
8872
8873 #[inline]
8874 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8875 ::fidl_next::munge!(let Self { table } = out);
8876 ::fidl_next::wire::Table::zero_padding(table);
8877 }
8878 }
8879
8880 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for AllocatorSetDebugClientInfoRequest<'de>
8881 where
8882 ___D: ::fidl_next::Decoder<'de> + ?Sized,
8883 {
8884 fn decode(
8885 slot: ::fidl_next::Slot<'_, Self>,
8886 decoder: &mut ___D,
8887 _: (),
8888 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8889 ::fidl_next::munge!(let Self { table } = slot);
8890
8891 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8892 match ordinal {
8893 0 => unsafe { ::core::hint::unreachable_unchecked() },
8894
8895 1 => {
8896 ::fidl_next::wire::Envelope::decode_as::<
8897 ___D,
8898 ::fidl_next::wire::String<'de>,
8899 >(slot.as_mut(), decoder, 256)?;
8900
8901 let value = unsafe {
8902 slot.deref_unchecked()
8903 .deref_unchecked::<::fidl_next::wire::String<'_>>()
8904 };
8905
8906 if value.len() > 256 {
8907 return Err(::fidl_next::DecodeError::VectorTooLong {
8908 size: value.len() as u64,
8909 limit: 256,
8910 });
8911 }
8912
8913 Ok(())
8914 }
8915
8916 2 => {
8917 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
8918 slot.as_mut(),
8919 decoder,
8920 (),
8921 )?;
8922
8923 Ok(())
8924 }
8925
8926 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
8927 }
8928 })
8929 }
8930 }
8931
8932 impl<'de> AllocatorSetDebugClientInfoRequest<'de> {
8933 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
8934 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8935 }
8936
8937 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
8938 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8939 }
8940 }
8941
8942 impl<'de> ::core::fmt::Debug for AllocatorSetDebugClientInfoRequest<'de> {
8943 fn fmt(
8944 &self,
8945 f: &mut ::core::fmt::Formatter<'_>,
8946 ) -> ::core::result::Result<(), ::core::fmt::Error> {
8947 f.debug_struct("AllocatorSetDebugClientInfoRequest")
8948 .field("name", &self.name())
8949 .field("id", &self.id())
8950 .finish()
8951 }
8952 }
8953
8954 impl<'de> ::fidl_next::IntoNatural for AllocatorSetDebugClientInfoRequest<'de> {
8955 type Natural = crate::natural::AllocatorSetDebugClientInfoRequest;
8956 }
8957
8958 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
8960 #[repr(transparent)]
8961 pub struct Error {
8962 pub(crate) value: ::fidl_next::wire::Uint32,
8963 }
8964
8965 impl ::fidl_next::Constrained for Error {
8966 type Constraint = ();
8967
8968 fn validate(
8969 _: ::fidl_next::Slot<'_, Self>,
8970 _: Self::Constraint,
8971 ) -> Result<(), ::fidl_next::ValidationError> {
8972 Ok(())
8973 }
8974 }
8975
8976 unsafe impl ::fidl_next::Wire for Error {
8977 type Narrowed<'de> = Self;
8978
8979 #[inline]
8980 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8981 }
8983 }
8984
8985 impl Error {
8986 pub const INVALID: Error = Error { value: ::fidl_next::wire::Uint32(0) };
8987
8988 pub const UNSPECIFIED: Error = Error { value: ::fidl_next::wire::Uint32(1) };
8989
8990 pub const PROTOCOL_DEVIATION: Error = Error { value: ::fidl_next::wire::Uint32(2) };
8991
8992 pub const NOT_FOUND: Error = Error { value: ::fidl_next::wire::Uint32(3) };
8993
8994 pub const HANDLE_ACCESS_DENIED: Error = Error { value: ::fidl_next::wire::Uint32(4) };
8995
8996 pub const NO_MEMORY: Error = Error { value: ::fidl_next::wire::Uint32(5) };
8997
8998 pub const CONSTRAINTS_INTERSECTION_EMPTY: Error =
8999 Error { value: ::fidl_next::wire::Uint32(6) };
9000
9001 pub const PENDING: Error = Error { value: ::fidl_next::wire::Uint32(7) };
9002
9003 pub const TOO_MANY_GROUP_CHILD_COMBINATIONS: Error =
9004 Error { value: ::fidl_next::wire::Uint32(8) };
9005 }
9006
9007 unsafe impl<___D> ::fidl_next::Decode<___D> for Error
9008 where
9009 ___D: ?Sized,
9010 {
9011 fn decode(
9012 slot: ::fidl_next::Slot<'_, Self>,
9013 _: &mut ___D,
9014 _: (),
9015 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9016 Ok(())
9017 }
9018 }
9019
9020 impl ::core::convert::From<crate::natural::Error> for Error {
9021 fn from(natural: crate::natural::Error) -> Self {
9022 match natural {
9023 crate::natural::Error::Invalid => Error::INVALID,
9024
9025 crate::natural::Error::Unspecified => Error::UNSPECIFIED,
9026
9027 crate::natural::Error::ProtocolDeviation => Error::PROTOCOL_DEVIATION,
9028
9029 crate::natural::Error::NotFound => Error::NOT_FOUND,
9030
9031 crate::natural::Error::HandleAccessDenied => Error::HANDLE_ACCESS_DENIED,
9032
9033 crate::natural::Error::NoMemory => Error::NO_MEMORY,
9034
9035 crate::natural::Error::ConstraintsIntersectionEmpty => {
9036 Error::CONSTRAINTS_INTERSECTION_EMPTY
9037 }
9038
9039 crate::natural::Error::Pending => Error::PENDING,
9040
9041 crate::natural::Error::TooManyGroupChildCombinations => {
9042 Error::TOO_MANY_GROUP_CHILD_COMBINATIONS
9043 }
9044
9045 crate::natural::Error::UnknownOrdinal_(value) => {
9046 Error { value: ::fidl_next::wire::Uint32::from(value) }
9047 }
9048 }
9049 }
9050 }
9051
9052 impl ::fidl_next::IntoNatural for Error {
9053 type Natural = crate::natural::Error;
9054 }
9055
9056 pub type NodeSyncResponse = ::fidl_next::wire::Unit;
9058
9059 #[repr(C)]
9061 pub struct NodeSetNameRequest<'de> {
9062 pub(crate) table: ::fidl_next::wire::Table<'de>,
9063 }
9064
9065 impl<'de> Drop for NodeSetNameRequest<'de> {
9066 fn drop(&mut self) {
9067 let _ = self
9068 .table
9069 .get(1)
9070 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9071
9072 let _ = self.table.get(2).map(|envelope| unsafe {
9073 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9074 });
9075 }
9076 }
9077
9078 impl ::fidl_next::Constrained for NodeSetNameRequest<'_> {
9079 type Constraint = ();
9080
9081 fn validate(
9082 _: ::fidl_next::Slot<'_, Self>,
9083 _: Self::Constraint,
9084 ) -> Result<(), ::fidl_next::ValidationError> {
9085 Ok(())
9086 }
9087 }
9088
9089 unsafe impl ::fidl_next::Wire for NodeSetNameRequest<'static> {
9090 type Narrowed<'de> = NodeSetNameRequest<'de>;
9091
9092 #[inline]
9093 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9094 ::fidl_next::munge!(let Self { table } = out);
9095 ::fidl_next::wire::Table::zero_padding(table);
9096 }
9097 }
9098
9099 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetNameRequest<'de>
9100 where
9101 ___D: ::fidl_next::Decoder<'de> + ?Sized,
9102 {
9103 fn decode(
9104 slot: ::fidl_next::Slot<'_, Self>,
9105 decoder: &mut ___D,
9106 _: (),
9107 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9108 ::fidl_next::munge!(let Self { table } = slot);
9109
9110 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9111 match ordinal {
9112 0 => unsafe { ::core::hint::unreachable_unchecked() },
9113
9114 1 => {
9115 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9116 slot.as_mut(),
9117 decoder,
9118 (),
9119 )?;
9120
9121 Ok(())
9122 }
9123
9124 2 => {
9125 ::fidl_next::wire::Envelope::decode_as::<
9126 ___D,
9127 ::fidl_next::wire::String<'de>,
9128 >(slot.as_mut(), decoder, 64)?;
9129
9130 let value = unsafe {
9131 slot.deref_unchecked()
9132 .deref_unchecked::<::fidl_next::wire::String<'_>>()
9133 };
9134
9135 if value.len() > 64 {
9136 return Err(::fidl_next::DecodeError::VectorTooLong {
9137 size: value.len() as u64,
9138 limit: 64,
9139 });
9140 }
9141
9142 Ok(())
9143 }
9144
9145 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9146 }
9147 })
9148 }
9149 }
9150
9151 impl<'de> NodeSetNameRequest<'de> {
9152 pub fn priority(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9153 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9154 }
9155
9156 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
9157 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9158 }
9159 }
9160
9161 impl<'de> ::core::fmt::Debug for NodeSetNameRequest<'de> {
9162 fn fmt(
9163 &self,
9164 f: &mut ::core::fmt::Formatter<'_>,
9165 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9166 f.debug_struct("NodeSetNameRequest")
9167 .field("priority", &self.priority())
9168 .field("name", &self.name())
9169 .finish()
9170 }
9171 }
9172
9173 impl<'de> ::fidl_next::IntoNatural for NodeSetNameRequest<'de> {
9174 type Natural = crate::natural::NodeSetNameRequest;
9175 }
9176
9177 #[repr(C)]
9179 pub struct NodeSetDebugClientInfoRequest<'de> {
9180 pub(crate) table: ::fidl_next::wire::Table<'de>,
9181 }
9182
9183 impl<'de> Drop for NodeSetDebugClientInfoRequest<'de> {
9184 fn drop(&mut self) {
9185 let _ = self.table.get(1).map(|envelope| unsafe {
9186 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9187 });
9188
9189 let _ = self
9190 .table
9191 .get(2)
9192 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9193 }
9194 }
9195
9196 impl ::fidl_next::Constrained for NodeSetDebugClientInfoRequest<'_> {
9197 type Constraint = ();
9198
9199 fn validate(
9200 _: ::fidl_next::Slot<'_, Self>,
9201 _: Self::Constraint,
9202 ) -> Result<(), ::fidl_next::ValidationError> {
9203 Ok(())
9204 }
9205 }
9206
9207 unsafe impl ::fidl_next::Wire for NodeSetDebugClientInfoRequest<'static> {
9208 type Narrowed<'de> = NodeSetDebugClientInfoRequest<'de>;
9209
9210 #[inline]
9211 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9212 ::fidl_next::munge!(let Self { table } = out);
9213 ::fidl_next::wire::Table::zero_padding(table);
9214 }
9215 }
9216
9217 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetDebugClientInfoRequest<'de>
9218 where
9219 ___D: ::fidl_next::Decoder<'de> + ?Sized,
9220 {
9221 fn decode(
9222 slot: ::fidl_next::Slot<'_, Self>,
9223 decoder: &mut ___D,
9224 _: (),
9225 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9226 ::fidl_next::munge!(let Self { table } = slot);
9227
9228 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9229 match ordinal {
9230 0 => unsafe { ::core::hint::unreachable_unchecked() },
9231
9232 1 => {
9233 ::fidl_next::wire::Envelope::decode_as::<
9234 ___D,
9235 ::fidl_next::wire::String<'de>,
9236 >(slot.as_mut(), decoder, 256)?;
9237
9238 let value = unsafe {
9239 slot.deref_unchecked()
9240 .deref_unchecked::<::fidl_next::wire::String<'_>>()
9241 };
9242
9243 if value.len() > 256 {
9244 return Err(::fidl_next::DecodeError::VectorTooLong {
9245 size: value.len() as u64,
9246 limit: 256,
9247 });
9248 }
9249
9250 Ok(())
9251 }
9252
9253 2 => {
9254 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9255 slot.as_mut(),
9256 decoder,
9257 (),
9258 )?;
9259
9260 Ok(())
9261 }
9262
9263 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9264 }
9265 })
9266 }
9267 }
9268
9269 impl<'de> NodeSetDebugClientInfoRequest<'de> {
9270 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
9271 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9272 }
9273
9274 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9275 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9276 }
9277 }
9278
9279 impl<'de> ::core::fmt::Debug for NodeSetDebugClientInfoRequest<'de> {
9280 fn fmt(
9281 &self,
9282 f: &mut ::core::fmt::Formatter<'_>,
9283 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9284 f.debug_struct("NodeSetDebugClientInfoRequest")
9285 .field("name", &self.name())
9286 .field("id", &self.id())
9287 .finish()
9288 }
9289 }
9290
9291 impl<'de> ::fidl_next::IntoNatural for NodeSetDebugClientInfoRequest<'de> {
9292 type Natural = crate::natural::NodeSetDebugClientInfoRequest;
9293 }
9294
9295 #[repr(C)]
9297 pub struct NodeSetDebugTimeoutLogDeadlineRequest<'de> {
9298 pub(crate) table: ::fidl_next::wire::Table<'de>,
9299 }
9300
9301 impl<'de> Drop for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
9302 fn drop(&mut self) {
9303 let _ = self
9304 .table
9305 .get(1)
9306 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
9307 }
9308 }
9309
9310 impl ::fidl_next::Constrained for NodeSetDebugTimeoutLogDeadlineRequest<'_> {
9311 type Constraint = ();
9312
9313 fn validate(
9314 _: ::fidl_next::Slot<'_, Self>,
9315 _: Self::Constraint,
9316 ) -> Result<(), ::fidl_next::ValidationError> {
9317 Ok(())
9318 }
9319 }
9320
9321 unsafe impl ::fidl_next::Wire for NodeSetDebugTimeoutLogDeadlineRequest<'static> {
9322 type Narrowed<'de> = NodeSetDebugTimeoutLogDeadlineRequest<'de>;
9323
9324 #[inline]
9325 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9326 ::fidl_next::munge!(let Self { table } = out);
9327 ::fidl_next::wire::Table::zero_padding(table);
9328 }
9329 }
9330
9331 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeSetDebugTimeoutLogDeadlineRequest<'de>
9332 where
9333 ___D: ::fidl_next::Decoder<'de> + ?Sized,
9334 {
9335 fn decode(
9336 slot: ::fidl_next::Slot<'_, Self>,
9337 decoder: &mut ___D,
9338 _: (),
9339 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9340 ::fidl_next::munge!(let Self { table } = slot);
9341
9342 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9343 match ordinal {
9344 0 => unsafe { ::core::hint::unreachable_unchecked() },
9345
9346 1 => {
9347 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
9348 slot.as_mut(),
9349 decoder,
9350 (),
9351 )?;
9352
9353 Ok(())
9354 }
9355
9356 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9357 }
9358 })
9359 }
9360 }
9361
9362 impl<'de> NodeSetDebugTimeoutLogDeadlineRequest<'de> {
9363 pub fn deadline(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
9364 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9365 }
9366 }
9367
9368 impl<'de> ::core::fmt::Debug for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
9369 fn fmt(
9370 &self,
9371 f: &mut ::core::fmt::Formatter<'_>,
9372 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9373 f.debug_struct("NodeSetDebugTimeoutLogDeadlineRequest")
9374 .field("deadline", &self.deadline())
9375 .finish()
9376 }
9377 }
9378
9379 impl<'de> ::fidl_next::IntoNatural for NodeSetDebugTimeoutLogDeadlineRequest<'de> {
9380 type Natural = crate::natural::NodeSetDebugTimeoutLogDeadlineRequest;
9381 }
9382
9383 #[repr(C)]
9385 pub struct NodeIsAlternateForResponse<'de> {
9386 pub(crate) table: ::fidl_next::wire::Table<'de>,
9387 }
9388
9389 impl<'de> Drop for NodeIsAlternateForResponse<'de> {
9390 fn drop(&mut self) {
9391 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9392 }
9393 }
9394
9395 impl ::fidl_next::Constrained for NodeIsAlternateForResponse<'_> {
9396 type Constraint = ();
9397
9398 fn validate(
9399 _: ::fidl_next::Slot<'_, Self>,
9400 _: Self::Constraint,
9401 ) -> Result<(), ::fidl_next::ValidationError> {
9402 Ok(())
9403 }
9404 }
9405
9406 unsafe impl ::fidl_next::Wire for NodeIsAlternateForResponse<'static> {
9407 type Narrowed<'de> = NodeIsAlternateForResponse<'de>;
9408
9409 #[inline]
9410 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9411 ::fidl_next::munge!(let Self { table } = out);
9412 ::fidl_next::wire::Table::zero_padding(table);
9413 }
9414 }
9415
9416 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeIsAlternateForResponse<'de>
9417 where
9418 ___D: ::fidl_next::Decoder<'de> + ?Sized,
9419 {
9420 fn decode(
9421 slot: ::fidl_next::Slot<'_, Self>,
9422 decoder: &mut ___D,
9423 _: (),
9424 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9425 ::fidl_next::munge!(let Self { table } = slot);
9426
9427 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9428 match ordinal {
9429 0 => unsafe { ::core::hint::unreachable_unchecked() },
9430
9431 1 => {
9432 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9433 slot.as_mut(),
9434 decoder,
9435 (),
9436 )?;
9437
9438 Ok(())
9439 }
9440
9441 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9442 }
9443 })
9444 }
9445 }
9446
9447 impl<'de> NodeIsAlternateForResponse<'de> {
9448 pub fn is_alternate(&self) -> ::core::option::Option<&bool> {
9449 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9450 }
9451 }
9452
9453 impl<'de> ::core::fmt::Debug for NodeIsAlternateForResponse<'de> {
9454 fn fmt(
9455 &self,
9456 f: &mut ::core::fmt::Formatter<'_>,
9457 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9458 f.debug_struct("NodeIsAlternateForResponse")
9459 .field("is_alternate", &self.is_alternate())
9460 .finish()
9461 }
9462 }
9463
9464 impl<'de> ::fidl_next::IntoNatural for NodeIsAlternateForResponse<'de> {
9465 type Natural = crate::natural::NodeIsAlternateForResponse;
9466 }
9467
9468 #[repr(C)]
9470 pub struct NodeGetBufferCollectionIdResponse<'de> {
9471 pub(crate) table: ::fidl_next::wire::Table<'de>,
9472 }
9473
9474 impl<'de> Drop for NodeGetBufferCollectionIdResponse<'de> {
9475 fn drop(&mut self) {
9476 let _ = self
9477 .table
9478 .get(1)
9479 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9480 }
9481 }
9482
9483 impl ::fidl_next::Constrained for NodeGetBufferCollectionIdResponse<'_> {
9484 type Constraint = ();
9485
9486 fn validate(
9487 _: ::fidl_next::Slot<'_, Self>,
9488 _: Self::Constraint,
9489 ) -> Result<(), ::fidl_next::ValidationError> {
9490 Ok(())
9491 }
9492 }
9493
9494 unsafe impl ::fidl_next::Wire for NodeGetBufferCollectionIdResponse<'static> {
9495 type Narrowed<'de> = NodeGetBufferCollectionIdResponse<'de>;
9496
9497 #[inline]
9498 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9499 ::fidl_next::munge!(let Self { table } = out);
9500 ::fidl_next::wire::Table::zero_padding(table);
9501 }
9502 }
9503
9504 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeGetBufferCollectionIdResponse<'de>
9505 where
9506 ___D: ::fidl_next::Decoder<'de> + ?Sized,
9507 {
9508 fn decode(
9509 slot: ::fidl_next::Slot<'_, Self>,
9510 decoder: &mut ___D,
9511 _: (),
9512 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9513 ::fidl_next::munge!(let Self { table } = slot);
9514
9515 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9516 match ordinal {
9517 0 => unsafe { ::core::hint::unreachable_unchecked() },
9518
9519 1 => {
9520 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9521 slot.as_mut(),
9522 decoder,
9523 (),
9524 )?;
9525
9526 Ok(())
9527 }
9528
9529 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9530 }
9531 })
9532 }
9533 }
9534
9535 impl<'de> NodeGetBufferCollectionIdResponse<'de> {
9536 pub fn buffer_collection_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9537 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9538 }
9539 }
9540
9541 impl<'de> ::core::fmt::Debug for NodeGetBufferCollectionIdResponse<'de> {
9542 fn fmt(
9543 &self,
9544 f: &mut ::core::fmt::Formatter<'_>,
9545 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9546 f.debug_struct("NodeGetBufferCollectionIdResponse")
9547 .field("buffer_collection_id", &self.buffer_collection_id())
9548 .finish()
9549 }
9550 }
9551
9552 impl<'de> ::fidl_next::IntoNatural for NodeGetBufferCollectionIdResponse<'de> {
9553 type Natural = crate::natural::NodeGetBufferCollectionIdResponse;
9554 }
9555
9556 #[repr(C)]
9558 pub struct BufferUsage<'de> {
9559 pub(crate) table: ::fidl_next::wire::Table<'de>,
9560 }
9561
9562 impl<'de> Drop for BufferUsage<'de> {
9563 fn drop(&mut self) {
9564 let _ = self
9565 .table
9566 .get(1)
9567 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9568
9569 let _ = self
9570 .table
9571 .get(2)
9572 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9573
9574 let _ = self
9575 .table
9576 .get(3)
9577 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9578
9579 let _ = self
9580 .table
9581 .get(4)
9582 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9583
9584 let _ = self
9585 .table
9586 .get(5)
9587 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
9588 }
9589 }
9590
9591 impl ::fidl_next::Constrained for BufferUsage<'_> {
9592 type Constraint = ();
9593
9594 fn validate(
9595 _: ::fidl_next::Slot<'_, Self>,
9596 _: Self::Constraint,
9597 ) -> Result<(), ::fidl_next::ValidationError> {
9598 Ok(())
9599 }
9600 }
9601
9602 unsafe impl ::fidl_next::Wire for BufferUsage<'static> {
9603 type Narrowed<'de> = BufferUsage<'de>;
9604
9605 #[inline]
9606 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9607 ::fidl_next::munge!(let Self { table } = out);
9608 ::fidl_next::wire::Table::zero_padding(table);
9609 }
9610 }
9611
9612 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferUsage<'de>
9613 where
9614 ___D: ::fidl_next::Decoder<'de> + ?Sized,
9615 {
9616 fn decode(
9617 slot: ::fidl_next::Slot<'_, Self>,
9618 decoder: &mut ___D,
9619 _: (),
9620 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9621 ::fidl_next::munge!(let Self { table } = slot);
9622
9623 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9624 match ordinal {
9625 0 => unsafe { ::core::hint::unreachable_unchecked() },
9626
9627 1 => {
9628 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9629 slot.as_mut(),
9630 decoder,
9631 (),
9632 )?;
9633
9634 Ok(())
9635 }
9636
9637 2 => {
9638 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9639 slot.as_mut(),
9640 decoder,
9641 (),
9642 )?;
9643
9644 Ok(())
9645 }
9646
9647 3 => {
9648 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9649 slot.as_mut(),
9650 decoder,
9651 (),
9652 )?;
9653
9654 Ok(())
9655 }
9656
9657 4 => {
9658 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9659 slot.as_mut(),
9660 decoder,
9661 (),
9662 )?;
9663
9664 Ok(())
9665 }
9666
9667 5 => {
9668 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
9669 slot.as_mut(),
9670 decoder,
9671 (),
9672 )?;
9673
9674 Ok(())
9675 }
9676
9677 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9678 }
9679 })
9680 }
9681 }
9682
9683 impl<'de> BufferUsage<'de> {
9684 pub fn none(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9685 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9686 }
9687
9688 pub fn cpu(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9689 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9690 }
9691
9692 pub fn vulkan(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9693 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9694 }
9695
9696 pub fn display(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9697 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9698 }
9699
9700 pub fn video(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
9701 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9702 }
9703 }
9704
9705 impl<'de> ::core::fmt::Debug for BufferUsage<'de> {
9706 fn fmt(
9707 &self,
9708 f: &mut ::core::fmt::Formatter<'_>,
9709 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9710 f.debug_struct("BufferUsage")
9711 .field("none", &self.none())
9712 .field("cpu", &self.cpu())
9713 .field("vulkan", &self.vulkan())
9714 .field("display", &self.display())
9715 .field("video", &self.video())
9716 .finish()
9717 }
9718 }
9719
9720 impl<'de> ::fidl_next::IntoNatural for BufferUsage<'de> {
9721 type Natural = crate::natural::BufferUsage;
9722 }
9723
9724 #[repr(C)]
9726 pub struct Heap<'de> {
9727 pub(crate) table: ::fidl_next::wire::Table<'de>,
9728 }
9729
9730 impl<'de> Drop for Heap<'de> {
9731 fn drop(&mut self) {
9732 let _ = self.table.get(1).map(|envelope| unsafe {
9733 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9734 });
9735
9736 let _ = self
9737 .table
9738 .get(2)
9739 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9740 }
9741 }
9742
9743 impl ::fidl_next::Constrained for Heap<'_> {
9744 type Constraint = ();
9745
9746 fn validate(
9747 _: ::fidl_next::Slot<'_, Self>,
9748 _: Self::Constraint,
9749 ) -> Result<(), ::fidl_next::ValidationError> {
9750 Ok(())
9751 }
9752 }
9753
9754 unsafe impl ::fidl_next::Wire for Heap<'static> {
9755 type Narrowed<'de> = Heap<'de>;
9756
9757 #[inline]
9758 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9759 ::fidl_next::munge!(let Self { table } = out);
9760 ::fidl_next::wire::Table::zero_padding(table);
9761 }
9762 }
9763
9764 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Heap<'de>
9765 where
9766 ___D: ::fidl_next::Decoder<'de> + ?Sized,
9767 {
9768 fn decode(
9769 slot: ::fidl_next::Slot<'_, Self>,
9770 decoder: &mut ___D,
9771 _: (),
9772 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9773 ::fidl_next::munge!(let Self { table } = slot);
9774
9775 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9776 match ordinal {
9777 0 => unsafe { ::core::hint::unreachable_unchecked() },
9778
9779 1 => {
9780 ::fidl_next::wire::Envelope::decode_as::<
9781 ___D,
9782 ::fidl_next::wire::String<'de>,
9783 >(slot.as_mut(), decoder, 128)?;
9784
9785 let value = unsafe {
9786 slot.deref_unchecked()
9787 .deref_unchecked::<::fidl_next::wire::String<'_>>()
9788 };
9789
9790 if value.len() > 128 {
9791 return Err(::fidl_next::DecodeError::VectorTooLong {
9792 size: value.len() as u64,
9793 limit: 128,
9794 });
9795 }
9796
9797 Ok(())
9798 }
9799
9800 2 => {
9801 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9802 slot.as_mut(),
9803 decoder,
9804 (),
9805 )?;
9806
9807 Ok(())
9808 }
9809
9810 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
9811 }
9812 })
9813 }
9814 }
9815
9816 impl<'de> Heap<'de> {
9817 pub fn heap_type(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
9818 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9819 }
9820
9821 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
9822 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9823 }
9824 }
9825
9826 impl<'de> ::core::fmt::Debug for Heap<'de> {
9827 fn fmt(
9828 &self,
9829 f: &mut ::core::fmt::Formatter<'_>,
9830 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9831 f.debug_struct("Heap")
9832 .field("heap_type", &self.heap_type())
9833 .field("id", &self.id())
9834 .finish()
9835 }
9836 }
9837
9838 impl<'de> ::fidl_next::IntoNatural for Heap<'de> {
9839 type Natural = crate::natural::Heap;
9840 }
9841
9842 #[repr(C)]
9844 pub struct BufferMemoryConstraints<'de> {
9845 pub(crate) table: ::fidl_next::wire::Table<'de>,
9846 }
9847
9848 impl<'de> Drop for BufferMemoryConstraints<'de> {
9849 fn drop(&mut self) {
9850 let _ = self
9851 .table
9852 .get(1)
9853 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9854
9855 let _ = self
9856 .table
9857 .get(2)
9858 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
9859
9860 let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9861
9862 let _ = self.table.get(4).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9863
9864 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9865
9866 let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9867
9868 let _ = self.table.get(7).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9869
9870 let _ = self.table.get(8).map(|envelope| unsafe {
9871 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>()
9872 });
9873 }
9874 }
9875
9876 impl ::fidl_next::Constrained for BufferMemoryConstraints<'_> {
9877 type Constraint = ();
9878
9879 fn validate(
9880 _: ::fidl_next::Slot<'_, Self>,
9881 _: Self::Constraint,
9882 ) -> Result<(), ::fidl_next::ValidationError> {
9883 Ok(())
9884 }
9885 }
9886
9887 unsafe impl ::fidl_next::Wire for BufferMemoryConstraints<'static> {
9888 type Narrowed<'de> = BufferMemoryConstraints<'de>;
9889
9890 #[inline]
9891 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9892 ::fidl_next::munge!(let Self { table } = out);
9893 ::fidl_next::wire::Table::zero_padding(table);
9894 }
9895 }
9896
9897 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferMemoryConstraints<'de>
9898 where
9899 ___D: ::fidl_next::Decoder<'de> + ?Sized,
9900 {
9901 fn decode(
9902 slot: ::fidl_next::Slot<'_, Self>,
9903 decoder: &mut ___D,
9904 _: (),
9905 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9906 ::fidl_next::munge!(let Self { table } = slot);
9907
9908 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9909 match ordinal {
9910 0 => unsafe { ::core::hint::unreachable_unchecked() },
9911
9912 1 => {
9913 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9914 slot.as_mut(),
9915 decoder,
9916 (),
9917 )?;
9918
9919 Ok(())
9920 }
9921
9922 2 => {
9923 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
9924 slot.as_mut(),
9925 decoder,
9926 (),
9927 )?;
9928
9929 Ok(())
9930 }
9931
9932 3 => {
9933 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9934 slot.as_mut(),
9935 decoder,
9936 (),
9937 )?;
9938
9939 Ok(())
9940 }
9941
9942 4 => {
9943 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9944 slot.as_mut(),
9945 decoder,
9946 (),
9947 )?;
9948
9949 Ok(())
9950 }
9951
9952 5 => {
9953 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9954 slot.as_mut(),
9955 decoder,
9956 (),
9957 )?;
9958
9959 Ok(())
9960 }
9961
9962 6 => {
9963 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9964 slot.as_mut(),
9965 decoder,
9966 (),
9967 )?;
9968
9969 Ok(())
9970 }
9971
9972 7 => {
9973 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
9974 slot.as_mut(),
9975 decoder,
9976 (),
9977 )?;
9978
9979 Ok(())
9980 }
9981
9982 8 => {
9983 ::fidl_next::wire::Envelope::decode_as::<
9984 ___D,
9985 ::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>,
9986 >(slot.as_mut(), decoder, (64, ()))?;
9987
9988 let value = unsafe {
9989 slot
9990 .deref_unchecked()
9991 .deref_unchecked::<
9992 ::fidl_next::wire::Vector<'_, crate::wire::Heap<'_>>
9993 >()
9994 };
9995
9996 if value.len() > 64 {
9997 return Err(::fidl_next::DecodeError::VectorTooLong {
9998 size: value.len() as u64,
9999 limit: 64,
10000 });
10001 }
10002
10003 Ok(())
10004 }
10005
10006 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10007 }
10008 })
10009 }
10010 }
10011
10012 impl<'de> BufferMemoryConstraints<'de> {
10013 pub fn min_size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10014 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10015 }
10016
10017 pub fn max_size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10018 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10019 }
10020
10021 pub fn physically_contiguous_required(&self) -> ::core::option::Option<&bool> {
10022 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10023 }
10024
10025 pub fn secure_required(&self) -> ::core::option::Option<&bool> {
10026 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10027 }
10028
10029 pub fn cpu_domain_supported(&self) -> ::core::option::Option<&bool> {
10030 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10031 }
10032
10033 pub fn ram_domain_supported(&self) -> ::core::option::Option<&bool> {
10034 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10035 }
10036
10037 pub fn inaccessible_domain_supported(&self) -> ::core::option::Option<&bool> {
10038 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10039 }
10040
10041 pub fn permitted_heaps(
10042 &self,
10043 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Heap<'de>>>
10044 {
10045 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10046 }
10047 }
10048
10049 impl<'de> ::core::fmt::Debug for BufferMemoryConstraints<'de> {
10050 fn fmt(
10051 &self,
10052 f: &mut ::core::fmt::Formatter<'_>,
10053 ) -> ::core::result::Result<(), ::core::fmt::Error> {
10054 f.debug_struct("BufferMemoryConstraints")
10055 .field("min_size_bytes", &self.min_size_bytes())
10056 .field("max_size_bytes", &self.max_size_bytes())
10057 .field("physically_contiguous_required", &self.physically_contiguous_required())
10058 .field("secure_required", &self.secure_required())
10059 .field("cpu_domain_supported", &self.cpu_domain_supported())
10060 .field("ram_domain_supported", &self.ram_domain_supported())
10061 .field("inaccessible_domain_supported", &self.inaccessible_domain_supported())
10062 .field("permitted_heaps", &self.permitted_heaps())
10063 .finish()
10064 }
10065 }
10066
10067 impl<'de> ::fidl_next::IntoNatural for BufferMemoryConstraints<'de> {
10068 type Natural = crate::natural::BufferMemoryConstraints;
10069 }
10070
10071 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
10073 #[repr(transparent)]
10074 pub struct CoherencyDomain {
10075 pub(crate) value: ::fidl_next::wire::Uint32,
10076 }
10077
10078 impl ::fidl_next::Constrained for CoherencyDomain {
10079 type Constraint = ();
10080
10081 fn validate(
10082 _: ::fidl_next::Slot<'_, Self>,
10083 _: Self::Constraint,
10084 ) -> Result<(), ::fidl_next::ValidationError> {
10085 Ok(())
10086 }
10087 }
10088
10089 unsafe impl ::fidl_next::Wire for CoherencyDomain {
10090 type Narrowed<'de> = Self;
10091
10092 #[inline]
10093 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10094 }
10096 }
10097
10098 impl CoherencyDomain {
10099 pub const CPU: CoherencyDomain = CoherencyDomain { value: ::fidl_next::wire::Uint32(0) };
10100
10101 pub const RAM: CoherencyDomain = CoherencyDomain { value: ::fidl_next::wire::Uint32(1) };
10102
10103 pub const INACCESSIBLE: CoherencyDomain =
10104 CoherencyDomain { value: ::fidl_next::wire::Uint32(2) };
10105 }
10106
10107 unsafe impl<___D> ::fidl_next::Decode<___D> for CoherencyDomain
10108 where
10109 ___D: ?Sized,
10110 {
10111 fn decode(
10112 slot: ::fidl_next::Slot<'_, Self>,
10113 _: &mut ___D,
10114 _: (),
10115 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10116 Ok(())
10117 }
10118 }
10119
10120 impl ::core::convert::From<crate::natural::CoherencyDomain> for CoherencyDomain {
10121 fn from(natural: crate::natural::CoherencyDomain) -> Self {
10122 match natural {
10123 crate::natural::CoherencyDomain::Cpu => CoherencyDomain::CPU,
10124
10125 crate::natural::CoherencyDomain::Ram => CoherencyDomain::RAM,
10126
10127 crate::natural::CoherencyDomain::Inaccessible => CoherencyDomain::INACCESSIBLE,
10128
10129 crate::natural::CoherencyDomain::UnknownOrdinal_(value) => {
10130 CoherencyDomain { value: ::fidl_next::wire::Uint32::from(value) }
10131 }
10132 }
10133 }
10134 }
10135
10136 impl ::fidl_next::IntoNatural for CoherencyDomain {
10137 type Natural = crate::natural::CoherencyDomain;
10138 }
10139
10140 #[derive(Clone, Debug)]
10142 #[repr(C)]
10143 pub struct PixelFormatAndModifier {
10144 pub pixel_format: ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
10145
10146 pub pixel_format_modifier: ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
10147 }
10148
10149 static_assertions::const_assert_eq!(std::mem::size_of::<PixelFormatAndModifier>(), 16);
10150 static_assertions::const_assert_eq!(std::mem::align_of::<PixelFormatAndModifier>(), 8);
10151
10152 static_assertions::const_assert_eq!(
10153 std::mem::offset_of!(PixelFormatAndModifier, pixel_format),
10154 0
10155 );
10156
10157 static_assertions::const_assert_eq!(
10158 std::mem::offset_of!(PixelFormatAndModifier, pixel_format_modifier),
10159 8
10160 );
10161
10162 impl ::fidl_next::Constrained for PixelFormatAndModifier {
10163 type Constraint = ();
10164
10165 fn validate(
10166 _: ::fidl_next::Slot<'_, Self>,
10167 _: Self::Constraint,
10168 ) -> Result<(), ::fidl_next::ValidationError> {
10169 Ok(())
10170 }
10171 }
10172
10173 unsafe impl ::fidl_next::Wire for PixelFormatAndModifier {
10174 type Narrowed<'de> = PixelFormatAndModifier;
10175
10176 #[inline]
10177 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
10178 ::fidl_next::munge! {
10179 let Self {
10180 pixel_format,
10181 pixel_format_modifier,
10182
10183 } = &mut *out_;
10184 }
10185
10186 ::fidl_next::Wire::zero_padding(pixel_format);
10187
10188 ::fidl_next::Wire::zero_padding(pixel_format_modifier);
10189
10190 unsafe {
10191 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
10192 }
10193 }
10194 }
10195
10196 unsafe impl<___D> ::fidl_next::Decode<___D> for PixelFormatAndModifier
10197 where
10198 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10199 {
10200 fn decode(
10201 slot_: ::fidl_next::Slot<'_, Self>,
10202 decoder_: &mut ___D,
10203 _: (),
10204 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10205 if slot_.as_bytes()[4..8] != [0u8; 4] {
10206 return Err(::fidl_next::DecodeError::InvalidPadding);
10207 }
10208
10209 ::fidl_next::munge! {
10210 let Self {
10211 mut pixel_format,
10212 mut pixel_format_modifier,
10213
10214 } = slot_;
10215 }
10216
10217 let _field = pixel_format.as_mut();
10218
10219 ::fidl_next::Decode::decode(pixel_format.as_mut(), decoder_, ())?;
10220
10221 let _field = pixel_format_modifier.as_mut();
10222
10223 ::fidl_next::Decode::decode(pixel_format_modifier.as_mut(), decoder_, ())?;
10224
10225 Ok(())
10226 }
10227 }
10228
10229 impl ::fidl_next::IntoNatural for PixelFormatAndModifier {
10230 type Natural = crate::natural::PixelFormatAndModifier;
10231 }
10232
10233 pub type BufferCollectionCheckAllBuffersAllocatedResponse = ::fidl_next::wire::Unit;
10235
10236 #[repr(C)]
10238 pub struct ImageFormatConstraints<'de> {
10239 pub(crate) table: ::fidl_next::wire::Table<'de>,
10240 }
10241
10242 impl<'de> Drop for ImageFormatConstraints<'de> {
10243 fn drop(&mut self) {
10244 let _ = self.table.get(1).map(|envelope| unsafe {
10245 envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>()
10246 });
10247
10248 let _ = self.table.get(2)
10249 .map(|envelope| unsafe {
10250 envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>()
10251 });
10252
10253 let _ = self.table.get(3).map(|envelope| unsafe {
10254 envelope.read_unchecked::<::fidl_next::wire::Vector<
10255 'de,
10256 ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
10257 >>()
10258 });
10259
10260 let _ = self.table.get(4).map(|envelope| unsafe {
10261 envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
10262 });
10263
10264 let _ = self.table.get(5).map(|envelope| unsafe {
10265 envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
10266 });
10267
10268 let _ = self
10269 .table
10270 .get(6)
10271 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10272
10273 let _ = self
10274 .table
10275 .get(7)
10276 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10277
10278 let _ = self
10279 .table
10280 .get(8)
10281 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
10282
10283 let _ = self.table.get(9).map(|envelope| unsafe {
10284 envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
10285 });
10286
10287 let _ = self.table.get(10).map(|envelope| unsafe {
10288 envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
10289 });
10290
10291 let _ = self.table.get(11).map(|envelope| unsafe {
10292 envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
10293 });
10294
10295 let _ = self.table.get(12).map(|envelope| unsafe {
10296 envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
10297 });
10298
10299 let _ = self
10300 .table
10301 .get(13)
10302 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10303
10304 let _ = self
10305 .table
10306 .get(14)
10307 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10308
10309 let _ = self.table.get(15)
10310 .map(|envelope| unsafe {
10311 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>>()
10312 });
10313
10314 let _ = self.table.get(16).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10315
10316 let _ = self.table.get(17).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10317
10318 let _ = self.table.get(18)
10319 .map(|envelope| unsafe {
10320 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>>()
10321 });
10322
10323 let _ = self.table.get(19).map(|envelope| unsafe {
10324 envelope.read_unchecked::<::fidl_next_common_fuchsia_math::wire::SizeU>()
10325 });
10326
10327 let _ = self
10328 .table
10329 .get(20)
10330 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
10331 }
10332 }
10333
10334 impl ::fidl_next::Constrained for ImageFormatConstraints<'_> {
10335 type Constraint = ();
10336
10337 fn validate(
10338 _: ::fidl_next::Slot<'_, Self>,
10339 _: Self::Constraint,
10340 ) -> Result<(), ::fidl_next::ValidationError> {
10341 Ok(())
10342 }
10343 }
10344
10345 unsafe impl ::fidl_next::Wire for ImageFormatConstraints<'static> {
10346 type Narrowed<'de> = ImageFormatConstraints<'de>;
10347
10348 #[inline]
10349 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10350 ::fidl_next::munge!(let Self { table } = out);
10351 ::fidl_next::wire::Table::zero_padding(table);
10352 }
10353 }
10354
10355 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ImageFormatConstraints<'de>
10356 where
10357 ___D: ::fidl_next::Decoder<'de> + ?Sized,
10358 {
10359 fn decode(
10360 slot: ::fidl_next::Slot<'_, Self>,
10361 decoder: &mut ___D,
10362 _: (),
10363 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10364 ::fidl_next::munge!(let Self { table } = slot);
10365
10366 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10367 match ordinal {
10368 0 => unsafe { ::core::hint::unreachable_unchecked() },
10369
10370 1 => {
10371 ::fidl_next::wire::Envelope::decode_as::<
10372 ___D,
10373 ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
10374 >(slot.as_mut(), decoder, ())?;
10375
10376 Ok(())
10377 }
10378
10379 2 => {
10380 ::fidl_next::wire::Envelope::decode_as::<
10381 ___D,
10382 ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
10383 >(slot.as_mut(), decoder, ())?;
10384
10385 Ok(())
10386 }
10387
10388 3 => {
10389 ::fidl_next::wire::Envelope::decode_as::<
10390 ___D,
10391 ::fidl_next::wire::Vector<
10392 'de,
10393 ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
10394 >,
10395 >(slot.as_mut(), decoder, (32, ()))?;
10396
10397 let value = unsafe {
10398 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
10399 '_,
10400 ::fidl_next_common_fuchsia_images2::wire::ColorSpace,
10401 >>()
10402 };
10403
10404 if value.len() > 32 {
10405 return Err(::fidl_next::DecodeError::VectorTooLong {
10406 size: value.len() as u64,
10407 limit: 32,
10408 });
10409 }
10410
10411 Ok(())
10412 }
10413
10414 4 => {
10415 ::fidl_next::wire::Envelope::decode_as::<
10416 ___D,
10417 ::fidl_next_common_fuchsia_math::wire::SizeU,
10418 >(slot.as_mut(), decoder, ())?;
10419
10420 Ok(())
10421 }
10422
10423 5 => {
10424 ::fidl_next::wire::Envelope::decode_as::<
10425 ___D,
10426 ::fidl_next_common_fuchsia_math::wire::SizeU,
10427 >(slot.as_mut(), decoder, ())?;
10428
10429 Ok(())
10430 }
10431
10432 6 => {
10433 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10434 slot.as_mut(),
10435 decoder,
10436 (),
10437 )?;
10438
10439 Ok(())
10440 }
10441
10442 7 => {
10443 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10444 slot.as_mut(),
10445 decoder,
10446 (),
10447 )?;
10448
10449 Ok(())
10450 }
10451
10452 8 => {
10453 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
10454 slot.as_mut(),
10455 decoder,
10456 (),
10457 )?;
10458
10459 Ok(())
10460 }
10461
10462 9 => {
10463 ::fidl_next::wire::Envelope::decode_as::<
10464 ___D,
10465 ::fidl_next_common_fuchsia_math::wire::SizeU,
10466 >(slot.as_mut(), decoder, ())?;
10467
10468 Ok(())
10469 }
10470
10471 10 => {
10472 ::fidl_next::wire::Envelope::decode_as::<
10473 ___D,
10474 ::fidl_next_common_fuchsia_math::wire::SizeU,
10475 >(slot.as_mut(), decoder, ())?;
10476
10477 Ok(())
10478 }
10479
10480 11 => {
10481 ::fidl_next::wire::Envelope::decode_as::<
10482 ___D,
10483 ::fidl_next_common_fuchsia_math::wire::SizeU,
10484 >(slot.as_mut(), decoder, ())?;
10485
10486 Ok(())
10487 }
10488
10489 12 => {
10490 ::fidl_next::wire::Envelope::decode_as::<
10491 ___D,
10492 ::fidl_next_common_fuchsia_math::wire::SizeU,
10493 >(slot.as_mut(), decoder, ())?;
10494
10495 Ok(())
10496 }
10497
10498 13 => {
10499 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10500 slot.as_mut(),
10501 decoder,
10502 (),
10503 )?;
10504
10505 Ok(())
10506 }
10507
10508 14 => {
10509 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10510 slot.as_mut(),
10511 decoder,
10512 (),
10513 )?;
10514
10515 Ok(())
10516 }
10517
10518 15 => {
10519 ::fidl_next::wire::Envelope::decode_as::<
10520 ___D,
10521 ::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>,
10522 >(slot.as_mut(), decoder, (64, ()))?;
10523
10524 let value = unsafe {
10525 slot
10526 .deref_unchecked()
10527 .deref_unchecked::<
10528 ::fidl_next::wire::Vector<'_, crate::wire::PixelFormatAndModifier>
10529 >()
10530 };
10531
10532 if value.len() > 64 {
10533 return Err(::fidl_next::DecodeError::VectorTooLong {
10534 size: value.len() as u64,
10535 limit: 64,
10536 });
10537 }
10538
10539 Ok(())
10540 }
10541
10542 16 => {
10543 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10544 slot.as_mut(),
10545 decoder,
10546 (),
10547 )?;
10548
10549 Ok(())
10550 }
10551
10552 17 => {
10553 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10554 slot.as_mut(),
10555 decoder,
10556 (),
10557 )?;
10558
10559 Ok(())
10560 }
10561
10562 18 => {
10563 ::fidl_next::wire::Envelope::decode_as::<
10564 ___D,
10565 ::fidl_next::wire::Vector<
10566 'de,
10567 ::fidl_next_common_fuchsia_math::wire::SizeU,
10568 >,
10569 >(slot.as_mut(), decoder, (64, ()))?;
10570
10571 let value = unsafe {
10572 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
10573 '_,
10574 ::fidl_next_common_fuchsia_math::wire::SizeU,
10575 >>()
10576 };
10577
10578 if value.len() > 64 {
10579 return Err(::fidl_next::DecodeError::VectorTooLong {
10580 size: value.len() as u64,
10581 limit: 64,
10582 });
10583 }
10584
10585 Ok(())
10586 }
10587
10588 19 => {
10589 ::fidl_next::wire::Envelope::decode_as::<
10590 ___D,
10591 ::fidl_next_common_fuchsia_math::wire::SizeU,
10592 >(slot.as_mut(), decoder, ())?;
10593
10594 Ok(())
10595 }
10596
10597 20 => {
10598 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
10599 slot.as_mut(),
10600 decoder,
10601 (),
10602 )?;
10603
10604 Ok(())
10605 }
10606
10607 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10608 }
10609 })
10610 }
10611 }
10612
10613 impl<'de> ImageFormatConstraints<'de> {
10614 pub fn pixel_format(
10615 &self,
10616 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormat>
10617 {
10618 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10619 }
10620
10621 pub fn pixel_format_modifier(
10622 &self,
10623 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
10624 {
10625 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10626 }
10627
10628 pub fn color_spaces(
10629 &self,
10630 ) -> ::core::option::Option<
10631 &::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_images2::wire::ColorSpace>,
10632 > {
10633 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10634 }
10635
10636 pub fn min_size(
10637 &self,
10638 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10639 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10640 }
10641
10642 pub fn max_size(
10643 &self,
10644 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10645 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10646 }
10647
10648 pub fn min_bytes_per_row(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10649 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10650 }
10651
10652 pub fn max_bytes_per_row(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10653 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10654 }
10655
10656 pub fn max_width_times_height(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10657 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10658 }
10659
10660 pub fn size_alignment(
10661 &self,
10662 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10663 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
10664 }
10665
10666 pub fn display_rect_alignment(
10667 &self,
10668 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10669 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
10670 }
10671
10672 pub fn required_min_size(
10673 &self,
10674 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10675 unsafe { Some(self.table.get(11)?.deref_unchecked()) }
10676 }
10677
10678 pub fn required_max_size(
10679 &self,
10680 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10681 unsafe { Some(self.table.get(12)?.deref_unchecked()) }
10682 }
10683
10684 pub fn bytes_per_row_divisor(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10685 unsafe { Some(self.table.get(13)?.deref_unchecked()) }
10686 }
10687
10688 pub fn start_offset_divisor(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10689 unsafe { Some(self.table.get(14)?.deref_unchecked()) }
10690 }
10691
10692 pub fn pixel_format_and_modifiers(
10693 &self,
10694 ) -> ::core::option::Option<
10695 &::fidl_next::wire::Vector<'de, crate::wire::PixelFormatAndModifier>,
10696 > {
10697 unsafe { Some(self.table.get(15)?.deref_unchecked()) }
10698 }
10699
10700 pub fn require_bytes_per_row_at_pixel_boundary(&self) -> ::core::option::Option<&bool> {
10701 unsafe { Some(self.table.get(16)?.deref_unchecked()) }
10702 }
10703
10704 pub fn is_alpha_present(&self) -> ::core::option::Option<&bool> {
10705 unsafe { Some(self.table.get(17)?.deref_unchecked()) }
10706 }
10707
10708 pub fn required_max_size_list(
10709 &self,
10710 ) -> ::core::option::Option<
10711 &::fidl_next::wire::Vector<'de, ::fidl_next_common_fuchsia_math::wire::SizeU>,
10712 > {
10713 unsafe { Some(self.table.get(18)?.deref_unchecked()) }
10714 }
10715
10716 pub fn pad_for_block_size(
10717 &self,
10718 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_math::wire::SizeU> {
10719 unsafe { Some(self.table.get(19)?.deref_unchecked()) }
10720 }
10721
10722 pub fn pad_beyond_image_size_bytes(
10723 &self,
10724 ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
10725 unsafe { Some(self.table.get(20)?.deref_unchecked()) }
10726 }
10727 }
10728
10729 impl<'de> ::core::fmt::Debug for ImageFormatConstraints<'de> {
10730 fn fmt(
10731 &self,
10732 f: &mut ::core::fmt::Formatter<'_>,
10733 ) -> ::core::result::Result<(), ::core::fmt::Error> {
10734 f.debug_struct("ImageFormatConstraints")
10735 .field("pixel_format", &self.pixel_format())
10736 .field("pixel_format_modifier", &self.pixel_format_modifier())
10737 .field("color_spaces", &self.color_spaces())
10738 .field("min_size", &self.min_size())
10739 .field("max_size", &self.max_size())
10740 .field("min_bytes_per_row", &self.min_bytes_per_row())
10741 .field("max_bytes_per_row", &self.max_bytes_per_row())
10742 .field("max_width_times_height", &self.max_width_times_height())
10743 .field("size_alignment", &self.size_alignment())
10744 .field("display_rect_alignment", &self.display_rect_alignment())
10745 .field("required_min_size", &self.required_min_size())
10746 .field("required_max_size", &self.required_max_size())
10747 .field("bytes_per_row_divisor", &self.bytes_per_row_divisor())
10748 .field("start_offset_divisor", &self.start_offset_divisor())
10749 .field("pixel_format_and_modifiers", &self.pixel_format_and_modifiers())
10750 .field(
10751 "require_bytes_per_row_at_pixel_boundary",
10752 &self.require_bytes_per_row_at_pixel_boundary(),
10753 )
10754 .field("is_alpha_present", &self.is_alpha_present())
10755 .field("required_max_size_list", &self.required_max_size_list())
10756 .field("pad_for_block_size", &self.pad_for_block_size())
10757 .field("pad_beyond_image_size_bytes", &self.pad_beyond_image_size_bytes())
10758 .finish()
10759 }
10760 }
10761
10762 impl<'de> ::fidl_next::IntoNatural for ImageFormatConstraints<'de> {
10763 type Natural = crate::natural::ImageFormatConstraints;
10764 }
10765
10766 #[repr(C)]
10768 pub struct BufferCollectionConstraints<'de> {
10769 pub(crate) table: ::fidl_next::wire::Table<'de>,
10770 }
10771
10772 impl<'de> Drop for BufferCollectionConstraints<'de> {
10773 fn drop(&mut self) {
10774 let _ = self.table.get(1).map(|envelope| unsafe {
10775 envelope.read_unchecked::<crate::wire::BufferUsage<'de>>()
10776 });
10777
10778 let _ = self
10779 .table
10780 .get(2)
10781 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10782
10783 let _ = self
10784 .table
10785 .get(3)
10786 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10787
10788 let _ = self
10789 .table
10790 .get(4)
10791 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10792
10793 let _ = self
10794 .table
10795 .get(5)
10796 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10797
10798 let _ = self
10799 .table
10800 .get(6)
10801 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
10802
10803 let _ = self.table.get(7).map(|envelope| unsafe {
10804 envelope.read_unchecked::<crate::wire::BufferMemoryConstraints<'de>>()
10805 });
10806
10807 let _ = self.table.get(8)
10808 .map(|envelope| unsafe {
10809 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ImageFormatConstraints<'de>>>()
10810 });
10811 }
10812 }
10813
10814 impl ::fidl_next::Constrained for BufferCollectionConstraints<'_> {
10815 type Constraint = ();
10816
10817 fn validate(
10818 _: ::fidl_next::Slot<'_, Self>,
10819 _: Self::Constraint,
10820 ) -> Result<(), ::fidl_next::ValidationError> {
10821 Ok(())
10822 }
10823 }
10824
10825 unsafe impl ::fidl_next::Wire for BufferCollectionConstraints<'static> {
10826 type Narrowed<'de> = BufferCollectionConstraints<'de>;
10827
10828 #[inline]
10829 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10830 ::fidl_next::munge!(let Self { table } = out);
10831 ::fidl_next::wire::Table::zero_padding(table);
10832 }
10833 }
10834
10835 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferCollectionConstraints<'de>
10836 where
10837 ___D: ::fidl_next::Decoder<'de> + ?Sized,
10838 {
10839 fn decode(
10840 slot: ::fidl_next::Slot<'_, Self>,
10841 decoder: &mut ___D,
10842 _: (),
10843 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10844 ::fidl_next::munge!(let Self { table } = slot);
10845
10846 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10847 match ordinal {
10848 0 => unsafe { ::core::hint::unreachable_unchecked() },
10849
10850 1 => {
10851 ::fidl_next::wire::Envelope::decode_as::<
10852 ___D,
10853 crate::wire::BufferUsage<'de>,
10854 >(slot.as_mut(), decoder, ())?;
10855
10856 Ok(())
10857 }
10858
10859 2 => {
10860 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10861 slot.as_mut(),
10862 decoder,
10863 (),
10864 )?;
10865
10866 Ok(())
10867 }
10868
10869 3 => {
10870 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10871 slot.as_mut(),
10872 decoder,
10873 (),
10874 )?;
10875
10876 Ok(())
10877 }
10878
10879 4 => {
10880 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10881 slot.as_mut(),
10882 decoder,
10883 (),
10884 )?;
10885
10886 Ok(())
10887 }
10888
10889 5 => {
10890 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10891 slot.as_mut(),
10892 decoder,
10893 (),
10894 )?;
10895
10896 Ok(())
10897 }
10898
10899 6 => {
10900 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
10901 slot.as_mut(),
10902 decoder,
10903 (),
10904 )?;
10905
10906 Ok(())
10907 }
10908
10909 7 => {
10910 ::fidl_next::wire::Envelope::decode_as::<
10911 ___D,
10912 crate::wire::BufferMemoryConstraints<'de>,
10913 >(slot.as_mut(), decoder, ())?;
10914
10915 Ok(())
10916 }
10917
10918 8 => {
10919 ::fidl_next::wire::Envelope::decode_as::<
10920 ___D,
10921 ::fidl_next::wire::Vector<
10922 'de,
10923 crate::wire::ImageFormatConstraints<'de>,
10924 >,
10925 >(slot.as_mut(), decoder, (64, ()))?;
10926
10927 let value = unsafe {
10928 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
10929 '_,
10930 crate::wire::ImageFormatConstraints<'_>,
10931 >>()
10932 };
10933
10934 if value.len() > 64 {
10935 return Err(::fidl_next::DecodeError::VectorTooLong {
10936 size: value.len() as u64,
10937 limit: 64,
10938 });
10939 }
10940
10941 Ok(())
10942 }
10943
10944 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10945 }
10946 })
10947 }
10948 }
10949
10950 impl<'de> BufferCollectionConstraints<'de> {
10951 pub fn usage(&self) -> ::core::option::Option<&crate::wire::BufferUsage<'de>> {
10952 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10953 }
10954
10955 pub fn min_buffer_count_for_camping(
10956 &self,
10957 ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10958 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10959 }
10960
10961 pub fn min_buffer_count_for_dedicated_slack(
10962 &self,
10963 ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10964 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10965 }
10966
10967 pub fn min_buffer_count_for_shared_slack(
10968 &self,
10969 ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10970 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10971 }
10972
10973 pub fn min_buffer_count(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10974 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10975 }
10976
10977 pub fn max_buffer_count(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
10978 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10979 }
10980
10981 pub fn buffer_memory_constraints(
10982 &self,
10983 ) -> ::core::option::Option<&crate::wire::BufferMemoryConstraints<'de>> {
10984 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10985 }
10986
10987 pub fn image_format_constraints(
10988 &self,
10989 ) -> ::core::option::Option<
10990 &::fidl_next::wire::Vector<'de, crate::wire::ImageFormatConstraints<'de>>,
10991 > {
10992 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10993 }
10994 }
10995
10996 impl<'de> ::core::fmt::Debug for BufferCollectionConstraints<'de> {
10997 fn fmt(
10998 &self,
10999 f: &mut ::core::fmt::Formatter<'_>,
11000 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11001 f.debug_struct("BufferCollectionConstraints")
11002 .field("usage", &self.usage())
11003 .field("min_buffer_count_for_camping", &self.min_buffer_count_for_camping())
11004 .field(
11005 "min_buffer_count_for_dedicated_slack",
11006 &self.min_buffer_count_for_dedicated_slack(),
11007 )
11008 .field(
11009 "min_buffer_count_for_shared_slack",
11010 &self.min_buffer_count_for_shared_slack(),
11011 )
11012 .field("min_buffer_count", &self.min_buffer_count())
11013 .field("max_buffer_count", &self.max_buffer_count())
11014 .field("buffer_memory_constraints", &self.buffer_memory_constraints())
11015 .field("image_format_constraints", &self.image_format_constraints())
11016 .finish()
11017 }
11018 }
11019
11020 impl<'de> ::fidl_next::IntoNatural for BufferCollectionConstraints<'de> {
11021 type Natural = crate::natural::BufferCollectionConstraints;
11022 }
11023
11024 #[repr(C)]
11026 pub struct BufferMemorySettings<'de> {
11027 pub(crate) table: ::fidl_next::wire::Table<'de>,
11028 }
11029
11030 impl<'de> Drop for BufferMemorySettings<'de> {
11031 fn drop(&mut self) {
11032 let _ = self
11033 .table
11034 .get(1)
11035 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
11036
11037 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
11038
11039 let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
11040
11041 let _ = self.table.get(4).map(|envelope| unsafe {
11042 envelope.read_unchecked::<crate::wire::CoherencyDomain>()
11043 });
11044
11045 let _ = self
11046 .table
11047 .get(5)
11048 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
11049
11050 let _ = self
11051 .table
11052 .get(6)
11053 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
11054 }
11055 }
11056
11057 impl ::fidl_next::Constrained for BufferMemorySettings<'_> {
11058 type Constraint = ();
11059
11060 fn validate(
11061 _: ::fidl_next::Slot<'_, Self>,
11062 _: Self::Constraint,
11063 ) -> Result<(), ::fidl_next::ValidationError> {
11064 Ok(())
11065 }
11066 }
11067
11068 unsafe impl ::fidl_next::Wire for BufferMemorySettings<'static> {
11069 type Narrowed<'de> = BufferMemorySettings<'de>;
11070
11071 #[inline]
11072 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11073 ::fidl_next::munge!(let Self { table } = out);
11074 ::fidl_next::wire::Table::zero_padding(table);
11075 }
11076 }
11077
11078 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferMemorySettings<'de>
11079 where
11080 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11081 {
11082 fn decode(
11083 slot: ::fidl_next::Slot<'_, Self>,
11084 decoder: &mut ___D,
11085 _: (),
11086 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11087 ::fidl_next::munge!(let Self { table } = slot);
11088
11089 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11090 match ordinal {
11091 0 => unsafe { ::core::hint::unreachable_unchecked() },
11092
11093 1 => {
11094 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
11095 slot.as_mut(),
11096 decoder,
11097 (),
11098 )?;
11099
11100 Ok(())
11101 }
11102
11103 2 => {
11104 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
11105 slot.as_mut(),
11106 decoder,
11107 (),
11108 )?;
11109
11110 Ok(())
11111 }
11112
11113 3 => {
11114 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
11115 slot.as_mut(),
11116 decoder,
11117 (),
11118 )?;
11119
11120 Ok(())
11121 }
11122
11123 4 => {
11124 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::CoherencyDomain>(
11125 slot.as_mut(),
11126 decoder,
11127 (),
11128 )?;
11129
11130 Ok(())
11131 }
11132
11133 5 => {
11134 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
11135 slot.as_mut(),
11136 decoder,
11137 (),
11138 )?;
11139
11140 Ok(())
11141 }
11142
11143 6 => {
11144 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
11145 slot.as_mut(),
11146 decoder,
11147 (),
11148 )?;
11149
11150 Ok(())
11151 }
11152
11153 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11154 }
11155 })
11156 }
11157 }
11158
11159 impl<'de> BufferMemorySettings<'de> {
11160 pub fn size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
11161 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11162 }
11163
11164 pub fn is_physically_contiguous(&self) -> ::core::option::Option<&bool> {
11165 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11166 }
11167
11168 pub fn is_secure(&self) -> ::core::option::Option<&bool> {
11169 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
11170 }
11171
11172 pub fn coherency_domain(&self) -> ::core::option::Option<&crate::wire::CoherencyDomain> {
11173 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
11174 }
11175
11176 pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
11177 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
11178 }
11179
11180 pub fn raw_vmo_size(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
11181 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
11182 }
11183 }
11184
11185 impl<'de> ::core::fmt::Debug for BufferMemorySettings<'de> {
11186 fn fmt(
11187 &self,
11188 f: &mut ::core::fmt::Formatter<'_>,
11189 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11190 f.debug_struct("BufferMemorySettings")
11191 .field("size_bytes", &self.size_bytes())
11192 .field("is_physically_contiguous", &self.is_physically_contiguous())
11193 .field("is_secure", &self.is_secure())
11194 .field("coherency_domain", &self.coherency_domain())
11195 .field("heap", &self.heap())
11196 .field("raw_vmo_size", &self.raw_vmo_size())
11197 .finish()
11198 }
11199 }
11200
11201 impl<'de> ::fidl_next::IntoNatural for BufferMemorySettings<'de> {
11202 type Natural = crate::natural::BufferMemorySettings;
11203 }
11204
11205 #[repr(C)]
11207 pub struct SingleBufferSettings<'de> {
11208 pub(crate) table: ::fidl_next::wire::Table<'de>,
11209 }
11210
11211 impl<'de> Drop for SingleBufferSettings<'de> {
11212 fn drop(&mut self) {
11213 let _ = self.table.get(1).map(|envelope| unsafe {
11214 envelope.read_unchecked::<crate::wire::BufferMemorySettings<'de>>()
11215 });
11216
11217 let _ = self.table.get(2).map(|envelope| unsafe {
11218 envelope.read_unchecked::<crate::wire::ImageFormatConstraints<'de>>()
11219 });
11220 }
11221 }
11222
11223 impl ::fidl_next::Constrained for SingleBufferSettings<'_> {
11224 type Constraint = ();
11225
11226 fn validate(
11227 _: ::fidl_next::Slot<'_, Self>,
11228 _: Self::Constraint,
11229 ) -> Result<(), ::fidl_next::ValidationError> {
11230 Ok(())
11231 }
11232 }
11233
11234 unsafe impl ::fidl_next::Wire for SingleBufferSettings<'static> {
11235 type Narrowed<'de> = SingleBufferSettings<'de>;
11236
11237 #[inline]
11238 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11239 ::fidl_next::munge!(let Self { table } = out);
11240 ::fidl_next::wire::Table::zero_padding(table);
11241 }
11242 }
11243
11244 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SingleBufferSettings<'de>
11245 where
11246 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11247 {
11248 fn decode(
11249 slot: ::fidl_next::Slot<'_, Self>,
11250 decoder: &mut ___D,
11251 _: (),
11252 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11253 ::fidl_next::munge!(let Self { table } = slot);
11254
11255 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11256 match ordinal {
11257 0 => unsafe { ::core::hint::unreachable_unchecked() },
11258
11259 1 => {
11260 ::fidl_next::wire::Envelope::decode_as::<
11261 ___D,
11262 crate::wire::BufferMemorySettings<'de>,
11263 >(slot.as_mut(), decoder, ())?;
11264
11265 Ok(())
11266 }
11267
11268 2 => {
11269 ::fidl_next::wire::Envelope::decode_as::<
11270 ___D,
11271 crate::wire::ImageFormatConstraints<'de>,
11272 >(slot.as_mut(), decoder, ())?;
11273
11274 Ok(())
11275 }
11276
11277 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11278 }
11279 })
11280 }
11281 }
11282
11283 impl<'de> SingleBufferSettings<'de> {
11284 pub fn buffer_settings(
11285 &self,
11286 ) -> ::core::option::Option<&crate::wire::BufferMemorySettings<'de>> {
11287 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11288 }
11289
11290 pub fn image_format_constraints(
11291 &self,
11292 ) -> ::core::option::Option<&crate::wire::ImageFormatConstraints<'de>> {
11293 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11294 }
11295 }
11296
11297 impl<'de> ::core::fmt::Debug for SingleBufferSettings<'de> {
11298 fn fmt(
11299 &self,
11300 f: &mut ::core::fmt::Formatter<'_>,
11301 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11302 f.debug_struct("SingleBufferSettings")
11303 .field("buffer_settings", &self.buffer_settings())
11304 .field("image_format_constraints", &self.image_format_constraints())
11305 .finish()
11306 }
11307 }
11308
11309 impl<'de> ::fidl_next::IntoNatural for SingleBufferSettings<'de> {
11310 type Natural = crate::natural::SingleBufferSettings;
11311 }
11312
11313 #[repr(C)]
11315 pub struct BufferCollectionTokenDuplicateSyncRequest<'de> {
11316 pub(crate) table: ::fidl_next::wire::Table<'de>,
11317 }
11318
11319 impl<'de> Drop for BufferCollectionTokenDuplicateSyncRequest<'de> {
11320 fn drop(&mut self) {
11321 let _ = self.table.get(1)
11322 .map(|envelope| unsafe {
11323 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>()
11324 });
11325 }
11326 }
11327
11328 impl ::fidl_next::Constrained for BufferCollectionTokenDuplicateSyncRequest<'_> {
11329 type Constraint = ();
11330
11331 fn validate(
11332 _: ::fidl_next::Slot<'_, Self>,
11333 _: Self::Constraint,
11334 ) -> Result<(), ::fidl_next::ValidationError> {
11335 Ok(())
11336 }
11337 }
11338
11339 unsafe impl ::fidl_next::Wire for BufferCollectionTokenDuplicateSyncRequest<'static> {
11340 type Narrowed<'de> = BufferCollectionTokenDuplicateSyncRequest<'de>;
11341
11342 #[inline]
11343 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11344 ::fidl_next::munge!(let Self { table } = out);
11345 ::fidl_next::wire::Table::zero_padding(table);
11346 }
11347 }
11348
11349 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BufferCollectionTokenDuplicateSyncRequest<'de>
11350 where
11351 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11352 {
11353 fn decode(
11354 slot: ::fidl_next::Slot<'_, Self>,
11355 decoder: &mut ___D,
11356 _: (),
11357 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11358 ::fidl_next::munge!(let Self { table } = slot);
11359
11360 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11361 match ordinal {
11362 0 => unsafe { ::core::hint::unreachable_unchecked() },
11363
11364 1 => {
11365 ::fidl_next::wire::Envelope::decode_as::<
11366 ___D,
11367 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11368 >(slot.as_mut(), decoder, (64, ()))?;
11369
11370 let value = unsafe {
11371 slot
11372 .deref_unchecked()
11373 .deref_unchecked::<
11374 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::fuchsia::Rights>
11375 >()
11376 };
11377
11378 if value.len() > 64 {
11379 return Err(::fidl_next::DecodeError::VectorTooLong {
11380 size: value.len() as u64,
11381 limit: 64,
11382 });
11383 }
11384
11385 Ok(())
11386 }
11387
11388 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11389 }
11390 })
11391 }
11392 }
11393
11394 impl<'de> BufferCollectionTokenDuplicateSyncRequest<'de> {
11395 pub fn rights_attenuation_masks(
11396 &self,
11397 ) -> ::core::option::Option<
11398 &::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11399 > {
11400 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11401 }
11402 }
11403
11404 impl<'de> ::core::fmt::Debug for BufferCollectionTokenDuplicateSyncRequest<'de> {
11405 fn fmt(
11406 &self,
11407 f: &mut ::core::fmt::Formatter<'_>,
11408 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11409 f.debug_struct("BufferCollectionTokenDuplicateSyncRequest")
11410 .field("rights_attenuation_masks", &self.rights_attenuation_masks())
11411 .finish()
11412 }
11413 }
11414
11415 impl<'de> ::fidl_next::IntoNatural for BufferCollectionTokenDuplicateSyncRequest<'de> {
11416 type Natural = crate::natural::BufferCollectionTokenDuplicateSyncRequest;
11417 }
11418
11419 #[repr(C)]
11421 pub struct BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11422 pub(crate) table: ::fidl_next::wire::Table<'de>,
11423 }
11424
11425 impl<'de> Drop for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11426 fn drop(&mut self) {
11427 let _ = self.table.get(1)
11428 .map(|envelope| unsafe {
11429 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>>()
11430 });
11431 }
11432 }
11433
11434 impl ::fidl_next::Constrained for BufferCollectionTokenGroupCreateChildrenSyncRequest<'_> {
11435 type Constraint = ();
11436
11437 fn validate(
11438 _: ::fidl_next::Slot<'_, Self>,
11439 _: Self::Constraint,
11440 ) -> Result<(), ::fidl_next::ValidationError> {
11441 Ok(())
11442 }
11443 }
11444
11445 unsafe impl ::fidl_next::Wire for BufferCollectionTokenGroupCreateChildrenSyncRequest<'static> {
11446 type Narrowed<'de> = BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>;
11447
11448 #[inline]
11449 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11450 ::fidl_next::munge!(let Self { table } = out);
11451 ::fidl_next::wire::Table::zero_padding(table);
11452 }
11453 }
11454
11455 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
11456 for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de>
11457 where
11458 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11459 {
11460 fn decode(
11461 slot: ::fidl_next::Slot<'_, Self>,
11462 decoder: &mut ___D,
11463 _: (),
11464 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11465 ::fidl_next::munge!(let Self { table } = slot);
11466
11467 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11468 match ordinal {
11469 0 => unsafe { ::core::hint::unreachable_unchecked() },
11470
11471 1 => {
11472 ::fidl_next::wire::Envelope::decode_as::<
11473 ___D,
11474 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11475 >(slot.as_mut(), decoder, (64, ()))?;
11476
11477 let value = unsafe {
11478 slot
11479 .deref_unchecked()
11480 .deref_unchecked::<
11481 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::fuchsia::Rights>
11482 >()
11483 };
11484
11485 if value.len() > 64 {
11486 return Err(::fidl_next::DecodeError::VectorTooLong {
11487 size: value.len() as u64,
11488 limit: 64,
11489 });
11490 }
11491
11492 Ok(())
11493 }
11494
11495 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11496 }
11497 })
11498 }
11499 }
11500
11501 impl<'de> BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11502 pub fn rights_attenuation_masks(
11503 &self,
11504 ) -> ::core::option::Option<
11505 &::fidl_next::wire::Vector<'de, ::fidl_next::wire::fuchsia::Rights>,
11506 > {
11507 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11508 }
11509 }
11510
11511 impl<'de> ::core::fmt::Debug for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11512 fn fmt(
11513 &self,
11514 f: &mut ::core::fmt::Formatter<'_>,
11515 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11516 f.debug_struct("BufferCollectionTokenGroupCreateChildrenSyncRequest")
11517 .field("rights_attenuation_masks", &self.rights_attenuation_masks())
11518 .finish()
11519 }
11520 }
11521
11522 impl<'de> ::fidl_next::IntoNatural for BufferCollectionTokenGroupCreateChildrenSyncRequest<'de> {
11523 type Natural = crate::natural::BufferCollectionTokenGroupCreateChildrenSyncRequest;
11524 }
11525
11526 #[repr(C)]
11528 pub struct FormatCostKey<'de> {
11529 pub(crate) table: ::fidl_next::wire::Table<'de>,
11530 }
11531
11532 impl<'de> Drop for FormatCostKey<'de> {
11533 fn drop(&mut self) {
11534 let _ = self.table.get(1).map(|envelope| unsafe {
11535 envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormat>()
11536 });
11537
11538 let _ = self.table.get(2)
11539 .map(|envelope| unsafe {
11540 envelope.read_unchecked::<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>()
11541 });
11542
11543 let _ = self.table.get(3).map(|envelope| unsafe {
11544 envelope.read_unchecked::<crate::wire::BufferUsage<'de>>()
11545 });
11546 }
11547 }
11548
11549 impl ::fidl_next::Constrained for FormatCostKey<'_> {
11550 type Constraint = ();
11551
11552 fn validate(
11553 _: ::fidl_next::Slot<'_, Self>,
11554 _: Self::Constraint,
11555 ) -> Result<(), ::fidl_next::ValidationError> {
11556 Ok(())
11557 }
11558 }
11559
11560 unsafe impl ::fidl_next::Wire for FormatCostKey<'static> {
11561 type Narrowed<'de> = FormatCostKey<'de>;
11562
11563 #[inline]
11564 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11565 ::fidl_next::munge!(let Self { table } = out);
11566 ::fidl_next::wire::Table::zero_padding(table);
11567 }
11568 }
11569
11570 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCostKey<'de>
11571 where
11572 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11573 {
11574 fn decode(
11575 slot: ::fidl_next::Slot<'_, Self>,
11576 decoder: &mut ___D,
11577 _: (),
11578 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11579 ::fidl_next::munge!(let Self { table } = slot);
11580
11581 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11582 match ordinal {
11583 0 => unsafe { ::core::hint::unreachable_unchecked() },
11584
11585 1 => {
11586 ::fidl_next::wire::Envelope::decode_as::<
11587 ___D,
11588 ::fidl_next_common_fuchsia_images2::wire::PixelFormat,
11589 >(slot.as_mut(), decoder, ())?;
11590
11591 Ok(())
11592 }
11593
11594 2 => {
11595 ::fidl_next::wire::Envelope::decode_as::<
11596 ___D,
11597 ::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier,
11598 >(slot.as_mut(), decoder, ())?;
11599
11600 Ok(())
11601 }
11602
11603 3 => {
11604 ::fidl_next::wire::Envelope::decode_as::<
11605 ___D,
11606 crate::wire::BufferUsage<'de>,
11607 >(slot.as_mut(), decoder, ())?;
11608
11609 Ok(())
11610 }
11611
11612 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11613 }
11614 })
11615 }
11616 }
11617
11618 impl<'de> FormatCostKey<'de> {
11619 pub fn pixel_format(
11620 &self,
11621 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormat>
11622 {
11623 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11624 }
11625
11626 pub fn pixel_format_modifier(
11627 &self,
11628 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier>
11629 {
11630 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11631 }
11632
11633 pub fn buffer_usage_bits(&self) -> ::core::option::Option<&crate::wire::BufferUsage<'de>> {
11634 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
11635 }
11636 }
11637
11638 impl<'de> ::core::fmt::Debug for FormatCostKey<'de> {
11639 fn fmt(
11640 &self,
11641 f: &mut ::core::fmt::Formatter<'_>,
11642 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11643 f.debug_struct("FormatCostKey")
11644 .field("pixel_format", &self.pixel_format())
11645 .field("pixel_format_modifier", &self.pixel_format_modifier())
11646 .field("buffer_usage_bits", &self.buffer_usage_bits())
11647 .finish()
11648 }
11649 }
11650
11651 impl<'de> ::fidl_next::IntoNatural for FormatCostKey<'de> {
11652 type Natural = crate::natural::FormatCostKey;
11653 }
11654
11655 #[repr(C)]
11657 pub struct FormatCostEntry<'de> {
11658 pub(crate) table: ::fidl_next::wire::Table<'de>,
11659 }
11660
11661 impl<'de> Drop for FormatCostEntry<'de> {
11662 fn drop(&mut self) {
11663 let _ = self.table.get(1).map(|envelope| unsafe {
11664 envelope.read_unchecked::<crate::wire::FormatCostKey<'de>>()
11665 });
11666
11667 let _ = self
11668 .table
11669 .get(2)
11670 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Float32>() });
11671 }
11672 }
11673
11674 impl ::fidl_next::Constrained for FormatCostEntry<'_> {
11675 type Constraint = ();
11676
11677 fn validate(
11678 _: ::fidl_next::Slot<'_, Self>,
11679 _: Self::Constraint,
11680 ) -> Result<(), ::fidl_next::ValidationError> {
11681 Ok(())
11682 }
11683 }
11684
11685 unsafe impl ::fidl_next::Wire for FormatCostEntry<'static> {
11686 type Narrowed<'de> = FormatCostEntry<'de>;
11687
11688 #[inline]
11689 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11690 ::fidl_next::munge!(let Self { table } = out);
11691 ::fidl_next::wire::Table::zero_padding(table);
11692 }
11693 }
11694
11695 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCostEntry<'de>
11696 where
11697 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11698 {
11699 fn decode(
11700 slot: ::fidl_next::Slot<'_, Self>,
11701 decoder: &mut ___D,
11702 _: (),
11703 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11704 ::fidl_next::munge!(let Self { table } = slot);
11705
11706 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11707 match ordinal {
11708 0 => unsafe { ::core::hint::unreachable_unchecked() },
11709
11710 1 => {
11711 ::fidl_next::wire::Envelope::decode_as::<
11712 ___D,
11713 crate::wire::FormatCostKey<'de>,
11714 >(slot.as_mut(), decoder, ())?;
11715
11716 Ok(())
11717 }
11718
11719 2 => {
11720 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Float32>(
11721 slot.as_mut(),
11722 decoder,
11723 (),
11724 )?;
11725
11726 Ok(())
11727 }
11728
11729 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11730 }
11731 })
11732 }
11733 }
11734
11735 impl<'de> FormatCostEntry<'de> {
11736 pub fn key(&self) -> ::core::option::Option<&crate::wire::FormatCostKey<'de>> {
11737 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11738 }
11739
11740 pub fn cost(&self) -> ::core::option::Option<&::fidl_next::wire::Float32> {
11741 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11742 }
11743 }
11744
11745 impl<'de> ::core::fmt::Debug for FormatCostEntry<'de> {
11746 fn fmt(
11747 &self,
11748 f: &mut ::core::fmt::Formatter<'_>,
11749 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11750 f.debug_struct("FormatCostEntry")
11751 .field("key", &self.key())
11752 .field("cost", &self.cost())
11753 .finish()
11754 }
11755 }
11756
11757 impl<'de> ::fidl_next::IntoNatural for FormatCostEntry<'de> {
11758 type Natural = crate::natural::FormatCostEntry;
11759 }
11760
11761 #[repr(C)]
11763 pub struct Config<'de> {
11764 pub(crate) table: ::fidl_next::wire::Table<'de>,
11765 }
11766
11767 impl<'de> Drop for Config<'de> {
11768 fn drop(&mut self) {
11769 let _ = self.table.get(1)
11770 .map(|envelope| unsafe {
11771 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>()
11772 });
11773 }
11774 }
11775
11776 impl ::fidl_next::Constrained for Config<'_> {
11777 type Constraint = ();
11778
11779 fn validate(
11780 _: ::fidl_next::Slot<'_, Self>,
11781 _: Self::Constraint,
11782 ) -> Result<(), ::fidl_next::ValidationError> {
11783 Ok(())
11784 }
11785 }
11786
11787 unsafe impl ::fidl_next::Wire for Config<'static> {
11788 type Narrowed<'de> = Config<'de>;
11789
11790 #[inline]
11791 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11792 ::fidl_next::munge!(let Self { table } = out);
11793 ::fidl_next::wire::Table::zero_padding(table);
11794 }
11795 }
11796
11797 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Config<'de>
11798 where
11799 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11800 {
11801 fn decode(
11802 slot: ::fidl_next::Slot<'_, Self>,
11803 decoder: &mut ___D,
11804 _: (),
11805 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11806 ::fidl_next::munge!(let Self { table } = slot);
11807
11808 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11809 match ordinal {
11810 0 => unsafe { ::core::hint::unreachable_unchecked() },
11811
11812 1 => {
11813 ::fidl_next::wire::Envelope::decode_as::<
11814 ___D,
11815 ::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
11816 >(slot.as_mut(), decoder, (4294967295, ()))?;
11817
11818 Ok(())
11819 }
11820
11821 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11822 }
11823 })
11824 }
11825 }
11826
11827 impl<'de> Config<'de> {
11828 pub fn format_costs(
11829 &self,
11830 ) -> ::core::option::Option<
11831 &::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
11832 > {
11833 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11834 }
11835 }
11836
11837 impl<'de> ::core::fmt::Debug for Config<'de> {
11838 fn fmt(
11839 &self,
11840 f: &mut ::core::fmt::Formatter<'_>,
11841 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11842 f.debug_struct("Config").field("format_costs", &self.format_costs()).finish()
11843 }
11844 }
11845
11846 impl<'de> ::fidl_next::IntoNatural for Config<'de> {
11847 type Natural = crate::natural::Config;
11848 }
11849
11850 #[repr(C)]
11852 pub struct DynamicSecureHeap<'de> {
11853 pub(crate) table: ::fidl_next::wire::Table<'de>,
11854 }
11855
11856 impl<'de> Drop for DynamicSecureHeap<'de> {
11857 fn drop(&mut self) {
11858 let _ = self
11859 .table
11860 .get(1)
11861 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
11862 }
11863 }
11864
11865 impl ::fidl_next::Constrained for DynamicSecureHeap<'_> {
11866 type Constraint = ();
11867
11868 fn validate(
11869 _: ::fidl_next::Slot<'_, Self>,
11870 _: Self::Constraint,
11871 ) -> Result<(), ::fidl_next::ValidationError> {
11872 Ok(())
11873 }
11874 }
11875
11876 unsafe impl ::fidl_next::Wire for DynamicSecureHeap<'static> {
11877 type Narrowed<'de> = DynamicSecureHeap<'de>;
11878
11879 #[inline]
11880 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11881 ::fidl_next::munge!(let Self { table } = out);
11882 ::fidl_next::wire::Table::zero_padding(table);
11883 }
11884 }
11885
11886 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DynamicSecureHeap<'de>
11887 where
11888 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11889 {
11890 fn decode(
11891 slot: ::fidl_next::Slot<'_, Self>,
11892 decoder: &mut ___D,
11893 _: (),
11894 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11895 ::fidl_next::munge!(let Self { table } = slot);
11896
11897 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11898 match ordinal {
11899 0 => unsafe { ::core::hint::unreachable_unchecked() },
11900
11901 1 => {
11902 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
11903 slot.as_mut(),
11904 decoder,
11905 (),
11906 )?;
11907
11908 Ok(())
11909 }
11910
11911 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11912 }
11913 })
11914 }
11915 }
11916
11917 impl<'de> DynamicSecureHeap<'de> {
11918 pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
11919 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11920 }
11921 }
11922
11923 impl<'de> ::core::fmt::Debug for DynamicSecureHeap<'de> {
11924 fn fmt(
11925 &self,
11926 f: &mut ::core::fmt::Formatter<'_>,
11927 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11928 f.debug_struct("DynamicSecureHeap").field("heap", &self.heap()).finish()
11929 }
11930 }
11931
11932 impl<'de> ::fidl_next::IntoNatural for DynamicSecureHeap<'de> {
11933 type Natural = crate::natural::DynamicSecureHeap;
11934 }
11935
11936 #[repr(C)]
11938 pub struct FormatCosts<'de> {
11939 pub(crate) table: ::fidl_next::wire::Table<'de>,
11940 }
11941
11942 impl<'de> Drop for FormatCosts<'de> {
11943 fn drop(&mut self) {
11944 let _ = self.table.get(1)
11945 .map(|envelope| unsafe {
11946 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>>()
11947 });
11948 }
11949 }
11950
11951 impl ::fidl_next::Constrained for FormatCosts<'_> {
11952 type Constraint = ();
11953
11954 fn validate(
11955 _: ::fidl_next::Slot<'_, Self>,
11956 _: Self::Constraint,
11957 ) -> Result<(), ::fidl_next::ValidationError> {
11958 Ok(())
11959 }
11960 }
11961
11962 unsafe impl ::fidl_next::Wire for FormatCosts<'static> {
11963 type Narrowed<'de> = FormatCosts<'de>;
11964
11965 #[inline]
11966 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11967 ::fidl_next::munge!(let Self { table } = out);
11968 ::fidl_next::wire::Table::zero_padding(table);
11969 }
11970 }
11971
11972 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormatCosts<'de>
11973 where
11974 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11975 {
11976 fn decode(
11977 slot: ::fidl_next::Slot<'_, Self>,
11978 decoder: &mut ___D,
11979 _: (),
11980 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11981 ::fidl_next::munge!(let Self { table } = slot);
11982
11983 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11984 match ordinal {
11985 0 => unsafe { ::core::hint::unreachable_unchecked() },
11986
11987 1 => {
11988 ::fidl_next::wire::Envelope::decode_as::<
11989 ___D,
11990 ::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
11991 >(slot.as_mut(), decoder, (4294967295, ()))?;
11992
11993 Ok(())
11994 }
11995
11996 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
11997 }
11998 })
11999 }
12000 }
12001
12002 impl<'de> FormatCosts<'de> {
12003 pub fn format_costs(
12004 &self,
12005 ) -> ::core::option::Option<
12006 &::fidl_next::wire::Vector<'de, crate::wire::FormatCostEntry<'de>>,
12007 > {
12008 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12009 }
12010 }
12011
12012 impl<'de> ::core::fmt::Debug for FormatCosts<'de> {
12013 fn fmt(
12014 &self,
12015 f: &mut ::core::fmt::Formatter<'_>,
12016 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12017 f.debug_struct("FormatCosts").field("format_costs", &self.format_costs()).finish()
12018 }
12019 }
12020
12021 impl<'de> ::fidl_next::IntoNatural for FormatCosts<'de> {
12022 type Natural = crate::natural::FormatCosts;
12023 }
12024
12025 #[repr(C)]
12027 pub struct SecureHeapRange<'de> {
12028 pub(crate) table: ::fidl_next::wire::Table<'de>,
12029 }
12030
12031 impl<'de> Drop for SecureHeapRange<'de> {
12032 fn drop(&mut self) {
12033 let _ = self
12034 .table
12035 .get(1)
12036 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
12037
12038 let _ = self
12039 .table
12040 .get(2)
12041 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
12042 }
12043 }
12044
12045 impl ::fidl_next::Constrained for SecureHeapRange<'_> {
12046 type Constraint = ();
12047
12048 fn validate(
12049 _: ::fidl_next::Slot<'_, Self>,
12050 _: Self::Constraint,
12051 ) -> Result<(), ::fidl_next::ValidationError> {
12052 Ok(())
12053 }
12054 }
12055
12056 unsafe impl ::fidl_next::Wire for SecureHeapRange<'static> {
12057 type Narrowed<'de> = SecureHeapRange<'de>;
12058
12059 #[inline]
12060 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12061 ::fidl_next::munge!(let Self { table } = out);
12062 ::fidl_next::wire::Table::zero_padding(table);
12063 }
12064 }
12065
12066 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapRange<'de>
12067 where
12068 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12069 {
12070 fn decode(
12071 slot: ::fidl_next::Slot<'_, Self>,
12072 decoder: &mut ___D,
12073 _: (),
12074 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12075 ::fidl_next::munge!(let Self { table } = slot);
12076
12077 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12078 match ordinal {
12079 0 => unsafe { ::core::hint::unreachable_unchecked() },
12080
12081 1 => {
12082 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
12083 slot.as_mut(),
12084 decoder,
12085 (),
12086 )?;
12087
12088 Ok(())
12089 }
12090
12091 2 => {
12092 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
12093 slot.as_mut(),
12094 decoder,
12095 (),
12096 )?;
12097
12098 Ok(())
12099 }
12100
12101 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12102 }
12103 })
12104 }
12105 }
12106
12107 impl<'de> SecureHeapRange<'de> {
12108 pub fn physical_address(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
12109 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12110 }
12111
12112 pub fn size_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
12113 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12114 }
12115 }
12116
12117 impl<'de> ::core::fmt::Debug for SecureHeapRange<'de> {
12118 fn fmt(
12119 &self,
12120 f: &mut ::core::fmt::Formatter<'_>,
12121 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12122 f.debug_struct("SecureHeapRange")
12123 .field("physical_address", &self.physical_address())
12124 .field("size_bytes", &self.size_bytes())
12125 .finish()
12126 }
12127 }
12128
12129 impl<'de> ::fidl_next::IntoNatural for SecureHeapRange<'de> {
12130 type Natural = crate::natural::SecureHeapRange;
12131 }
12132
12133 #[repr(C)]
12135 pub struct SecureHeapAndRange<'de> {
12136 pub(crate) table: ::fidl_next::wire::Table<'de>,
12137 }
12138
12139 impl<'de> Drop for SecureHeapAndRange<'de> {
12140 fn drop(&mut self) {
12141 let _ = self
12142 .table
12143 .get(1)
12144 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12145
12146 let _ = self.table.get(2).map(|envelope| unsafe {
12147 envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12148 });
12149 }
12150 }
12151
12152 impl ::fidl_next::Constrained for SecureHeapAndRange<'_> {
12153 type Constraint = ();
12154
12155 fn validate(
12156 _: ::fidl_next::Slot<'_, Self>,
12157 _: Self::Constraint,
12158 ) -> Result<(), ::fidl_next::ValidationError> {
12159 Ok(())
12160 }
12161 }
12162
12163 unsafe impl ::fidl_next::Wire for SecureHeapAndRange<'static> {
12164 type Narrowed<'de> = SecureHeapAndRange<'de>;
12165
12166 #[inline]
12167 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12168 ::fidl_next::munge!(let Self { table } = out);
12169 ::fidl_next::wire::Table::zero_padding(table);
12170 }
12171 }
12172
12173 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRange<'de>
12174 where
12175 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12176 {
12177 fn decode(
12178 slot: ::fidl_next::Slot<'_, Self>,
12179 decoder: &mut ___D,
12180 _: (),
12181 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12182 ::fidl_next::munge!(let Self { table } = slot);
12183
12184 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12185 match ordinal {
12186 0 => unsafe { ::core::hint::unreachable_unchecked() },
12187
12188 1 => {
12189 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12190 slot.as_mut(),
12191 decoder,
12192 (),
12193 )?;
12194
12195 Ok(())
12196 }
12197
12198 2 => {
12199 ::fidl_next::wire::Envelope::decode_as::<
12200 ___D,
12201 crate::wire::SecureHeapRange<'de>,
12202 >(slot.as_mut(), decoder, ())?;
12203
12204 Ok(())
12205 }
12206
12207 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12208 }
12209 })
12210 }
12211 }
12212
12213 impl<'de> SecureHeapAndRange<'de> {
12214 pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12215 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12216 }
12217
12218 pub fn range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12219 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12220 }
12221 }
12222
12223 impl<'de> ::core::fmt::Debug for SecureHeapAndRange<'de> {
12224 fn fmt(
12225 &self,
12226 f: &mut ::core::fmt::Formatter<'_>,
12227 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12228 f.debug_struct("SecureHeapAndRange")
12229 .field("heap", &self.heap())
12230 .field("range", &self.range())
12231 .finish()
12232 }
12233 }
12234
12235 impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRange<'de> {
12236 type Natural = crate::natural::SecureHeapAndRange;
12237 }
12238
12239 #[repr(C)]
12241 pub struct SecureHeapAndRangeModification<'de> {
12242 pub(crate) table: ::fidl_next::wire::Table<'de>,
12243 }
12244
12245 impl<'de> Drop for SecureHeapAndRangeModification<'de> {
12246 fn drop(&mut self) {
12247 let _ = self
12248 .table
12249 .get(1)
12250 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12251
12252 let _ = self.table.get(2).map(|envelope| unsafe {
12253 envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12254 });
12255
12256 let _ = self.table.get(3).map(|envelope| unsafe {
12257 envelope.read_unchecked::<crate::wire::SecureHeapRange<'de>>()
12258 });
12259 }
12260 }
12261
12262 impl ::fidl_next::Constrained for SecureHeapAndRangeModification<'_> {
12263 type Constraint = ();
12264
12265 fn validate(
12266 _: ::fidl_next::Slot<'_, Self>,
12267 _: Self::Constraint,
12268 ) -> Result<(), ::fidl_next::ValidationError> {
12269 Ok(())
12270 }
12271 }
12272
12273 unsafe impl ::fidl_next::Wire for SecureHeapAndRangeModification<'static> {
12274 type Narrowed<'de> = SecureHeapAndRangeModification<'de>;
12275
12276 #[inline]
12277 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12278 ::fidl_next::munge!(let Self { table } = out);
12279 ::fidl_next::wire::Table::zero_padding(table);
12280 }
12281 }
12282
12283 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRangeModification<'de>
12284 where
12285 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12286 {
12287 fn decode(
12288 slot: ::fidl_next::Slot<'_, Self>,
12289 decoder: &mut ___D,
12290 _: (),
12291 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12292 ::fidl_next::munge!(let Self { table } = slot);
12293
12294 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12295 match ordinal {
12296 0 => unsafe { ::core::hint::unreachable_unchecked() },
12297
12298 1 => {
12299 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12300 slot.as_mut(),
12301 decoder,
12302 (),
12303 )?;
12304
12305 Ok(())
12306 }
12307
12308 2 => {
12309 ::fidl_next::wire::Envelope::decode_as::<
12310 ___D,
12311 crate::wire::SecureHeapRange<'de>,
12312 >(slot.as_mut(), decoder, ())?;
12313
12314 Ok(())
12315 }
12316
12317 3 => {
12318 ::fidl_next::wire::Envelope::decode_as::<
12319 ___D,
12320 crate::wire::SecureHeapRange<'de>,
12321 >(slot.as_mut(), decoder, ())?;
12322
12323 Ok(())
12324 }
12325
12326 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12327 }
12328 })
12329 }
12330 }
12331
12332 impl<'de> SecureHeapAndRangeModification<'de> {
12333 pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12334 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12335 }
12336
12337 pub fn old_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12338 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12339 }
12340
12341 pub fn new_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapRange<'de>> {
12342 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12343 }
12344 }
12345
12346 impl<'de> ::core::fmt::Debug for SecureHeapAndRangeModification<'de> {
12347 fn fmt(
12348 &self,
12349 f: &mut ::core::fmt::Formatter<'_>,
12350 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12351 f.debug_struct("SecureHeapAndRangeModification")
12352 .field("heap", &self.heap())
12353 .field("old_range", &self.old_range())
12354 .field("new_range", &self.new_range())
12355 .finish()
12356 }
12357 }
12358
12359 impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRangeModification<'de> {
12360 type Natural = crate::natural::SecureHeapAndRangeModification;
12361 }
12362
12363 #[repr(C)]
12365 pub struct SecureHeapAndRanges<'de> {
12366 pub(crate) table: ::fidl_next::wire::Table<'de>,
12367 }
12368
12369 impl<'de> Drop for SecureHeapAndRanges<'de> {
12370 fn drop(&mut self) {
12371 let _ = self
12372 .table
12373 .get(1)
12374 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12375
12376 let _ = self.table.get(2)
12377 .map(|envelope| unsafe {
12378 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>>()
12379 });
12380 }
12381 }
12382
12383 impl ::fidl_next::Constrained for SecureHeapAndRanges<'_> {
12384 type Constraint = ();
12385
12386 fn validate(
12387 _: ::fidl_next::Slot<'_, Self>,
12388 _: Self::Constraint,
12389 ) -> Result<(), ::fidl_next::ValidationError> {
12390 Ok(())
12391 }
12392 }
12393
12394 unsafe impl ::fidl_next::Wire for SecureHeapAndRanges<'static> {
12395 type Narrowed<'de> = SecureHeapAndRanges<'de>;
12396
12397 #[inline]
12398 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12399 ::fidl_next::munge!(let Self { table } = out);
12400 ::fidl_next::wire::Table::zero_padding(table);
12401 }
12402 }
12403
12404 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapAndRanges<'de>
12405 where
12406 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12407 {
12408 fn decode(
12409 slot: ::fidl_next::Slot<'_, Self>,
12410 decoder: &mut ___D,
12411 _: (),
12412 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12413 ::fidl_next::munge!(let Self { table } = slot);
12414
12415 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12416 match ordinal {
12417 0 => unsafe { ::core::hint::unreachable_unchecked() },
12418
12419 1 => {
12420 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12421 slot.as_mut(),
12422 decoder,
12423 (),
12424 )?;
12425
12426 Ok(())
12427 }
12428
12429 2 => {
12430 ::fidl_next::wire::Envelope::decode_as::<
12431 ___D,
12432 ::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>,
12433 >(slot.as_mut(), decoder, (128, ()))?;
12434
12435 let value = unsafe {
12436 slot
12437 .deref_unchecked()
12438 .deref_unchecked::<
12439 ::fidl_next::wire::Vector<'_, crate::wire::SecureHeapRange<'_>>
12440 >()
12441 };
12442
12443 if value.len() > 128 {
12444 return Err(::fidl_next::DecodeError::VectorTooLong {
12445 size: value.len() as u64,
12446 limit: 128,
12447 });
12448 }
12449
12450 Ok(())
12451 }
12452
12453 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12454 }
12455 })
12456 }
12457 }
12458
12459 impl<'de> SecureHeapAndRanges<'de> {
12460 pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12461 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12462 }
12463
12464 pub fn ranges(
12465 &self,
12466 ) -> ::core::option::Option<
12467 &::fidl_next::wire::Vector<'de, crate::wire::SecureHeapRange<'de>>,
12468 > {
12469 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12470 }
12471 }
12472
12473 impl<'de> ::core::fmt::Debug for SecureHeapAndRanges<'de> {
12474 fn fmt(
12475 &self,
12476 f: &mut ::core::fmt::Formatter<'_>,
12477 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12478 f.debug_struct("SecureHeapAndRanges")
12479 .field("heap", &self.heap())
12480 .field("ranges", &self.ranges())
12481 .finish()
12482 }
12483 }
12484
12485 impl<'de> ::fidl_next::IntoNatural for SecureHeapAndRanges<'de> {
12486 type Natural = crate::natural::SecureHeapAndRanges;
12487 }
12488
12489 #[repr(C)]
12491 pub struct SecureHeapProperties<'de> {
12492 pub(crate) table: ::fidl_next::wire::Table<'de>,
12493 }
12494
12495 impl<'de> Drop for SecureHeapProperties<'de> {
12496 fn drop(&mut self) {
12497 let _ = self
12498 .table
12499 .get(1)
12500 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Heap<'de>>() });
12501
12502 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
12503
12504 let _ = self
12505 .table
12506 .get(3)
12507 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
12508
12509 let _ = self
12510 .table
12511 .get(4)
12512 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
12513
12514 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
12515 }
12516 }
12517
12518 impl ::fidl_next::Constrained for SecureHeapProperties<'_> {
12519 type Constraint = ();
12520
12521 fn validate(
12522 _: ::fidl_next::Slot<'_, Self>,
12523 _: Self::Constraint,
12524 ) -> Result<(), ::fidl_next::ValidationError> {
12525 Ok(())
12526 }
12527 }
12528
12529 unsafe impl ::fidl_next::Wire for SecureHeapProperties<'static> {
12530 type Narrowed<'de> = SecureHeapProperties<'de>;
12531
12532 #[inline]
12533 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12534 ::fidl_next::munge!(let Self { table } = out);
12535 ::fidl_next::wire::Table::zero_padding(table);
12536 }
12537 }
12538
12539 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureHeapProperties<'de>
12540 where
12541 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12542 {
12543 fn decode(
12544 slot: ::fidl_next::Slot<'_, Self>,
12545 decoder: &mut ___D,
12546 _: (),
12547 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12548 ::fidl_next::munge!(let Self { table } = slot);
12549
12550 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12551 match ordinal {
12552 0 => unsafe { ::core::hint::unreachable_unchecked() },
12553
12554 1 => {
12555 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Heap<'de>>(
12556 slot.as_mut(),
12557 decoder,
12558 (),
12559 )?;
12560
12561 Ok(())
12562 }
12563
12564 2 => {
12565 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
12566 slot.as_mut(),
12567 decoder,
12568 (),
12569 )?;
12570
12571 Ok(())
12572 }
12573
12574 3 => {
12575 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
12576 slot.as_mut(),
12577 decoder,
12578 (),
12579 )?;
12580
12581 Ok(())
12582 }
12583
12584 4 => {
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 5 => {
12595 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
12596 slot.as_mut(),
12597 decoder,
12598 (),
12599 )?;
12600
12601 Ok(())
12602 }
12603
12604 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12605 }
12606 })
12607 }
12608 }
12609
12610 impl<'de> SecureHeapProperties<'de> {
12611 pub fn heap(&self) -> ::core::option::Option<&crate::wire::Heap<'de>> {
12612 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12613 }
12614
12615 pub fn dynamic_protection_ranges(&self) -> ::core::option::Option<&bool> {
12616 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12617 }
12618
12619 pub fn protected_range_granularity(
12620 &self,
12621 ) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
12622 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12623 }
12624
12625 pub fn max_protected_range_count(
12626 &self,
12627 ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
12628 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
12629 }
12630
12631 pub fn is_mod_protected_range_available(&self) -> ::core::option::Option<&bool> {
12632 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
12633 }
12634 }
12635
12636 impl<'de> ::core::fmt::Debug for SecureHeapProperties<'de> {
12637 fn fmt(
12638 &self,
12639 f: &mut ::core::fmt::Formatter<'_>,
12640 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12641 f.debug_struct("SecureHeapProperties")
12642 .field("heap", &self.heap())
12643 .field("dynamic_protection_ranges", &self.dynamic_protection_ranges())
12644 .field("protected_range_granularity", &self.protected_range_granularity())
12645 .field("max_protected_range_count", &self.max_protected_range_count())
12646 .field("is_mod_protected_range_available", &self.is_mod_protected_range_available())
12647 .finish()
12648 }
12649 }
12650
12651 impl<'de> ::fidl_next::IntoNatural for SecureHeapProperties<'de> {
12652 type Natural = crate::natural::SecureHeapProperties;
12653 }
12654
12655 #[repr(C)]
12657 pub struct SecureMemGetPhysicalSecureHeapsResponse<'de> {
12658 pub(crate) table: ::fidl_next::wire::Table<'de>,
12659 }
12660
12661 impl<'de> Drop for SecureMemGetPhysicalSecureHeapsResponse<'de> {
12662 fn drop(&mut self) {
12663 let _ = self.table.get(1)
12664 .map(|envelope| unsafe {
12665 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>>()
12666 });
12667 }
12668 }
12669
12670 impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapsResponse<'_> {
12671 type Constraint = ();
12672
12673 fn validate(
12674 _: ::fidl_next::Slot<'_, Self>,
12675 _: Self::Constraint,
12676 ) -> Result<(), ::fidl_next::ValidationError> {
12677 Ok(())
12678 }
12679 }
12680
12681 unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapsResponse<'static> {
12682 type Narrowed<'de> = SecureMemGetPhysicalSecureHeapsResponse<'de>;
12683
12684 #[inline]
12685 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12686 ::fidl_next::munge!(let Self { table } = out);
12687 ::fidl_next::wire::Table::zero_padding(table);
12688 }
12689 }
12690
12691 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemGetPhysicalSecureHeapsResponse<'de>
12692 where
12693 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12694 {
12695 fn decode(
12696 slot: ::fidl_next::Slot<'_, Self>,
12697 decoder: &mut ___D,
12698 _: (),
12699 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12700 ::fidl_next::munge!(let Self { table } = slot);
12701
12702 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12703 match ordinal {
12704 0 => unsafe { ::core::hint::unreachable_unchecked() },
12705
12706 1 => {
12707 ::fidl_next::wire::Envelope::decode_as::<
12708 ___D,
12709 ::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>,
12710 >(slot.as_mut(), decoder, (32, ()))?;
12711
12712 let value = unsafe {
12713 slot
12714 .deref_unchecked()
12715 .deref_unchecked::<
12716 ::fidl_next::wire::Vector<'_, crate::wire::SecureHeapAndRanges<'_>>
12717 >()
12718 };
12719
12720 if value.len() > 32 {
12721 return Err(::fidl_next::DecodeError::VectorTooLong {
12722 size: value.len() as u64,
12723 limit: 32,
12724 });
12725 }
12726
12727 Ok(())
12728 }
12729
12730 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12731 }
12732 })
12733 }
12734 }
12735
12736 impl<'de> SecureMemGetPhysicalSecureHeapsResponse<'de> {
12737 pub fn heaps(
12738 &self,
12739 ) -> ::core::option::Option<
12740 &::fidl_next::wire::Vector<'de, crate::wire::SecureHeapAndRanges<'de>>,
12741 > {
12742 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12743 }
12744 }
12745
12746 impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapsResponse<'de> {
12747 fn fmt(
12748 &self,
12749 f: &mut ::core::fmt::Formatter<'_>,
12750 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12751 f.debug_struct("SecureMemGetPhysicalSecureHeapsResponse")
12752 .field("heaps", &self.heaps())
12753 .finish()
12754 }
12755 }
12756
12757 impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapsResponse<'de> {
12758 type Natural = crate::natural::SecureMemGetPhysicalSecureHeapsResponse;
12759 }
12760
12761 #[repr(C)]
12763 pub struct SecureMemGetDynamicSecureHeapsResponse<'de> {
12764 pub(crate) table: ::fidl_next::wire::Table<'de>,
12765 }
12766
12767 impl<'de> Drop for SecureMemGetDynamicSecureHeapsResponse<'de> {
12768 fn drop(&mut self) {
12769 let _ = self.table.get(1)
12770 .map(|envelope| unsafe {
12771 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>>()
12772 });
12773 }
12774 }
12775
12776 impl ::fidl_next::Constrained for SecureMemGetDynamicSecureHeapsResponse<'_> {
12777 type Constraint = ();
12778
12779 fn validate(
12780 _: ::fidl_next::Slot<'_, Self>,
12781 _: Self::Constraint,
12782 ) -> Result<(), ::fidl_next::ValidationError> {
12783 Ok(())
12784 }
12785 }
12786
12787 unsafe impl ::fidl_next::Wire for SecureMemGetDynamicSecureHeapsResponse<'static> {
12788 type Narrowed<'de> = SecureMemGetDynamicSecureHeapsResponse<'de>;
12789
12790 #[inline]
12791 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12792 ::fidl_next::munge!(let Self { table } = out);
12793 ::fidl_next::wire::Table::zero_padding(table);
12794 }
12795 }
12796
12797 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemGetDynamicSecureHeapsResponse<'de>
12798 where
12799 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12800 {
12801 fn decode(
12802 slot: ::fidl_next::Slot<'_, Self>,
12803 decoder: &mut ___D,
12804 _: (),
12805 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12806 ::fidl_next::munge!(let Self { table } = slot);
12807
12808 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12809 match ordinal {
12810 0 => unsafe { ::core::hint::unreachable_unchecked() },
12811
12812 1 => {
12813 ::fidl_next::wire::Envelope::decode_as::<
12814 ___D,
12815 ::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>,
12816 >(slot.as_mut(), decoder, (32, ()))?;
12817
12818 let value = unsafe {
12819 slot
12820 .deref_unchecked()
12821 .deref_unchecked::<
12822 ::fidl_next::wire::Vector<'_, crate::wire::DynamicSecureHeap<'_>>
12823 >()
12824 };
12825
12826 if value.len() > 32 {
12827 return Err(::fidl_next::DecodeError::VectorTooLong {
12828 size: value.len() as u64,
12829 limit: 32,
12830 });
12831 }
12832
12833 Ok(())
12834 }
12835
12836 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12837 }
12838 })
12839 }
12840 }
12841
12842 impl<'de> SecureMemGetDynamicSecureHeapsResponse<'de> {
12843 pub fn heaps(
12844 &self,
12845 ) -> ::core::option::Option<
12846 &::fidl_next::wire::Vector<'de, crate::wire::DynamicSecureHeap<'de>>,
12847 > {
12848 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12849 }
12850 }
12851
12852 impl<'de> ::core::fmt::Debug for SecureMemGetDynamicSecureHeapsResponse<'de> {
12853 fn fmt(
12854 &self,
12855 f: &mut ::core::fmt::Formatter<'_>,
12856 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12857 f.debug_struct("SecureMemGetDynamicSecureHeapsResponse")
12858 .field("heaps", &self.heaps())
12859 .finish()
12860 }
12861 }
12862
12863 impl<'de> ::fidl_next::IntoNatural for SecureMemGetDynamicSecureHeapsResponse<'de> {
12864 type Natural = crate::natural::SecureMemGetDynamicSecureHeapsResponse;
12865 }
12866
12867 #[repr(C)]
12869 pub struct SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
12870 pub(crate) table: ::fidl_next::wire::Table<'de>,
12871 }
12872
12873 impl<'de> Drop for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
12874 fn drop(&mut self) {
12875 let _ = self.table.get(1).map(|envelope| unsafe {
12876 envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
12877 });
12878 }
12879 }
12880
12881 impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapPropertiesRequest<'_> {
12882 type Constraint = ();
12883
12884 fn validate(
12885 _: ::fidl_next::Slot<'_, Self>,
12886 _: Self::Constraint,
12887 ) -> Result<(), ::fidl_next::ValidationError> {
12888 Ok(())
12889 }
12890 }
12891
12892 unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapPropertiesRequest<'static> {
12893 type Narrowed<'de> = SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>;
12894
12895 #[inline]
12896 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12897 ::fidl_next::munge!(let Self { table } = out);
12898 ::fidl_next::wire::Table::zero_padding(table);
12899 }
12900 }
12901
12902 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
12903 for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>
12904 where
12905 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12906 {
12907 fn decode(
12908 slot: ::fidl_next::Slot<'_, Self>,
12909 decoder: &mut ___D,
12910 _: (),
12911 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12912 ::fidl_next::munge!(let Self { table } = slot);
12913
12914 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12915 match ordinal {
12916 0 => unsafe { ::core::hint::unreachable_unchecked() },
12917
12918 1 => {
12919 ::fidl_next::wire::Envelope::decode_as::<
12920 ___D,
12921 crate::wire::SecureHeapAndRange<'de>,
12922 >(slot.as_mut(), decoder, ())?;
12923
12924 Ok(())
12925 }
12926
12927 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12928 }
12929 })
12930 }
12931 }
12932
12933 impl<'de> SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
12934 pub fn entire_heap(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
12935 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12936 }
12937 }
12938
12939 impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
12940 fn fmt(
12941 &self,
12942 f: &mut ::core::fmt::Formatter<'_>,
12943 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12944 f.debug_struct("SecureMemGetPhysicalSecureHeapPropertiesRequest")
12945 .field("entire_heap", &self.entire_heap())
12946 .finish()
12947 }
12948 }
12949
12950 impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapPropertiesRequest<'de> {
12951 type Natural = crate::natural::SecureMemGetPhysicalSecureHeapPropertiesRequest;
12952 }
12953
12954 #[repr(C)]
12956 pub struct SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
12957 pub(crate) table: ::fidl_next::wire::Table<'de>,
12958 }
12959
12960 impl<'de> Drop for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
12961 fn drop(&mut self) {
12962 let _ = self.table.get(1).map(|envelope| unsafe {
12963 envelope.read_unchecked::<crate::wire::SecureHeapProperties<'de>>()
12964 });
12965 }
12966 }
12967
12968 impl ::fidl_next::Constrained for SecureMemGetPhysicalSecureHeapPropertiesResponse<'_> {
12969 type Constraint = ();
12970
12971 fn validate(
12972 _: ::fidl_next::Slot<'_, Self>,
12973 _: Self::Constraint,
12974 ) -> Result<(), ::fidl_next::ValidationError> {
12975 Ok(())
12976 }
12977 }
12978
12979 unsafe impl ::fidl_next::Wire for SecureMemGetPhysicalSecureHeapPropertiesResponse<'static> {
12980 type Narrowed<'de> = SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>;
12981
12982 #[inline]
12983 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12984 ::fidl_next::munge!(let Self { table } = out);
12985 ::fidl_next::wire::Table::zero_padding(table);
12986 }
12987 }
12988
12989 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
12990 for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de>
12991 where
12992 ___D: ::fidl_next::Decoder<'de> + ?Sized,
12993 {
12994 fn decode(
12995 slot: ::fidl_next::Slot<'_, Self>,
12996 decoder: &mut ___D,
12997 _: (),
12998 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12999 ::fidl_next::munge!(let Self { table } = slot);
13000
13001 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13002 match ordinal {
13003 0 => unsafe { ::core::hint::unreachable_unchecked() },
13004
13005 1 => {
13006 ::fidl_next::wire::Envelope::decode_as::<
13007 ___D,
13008 crate::wire::SecureHeapProperties<'de>,
13009 >(slot.as_mut(), decoder, ())?;
13010
13011 Ok(())
13012 }
13013
13014 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13015 }
13016 })
13017 }
13018 }
13019
13020 impl<'de> SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13021 pub fn properties(
13022 &self,
13023 ) -> ::core::option::Option<&crate::wire::SecureHeapProperties<'de>> {
13024 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13025 }
13026 }
13027
13028 impl<'de> ::core::fmt::Debug for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13029 fn fmt(
13030 &self,
13031 f: &mut ::core::fmt::Formatter<'_>,
13032 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13033 f.debug_struct("SecureMemGetPhysicalSecureHeapPropertiesResponse")
13034 .field("properties", &self.properties())
13035 .finish()
13036 }
13037 }
13038
13039 impl<'de> ::fidl_next::IntoNatural for SecureMemGetPhysicalSecureHeapPropertiesResponse<'de> {
13040 type Natural = crate::natural::SecureMemGetPhysicalSecureHeapPropertiesResponse;
13041 }
13042
13043 #[repr(C)]
13045 pub struct SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13046 pub(crate) table: ::fidl_next::wire::Table<'de>,
13047 }
13048
13049 impl<'de> Drop for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13050 fn drop(&mut self) {
13051 let _ = self.table.get(1).map(|envelope| unsafe {
13052 envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13053 });
13054 }
13055 }
13056
13057 impl ::fidl_next::Constrained for SecureMemAddSecureHeapPhysicalRangeRequest<'_> {
13058 type Constraint = ();
13059
13060 fn validate(
13061 _: ::fidl_next::Slot<'_, Self>,
13062 _: Self::Constraint,
13063 ) -> Result<(), ::fidl_next::ValidationError> {
13064 Ok(())
13065 }
13066 }
13067
13068 unsafe impl ::fidl_next::Wire for SecureMemAddSecureHeapPhysicalRangeRequest<'static> {
13069 type Narrowed<'de> = SecureMemAddSecureHeapPhysicalRangeRequest<'de>;
13070
13071 #[inline]
13072 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13073 ::fidl_next::munge!(let Self { table } = out);
13074 ::fidl_next::wire::Table::zero_padding(table);
13075 }
13076 }
13077
13078 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemAddSecureHeapPhysicalRangeRequest<'de>
13079 where
13080 ___D: ::fidl_next::Decoder<'de> + ?Sized,
13081 {
13082 fn decode(
13083 slot: ::fidl_next::Slot<'_, Self>,
13084 decoder: &mut ___D,
13085 _: (),
13086 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13087 ::fidl_next::munge!(let Self { table } = slot);
13088
13089 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13090 match ordinal {
13091 0 => unsafe { ::core::hint::unreachable_unchecked() },
13092
13093 1 => {
13094 ::fidl_next::wire::Envelope::decode_as::<
13095 ___D,
13096 crate::wire::SecureHeapAndRange<'de>,
13097 >(slot.as_mut(), decoder, ())?;
13098
13099 Ok(())
13100 }
13101
13102 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13103 }
13104 })
13105 }
13106 }
13107
13108 impl<'de> SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13109 pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13110 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13111 }
13112 }
13113
13114 impl<'de> ::core::fmt::Debug for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13115 fn fmt(
13116 &self,
13117 f: &mut ::core::fmt::Formatter<'_>,
13118 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13119 f.debug_struct("SecureMemAddSecureHeapPhysicalRangeRequest")
13120 .field("heap_range", &self.heap_range())
13121 .finish()
13122 }
13123 }
13124
13125 impl<'de> ::fidl_next::IntoNatural for SecureMemAddSecureHeapPhysicalRangeRequest<'de> {
13126 type Natural = crate::natural::SecureMemAddSecureHeapPhysicalRangeRequest;
13127 }
13128
13129 pub type SecureMemAddSecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13131
13132 #[repr(C)]
13134 pub struct SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13135 pub(crate) table: ::fidl_next::wire::Table<'de>,
13136 }
13137
13138 impl<'de> Drop for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13139 fn drop(&mut self) {
13140 let _ = self.table.get(1).map(|envelope| unsafe {
13141 envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13142 });
13143 }
13144 }
13145
13146 impl ::fidl_next::Constrained for SecureMemDeleteSecureHeapPhysicalRangeRequest<'_> {
13147 type Constraint = ();
13148
13149 fn validate(
13150 _: ::fidl_next::Slot<'_, Self>,
13151 _: Self::Constraint,
13152 ) -> Result<(), ::fidl_next::ValidationError> {
13153 Ok(())
13154 }
13155 }
13156
13157 unsafe impl ::fidl_next::Wire for SecureMemDeleteSecureHeapPhysicalRangeRequest<'static> {
13158 type Narrowed<'de> = SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>;
13159
13160 #[inline]
13161 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13162 ::fidl_next::munge!(let Self { table } = out);
13163 ::fidl_next::wire::Table::zero_padding(table);
13164 }
13165 }
13166
13167 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13168 for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>
13169 where
13170 ___D: ::fidl_next::Decoder<'de> + ?Sized,
13171 {
13172 fn decode(
13173 slot: ::fidl_next::Slot<'_, Self>,
13174 decoder: &mut ___D,
13175 _: (),
13176 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13177 ::fidl_next::munge!(let Self { table } = slot);
13178
13179 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13180 match ordinal {
13181 0 => unsafe { ::core::hint::unreachable_unchecked() },
13182
13183 1 => {
13184 ::fidl_next::wire::Envelope::decode_as::<
13185 ___D,
13186 crate::wire::SecureHeapAndRange<'de>,
13187 >(slot.as_mut(), decoder, ())?;
13188
13189 Ok(())
13190 }
13191
13192 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13193 }
13194 })
13195 }
13196 }
13197
13198 impl<'de> SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13199 pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13200 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13201 }
13202 }
13203
13204 impl<'de> ::core::fmt::Debug for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13205 fn fmt(
13206 &self,
13207 f: &mut ::core::fmt::Formatter<'_>,
13208 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13209 f.debug_struct("SecureMemDeleteSecureHeapPhysicalRangeRequest")
13210 .field("heap_range", &self.heap_range())
13211 .finish()
13212 }
13213 }
13214
13215 impl<'de> ::fidl_next::IntoNatural for SecureMemDeleteSecureHeapPhysicalRangeRequest<'de> {
13216 type Natural = crate::natural::SecureMemDeleteSecureHeapPhysicalRangeRequest;
13217 }
13218
13219 pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13221
13222 #[repr(C)]
13224 pub struct SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13225 pub(crate) table: ::fidl_next::wire::Table<'de>,
13226 }
13227
13228 impl<'de> Drop for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13229 fn drop(&mut self) {
13230 let _ = self.table.get(1).map(|envelope| unsafe {
13231 envelope.read_unchecked::<crate::wire::SecureHeapAndRangeModification<'de>>()
13232 });
13233 }
13234 }
13235
13236 impl ::fidl_next::Constrained for SecureMemModifySecureHeapPhysicalRangeRequest<'_> {
13237 type Constraint = ();
13238
13239 fn validate(
13240 _: ::fidl_next::Slot<'_, Self>,
13241 _: Self::Constraint,
13242 ) -> Result<(), ::fidl_next::ValidationError> {
13243 Ok(())
13244 }
13245 }
13246
13247 unsafe impl ::fidl_next::Wire for SecureMemModifySecureHeapPhysicalRangeRequest<'static> {
13248 type Narrowed<'de> = SecureMemModifySecureHeapPhysicalRangeRequest<'de>;
13249
13250 #[inline]
13251 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13252 ::fidl_next::munge!(let Self { table } = out);
13253 ::fidl_next::wire::Table::zero_padding(table);
13254 }
13255 }
13256
13257 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
13258 for SecureMemModifySecureHeapPhysicalRangeRequest<'de>
13259 where
13260 ___D: ::fidl_next::Decoder<'de> + ?Sized,
13261 {
13262 fn decode(
13263 slot: ::fidl_next::Slot<'_, Self>,
13264 decoder: &mut ___D,
13265 _: (),
13266 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13267 ::fidl_next::munge!(let Self { table } = slot);
13268
13269 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13270 match ordinal {
13271 0 => unsafe { ::core::hint::unreachable_unchecked() },
13272
13273 1 => {
13274 ::fidl_next::wire::Envelope::decode_as::<
13275 ___D,
13276 crate::wire::SecureHeapAndRangeModification<'de>,
13277 >(slot.as_mut(), decoder, ())?;
13278
13279 Ok(())
13280 }
13281
13282 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13283 }
13284 })
13285 }
13286 }
13287
13288 impl<'de> SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13289 pub fn range_modification(
13290 &self,
13291 ) -> ::core::option::Option<&crate::wire::SecureHeapAndRangeModification<'de>> {
13292 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13293 }
13294 }
13295
13296 impl<'de> ::core::fmt::Debug for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13297 fn fmt(
13298 &self,
13299 f: &mut ::core::fmt::Formatter<'_>,
13300 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13301 f.debug_struct("SecureMemModifySecureHeapPhysicalRangeRequest")
13302 .field("range_modification", &self.range_modification())
13303 .finish()
13304 }
13305 }
13306
13307 impl<'de> ::fidl_next::IntoNatural for SecureMemModifySecureHeapPhysicalRangeRequest<'de> {
13308 type Natural = crate::natural::SecureMemModifySecureHeapPhysicalRangeRequest;
13309 }
13310
13311 pub type SecureMemModifySecureHeapPhysicalRangeResponse = ::fidl_next::wire::Unit;
13313
13314 #[repr(C)]
13316 pub struct SecureMemZeroSubRangeRequest<'de> {
13317 pub(crate) table: ::fidl_next::wire::Table<'de>,
13318 }
13319
13320 impl<'de> Drop for SecureMemZeroSubRangeRequest<'de> {
13321 fn drop(&mut self) {
13322 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
13323
13324 let _ = self.table.get(2).map(|envelope| unsafe {
13325 envelope.read_unchecked::<crate::wire::SecureHeapAndRange<'de>>()
13326 });
13327 }
13328 }
13329
13330 impl ::fidl_next::Constrained for SecureMemZeroSubRangeRequest<'_> {
13331 type Constraint = ();
13332
13333 fn validate(
13334 _: ::fidl_next::Slot<'_, Self>,
13335 _: Self::Constraint,
13336 ) -> Result<(), ::fidl_next::ValidationError> {
13337 Ok(())
13338 }
13339 }
13340
13341 unsafe impl ::fidl_next::Wire for SecureMemZeroSubRangeRequest<'static> {
13342 type Narrowed<'de> = SecureMemZeroSubRangeRequest<'de>;
13343
13344 #[inline]
13345 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13346 ::fidl_next::munge!(let Self { table } = out);
13347 ::fidl_next::wire::Table::zero_padding(table);
13348 }
13349 }
13350
13351 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SecureMemZeroSubRangeRequest<'de>
13352 where
13353 ___D: ::fidl_next::Decoder<'de> + ?Sized,
13354 {
13355 fn decode(
13356 slot: ::fidl_next::Slot<'_, Self>,
13357 decoder: &mut ___D,
13358 _: (),
13359 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13360 ::fidl_next::munge!(let Self { table } = slot);
13361
13362 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13363 match ordinal {
13364 0 => unsafe { ::core::hint::unreachable_unchecked() },
13365
13366 1 => {
13367 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
13368 slot.as_mut(),
13369 decoder,
13370 (),
13371 )?;
13372
13373 Ok(())
13374 }
13375
13376 2 => {
13377 ::fidl_next::wire::Envelope::decode_as::<
13378 ___D,
13379 crate::wire::SecureHeapAndRange<'de>,
13380 >(slot.as_mut(), decoder, ())?;
13381
13382 Ok(())
13383 }
13384
13385 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13386 }
13387 })
13388 }
13389 }
13390
13391 impl<'de> SecureMemZeroSubRangeRequest<'de> {
13392 pub fn is_covering_range_explicit(&self) -> ::core::option::Option<&bool> {
13393 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13394 }
13395
13396 pub fn heap_range(&self) -> ::core::option::Option<&crate::wire::SecureHeapAndRange<'de>> {
13397 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13398 }
13399 }
13400
13401 impl<'de> ::core::fmt::Debug for SecureMemZeroSubRangeRequest<'de> {
13402 fn fmt(
13403 &self,
13404 f: &mut ::core::fmt::Formatter<'_>,
13405 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13406 f.debug_struct("SecureMemZeroSubRangeRequest")
13407 .field("is_covering_range_explicit", &self.is_covering_range_explicit())
13408 .field("heap_range", &self.heap_range())
13409 .finish()
13410 }
13411 }
13412
13413 impl<'de> ::fidl_next::IntoNatural for SecureMemZeroSubRangeRequest<'de> {
13414 type Natural = crate::natural::SecureMemZeroSubRangeRequest;
13415 }
13416
13417 pub type SecureMemZeroSubRangeResponse = ::fidl_next::wire::Unit;
13419}
13420
13421pub mod wire_optional {}
13422
13423pub mod generic {
13424
13425 pub type NodeSyncResponse = ();
13427
13428 pub struct PixelFormatAndModifier<T0, T1> {
13430 pub pixel_format: T0,
13431
13432 pub pixel_format_modifier: T1,
13433 }
13434
13435 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::PixelFormatAndModifier, ___E>
13436 for PixelFormatAndModifier<T0, T1>
13437 where
13438 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13439 T0: ::fidl_next::Encode<::fidl_next_common_fuchsia_images2::wire::PixelFormat, ___E>,
13440 T1: ::fidl_next::Encode<::fidl_next_common_fuchsia_images2::wire::PixelFormatModifier, ___E>,
13441 {
13442 #[inline]
13443 fn encode(
13444 self,
13445 encoder_: &mut ___E,
13446 out_: &mut ::core::mem::MaybeUninit<crate::wire::PixelFormatAndModifier>,
13447 _: (),
13448 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13449 ::fidl_next::munge! {
13450 let crate::wire::PixelFormatAndModifier {
13451 pixel_format,
13452 pixel_format_modifier,
13453
13454 } = out_;
13455 }
13456
13457 ::fidl_next::Encode::encode(self.pixel_format, encoder_, pixel_format, ())?;
13458
13459 ::fidl_next::Encode::encode(
13460 self.pixel_format_modifier,
13461 encoder_,
13462 pixel_format_modifier,
13463 (),
13464 )?;
13465
13466 Ok(())
13467 }
13468 }
13469
13470 pub type BufferCollectionCheckAllBuffersAllocatedResponse = ();
13472
13473 pub type SecureMemAddSecureHeapPhysicalRangeResponse = ();
13475
13476 pub type SecureMemDeleteSecureHeapPhysicalRangeResponse = ();
13478
13479 pub type SecureMemModifySecureHeapPhysicalRangeResponse = ();
13481
13482 pub type SecureMemZeroSubRangeResponse = ();
13484}
13485
13486pub use self::natural::*;
13487
13488#[doc = " The max length in bytes of the `name` request field in\n [`fuchsia.sysmem2/Allocator.SetDebugClientInfo`] and\n [`fuchsia.sysmem2/Node.SetDebugClientInfo`].\n"]
13489pub const MAX_CLIENT_NAME_LENGTH: i32 = 256 as i32;
13490
13491#[doc = " The maximum size of\n [`fuchsia.sysmem2/BufferMemoryConstraints.permitted_heaps`].\n"]
13492pub const MAX_COUNT_BUFFER_MEMORY_CONSTRAINTS_PERMITTED_HEAPS: u32 = 64 as u32;
13493
13494#[doc = " The maximum size of [`fuchsia.sysmem2/ImageFormatConstraints.color_spaces`].\n"]
13495pub const MAX_COUNT_IMAGE_FORMAT_CONSTRAINTS_COLOR_SPACES: u32 = 32 as u32;
13496
13497#[doc = " The maximum size of\n [`fuchsia.sysmem2/ImageFormatConstraints.pixel_format_and_modifiers`].\n"]
13498pub const MAX_COUNT_PIXEL_FORMAT_AND_MODIFIERS: u32 = 64 as u32;
13499
13500#[doc = " The maximum size of\n [`fuchsia.sysmem2/BufferCollectionConstraints.image_format_constraints`].\n"]
13501pub const MAX_COUNT_BUFFER_COLLECTION_CONSTRAINTS_IMAGE_FORMAT_CONSTRAINTS: u32 = 64 as u32;
13502
13503#[doc = " The maximum entries that can be in the\n [`fuchsia.sysmem2/BufferCollectionInfo.buffers`] field.\n"]
13504pub const MAX_COUNT_BUFFER_COLLECTION_INFO_BUFFERS: u32 = 128 as u32;
13505
13506pub const MAX_COUNT_IMAGE_FORMAT_CONSTRAINTS_REQUIRED_MAX_SIZE_LIST: u32 = 64 as u32;
13507
13508pub const MAX_COUNT_DUPLICATES: u32 = 64 as u32;
13509
13510#[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"]
13511pub const MAX_COUNT_CREATE_CHILDREN: i32 = 64 as i32;
13512
13513pub const CPU_USAGE_READ: u32 = 1 as u32;
13514
13515pub const CPU_USAGE_READ_OFTEN: u32 = 2 as u32;
13516
13517pub const CPU_USAGE_WRITE: u32 = 4 as u32;
13518
13519pub const CPU_USAGE_WRITE_OFTEN: u32 = 8 as u32;
13520
13521pub const DISPLAY_USAGE_CURSOR: u32 = 2 as u32;
13522
13523pub const DISPLAY_USAGE_LAYER: u32 = 1 as u32;
13524
13525pub const MAX_HEAPS_COUNT: u32 = 32 as u32;
13526
13527pub const MAX_RANGES_COUNT: u32 = 128 as u32;
13528
13529pub const NONE_USAGE: u32 = 1 as u32;
13530
13531pub const NONE_USAGE_PERMIT_ALLOCATION: u32 = 2 as u32;
13532
13533#[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"]
13535#[derive(PartialEq, Debug)]
13536pub struct SecureMem;
13537
13538#[cfg(target_os = "fuchsia")]
13539impl ::fidl_next::HasTransport for SecureMem {
13540 type Transport = ::fidl_next::fuchsia::zx::Channel;
13541}
13542
13543pub mod secure_mem {
13544 pub mod prelude {
13545 pub use crate::{
13546 SecureMem, SecureMemClientHandler, SecureMemLocalClientHandler,
13547 SecureMemLocalServerHandler, SecureMemServerHandler, secure_mem,
13548 };
13549
13550 pub use crate::natural::Error;
13551
13552 pub use crate::natural::SecureMemAddSecureHeapPhysicalRangeRequest;
13553
13554 pub use crate::natural::SecureMemDeleteSecureHeapPhysicalRangeRequest;
13555
13556 pub use crate::natural::SecureMemGetPhysicalSecureHeapPropertiesRequest;
13557
13558 pub use crate::natural::SecureMemModifySecureHeapPhysicalRangeRequest;
13559
13560 pub use crate::natural::SecureMemZeroSubRangeRequest;
13561
13562 pub use crate::natural::SecureMemAddSecureHeapPhysicalRangeResponse;
13563
13564 pub use crate::natural::SecureMemDeleteSecureHeapPhysicalRangeResponse;
13565
13566 pub use crate::natural::SecureMemGetDynamicSecureHeapsResponse;
13567
13568 pub use crate::natural::SecureMemGetPhysicalSecureHeapPropertiesResponse;
13569
13570 pub use crate::natural::SecureMemGetPhysicalSecureHeapsResponse;
13571
13572 pub use crate::natural::SecureMemModifySecureHeapPhysicalRangeResponse;
13573
13574 pub use crate::natural::SecureMemZeroSubRangeResponse;
13575 }
13576
13577 pub struct GetPhysicalSecureHeaps;
13578
13579 impl ::fidl_next::Method for GetPhysicalSecureHeaps {
13580 const ORDINAL: u64 = 4067140791638717411;
13581 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
13582 ::fidl_next::protocol::Flexibility::Flexible;
13583
13584 type Protocol = crate::SecureMem;
13585
13586 type Request = ::fidl_next::wire::EmptyMessageBody;
13587 }
13588
13589 impl ::fidl_next::TwoWayMethod for GetPhysicalSecureHeaps {
13590 type Response = ::fidl_next::wire::FlexibleResult<
13591 'static,
13592 crate::wire::SecureMemGetPhysicalSecureHeapsResponse<'static>,
13593 crate::wire::Error,
13594 >;
13595 }
13596
13597 impl<___R> ::fidl_next::Respond<___R> for GetPhysicalSecureHeaps {
13598 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
13599
13600 fn respond(response: ___R) -> Self::Output {
13601 ::fidl_next::FlexibleResult::Ok(response)
13602 }
13603 }
13604
13605 impl<___R> ::fidl_next::RespondErr<___R> for GetPhysicalSecureHeaps {
13606 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
13607
13608 fn respond_err(response: ___R) -> Self::Output {
13609 ::fidl_next::FlexibleResult::Err(response)
13610 }
13611 }
13612
13613 pub struct GetDynamicSecureHeaps;
13614
13615 impl ::fidl_next::Method for GetDynamicSecureHeaps {
13616 const ORDINAL: u64 = 1265657178863511604;
13617 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
13618 ::fidl_next::protocol::Flexibility::Flexible;
13619
13620 type Protocol = crate::SecureMem;
13621
13622 type Request = ::fidl_next::wire::EmptyMessageBody;
13623 }
13624
13625 impl ::fidl_next::TwoWayMethod for GetDynamicSecureHeaps {
13626 type Response = ::fidl_next::wire::FlexibleResult<
13627 'static,
13628 crate::wire::SecureMemGetDynamicSecureHeapsResponse<'static>,
13629 crate::wire::Error,
13630 >;
13631 }
13632
13633 impl<___R> ::fidl_next::Respond<___R> for GetDynamicSecureHeaps {
13634 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
13635
13636 fn respond(response: ___R) -> Self::Output {
13637 ::fidl_next::FlexibleResult::Ok(response)
13638 }
13639 }
13640
13641 impl<___R> ::fidl_next::RespondErr<___R> for GetDynamicSecureHeaps {
13642 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
13643
13644 fn respond_err(response: ___R) -> Self::Output {
13645 ::fidl_next::FlexibleResult::Err(response)
13646 }
13647 }
13648
13649 pub struct GetPhysicalSecureHeapProperties;
13650
13651 impl ::fidl_next::Method for GetPhysicalSecureHeapProperties {
13652 const ORDINAL: u64 = 895942034471897020;
13653 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
13654 ::fidl_next::protocol::Flexibility::Flexible;
13655
13656 type Protocol = crate::SecureMem;
13657
13658 type Request = crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>;
13659 }
13660
13661 impl ::fidl_next::TwoWayMethod for GetPhysicalSecureHeapProperties {
13662 type Response = ::fidl_next::wire::FlexibleResult<
13663 'static,
13664 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesResponse<'static>,
13665 crate::wire::Error,
13666 >;
13667 }
13668
13669 impl<___R> ::fidl_next::Respond<___R> for GetPhysicalSecureHeapProperties {
13670 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
13671
13672 fn respond(response: ___R) -> Self::Output {
13673 ::fidl_next::FlexibleResult::Ok(response)
13674 }
13675 }
13676
13677 impl<___R> ::fidl_next::RespondErr<___R> for GetPhysicalSecureHeapProperties {
13678 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
13679
13680 fn respond_err(response: ___R) -> Self::Output {
13681 ::fidl_next::FlexibleResult::Err(response)
13682 }
13683 }
13684
13685 pub struct AddSecureHeapPhysicalRange;
13686
13687 impl ::fidl_next::Method for AddSecureHeapPhysicalRange {
13688 const ORDINAL: u64 = 3888459953148993914;
13689 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
13690 ::fidl_next::protocol::Flexibility::Flexible;
13691
13692 type Protocol = crate::SecureMem;
13693
13694 type Request = crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>;
13695 }
13696
13697 impl ::fidl_next::TwoWayMethod for AddSecureHeapPhysicalRange {
13698 type Response = ::fidl_next::wire::FlexibleResult<
13699 'static,
13700 crate::wire::SecureMemAddSecureHeapPhysicalRangeResponse,
13701 crate::wire::Error,
13702 >;
13703 }
13704
13705 impl<___R> ::fidl_next::Respond<___R> for AddSecureHeapPhysicalRange {
13706 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
13707
13708 fn respond(response: ___R) -> Self::Output {
13709 ::fidl_next::FlexibleResult::Ok(response)
13710 }
13711 }
13712
13713 impl<___R> ::fidl_next::RespondErr<___R> for AddSecureHeapPhysicalRange {
13714 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
13715
13716 fn respond_err(response: ___R) -> Self::Output {
13717 ::fidl_next::FlexibleResult::Err(response)
13718 }
13719 }
13720
13721 pub struct DeleteSecureHeapPhysicalRange;
13722
13723 impl ::fidl_next::Method for DeleteSecureHeapPhysicalRange {
13724 const ORDINAL: u64 = 1056754671343258782;
13725 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
13726 ::fidl_next::protocol::Flexibility::Flexible;
13727
13728 type Protocol = crate::SecureMem;
13729
13730 type Request = crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>;
13731 }
13732
13733 impl ::fidl_next::TwoWayMethod for DeleteSecureHeapPhysicalRange {
13734 type Response = ::fidl_next::wire::FlexibleResult<
13735 'static,
13736 crate::wire::SecureMemDeleteSecureHeapPhysicalRangeResponse,
13737 crate::wire::Error,
13738 >;
13739 }
13740
13741 impl<___R> ::fidl_next::Respond<___R> for DeleteSecureHeapPhysicalRange {
13742 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
13743
13744 fn respond(response: ___R) -> Self::Output {
13745 ::fidl_next::FlexibleResult::Ok(response)
13746 }
13747 }
13748
13749 impl<___R> ::fidl_next::RespondErr<___R> for DeleteSecureHeapPhysicalRange {
13750 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
13751
13752 fn respond_err(response: ___R) -> Self::Output {
13753 ::fidl_next::FlexibleResult::Err(response)
13754 }
13755 }
13756
13757 pub struct ModifySecureHeapPhysicalRange;
13758
13759 impl ::fidl_next::Method for ModifySecureHeapPhysicalRange {
13760 const ORDINAL: u64 = 6969114310578042676;
13761 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
13762 ::fidl_next::protocol::Flexibility::Flexible;
13763
13764 type Protocol = crate::SecureMem;
13765
13766 type Request = crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>;
13767 }
13768
13769 impl ::fidl_next::TwoWayMethod for ModifySecureHeapPhysicalRange {
13770 type Response = ::fidl_next::wire::FlexibleResult<
13771 'static,
13772 crate::wire::SecureMemModifySecureHeapPhysicalRangeResponse,
13773 crate::wire::Error,
13774 >;
13775 }
13776
13777 impl<___R> ::fidl_next::Respond<___R> for ModifySecureHeapPhysicalRange {
13778 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
13779
13780 fn respond(response: ___R) -> Self::Output {
13781 ::fidl_next::FlexibleResult::Ok(response)
13782 }
13783 }
13784
13785 impl<___R> ::fidl_next::RespondErr<___R> for ModifySecureHeapPhysicalRange {
13786 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
13787
13788 fn respond_err(response: ___R) -> Self::Output {
13789 ::fidl_next::FlexibleResult::Err(response)
13790 }
13791 }
13792
13793 pub struct ZeroSubRange;
13794
13795 impl ::fidl_next::Method for ZeroSubRange {
13796 const ORDINAL: u64 = 6567857461132811493;
13797 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
13798 ::fidl_next::protocol::Flexibility::Flexible;
13799
13800 type Protocol = crate::SecureMem;
13801
13802 type Request = crate::wire::SecureMemZeroSubRangeRequest<'static>;
13803 }
13804
13805 impl ::fidl_next::TwoWayMethod for ZeroSubRange {
13806 type Response = ::fidl_next::wire::FlexibleResult<
13807 'static,
13808 crate::wire::SecureMemZeroSubRangeResponse,
13809 crate::wire::Error,
13810 >;
13811 }
13812
13813 impl<___R> ::fidl_next::Respond<___R> for ZeroSubRange {
13814 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
13815
13816 fn respond(response: ___R) -> Self::Output {
13817 ::fidl_next::FlexibleResult::Ok(response)
13818 }
13819 }
13820
13821 impl<___R> ::fidl_next::RespondErr<___R> for ZeroSubRange {
13822 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
13823
13824 fn respond_err(response: ___R) -> Self::Output {
13825 ::fidl_next::FlexibleResult::Err(response)
13826 }
13827 }
13828
13829 mod ___detail {
13830 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::SecureMem
13831 where
13832 ___T: ::fidl_next::Transport,
13833 {
13834 type Client = SecureMemClient<___T>;
13835 type Server = SecureMemServer<___T>;
13836 }
13837
13838 #[repr(transparent)]
13840 pub struct SecureMemClient<___T: ::fidl_next::Transport> {
13841 #[allow(dead_code)]
13842 client: ::fidl_next::protocol::Client<___T>,
13843 }
13844
13845 impl<___T> SecureMemClient<___T>
13846 where
13847 ___T: ::fidl_next::Transport,
13848 {
13849 #[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"]
13850 pub fn get_physical_secure_heaps(
13851 &self,
13852 ) -> ::fidl_next::TwoWayFuture<'_, super::GetPhysicalSecureHeaps, ___T> {
13853 ::fidl_next::TwoWayFuture::from_untyped(
13854 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
13855 4067140791638717411,
13856 <super::GetPhysicalSecureHeaps as ::fidl_next::Method>::FLEXIBILITY,
13857 (),
13858 ),
13859 )
13860 }
13861
13862 #[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"]
13863 pub fn get_dynamic_secure_heaps(
13864 &self,
13865 ) -> ::fidl_next::TwoWayFuture<'_, super::GetDynamicSecureHeaps, ___T> {
13866 ::fidl_next::TwoWayFuture::from_untyped(
13867 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
13868 1265657178863511604,
13869 <super::GetDynamicSecureHeaps as ::fidl_next::Method>::FLEXIBILITY,
13870 (),
13871 ),
13872 )
13873 }
13874
13875 #[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"]
13876 pub fn get_physical_secure_heap_properties_with<___R>(
13877 &self,
13878 request: ___R,
13879 ) -> ::fidl_next::TwoWayFuture<'_, super::GetPhysicalSecureHeapProperties, ___T>
13880 where
13881 ___R: ::fidl_next::Encode<
13882 crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'static>,
13883 <___T as ::fidl_next::Transport>::SendBuffer,
13884 >,
13885 {
13886 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
13887 895942034471897020,
13888 <super::GetPhysicalSecureHeapProperties as ::fidl_next::Method>::FLEXIBILITY,
13889 request,
13890 ))
13891 }
13892
13893 #[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"]
13894 pub fn add_secure_heap_physical_range_with<___R>(
13895 &self,
13896 request: ___R,
13897 ) -> ::fidl_next::TwoWayFuture<'_, super::AddSecureHeapPhysicalRange, ___T>
13898 where
13899 ___R: ::fidl_next::Encode<
13900 crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'static>,
13901 <___T as ::fidl_next::Transport>::SendBuffer,
13902 >,
13903 {
13904 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
13905 3888459953148993914,
13906 <super::AddSecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
13907 request,
13908 ))
13909 }
13910
13911 #[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"]
13912 pub fn delete_secure_heap_physical_range_with<___R>(
13913 &self,
13914 request: ___R,
13915 ) -> ::fidl_next::TwoWayFuture<'_, super::DeleteSecureHeapPhysicalRange, ___T>
13916 where
13917 ___R: ::fidl_next::Encode<
13918 crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'static>,
13919 <___T as ::fidl_next::Transport>::SendBuffer,
13920 >,
13921 {
13922 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
13923 1056754671343258782,
13924 <super::DeleteSecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
13925 request,
13926 ))
13927 }
13928
13929 #[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"]
13930 pub fn modify_secure_heap_physical_range_with<___R>(
13931 &self,
13932 request: ___R,
13933 ) -> ::fidl_next::TwoWayFuture<'_, super::ModifySecureHeapPhysicalRange, ___T>
13934 where
13935 ___R: ::fidl_next::Encode<
13936 crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'static>,
13937 <___T as ::fidl_next::Transport>::SendBuffer,
13938 >,
13939 {
13940 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
13941 6969114310578042676,
13942 <super::ModifySecureHeapPhysicalRange as ::fidl_next::Method>::FLEXIBILITY,
13943 request,
13944 ))
13945 }
13946
13947 #[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"]
13948 pub fn zero_sub_range_with<___R>(
13949 &self,
13950 request: ___R,
13951 ) -> ::fidl_next::TwoWayFuture<'_, super::ZeroSubRange, ___T>
13952 where
13953 ___R: ::fidl_next::Encode<
13954 crate::wire::SecureMemZeroSubRangeRequest<'static>,
13955 <___T as ::fidl_next::Transport>::SendBuffer,
13956 >,
13957 {
13958 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
13959 6567857461132811493,
13960 <super::ZeroSubRange as ::fidl_next::Method>::FLEXIBILITY,
13961 request,
13962 ))
13963 }
13964 }
13965
13966 #[repr(transparent)]
13968 pub struct SecureMemServer<___T: ::fidl_next::Transport> {
13969 server: ::fidl_next::protocol::Server<___T>,
13970 }
13971
13972 impl<___T> SecureMemServer<___T> where ___T: ::fidl_next::Transport {}
13973 }
13974}
13975
13976#[diagnostic::on_unimplemented(
13977 note = "If {Self} implements the non-local SecureMemClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
13978)]
13979
13980pub trait SecureMemLocalClientHandler<
13984 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
13985 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
13986>
13987{
13988 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
13989 ::core::future::ready(())
13990 }
13991}
13992
13993impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for SecureMem
13994where
13995 ___H: SecureMemLocalClientHandler<___T>,
13996 ___T: ::fidl_next::Transport,
13997{
13998 async fn on_event(
13999 handler: &mut ___H,
14000 ordinal: u64,
14001 flexibility: ::fidl_next::protocol::Flexibility,
14002 body: ::fidl_next::Body<___T>,
14003 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
14004 match ordinal {
14005 ordinal => {
14006 handler.on_unknown_interaction(ordinal).await;
14007 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
14008 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14009 } else {
14010 Ok(())
14011 }
14012 }
14013 }
14014 }
14015}
14016
14017#[diagnostic::on_unimplemented(
14018 note = "If {Self} implements the non-local SecureMemServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
14019)]
14020
14021pub trait SecureMemLocalServerHandler<
14025 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14026 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14027>
14028{
14029 #[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"]
14030 fn get_physical_secure_heaps(
14031 &mut self,
14032
14033 responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
14034 ) -> impl ::core::future::Future<Output = ()>;
14035
14036 #[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"]
14037 fn get_dynamic_secure_heaps(
14038 &mut self,
14039
14040 responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
14041 ) -> impl ::core::future::Future<Output = ()>;
14042
14043 #[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"]
14044 fn get_physical_secure_heap_properties(
14045 &mut self,
14046
14047 request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14048
14049 responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14050 ) -> impl ::core::future::Future<Output = ()>;
14051
14052 #[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"]
14053 fn add_secure_heap_physical_range(
14054 &mut self,
14055
14056 request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14057
14058 responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14059 ) -> impl ::core::future::Future<Output = ()>;
14060
14061 #[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"]
14062 fn delete_secure_heap_physical_range(
14063 &mut self,
14064
14065 request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14066
14067 responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14068 ) -> impl ::core::future::Future<Output = ()>;
14069
14070 #[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"]
14071 fn modify_secure_heap_physical_range(
14072 &mut self,
14073
14074 request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14075
14076 responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14077 ) -> impl ::core::future::Future<Output = ()>;
14078
14079 #[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"]
14080 fn zero_sub_range(
14081 &mut self,
14082
14083 request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
14084
14085 responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
14086 ) -> impl ::core::future::Future<Output = ()>;
14087
14088 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
14089 ::core::future::ready(())
14090 }
14091}
14092
14093impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for SecureMem
14094where
14095 ___H: SecureMemLocalServerHandler<___T>,
14096 ___T: ::fidl_next::Transport,
14097 for<'de> crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>: ::fidl_next::Decode<
14098 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14099 Constraint = (),
14100 >,
14101 for<'de> crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14102 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14103 Constraint = (),
14104 >,
14105 for<'de> crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14106 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14107 Constraint = (),
14108 >,
14109 for<'de> crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14110 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14111 Constraint = (),
14112 >,
14113 for<'de> crate::wire::SecureMemZeroSubRangeRequest<'de>: ::fidl_next::Decode<
14114 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14115 Constraint = (),
14116 >,
14117{
14118 async fn on_one_way(
14119 handler: &mut ___H,
14120 ordinal: u64,
14121 flexibility: ::fidl_next::protocol::Flexibility,
14122 body: ::fidl_next::Body<___T>,
14123 ) -> ::core::result::Result<
14124 (),
14125 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14126 > {
14127 match ordinal {
14128 ordinal => {
14129 handler.on_unknown_interaction(ordinal).await;
14130 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
14131 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14132 } else {
14133 Ok(())
14134 }
14135 }
14136 }
14137 }
14138
14139 async fn on_two_way(
14140 handler: &mut ___H,
14141 ordinal: u64,
14142 flexibility: ::fidl_next::protocol::Flexibility,
14143 body: ::fidl_next::Body<___T>,
14144 responder: ::fidl_next::protocol::Responder<___T>,
14145 ) -> ::core::result::Result<
14146 (),
14147 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14148 > {
14149 match ordinal {
14150 4067140791638717411 => {
14151 let responder = ::fidl_next::Responder::from_untyped(responder);
14152
14153 handler.get_physical_secure_heaps(responder).await;
14154 Ok(())
14155 }
14156
14157 1265657178863511604 => {
14158 let responder = ::fidl_next::Responder::from_untyped(responder);
14159
14160 handler.get_dynamic_secure_heaps(responder).await;
14161 Ok(())
14162 }
14163
14164 895942034471897020 => {
14165 let responder = ::fidl_next::Responder::from_untyped(responder);
14166
14167 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14168 Ok(decoded) => {
14169 handler
14170 .get_physical_secure_heap_properties(
14171 ::fidl_next::Request::from_decoded(decoded),
14172 responder,
14173 )
14174 .await;
14175 Ok(())
14176 }
14177 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14178 ordinal: 895942034471897020,
14179 error,
14180 }),
14181 }
14182 }
14183
14184 3888459953148993914 => {
14185 let responder = ::fidl_next::Responder::from_untyped(responder);
14186
14187 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14188 Ok(decoded) => {
14189 handler
14190 .add_secure_heap_physical_range(
14191 ::fidl_next::Request::from_decoded(decoded),
14192 responder,
14193 )
14194 .await;
14195 Ok(())
14196 }
14197 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14198 ordinal: 3888459953148993914,
14199 error,
14200 }),
14201 }
14202 }
14203
14204 1056754671343258782 => {
14205 let responder = ::fidl_next::Responder::from_untyped(responder);
14206
14207 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14208 Ok(decoded) => {
14209 handler
14210 .delete_secure_heap_physical_range(
14211 ::fidl_next::Request::from_decoded(decoded),
14212 responder,
14213 )
14214 .await;
14215 Ok(())
14216 }
14217 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14218 ordinal: 1056754671343258782,
14219 error,
14220 }),
14221 }
14222 }
14223
14224 6969114310578042676 => {
14225 let responder = ::fidl_next::Responder::from_untyped(responder);
14226
14227 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14228 Ok(decoded) => {
14229 handler
14230 .modify_secure_heap_physical_range(
14231 ::fidl_next::Request::from_decoded(decoded),
14232 responder,
14233 )
14234 .await;
14235 Ok(())
14236 }
14237 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14238 ordinal: 6969114310578042676,
14239 error,
14240 }),
14241 }
14242 }
14243
14244 6567857461132811493 => {
14245 let responder = ::fidl_next::Responder::from_untyped(responder);
14246
14247 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14248 Ok(decoded) => {
14249 handler
14250 .zero_sub_range(::fidl_next::Request::from_decoded(decoded), responder)
14251 .await;
14252 Ok(())
14253 }
14254 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14255 ordinal: 6567857461132811493,
14256 error,
14257 }),
14258 }
14259 }
14260
14261 ordinal => {
14262 handler.on_unknown_interaction(ordinal).await;
14263 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
14264 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14265 } else {
14266 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
14267 ordinal,
14268 flexibility,
14269 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
14270 )
14271 .expect("encoding a framework error should never fail")
14272 .await?;
14273 Ok(())
14274 }
14275 }
14276 }
14277 }
14278}
14279
14280pub trait SecureMemClientHandler<
14284 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14285 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14286>
14287{
14288 fn on_unknown_interaction(
14289 &mut self,
14290 ordinal: u64,
14291 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
14292 ::core::future::ready(())
14293 }
14294}
14295
14296impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for SecureMem
14297where
14298 ___H: SecureMemClientHandler<___T> + ::core::marker::Send,
14299 ___T: ::fidl_next::Transport,
14300{
14301 async fn on_event(
14302 handler: &mut ___H,
14303 ordinal: u64,
14304 flexibility: ::fidl_next::protocol::Flexibility,
14305 body: ::fidl_next::Body<___T>,
14306 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
14307 match ordinal {
14308 ordinal => {
14309 handler.on_unknown_interaction(ordinal).await;
14310 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
14311 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14312 } else {
14313 Ok(())
14314 }
14315 }
14316 }
14317 }
14318}
14319
14320pub trait SecureMemServerHandler<
14324 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14325 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
14326>
14327{
14328 #[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"]
14329 fn get_physical_secure_heaps(
14330 &mut self,
14331
14332 responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
14333 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14334
14335 #[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"]
14336 fn get_dynamic_secure_heaps(
14337 &mut self,
14338
14339 responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
14340 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14341
14342 #[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"]
14343 fn get_physical_secure_heap_properties(
14344 &mut self,
14345
14346 request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14347
14348 responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14349 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14350
14351 #[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"]
14352 fn add_secure_heap_physical_range(
14353 &mut self,
14354
14355 request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14356
14357 responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14358 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14359
14360 #[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"]
14361 fn delete_secure_heap_physical_range(
14362 &mut self,
14363
14364 request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14365
14366 responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14367 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14368
14369 #[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"]
14370 fn modify_secure_heap_physical_range(
14371 &mut self,
14372
14373 request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14374
14375 responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14376 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14377
14378 #[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"]
14379 fn zero_sub_range(
14380 &mut self,
14381
14382 request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
14383
14384 responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
14385 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14386
14387 fn on_unknown_interaction(
14388 &mut self,
14389 ordinal: u64,
14390 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
14391 ::core::future::ready(())
14392 }
14393}
14394
14395impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for SecureMem
14396where
14397 ___H: SecureMemServerHandler<___T> + ::core::marker::Send,
14398 ___T: ::fidl_next::Transport,
14399 for<'de> crate::wire::SecureMemGetPhysicalSecureHeapPropertiesRequest<'de>: ::fidl_next::Decode<
14400 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14401 Constraint = (),
14402 >,
14403 for<'de> crate::wire::SecureMemAddSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14404 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14405 Constraint = (),
14406 >,
14407 for<'de> crate::wire::SecureMemDeleteSecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14408 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14409 Constraint = (),
14410 >,
14411 for<'de> crate::wire::SecureMemModifySecureHeapPhysicalRangeRequest<'de>: ::fidl_next::Decode<
14412 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14413 Constraint = (),
14414 >,
14415 for<'de> crate::wire::SecureMemZeroSubRangeRequest<'de>: ::fidl_next::Decode<
14416 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
14417 Constraint = (),
14418 >,
14419{
14420 async fn on_one_way(
14421 handler: &mut ___H,
14422 ordinal: u64,
14423 flexibility: ::fidl_next::protocol::Flexibility,
14424 body: ::fidl_next::Body<___T>,
14425 ) -> ::core::result::Result<
14426 (),
14427 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14428 > {
14429 match ordinal {
14430 ordinal => {
14431 handler.on_unknown_interaction(ordinal).await;
14432 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
14433 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14434 } else {
14435 Ok(())
14436 }
14437 }
14438 }
14439 }
14440
14441 async fn on_two_way(
14442 handler: &mut ___H,
14443 ordinal: u64,
14444 flexibility: ::fidl_next::protocol::Flexibility,
14445 body: ::fidl_next::Body<___T>,
14446 responder: ::fidl_next::protocol::Responder<___T>,
14447 ) -> ::core::result::Result<
14448 (),
14449 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14450 > {
14451 match ordinal {
14452 4067140791638717411 => {
14453 let responder = ::fidl_next::Responder::from_untyped(responder);
14454
14455 handler.get_physical_secure_heaps(responder).await;
14456 Ok(())
14457 }
14458
14459 1265657178863511604 => {
14460 let responder = ::fidl_next::Responder::from_untyped(responder);
14461
14462 handler.get_dynamic_secure_heaps(responder).await;
14463 Ok(())
14464 }
14465
14466 895942034471897020 => {
14467 let responder = ::fidl_next::Responder::from_untyped(responder);
14468
14469 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14470 Ok(decoded) => {
14471 handler
14472 .get_physical_secure_heap_properties(
14473 ::fidl_next::Request::from_decoded(decoded),
14474 responder,
14475 )
14476 .await;
14477 Ok(())
14478 }
14479 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14480 ordinal: 895942034471897020,
14481 error,
14482 }),
14483 }
14484 }
14485
14486 3888459953148993914 => {
14487 let responder = ::fidl_next::Responder::from_untyped(responder);
14488
14489 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14490 Ok(decoded) => {
14491 handler
14492 .add_secure_heap_physical_range(
14493 ::fidl_next::Request::from_decoded(decoded),
14494 responder,
14495 )
14496 .await;
14497 Ok(())
14498 }
14499 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14500 ordinal: 3888459953148993914,
14501 error,
14502 }),
14503 }
14504 }
14505
14506 1056754671343258782 => {
14507 let responder = ::fidl_next::Responder::from_untyped(responder);
14508
14509 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14510 Ok(decoded) => {
14511 handler
14512 .delete_secure_heap_physical_range(
14513 ::fidl_next::Request::from_decoded(decoded),
14514 responder,
14515 )
14516 .await;
14517 Ok(())
14518 }
14519 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14520 ordinal: 1056754671343258782,
14521 error,
14522 }),
14523 }
14524 }
14525
14526 6969114310578042676 => {
14527 let responder = ::fidl_next::Responder::from_untyped(responder);
14528
14529 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14530 Ok(decoded) => {
14531 handler
14532 .modify_secure_heap_physical_range(
14533 ::fidl_next::Request::from_decoded(decoded),
14534 responder,
14535 )
14536 .await;
14537 Ok(())
14538 }
14539 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14540 ordinal: 6969114310578042676,
14541 error,
14542 }),
14543 }
14544 }
14545
14546 6567857461132811493 => {
14547 let responder = ::fidl_next::Responder::from_untyped(responder);
14548
14549 match ::fidl_next::AsDecoderExt::into_decoded(body) {
14550 Ok(decoded) => {
14551 handler
14552 .zero_sub_range(::fidl_next::Request::from_decoded(decoded), responder)
14553 .await;
14554 Ok(())
14555 }
14556 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14557 ordinal: 6567857461132811493,
14558 error,
14559 }),
14560 }
14561 }
14562
14563 ordinal => {
14564 handler.on_unknown_interaction(ordinal).await;
14565 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
14566 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
14567 } else {
14568 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
14569 ordinal,
14570 flexibility,
14571 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
14572 )
14573 .expect("encoding a framework error should never fail")
14574 .await?;
14575 Ok(())
14576 }
14577 }
14578 }
14579 }
14580}
14581
14582impl<___T> SecureMemClientHandler<___T> for ::fidl_next::IgnoreEvents
14583where
14584 ___T: ::fidl_next::Transport,
14585{
14586 async fn on_unknown_interaction(&mut self, _: u64) {}
14587}
14588
14589impl<___H, ___T> SecureMemLocalClientHandler<___T> for ::fidl_next::Local<___H>
14590where
14591 ___H: SecureMemClientHandler<___T>,
14592 ___T: ::fidl_next::Transport,
14593{
14594 async fn on_unknown_interaction(&mut self, ordinal: u64) {
14595 ___H::on_unknown_interaction(&mut self.0, ordinal).await
14596 }
14597}
14598
14599impl<___H, ___T> SecureMemLocalServerHandler<___T> for ::fidl_next::Local<___H>
14600where
14601 ___H: SecureMemServerHandler<___T>,
14602 ___T: ::fidl_next::Transport,
14603{
14604 async fn get_physical_secure_heaps(
14605 &mut self,
14606
14607 responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeaps, ___T>,
14608 ) {
14609 ___H::get_physical_secure_heaps(&mut self.0, responder).await
14610 }
14611
14612 async fn get_dynamic_secure_heaps(
14613 &mut self,
14614
14615 responder: ::fidl_next::Responder<secure_mem::GetDynamicSecureHeaps, ___T>,
14616 ) {
14617 ___H::get_dynamic_secure_heaps(&mut self.0, responder).await
14618 }
14619
14620 async fn get_physical_secure_heap_properties(
14621 &mut self,
14622
14623 request: ::fidl_next::Request<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14624
14625 responder: ::fidl_next::Responder<secure_mem::GetPhysicalSecureHeapProperties, ___T>,
14626 ) {
14627 ___H::get_physical_secure_heap_properties(&mut self.0, request, responder).await
14628 }
14629
14630 async fn add_secure_heap_physical_range(
14631 &mut self,
14632
14633 request: ::fidl_next::Request<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14634
14635 responder: ::fidl_next::Responder<secure_mem::AddSecureHeapPhysicalRange, ___T>,
14636 ) {
14637 ___H::add_secure_heap_physical_range(&mut self.0, request, responder).await
14638 }
14639
14640 async fn delete_secure_heap_physical_range(
14641 &mut self,
14642
14643 request: ::fidl_next::Request<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14644
14645 responder: ::fidl_next::Responder<secure_mem::DeleteSecureHeapPhysicalRange, ___T>,
14646 ) {
14647 ___H::delete_secure_heap_physical_range(&mut self.0, request, responder).await
14648 }
14649
14650 async fn modify_secure_heap_physical_range(
14651 &mut self,
14652
14653 request: ::fidl_next::Request<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14654
14655 responder: ::fidl_next::Responder<secure_mem::ModifySecureHeapPhysicalRange, ___T>,
14656 ) {
14657 ___H::modify_secure_heap_physical_range(&mut self.0, request, responder).await
14658 }
14659
14660 async fn zero_sub_range(
14661 &mut self,
14662
14663 request: ::fidl_next::Request<secure_mem::ZeroSubRange, ___T>,
14664
14665 responder: ::fidl_next::Responder<secure_mem::ZeroSubRange, ___T>,
14666 ) {
14667 ___H::zero_sub_range(&mut self.0, request, responder).await
14668 }
14669
14670 async fn on_unknown_interaction(&mut self, ordinal: u64) {
14671 ___H::on_unknown_interaction(&mut self.0, ordinal).await
14672 }
14673}
14674
14675pub const VIDEO_USAGE_CAPTURE: u32 = 8 as u32;
14676
14677pub const VIDEO_USAGE_DECRYPTOR_OUTPUT: u32 = 16 as u32;
14678
14679pub const VIDEO_USAGE_HW_DECODER: u32 = 1 as u32;
14680
14681pub const VIDEO_USAGE_HW_DECODER_INTERNAL: u32 = 32 as u32;
14682
14683pub const VIDEO_USAGE_HW_ENCODER: u32 = 2 as u32;
14684
14685pub const VULKAN_BUFFER_USAGE_INDEX_BUFFER: u32 = 4194304 as u32;
14686
14687pub const VULKAN_BUFFER_USAGE_INDIRECT_BUFFER: u32 = 16777216 as u32;
14688
14689pub const VULKAN_BUFFER_USAGE_STORAGE_BUFFER: u32 = 2097152 as u32;
14690
14691pub const VULKAN_BUFFER_USAGE_STORAGE_TEXEL_BUFFER: u32 = 524288 as u32;
14692
14693pub const VULKAN_BUFFER_USAGE_TRANSFER_DST: u32 = 131072 as u32;
14694
14695pub const VULKAN_BUFFER_USAGE_TRANSFER_SRC: u32 = 65536 as u32;
14696
14697pub const VULKAN_BUFFER_USAGE_UNIFORM_BUFFER: u32 = 1048576 as u32;
14698
14699pub const VULKAN_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER: u32 = 262144 as u32;
14700
14701pub const VULKAN_BUFFER_USAGE_VERTEX_BUFFER: u32 = 8388608 as u32;
14702
14703pub const VULKAN_IMAGE_USAGE_COLOR_ATTACHMENT: u32 = 16 as u32;
14704
14705pub const VULKAN_IMAGE_USAGE_INPUT_ATTACHMENT: u32 = 128 as u32;
14706
14707pub const VULKAN_IMAGE_USAGE_SAMPLED: u32 = 4 as u32;
14708
14709pub const VULKAN_IMAGE_USAGE_STENCIL_ATTACHMENT: u32 = 32 as u32;
14710
14711pub const VULKAN_IMAGE_USAGE_STORAGE: u32 = 8 as u32;
14712
14713pub const VULKAN_IMAGE_USAGE_TRANSFER_DST: u32 = 2 as u32;
14714
14715pub const VULKAN_IMAGE_USAGE_TRANSFER_SRC: u32 = 1 as u32;
14716
14717pub const VULKAN_IMAGE_USAGE_TRANSIENT_ATTACHMENT: u32 = 64 as u32;