1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8 #[repr(C)]
9 pub struct EmmcDeviceInfo {
10 pub cid: [u8; 16],
11
12 pub rpmb_size: u8,
13
14 pub reliable_write_sector_count: u8,
15 }
16
17 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EmmcDeviceInfo, ___E> for EmmcDeviceInfo
18 where
19 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20 {
21 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::EmmcDeviceInfo> = unsafe {
22 ::fidl_next::CopyOptimization::enable_if(
23 true && <[u8; 16] as ::fidl_next::Encode<[u8; 16], ___E>>::COPY_OPTIMIZATION
24 .is_enabled()
25 && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled()
26 && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled(),
27 )
28 };
29
30 #[inline]
31 fn encode(
32 self,
33 encoder_: &mut ___E,
34 out_: &mut ::core::mem::MaybeUninit<crate::wire::EmmcDeviceInfo>,
35 _: (),
36 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
37 ::fidl_next::munge! {
38 let crate::wire::EmmcDeviceInfo {
39 cid,
40 rpmb_size,
41 reliable_write_sector_count,
42
43 } = out_;
44 }
45
46 ::fidl_next::Encode::encode(self.cid, encoder_, cid, ())?;
47
48 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(cid.as_mut_ptr()) };
49
50 ::fidl_next::Encode::encode(self.rpmb_size, encoder_, rpmb_size, ())?;
51
52 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rpmb_size.as_mut_ptr()) };
53
54 ::fidl_next::Encode::encode(
55 self.reliable_write_sector_count,
56 encoder_,
57 reliable_write_sector_count,
58 (),
59 )?;
60
61 let mut _field = unsafe {
62 ::fidl_next::Slot::new_unchecked(reliable_write_sector_count.as_mut_ptr())
63 };
64
65 Ok(())
66 }
67 }
68
69 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EmmcDeviceInfo, ___E> for &'a EmmcDeviceInfo
70 where
71 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
72 {
73 #[inline]
74 fn encode(
75 self,
76 encoder_: &mut ___E,
77 out_: &mut ::core::mem::MaybeUninit<crate::wire::EmmcDeviceInfo>,
78 _: (),
79 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
80 ::fidl_next::munge! {
81 let crate::wire::EmmcDeviceInfo {
82 cid,
83 rpmb_size,
84 reliable_write_sector_count,
85
86 } = out_;
87 }
88
89 ::fidl_next::Encode::encode(&self.cid, encoder_, cid, ())?;
90
91 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(cid.as_mut_ptr()) };
92
93 ::fidl_next::Encode::encode(&self.rpmb_size, encoder_, rpmb_size, ())?;
94
95 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rpmb_size.as_mut_ptr()) };
96
97 ::fidl_next::Encode::encode(
98 &self.reliable_write_sector_count,
99 encoder_,
100 reliable_write_sector_count,
101 (),
102 )?;
103
104 let mut _field = unsafe {
105 ::fidl_next::Slot::new_unchecked(reliable_write_sector_count.as_mut_ptr())
106 };
107
108 Ok(())
109 }
110 }
111
112 unsafe impl<___E>
113 ::fidl_next::EncodeOption<
114 ::fidl_next::wire::Box<'static, crate::wire::EmmcDeviceInfo>,
115 ___E,
116 > for EmmcDeviceInfo
117 where
118 ___E: ::fidl_next::Encoder + ?Sized,
119 EmmcDeviceInfo: ::fidl_next::Encode<crate::wire::EmmcDeviceInfo, ___E>,
120 {
121 #[inline]
122 fn encode_option(
123 this: ::core::option::Option<Self>,
124 encoder: &mut ___E,
125 out: &mut ::core::mem::MaybeUninit<
126 ::fidl_next::wire::Box<'static, crate::wire::EmmcDeviceInfo>,
127 >,
128 _: (),
129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
130 if let Some(inner) = this {
131 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
132 ::fidl_next::wire::Box::encode_present(out);
133 } else {
134 ::fidl_next::wire::Box::encode_absent(out);
135 }
136
137 Ok(())
138 }
139 }
140
141 unsafe impl<'a, ___E>
142 ::fidl_next::EncodeOption<
143 ::fidl_next::wire::Box<'static, crate::wire::EmmcDeviceInfo>,
144 ___E,
145 > for &'a EmmcDeviceInfo
146 where
147 ___E: ::fidl_next::Encoder + ?Sized,
148 &'a EmmcDeviceInfo: ::fidl_next::Encode<crate::wire::EmmcDeviceInfo, ___E>,
149 {
150 #[inline]
151 fn encode_option(
152 this: ::core::option::Option<Self>,
153 encoder: &mut ___E,
154 out: &mut ::core::mem::MaybeUninit<
155 ::fidl_next::wire::Box<'static, crate::wire::EmmcDeviceInfo>,
156 >,
157 _: (),
158 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
159 if let Some(inner) = this {
160 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
161 ::fidl_next::wire::Box::encode_present(out);
162 } else {
163 ::fidl_next::wire::Box::encode_absent(out);
164 }
165
166 Ok(())
167 }
168 }
169
170 impl ::fidl_next::FromWire<crate::wire::EmmcDeviceInfo> for EmmcDeviceInfo {
171 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::EmmcDeviceInfo, Self> = unsafe {
172 ::fidl_next::CopyOptimization::enable_if(
173 true && <[u8; 16] as ::fidl_next::FromWire<[u8; 16]>>::COPY_OPTIMIZATION
174 .is_enabled()
175 && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled()
176 && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled(),
177 )
178 };
179
180 #[inline]
181 fn from_wire(wire: crate::wire::EmmcDeviceInfo) -> Self {
182 Self {
183 cid: ::fidl_next::FromWire::from_wire(wire.cid),
184
185 rpmb_size: ::fidl_next::FromWire::from_wire(wire.rpmb_size),
186
187 reliable_write_sector_count: ::fidl_next::FromWire::from_wire(
188 wire.reliable_write_sector_count,
189 ),
190 }
191 }
192 }
193
194 impl ::fidl_next::FromWireRef<crate::wire::EmmcDeviceInfo> for EmmcDeviceInfo {
195 #[inline]
196 fn from_wire_ref(wire: &crate::wire::EmmcDeviceInfo) -> Self {
197 Self {
198 cid: ::fidl_next::FromWireRef::from_wire_ref(&wire.cid),
199
200 rpmb_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.rpmb_size),
201
202 reliable_write_sector_count: ::fidl_next::FromWireRef::from_wire_ref(
203 &wire.reliable_write_sector_count,
204 ),
205 }
206 }
207 }
208
209 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
210 pub enum DeviceInfo {
211 EmmcInfo(crate::natural::EmmcDeviceInfo),
212
213 UnknownOrdinal_(u64),
214 }
215
216 impl DeviceInfo {
217 pub fn is_unknown(&self) -> bool {
218 #[allow(unreachable_patterns)]
219 match self {
220 Self::UnknownOrdinal_(_) => true,
221 _ => false,
222 }
223 }
224 }
225
226 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceInfo<'static>, ___E> for DeviceInfo
227 where
228 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
229 ___E: ::fidl_next::Encoder,
230 {
231 #[inline]
232 fn encode(
233 self,
234 encoder: &mut ___E,
235 out: &mut ::core::mem::MaybeUninit<crate::wire::DeviceInfo<'static>>,
236 _: (),
237 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
238 ::fidl_next::munge!(let crate::wire::DeviceInfo { raw, _phantom: _ } = out);
239
240 match self {
241 Self::EmmcInfo(value) => ::fidl_next::wire::Union::encode_as::<
242 ___E,
243 crate::wire::EmmcDeviceInfo,
244 >(value, 1, encoder, raw, ())?,
245
246 Self::UnknownOrdinal_(ordinal) => {
247 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
248 }
249 }
250
251 Ok(())
252 }
253 }
254
255 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceInfo<'static>, ___E> for &'a DeviceInfo
256 where
257 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
258 ___E: ::fidl_next::Encoder,
259 {
260 #[inline]
261 fn encode(
262 self,
263 encoder: &mut ___E,
264 out: &mut ::core::mem::MaybeUninit<crate::wire::DeviceInfo<'static>>,
265 _: (),
266 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
267 ::fidl_next::munge!(let crate::wire::DeviceInfo { raw, _phantom: _ } = out);
268
269 match self {
270 DeviceInfo::EmmcInfo(value) => ::fidl_next::wire::Union::encode_as::<
271 ___E,
272 crate::wire::EmmcDeviceInfo,
273 >(value, 1, encoder, raw, ())?,
274
275 DeviceInfo::UnknownOrdinal_(ordinal) => {
276 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
277 }
278 }
279
280 Ok(())
281 }
282 }
283
284 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::DeviceInfo<'static>, ___E>
285 for DeviceInfo
286 where
287 ___E: ?Sized,
288 DeviceInfo: ::fidl_next::Encode<crate::wire::DeviceInfo<'static>, ___E>,
289 {
290 #[inline]
291 fn encode_option(
292 this: ::core::option::Option<Self>,
293 encoder: &mut ___E,
294 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DeviceInfo<'static>>,
295 _: (),
296 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
297 ::fidl_next::munge!(let crate::wire_optional::DeviceInfo { raw, _phantom: _ } = &mut *out);
298
299 if let Some(inner) = this {
300 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
301 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
302 } else {
303 ::fidl_next::wire::Union::encode_absent(raw);
304 }
305
306 Ok(())
307 }
308 }
309
310 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::DeviceInfo<'static>, ___E>
311 for &'a DeviceInfo
312 where
313 ___E: ?Sized,
314 &'a DeviceInfo: ::fidl_next::Encode<crate::wire::DeviceInfo<'static>, ___E>,
315 {
316 #[inline]
317 fn encode_option(
318 this: ::core::option::Option<Self>,
319 encoder: &mut ___E,
320 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DeviceInfo<'static>>,
321 _: (),
322 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
323 ::fidl_next::munge!(let crate::wire_optional::DeviceInfo { raw, _phantom: _ } = &mut *out);
324
325 if let Some(inner) = this {
326 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
327 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
328 } else {
329 ::fidl_next::wire::Union::encode_absent(raw);
330 }
331
332 Ok(())
333 }
334 }
335
336 impl<'de> ::fidl_next::FromWire<crate::wire::DeviceInfo<'de>> for DeviceInfo {
337 #[inline]
338 fn from_wire(wire: crate::wire::DeviceInfo<'de>) -> Self {
339 let wire = ::core::mem::ManuallyDrop::new(wire);
340 match wire.raw.ordinal() {
341 1 => Self::EmmcInfo(::fidl_next::FromWire::from_wire(unsafe {
342 wire.raw.get().read_unchecked::<crate::wire::EmmcDeviceInfo>()
343 })),
344
345 ord => return Self::UnknownOrdinal_(ord as u64),
346 }
347 }
348 }
349
350 impl<'de> ::fidl_next::FromWireRef<crate::wire::DeviceInfo<'de>> for DeviceInfo {
351 #[inline]
352 fn from_wire_ref(wire: &crate::wire::DeviceInfo<'de>) -> Self {
353 match wire.raw.ordinal() {
354 1 => Self::EmmcInfo(::fidl_next::FromWireRef::from_wire_ref(unsafe {
355 wire.raw.get().deref_unchecked::<crate::wire::EmmcDeviceInfo>()
356 })),
357
358 ord => return Self::UnknownOrdinal_(ord as u64),
359 }
360 }
361 }
362
363 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DeviceInfo<'de>> for DeviceInfo {
364 #[inline]
365 fn from_wire_option(
366 wire: crate::wire_optional::DeviceInfo<'de>,
367 ) -> ::core::option::Option<Self> {
368 if let Some(inner) = wire.into_option() {
369 Some(::fidl_next::FromWire::from_wire(inner))
370 } else {
371 None
372 }
373 }
374 }
375
376 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DeviceInfo<'de>> for Box<DeviceInfo> {
377 #[inline]
378 fn from_wire_option(
379 wire: crate::wire_optional::DeviceInfo<'de>,
380 ) -> ::core::option::Option<Self> {
381 <
382 DeviceInfo as ::fidl_next::FromWireOption<crate::wire_optional::DeviceInfo<'de>>
383 >::from_wire_option(wire).map(Box::new)
384 }
385 }
386
387 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::DeviceInfo<'de>>
388 for Box<DeviceInfo>
389 {
390 #[inline]
391 fn from_wire_option_ref(
392 wire: &crate::wire_optional::DeviceInfo<'de>,
393 ) -> ::core::option::Option<Self> {
394 if let Some(inner) = wire.as_ref() {
395 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
396 } else {
397 None
398 }
399 }
400 }
401
402 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
403 pub struct RpmbGetDeviceInfoResponse {
404 pub info: crate::natural::DeviceInfo,
405 }
406
407 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RpmbGetDeviceInfoResponse<'static>, ___E>
408 for RpmbGetDeviceInfoResponse
409 where
410 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
411 ___E: ::fidl_next::Encoder,
412 {
413 #[inline]
414 fn encode(
415 self,
416 encoder_: &mut ___E,
417 out_: &mut ::core::mem::MaybeUninit<crate::wire::RpmbGetDeviceInfoResponse<'static>>,
418 _: (),
419 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
420 ::fidl_next::munge! {
421 let crate::wire::RpmbGetDeviceInfoResponse {
422 info,
423
424 } = out_;
425 }
426
427 ::fidl_next::Encode::encode(self.info, encoder_, info, ())?;
428
429 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(info.as_mut_ptr()) };
430
431 Ok(())
432 }
433 }
434
435 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::RpmbGetDeviceInfoResponse<'static>, ___E>
436 for &'a RpmbGetDeviceInfoResponse
437 where
438 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
439 ___E: ::fidl_next::Encoder,
440 {
441 #[inline]
442 fn encode(
443 self,
444 encoder_: &mut ___E,
445 out_: &mut ::core::mem::MaybeUninit<crate::wire::RpmbGetDeviceInfoResponse<'static>>,
446 _: (),
447 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
448 ::fidl_next::munge! {
449 let crate::wire::RpmbGetDeviceInfoResponse {
450 info,
451
452 } = out_;
453 }
454
455 ::fidl_next::Encode::encode(&self.info, encoder_, info, ())?;
456
457 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(info.as_mut_ptr()) };
458
459 Ok(())
460 }
461 }
462
463 unsafe impl<___E>
464 ::fidl_next::EncodeOption<
465 ::fidl_next::wire::Box<'static, crate::wire::RpmbGetDeviceInfoResponse<'static>>,
466 ___E,
467 > for RpmbGetDeviceInfoResponse
468 where
469 ___E: ::fidl_next::Encoder + ?Sized,
470 RpmbGetDeviceInfoResponse:
471 ::fidl_next::Encode<crate::wire::RpmbGetDeviceInfoResponse<'static>, ___E>,
472 {
473 #[inline]
474 fn encode_option(
475 this: ::core::option::Option<Self>,
476 encoder: &mut ___E,
477 out: &mut ::core::mem::MaybeUninit<
478 ::fidl_next::wire::Box<'static, crate::wire::RpmbGetDeviceInfoResponse<'static>>,
479 >,
480 _: (),
481 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
482 if let Some(inner) = this {
483 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
484 ::fidl_next::wire::Box::encode_present(out);
485 } else {
486 ::fidl_next::wire::Box::encode_absent(out);
487 }
488
489 Ok(())
490 }
491 }
492
493 unsafe impl<'a, ___E>
494 ::fidl_next::EncodeOption<
495 ::fidl_next::wire::Box<'static, crate::wire::RpmbGetDeviceInfoResponse<'static>>,
496 ___E,
497 > for &'a RpmbGetDeviceInfoResponse
498 where
499 ___E: ::fidl_next::Encoder + ?Sized,
500 &'a RpmbGetDeviceInfoResponse:
501 ::fidl_next::Encode<crate::wire::RpmbGetDeviceInfoResponse<'static>, ___E>,
502 {
503 #[inline]
504 fn encode_option(
505 this: ::core::option::Option<Self>,
506 encoder: &mut ___E,
507 out: &mut ::core::mem::MaybeUninit<
508 ::fidl_next::wire::Box<'static, crate::wire::RpmbGetDeviceInfoResponse<'static>>,
509 >,
510 _: (),
511 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
512 if let Some(inner) = this {
513 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
514 ::fidl_next::wire::Box::encode_present(out);
515 } else {
516 ::fidl_next::wire::Box::encode_absent(out);
517 }
518
519 Ok(())
520 }
521 }
522
523 impl<'de> ::fidl_next::FromWire<crate::wire::RpmbGetDeviceInfoResponse<'de>>
524 for RpmbGetDeviceInfoResponse
525 {
526 #[inline]
527 fn from_wire(wire: crate::wire::RpmbGetDeviceInfoResponse<'de>) -> Self {
528 Self { info: ::fidl_next::FromWire::from_wire(wire.info) }
529 }
530 }
531
532 impl<'de> ::fidl_next::FromWireRef<crate::wire::RpmbGetDeviceInfoResponse<'de>>
533 for RpmbGetDeviceInfoResponse
534 {
535 #[inline]
536 fn from_wire_ref(wire: &crate::wire::RpmbGetDeviceInfoResponse<'de>) -> Self {
537 Self { info: ::fidl_next::FromWireRef::from_wire_ref(&wire.info) }
538 }
539 }
540
541 pub type RpmbRequestResponse = ();
542}
543
544pub mod wire {
545
546 #[derive(Clone, Debug)]
548 #[repr(C)]
549 pub struct EmmcDeviceInfo {
550 pub cid: [u8; 16],
551
552 pub rpmb_size: u8,
553
554 pub reliable_write_sector_count: u8,
555 }
556
557 static_assertions::const_assert_eq!(std::mem::size_of::<EmmcDeviceInfo>(), 18);
558 static_assertions::const_assert_eq!(std::mem::align_of::<EmmcDeviceInfo>(), 1);
559
560 static_assertions::const_assert_eq!(std::mem::offset_of!(EmmcDeviceInfo, cid), 0);
561
562 static_assertions::const_assert_eq!(std::mem::offset_of!(EmmcDeviceInfo, rpmb_size), 16);
563
564 static_assertions::const_assert_eq!(
565 std::mem::offset_of!(EmmcDeviceInfo, reliable_write_sector_count),
566 17
567 );
568
569 impl ::fidl_next::Constrained for EmmcDeviceInfo {
570 type Constraint = ();
571
572 fn validate(
573 _: ::fidl_next::Slot<'_, Self>,
574 _: Self::Constraint,
575 ) -> Result<(), ::fidl_next::ValidationError> {
576 Ok(())
577 }
578 }
579
580 unsafe impl ::fidl_next::Wire for EmmcDeviceInfo {
581 type Narrowed<'de> = EmmcDeviceInfo;
582
583 #[inline]
584 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
585 ::fidl_next::munge! {
586 let Self {
587 cid,
588 rpmb_size,
589 reliable_write_sector_count,
590
591 } = &mut *out_;
592 }
593
594 ::fidl_next::Wire::zero_padding(cid);
595
596 ::fidl_next::Wire::zero_padding(rpmb_size);
597
598 ::fidl_next::Wire::zero_padding(reliable_write_sector_count);
599 }
600 }
601
602 unsafe impl<___D> ::fidl_next::Decode<___D> for EmmcDeviceInfo
603 where
604 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
605 {
606 fn decode(
607 slot_: ::fidl_next::Slot<'_, Self>,
608 decoder_: &mut ___D,
609 _: (),
610 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
611 ::fidl_next::munge! {
612 let Self {
613 mut cid,
614 mut rpmb_size,
615 mut reliable_write_sector_count,
616
617 } = slot_;
618 }
619
620 let _field = cid.as_mut();
621
622 ::fidl_next::Decode::decode(cid.as_mut(), decoder_, ())?;
623
624 let _field = rpmb_size.as_mut();
625
626 ::fidl_next::Decode::decode(rpmb_size.as_mut(), decoder_, ())?;
627
628 let _field = reliable_write_sector_count.as_mut();
629
630 ::fidl_next::Decode::decode(reliable_write_sector_count.as_mut(), decoder_, ())?;
631
632 Ok(())
633 }
634 }
635
636 impl ::fidl_next::IntoNatural for EmmcDeviceInfo {
637 type Natural = crate::natural::EmmcDeviceInfo;
638 }
639
640 #[repr(transparent)]
642 pub struct DeviceInfo<'de> {
643 pub(crate) raw: ::fidl_next::wire::Union,
644 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
645 }
646
647 impl<'de> Drop for DeviceInfo<'de> {
648 fn drop(&mut self) {
649 match self.raw.ordinal() {
650 1 => {
651 let _ =
652 unsafe { self.raw.get().read_unchecked::<crate::wire::EmmcDeviceInfo>() };
653 }
654
655 _ => (),
656 }
657 }
658 }
659
660 impl ::fidl_next::Constrained for DeviceInfo<'_> {
661 type Constraint = ();
662
663 fn validate(
664 _: ::fidl_next::Slot<'_, Self>,
665 _: Self::Constraint,
666 ) -> Result<(), ::fidl_next::ValidationError> {
667 Ok(())
668 }
669 }
670
671 unsafe impl ::fidl_next::Wire for DeviceInfo<'static> {
672 type Narrowed<'de> = DeviceInfo<'de>;
673
674 #[inline]
675 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
676 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
677 ::fidl_next::wire::Union::zero_padding(raw);
678 }
679 }
680
681 pub mod device_info {
682 pub enum Ref<'de> {
683 EmmcInfo(&'de crate::wire::EmmcDeviceInfo),
684
685 UnknownOrdinal_(u64),
686 }
687
688 pub enum Value {
689 EmmcInfo(crate::wire::EmmcDeviceInfo),
690
691 UnknownOrdinal_(u64),
692 }
693 }
694
695 impl<'de> DeviceInfo<'de> {
696 pub fn as_ref(&self) -> crate::wire::device_info::Ref<'_> {
697 match self.raw.ordinal() {
698 1 => crate::wire::device_info::Ref::EmmcInfo(unsafe {
699 self.raw.get().deref_unchecked::<crate::wire::EmmcDeviceInfo>()
700 }),
701
702 unknown => crate::wire::device_info::Ref::UnknownOrdinal_(unknown),
703 }
704 }
705
706 pub fn into_inner(self) -> crate::wire::device_info::Value {
707 let this = ::core::mem::ManuallyDrop::new(self);
708
709 match this.raw.ordinal() {
710 1 => crate::wire::device_info::Value::EmmcInfo(unsafe {
711 this.raw.get().read_unchecked::<crate::wire::EmmcDeviceInfo>()
712 }),
713
714 unknown => crate::wire::device_info::Value::UnknownOrdinal_(unknown),
715 }
716 }
717 }
718
719 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceInfo<'de>
720 where
721 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
722 ___D: ::fidl_next::Decoder<'de>,
723 {
724 fn decode(
725 mut slot: ::fidl_next::Slot<'_, Self>,
726 decoder: &mut ___D,
727 _: (),
728 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
729 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
730 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
731 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EmmcDeviceInfo>(
732 raw,
733 decoder,
734 (),
735 )?,
736
737 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
738 }
739
740 Ok(())
741 }
742 }
743
744 impl<'de> ::core::fmt::Debug for DeviceInfo<'de> {
745 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
746 match self.raw.ordinal() {
747 1 => unsafe {
748 self.raw.get().deref_unchecked::<crate::wire::EmmcDeviceInfo>().fmt(f)
749 },
750 _ => unsafe { ::core::hint::unreachable_unchecked() },
751 }
752 }
753 }
754
755 impl<'de> ::fidl_next::IntoNatural for DeviceInfo<'de> {
756 type Natural = crate::natural::DeviceInfo;
757 }
758
759 #[derive(Debug)]
761 #[repr(C)]
762 pub struct RpmbGetDeviceInfoResponse<'de> {
763 pub info: crate::wire::DeviceInfo<'de>,
764 }
765
766 static_assertions::const_assert_eq!(std::mem::size_of::<RpmbGetDeviceInfoResponse<'_>>(), 16);
767 static_assertions::const_assert_eq!(std::mem::align_of::<RpmbGetDeviceInfoResponse<'_>>(), 8);
768
769 static_assertions::const_assert_eq!(
770 std::mem::offset_of!(RpmbGetDeviceInfoResponse<'_>, info),
771 0
772 );
773
774 impl ::fidl_next::Constrained for RpmbGetDeviceInfoResponse<'_> {
775 type Constraint = ();
776
777 fn validate(
778 _: ::fidl_next::Slot<'_, Self>,
779 _: Self::Constraint,
780 ) -> Result<(), ::fidl_next::ValidationError> {
781 Ok(())
782 }
783 }
784
785 unsafe impl ::fidl_next::Wire for RpmbGetDeviceInfoResponse<'static> {
786 type Narrowed<'de> = RpmbGetDeviceInfoResponse<'de>;
787
788 #[inline]
789 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
790 ::fidl_next::munge! {
791 let Self {
792 info,
793
794 } = &mut *out_;
795 }
796
797 ::fidl_next::Wire::zero_padding(info);
798 }
799 }
800
801 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for RpmbGetDeviceInfoResponse<'de>
802 where
803 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
804 ___D: ::fidl_next::Decoder<'de>,
805 {
806 fn decode(
807 slot_: ::fidl_next::Slot<'_, Self>,
808 decoder_: &mut ___D,
809 _: (),
810 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
811 ::fidl_next::munge! {
812 let Self {
813 mut info,
814
815 } = slot_;
816 }
817
818 let _field = info.as_mut();
819
820 ::fidl_next::Decode::decode(info.as_mut(), decoder_, ())?;
821
822 Ok(())
823 }
824 }
825
826 impl<'de> ::fidl_next::IntoNatural for RpmbGetDeviceInfoResponse<'de> {
827 type Natural = crate::natural::RpmbGetDeviceInfoResponse;
828 }
829
830 pub type RpmbRequestResponse = ::fidl_next::wire::Unit;
832}
833
834pub mod wire_optional {
835
836 #[repr(transparent)]
837 pub struct DeviceInfo<'de> {
838 pub(crate) raw: ::fidl_next::wire::Union,
839 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
840 }
841
842 impl ::fidl_next::Constrained for DeviceInfo<'_> {
843 type Constraint = ();
844
845 fn validate(
846 _: ::fidl_next::Slot<'_, Self>,
847 _: Self::Constraint,
848 ) -> Result<(), ::fidl_next::ValidationError> {
849 Ok(())
850 }
851 }
852
853 unsafe impl ::fidl_next::Wire for DeviceInfo<'static> {
854 type Narrowed<'de> = DeviceInfo<'de>;
855
856 #[inline]
857 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
858 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
859 ::fidl_next::wire::Union::zero_padding(raw);
860 }
861 }
862
863 impl<'de> DeviceInfo<'de> {
864 pub fn is_some(&self) -> bool {
865 self.raw.is_some()
866 }
867
868 pub fn is_none(&self) -> bool {
869 self.raw.is_none()
870 }
871
872 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::DeviceInfo<'de>> {
873 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
874 }
875
876 pub fn into_option(self) -> ::core::option::Option<crate::wire::DeviceInfo<'de>> {
877 if self.is_some() {
878 Some(crate::wire::DeviceInfo {
879 raw: self.raw,
880 _phantom: ::core::marker::PhantomData,
881 })
882 } else {
883 None
884 }
885 }
886 }
887
888 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceInfo<'de>
889 where
890 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
891 ___D: ::fidl_next::Decoder<'de>,
892 {
893 fn decode(
894 mut slot: ::fidl_next::Slot<'_, Self>,
895 decoder: &mut ___D,
896 _: (),
897 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
898 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
899 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
900 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EmmcDeviceInfo>(
901 raw,
902 decoder,
903 (),
904 )?,
905
906 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
907 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
908 }
909
910 Ok(())
911 }
912 }
913
914 impl<'de> ::core::fmt::Debug for DeviceInfo<'de> {
915 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
916 self.as_ref().fmt(f)
917 }
918 }
919
920 impl<'de> ::fidl_next::IntoNatural for DeviceInfo<'de> {
921 type Natural = ::core::option::Option<crate::natural::DeviceInfo>;
922 }
923}
924
925pub mod generic {
926
927 pub struct EmmcDeviceInfo<T0, T1, T2> {
929 pub cid: T0,
930
931 pub rpmb_size: T1,
932
933 pub reliable_write_sector_count: T2,
934 }
935
936 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::EmmcDeviceInfo, ___E>
937 for EmmcDeviceInfo<T0, T1, T2>
938 where
939 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
940 T0: ::fidl_next::Encode<[u8; 16], ___E>,
941 T1: ::fidl_next::Encode<u8, ___E>,
942 T2: ::fidl_next::Encode<u8, ___E>,
943 {
944 #[inline]
945 fn encode(
946 self,
947 encoder_: &mut ___E,
948 out_: &mut ::core::mem::MaybeUninit<crate::wire::EmmcDeviceInfo>,
949 _: (),
950 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
951 ::fidl_next::munge! {
952 let crate::wire::EmmcDeviceInfo {
953 cid,
954 rpmb_size,
955 reliable_write_sector_count,
956
957 } = out_;
958 }
959
960 ::fidl_next::Encode::encode(self.cid, encoder_, cid, ())?;
961
962 ::fidl_next::Encode::encode(self.rpmb_size, encoder_, rpmb_size, ())?;
963
964 ::fidl_next::Encode::encode(
965 self.reliable_write_sector_count,
966 encoder_,
967 reliable_write_sector_count,
968 (),
969 )?;
970
971 Ok(())
972 }
973 }
974
975 pub struct RpmbGetDeviceInfoResponse<T0> {
977 pub info: T0,
978 }
979
980 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::RpmbGetDeviceInfoResponse<'static>, ___E>
981 for RpmbGetDeviceInfoResponse<T0>
982 where
983 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
984 ___E: ::fidl_next::Encoder,
985 T0: ::fidl_next::Encode<crate::wire::DeviceInfo<'static>, ___E>,
986 {
987 #[inline]
988 fn encode(
989 self,
990 encoder_: &mut ___E,
991 out_: &mut ::core::mem::MaybeUninit<crate::wire::RpmbGetDeviceInfoResponse<'static>>,
992 _: (),
993 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
994 ::fidl_next::munge! {
995 let crate::wire::RpmbGetDeviceInfoResponse {
996 info,
997
998 } = out_;
999 }
1000
1001 ::fidl_next::Encode::encode(self.info, encoder_, info, ())?;
1002
1003 Ok(())
1004 }
1005 }
1006
1007 pub type RpmbRequestResponse = ();
1009}
1010
1011pub use self::natural::*;
1012
1013#[doc = " The RPMB frame size in bytes.\n"]
1014pub const FRAME_SIZE: u32 = 512 as u32;