1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub type CqhciEnableCqhciResponse = ();
8
9 pub type CqhciDisableCqhciResponse = ();
10
11 ::fidl_next::bitflags::bitflags! {
12 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct SdmmcHostCap: u64 {
13 const BUS_WIDTH_8 = 1;
14 const DMA = 2;
15 const VOLTAGE_330 = 4;
16 const AUTO_CMD12 = 8;
17 const SDR104 = 16;
18 const SDR50 = 32;
19 const DDR50 = 64;
20 #[doc = " The host does not require tuning for SDR50.\n"]const NO_TUNING_SDR50 = 128;
21 const HS400_ENHANCED_STROBE = 256;
22 const COMMAND_QUEUEING = 512;
23
24 }
25 }
26
27 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcHostCap, ___E> for SdmmcHostCap
28 where
29 ___E: ?Sized,
30 {
31 #[inline]
32 fn encode(
33 self,
34 encoder: &mut ___E,
35 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostCap>,
36 _: (),
37 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
38 ::fidl_next::Encode::encode(&self, encoder, out, ())
39 }
40 }
41
42 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcHostCap, ___E> for &'a SdmmcHostCap
43 where
44 ___E: ?Sized,
45 {
46 #[inline]
47 fn encode(
48 self,
49 _: &mut ___E,
50 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostCap>,
51 _: (),
52 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
53 ::fidl_next::munge!(let crate::wire::SdmmcHostCap { value } = out);
54
55 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
56 return Err(::fidl_next::EncodeError::InvalidStrictBits);
57 }
58
59 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
60 Ok(())
61 }
62 }
63
64 impl ::core::convert::From<crate::wire::SdmmcHostCap> for SdmmcHostCap {
65 fn from(wire: crate::wire::SdmmcHostCap) -> Self {
66 Self::from_bits_retain(u64::from(wire.value))
67 }
68 }
69
70 impl ::fidl_next::FromWire<crate::wire::SdmmcHostCap> for SdmmcHostCap {
71 #[inline]
72 fn from_wire(wire: crate::wire::SdmmcHostCap) -> Self {
73 Self::from(wire)
74 }
75 }
76
77 impl ::fidl_next::FromWireRef<crate::wire::SdmmcHostCap> for SdmmcHostCap {
78 #[inline]
79 fn from_wire_ref(wire: &crate::wire::SdmmcHostCap) -> Self {
80 Self::from(*wire)
81 }
82 }
83
84 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
85 pub struct SdmmcHostInfo {
86 pub caps: crate::natural::SdmmcHostCap,
87
88 pub max_transfer_size: u32,
89
90 pub max_buffer_regions: u64,
91 }
92
93 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcHostInfo, ___E> for SdmmcHostInfo
94 where
95 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
96 {
97 #[inline]
98 fn encode(
99 self,
100 encoder_: &mut ___E,
101 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostInfo>,
102 _: (),
103 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
104 ::fidl_next::munge! {
105 let crate::wire::SdmmcHostInfo {
106 caps,
107 max_transfer_size,
108 max_buffer_regions,
109
110 } = out_;
111 }
112
113 ::fidl_next::Encode::encode(self.caps, encoder_, caps, ())?;
114
115 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(caps.as_mut_ptr()) };
116
117 ::fidl_next::Encode::encode(self.max_transfer_size, encoder_, max_transfer_size, ())?;
118
119 let mut _field =
120 unsafe { ::fidl_next::Slot::new_unchecked(max_transfer_size.as_mut_ptr()) };
121
122 ::fidl_next::Encode::encode(self.max_buffer_regions, encoder_, max_buffer_regions, ())?;
123
124 let mut _field =
125 unsafe { ::fidl_next::Slot::new_unchecked(max_buffer_regions.as_mut_ptr()) };
126
127 Ok(())
128 }
129 }
130
131 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcHostInfo, ___E> for &'a SdmmcHostInfo
132 where
133 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
134 {
135 #[inline]
136 fn encode(
137 self,
138 encoder_: &mut ___E,
139 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostInfo>,
140 _: (),
141 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
142 ::fidl_next::munge! {
143 let crate::wire::SdmmcHostInfo {
144 caps,
145 max_transfer_size,
146 max_buffer_regions,
147
148 } = out_;
149 }
150
151 ::fidl_next::Encode::encode(&self.caps, encoder_, caps, ())?;
152
153 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(caps.as_mut_ptr()) };
154
155 ::fidl_next::Encode::encode(&self.max_transfer_size, encoder_, max_transfer_size, ())?;
156
157 let mut _field =
158 unsafe { ::fidl_next::Slot::new_unchecked(max_transfer_size.as_mut_ptr()) };
159
160 ::fidl_next::Encode::encode(
161 &self.max_buffer_regions,
162 encoder_,
163 max_buffer_regions,
164 (),
165 )?;
166
167 let mut _field =
168 unsafe { ::fidl_next::Slot::new_unchecked(max_buffer_regions.as_mut_ptr()) };
169
170 Ok(())
171 }
172 }
173
174 unsafe impl<___E>
175 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::SdmmcHostInfo>, ___E>
176 for SdmmcHostInfo
177 where
178 ___E: ::fidl_next::Encoder + ?Sized,
179 SdmmcHostInfo: ::fidl_next::Encode<crate::wire::SdmmcHostInfo, ___E>,
180 {
181 #[inline]
182 fn encode_option(
183 this: ::core::option::Option<Self>,
184 encoder: &mut ___E,
185 out: &mut ::core::mem::MaybeUninit<
186 ::fidl_next::wire::Box<'static, crate::wire::SdmmcHostInfo>,
187 >,
188 _: (),
189 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
190 if let Some(inner) = this {
191 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
192 ::fidl_next::wire::Box::encode_present(out);
193 } else {
194 ::fidl_next::wire::Box::encode_absent(out);
195 }
196
197 Ok(())
198 }
199 }
200
201 unsafe impl<'a, ___E>
202 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::SdmmcHostInfo>, ___E>
203 for &'a SdmmcHostInfo
204 where
205 ___E: ::fidl_next::Encoder + ?Sized,
206 &'a SdmmcHostInfo: ::fidl_next::Encode<crate::wire::SdmmcHostInfo, ___E>,
207 {
208 #[inline]
209 fn encode_option(
210 this: ::core::option::Option<Self>,
211 encoder: &mut ___E,
212 out: &mut ::core::mem::MaybeUninit<
213 ::fidl_next::wire::Box<'static, crate::wire::SdmmcHostInfo>,
214 >,
215 _: (),
216 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
217 if let Some(inner) = this {
218 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
219 ::fidl_next::wire::Box::encode_present(out);
220 } else {
221 ::fidl_next::wire::Box::encode_absent(out);
222 }
223
224 Ok(())
225 }
226 }
227
228 impl ::fidl_next::FromWire<crate::wire::SdmmcHostInfo> for SdmmcHostInfo {
229 #[inline]
230 fn from_wire(wire: crate::wire::SdmmcHostInfo) -> Self {
231 Self {
232 caps: ::fidl_next::FromWire::from_wire(wire.caps),
233
234 max_transfer_size: ::fidl_next::FromWire::from_wire(wire.max_transfer_size),
235
236 max_buffer_regions: ::fidl_next::FromWire::from_wire(wire.max_buffer_regions),
237 }
238 }
239 }
240
241 impl ::fidl_next::FromWireRef<crate::wire::SdmmcHostInfo> for SdmmcHostInfo {
242 #[inline]
243 fn from_wire_ref(wire: &crate::wire::SdmmcHostInfo) -> Self {
244 Self {
245 caps: ::fidl_next::FromWireRef::from_wire_ref(&wire.caps),
246
247 max_transfer_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_transfer_size),
248
249 max_buffer_regions: ::fidl_next::FromWireRef::from_wire_ref(
250 &wire.max_buffer_regions,
251 ),
252 }
253 }
254 }
255
256 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
257 pub struct SdmmcHostInfoResponse {
258 pub info: crate::natural::SdmmcHostInfo,
259 }
260
261 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcHostInfoResponse, ___E>
262 for SdmmcHostInfoResponse
263 where
264 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
265 {
266 #[inline]
267 fn encode(
268 self,
269 encoder_: &mut ___E,
270 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostInfoResponse>,
271 _: (),
272 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
273 ::fidl_next::munge! {
274 let crate::wire::SdmmcHostInfoResponse {
275 info,
276
277 } = out_;
278 }
279
280 ::fidl_next::Encode::encode(self.info, encoder_, info, ())?;
281
282 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(info.as_mut_ptr()) };
283
284 Ok(())
285 }
286 }
287
288 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcHostInfoResponse, ___E>
289 for &'a SdmmcHostInfoResponse
290 where
291 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
292 {
293 #[inline]
294 fn encode(
295 self,
296 encoder_: &mut ___E,
297 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostInfoResponse>,
298 _: (),
299 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
300 ::fidl_next::munge! {
301 let crate::wire::SdmmcHostInfoResponse {
302 info,
303
304 } = out_;
305 }
306
307 ::fidl_next::Encode::encode(&self.info, encoder_, info, ())?;
308
309 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(info.as_mut_ptr()) };
310
311 Ok(())
312 }
313 }
314
315 unsafe impl<___E>
316 ::fidl_next::EncodeOption<
317 ::fidl_next::wire::Box<'static, crate::wire::SdmmcHostInfoResponse>,
318 ___E,
319 > for SdmmcHostInfoResponse
320 where
321 ___E: ::fidl_next::Encoder + ?Sized,
322 SdmmcHostInfoResponse: ::fidl_next::Encode<crate::wire::SdmmcHostInfoResponse, ___E>,
323 {
324 #[inline]
325 fn encode_option(
326 this: ::core::option::Option<Self>,
327 encoder: &mut ___E,
328 out: &mut ::core::mem::MaybeUninit<
329 ::fidl_next::wire::Box<'static, crate::wire::SdmmcHostInfoResponse>,
330 >,
331 _: (),
332 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
333 if let Some(inner) = this {
334 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
335 ::fidl_next::wire::Box::encode_present(out);
336 } else {
337 ::fidl_next::wire::Box::encode_absent(out);
338 }
339
340 Ok(())
341 }
342 }
343
344 unsafe impl<'a, ___E>
345 ::fidl_next::EncodeOption<
346 ::fidl_next::wire::Box<'static, crate::wire::SdmmcHostInfoResponse>,
347 ___E,
348 > for &'a SdmmcHostInfoResponse
349 where
350 ___E: ::fidl_next::Encoder + ?Sized,
351 &'a SdmmcHostInfoResponse: ::fidl_next::Encode<crate::wire::SdmmcHostInfoResponse, ___E>,
352 {
353 #[inline]
354 fn encode_option(
355 this: ::core::option::Option<Self>,
356 encoder: &mut ___E,
357 out: &mut ::core::mem::MaybeUninit<
358 ::fidl_next::wire::Box<'static, crate::wire::SdmmcHostInfoResponse>,
359 >,
360 _: (),
361 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
362 if let Some(inner) = this {
363 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
364 ::fidl_next::wire::Box::encode_present(out);
365 } else {
366 ::fidl_next::wire::Box::encode_absent(out);
367 }
368
369 Ok(())
370 }
371 }
372
373 impl ::fidl_next::FromWire<crate::wire::SdmmcHostInfoResponse> for SdmmcHostInfoResponse {
374 #[inline]
375 fn from_wire(wire: crate::wire::SdmmcHostInfoResponse) -> Self {
376 Self { info: ::fidl_next::FromWire::from_wire(wire.info) }
377 }
378 }
379
380 impl ::fidl_next::FromWireRef<crate::wire::SdmmcHostInfoResponse> for SdmmcHostInfoResponse {
381 #[inline]
382 fn from_wire_ref(wire: &crate::wire::SdmmcHostInfoResponse) -> Self {
383 Self { info: ::fidl_next::FromWireRef::from_wire_ref(&wire.info) }
384 }
385 }
386
387 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
388 #[repr(u8)]
389 pub enum SdmmcVoltage {
390 V330 = 0,
391 V180 = 1,
392 Max = 2,
393 }
394 impl ::core::convert::TryFrom<u8> for SdmmcVoltage {
395 type Error = ::fidl_next::UnknownStrictEnumMemberError;
396 fn try_from(
397 value: u8,
398 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
399 match value {
400 0 => Ok(Self::V330),
401 1 => Ok(Self::V180),
402 2 => Ok(Self::Max),
403
404 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
405 }
406 }
407 }
408
409 impl ::std::convert::From<SdmmcVoltage> for u8 {
410 fn from(value: SdmmcVoltage) -> Self {
411 match value {
412 SdmmcVoltage::V330 => 0,
413 SdmmcVoltage::V180 => 1,
414 SdmmcVoltage::Max => 2,
415 }
416 }
417 }
418
419 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcVoltage, ___E> for SdmmcVoltage
420 where
421 ___E: ?Sized,
422 {
423 #[inline]
424 fn encode(
425 self,
426 encoder: &mut ___E,
427 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcVoltage>,
428 _: (),
429 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
430 ::fidl_next::Encode::encode(&self, encoder, out, ())
431 }
432 }
433
434 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcVoltage, ___E> for &'a SdmmcVoltage
435 where
436 ___E: ?Sized,
437 {
438 #[inline]
439 fn encode(
440 self,
441 encoder: &mut ___E,
442 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcVoltage>,
443 _: (),
444 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
445 ::fidl_next::munge!(let crate::wire::SdmmcVoltage { value } = out);
446 let _ = value.write(u8::from(match *self {
447 SdmmcVoltage::V330 => 0,
448
449 SdmmcVoltage::V180 => 1,
450
451 SdmmcVoltage::Max => 2,
452 }));
453
454 Ok(())
455 }
456 }
457
458 impl ::core::convert::From<crate::wire::SdmmcVoltage> for SdmmcVoltage {
459 fn from(wire: crate::wire::SdmmcVoltage) -> Self {
460 match u8::from(wire.value) {
461 0 => Self::V330,
462
463 1 => Self::V180,
464
465 2 => Self::Max,
466
467 _ => unsafe { ::core::hint::unreachable_unchecked() },
468 }
469 }
470 }
471
472 impl ::fidl_next::FromWire<crate::wire::SdmmcVoltage> for SdmmcVoltage {
473 #[inline]
474 fn from_wire(wire: crate::wire::SdmmcVoltage) -> Self {
475 Self::from(wire)
476 }
477 }
478
479 impl ::fidl_next::FromWireRef<crate::wire::SdmmcVoltage> for SdmmcVoltage {
480 #[inline]
481 fn from_wire_ref(wire: &crate::wire::SdmmcVoltage) -> Self {
482 Self::from(*wire)
483 }
484 }
485
486 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
487 #[repr(C)]
488 pub struct SdmmcSetSignalVoltageRequest {
489 pub voltage: crate::natural::SdmmcVoltage,
490 }
491
492 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcSetSignalVoltageRequest, ___E>
493 for SdmmcSetSignalVoltageRequest
494 where
495 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
496 {
497 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
498 Self,
499 crate::wire::SdmmcSetSignalVoltageRequest,
500 > = unsafe {
501 ::fidl_next::CopyOptimization::enable_if(
502 true && <crate::natural::SdmmcVoltage as ::fidl_next::Encode<
503 crate::wire::SdmmcVoltage,
504 ___E,
505 >>::COPY_OPTIMIZATION
506 .is_enabled(),
507 )
508 };
509
510 #[inline]
511 fn encode(
512 self,
513 encoder_: &mut ___E,
514 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetSignalVoltageRequest>,
515 _: (),
516 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
517 ::fidl_next::munge! {
518 let crate::wire::SdmmcSetSignalVoltageRequest {
519 voltage,
520
521 } = out_;
522 }
523
524 ::fidl_next::Encode::encode(self.voltage, encoder_, voltage, ())?;
525
526 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(voltage.as_mut_ptr()) };
527
528 Ok(())
529 }
530 }
531
532 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcSetSignalVoltageRequest, ___E>
533 for &'a SdmmcSetSignalVoltageRequest
534 where
535 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
536 {
537 #[inline]
538 fn encode(
539 self,
540 encoder_: &mut ___E,
541 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetSignalVoltageRequest>,
542 _: (),
543 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
544 ::fidl_next::munge! {
545 let crate::wire::SdmmcSetSignalVoltageRequest {
546 voltage,
547
548 } = out_;
549 }
550
551 ::fidl_next::Encode::encode(&self.voltage, encoder_, voltage, ())?;
552
553 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(voltage.as_mut_ptr()) };
554
555 Ok(())
556 }
557 }
558
559 unsafe impl<___E>
560 ::fidl_next::EncodeOption<
561 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetSignalVoltageRequest>,
562 ___E,
563 > for SdmmcSetSignalVoltageRequest
564 where
565 ___E: ::fidl_next::Encoder + ?Sized,
566 SdmmcSetSignalVoltageRequest:
567 ::fidl_next::Encode<crate::wire::SdmmcSetSignalVoltageRequest, ___E>,
568 {
569 #[inline]
570 fn encode_option(
571 this: ::core::option::Option<Self>,
572 encoder: &mut ___E,
573 out: &mut ::core::mem::MaybeUninit<
574 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetSignalVoltageRequest>,
575 >,
576 _: (),
577 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
578 if let Some(inner) = this {
579 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
580 ::fidl_next::wire::Box::encode_present(out);
581 } else {
582 ::fidl_next::wire::Box::encode_absent(out);
583 }
584
585 Ok(())
586 }
587 }
588
589 unsafe impl<'a, ___E>
590 ::fidl_next::EncodeOption<
591 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetSignalVoltageRequest>,
592 ___E,
593 > for &'a SdmmcSetSignalVoltageRequest
594 where
595 ___E: ::fidl_next::Encoder + ?Sized,
596 &'a SdmmcSetSignalVoltageRequest:
597 ::fidl_next::Encode<crate::wire::SdmmcSetSignalVoltageRequest, ___E>,
598 {
599 #[inline]
600 fn encode_option(
601 this: ::core::option::Option<Self>,
602 encoder: &mut ___E,
603 out: &mut ::core::mem::MaybeUninit<
604 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetSignalVoltageRequest>,
605 >,
606 _: (),
607 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
608 if let Some(inner) = this {
609 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
610 ::fidl_next::wire::Box::encode_present(out);
611 } else {
612 ::fidl_next::wire::Box::encode_absent(out);
613 }
614
615 Ok(())
616 }
617 }
618
619 impl ::fidl_next::FromWire<crate::wire::SdmmcSetSignalVoltageRequest>
620 for SdmmcSetSignalVoltageRequest
621 {
622 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
623 crate::wire::SdmmcSetSignalVoltageRequest,
624 Self,
625 > = unsafe {
626 ::fidl_next::CopyOptimization::enable_if(
627 true && <crate::natural::SdmmcVoltage as ::fidl_next::FromWire<
628 crate::wire::SdmmcVoltage,
629 >>::COPY_OPTIMIZATION
630 .is_enabled(),
631 )
632 };
633
634 #[inline]
635 fn from_wire(wire: crate::wire::SdmmcSetSignalVoltageRequest) -> Self {
636 Self { voltage: ::fidl_next::FromWire::from_wire(wire.voltage) }
637 }
638 }
639
640 impl ::fidl_next::FromWireRef<crate::wire::SdmmcSetSignalVoltageRequest>
641 for SdmmcSetSignalVoltageRequest
642 {
643 #[inline]
644 fn from_wire_ref(wire: &crate::wire::SdmmcSetSignalVoltageRequest) -> Self {
645 Self { voltage: ::fidl_next::FromWireRef::from_wire_ref(&wire.voltage) }
646 }
647 }
648
649 pub type SdmmcSetSignalVoltageResponse = ();
650
651 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
652 #[repr(u8)]
653 pub enum SdmmcBusWidth {
654 One = 0,
655 Four = 1,
656 Eight = 2,
657 Max = 3,
658 }
659 impl ::core::convert::TryFrom<u8> for SdmmcBusWidth {
660 type Error = ::fidl_next::UnknownStrictEnumMemberError;
661 fn try_from(
662 value: u8,
663 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
664 match value {
665 0 => Ok(Self::One),
666 1 => Ok(Self::Four),
667 2 => Ok(Self::Eight),
668 3 => Ok(Self::Max),
669
670 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
671 }
672 }
673 }
674
675 impl ::std::convert::From<SdmmcBusWidth> for u8 {
676 fn from(value: SdmmcBusWidth) -> Self {
677 match value {
678 SdmmcBusWidth::One => 0,
679 SdmmcBusWidth::Four => 1,
680 SdmmcBusWidth::Eight => 2,
681 SdmmcBusWidth::Max => 3,
682 }
683 }
684 }
685
686 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcBusWidth, ___E> for SdmmcBusWidth
687 where
688 ___E: ?Sized,
689 {
690 #[inline]
691 fn encode(
692 self,
693 encoder: &mut ___E,
694 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcBusWidth>,
695 _: (),
696 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
697 ::fidl_next::Encode::encode(&self, encoder, out, ())
698 }
699 }
700
701 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcBusWidth, ___E> for &'a SdmmcBusWidth
702 where
703 ___E: ?Sized,
704 {
705 #[inline]
706 fn encode(
707 self,
708 encoder: &mut ___E,
709 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcBusWidth>,
710 _: (),
711 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
712 ::fidl_next::munge!(let crate::wire::SdmmcBusWidth { value } = out);
713 let _ = value.write(u8::from(match *self {
714 SdmmcBusWidth::One => 0,
715
716 SdmmcBusWidth::Four => 1,
717
718 SdmmcBusWidth::Eight => 2,
719
720 SdmmcBusWidth::Max => 3,
721 }));
722
723 Ok(())
724 }
725 }
726
727 impl ::core::convert::From<crate::wire::SdmmcBusWidth> for SdmmcBusWidth {
728 fn from(wire: crate::wire::SdmmcBusWidth) -> Self {
729 match u8::from(wire.value) {
730 0 => Self::One,
731
732 1 => Self::Four,
733
734 2 => Self::Eight,
735
736 3 => Self::Max,
737
738 _ => unsafe { ::core::hint::unreachable_unchecked() },
739 }
740 }
741 }
742
743 impl ::fidl_next::FromWire<crate::wire::SdmmcBusWidth> for SdmmcBusWidth {
744 #[inline]
745 fn from_wire(wire: crate::wire::SdmmcBusWidth) -> Self {
746 Self::from(wire)
747 }
748 }
749
750 impl ::fidl_next::FromWireRef<crate::wire::SdmmcBusWidth> for SdmmcBusWidth {
751 #[inline]
752 fn from_wire_ref(wire: &crate::wire::SdmmcBusWidth) -> Self {
753 Self::from(*wire)
754 }
755 }
756
757 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
758 #[repr(C)]
759 pub struct SdmmcSetBusWidthRequest {
760 pub bus_width: crate::natural::SdmmcBusWidth,
761 }
762
763 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcSetBusWidthRequest, ___E>
764 for SdmmcSetBusWidthRequest
765 where
766 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
767 {
768 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
769 Self,
770 crate::wire::SdmmcSetBusWidthRequest,
771 > = unsafe {
772 ::fidl_next::CopyOptimization::enable_if(
773 true && <crate::natural::SdmmcBusWidth as ::fidl_next::Encode<
774 crate::wire::SdmmcBusWidth,
775 ___E,
776 >>::COPY_OPTIMIZATION
777 .is_enabled(),
778 )
779 };
780
781 #[inline]
782 fn encode(
783 self,
784 encoder_: &mut ___E,
785 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetBusWidthRequest>,
786 _: (),
787 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
788 ::fidl_next::munge! {
789 let crate::wire::SdmmcSetBusWidthRequest {
790 bus_width,
791
792 } = out_;
793 }
794
795 ::fidl_next::Encode::encode(self.bus_width, encoder_, bus_width, ())?;
796
797 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bus_width.as_mut_ptr()) };
798
799 Ok(())
800 }
801 }
802
803 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcSetBusWidthRequest, ___E>
804 for &'a SdmmcSetBusWidthRequest
805 where
806 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
807 {
808 #[inline]
809 fn encode(
810 self,
811 encoder_: &mut ___E,
812 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetBusWidthRequest>,
813 _: (),
814 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
815 ::fidl_next::munge! {
816 let crate::wire::SdmmcSetBusWidthRequest {
817 bus_width,
818
819 } = out_;
820 }
821
822 ::fidl_next::Encode::encode(&self.bus_width, encoder_, bus_width, ())?;
823
824 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bus_width.as_mut_ptr()) };
825
826 Ok(())
827 }
828 }
829
830 unsafe impl<___E>
831 ::fidl_next::EncodeOption<
832 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetBusWidthRequest>,
833 ___E,
834 > for SdmmcSetBusWidthRequest
835 where
836 ___E: ::fidl_next::Encoder + ?Sized,
837 SdmmcSetBusWidthRequest: ::fidl_next::Encode<crate::wire::SdmmcSetBusWidthRequest, ___E>,
838 {
839 #[inline]
840 fn encode_option(
841 this: ::core::option::Option<Self>,
842 encoder: &mut ___E,
843 out: &mut ::core::mem::MaybeUninit<
844 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetBusWidthRequest>,
845 >,
846 _: (),
847 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
848 if let Some(inner) = this {
849 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
850 ::fidl_next::wire::Box::encode_present(out);
851 } else {
852 ::fidl_next::wire::Box::encode_absent(out);
853 }
854
855 Ok(())
856 }
857 }
858
859 unsafe impl<'a, ___E>
860 ::fidl_next::EncodeOption<
861 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetBusWidthRequest>,
862 ___E,
863 > for &'a SdmmcSetBusWidthRequest
864 where
865 ___E: ::fidl_next::Encoder + ?Sized,
866 &'a SdmmcSetBusWidthRequest:
867 ::fidl_next::Encode<crate::wire::SdmmcSetBusWidthRequest, ___E>,
868 {
869 #[inline]
870 fn encode_option(
871 this: ::core::option::Option<Self>,
872 encoder: &mut ___E,
873 out: &mut ::core::mem::MaybeUninit<
874 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetBusWidthRequest>,
875 >,
876 _: (),
877 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
878 if let Some(inner) = this {
879 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
880 ::fidl_next::wire::Box::encode_present(out);
881 } else {
882 ::fidl_next::wire::Box::encode_absent(out);
883 }
884
885 Ok(())
886 }
887 }
888
889 impl ::fidl_next::FromWire<crate::wire::SdmmcSetBusWidthRequest> for SdmmcSetBusWidthRequest {
890 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
891 crate::wire::SdmmcSetBusWidthRequest,
892 Self,
893 > = unsafe {
894 ::fidl_next::CopyOptimization::enable_if(
895 true && <crate::natural::SdmmcBusWidth as ::fidl_next::FromWire<
896 crate::wire::SdmmcBusWidth,
897 >>::COPY_OPTIMIZATION
898 .is_enabled(),
899 )
900 };
901
902 #[inline]
903 fn from_wire(wire: crate::wire::SdmmcSetBusWidthRequest) -> Self {
904 Self { bus_width: ::fidl_next::FromWire::from_wire(wire.bus_width) }
905 }
906 }
907
908 impl ::fidl_next::FromWireRef<crate::wire::SdmmcSetBusWidthRequest> for SdmmcSetBusWidthRequest {
909 #[inline]
910 fn from_wire_ref(wire: &crate::wire::SdmmcSetBusWidthRequest) -> Self {
911 Self { bus_width: ::fidl_next::FromWireRef::from_wire_ref(&wire.bus_width) }
912 }
913 }
914
915 pub type SdmmcSetBusWidthResponse = ();
916
917 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
918 #[repr(C)]
919 pub struct SdmmcSetBusFreqRequest {
920 pub bus_freq: u32,
921 }
922
923 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcSetBusFreqRequest, ___E>
924 for SdmmcSetBusFreqRequest
925 where
926 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
927 {
928 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
929 Self,
930 crate::wire::SdmmcSetBusFreqRequest,
931 > = unsafe {
932 ::fidl_next::CopyOptimization::enable_if(
933 true
934
935 && <
936 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
937 >::COPY_OPTIMIZATION.is_enabled()
938
939 )
940 };
941
942 #[inline]
943 fn encode(
944 self,
945 encoder_: &mut ___E,
946 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetBusFreqRequest>,
947 _: (),
948 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
949 ::fidl_next::munge! {
950 let crate::wire::SdmmcSetBusFreqRequest {
951 bus_freq,
952
953 } = out_;
954 }
955
956 ::fidl_next::Encode::encode(self.bus_freq, encoder_, bus_freq, ())?;
957
958 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bus_freq.as_mut_ptr()) };
959
960 Ok(())
961 }
962 }
963
964 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcSetBusFreqRequest, ___E>
965 for &'a SdmmcSetBusFreqRequest
966 where
967 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
968 {
969 #[inline]
970 fn encode(
971 self,
972 encoder_: &mut ___E,
973 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetBusFreqRequest>,
974 _: (),
975 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
976 ::fidl_next::munge! {
977 let crate::wire::SdmmcSetBusFreqRequest {
978 bus_freq,
979
980 } = out_;
981 }
982
983 ::fidl_next::Encode::encode(&self.bus_freq, encoder_, bus_freq, ())?;
984
985 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bus_freq.as_mut_ptr()) };
986
987 Ok(())
988 }
989 }
990
991 unsafe impl<___E>
992 ::fidl_next::EncodeOption<
993 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetBusFreqRequest>,
994 ___E,
995 > for SdmmcSetBusFreqRequest
996 where
997 ___E: ::fidl_next::Encoder + ?Sized,
998 SdmmcSetBusFreqRequest: ::fidl_next::Encode<crate::wire::SdmmcSetBusFreqRequest, ___E>,
999 {
1000 #[inline]
1001 fn encode_option(
1002 this: ::core::option::Option<Self>,
1003 encoder: &mut ___E,
1004 out: &mut ::core::mem::MaybeUninit<
1005 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetBusFreqRequest>,
1006 >,
1007 _: (),
1008 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1009 if let Some(inner) = this {
1010 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1011 ::fidl_next::wire::Box::encode_present(out);
1012 } else {
1013 ::fidl_next::wire::Box::encode_absent(out);
1014 }
1015
1016 Ok(())
1017 }
1018 }
1019
1020 unsafe impl<'a, ___E>
1021 ::fidl_next::EncodeOption<
1022 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetBusFreqRequest>,
1023 ___E,
1024 > for &'a SdmmcSetBusFreqRequest
1025 where
1026 ___E: ::fidl_next::Encoder + ?Sized,
1027 &'a SdmmcSetBusFreqRequest: ::fidl_next::Encode<crate::wire::SdmmcSetBusFreqRequest, ___E>,
1028 {
1029 #[inline]
1030 fn encode_option(
1031 this: ::core::option::Option<Self>,
1032 encoder: &mut ___E,
1033 out: &mut ::core::mem::MaybeUninit<
1034 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetBusFreqRequest>,
1035 >,
1036 _: (),
1037 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1038 if let Some(inner) = this {
1039 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1040 ::fidl_next::wire::Box::encode_present(out);
1041 } else {
1042 ::fidl_next::wire::Box::encode_absent(out);
1043 }
1044
1045 Ok(())
1046 }
1047 }
1048
1049 impl ::fidl_next::FromWire<crate::wire::SdmmcSetBusFreqRequest> for SdmmcSetBusFreqRequest {
1050 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1051 crate::wire::SdmmcSetBusFreqRequest,
1052 Self,
1053 > = unsafe {
1054 ::fidl_next::CopyOptimization::enable_if(
1055 true
1056 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
1057 .is_enabled(),
1058 )
1059 };
1060
1061 #[inline]
1062 fn from_wire(wire: crate::wire::SdmmcSetBusFreqRequest) -> Self {
1063 Self { bus_freq: ::fidl_next::FromWire::from_wire(wire.bus_freq) }
1064 }
1065 }
1066
1067 impl ::fidl_next::FromWireRef<crate::wire::SdmmcSetBusFreqRequest> for SdmmcSetBusFreqRequest {
1068 #[inline]
1069 fn from_wire_ref(wire: &crate::wire::SdmmcSetBusFreqRequest) -> Self {
1070 Self { bus_freq: ::fidl_next::FromWireRef::from_wire_ref(&wire.bus_freq) }
1071 }
1072 }
1073
1074 pub type SdmmcSetBusFreqResponse = ();
1075
1076 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1077 #[repr(u8)]
1078 pub enum SdmmcTiming {
1079 Legacy = 0,
1080 Hs = 1,
1081 Hsddr = 2,
1082 Hs200 = 3,
1083 Hs400 = 4,
1084 Sdr12 = 5,
1085 Sdr25 = 6,
1086 Sdr50 = 7,
1087 Sdr104 = 8,
1088 Ddr50 = 9,
1089 Hs400EnhancedStrobe = 10,
1090 Max = 11,
1091 }
1092 impl ::core::convert::TryFrom<u8> for SdmmcTiming {
1093 type Error = ::fidl_next::UnknownStrictEnumMemberError;
1094 fn try_from(
1095 value: u8,
1096 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
1097 match value {
1098 0 => Ok(Self::Legacy),
1099 1 => Ok(Self::Hs),
1100 2 => Ok(Self::Hsddr),
1101 3 => Ok(Self::Hs200),
1102 4 => Ok(Self::Hs400),
1103 5 => Ok(Self::Sdr12),
1104 6 => Ok(Self::Sdr25),
1105 7 => Ok(Self::Sdr50),
1106 8 => Ok(Self::Sdr104),
1107 9 => Ok(Self::Ddr50),
1108 10 => Ok(Self::Hs400EnhancedStrobe),
1109 11 => Ok(Self::Max),
1110
1111 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
1112 }
1113 }
1114 }
1115
1116 impl ::std::convert::From<SdmmcTiming> for u8 {
1117 fn from(value: SdmmcTiming) -> Self {
1118 match value {
1119 SdmmcTiming::Legacy => 0,
1120 SdmmcTiming::Hs => 1,
1121 SdmmcTiming::Hsddr => 2,
1122 SdmmcTiming::Hs200 => 3,
1123 SdmmcTiming::Hs400 => 4,
1124 SdmmcTiming::Sdr12 => 5,
1125 SdmmcTiming::Sdr25 => 6,
1126 SdmmcTiming::Sdr50 => 7,
1127 SdmmcTiming::Sdr104 => 8,
1128 SdmmcTiming::Ddr50 => 9,
1129 SdmmcTiming::Hs400EnhancedStrobe => 10,
1130 SdmmcTiming::Max => 11,
1131 }
1132 }
1133 }
1134
1135 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcTiming, ___E> for SdmmcTiming
1136 where
1137 ___E: ?Sized,
1138 {
1139 #[inline]
1140 fn encode(
1141 self,
1142 encoder: &mut ___E,
1143 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcTiming>,
1144 _: (),
1145 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1146 ::fidl_next::Encode::encode(&self, encoder, out, ())
1147 }
1148 }
1149
1150 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcTiming, ___E> for &'a SdmmcTiming
1151 where
1152 ___E: ?Sized,
1153 {
1154 #[inline]
1155 fn encode(
1156 self,
1157 encoder: &mut ___E,
1158 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcTiming>,
1159 _: (),
1160 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1161 ::fidl_next::munge!(let crate::wire::SdmmcTiming { value } = out);
1162 let _ = value.write(u8::from(match *self {
1163 SdmmcTiming::Legacy => 0,
1164
1165 SdmmcTiming::Hs => 1,
1166
1167 SdmmcTiming::Hsddr => 2,
1168
1169 SdmmcTiming::Hs200 => 3,
1170
1171 SdmmcTiming::Hs400 => 4,
1172
1173 SdmmcTiming::Sdr12 => 5,
1174
1175 SdmmcTiming::Sdr25 => 6,
1176
1177 SdmmcTiming::Sdr50 => 7,
1178
1179 SdmmcTiming::Sdr104 => 8,
1180
1181 SdmmcTiming::Ddr50 => 9,
1182
1183 SdmmcTiming::Hs400EnhancedStrobe => 10,
1184
1185 SdmmcTiming::Max => 11,
1186 }));
1187
1188 Ok(())
1189 }
1190 }
1191
1192 impl ::core::convert::From<crate::wire::SdmmcTiming> for SdmmcTiming {
1193 fn from(wire: crate::wire::SdmmcTiming) -> Self {
1194 match u8::from(wire.value) {
1195 0 => Self::Legacy,
1196
1197 1 => Self::Hs,
1198
1199 2 => Self::Hsddr,
1200
1201 3 => Self::Hs200,
1202
1203 4 => Self::Hs400,
1204
1205 5 => Self::Sdr12,
1206
1207 6 => Self::Sdr25,
1208
1209 7 => Self::Sdr50,
1210
1211 8 => Self::Sdr104,
1212
1213 9 => Self::Ddr50,
1214
1215 10 => Self::Hs400EnhancedStrobe,
1216
1217 11 => Self::Max,
1218
1219 _ => unsafe { ::core::hint::unreachable_unchecked() },
1220 }
1221 }
1222 }
1223
1224 impl ::fidl_next::FromWire<crate::wire::SdmmcTiming> for SdmmcTiming {
1225 #[inline]
1226 fn from_wire(wire: crate::wire::SdmmcTiming) -> Self {
1227 Self::from(wire)
1228 }
1229 }
1230
1231 impl ::fidl_next::FromWireRef<crate::wire::SdmmcTiming> for SdmmcTiming {
1232 #[inline]
1233 fn from_wire_ref(wire: &crate::wire::SdmmcTiming) -> Self {
1234 Self::from(*wire)
1235 }
1236 }
1237
1238 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1239 #[repr(C)]
1240 pub struct SdmmcSetTimingRequest {
1241 pub timing: crate::natural::SdmmcTiming,
1242 }
1243
1244 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcSetTimingRequest, ___E>
1245 for SdmmcSetTimingRequest
1246 where
1247 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1248 {
1249 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1250 Self,
1251 crate::wire::SdmmcSetTimingRequest,
1252 > = unsafe {
1253 ::fidl_next::CopyOptimization::enable_if(
1254 true && <crate::natural::SdmmcTiming as ::fidl_next::Encode<
1255 crate::wire::SdmmcTiming,
1256 ___E,
1257 >>::COPY_OPTIMIZATION
1258 .is_enabled(),
1259 )
1260 };
1261
1262 #[inline]
1263 fn encode(
1264 self,
1265 encoder_: &mut ___E,
1266 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetTimingRequest>,
1267 _: (),
1268 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1269 ::fidl_next::munge! {
1270 let crate::wire::SdmmcSetTimingRequest {
1271 timing,
1272
1273 } = out_;
1274 }
1275
1276 ::fidl_next::Encode::encode(self.timing, encoder_, timing, ())?;
1277
1278 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(timing.as_mut_ptr()) };
1279
1280 Ok(())
1281 }
1282 }
1283
1284 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcSetTimingRequest, ___E>
1285 for &'a SdmmcSetTimingRequest
1286 where
1287 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1288 {
1289 #[inline]
1290 fn encode(
1291 self,
1292 encoder_: &mut ___E,
1293 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetTimingRequest>,
1294 _: (),
1295 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1296 ::fidl_next::munge! {
1297 let crate::wire::SdmmcSetTimingRequest {
1298 timing,
1299
1300 } = out_;
1301 }
1302
1303 ::fidl_next::Encode::encode(&self.timing, encoder_, timing, ())?;
1304
1305 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(timing.as_mut_ptr()) };
1306
1307 Ok(())
1308 }
1309 }
1310
1311 unsafe impl<___E>
1312 ::fidl_next::EncodeOption<
1313 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetTimingRequest>,
1314 ___E,
1315 > for SdmmcSetTimingRequest
1316 where
1317 ___E: ::fidl_next::Encoder + ?Sized,
1318 SdmmcSetTimingRequest: ::fidl_next::Encode<crate::wire::SdmmcSetTimingRequest, ___E>,
1319 {
1320 #[inline]
1321 fn encode_option(
1322 this: ::core::option::Option<Self>,
1323 encoder: &mut ___E,
1324 out: &mut ::core::mem::MaybeUninit<
1325 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetTimingRequest>,
1326 >,
1327 _: (),
1328 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1329 if let Some(inner) = this {
1330 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1331 ::fidl_next::wire::Box::encode_present(out);
1332 } else {
1333 ::fidl_next::wire::Box::encode_absent(out);
1334 }
1335
1336 Ok(())
1337 }
1338 }
1339
1340 unsafe impl<'a, ___E>
1341 ::fidl_next::EncodeOption<
1342 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetTimingRequest>,
1343 ___E,
1344 > for &'a SdmmcSetTimingRequest
1345 where
1346 ___E: ::fidl_next::Encoder + ?Sized,
1347 &'a SdmmcSetTimingRequest: ::fidl_next::Encode<crate::wire::SdmmcSetTimingRequest, ___E>,
1348 {
1349 #[inline]
1350 fn encode_option(
1351 this: ::core::option::Option<Self>,
1352 encoder: &mut ___E,
1353 out: &mut ::core::mem::MaybeUninit<
1354 ::fidl_next::wire::Box<'static, crate::wire::SdmmcSetTimingRequest>,
1355 >,
1356 _: (),
1357 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1358 if let Some(inner) = this {
1359 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1360 ::fidl_next::wire::Box::encode_present(out);
1361 } else {
1362 ::fidl_next::wire::Box::encode_absent(out);
1363 }
1364
1365 Ok(())
1366 }
1367 }
1368
1369 impl ::fidl_next::FromWire<crate::wire::SdmmcSetTimingRequest> for SdmmcSetTimingRequest {
1370 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1371 crate::wire::SdmmcSetTimingRequest,
1372 Self,
1373 > = unsafe {
1374 ::fidl_next::CopyOptimization::enable_if(
1375 true && <crate::natural::SdmmcTiming as ::fidl_next::FromWire<
1376 crate::wire::SdmmcTiming,
1377 >>::COPY_OPTIMIZATION
1378 .is_enabled(),
1379 )
1380 };
1381
1382 #[inline]
1383 fn from_wire(wire: crate::wire::SdmmcSetTimingRequest) -> Self {
1384 Self { timing: ::fidl_next::FromWire::from_wire(wire.timing) }
1385 }
1386 }
1387
1388 impl ::fidl_next::FromWireRef<crate::wire::SdmmcSetTimingRequest> for SdmmcSetTimingRequest {
1389 #[inline]
1390 fn from_wire_ref(wire: &crate::wire::SdmmcSetTimingRequest) -> Self {
1391 Self { timing: ::fidl_next::FromWireRef::from_wire_ref(&wire.timing) }
1392 }
1393 }
1394
1395 pub type SdmmcSetTimingResponse = ();
1396
1397 pub type SdmmcHwResetResponse = ();
1398
1399 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1400 #[repr(C)]
1401 pub struct SdmmcPerformTuningRequest {
1402 pub cmd_idx: u32,
1403 }
1404
1405 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcPerformTuningRequest, ___E>
1406 for SdmmcPerformTuningRequest
1407 where
1408 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1409 {
1410 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1411 Self,
1412 crate::wire::SdmmcPerformTuningRequest,
1413 > = unsafe {
1414 ::fidl_next::CopyOptimization::enable_if(
1415 true
1416
1417 && <
1418 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
1419 >::COPY_OPTIMIZATION.is_enabled()
1420
1421 )
1422 };
1423
1424 #[inline]
1425 fn encode(
1426 self,
1427 encoder_: &mut ___E,
1428 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcPerformTuningRequest>,
1429 _: (),
1430 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1431 ::fidl_next::munge! {
1432 let crate::wire::SdmmcPerformTuningRequest {
1433 cmd_idx,
1434
1435 } = out_;
1436 }
1437
1438 ::fidl_next::Encode::encode(self.cmd_idx, encoder_, cmd_idx, ())?;
1439
1440 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(cmd_idx.as_mut_ptr()) };
1441
1442 Ok(())
1443 }
1444 }
1445
1446 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcPerformTuningRequest, ___E>
1447 for &'a SdmmcPerformTuningRequest
1448 where
1449 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1450 {
1451 #[inline]
1452 fn encode(
1453 self,
1454 encoder_: &mut ___E,
1455 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcPerformTuningRequest>,
1456 _: (),
1457 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1458 ::fidl_next::munge! {
1459 let crate::wire::SdmmcPerformTuningRequest {
1460 cmd_idx,
1461
1462 } = out_;
1463 }
1464
1465 ::fidl_next::Encode::encode(&self.cmd_idx, encoder_, cmd_idx, ())?;
1466
1467 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(cmd_idx.as_mut_ptr()) };
1468
1469 Ok(())
1470 }
1471 }
1472
1473 unsafe impl<___E>
1474 ::fidl_next::EncodeOption<
1475 ::fidl_next::wire::Box<'static, crate::wire::SdmmcPerformTuningRequest>,
1476 ___E,
1477 > for SdmmcPerformTuningRequest
1478 where
1479 ___E: ::fidl_next::Encoder + ?Sized,
1480 SdmmcPerformTuningRequest:
1481 ::fidl_next::Encode<crate::wire::SdmmcPerformTuningRequest, ___E>,
1482 {
1483 #[inline]
1484 fn encode_option(
1485 this: ::core::option::Option<Self>,
1486 encoder: &mut ___E,
1487 out: &mut ::core::mem::MaybeUninit<
1488 ::fidl_next::wire::Box<'static, crate::wire::SdmmcPerformTuningRequest>,
1489 >,
1490 _: (),
1491 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1492 if let Some(inner) = this {
1493 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1494 ::fidl_next::wire::Box::encode_present(out);
1495 } else {
1496 ::fidl_next::wire::Box::encode_absent(out);
1497 }
1498
1499 Ok(())
1500 }
1501 }
1502
1503 unsafe impl<'a, ___E>
1504 ::fidl_next::EncodeOption<
1505 ::fidl_next::wire::Box<'static, crate::wire::SdmmcPerformTuningRequest>,
1506 ___E,
1507 > for &'a SdmmcPerformTuningRequest
1508 where
1509 ___E: ::fidl_next::Encoder + ?Sized,
1510 &'a SdmmcPerformTuningRequest:
1511 ::fidl_next::Encode<crate::wire::SdmmcPerformTuningRequest, ___E>,
1512 {
1513 #[inline]
1514 fn encode_option(
1515 this: ::core::option::Option<Self>,
1516 encoder: &mut ___E,
1517 out: &mut ::core::mem::MaybeUninit<
1518 ::fidl_next::wire::Box<'static, crate::wire::SdmmcPerformTuningRequest>,
1519 >,
1520 _: (),
1521 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1522 if let Some(inner) = this {
1523 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1524 ::fidl_next::wire::Box::encode_present(out);
1525 } else {
1526 ::fidl_next::wire::Box::encode_absent(out);
1527 }
1528
1529 Ok(())
1530 }
1531 }
1532
1533 impl ::fidl_next::FromWire<crate::wire::SdmmcPerformTuningRequest> for SdmmcPerformTuningRequest {
1534 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1535 crate::wire::SdmmcPerformTuningRequest,
1536 Self,
1537 > = unsafe {
1538 ::fidl_next::CopyOptimization::enable_if(
1539 true
1540 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
1541 .is_enabled(),
1542 )
1543 };
1544
1545 #[inline]
1546 fn from_wire(wire: crate::wire::SdmmcPerformTuningRequest) -> Self {
1547 Self { cmd_idx: ::fidl_next::FromWire::from_wire(wire.cmd_idx) }
1548 }
1549 }
1550
1551 impl ::fidl_next::FromWireRef<crate::wire::SdmmcPerformTuningRequest>
1552 for SdmmcPerformTuningRequest
1553 {
1554 #[inline]
1555 fn from_wire_ref(wire: &crate::wire::SdmmcPerformTuningRequest) -> Self {
1556 Self { cmd_idx: ::fidl_next::FromWireRef::from_wire_ref(&wire.cmd_idx) }
1557 }
1558 }
1559
1560 pub type SdmmcPerformTuningResponse = ();
1561
1562 pub type SdmmcRegisterInBandInterruptResponse = ();
1563
1564 ::fidl_next::bitflags::bitflags! {
1565 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct SdmmcVmoRight: u32 {
1566 const READ = 1;
1567 const WRITE = 2;
1568
1569 }
1570 }
1571
1572 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcVmoRight, ___E> for SdmmcVmoRight
1573 where
1574 ___E: ?Sized,
1575 {
1576 #[inline]
1577 fn encode(
1578 self,
1579 encoder: &mut ___E,
1580 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcVmoRight>,
1581 _: (),
1582 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1583 ::fidl_next::Encode::encode(&self, encoder, out, ())
1584 }
1585 }
1586
1587 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcVmoRight, ___E> for &'a SdmmcVmoRight
1588 where
1589 ___E: ?Sized,
1590 {
1591 #[inline]
1592 fn encode(
1593 self,
1594 _: &mut ___E,
1595 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcVmoRight>,
1596 _: (),
1597 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1598 ::fidl_next::munge!(let crate::wire::SdmmcVmoRight { value } = out);
1599
1600 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
1601 return Err(::fidl_next::EncodeError::InvalidStrictBits);
1602 }
1603
1604 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
1605 Ok(())
1606 }
1607 }
1608
1609 impl ::core::convert::From<crate::wire::SdmmcVmoRight> for SdmmcVmoRight {
1610 fn from(wire: crate::wire::SdmmcVmoRight) -> Self {
1611 Self::from_bits_retain(u32::from(wire.value))
1612 }
1613 }
1614
1615 impl ::fidl_next::FromWire<crate::wire::SdmmcVmoRight> for SdmmcVmoRight {
1616 #[inline]
1617 fn from_wire(wire: crate::wire::SdmmcVmoRight) -> Self {
1618 Self::from(wire)
1619 }
1620 }
1621
1622 impl ::fidl_next::FromWireRef<crate::wire::SdmmcVmoRight> for SdmmcVmoRight {
1623 #[inline]
1624 fn from_wire_ref(wire: &crate::wire::SdmmcVmoRight) -> Self {
1625 Self::from(*wire)
1626 }
1627 }
1628
1629 pub type SdmmcRegisterVmoResponse = ();
1630
1631 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1632 pub struct SdmmcUnregisterVmoRequest {
1633 pub vmo_id: u32,
1634
1635 pub client_id: u8,
1636 }
1637
1638 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcUnregisterVmoRequest, ___E>
1639 for SdmmcUnregisterVmoRequest
1640 where
1641 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1642 {
1643 #[inline]
1644 fn encode(
1645 self,
1646 encoder_: &mut ___E,
1647 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcUnregisterVmoRequest>,
1648 _: (),
1649 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1650 ::fidl_next::munge! {
1651 let crate::wire::SdmmcUnregisterVmoRequest {
1652 vmo_id,
1653 client_id,
1654
1655 } = out_;
1656 }
1657
1658 ::fidl_next::Encode::encode(self.vmo_id, encoder_, vmo_id, ())?;
1659
1660 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(vmo_id.as_mut_ptr()) };
1661
1662 ::fidl_next::Encode::encode(self.client_id, encoder_, client_id, ())?;
1663
1664 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(client_id.as_mut_ptr()) };
1665
1666 Ok(())
1667 }
1668 }
1669
1670 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcUnregisterVmoRequest, ___E>
1671 for &'a SdmmcUnregisterVmoRequest
1672 where
1673 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1674 {
1675 #[inline]
1676 fn encode(
1677 self,
1678 encoder_: &mut ___E,
1679 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcUnregisterVmoRequest>,
1680 _: (),
1681 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1682 ::fidl_next::munge! {
1683 let crate::wire::SdmmcUnregisterVmoRequest {
1684 vmo_id,
1685 client_id,
1686
1687 } = out_;
1688 }
1689
1690 ::fidl_next::Encode::encode(&self.vmo_id, encoder_, vmo_id, ())?;
1691
1692 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(vmo_id.as_mut_ptr()) };
1693
1694 ::fidl_next::Encode::encode(&self.client_id, encoder_, client_id, ())?;
1695
1696 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(client_id.as_mut_ptr()) };
1697
1698 Ok(())
1699 }
1700 }
1701
1702 unsafe impl<___E>
1703 ::fidl_next::EncodeOption<
1704 ::fidl_next::wire::Box<'static, crate::wire::SdmmcUnregisterVmoRequest>,
1705 ___E,
1706 > for SdmmcUnregisterVmoRequest
1707 where
1708 ___E: ::fidl_next::Encoder + ?Sized,
1709 SdmmcUnregisterVmoRequest:
1710 ::fidl_next::Encode<crate::wire::SdmmcUnregisterVmoRequest, ___E>,
1711 {
1712 #[inline]
1713 fn encode_option(
1714 this: ::core::option::Option<Self>,
1715 encoder: &mut ___E,
1716 out: &mut ::core::mem::MaybeUninit<
1717 ::fidl_next::wire::Box<'static, crate::wire::SdmmcUnregisterVmoRequest>,
1718 >,
1719 _: (),
1720 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1721 if let Some(inner) = this {
1722 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1723 ::fidl_next::wire::Box::encode_present(out);
1724 } else {
1725 ::fidl_next::wire::Box::encode_absent(out);
1726 }
1727
1728 Ok(())
1729 }
1730 }
1731
1732 unsafe impl<'a, ___E>
1733 ::fidl_next::EncodeOption<
1734 ::fidl_next::wire::Box<'static, crate::wire::SdmmcUnregisterVmoRequest>,
1735 ___E,
1736 > for &'a SdmmcUnregisterVmoRequest
1737 where
1738 ___E: ::fidl_next::Encoder + ?Sized,
1739 &'a SdmmcUnregisterVmoRequest:
1740 ::fidl_next::Encode<crate::wire::SdmmcUnregisterVmoRequest, ___E>,
1741 {
1742 #[inline]
1743 fn encode_option(
1744 this: ::core::option::Option<Self>,
1745 encoder: &mut ___E,
1746 out: &mut ::core::mem::MaybeUninit<
1747 ::fidl_next::wire::Box<'static, crate::wire::SdmmcUnregisterVmoRequest>,
1748 >,
1749 _: (),
1750 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1751 if let Some(inner) = this {
1752 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1753 ::fidl_next::wire::Box::encode_present(out);
1754 } else {
1755 ::fidl_next::wire::Box::encode_absent(out);
1756 }
1757
1758 Ok(())
1759 }
1760 }
1761
1762 impl ::fidl_next::FromWire<crate::wire::SdmmcUnregisterVmoRequest> for SdmmcUnregisterVmoRequest {
1763 #[inline]
1764 fn from_wire(wire: crate::wire::SdmmcUnregisterVmoRequest) -> Self {
1765 Self {
1766 vmo_id: ::fidl_next::FromWire::from_wire(wire.vmo_id),
1767
1768 client_id: ::fidl_next::FromWire::from_wire(wire.client_id),
1769 }
1770 }
1771 }
1772
1773 impl ::fidl_next::FromWireRef<crate::wire::SdmmcUnregisterVmoRequest>
1774 for SdmmcUnregisterVmoRequest
1775 {
1776 #[inline]
1777 fn from_wire_ref(wire: &crate::wire::SdmmcUnregisterVmoRequest) -> Self {
1778 Self {
1779 vmo_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.vmo_id),
1780
1781 client_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.client_id),
1782 }
1783 }
1784 }
1785
1786 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1787 #[repr(C)]
1788 pub struct SdmmcRequestResponse {
1789 pub response: [u32; 4],
1790 }
1791
1792 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcRequestResponse, ___E>
1793 for SdmmcRequestResponse
1794 where
1795 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1796 {
1797 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1798 Self,
1799 crate::wire::SdmmcRequestResponse,
1800 > = unsafe {
1801 ::fidl_next::CopyOptimization::enable_if(
1802 true
1803
1804 && <
1805 [u32; 4] as ::fidl_next::Encode<[::fidl_next::wire::Uint32; 4], ___E>
1806 >::COPY_OPTIMIZATION.is_enabled()
1807
1808 )
1809 };
1810
1811 #[inline]
1812 fn encode(
1813 self,
1814 encoder_: &mut ___E,
1815 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcRequestResponse>,
1816 _: (),
1817 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1818 ::fidl_next::munge! {
1819 let crate::wire::SdmmcRequestResponse {
1820 response,
1821
1822 } = out_;
1823 }
1824
1825 ::fidl_next::Encode::encode(self.response, encoder_, response, ())?;
1826
1827 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
1828
1829 Ok(())
1830 }
1831 }
1832
1833 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcRequestResponse, ___E>
1834 for &'a SdmmcRequestResponse
1835 where
1836 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1837 {
1838 #[inline]
1839 fn encode(
1840 self,
1841 encoder_: &mut ___E,
1842 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcRequestResponse>,
1843 _: (),
1844 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1845 ::fidl_next::munge! {
1846 let crate::wire::SdmmcRequestResponse {
1847 response,
1848
1849 } = out_;
1850 }
1851
1852 ::fidl_next::Encode::encode(&self.response, encoder_, response, ())?;
1853
1854 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
1855
1856 Ok(())
1857 }
1858 }
1859
1860 unsafe impl<___E>
1861 ::fidl_next::EncodeOption<
1862 ::fidl_next::wire::Box<'static, crate::wire::SdmmcRequestResponse>,
1863 ___E,
1864 > for SdmmcRequestResponse
1865 where
1866 ___E: ::fidl_next::Encoder + ?Sized,
1867 SdmmcRequestResponse: ::fidl_next::Encode<crate::wire::SdmmcRequestResponse, ___E>,
1868 {
1869 #[inline]
1870 fn encode_option(
1871 this: ::core::option::Option<Self>,
1872 encoder: &mut ___E,
1873 out: &mut ::core::mem::MaybeUninit<
1874 ::fidl_next::wire::Box<'static, crate::wire::SdmmcRequestResponse>,
1875 >,
1876 _: (),
1877 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1878 if let Some(inner) = this {
1879 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1880 ::fidl_next::wire::Box::encode_present(out);
1881 } else {
1882 ::fidl_next::wire::Box::encode_absent(out);
1883 }
1884
1885 Ok(())
1886 }
1887 }
1888
1889 unsafe impl<'a, ___E>
1890 ::fidl_next::EncodeOption<
1891 ::fidl_next::wire::Box<'static, crate::wire::SdmmcRequestResponse>,
1892 ___E,
1893 > for &'a SdmmcRequestResponse
1894 where
1895 ___E: ::fidl_next::Encoder + ?Sized,
1896 &'a SdmmcRequestResponse: ::fidl_next::Encode<crate::wire::SdmmcRequestResponse, ___E>,
1897 {
1898 #[inline]
1899 fn encode_option(
1900 this: ::core::option::Option<Self>,
1901 encoder: &mut ___E,
1902 out: &mut ::core::mem::MaybeUninit<
1903 ::fidl_next::wire::Box<'static, crate::wire::SdmmcRequestResponse>,
1904 >,
1905 _: (),
1906 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1907 if let Some(inner) = this {
1908 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1909 ::fidl_next::wire::Box::encode_present(out);
1910 } else {
1911 ::fidl_next::wire::Box::encode_absent(out);
1912 }
1913
1914 Ok(())
1915 }
1916 }
1917
1918 impl ::fidl_next::FromWire<crate::wire::SdmmcRequestResponse> for SdmmcRequestResponse {
1919 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1920 crate::wire::SdmmcRequestResponse,
1921 Self,
1922 > = unsafe {
1923 ::fidl_next::CopyOptimization::enable_if(
1924 true
1925
1926 && <
1927 [u32; 4] as ::fidl_next::FromWire<[::fidl_next::wire::Uint32; 4]>
1928 >::COPY_OPTIMIZATION.is_enabled()
1929
1930 )
1931 };
1932
1933 #[inline]
1934 fn from_wire(wire: crate::wire::SdmmcRequestResponse) -> Self {
1935 Self { response: ::fidl_next::FromWire::from_wire(wire.response) }
1936 }
1937 }
1938
1939 impl ::fidl_next::FromWireRef<crate::wire::SdmmcRequestResponse> for SdmmcRequestResponse {
1940 #[inline]
1941 fn from_wire_ref(wire: &crate::wire::SdmmcRequestResponse) -> Self {
1942 Self { response: ::fidl_next::FromWireRef::from_wire_ref(&wire.response) }
1943 }
1944 }
1945
1946 ::fidl_next::bitflags::bitflags! {
1947 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct SdmmcHostPrefs: u64 {
1948 const DISABLE_HS400 = 1;
1949 const DISABLE_HS200 = 2;
1950 const DISABLE_HSDDR = 4;
1951
1952 }
1953 }
1954
1955 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcHostPrefs, ___E> for SdmmcHostPrefs
1956 where
1957 ___E: ?Sized,
1958 {
1959 #[inline]
1960 fn encode(
1961 self,
1962 encoder: &mut ___E,
1963 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostPrefs>,
1964 _: (),
1965 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1966 ::fidl_next::Encode::encode(&self, encoder, out, ())
1967 }
1968 }
1969
1970 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcHostPrefs, ___E> for &'a SdmmcHostPrefs
1971 where
1972 ___E: ?Sized,
1973 {
1974 #[inline]
1975 fn encode(
1976 self,
1977 _: &mut ___E,
1978 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostPrefs>,
1979 _: (),
1980 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1981 ::fidl_next::munge!(let crate::wire::SdmmcHostPrefs { value } = out);
1982
1983 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
1984 return Err(::fidl_next::EncodeError::InvalidStrictBits);
1985 }
1986
1987 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
1988 Ok(())
1989 }
1990 }
1991
1992 impl ::core::convert::From<crate::wire::SdmmcHostPrefs> for SdmmcHostPrefs {
1993 fn from(wire: crate::wire::SdmmcHostPrefs) -> Self {
1994 Self::from_bits_retain(u64::from(wire.value))
1995 }
1996 }
1997
1998 impl ::fidl_next::FromWire<crate::wire::SdmmcHostPrefs> for SdmmcHostPrefs {
1999 #[inline]
2000 fn from_wire(wire: crate::wire::SdmmcHostPrefs) -> Self {
2001 Self::from(wire)
2002 }
2003 }
2004
2005 impl ::fidl_next::FromWireRef<crate::wire::SdmmcHostPrefs> for SdmmcHostPrefs {
2006 #[inline]
2007 fn from_wire_ref(wire: &crate::wire::SdmmcHostPrefs) -> Self {
2008 Self::from(*wire)
2009 }
2010 }
2011
2012 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2013 pub struct SdmmcMetadata {
2014 pub max_frequency: ::core::option::Option<u32>,
2015
2016 pub speed_capabilities: ::core::option::Option<crate::natural::SdmmcHostPrefs>,
2017
2018 pub enable_cache: ::core::option::Option<bool>,
2019
2020 pub removable: ::core::option::Option<bool>,
2021
2022 pub max_command_packing: ::core::option::Option<u32>,
2023
2024 pub use_fidl: ::core::option::Option<bool>,
2025
2026 pub instance_identifier: ::core::option::Option<::std::string::String>,
2027
2028 pub vccq_off_with_controller_off: ::core::option::Option<bool>,
2029 }
2030
2031 impl SdmmcMetadata {
2032 fn __max_ordinal(&self) -> usize {
2033 if self.vccq_off_with_controller_off.is_some() {
2034 return 8;
2035 }
2036
2037 if self.instance_identifier.is_some() {
2038 return 7;
2039 }
2040
2041 if self.use_fidl.is_some() {
2042 return 6;
2043 }
2044
2045 if self.max_command_packing.is_some() {
2046 return 5;
2047 }
2048
2049 if self.removable.is_some() {
2050 return 4;
2051 }
2052
2053 if self.enable_cache.is_some() {
2054 return 3;
2055 }
2056
2057 if self.speed_capabilities.is_some() {
2058 return 2;
2059 }
2060
2061 if self.max_frequency.is_some() {
2062 return 1;
2063 }
2064
2065 0
2066 }
2067 }
2068
2069 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SdmmcMetadata<'static>, ___E> for SdmmcMetadata
2070 where
2071 ___E: ::fidl_next::Encoder + ?Sized,
2072 {
2073 #[inline]
2074 fn encode(
2075 mut self,
2076 encoder: &mut ___E,
2077 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcMetadata<'static>>,
2078 _: (),
2079 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2080 ::fidl_next::munge!(let crate::wire::SdmmcMetadata { table } = out);
2081
2082 let max_ord = self.__max_ordinal();
2083
2084 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2085 ::fidl_next::Wire::zero_padding(&mut out);
2086
2087 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2088 ::fidl_next::wire::Envelope,
2089 >(encoder, max_ord);
2090
2091 for i in 1..=max_ord {
2092 match i {
2093 8 => {
2094 if let Some(value) = self.vccq_off_with_controller_off.take() {
2095 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2096 value,
2097 preallocated.encoder,
2098 &mut out,
2099 (),
2100 )?;
2101 } else {
2102 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2103 }
2104 }
2105
2106 7 => {
2107 if let Some(value) = self.instance_identifier.take() {
2108 ::fidl_next::wire::Envelope::encode_value::<
2109 ::fidl_next::wire::String<'static>,
2110 ___E,
2111 >(
2112 value, preallocated.encoder, &mut out, 64
2113 )?;
2114 } else {
2115 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2116 }
2117 }
2118
2119 6 => {
2120 if let Some(value) = self.use_fidl.take() {
2121 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2122 value,
2123 preallocated.encoder,
2124 &mut out,
2125 (),
2126 )?;
2127 } else {
2128 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2129 }
2130 }
2131
2132 5 => {
2133 if let Some(value) = self.max_command_packing.take() {
2134 ::fidl_next::wire::Envelope::encode_value::<
2135 ::fidl_next::wire::Uint32,
2136 ___E,
2137 >(
2138 value, preallocated.encoder, &mut out, ()
2139 )?;
2140 } else {
2141 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2142 }
2143 }
2144
2145 4 => {
2146 if let Some(value) = self.removable.take() {
2147 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2148 value,
2149 preallocated.encoder,
2150 &mut out,
2151 (),
2152 )?;
2153 } else {
2154 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2155 }
2156 }
2157
2158 3 => {
2159 if let Some(value) = self.enable_cache.take() {
2160 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2161 value,
2162 preallocated.encoder,
2163 &mut out,
2164 (),
2165 )?;
2166 } else {
2167 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2168 }
2169 }
2170
2171 2 => {
2172 if let Some(value) = self.speed_capabilities.take() {
2173 ::fidl_next::wire::Envelope::encode_value::<
2174 crate::wire::SdmmcHostPrefs,
2175 ___E,
2176 >(
2177 value, preallocated.encoder, &mut out, ()
2178 )?;
2179 } else {
2180 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2181 }
2182 }
2183
2184 1 => {
2185 if let Some(value) = self.max_frequency.take() {
2186 ::fidl_next::wire::Envelope::encode_value::<
2187 ::fidl_next::wire::Uint32,
2188 ___E,
2189 >(
2190 value, preallocated.encoder, &mut out, ()
2191 )?;
2192 } else {
2193 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2194 }
2195 }
2196
2197 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2198 }
2199 unsafe {
2200 preallocated.write_next(out.assume_init_ref());
2201 }
2202 }
2203
2204 ::fidl_next::wire::Table::encode_len(table, max_ord);
2205
2206 Ok(())
2207 }
2208 }
2209
2210 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SdmmcMetadata<'static>, ___E>
2211 for &'a SdmmcMetadata
2212 where
2213 ___E: ::fidl_next::Encoder + ?Sized,
2214 {
2215 #[inline]
2216 fn encode(
2217 self,
2218 encoder: &mut ___E,
2219 out: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcMetadata<'static>>,
2220 _: (),
2221 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2222 ::fidl_next::munge!(let crate::wire::SdmmcMetadata { table } = out);
2223
2224 let max_ord = self.__max_ordinal();
2225
2226 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2227 ::fidl_next::Wire::zero_padding(&mut out);
2228
2229 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2230 ::fidl_next::wire::Envelope,
2231 >(encoder, max_ord);
2232
2233 for i in 1..=max_ord {
2234 match i {
2235 8 => {
2236 if let Some(value) = &self.vccq_off_with_controller_off {
2237 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2238 value,
2239 preallocated.encoder,
2240 &mut out,
2241 (),
2242 )?;
2243 } else {
2244 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2245 }
2246 }
2247
2248 7 => {
2249 if let Some(value) = &self.instance_identifier {
2250 ::fidl_next::wire::Envelope::encode_value::<
2251 ::fidl_next::wire::String<'static>,
2252 ___E,
2253 >(
2254 value, preallocated.encoder, &mut out, 64
2255 )?;
2256 } else {
2257 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2258 }
2259 }
2260
2261 6 => {
2262 if let Some(value) = &self.use_fidl {
2263 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2264 value,
2265 preallocated.encoder,
2266 &mut out,
2267 (),
2268 )?;
2269 } else {
2270 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2271 }
2272 }
2273
2274 5 => {
2275 if let Some(value) = &self.max_command_packing {
2276 ::fidl_next::wire::Envelope::encode_value::<
2277 ::fidl_next::wire::Uint32,
2278 ___E,
2279 >(
2280 value, preallocated.encoder, &mut out, ()
2281 )?;
2282 } else {
2283 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2284 }
2285 }
2286
2287 4 => {
2288 if let Some(value) = &self.removable {
2289 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2290 value,
2291 preallocated.encoder,
2292 &mut out,
2293 (),
2294 )?;
2295 } else {
2296 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2297 }
2298 }
2299
2300 3 => {
2301 if let Some(value) = &self.enable_cache {
2302 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
2303 value,
2304 preallocated.encoder,
2305 &mut out,
2306 (),
2307 )?;
2308 } else {
2309 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2310 }
2311 }
2312
2313 2 => {
2314 if let Some(value) = &self.speed_capabilities {
2315 ::fidl_next::wire::Envelope::encode_value::<
2316 crate::wire::SdmmcHostPrefs,
2317 ___E,
2318 >(
2319 value, preallocated.encoder, &mut out, ()
2320 )?;
2321 } else {
2322 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2323 }
2324 }
2325
2326 1 => {
2327 if let Some(value) = &self.max_frequency {
2328 ::fidl_next::wire::Envelope::encode_value::<
2329 ::fidl_next::wire::Uint32,
2330 ___E,
2331 >(
2332 value, preallocated.encoder, &mut out, ()
2333 )?;
2334 } else {
2335 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2336 }
2337 }
2338
2339 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2340 }
2341 unsafe {
2342 preallocated.write_next(out.assume_init_ref());
2343 }
2344 }
2345
2346 ::fidl_next::wire::Table::encode_len(table, max_ord);
2347
2348 Ok(())
2349 }
2350 }
2351
2352 impl<'de> ::fidl_next::FromWire<crate::wire::SdmmcMetadata<'de>> for SdmmcMetadata {
2353 #[inline]
2354 fn from_wire(wire_: crate::wire::SdmmcMetadata<'de>) -> Self {
2355 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2356
2357 let max_frequency = wire_.table.get(1);
2358
2359 let speed_capabilities = wire_.table.get(2);
2360
2361 let enable_cache = wire_.table.get(3);
2362
2363 let removable = wire_.table.get(4);
2364
2365 let max_command_packing = wire_.table.get(5);
2366
2367 let use_fidl = wire_.table.get(6);
2368
2369 let instance_identifier = wire_.table.get(7);
2370
2371 let vccq_off_with_controller_off = wire_.table.get(8);
2372
2373 Self {
2374 max_frequency: max_frequency.map(|envelope| {
2375 ::fidl_next::FromWire::from_wire(unsafe {
2376 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
2377 })
2378 }),
2379
2380 speed_capabilities: speed_capabilities.map(|envelope| {
2381 ::fidl_next::FromWire::from_wire(unsafe {
2382 envelope.read_unchecked::<crate::wire::SdmmcHostPrefs>()
2383 })
2384 }),
2385
2386 enable_cache: enable_cache.map(|envelope| {
2387 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
2388 }),
2389
2390 removable: removable.map(|envelope| {
2391 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
2392 }),
2393
2394 max_command_packing: max_command_packing.map(|envelope| {
2395 ::fidl_next::FromWire::from_wire(unsafe {
2396 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
2397 })
2398 }),
2399
2400 use_fidl: use_fidl.map(|envelope| {
2401 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
2402 }),
2403
2404 instance_identifier: instance_identifier.map(|envelope| {
2405 ::fidl_next::FromWire::from_wire(unsafe {
2406 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2407 })
2408 }),
2409
2410 vccq_off_with_controller_off: vccq_off_with_controller_off.map(|envelope| {
2411 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
2412 }),
2413 }
2414 }
2415 }
2416
2417 impl<'de> ::fidl_next::FromWireRef<crate::wire::SdmmcMetadata<'de>> for SdmmcMetadata {
2418 #[inline]
2419 fn from_wire_ref(wire: &crate::wire::SdmmcMetadata<'de>) -> Self {
2420 Self {
2421 max_frequency: wire.table.get(1).map(|envelope| {
2422 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2423 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
2424 })
2425 }),
2426
2427 speed_capabilities: wire.table.get(2).map(|envelope| {
2428 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2429 envelope.deref_unchecked::<crate::wire::SdmmcHostPrefs>()
2430 })
2431 }),
2432
2433 enable_cache: wire.table.get(3).map(|envelope| {
2434 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2435 envelope.deref_unchecked::<bool>()
2436 })
2437 }),
2438
2439 removable: wire.table.get(4).map(|envelope| {
2440 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2441 envelope.deref_unchecked::<bool>()
2442 })
2443 }),
2444
2445 max_command_packing: wire.table.get(5).map(|envelope| {
2446 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2447 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
2448 })
2449 }),
2450
2451 use_fidl: wire.table.get(6).map(|envelope| {
2452 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2453 envelope.deref_unchecked::<bool>()
2454 })
2455 }),
2456
2457 instance_identifier: wire.table.get(7).map(|envelope| {
2458 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2459 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
2460 })
2461 }),
2462
2463 vccq_off_with_controller_off: wire.table.get(8).map(|envelope| {
2464 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2465 envelope.deref_unchecked::<bool>()
2466 })
2467 }),
2468 }
2469 }
2470 }
2471}
2472
2473pub mod wire {
2474
2475 pub type CqhciEnableCqhciResponse = ::fidl_next::wire::Unit;
2477
2478 pub type CqhciDisableCqhciResponse = ::fidl_next::wire::Unit;
2480
2481 #[derive(Clone, Copy, Debug)]
2483 #[repr(transparent)]
2484 pub struct SdmmcHostCap {
2485 pub(crate) value: ::fidl_next::wire::Uint64,
2486 }
2487
2488 impl ::fidl_next::Constrained for SdmmcHostCap {
2489 type Constraint = ();
2490
2491 fn validate(
2492 _: ::fidl_next::Slot<'_, Self>,
2493 _: Self::Constraint,
2494 ) -> Result<(), ::fidl_next::ValidationError> {
2495 Ok(())
2496 }
2497 }
2498
2499 unsafe impl ::fidl_next::Wire for SdmmcHostCap {
2500 type Narrowed<'de> = Self;
2501
2502 #[inline]
2503 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2504 }
2506 }
2507
2508 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcHostCap
2509 where
2510 ___D: ?Sized,
2511 {
2512 fn decode(
2513 slot: ::fidl_next::Slot<'_, Self>,
2514 _: &mut ___D,
2515 _: (),
2516 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2517 ::fidl_next::munge!(let Self { value } = slot);
2518 let set = u64::from(*value);
2519 if set & !crate::natural::SdmmcHostCap::all().bits() != 0 {
2520 return Err(::fidl_next::DecodeError::InvalidBits {
2521 expected: crate::natural::SdmmcHostCap::all().bits() as usize,
2522 actual: set as usize,
2523 });
2524 }
2525
2526 Ok(())
2527 }
2528 }
2529
2530 impl ::core::convert::From<crate::natural::SdmmcHostCap> for SdmmcHostCap {
2531 fn from(natural: crate::natural::SdmmcHostCap) -> Self {
2532 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
2533 }
2534 }
2535
2536 impl ::fidl_next::IntoNatural for SdmmcHostCap {
2537 type Natural = crate::natural::SdmmcHostCap;
2538 }
2539
2540 #[derive(Clone, Debug)]
2542 #[repr(C)]
2543 pub struct SdmmcHostInfo {
2544 pub caps: crate::wire::SdmmcHostCap,
2545
2546 pub max_transfer_size: ::fidl_next::wire::Uint32,
2547
2548 pub max_buffer_regions: ::fidl_next::wire::Uint64,
2549 }
2550
2551 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcHostInfo>(), 24);
2552 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcHostInfo>(), 8);
2553
2554 static_assertions::const_assert_eq!(std::mem::offset_of!(SdmmcHostInfo, caps), 0);
2555
2556 static_assertions::const_assert_eq!(std::mem::offset_of!(SdmmcHostInfo, max_transfer_size), 8);
2557
2558 static_assertions::const_assert_eq!(
2559 std::mem::offset_of!(SdmmcHostInfo, max_buffer_regions),
2560 16
2561 );
2562
2563 impl ::fidl_next::Constrained for SdmmcHostInfo {
2564 type Constraint = ();
2565
2566 fn validate(
2567 _: ::fidl_next::Slot<'_, Self>,
2568 _: Self::Constraint,
2569 ) -> Result<(), ::fidl_next::ValidationError> {
2570 Ok(())
2571 }
2572 }
2573
2574 unsafe impl ::fidl_next::Wire for SdmmcHostInfo {
2575 type Narrowed<'de> = SdmmcHostInfo;
2576
2577 #[inline]
2578 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2579 ::fidl_next::munge! {
2580 let Self {
2581 caps,
2582 max_transfer_size,
2583 max_buffer_regions,
2584
2585 } = &mut *out_;
2586 }
2587
2588 ::fidl_next::Wire::zero_padding(caps);
2589
2590 ::fidl_next::Wire::zero_padding(max_transfer_size);
2591
2592 ::fidl_next::Wire::zero_padding(max_buffer_regions);
2593
2594 unsafe {
2595 out_.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
2596 }
2597 }
2598 }
2599
2600 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcHostInfo
2601 where
2602 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2603 {
2604 fn decode(
2605 slot_: ::fidl_next::Slot<'_, Self>,
2606 decoder_: &mut ___D,
2607 _: (),
2608 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2609 if slot_.as_bytes()[12..16] != [0u8; 4] {
2610 return Err(::fidl_next::DecodeError::InvalidPadding);
2611 }
2612
2613 ::fidl_next::munge! {
2614 let Self {
2615 mut caps,
2616 mut max_transfer_size,
2617 mut max_buffer_regions,
2618
2619 } = slot_;
2620 }
2621
2622 let _field = caps.as_mut();
2623
2624 ::fidl_next::Decode::decode(caps.as_mut(), decoder_, ())?;
2625
2626 let _field = max_transfer_size.as_mut();
2627
2628 ::fidl_next::Decode::decode(max_transfer_size.as_mut(), decoder_, ())?;
2629
2630 let _field = max_buffer_regions.as_mut();
2631
2632 ::fidl_next::Decode::decode(max_buffer_regions.as_mut(), decoder_, ())?;
2633
2634 Ok(())
2635 }
2636 }
2637
2638 impl ::fidl_next::IntoNatural for SdmmcHostInfo {
2639 type Natural = crate::natural::SdmmcHostInfo;
2640 }
2641
2642 #[derive(Clone, Debug)]
2644 #[repr(C)]
2645 pub struct SdmmcHostInfoResponse {
2646 pub info: crate::wire::SdmmcHostInfo,
2647 }
2648
2649 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcHostInfoResponse>(), 24);
2650 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcHostInfoResponse>(), 8);
2651
2652 static_assertions::const_assert_eq!(std::mem::offset_of!(SdmmcHostInfoResponse, info), 0);
2653
2654 impl ::fidl_next::Constrained for SdmmcHostInfoResponse {
2655 type Constraint = ();
2656
2657 fn validate(
2658 _: ::fidl_next::Slot<'_, Self>,
2659 _: Self::Constraint,
2660 ) -> Result<(), ::fidl_next::ValidationError> {
2661 Ok(())
2662 }
2663 }
2664
2665 unsafe impl ::fidl_next::Wire for SdmmcHostInfoResponse {
2666 type Narrowed<'de> = SdmmcHostInfoResponse;
2667
2668 #[inline]
2669 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2670 ::fidl_next::munge! {
2671 let Self {
2672 info,
2673
2674 } = &mut *out_;
2675 }
2676
2677 ::fidl_next::Wire::zero_padding(info);
2678 }
2679 }
2680
2681 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcHostInfoResponse
2682 where
2683 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2684 {
2685 fn decode(
2686 slot_: ::fidl_next::Slot<'_, Self>,
2687 decoder_: &mut ___D,
2688 _: (),
2689 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2690 ::fidl_next::munge! {
2691 let Self {
2692 mut info,
2693
2694 } = slot_;
2695 }
2696
2697 let _field = info.as_mut();
2698
2699 ::fidl_next::Decode::decode(info.as_mut(), decoder_, ())?;
2700
2701 Ok(())
2702 }
2703 }
2704
2705 impl ::fidl_next::IntoNatural for SdmmcHostInfoResponse {
2706 type Natural = crate::natural::SdmmcHostInfoResponse;
2707 }
2708
2709 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2711 #[repr(transparent)]
2712 pub struct SdmmcVoltage {
2713 pub(crate) value: u8,
2714 }
2715
2716 impl ::fidl_next::Constrained for SdmmcVoltage {
2717 type Constraint = ();
2718
2719 fn validate(
2720 _: ::fidl_next::Slot<'_, Self>,
2721 _: Self::Constraint,
2722 ) -> Result<(), ::fidl_next::ValidationError> {
2723 Ok(())
2724 }
2725 }
2726
2727 unsafe impl ::fidl_next::Wire for SdmmcVoltage {
2728 type Narrowed<'de> = Self;
2729
2730 #[inline]
2731 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2732 }
2734 }
2735
2736 impl SdmmcVoltage {
2737 pub const V330: SdmmcVoltage = SdmmcVoltage { value: 0 };
2738
2739 pub const V180: SdmmcVoltage = SdmmcVoltage { value: 1 };
2740
2741 pub const MAX: SdmmcVoltage = SdmmcVoltage { value: 2 };
2742 }
2743
2744 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcVoltage
2745 where
2746 ___D: ?Sized,
2747 {
2748 fn decode(
2749 slot: ::fidl_next::Slot<'_, Self>,
2750 _: &mut ___D,
2751 _: (),
2752 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2753 ::fidl_next::munge!(let Self { value } = slot);
2754
2755 match u8::from(*value) {
2756 0 | 1 | 2 => (),
2757 unknown => {
2758 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
2759 }
2760 }
2761
2762 Ok(())
2763 }
2764 }
2765
2766 impl ::core::convert::From<crate::natural::SdmmcVoltage> for SdmmcVoltage {
2767 fn from(natural: crate::natural::SdmmcVoltage) -> Self {
2768 match natural {
2769 crate::natural::SdmmcVoltage::V330 => SdmmcVoltage::V330,
2770
2771 crate::natural::SdmmcVoltage::V180 => SdmmcVoltage::V180,
2772
2773 crate::natural::SdmmcVoltage::Max => SdmmcVoltage::MAX,
2774 }
2775 }
2776 }
2777
2778 impl ::fidl_next::IntoNatural for SdmmcVoltage {
2779 type Natural = crate::natural::SdmmcVoltage;
2780 }
2781
2782 #[derive(Clone, Debug)]
2784 #[repr(C)]
2785 pub struct SdmmcSetSignalVoltageRequest {
2786 pub voltage: crate::wire::SdmmcVoltage,
2787 }
2788
2789 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcSetSignalVoltageRequest>(), 1);
2790 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcSetSignalVoltageRequest>(), 1);
2791
2792 static_assertions::const_assert_eq!(
2793 std::mem::offset_of!(SdmmcSetSignalVoltageRequest, voltage),
2794 0
2795 );
2796
2797 impl ::fidl_next::Constrained for SdmmcSetSignalVoltageRequest {
2798 type Constraint = ();
2799
2800 fn validate(
2801 _: ::fidl_next::Slot<'_, Self>,
2802 _: Self::Constraint,
2803 ) -> Result<(), ::fidl_next::ValidationError> {
2804 Ok(())
2805 }
2806 }
2807
2808 unsafe impl ::fidl_next::Wire for SdmmcSetSignalVoltageRequest {
2809 type Narrowed<'de> = SdmmcSetSignalVoltageRequest;
2810
2811 #[inline]
2812 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2813 ::fidl_next::munge! {
2814 let Self {
2815 voltage,
2816
2817 } = &mut *out_;
2818 }
2819
2820 ::fidl_next::Wire::zero_padding(voltage);
2821 }
2822 }
2823
2824 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcSetSignalVoltageRequest
2825 where
2826 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2827 {
2828 fn decode(
2829 slot_: ::fidl_next::Slot<'_, Self>,
2830 decoder_: &mut ___D,
2831 _: (),
2832 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2833 ::fidl_next::munge! {
2834 let Self {
2835 mut voltage,
2836
2837 } = slot_;
2838 }
2839
2840 let _field = voltage.as_mut();
2841
2842 ::fidl_next::Decode::decode(voltage.as_mut(), decoder_, ())?;
2843
2844 Ok(())
2845 }
2846 }
2847
2848 impl ::fidl_next::IntoNatural for SdmmcSetSignalVoltageRequest {
2849 type Natural = crate::natural::SdmmcSetSignalVoltageRequest;
2850 }
2851
2852 pub type SdmmcSetSignalVoltageResponse = ::fidl_next::wire::Unit;
2854
2855 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2857 #[repr(transparent)]
2858 pub struct SdmmcBusWidth {
2859 pub(crate) value: u8,
2860 }
2861
2862 impl ::fidl_next::Constrained for SdmmcBusWidth {
2863 type Constraint = ();
2864
2865 fn validate(
2866 _: ::fidl_next::Slot<'_, Self>,
2867 _: Self::Constraint,
2868 ) -> Result<(), ::fidl_next::ValidationError> {
2869 Ok(())
2870 }
2871 }
2872
2873 unsafe impl ::fidl_next::Wire for SdmmcBusWidth {
2874 type Narrowed<'de> = Self;
2875
2876 #[inline]
2877 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2878 }
2880 }
2881
2882 impl SdmmcBusWidth {
2883 pub const ONE: SdmmcBusWidth = SdmmcBusWidth { value: 0 };
2884
2885 pub const FOUR: SdmmcBusWidth = SdmmcBusWidth { value: 1 };
2886
2887 pub const EIGHT: SdmmcBusWidth = SdmmcBusWidth { value: 2 };
2888
2889 pub const MAX: SdmmcBusWidth = SdmmcBusWidth { value: 3 };
2890 }
2891
2892 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcBusWidth
2893 where
2894 ___D: ?Sized,
2895 {
2896 fn decode(
2897 slot: ::fidl_next::Slot<'_, Self>,
2898 _: &mut ___D,
2899 _: (),
2900 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2901 ::fidl_next::munge!(let Self { value } = slot);
2902
2903 match u8::from(*value) {
2904 0 | 1 | 2 | 3 => (),
2905 unknown => {
2906 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
2907 }
2908 }
2909
2910 Ok(())
2911 }
2912 }
2913
2914 impl ::core::convert::From<crate::natural::SdmmcBusWidth> for SdmmcBusWidth {
2915 fn from(natural: crate::natural::SdmmcBusWidth) -> Self {
2916 match natural {
2917 crate::natural::SdmmcBusWidth::One => SdmmcBusWidth::ONE,
2918
2919 crate::natural::SdmmcBusWidth::Four => SdmmcBusWidth::FOUR,
2920
2921 crate::natural::SdmmcBusWidth::Eight => SdmmcBusWidth::EIGHT,
2922
2923 crate::natural::SdmmcBusWidth::Max => SdmmcBusWidth::MAX,
2924 }
2925 }
2926 }
2927
2928 impl ::fidl_next::IntoNatural for SdmmcBusWidth {
2929 type Natural = crate::natural::SdmmcBusWidth;
2930 }
2931
2932 #[derive(Clone, Debug)]
2934 #[repr(C)]
2935 pub struct SdmmcSetBusWidthRequest {
2936 pub bus_width: crate::wire::SdmmcBusWidth,
2937 }
2938
2939 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcSetBusWidthRequest>(), 1);
2940 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcSetBusWidthRequest>(), 1);
2941
2942 static_assertions::const_assert_eq!(
2943 std::mem::offset_of!(SdmmcSetBusWidthRequest, bus_width),
2944 0
2945 );
2946
2947 impl ::fidl_next::Constrained for SdmmcSetBusWidthRequest {
2948 type Constraint = ();
2949
2950 fn validate(
2951 _: ::fidl_next::Slot<'_, Self>,
2952 _: Self::Constraint,
2953 ) -> Result<(), ::fidl_next::ValidationError> {
2954 Ok(())
2955 }
2956 }
2957
2958 unsafe impl ::fidl_next::Wire for SdmmcSetBusWidthRequest {
2959 type Narrowed<'de> = SdmmcSetBusWidthRequest;
2960
2961 #[inline]
2962 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2963 ::fidl_next::munge! {
2964 let Self {
2965 bus_width,
2966
2967 } = &mut *out_;
2968 }
2969
2970 ::fidl_next::Wire::zero_padding(bus_width);
2971 }
2972 }
2973
2974 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcSetBusWidthRequest
2975 where
2976 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2977 {
2978 fn decode(
2979 slot_: ::fidl_next::Slot<'_, Self>,
2980 decoder_: &mut ___D,
2981 _: (),
2982 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2983 ::fidl_next::munge! {
2984 let Self {
2985 mut bus_width,
2986
2987 } = slot_;
2988 }
2989
2990 let _field = bus_width.as_mut();
2991
2992 ::fidl_next::Decode::decode(bus_width.as_mut(), decoder_, ())?;
2993
2994 Ok(())
2995 }
2996 }
2997
2998 impl ::fidl_next::IntoNatural for SdmmcSetBusWidthRequest {
2999 type Natural = crate::natural::SdmmcSetBusWidthRequest;
3000 }
3001
3002 pub type SdmmcSetBusWidthResponse = ::fidl_next::wire::Unit;
3004
3005 #[derive(Clone, Debug)]
3007 #[repr(C)]
3008 pub struct SdmmcSetBusFreqRequest {
3009 pub bus_freq: ::fidl_next::wire::Uint32,
3010 }
3011
3012 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcSetBusFreqRequest>(), 4);
3013 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcSetBusFreqRequest>(), 4);
3014
3015 static_assertions::const_assert_eq!(std::mem::offset_of!(SdmmcSetBusFreqRequest, bus_freq), 0);
3016
3017 impl ::fidl_next::Constrained for SdmmcSetBusFreqRequest {
3018 type Constraint = ();
3019
3020 fn validate(
3021 _: ::fidl_next::Slot<'_, Self>,
3022 _: Self::Constraint,
3023 ) -> Result<(), ::fidl_next::ValidationError> {
3024 Ok(())
3025 }
3026 }
3027
3028 unsafe impl ::fidl_next::Wire for SdmmcSetBusFreqRequest {
3029 type Narrowed<'de> = SdmmcSetBusFreqRequest;
3030
3031 #[inline]
3032 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3033 ::fidl_next::munge! {
3034 let Self {
3035 bus_freq,
3036
3037 } = &mut *out_;
3038 }
3039
3040 ::fidl_next::Wire::zero_padding(bus_freq);
3041 }
3042 }
3043
3044 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcSetBusFreqRequest
3045 where
3046 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3047 {
3048 fn decode(
3049 slot_: ::fidl_next::Slot<'_, Self>,
3050 decoder_: &mut ___D,
3051 _: (),
3052 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3053 ::fidl_next::munge! {
3054 let Self {
3055 mut bus_freq,
3056
3057 } = slot_;
3058 }
3059
3060 let _field = bus_freq.as_mut();
3061
3062 ::fidl_next::Decode::decode(bus_freq.as_mut(), decoder_, ())?;
3063
3064 Ok(())
3065 }
3066 }
3067
3068 impl ::fidl_next::IntoNatural for SdmmcSetBusFreqRequest {
3069 type Natural = crate::natural::SdmmcSetBusFreqRequest;
3070 }
3071
3072 pub type SdmmcSetBusFreqResponse = ::fidl_next::wire::Unit;
3074
3075 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3077 #[repr(transparent)]
3078 pub struct SdmmcTiming {
3079 pub(crate) value: u8,
3080 }
3081
3082 impl ::fidl_next::Constrained for SdmmcTiming {
3083 type Constraint = ();
3084
3085 fn validate(
3086 _: ::fidl_next::Slot<'_, Self>,
3087 _: Self::Constraint,
3088 ) -> Result<(), ::fidl_next::ValidationError> {
3089 Ok(())
3090 }
3091 }
3092
3093 unsafe impl ::fidl_next::Wire for SdmmcTiming {
3094 type Narrowed<'de> = Self;
3095
3096 #[inline]
3097 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3098 }
3100 }
3101
3102 impl SdmmcTiming {
3103 pub const LEGACY: SdmmcTiming = SdmmcTiming { value: 0 };
3104
3105 pub const HS: SdmmcTiming = SdmmcTiming { value: 1 };
3106
3107 pub const HSDDR: SdmmcTiming = SdmmcTiming { value: 2 };
3108
3109 pub const HS200: SdmmcTiming = SdmmcTiming { value: 3 };
3110
3111 pub const HS400: SdmmcTiming = SdmmcTiming { value: 4 };
3112
3113 pub const SDR12: SdmmcTiming = SdmmcTiming { value: 5 };
3114
3115 pub const SDR25: SdmmcTiming = SdmmcTiming { value: 6 };
3116
3117 pub const SDR50: SdmmcTiming = SdmmcTiming { value: 7 };
3118
3119 pub const SDR104: SdmmcTiming = SdmmcTiming { value: 8 };
3120
3121 pub const DDR50: SdmmcTiming = SdmmcTiming { value: 9 };
3122
3123 pub const HS400_ENHANCED_STROBE: SdmmcTiming = SdmmcTiming { value: 10 };
3124
3125 pub const MAX: SdmmcTiming = SdmmcTiming { value: 11 };
3126 }
3127
3128 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcTiming
3129 where
3130 ___D: ?Sized,
3131 {
3132 fn decode(
3133 slot: ::fidl_next::Slot<'_, Self>,
3134 _: &mut ___D,
3135 _: (),
3136 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3137 ::fidl_next::munge!(let Self { value } = slot);
3138
3139 match u8::from(*value) {
3140 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 => (),
3141 unknown => {
3142 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
3143 }
3144 }
3145
3146 Ok(())
3147 }
3148 }
3149
3150 impl ::core::convert::From<crate::natural::SdmmcTiming> for SdmmcTiming {
3151 fn from(natural: crate::natural::SdmmcTiming) -> Self {
3152 match natural {
3153 crate::natural::SdmmcTiming::Legacy => SdmmcTiming::LEGACY,
3154
3155 crate::natural::SdmmcTiming::Hs => SdmmcTiming::HS,
3156
3157 crate::natural::SdmmcTiming::Hsddr => SdmmcTiming::HSDDR,
3158
3159 crate::natural::SdmmcTiming::Hs200 => SdmmcTiming::HS200,
3160
3161 crate::natural::SdmmcTiming::Hs400 => SdmmcTiming::HS400,
3162
3163 crate::natural::SdmmcTiming::Sdr12 => SdmmcTiming::SDR12,
3164
3165 crate::natural::SdmmcTiming::Sdr25 => SdmmcTiming::SDR25,
3166
3167 crate::natural::SdmmcTiming::Sdr50 => SdmmcTiming::SDR50,
3168
3169 crate::natural::SdmmcTiming::Sdr104 => SdmmcTiming::SDR104,
3170
3171 crate::natural::SdmmcTiming::Ddr50 => SdmmcTiming::DDR50,
3172
3173 crate::natural::SdmmcTiming::Hs400EnhancedStrobe => {
3174 SdmmcTiming::HS400_ENHANCED_STROBE
3175 }
3176
3177 crate::natural::SdmmcTiming::Max => SdmmcTiming::MAX,
3178 }
3179 }
3180 }
3181
3182 impl ::fidl_next::IntoNatural for SdmmcTiming {
3183 type Natural = crate::natural::SdmmcTiming;
3184 }
3185
3186 #[derive(Clone, Debug)]
3188 #[repr(C)]
3189 pub struct SdmmcSetTimingRequest {
3190 pub timing: crate::wire::SdmmcTiming,
3191 }
3192
3193 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcSetTimingRequest>(), 1);
3194 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcSetTimingRequest>(), 1);
3195
3196 static_assertions::const_assert_eq!(std::mem::offset_of!(SdmmcSetTimingRequest, timing), 0);
3197
3198 impl ::fidl_next::Constrained for SdmmcSetTimingRequest {
3199 type Constraint = ();
3200
3201 fn validate(
3202 _: ::fidl_next::Slot<'_, Self>,
3203 _: Self::Constraint,
3204 ) -> Result<(), ::fidl_next::ValidationError> {
3205 Ok(())
3206 }
3207 }
3208
3209 unsafe impl ::fidl_next::Wire for SdmmcSetTimingRequest {
3210 type Narrowed<'de> = SdmmcSetTimingRequest;
3211
3212 #[inline]
3213 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3214 ::fidl_next::munge! {
3215 let Self {
3216 timing,
3217
3218 } = &mut *out_;
3219 }
3220
3221 ::fidl_next::Wire::zero_padding(timing);
3222 }
3223 }
3224
3225 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcSetTimingRequest
3226 where
3227 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3228 {
3229 fn decode(
3230 slot_: ::fidl_next::Slot<'_, Self>,
3231 decoder_: &mut ___D,
3232 _: (),
3233 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3234 ::fidl_next::munge! {
3235 let Self {
3236 mut timing,
3237
3238 } = slot_;
3239 }
3240
3241 let _field = timing.as_mut();
3242
3243 ::fidl_next::Decode::decode(timing.as_mut(), decoder_, ())?;
3244
3245 Ok(())
3246 }
3247 }
3248
3249 impl ::fidl_next::IntoNatural for SdmmcSetTimingRequest {
3250 type Natural = crate::natural::SdmmcSetTimingRequest;
3251 }
3252
3253 pub type SdmmcSetTimingResponse = ::fidl_next::wire::Unit;
3255
3256 pub type SdmmcHwResetResponse = ::fidl_next::wire::Unit;
3258
3259 #[derive(Clone, Debug)]
3261 #[repr(C)]
3262 pub struct SdmmcPerformTuningRequest {
3263 pub cmd_idx: ::fidl_next::wire::Uint32,
3264 }
3265
3266 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcPerformTuningRequest>(), 4);
3267 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcPerformTuningRequest>(), 4);
3268
3269 static_assertions::const_assert_eq!(
3270 std::mem::offset_of!(SdmmcPerformTuningRequest, cmd_idx),
3271 0
3272 );
3273
3274 impl ::fidl_next::Constrained for SdmmcPerformTuningRequest {
3275 type Constraint = ();
3276
3277 fn validate(
3278 _: ::fidl_next::Slot<'_, Self>,
3279 _: Self::Constraint,
3280 ) -> Result<(), ::fidl_next::ValidationError> {
3281 Ok(())
3282 }
3283 }
3284
3285 unsafe impl ::fidl_next::Wire for SdmmcPerformTuningRequest {
3286 type Narrowed<'de> = SdmmcPerformTuningRequest;
3287
3288 #[inline]
3289 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3290 ::fidl_next::munge! {
3291 let Self {
3292 cmd_idx,
3293
3294 } = &mut *out_;
3295 }
3296
3297 ::fidl_next::Wire::zero_padding(cmd_idx);
3298 }
3299 }
3300
3301 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcPerformTuningRequest
3302 where
3303 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3304 {
3305 fn decode(
3306 slot_: ::fidl_next::Slot<'_, Self>,
3307 decoder_: &mut ___D,
3308 _: (),
3309 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3310 ::fidl_next::munge! {
3311 let Self {
3312 mut cmd_idx,
3313
3314 } = slot_;
3315 }
3316
3317 let _field = cmd_idx.as_mut();
3318
3319 ::fidl_next::Decode::decode(cmd_idx.as_mut(), decoder_, ())?;
3320
3321 Ok(())
3322 }
3323 }
3324
3325 impl ::fidl_next::IntoNatural for SdmmcPerformTuningRequest {
3326 type Natural = crate::natural::SdmmcPerformTuningRequest;
3327 }
3328
3329 pub type SdmmcPerformTuningResponse = ::fidl_next::wire::Unit;
3331
3332 pub type SdmmcRegisterInBandInterruptResponse = ::fidl_next::wire::Unit;
3334
3335 #[derive(Clone, Copy, Debug)]
3337 #[repr(transparent)]
3338 pub struct SdmmcVmoRight {
3339 pub(crate) value: ::fidl_next::wire::Uint32,
3340 }
3341
3342 impl ::fidl_next::Constrained for SdmmcVmoRight {
3343 type Constraint = ();
3344
3345 fn validate(
3346 _: ::fidl_next::Slot<'_, Self>,
3347 _: Self::Constraint,
3348 ) -> Result<(), ::fidl_next::ValidationError> {
3349 Ok(())
3350 }
3351 }
3352
3353 unsafe impl ::fidl_next::Wire for SdmmcVmoRight {
3354 type Narrowed<'de> = Self;
3355
3356 #[inline]
3357 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3358 }
3360 }
3361
3362 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcVmoRight
3363 where
3364 ___D: ?Sized,
3365 {
3366 fn decode(
3367 slot: ::fidl_next::Slot<'_, Self>,
3368 _: &mut ___D,
3369 _: (),
3370 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3371 ::fidl_next::munge!(let Self { value } = slot);
3372 let set = u32::from(*value);
3373 if set & !crate::natural::SdmmcVmoRight::all().bits() != 0 {
3374 return Err(::fidl_next::DecodeError::InvalidBits {
3375 expected: crate::natural::SdmmcVmoRight::all().bits() as usize,
3376 actual: set as usize,
3377 });
3378 }
3379
3380 Ok(())
3381 }
3382 }
3383
3384 impl ::core::convert::From<crate::natural::SdmmcVmoRight> for SdmmcVmoRight {
3385 fn from(natural: crate::natural::SdmmcVmoRight) -> Self {
3386 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
3387 }
3388 }
3389
3390 impl ::fidl_next::IntoNatural for SdmmcVmoRight {
3391 type Natural = crate::natural::SdmmcVmoRight;
3392 }
3393
3394 pub type SdmmcRegisterVmoResponse = ::fidl_next::wire::Unit;
3396
3397 #[derive(Clone, Debug)]
3399 #[repr(C)]
3400 pub struct SdmmcUnregisterVmoRequest {
3401 pub vmo_id: ::fidl_next::wire::Uint32,
3402
3403 pub client_id: u8,
3404 }
3405
3406 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcUnregisterVmoRequest>(), 8);
3407 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcUnregisterVmoRequest>(), 4);
3408
3409 static_assertions::const_assert_eq!(std::mem::offset_of!(SdmmcUnregisterVmoRequest, vmo_id), 0);
3410
3411 static_assertions::const_assert_eq!(
3412 std::mem::offset_of!(SdmmcUnregisterVmoRequest, client_id),
3413 4
3414 );
3415
3416 impl ::fidl_next::Constrained for SdmmcUnregisterVmoRequest {
3417 type Constraint = ();
3418
3419 fn validate(
3420 _: ::fidl_next::Slot<'_, Self>,
3421 _: Self::Constraint,
3422 ) -> Result<(), ::fidl_next::ValidationError> {
3423 Ok(())
3424 }
3425 }
3426
3427 unsafe impl ::fidl_next::Wire for SdmmcUnregisterVmoRequest {
3428 type Narrowed<'de> = SdmmcUnregisterVmoRequest;
3429
3430 #[inline]
3431 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3432 ::fidl_next::munge! {
3433 let Self {
3434 vmo_id,
3435 client_id,
3436
3437 } = &mut *out_;
3438 }
3439
3440 ::fidl_next::Wire::zero_padding(vmo_id);
3441
3442 ::fidl_next::Wire::zero_padding(client_id);
3443
3444 unsafe {
3445 out_.as_mut_ptr().cast::<u8>().add(5).write_bytes(0, 3);
3446 }
3447 }
3448 }
3449
3450 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcUnregisterVmoRequest
3451 where
3452 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3453 {
3454 fn decode(
3455 slot_: ::fidl_next::Slot<'_, Self>,
3456 decoder_: &mut ___D,
3457 _: (),
3458 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3459 if slot_.as_bytes()[5..8] != [0u8; 3] {
3460 return Err(::fidl_next::DecodeError::InvalidPadding);
3461 }
3462
3463 ::fidl_next::munge! {
3464 let Self {
3465 mut vmo_id,
3466 mut client_id,
3467
3468 } = slot_;
3469 }
3470
3471 let _field = vmo_id.as_mut();
3472
3473 ::fidl_next::Decode::decode(vmo_id.as_mut(), decoder_, ())?;
3474
3475 let _field = client_id.as_mut();
3476
3477 ::fidl_next::Decode::decode(client_id.as_mut(), decoder_, ())?;
3478
3479 Ok(())
3480 }
3481 }
3482
3483 impl ::fidl_next::IntoNatural for SdmmcUnregisterVmoRequest {
3484 type Natural = crate::natural::SdmmcUnregisterVmoRequest;
3485 }
3486
3487 #[derive(Clone, Debug)]
3489 #[repr(C)]
3490 pub struct SdmmcRequestResponse {
3491 pub response: [::fidl_next::wire::Uint32; 4],
3492 }
3493
3494 static_assertions::const_assert_eq!(std::mem::size_of::<SdmmcRequestResponse>(), 16);
3495 static_assertions::const_assert_eq!(std::mem::align_of::<SdmmcRequestResponse>(), 4);
3496
3497 static_assertions::const_assert_eq!(std::mem::offset_of!(SdmmcRequestResponse, response), 0);
3498
3499 impl ::fidl_next::Constrained for SdmmcRequestResponse {
3500 type Constraint = ();
3501
3502 fn validate(
3503 _: ::fidl_next::Slot<'_, Self>,
3504 _: Self::Constraint,
3505 ) -> Result<(), ::fidl_next::ValidationError> {
3506 Ok(())
3507 }
3508 }
3509
3510 unsafe impl ::fidl_next::Wire for SdmmcRequestResponse {
3511 type Narrowed<'de> = SdmmcRequestResponse;
3512
3513 #[inline]
3514 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3515 ::fidl_next::munge! {
3516 let Self {
3517 response,
3518
3519 } = &mut *out_;
3520 }
3521
3522 ::fidl_next::Wire::zero_padding(response);
3523 }
3524 }
3525
3526 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcRequestResponse
3527 where
3528 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3529 {
3530 fn decode(
3531 slot_: ::fidl_next::Slot<'_, Self>,
3532 decoder_: &mut ___D,
3533 _: (),
3534 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3535 ::fidl_next::munge! {
3536 let Self {
3537 mut response,
3538
3539 } = slot_;
3540 }
3541
3542 let _field = response.as_mut();
3543
3544 ::fidl_next::Decode::decode(response.as_mut(), decoder_, ())?;
3545
3546 Ok(())
3547 }
3548 }
3549
3550 impl ::fidl_next::IntoNatural for SdmmcRequestResponse {
3551 type Natural = crate::natural::SdmmcRequestResponse;
3552 }
3553
3554 #[derive(Clone, Copy, Debug)]
3556 #[repr(transparent)]
3557 pub struct SdmmcHostPrefs {
3558 pub(crate) value: ::fidl_next::wire::Uint64,
3559 }
3560
3561 impl ::fidl_next::Constrained for SdmmcHostPrefs {
3562 type Constraint = ();
3563
3564 fn validate(
3565 _: ::fidl_next::Slot<'_, Self>,
3566 _: Self::Constraint,
3567 ) -> Result<(), ::fidl_next::ValidationError> {
3568 Ok(())
3569 }
3570 }
3571
3572 unsafe impl ::fidl_next::Wire for SdmmcHostPrefs {
3573 type Narrowed<'de> = Self;
3574
3575 #[inline]
3576 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3577 }
3579 }
3580
3581 unsafe impl<___D> ::fidl_next::Decode<___D> for SdmmcHostPrefs
3582 where
3583 ___D: ?Sized,
3584 {
3585 fn decode(
3586 slot: ::fidl_next::Slot<'_, Self>,
3587 _: &mut ___D,
3588 _: (),
3589 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3590 ::fidl_next::munge!(let Self { value } = slot);
3591 let set = u64::from(*value);
3592 if set & !crate::natural::SdmmcHostPrefs::all().bits() != 0 {
3593 return Err(::fidl_next::DecodeError::InvalidBits {
3594 expected: crate::natural::SdmmcHostPrefs::all().bits() as usize,
3595 actual: set as usize,
3596 });
3597 }
3598
3599 Ok(())
3600 }
3601 }
3602
3603 impl ::core::convert::From<crate::natural::SdmmcHostPrefs> for SdmmcHostPrefs {
3604 fn from(natural: crate::natural::SdmmcHostPrefs) -> Self {
3605 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
3606 }
3607 }
3608
3609 impl ::fidl_next::IntoNatural for SdmmcHostPrefs {
3610 type Natural = crate::natural::SdmmcHostPrefs;
3611 }
3612
3613 #[repr(C)]
3615 pub struct SdmmcMetadata<'de> {
3616 pub(crate) table: ::fidl_next::wire::Table<'de>,
3617 }
3618
3619 impl<'de> Drop for SdmmcMetadata<'de> {
3620 fn drop(&mut self) {
3621 let _ = self
3622 .table
3623 .get(1)
3624 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
3625
3626 let _ = self.table.get(2).map(|envelope| unsafe {
3627 envelope.read_unchecked::<crate::wire::SdmmcHostPrefs>()
3628 });
3629
3630 let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3631
3632 let _ = self.table.get(4).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3633
3634 let _ = self
3635 .table
3636 .get(5)
3637 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
3638
3639 let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3640
3641 let _ = self.table.get(7).map(|envelope| unsafe {
3642 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3643 });
3644
3645 let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
3646 }
3647 }
3648
3649 impl ::fidl_next::Constrained for SdmmcMetadata<'_> {
3650 type Constraint = ();
3651
3652 fn validate(
3653 _: ::fidl_next::Slot<'_, Self>,
3654 _: Self::Constraint,
3655 ) -> Result<(), ::fidl_next::ValidationError> {
3656 Ok(())
3657 }
3658 }
3659
3660 unsafe impl ::fidl_next::Wire for SdmmcMetadata<'static> {
3661 type Narrowed<'de> = SdmmcMetadata<'de>;
3662
3663 #[inline]
3664 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3665 ::fidl_next::munge!(let Self { table } = out);
3666 ::fidl_next::wire::Table::zero_padding(table);
3667 }
3668 }
3669
3670 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SdmmcMetadata<'de>
3671 where
3672 ___D: ::fidl_next::Decoder<'de> + ?Sized,
3673 {
3674 fn decode(
3675 slot: ::fidl_next::Slot<'_, Self>,
3676 decoder: &mut ___D,
3677 _: (),
3678 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3679 ::fidl_next::munge!(let Self { table } = slot);
3680
3681 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3682 match ordinal {
3683 0 => unsafe { ::core::hint::unreachable_unchecked() },
3684
3685 1 => {
3686 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
3687 slot.as_mut(),
3688 decoder,
3689 (),
3690 )?;
3691
3692 Ok(())
3693 }
3694
3695 2 => {
3696 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::SdmmcHostPrefs>(
3697 slot.as_mut(),
3698 decoder,
3699 (),
3700 )?;
3701
3702 Ok(())
3703 }
3704
3705 3 => {
3706 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
3707 slot.as_mut(),
3708 decoder,
3709 (),
3710 )?;
3711
3712 Ok(())
3713 }
3714
3715 4 => {
3716 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
3717 slot.as_mut(),
3718 decoder,
3719 (),
3720 )?;
3721
3722 Ok(())
3723 }
3724
3725 5 => {
3726 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
3727 slot.as_mut(),
3728 decoder,
3729 (),
3730 )?;
3731
3732 Ok(())
3733 }
3734
3735 6 => {
3736 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
3737 slot.as_mut(),
3738 decoder,
3739 (),
3740 )?;
3741
3742 Ok(())
3743 }
3744
3745 7 => {
3746 ::fidl_next::wire::Envelope::decode_as::<
3747 ___D,
3748 ::fidl_next::wire::String<'de>,
3749 >(slot.as_mut(), decoder, 64)?;
3750
3751 let value = unsafe {
3752 slot.deref_unchecked()
3753 .deref_unchecked::<::fidl_next::wire::String<'_>>()
3754 };
3755
3756 if value.len() > 64 {
3757 return Err(::fidl_next::DecodeError::VectorTooLong {
3758 size: value.len() as u64,
3759 limit: 64,
3760 });
3761 }
3762
3763 Ok(())
3764 }
3765
3766 8 => {
3767 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
3768 slot.as_mut(),
3769 decoder,
3770 (),
3771 )?;
3772
3773 Ok(())
3774 }
3775
3776 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3777 }
3778 })
3779 }
3780 }
3781
3782 impl<'de> SdmmcMetadata<'de> {
3783 pub fn max_frequency(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
3784 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3785 }
3786
3787 pub fn take_max_frequency(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
3788 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3789 }
3790
3791 pub fn speed_capabilities(&self) -> ::core::option::Option<&crate::wire::SdmmcHostPrefs> {
3792 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3793 }
3794
3795 pub fn take_speed_capabilities(
3796 &mut self,
3797 ) -> ::core::option::Option<crate::wire::SdmmcHostPrefs> {
3798 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
3799 }
3800
3801 pub fn enable_cache(&self) -> ::core::option::Option<&bool> {
3802 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
3803 }
3804
3805 pub fn take_enable_cache(&mut self) -> ::core::option::Option<bool> {
3806 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
3807 }
3808
3809 pub fn removable(&self) -> ::core::option::Option<&bool> {
3810 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
3811 }
3812
3813 pub fn take_removable(&mut self) -> ::core::option::Option<bool> {
3814 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
3815 }
3816
3817 pub fn max_command_packing(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
3818 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
3819 }
3820
3821 pub fn take_max_command_packing(
3822 &mut self,
3823 ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
3824 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
3825 }
3826
3827 pub fn use_fidl(&self) -> ::core::option::Option<&bool> {
3828 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
3829 }
3830
3831 pub fn take_use_fidl(&mut self) -> ::core::option::Option<bool> {
3832 unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
3833 }
3834
3835 pub fn instance_identifier(
3836 &self,
3837 ) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
3838 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
3839 }
3840
3841 pub fn take_instance_identifier(
3842 &mut self,
3843 ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
3844 unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
3845 }
3846
3847 pub fn vccq_off_with_controller_off(&self) -> ::core::option::Option<&bool> {
3848 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
3849 }
3850
3851 pub fn take_vccq_off_with_controller_off(&mut self) -> ::core::option::Option<bool> {
3852 unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
3853 }
3854 }
3855
3856 impl<'de> ::core::fmt::Debug for SdmmcMetadata<'de> {
3857 fn fmt(
3858 &self,
3859 f: &mut ::core::fmt::Formatter<'_>,
3860 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3861 f.debug_struct("SdmmcMetadata")
3862 .field("max_frequency", &self.max_frequency())
3863 .field("speed_capabilities", &self.speed_capabilities())
3864 .field("enable_cache", &self.enable_cache())
3865 .field("removable", &self.removable())
3866 .field("max_command_packing", &self.max_command_packing())
3867 .field("use_fidl", &self.use_fidl())
3868 .field("instance_identifier", &self.instance_identifier())
3869 .field("vccq_off_with_controller_off", &self.vccq_off_with_controller_off())
3870 .finish()
3871 }
3872 }
3873
3874 impl<'de> ::fidl_next::IntoNatural for SdmmcMetadata<'de> {
3875 type Natural = crate::natural::SdmmcMetadata;
3876 }
3877}
3878
3879pub mod wire_optional {}
3880
3881pub mod generic {
3882
3883 pub type CqhciEnableCqhciResponse = ();
3885
3886 pub type CqhciDisableCqhciResponse = ();
3888
3889 pub struct SdmmcHostInfo<T0, T1, T2> {
3891 pub caps: T0,
3892
3893 pub max_transfer_size: T1,
3894
3895 pub max_buffer_regions: T2,
3896 }
3897
3898 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::SdmmcHostInfo, ___E>
3899 for SdmmcHostInfo<T0, T1, T2>
3900 where
3901 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3902 T0: ::fidl_next::Encode<crate::wire::SdmmcHostCap, ___E>,
3903 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
3904 T2: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
3905 {
3906 #[inline]
3907 fn encode(
3908 self,
3909 encoder_: &mut ___E,
3910 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostInfo>,
3911 _: (),
3912 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3913 ::fidl_next::munge! {
3914 let crate::wire::SdmmcHostInfo {
3915 caps,
3916 max_transfer_size,
3917 max_buffer_regions,
3918
3919 } = out_;
3920 }
3921
3922 ::fidl_next::Encode::encode(self.caps, encoder_, caps, ())?;
3923
3924 ::fidl_next::Encode::encode(self.max_transfer_size, encoder_, max_transfer_size, ())?;
3925
3926 ::fidl_next::Encode::encode(self.max_buffer_regions, encoder_, max_buffer_regions, ())?;
3927
3928 Ok(())
3929 }
3930 }
3931
3932 pub struct SdmmcHostInfoResponse<T0> {
3934 pub info: T0,
3935 }
3936
3937 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SdmmcHostInfoResponse, ___E>
3938 for SdmmcHostInfoResponse<T0>
3939 where
3940 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3941 T0: ::fidl_next::Encode<crate::wire::SdmmcHostInfo, ___E>,
3942 {
3943 #[inline]
3944 fn encode(
3945 self,
3946 encoder_: &mut ___E,
3947 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcHostInfoResponse>,
3948 _: (),
3949 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3950 ::fidl_next::munge! {
3951 let crate::wire::SdmmcHostInfoResponse {
3952 info,
3953
3954 } = out_;
3955 }
3956
3957 ::fidl_next::Encode::encode(self.info, encoder_, info, ())?;
3958
3959 Ok(())
3960 }
3961 }
3962
3963 pub struct SdmmcSetSignalVoltageRequest<T0> {
3965 pub voltage: T0,
3966 }
3967
3968 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SdmmcSetSignalVoltageRequest, ___E>
3969 for SdmmcSetSignalVoltageRequest<T0>
3970 where
3971 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3972 T0: ::fidl_next::Encode<crate::wire::SdmmcVoltage, ___E>,
3973 {
3974 #[inline]
3975 fn encode(
3976 self,
3977 encoder_: &mut ___E,
3978 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetSignalVoltageRequest>,
3979 _: (),
3980 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3981 ::fidl_next::munge! {
3982 let crate::wire::SdmmcSetSignalVoltageRequest {
3983 voltage,
3984
3985 } = out_;
3986 }
3987
3988 ::fidl_next::Encode::encode(self.voltage, encoder_, voltage, ())?;
3989
3990 Ok(())
3991 }
3992 }
3993
3994 pub type SdmmcSetSignalVoltageResponse = ();
3996
3997 pub struct SdmmcSetBusWidthRequest<T0> {
3999 pub bus_width: T0,
4000 }
4001
4002 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SdmmcSetBusWidthRequest, ___E>
4003 for SdmmcSetBusWidthRequest<T0>
4004 where
4005 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4006 T0: ::fidl_next::Encode<crate::wire::SdmmcBusWidth, ___E>,
4007 {
4008 #[inline]
4009 fn encode(
4010 self,
4011 encoder_: &mut ___E,
4012 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetBusWidthRequest>,
4013 _: (),
4014 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4015 ::fidl_next::munge! {
4016 let crate::wire::SdmmcSetBusWidthRequest {
4017 bus_width,
4018
4019 } = out_;
4020 }
4021
4022 ::fidl_next::Encode::encode(self.bus_width, encoder_, bus_width, ())?;
4023
4024 Ok(())
4025 }
4026 }
4027
4028 pub type SdmmcSetBusWidthResponse = ();
4030
4031 pub struct SdmmcSetBusFreqRequest<T0> {
4033 pub bus_freq: T0,
4034 }
4035
4036 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SdmmcSetBusFreqRequest, ___E>
4037 for SdmmcSetBusFreqRequest<T0>
4038 where
4039 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4040 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
4041 {
4042 #[inline]
4043 fn encode(
4044 self,
4045 encoder_: &mut ___E,
4046 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetBusFreqRequest>,
4047 _: (),
4048 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4049 ::fidl_next::munge! {
4050 let crate::wire::SdmmcSetBusFreqRequest {
4051 bus_freq,
4052
4053 } = out_;
4054 }
4055
4056 ::fidl_next::Encode::encode(self.bus_freq, encoder_, bus_freq, ())?;
4057
4058 Ok(())
4059 }
4060 }
4061
4062 pub type SdmmcSetBusFreqResponse = ();
4064
4065 pub struct SdmmcSetTimingRequest<T0> {
4067 pub timing: T0,
4068 }
4069
4070 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SdmmcSetTimingRequest, ___E>
4071 for SdmmcSetTimingRequest<T0>
4072 where
4073 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4074 T0: ::fidl_next::Encode<crate::wire::SdmmcTiming, ___E>,
4075 {
4076 #[inline]
4077 fn encode(
4078 self,
4079 encoder_: &mut ___E,
4080 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcSetTimingRequest>,
4081 _: (),
4082 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4083 ::fidl_next::munge! {
4084 let crate::wire::SdmmcSetTimingRequest {
4085 timing,
4086
4087 } = out_;
4088 }
4089
4090 ::fidl_next::Encode::encode(self.timing, encoder_, timing, ())?;
4091
4092 Ok(())
4093 }
4094 }
4095
4096 pub type SdmmcSetTimingResponse = ();
4098
4099 pub type SdmmcHwResetResponse = ();
4101
4102 pub struct SdmmcPerformTuningRequest<T0> {
4104 pub cmd_idx: T0,
4105 }
4106
4107 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SdmmcPerformTuningRequest, ___E>
4108 for SdmmcPerformTuningRequest<T0>
4109 where
4110 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4111 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
4112 {
4113 #[inline]
4114 fn encode(
4115 self,
4116 encoder_: &mut ___E,
4117 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcPerformTuningRequest>,
4118 _: (),
4119 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4120 ::fidl_next::munge! {
4121 let crate::wire::SdmmcPerformTuningRequest {
4122 cmd_idx,
4123
4124 } = out_;
4125 }
4126
4127 ::fidl_next::Encode::encode(self.cmd_idx, encoder_, cmd_idx, ())?;
4128
4129 Ok(())
4130 }
4131 }
4132
4133 pub type SdmmcPerformTuningResponse = ();
4135
4136 pub type SdmmcRegisterInBandInterruptResponse = ();
4138
4139 pub type SdmmcRegisterVmoResponse = ();
4141
4142 pub struct SdmmcUnregisterVmoRequest<T0, T1> {
4144 pub vmo_id: T0,
4145
4146 pub client_id: T1,
4147 }
4148
4149 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::SdmmcUnregisterVmoRequest, ___E>
4150 for SdmmcUnregisterVmoRequest<T0, T1>
4151 where
4152 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4153 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
4154 T1: ::fidl_next::Encode<u8, ___E>,
4155 {
4156 #[inline]
4157 fn encode(
4158 self,
4159 encoder_: &mut ___E,
4160 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcUnregisterVmoRequest>,
4161 _: (),
4162 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4163 ::fidl_next::munge! {
4164 let crate::wire::SdmmcUnregisterVmoRequest {
4165 vmo_id,
4166 client_id,
4167
4168 } = out_;
4169 }
4170
4171 ::fidl_next::Encode::encode(self.vmo_id, encoder_, vmo_id, ())?;
4172
4173 ::fidl_next::Encode::encode(self.client_id, encoder_, client_id, ())?;
4174
4175 Ok(())
4176 }
4177 }
4178
4179 pub struct SdmmcRequestResponse<T0> {
4181 pub response: T0,
4182 }
4183
4184 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SdmmcRequestResponse, ___E>
4185 for SdmmcRequestResponse<T0>
4186 where
4187 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4188 T0: ::fidl_next::Encode<[::fidl_next::wire::Uint32; 4], ___E>,
4189 {
4190 #[inline]
4191 fn encode(
4192 self,
4193 encoder_: &mut ___E,
4194 out_: &mut ::core::mem::MaybeUninit<crate::wire::SdmmcRequestResponse>,
4195 _: (),
4196 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4197 ::fidl_next::munge! {
4198 let crate::wire::SdmmcRequestResponse {
4199 response,
4200
4201 } = out_;
4202 }
4203
4204 ::fidl_next::Encode::encode(self.response, encoder_, response, ())?;
4205
4206 Ok(())
4207 }
4208 }
4209}
4210
4211pub use self::natural::*;
4212
4213#[derive(PartialEq, Debug)]
4215pub struct InBandInterrupt;
4216
4217impl ::fidl_next::Discoverable for InBandInterrupt {
4218 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.sdmmc.InBandInterrupt";
4219}
4220
4221#[cfg(feature = "driver")]
4222impl ::fidl_next::HasTransport for InBandInterrupt {
4223 type Transport = ::fdf_fidl::DriverChannel;
4224}
4225
4226pub mod in_band_interrupt {
4227 pub mod prelude {
4228 pub use crate::{
4229 InBandInterrupt, InBandInterruptClientHandler, InBandInterruptLocalClientHandler,
4230 InBandInterruptLocalServerHandler, InBandInterruptServerHandler, in_band_interrupt,
4231 };
4232 }
4233
4234 pub struct Callback;
4235
4236 impl ::fidl_next::Method for Callback {
4237 const ORDINAL: u64 = 1424660355215079669;
4238 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4239 ::fidl_next::protocol::Flexibility::Strict;
4240
4241 type Protocol = crate::InBandInterrupt;
4242
4243 type Request = ::fidl_next::wire::EmptyMessageBody;
4244 }
4245
4246 impl ::fidl_next::TwoWayMethod for Callback {
4247 type Response = ::fidl_next::wire::Strict<::fidl_next::wire::EmptyMessageBody>;
4248 }
4249
4250 impl<___R> ::fidl_next::Respond<___R> for Callback {
4251 type Output = ::fidl_next::Strict<___R>;
4252
4253 fn respond(response: ___R) -> Self::Output {
4254 ::fidl_next::Strict(response)
4255 }
4256 }
4257
4258 mod ___detail {
4259 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::InBandInterrupt
4260 where
4261 ___T: ::fidl_next::Transport,
4262 {
4263 type Client = InBandInterruptClient<___T>;
4264 type Server = InBandInterruptServer<___T>;
4265 }
4266
4267 #[repr(transparent)]
4269 pub struct InBandInterruptClient<___T: ::fidl_next::Transport> {
4270 #[allow(dead_code)]
4271 client: ::fidl_next::protocol::Client<___T>,
4272 }
4273
4274 impl<___T> InBandInterruptClient<___T>
4275 where
4276 ___T: ::fidl_next::Transport,
4277 {
4278 pub fn callback(&self) -> ::fidl_next::TwoWayFuture<'_, super::Callback, ___T> {
4279 ::fidl_next::TwoWayFuture::from_untyped(
4280 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4281 1424660355215079669,
4282 <super::Callback as ::fidl_next::Method>::FLEXIBILITY,
4283 (),
4284 ),
4285 )
4286 }
4287 }
4288
4289 #[repr(transparent)]
4291 pub struct InBandInterruptServer<___T: ::fidl_next::Transport> {
4292 server: ::fidl_next::protocol::Server<___T>,
4293 }
4294
4295 impl<___T> InBandInterruptServer<___T> where ___T: ::fidl_next::Transport {}
4296 }
4297}
4298
4299#[diagnostic::on_unimplemented(
4300 note = "If {Self} implements the non-local InBandInterruptClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4301)]
4302
4303pub trait InBandInterruptLocalClientHandler<
4307 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
4308 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
4309>
4310{
4311}
4312
4313impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for InBandInterrupt
4314where
4315 ___H: InBandInterruptLocalClientHandler<___T>,
4316 ___T: ::fidl_next::Transport,
4317{
4318 async fn on_event(
4319 handler: &mut ___H,
4320 mut message: ::fidl_next::Message<___T>,
4321 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4322 match *message.header().ordinal {
4323 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4324 }
4325 }
4326}
4327
4328#[diagnostic::on_unimplemented(
4329 note = "If {Self} implements the non-local InBandInterruptServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4330)]
4331
4332pub trait InBandInterruptLocalServerHandler<
4336 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
4337 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
4338>
4339{
4340 fn callback(
4341 &mut self,
4342
4343 responder: ::fidl_next::Responder<in_band_interrupt::Callback, ___T>,
4344 ) -> impl ::core::future::Future<Output = ()>;
4345}
4346
4347impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for InBandInterrupt
4348where
4349 ___H: InBandInterruptLocalServerHandler<___T>,
4350 ___T: ::fidl_next::Transport,
4351{
4352 async fn on_one_way(
4353 handler: &mut ___H,
4354 mut message: ::fidl_next::Message<___T>,
4355 ) -> ::core::result::Result<
4356 (),
4357 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4358 > {
4359 match *message.header().ordinal {
4360 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4361 }
4362 }
4363
4364 async fn on_two_way(
4365 handler: &mut ___H,
4366 mut message: ::fidl_next::Message<___T>,
4367 responder: ::fidl_next::protocol::Responder<___T>,
4368 ) -> ::core::result::Result<
4369 (),
4370 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4371 > {
4372 match *message.header().ordinal {
4373 1424660355215079669 => {
4374 let responder = ::fidl_next::Responder::from_untyped(responder);
4375
4376 handler.callback(responder).await;
4377 Ok(())
4378 }
4379
4380 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4381 }
4382 }
4383}
4384
4385pub trait InBandInterruptClientHandler<
4389 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
4390 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
4391>
4392{
4393}
4394
4395impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for InBandInterrupt
4396where
4397 ___H: InBandInterruptClientHandler<___T> + ::core::marker::Send,
4398 ___T: ::fidl_next::Transport,
4399{
4400 async fn on_event(
4401 handler: &mut ___H,
4402 mut message: ::fidl_next::Message<___T>,
4403 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4404 match *message.header().ordinal {
4405 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4406 }
4407 }
4408}
4409
4410pub trait InBandInterruptServerHandler<
4414 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
4415 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
4416>
4417{
4418 fn callback(
4419 &mut self,
4420
4421 responder: ::fidl_next::Responder<in_band_interrupt::Callback, ___T>,
4422 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4423}
4424
4425impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for InBandInterrupt
4426where
4427 ___H: InBandInterruptServerHandler<___T> + ::core::marker::Send,
4428 ___T: ::fidl_next::Transport,
4429{
4430 async fn on_one_way(
4431 handler: &mut ___H,
4432 mut message: ::fidl_next::Message<___T>,
4433 ) -> ::core::result::Result<
4434 (),
4435 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4436 > {
4437 match *message.header().ordinal {
4438 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4439 }
4440 }
4441
4442 async fn on_two_way(
4443 handler: &mut ___H,
4444 mut message: ::fidl_next::Message<___T>,
4445 responder: ::fidl_next::protocol::Responder<___T>,
4446 ) -> ::core::result::Result<
4447 (),
4448 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4449 > {
4450 match *message.header().ordinal {
4451 1424660355215079669 => {
4452 let responder = ::fidl_next::Responder::from_untyped(responder);
4453
4454 handler.callback(responder).await;
4455 Ok(())
4456 }
4457
4458 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4459 }
4460 }
4461}
4462
4463impl<___T> InBandInterruptClientHandler<___T> for ::fidl_next::IgnoreEvents where
4464 ___T: ::fidl_next::Transport
4465{
4466}
4467
4468impl<___H, ___T> InBandInterruptLocalClientHandler<___T> for ::fidl_next::Local<___H>
4469where
4470 ___H: InBandInterruptClientHandler<___T>,
4471 ___T: ::fidl_next::Transport,
4472{
4473}
4474
4475impl<___H, ___T> InBandInterruptLocalServerHandler<___T> for ::fidl_next::Local<___H>
4476where
4477 ___H: InBandInterruptServerHandler<___T>,
4478 ___T: ::fidl_next::Transport,
4479{
4480 async fn callback(
4481 &mut self,
4482
4483 responder: ::fidl_next::Responder<in_band_interrupt::Callback, ___T>,
4484 ) {
4485 ___H::callback(&mut self.0, responder).await
4486 }
4487}
4488
4489pub const MAX_NAME_LENGTH: u8 = 64 as u8;
4490
4491#[doc = " The maximum value for a transfer size, identifying that there\n effectively exists no maximum for a single operation.\n"]
4492pub const MAX_TRANSFER_UNBOUNDED: u32 = 4294967295 as u32;
4493
4494#[doc = " The max value of client_id fields below. There is no known need for more than eight clients at\n the moment, however if that changes later this value will be increased.\n"]
4495pub const SDMMC_MAX_CLIENT_ID: u8 = 7 as u8;
4496
4497#[doc = " number of pages per request - 2M per request\n matches DMA_DESC_COUNT in dev/block/sdhci\n (PAGE_SIZE / sizeof(zx_paddr_t))\n"]
4498pub const SDMMC_PAGES_COUNT: u64 = 512 as u64;