1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(Clone, Debug)]
6#[repr(C)]
7pub struct DeviceGetMaxTransferSizeResponse {
8 pub size: u64,
9}
10
11impl ::fidl_next::Encodable for DeviceGetMaxTransferSizeResponse {
12 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
13 Self,
14 WireDeviceGetMaxTransferSizeResponse,
15 > = unsafe {
16 ::fidl_next::CopyOptimization::enable_if(
17 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
18 )
19 };
20
21 type Encoded = WireDeviceGetMaxTransferSizeResponse;
22}
23
24unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceGetMaxTransferSizeResponse
25where
26 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27{
28 #[inline]
29 fn encode(
30 self,
31 encoder: &mut ___E,
32 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
33 ) -> Result<(), ::fidl_next::EncodeError> {
34 ::fidl_next::munge! {
35 let Self::Encoded {
36 size,
37
38 } = out;
39 }
40
41 ::fidl_next::Encode::encode(self.size, encoder, size)?;
42
43 Ok(())
44 }
45}
46
47unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceGetMaxTransferSizeResponse
48where
49 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
50{
51 #[inline]
52 fn encode_ref(
53 &self,
54 encoder: &mut ___E,
55 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
56 ) -> Result<(), ::fidl_next::EncodeError> {
57 ::fidl_next::munge! {
58 let Self::Encoded {
59 size,
60
61 } = out;
62 }
63
64 ::fidl_next::EncodeRef::encode_ref(&self.size, encoder, size)?;
65
66 Ok(())
67 }
68}
69
70impl ::fidl_next::EncodableOption for DeviceGetMaxTransferSizeResponse {
71 type EncodedOption = ::fidl_next::WireBox<'static, WireDeviceGetMaxTransferSizeResponse>;
72}
73
74unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DeviceGetMaxTransferSizeResponse
75where
76 ___E: ::fidl_next::Encoder + ?Sized,
77 DeviceGetMaxTransferSizeResponse: ::fidl_next::Encode<___E>,
78{
79 #[inline]
80 fn encode_option(
81 this: Option<Self>,
82 encoder: &mut ___E,
83 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
84 ) -> Result<(), ::fidl_next::EncodeError> {
85 if let Some(inner) = this {
86 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
87 ::fidl_next::WireBox::encode_present(out);
88 } else {
89 ::fidl_next::WireBox::encode_absent(out);
90 }
91
92 Ok(())
93 }
94}
95
96unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DeviceGetMaxTransferSizeResponse
97where
98 ___E: ::fidl_next::Encoder + ?Sized,
99 DeviceGetMaxTransferSizeResponse: ::fidl_next::EncodeRef<___E>,
100{
101 #[inline]
102 fn encode_option_ref(
103 this: Option<&Self>,
104 encoder: &mut ___E,
105 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
106 ) -> Result<(), ::fidl_next::EncodeError> {
107 if let Some(inner) = this {
108 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
109 ::fidl_next::WireBox::encode_present(out);
110 } else {
111 ::fidl_next::WireBox::encode_absent(out);
112 }
113
114 Ok(())
115 }
116}
117
118impl ::fidl_next::FromWire<WireDeviceGetMaxTransferSizeResponse>
119 for DeviceGetMaxTransferSizeResponse
120{
121 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
122 WireDeviceGetMaxTransferSizeResponse,
123 Self,
124 > = unsafe {
125 ::fidl_next::CopyOptimization::enable_if(
126 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
127 .is_enabled(),
128 )
129 };
130
131 #[inline]
132 fn from_wire(wire: WireDeviceGetMaxTransferSizeResponse) -> Self {
133 Self { size: ::fidl_next::FromWire::from_wire(wire.size) }
134 }
135}
136
137impl ::fidl_next::FromWireRef<WireDeviceGetMaxTransferSizeResponse>
138 for DeviceGetMaxTransferSizeResponse
139{
140 #[inline]
141 fn from_wire_ref(wire: &WireDeviceGetMaxTransferSizeResponse) -> Self {
142 Self { size: ::fidl_next::FromWireRef::from_wire_ref(&wire.size) }
143 }
144}
145
146#[derive(Clone, Debug)]
148#[repr(C)]
149pub struct WireDeviceGetMaxTransferSizeResponse {
150 pub size: ::fidl_next::WireU64,
151}
152
153unsafe impl ::fidl_next::Wire for WireDeviceGetMaxTransferSizeResponse {
154 type Decoded<'de> = WireDeviceGetMaxTransferSizeResponse;
155
156 #[inline]
157 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
158}
159
160unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceGetMaxTransferSizeResponse
161where
162 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
163{
164 fn decode(
165 slot: ::fidl_next::Slot<'_, Self>,
166 decoder: &mut ___D,
167 ) -> Result<(), ::fidl_next::DecodeError> {
168 ::fidl_next::munge! {
169 let Self {
170 mut size,
171
172 } = slot;
173 }
174
175 ::fidl_next::Decode::decode(size.as_mut(), decoder)?;
176
177 Ok(())
178 }
179}
180
181#[derive(Clone, Debug)]
182#[repr(C)]
183pub struct DeviceSetBitrateRequest {
184 pub bitrate: u32,
185}
186
187impl ::fidl_next::Encodable for DeviceSetBitrateRequest {
188 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDeviceSetBitrateRequest> = unsafe {
189 ::fidl_next::CopyOptimization::enable_if(
190 true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
191 )
192 };
193
194 type Encoded = WireDeviceSetBitrateRequest;
195}
196
197unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceSetBitrateRequest
198where
199 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
200{
201 #[inline]
202 fn encode(
203 self,
204 encoder: &mut ___E,
205 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
206 ) -> Result<(), ::fidl_next::EncodeError> {
207 ::fidl_next::munge! {
208 let Self::Encoded {
209 bitrate,
210
211 } = out;
212 }
213
214 ::fidl_next::Encode::encode(self.bitrate, encoder, bitrate)?;
215
216 Ok(())
217 }
218}
219
220unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceSetBitrateRequest
221where
222 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
223{
224 #[inline]
225 fn encode_ref(
226 &self,
227 encoder: &mut ___E,
228 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
229 ) -> Result<(), ::fidl_next::EncodeError> {
230 ::fidl_next::munge! {
231 let Self::Encoded {
232 bitrate,
233
234 } = out;
235 }
236
237 ::fidl_next::EncodeRef::encode_ref(&self.bitrate, encoder, bitrate)?;
238
239 Ok(())
240 }
241}
242
243impl ::fidl_next::EncodableOption for DeviceSetBitrateRequest {
244 type EncodedOption = ::fidl_next::WireBox<'static, WireDeviceSetBitrateRequest>;
245}
246
247unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DeviceSetBitrateRequest
248where
249 ___E: ::fidl_next::Encoder + ?Sized,
250 DeviceSetBitrateRequest: ::fidl_next::Encode<___E>,
251{
252 #[inline]
253 fn encode_option(
254 this: Option<Self>,
255 encoder: &mut ___E,
256 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
257 ) -> Result<(), ::fidl_next::EncodeError> {
258 if let Some(inner) = this {
259 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
260 ::fidl_next::WireBox::encode_present(out);
261 } else {
262 ::fidl_next::WireBox::encode_absent(out);
263 }
264
265 Ok(())
266 }
267}
268
269unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DeviceSetBitrateRequest
270where
271 ___E: ::fidl_next::Encoder + ?Sized,
272 DeviceSetBitrateRequest: ::fidl_next::EncodeRef<___E>,
273{
274 #[inline]
275 fn encode_option_ref(
276 this: Option<&Self>,
277 encoder: &mut ___E,
278 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
279 ) -> Result<(), ::fidl_next::EncodeError> {
280 if let Some(inner) = this {
281 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
282 ::fidl_next::WireBox::encode_present(out);
283 } else {
284 ::fidl_next::WireBox::encode_absent(out);
285 }
286
287 Ok(())
288 }
289}
290
291impl ::fidl_next::FromWire<WireDeviceSetBitrateRequest> for DeviceSetBitrateRequest {
292 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDeviceSetBitrateRequest, Self> = unsafe {
293 ::fidl_next::CopyOptimization::enable_if(
294 true && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
295 .is_enabled(),
296 )
297 };
298
299 #[inline]
300 fn from_wire(wire: WireDeviceSetBitrateRequest) -> Self {
301 Self { bitrate: ::fidl_next::FromWire::from_wire(wire.bitrate) }
302 }
303}
304
305impl ::fidl_next::FromWireRef<WireDeviceSetBitrateRequest> for DeviceSetBitrateRequest {
306 #[inline]
307 fn from_wire_ref(wire: &WireDeviceSetBitrateRequest) -> Self {
308 Self { bitrate: ::fidl_next::FromWireRef::from_wire_ref(&wire.bitrate) }
309 }
310}
311
312#[derive(Clone, Debug)]
314#[repr(C)]
315pub struct WireDeviceSetBitrateRequest {
316 pub bitrate: ::fidl_next::WireU32,
317}
318
319unsafe impl ::fidl_next::Wire for WireDeviceSetBitrateRequest {
320 type Decoded<'de> = WireDeviceSetBitrateRequest;
321
322 #[inline]
323 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
324}
325
326unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceSetBitrateRequest
327where
328 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
329{
330 fn decode(
331 slot: ::fidl_next::Slot<'_, Self>,
332 decoder: &mut ___D,
333 ) -> Result<(), ::fidl_next::DecodeError> {
334 ::fidl_next::munge! {
335 let Self {
336 mut bitrate,
337
338 } = slot;
339 }
340
341 ::fidl_next::Decode::decode(bitrate.as_mut(), decoder)?;
342
343 Ok(())
344 }
345}
346
347pub type DeviceSetBitrateResponse = ();
348
349pub type WireDeviceSetBitrateResponse = ();
351
352#[doc = " If `read_size` is set: This is a read operation and `read_size` bytes will be read.\n If `write_data` is set: This is a write operation and `write_data` will be written.\n"]
353#[derive(Clone, Debug)]
354pub enum I2cImplOpType {
355 ReadSize(u32),
356
357 WriteData(Vec<u8>),
358}
359
360impl ::fidl_next::Encodable for I2cImplOpType {
361 type Encoded = WireI2cImplOpType<'static>;
362}
363
364unsafe impl<___E> ::fidl_next::Encode<___E> for I2cImplOpType
365where
366 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
367 ___E: ::fidl_next::Encoder,
368{
369 #[inline]
370 fn encode(
371 self,
372 encoder: &mut ___E,
373 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
374 ) -> Result<(), ::fidl_next::EncodeError> {
375 ::fidl_next::munge!(let WireI2cImplOpType { raw, _phantom: _ } = out);
376
377 match self {
378 Self::ReadSize(value) => {
379 ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 1, encoder, raw)?
380 }
381
382 Self::WriteData(value) => {
383 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 2, encoder, raw)?
384 }
385 }
386
387 Ok(())
388 }
389}
390
391unsafe impl<___E> ::fidl_next::EncodeRef<___E> for I2cImplOpType
392where
393 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
394 ___E: ::fidl_next::Encoder,
395{
396 #[inline]
397 fn encode_ref(
398 &self,
399 encoder: &mut ___E,
400 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
401 ) -> Result<(), ::fidl_next::EncodeError> {
402 ::fidl_next::munge!(let WireI2cImplOpType { raw, _phantom: _ } = out);
403
404 match self {
405 Self::ReadSize(value) => {
406 ::fidl_next::RawWireUnion::encode_as::<___E, &u32>(value, 1, encoder, raw)?
407 }
408
409 Self::WriteData(value) => {
410 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u8>>(value, 2, encoder, raw)?
411 }
412 }
413
414 Ok(())
415 }
416}
417
418impl ::fidl_next::EncodableOption for I2cImplOpType {
419 type EncodedOption = WireOptionalI2cImplOpType<'static>;
420}
421
422unsafe impl<___E> ::fidl_next::EncodeOption<___E> for I2cImplOpType
423where
424 ___E: ?Sized,
425 I2cImplOpType: ::fidl_next::Encode<___E>,
426{
427 #[inline]
428 fn encode_option(
429 this: Option<Self>,
430 encoder: &mut ___E,
431 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
432 ) -> Result<(), ::fidl_next::EncodeError> {
433 ::fidl_next::munge!(let WireOptionalI2cImplOpType { raw, _phantom: _ } = &mut *out);
434
435 if let Some(inner) = this {
436 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
437 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
438 } else {
439 ::fidl_next::RawWireUnion::encode_absent(raw);
440 }
441
442 Ok(())
443 }
444}
445
446unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for I2cImplOpType
447where
448 ___E: ?Sized,
449 I2cImplOpType: ::fidl_next::EncodeRef<___E>,
450{
451 #[inline]
452 fn encode_option_ref(
453 this: Option<&Self>,
454 encoder: &mut ___E,
455 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
456 ) -> Result<(), ::fidl_next::EncodeError> {
457 ::fidl_next::munge!(let WireOptionalI2cImplOpType { raw, _phantom: _ } = &mut *out);
458
459 if let Some(inner) = this {
460 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
461 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
462 } else {
463 ::fidl_next::RawWireUnion::encode_absent(raw);
464 }
465
466 Ok(())
467 }
468}
469
470impl<'de> ::fidl_next::FromWire<WireI2cImplOpType<'de>> for I2cImplOpType {
471 #[inline]
472 fn from_wire(wire: WireI2cImplOpType<'de>) -> Self {
473 let wire = ::core::mem::ManuallyDrop::new(wire);
474 match wire.raw.ordinal() {
475 1 => Self::ReadSize(::fidl_next::FromWire::from_wire(unsafe {
476 wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
477 })),
478
479 2 => Self::WriteData(::fidl_next::FromWire::from_wire(unsafe {
480 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
481 })),
482
483 _ => unsafe { ::core::hint::unreachable_unchecked() },
484 }
485 }
486}
487
488impl<'de> ::fidl_next::FromWireRef<WireI2cImplOpType<'de>> for I2cImplOpType {
489 #[inline]
490 fn from_wire_ref(wire: &WireI2cImplOpType<'de>) -> Self {
491 match wire.raw.ordinal() {
492 1 => Self::ReadSize(::fidl_next::FromWireRef::from_wire_ref(unsafe {
493 wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
494 })),
495
496 2 => Self::WriteData(::fidl_next::FromWireRef::from_wire_ref(unsafe {
497 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
498 })),
499
500 _ => unsafe { ::core::hint::unreachable_unchecked() },
501 }
502 }
503}
504
505impl<'de> ::fidl_next::FromWireOption<WireOptionalI2cImplOpType<'de>> for Box<I2cImplOpType> {
506 #[inline]
507 fn from_wire_option(wire: WireOptionalI2cImplOpType<'de>) -> Option<Self> {
508 if let Some(inner) = wire.into_option() {
509 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
510 } else {
511 None
512 }
513 }
514}
515
516impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalI2cImplOpType<'de>> for Box<I2cImplOpType> {
517 #[inline]
518 fn from_wire_option_ref(wire: &WireOptionalI2cImplOpType<'de>) -> Option<Self> {
519 if let Some(inner) = wire.as_ref() {
520 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
521 } else {
522 None
523 }
524 }
525}
526
527#[repr(transparent)]
529pub struct WireI2cImplOpType<'de> {
530 raw: ::fidl_next::RawWireUnion,
531 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
532}
533
534impl<'de> Drop for WireI2cImplOpType<'de> {
535 fn drop(&mut self) {
536 match self.raw.ordinal() {
537 1 => {
538 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
539 }
540
541 2 => {
542 let _ =
543 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
544 }
545
546 _ => unsafe { ::core::hint::unreachable_unchecked() },
547 }
548 }
549}
550
551unsafe impl ::fidl_next::Wire for WireI2cImplOpType<'static> {
552 type Decoded<'de> = WireI2cImplOpType<'de>;
553
554 #[inline]
555 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
556 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
557 ::fidl_next::RawWireUnion::zero_padding(raw);
558 }
559}
560
561pub mod i2c_impl_op_type {
562 pub enum Ref<'de> {
563 ReadSize(&'de ::fidl_next::WireU32),
564
565 WriteData(&'de ::fidl_next::WireVector<'de, u8>),
566 }
567}
568
569impl<'de> WireI2cImplOpType<'de> {
570 pub fn as_ref(&self) -> crate::i2c_impl_op_type::Ref<'_> {
571 match self.raw.ordinal() {
572 1 => crate::i2c_impl_op_type::Ref::ReadSize(unsafe {
573 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
574 }),
575
576 2 => crate::i2c_impl_op_type::Ref::WriteData(unsafe {
577 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
578 }),
579
580 _ => unsafe { ::core::hint::unreachable_unchecked() },
581 }
582 }
583}
584
585unsafe impl<___D> ::fidl_next::Decode<___D> for WireI2cImplOpType<'static>
586where
587 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
588 ___D: ::fidl_next::Decoder,
589{
590 fn decode(
591 mut slot: ::fidl_next::Slot<'_, Self>,
592 decoder: &mut ___D,
593 ) -> Result<(), ::fidl_next::DecodeError> {
594 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
595 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
596 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
597
598 2 => {
599 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
600 raw, decoder,
601 )?
602 }
603
604 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
605 }
606
607 Ok(())
608 }
609}
610
611impl<'de> ::core::fmt::Debug for WireI2cImplOpType<'de> {
612 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
613 match self.raw.ordinal() {
614 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
615 2 => unsafe {
616 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
617 },
618 _ => unsafe { ::core::hint::unreachable_unchecked() },
619 }
620 }
621}
622
623#[repr(transparent)]
624pub struct WireOptionalI2cImplOpType<'de> {
625 raw: ::fidl_next::RawWireUnion,
626 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
627}
628
629unsafe impl ::fidl_next::Wire for WireOptionalI2cImplOpType<'static> {
630 type Decoded<'de> = WireOptionalI2cImplOpType<'de>;
631
632 #[inline]
633 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
634 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
635 ::fidl_next::RawWireUnion::zero_padding(raw);
636 }
637}
638
639impl<'de> WireOptionalI2cImplOpType<'de> {
640 pub fn is_some(&self) -> bool {
641 self.raw.is_some()
642 }
643
644 pub fn is_none(&self) -> bool {
645 self.raw.is_none()
646 }
647
648 pub fn as_ref(&self) -> Option<&WireI2cImplOpType<'de>> {
649 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
650 }
651
652 pub fn into_option(self) -> Option<WireI2cImplOpType<'de>> {
653 if self.is_some() {
654 Some(WireI2cImplOpType { raw: self.raw, _phantom: ::core::marker::PhantomData })
655 } else {
656 None
657 }
658 }
659}
660
661unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalI2cImplOpType<'static>
662where
663 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
664 ___D: ::fidl_next::Decoder,
665{
666 fn decode(
667 mut slot: ::fidl_next::Slot<'_, Self>,
668 decoder: &mut ___D,
669 ) -> Result<(), ::fidl_next::DecodeError> {
670 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
671 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
672 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
673
674 2 => {
675 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
676 raw, decoder,
677 )?
678 }
679
680 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
681 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
682 }
683
684 Ok(())
685 }
686}
687
688impl<'de> ::core::fmt::Debug for WireOptionalI2cImplOpType<'de> {
689 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
690 self.as_ref().fmt(f)
691 }
692}
693
694#[doc = " See `Transact` below for usage.\n"]
695#[derive(Clone, Debug)]
696pub struct I2cImplOp {
697 pub address: u16,
698
699 pub type_: crate::I2cImplOpType,
700
701 pub stop: bool,
702}
703
704impl ::fidl_next::Encodable for I2cImplOp {
705 type Encoded = WireI2cImplOp<'static>;
706}
707
708unsafe impl<___E> ::fidl_next::Encode<___E> for I2cImplOp
709where
710 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
711 ___E: ::fidl_next::Encoder,
712{
713 #[inline]
714 fn encode(
715 self,
716 encoder: &mut ___E,
717 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
718 ) -> Result<(), ::fidl_next::EncodeError> {
719 ::fidl_next::munge! {
720 let Self::Encoded {
721 address,
722 type_,
723 stop,
724
725 } = out;
726 }
727
728 ::fidl_next::Encode::encode(self.address, encoder, address)?;
729
730 ::fidl_next::Encode::encode(self.type_, encoder, type_)?;
731
732 ::fidl_next::Encode::encode(self.stop, encoder, stop)?;
733
734 Ok(())
735 }
736}
737
738unsafe impl<___E> ::fidl_next::EncodeRef<___E> for I2cImplOp
739where
740 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
741 ___E: ::fidl_next::Encoder,
742{
743 #[inline]
744 fn encode_ref(
745 &self,
746 encoder: &mut ___E,
747 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
748 ) -> Result<(), ::fidl_next::EncodeError> {
749 ::fidl_next::munge! {
750 let Self::Encoded {
751 address,
752 type_,
753 stop,
754
755 } = out;
756 }
757
758 ::fidl_next::EncodeRef::encode_ref(&self.address, encoder, address)?;
759
760 ::fidl_next::EncodeRef::encode_ref(&self.type_, encoder, type_)?;
761
762 ::fidl_next::EncodeRef::encode_ref(&self.stop, encoder, stop)?;
763
764 Ok(())
765 }
766}
767
768impl ::fidl_next::EncodableOption for I2cImplOp {
769 type EncodedOption = ::fidl_next::WireBox<'static, WireI2cImplOp<'static>>;
770}
771
772unsafe impl<___E> ::fidl_next::EncodeOption<___E> for I2cImplOp
773where
774 ___E: ::fidl_next::Encoder + ?Sized,
775 I2cImplOp: ::fidl_next::Encode<___E>,
776{
777 #[inline]
778 fn encode_option(
779 this: Option<Self>,
780 encoder: &mut ___E,
781 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
782 ) -> Result<(), ::fidl_next::EncodeError> {
783 if let Some(inner) = this {
784 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
785 ::fidl_next::WireBox::encode_present(out);
786 } else {
787 ::fidl_next::WireBox::encode_absent(out);
788 }
789
790 Ok(())
791 }
792}
793
794unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for I2cImplOp
795where
796 ___E: ::fidl_next::Encoder + ?Sized,
797 I2cImplOp: ::fidl_next::EncodeRef<___E>,
798{
799 #[inline]
800 fn encode_option_ref(
801 this: Option<&Self>,
802 encoder: &mut ___E,
803 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
804 ) -> Result<(), ::fidl_next::EncodeError> {
805 if let Some(inner) = this {
806 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
807 ::fidl_next::WireBox::encode_present(out);
808 } else {
809 ::fidl_next::WireBox::encode_absent(out);
810 }
811
812 Ok(())
813 }
814}
815
816impl<'de> ::fidl_next::FromWire<WireI2cImplOp<'de>> for I2cImplOp {
817 #[inline]
818 fn from_wire(wire: WireI2cImplOp<'de>) -> Self {
819 Self {
820 address: ::fidl_next::FromWire::from_wire(wire.address),
821
822 type_: ::fidl_next::FromWire::from_wire(wire.type_),
823
824 stop: ::fidl_next::FromWire::from_wire(wire.stop),
825 }
826 }
827}
828
829impl<'de> ::fidl_next::FromWireRef<WireI2cImplOp<'de>> for I2cImplOp {
830 #[inline]
831 fn from_wire_ref(wire: &WireI2cImplOp<'de>) -> Self {
832 Self {
833 address: ::fidl_next::FromWireRef::from_wire_ref(&wire.address),
834
835 type_: ::fidl_next::FromWireRef::from_wire_ref(&wire.type_),
836
837 stop: ::fidl_next::FromWireRef::from_wire_ref(&wire.stop),
838 }
839 }
840}
841
842#[derive(Debug)]
844#[repr(C)]
845pub struct WireI2cImplOp<'de> {
846 pub address: ::fidl_next::WireU16,
847
848 pub type_: crate::WireI2cImplOpType<'de>,
849
850 pub stop: bool,
851}
852
853unsafe impl ::fidl_next::Wire for WireI2cImplOp<'static> {
854 type Decoded<'de> = WireI2cImplOp<'de>;
855
856 #[inline]
857 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
858 unsafe {
859 out.as_mut_ptr().cast::<u8>().add(25).write_bytes(0, 7);
860 }
861
862 unsafe {
863 out.as_mut_ptr().cast::<u8>().add(2).write_bytes(0, 6);
864 }
865 }
866}
867
868unsafe impl<___D> ::fidl_next::Decode<___D> for WireI2cImplOp<'static>
869where
870 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
871 ___D: ::fidl_next::Decoder,
872{
873 fn decode(
874 slot: ::fidl_next::Slot<'_, Self>,
875 decoder: &mut ___D,
876 ) -> Result<(), ::fidl_next::DecodeError> {
877 ::fidl_next::munge! {
878 let Self {
879 mut address,
880 mut type_,
881 mut stop,
882
883 } = slot;
884 }
885
886 ::fidl_next::Decode::decode(address.as_mut(), decoder)?;
887
888 ::fidl_next::Decode::decode(type_.as_mut(), decoder)?;
889
890 ::fidl_next::Decode::decode(stop.as_mut(), decoder)?;
891
892 Ok(())
893 }
894}
895
896#[derive(Clone, Debug)]
897pub struct DeviceTransactRequest {
898 pub op: Vec<crate::I2cImplOp>,
899}
900
901impl ::fidl_next::Encodable for DeviceTransactRequest {
902 type Encoded = WireDeviceTransactRequest<'static>;
903}
904
905unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceTransactRequest
906where
907 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
908 ___E: ::fidl_next::Encoder,
909{
910 #[inline]
911 fn encode(
912 self,
913 encoder: &mut ___E,
914 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
915 ) -> Result<(), ::fidl_next::EncodeError> {
916 ::fidl_next::munge! {
917 let Self::Encoded {
918 op,
919
920 } = out;
921 }
922
923 ::fidl_next::Encode::encode(self.op, encoder, op)?;
924
925 Ok(())
926 }
927}
928
929unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceTransactRequest
930where
931 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
932 ___E: ::fidl_next::Encoder,
933{
934 #[inline]
935 fn encode_ref(
936 &self,
937 encoder: &mut ___E,
938 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
939 ) -> Result<(), ::fidl_next::EncodeError> {
940 ::fidl_next::munge! {
941 let Self::Encoded {
942 op,
943
944 } = out;
945 }
946
947 ::fidl_next::EncodeRef::encode_ref(&self.op, encoder, op)?;
948
949 Ok(())
950 }
951}
952
953impl ::fidl_next::EncodableOption for DeviceTransactRequest {
954 type EncodedOption = ::fidl_next::WireBox<'static, WireDeviceTransactRequest<'static>>;
955}
956
957unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DeviceTransactRequest
958where
959 ___E: ::fidl_next::Encoder + ?Sized,
960 DeviceTransactRequest: ::fidl_next::Encode<___E>,
961{
962 #[inline]
963 fn encode_option(
964 this: Option<Self>,
965 encoder: &mut ___E,
966 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
967 ) -> Result<(), ::fidl_next::EncodeError> {
968 if let Some(inner) = this {
969 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
970 ::fidl_next::WireBox::encode_present(out);
971 } else {
972 ::fidl_next::WireBox::encode_absent(out);
973 }
974
975 Ok(())
976 }
977}
978
979unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DeviceTransactRequest
980where
981 ___E: ::fidl_next::Encoder + ?Sized,
982 DeviceTransactRequest: ::fidl_next::EncodeRef<___E>,
983{
984 #[inline]
985 fn encode_option_ref(
986 this: Option<&Self>,
987 encoder: &mut ___E,
988 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
989 ) -> Result<(), ::fidl_next::EncodeError> {
990 if let Some(inner) = this {
991 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
992 ::fidl_next::WireBox::encode_present(out);
993 } else {
994 ::fidl_next::WireBox::encode_absent(out);
995 }
996
997 Ok(())
998 }
999}
1000
1001impl<'de> ::fidl_next::FromWire<WireDeviceTransactRequest<'de>> for DeviceTransactRequest {
1002 #[inline]
1003 fn from_wire(wire: WireDeviceTransactRequest<'de>) -> Self {
1004 Self { op: ::fidl_next::FromWire::from_wire(wire.op) }
1005 }
1006}
1007
1008impl<'de> ::fidl_next::FromWireRef<WireDeviceTransactRequest<'de>> for DeviceTransactRequest {
1009 #[inline]
1010 fn from_wire_ref(wire: &WireDeviceTransactRequest<'de>) -> Self {
1011 Self { op: ::fidl_next::FromWireRef::from_wire_ref(&wire.op) }
1012 }
1013}
1014
1015#[derive(Debug)]
1017#[repr(C)]
1018pub struct WireDeviceTransactRequest<'de> {
1019 pub op: ::fidl_next::WireVector<'de, crate::WireI2cImplOp<'de>>,
1020}
1021
1022unsafe impl ::fidl_next::Wire for WireDeviceTransactRequest<'static> {
1023 type Decoded<'de> = WireDeviceTransactRequest<'de>;
1024
1025 #[inline]
1026 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1027}
1028
1029unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceTransactRequest<'static>
1030where
1031 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1032 ___D: ::fidl_next::Decoder,
1033{
1034 fn decode(
1035 slot: ::fidl_next::Slot<'_, Self>,
1036 decoder: &mut ___D,
1037 ) -> Result<(), ::fidl_next::DecodeError> {
1038 ::fidl_next::munge! {
1039 let Self {
1040 mut op,
1041
1042 } = slot;
1043 }
1044
1045 ::fidl_next::Decode::decode(op.as_mut(), decoder)?;
1046
1047 let op = unsafe { op.deref_unchecked() };
1048
1049 if op.len() > 256 {
1050 return Err(::fidl_next::DecodeError::VectorTooLong {
1051 size: op.len() as u64,
1052 limit: 256,
1053 });
1054 }
1055
1056 Ok(())
1057 }
1058}
1059
1060#[doc = " The result of one read transaction.\n"]
1061#[derive(Clone, Debug)]
1062pub struct ReadData {
1063 pub data: Vec<u8>,
1064}
1065
1066impl ::fidl_next::Encodable for ReadData {
1067 type Encoded = WireReadData<'static>;
1068}
1069
1070unsafe impl<___E> ::fidl_next::Encode<___E> for ReadData
1071where
1072 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1073 ___E: ::fidl_next::Encoder,
1074{
1075 #[inline]
1076 fn encode(
1077 self,
1078 encoder: &mut ___E,
1079 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1080 ) -> Result<(), ::fidl_next::EncodeError> {
1081 ::fidl_next::munge! {
1082 let Self::Encoded {
1083 data,
1084
1085 } = out;
1086 }
1087
1088 ::fidl_next::Encode::encode(self.data, encoder, data)?;
1089
1090 Ok(())
1091 }
1092}
1093
1094unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadData
1095where
1096 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1097 ___E: ::fidl_next::Encoder,
1098{
1099 #[inline]
1100 fn encode_ref(
1101 &self,
1102 encoder: &mut ___E,
1103 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1104 ) -> Result<(), ::fidl_next::EncodeError> {
1105 ::fidl_next::munge! {
1106 let Self::Encoded {
1107 data,
1108
1109 } = out;
1110 }
1111
1112 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
1113
1114 Ok(())
1115 }
1116}
1117
1118impl ::fidl_next::EncodableOption for ReadData {
1119 type EncodedOption = ::fidl_next::WireBox<'static, WireReadData<'static>>;
1120}
1121
1122unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ReadData
1123where
1124 ___E: ::fidl_next::Encoder + ?Sized,
1125 ReadData: ::fidl_next::Encode<___E>,
1126{
1127 #[inline]
1128 fn encode_option(
1129 this: Option<Self>,
1130 encoder: &mut ___E,
1131 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1132 ) -> Result<(), ::fidl_next::EncodeError> {
1133 if let Some(inner) = this {
1134 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1135 ::fidl_next::WireBox::encode_present(out);
1136 } else {
1137 ::fidl_next::WireBox::encode_absent(out);
1138 }
1139
1140 Ok(())
1141 }
1142}
1143
1144unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ReadData
1145where
1146 ___E: ::fidl_next::Encoder + ?Sized,
1147 ReadData: ::fidl_next::EncodeRef<___E>,
1148{
1149 #[inline]
1150 fn encode_option_ref(
1151 this: Option<&Self>,
1152 encoder: &mut ___E,
1153 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1154 ) -> Result<(), ::fidl_next::EncodeError> {
1155 if let Some(inner) = this {
1156 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1157 ::fidl_next::WireBox::encode_present(out);
1158 } else {
1159 ::fidl_next::WireBox::encode_absent(out);
1160 }
1161
1162 Ok(())
1163 }
1164}
1165
1166impl<'de> ::fidl_next::FromWire<WireReadData<'de>> for ReadData {
1167 #[inline]
1168 fn from_wire(wire: WireReadData<'de>) -> Self {
1169 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
1170 }
1171}
1172
1173impl<'de> ::fidl_next::FromWireRef<WireReadData<'de>> for ReadData {
1174 #[inline]
1175 fn from_wire_ref(wire: &WireReadData<'de>) -> Self {
1176 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
1177 }
1178}
1179
1180#[derive(Debug)]
1182#[repr(C)]
1183pub struct WireReadData<'de> {
1184 pub data: ::fidl_next::WireVector<'de, u8>,
1185}
1186
1187unsafe impl ::fidl_next::Wire for WireReadData<'static> {
1188 type Decoded<'de> = WireReadData<'de>;
1189
1190 #[inline]
1191 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1192}
1193
1194unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadData<'static>
1195where
1196 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1197 ___D: ::fidl_next::Decoder,
1198{
1199 fn decode(
1200 slot: ::fidl_next::Slot<'_, Self>,
1201 decoder: &mut ___D,
1202 ) -> Result<(), ::fidl_next::DecodeError> {
1203 ::fidl_next::munge! {
1204 let Self {
1205 mut data,
1206
1207 } = slot;
1208 }
1209
1210 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
1211
1212 let data = unsafe { data.deref_unchecked() };
1213
1214 if data.len() > 32768 {
1215 return Err(::fidl_next::DecodeError::VectorTooLong {
1216 size: data.len() as u64,
1217 limit: 32768,
1218 });
1219 }
1220
1221 Ok(())
1222 }
1223}
1224
1225#[derive(Clone, Debug)]
1226pub struct DeviceTransactResponse {
1227 pub read: Vec<crate::ReadData>,
1228}
1229
1230impl ::fidl_next::Encodable for DeviceTransactResponse {
1231 type Encoded = WireDeviceTransactResponse<'static>;
1232}
1233
1234unsafe impl<___E> ::fidl_next::Encode<___E> for DeviceTransactResponse
1235where
1236 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1237 ___E: ::fidl_next::Encoder,
1238{
1239 #[inline]
1240 fn encode(
1241 self,
1242 encoder: &mut ___E,
1243 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1244 ) -> Result<(), ::fidl_next::EncodeError> {
1245 ::fidl_next::munge! {
1246 let Self::Encoded {
1247 read,
1248
1249 } = out;
1250 }
1251
1252 ::fidl_next::Encode::encode(self.read, encoder, read)?;
1253
1254 Ok(())
1255 }
1256}
1257
1258unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeviceTransactResponse
1259where
1260 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1261 ___E: ::fidl_next::Encoder,
1262{
1263 #[inline]
1264 fn encode_ref(
1265 &self,
1266 encoder: &mut ___E,
1267 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1268 ) -> Result<(), ::fidl_next::EncodeError> {
1269 ::fidl_next::munge! {
1270 let Self::Encoded {
1271 read,
1272
1273 } = out;
1274 }
1275
1276 ::fidl_next::EncodeRef::encode_ref(&self.read, encoder, read)?;
1277
1278 Ok(())
1279 }
1280}
1281
1282impl ::fidl_next::EncodableOption for DeviceTransactResponse {
1283 type EncodedOption = ::fidl_next::WireBox<'static, WireDeviceTransactResponse<'static>>;
1284}
1285
1286unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DeviceTransactResponse
1287where
1288 ___E: ::fidl_next::Encoder + ?Sized,
1289 DeviceTransactResponse: ::fidl_next::Encode<___E>,
1290{
1291 #[inline]
1292 fn encode_option(
1293 this: Option<Self>,
1294 encoder: &mut ___E,
1295 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1296 ) -> Result<(), ::fidl_next::EncodeError> {
1297 if let Some(inner) = this {
1298 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1299 ::fidl_next::WireBox::encode_present(out);
1300 } else {
1301 ::fidl_next::WireBox::encode_absent(out);
1302 }
1303
1304 Ok(())
1305 }
1306}
1307
1308unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DeviceTransactResponse
1309where
1310 ___E: ::fidl_next::Encoder + ?Sized,
1311 DeviceTransactResponse: ::fidl_next::EncodeRef<___E>,
1312{
1313 #[inline]
1314 fn encode_option_ref(
1315 this: Option<&Self>,
1316 encoder: &mut ___E,
1317 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1318 ) -> Result<(), ::fidl_next::EncodeError> {
1319 if let Some(inner) = this {
1320 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1321 ::fidl_next::WireBox::encode_present(out);
1322 } else {
1323 ::fidl_next::WireBox::encode_absent(out);
1324 }
1325
1326 Ok(())
1327 }
1328}
1329
1330impl<'de> ::fidl_next::FromWire<WireDeviceTransactResponse<'de>> for DeviceTransactResponse {
1331 #[inline]
1332 fn from_wire(wire: WireDeviceTransactResponse<'de>) -> Self {
1333 Self { read: ::fidl_next::FromWire::from_wire(wire.read) }
1334 }
1335}
1336
1337impl<'de> ::fidl_next::FromWireRef<WireDeviceTransactResponse<'de>> for DeviceTransactResponse {
1338 #[inline]
1339 fn from_wire_ref(wire: &WireDeviceTransactResponse<'de>) -> Self {
1340 Self { read: ::fidl_next::FromWireRef::from_wire_ref(&wire.read) }
1341 }
1342}
1343
1344#[derive(Debug)]
1346#[repr(C)]
1347pub struct WireDeviceTransactResponse<'de> {
1348 pub read: ::fidl_next::WireVector<'de, crate::WireReadData<'de>>,
1349}
1350
1351unsafe impl ::fidl_next::Wire for WireDeviceTransactResponse<'static> {
1352 type Decoded<'de> = WireDeviceTransactResponse<'de>;
1353
1354 #[inline]
1355 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1356}
1357
1358unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeviceTransactResponse<'static>
1359where
1360 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1361 ___D: ::fidl_next::Decoder,
1362{
1363 fn decode(
1364 slot: ::fidl_next::Slot<'_, Self>,
1365 decoder: &mut ___D,
1366 ) -> Result<(), ::fidl_next::DecodeError> {
1367 ::fidl_next::munge! {
1368 let Self {
1369 mut read,
1370
1371 } = slot;
1372 }
1373
1374 ::fidl_next::Decode::decode(read.as_mut(), decoder)?;
1375
1376 let read = unsafe { read.deref_unchecked() };
1377
1378 if read.len() > 256 {
1379 return Err(::fidl_next::DecodeError::VectorTooLong {
1380 size: read.len() as u64,
1381 limit: 256,
1382 });
1383 }
1384
1385 Ok(())
1386 }
1387}
1388
1389#[doc = " Low-level protocol for i2c drivers.\n"]
1391#[derive(Debug)]
1392pub struct Device;
1393
1394impl ::fidl_next::Discoverable for Device {
1395 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.i2cimpl.Device";
1396}
1397
1398pub mod device {
1399 pub mod prelude {
1400 pub use crate::{Device, DeviceClientHandler, DeviceServerHandler, device};
1401
1402 pub use crate::DeviceSetBitrateRequest;
1403
1404 pub use crate::DeviceTransactRequest;
1405
1406 pub use crate::DeviceGetMaxTransferSizeResponse;
1407
1408 pub use crate::DeviceSetBitrateResponse;
1409
1410 pub use crate::DeviceTransactResponse;
1411 }
1412
1413 pub struct GetMaxTransferSize;
1414
1415 impl ::fidl_next::Method for GetMaxTransferSize {
1416 const ORDINAL: u64 = 5122675640437495577;
1417
1418 type Protocol = crate::Device;
1419
1420 type Request = ();
1421
1422 type Response = ::fidl_next::WireFlexibleResult<
1423 'static,
1424 crate::WireDeviceGetMaxTransferSizeResponse,
1425 ::fidl_next::WireI32,
1426 >;
1427 }
1428
1429 pub struct SetBitrate;
1430
1431 impl ::fidl_next::Method for SetBitrate {
1432 const ORDINAL: u64 = 8193992212524563188;
1433
1434 type Protocol = crate::Device;
1435
1436 type Request = crate::WireDeviceSetBitrateRequest;
1437
1438 type Response = ::fidl_next::WireFlexibleResult<
1439 'static,
1440 crate::WireDeviceSetBitrateResponse,
1441 ::fidl_next::WireI32,
1442 >;
1443 }
1444
1445 pub struct Transact;
1446
1447 impl ::fidl_next::Method for Transact {
1448 const ORDINAL: u64 = 6461839908402215334;
1449
1450 type Protocol = crate::Device;
1451
1452 type Request = crate::WireDeviceTransactRequest<'static>;
1453
1454 type Response = ::fidl_next::WireFlexibleResult<
1455 'static,
1456 crate::WireDeviceTransactResponse<'static>,
1457 ::fidl_next::WireI32,
1458 >;
1459 }
1460
1461 mod ___detail {
1462
1463 pub struct SetBitrate<T0> {
1464 bitrate: T0,
1465 }
1466
1467 impl<T0> ::fidl_next::Encodable for SetBitrate<T0>
1468 where
1469 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU32>,
1470 {
1471 type Encoded = crate::WireDeviceSetBitrateRequest;
1472 }
1473
1474 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetBitrate<T0>
1475 where
1476 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1477 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU32>,
1478 {
1479 #[inline]
1480 fn encode(
1481 self,
1482 encoder: &mut ___E,
1483 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1484 ) -> Result<(), ::fidl_next::EncodeError> {
1485 ::fidl_next::munge! {
1486 let Self::Encoded {
1487 bitrate,
1488
1489 } = out;
1490 }
1491
1492 ::fidl_next::Encode::encode(self.bitrate, encoder, bitrate)?;
1493
1494 Ok(())
1495 }
1496 }
1497
1498 pub struct Transact<T0> {
1499 op: T0,
1500 }
1501
1502 impl<T0> ::fidl_next::Encodable for Transact<T0>
1503 where
1504 T0: ::fidl_next::Encodable<
1505 Encoded = ::fidl_next::WireVector<'static, crate::WireI2cImplOp<'static>>,
1506 >,
1507 {
1508 type Encoded = crate::WireDeviceTransactRequest<'static>;
1509 }
1510
1511 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Transact<T0>
1512 where
1513 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1514 ___E: ::fidl_next::Encoder,
1515 T0: ::fidl_next::Encode<
1516 ___E,
1517 Encoded = ::fidl_next::WireVector<'static, crate::WireI2cImplOp<'static>>,
1518 >,
1519 {
1520 #[inline]
1521 fn encode(
1522 self,
1523 encoder: &mut ___E,
1524 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1525 ) -> Result<(), ::fidl_next::EncodeError> {
1526 ::fidl_next::munge! {
1527 let Self::Encoded {
1528 op,
1529
1530 } = out;
1531 }
1532
1533 ::fidl_next::Encode::encode(self.op, encoder, op)?;
1534
1535 Ok(())
1536 }
1537 }
1538
1539 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Device
1540 where
1541 ___T: ::fidl_next::Transport,
1542 {
1543 type ClientSender = DeviceClientSender<___T>;
1544 type ServerSender = DeviceServerSender<___T>;
1545 }
1546
1547 #[repr(transparent)]
1549 pub struct DeviceClientSender<___T: ::fidl_next::Transport> {
1550 #[allow(dead_code)]
1551 sender: ::fidl_next::protocol::ClientSender<___T>,
1552 }
1553
1554 impl<___T> DeviceClientSender<___T>
1555 where
1556 ___T: ::fidl_next::Transport,
1557 {
1558 pub fn get_max_transfer_size(
1559 &self,
1560 ) -> ::fidl_next::TwoWayFuture<'_, super::GetMaxTransferSize, ___T> {
1561 ::fidl_next::TwoWayFuture::from_untyped(
1562 self.sender.send_two_way(5122675640437495577, ()),
1563 )
1564 }
1565
1566 #[doc = " Sets the bitrate for the i2c bus in KHz units.\n"]
1567 pub fn set_bitrate(
1568 &self,
1569
1570 bitrate: impl ::fidl_next::Encode<
1571 <___T as ::fidl_next::Transport>::SendBuffer,
1572 Encoded = ::fidl_next::WireU32,
1573 >,
1574 ) -> ::fidl_next::TwoWayFuture<'_, super::SetBitrate, ___T>
1575 where
1576 <___T as ::fidl_next::Transport>::SendBuffer:
1577 ::fidl_next::encoder::InternalHandleEncoder,
1578 {
1579 self.set_bitrate_with(SetBitrate { bitrate })
1580 }
1581
1582 #[doc = " Sets the bitrate for the i2c bus in KHz units.\n"]
1583 pub fn set_bitrate_with<___R>(
1584 &self,
1585 request: ___R,
1586 ) -> ::fidl_next::TwoWayFuture<'_, super::SetBitrate, ___T>
1587 where
1588 ___R: ::fidl_next::Encode<
1589 <___T as ::fidl_next::Transport>::SendBuffer,
1590 Encoded = crate::WireDeviceSetBitrateRequest,
1591 >,
1592 {
1593 ::fidl_next::TwoWayFuture::from_untyped(
1594 self.sender.send_two_way(8193992212524563188, request),
1595 )
1596 }
1597
1598 #[doc = " |Transact| assumes that write ops write_data length are not zero.\n |Transact| assumes that at least the last op has stop set to true.\n\n For each read-transaction, there will be a corresponding ReadData\n returned. Write-transactions produce no data result.\n"]
1599 pub fn transact(
1600 &self,
1601
1602 op: impl ::fidl_next::Encode<
1603 <___T as ::fidl_next::Transport>::SendBuffer,
1604 Encoded = ::fidl_next::WireVector<'static, crate::WireI2cImplOp<'static>>,
1605 >,
1606 ) -> ::fidl_next::TwoWayFuture<'_, super::Transact, ___T>
1607 where
1608 <___T as ::fidl_next::Transport>::SendBuffer:
1609 ::fidl_next::encoder::InternalHandleEncoder,
1610 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1611 {
1612 self.transact_with(Transact { op })
1613 }
1614
1615 #[doc = " |Transact| assumes that write ops write_data length are not zero.\n |Transact| assumes that at least the last op has stop set to true.\n\n For each read-transaction, there will be a corresponding ReadData\n returned. Write-transactions produce no data result.\n"]
1616 pub fn transact_with<___R>(
1617 &self,
1618 request: ___R,
1619 ) -> ::fidl_next::TwoWayFuture<'_, super::Transact, ___T>
1620 where
1621 ___R: ::fidl_next::Encode<
1622 <___T as ::fidl_next::Transport>::SendBuffer,
1623 Encoded = crate::WireDeviceTransactRequest<'static>,
1624 >,
1625 {
1626 ::fidl_next::TwoWayFuture::from_untyped(
1627 self.sender.send_two_way(6461839908402215334, request),
1628 )
1629 }
1630 }
1631
1632 #[repr(transparent)]
1634 pub struct DeviceServerSender<___T: ::fidl_next::Transport> {
1635 sender: ::fidl_next::protocol::ServerSender<___T>,
1636 }
1637
1638 impl<___T> DeviceServerSender<___T> where ___T: ::fidl_next::Transport {}
1639 }
1640}
1641
1642pub trait DeviceClientHandler<
1646 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1647 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1648>
1649{
1650 fn on_unknown_interaction(
1651 &mut self,
1652 sender: &::fidl_next::ClientSender<Device, ___T>,
1653 ordinal: u64,
1654 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1655 sender.close();
1656 ::core::future::ready(())
1657 }
1658}
1659
1660impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
1661where
1662 ___H: DeviceClientHandler<___T> + ::core::marker::Send,
1663 ___T: ::fidl_next::Transport,
1664 <device::GetMaxTransferSize as ::fidl_next::Method>::Response:
1665 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1666 <device::SetBitrate as ::fidl_next::Method>::Response:
1667 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1668 <device::Transact as ::fidl_next::Method>::Response:
1669 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1670{
1671 async fn on_event(
1672 handler: &mut ___H,
1673 sender: &::fidl_next::ClientSender<Self, ___T>,
1674 ordinal: u64,
1675 buffer: ___T::RecvBuffer,
1676 ) {
1677 match ordinal {
1678 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
1679 }
1680 }
1681}
1682
1683pub trait DeviceServerHandler<
1687 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1688 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1689>
1690{
1691 fn get_max_transfer_size(
1692 &mut self,
1693 sender: &::fidl_next::ServerSender<Device, ___T>,
1694
1695 responder: ::fidl_next::Responder<device::GetMaxTransferSize>,
1696 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1697
1698 #[doc = " Sets the bitrate for the i2c bus in KHz units.\n"]
1699 fn set_bitrate(
1700 &mut self,
1701 sender: &::fidl_next::ServerSender<Device, ___T>,
1702
1703 request: ::fidl_next::Request<device::SetBitrate, ___T>,
1704
1705 responder: ::fidl_next::Responder<device::SetBitrate>,
1706 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1707
1708 #[doc = " |Transact| assumes that write ops write_data length are not zero.\n |Transact| assumes that at least the last op has stop set to true.\n\n For each read-transaction, there will be a corresponding ReadData\n returned. Write-transactions produce no data result.\n"]
1709 fn transact(
1710 &mut self,
1711 sender: &::fidl_next::ServerSender<Device, ___T>,
1712
1713 request: ::fidl_next::Request<device::Transact, ___T>,
1714
1715 responder: ::fidl_next::Responder<device::Transact>,
1716 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1717
1718 fn on_unknown_interaction(
1719 &mut self,
1720 sender: &::fidl_next::ServerSender<Device, ___T>,
1721 ordinal: u64,
1722 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1723 sender.close();
1724 ::core::future::ready(())
1725 }
1726}
1727
1728impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
1729where
1730 ___H: DeviceServerHandler<___T> + ::core::marker::Send,
1731 ___T: ::fidl_next::Transport,
1732 <device::SetBitrate as ::fidl_next::Method>::Request:
1733 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1734 <device::Transact as ::fidl_next::Method>::Request:
1735 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1736{
1737 async fn on_one_way(
1738 handler: &mut ___H,
1739 sender: &::fidl_next::ServerSender<Self, ___T>,
1740 ordinal: u64,
1741 buffer: ___T::RecvBuffer,
1742 ) {
1743 match ordinal {
1744 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
1745 }
1746 }
1747
1748 async fn on_two_way(
1749 handler: &mut ___H,
1750 sender: &::fidl_next::ServerSender<Self, ___T>,
1751 ordinal: u64,
1752 buffer: ___T::RecvBuffer,
1753 responder: ::fidl_next::protocol::Responder,
1754 ) {
1755 match ordinal {
1756 5122675640437495577 => {
1757 let responder = ::fidl_next::Responder::from_untyped(responder);
1758
1759 handler.get_max_transfer_size(sender, responder).await;
1760 }
1761
1762 8193992212524563188 => {
1763 let responder = ::fidl_next::Responder::from_untyped(responder);
1764
1765 match ::fidl_next::DecoderExt::decode(buffer) {
1766 Ok(decoded) => handler.set_bitrate(sender, decoded, responder).await,
1767 Err(e) => sender.close(),
1768 }
1769 }
1770
1771 6461839908402215334 => {
1772 let responder = ::fidl_next::Responder::from_untyped(responder);
1773
1774 match ::fidl_next::DecoderExt::decode(buffer) {
1775 Ok(decoded) => handler.transact(sender, decoded, responder).await,
1776 Err(e) => sender.close(),
1777 }
1778 }
1779
1780 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
1781 }
1782 }
1783}
1784
1785#[derive(Debug)]
1787pub struct Service;
1788
1789impl ::fidl_next::DiscoverableService for Service {
1790 const SERVICE_NAME: &'static str = "fuchsia.hardware.i2cimpl.Service";
1791 const MEMBER_NAMES: &'static [&'static str] = &["device"];
1792}
1793
1794impl<___C> ::fidl_next::Service<___C> for Service
1795where
1796 ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
1797{
1798 type Connector = ServiceConnector<___C>;
1799}
1800
1801#[repr(transparent)]
1803pub struct ServiceConnector<___C> {
1804 #[allow(dead_code)]
1805 connector: ___C,
1806}
1807
1808impl<___C> ServiceConnector<___C>
1809where
1810 ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
1811{
1812 pub fn device(
1814 &self,
1815 server_end: ::fidl_next::ServerEnd<crate::Device, ::fdf_fidl::DriverChannel>,
1816 ) -> Result<
1817 (),
1818 <___C as ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>>::Error,
1819 > {
1820 ::fidl_next::protocol::ServiceConnector::<::fdf_fidl::DriverChannel>::connect_to_member(
1821 &self.connector,
1822 "device",
1823 server_end.into_untyped(),
1824 )
1825 }
1826}
1827
1828pub trait ServiceHandler<___T> {
1830 fn device(&self, server_end: ::fidl_next::ServerEnd<crate::Device, ___T>);
1832}
1833
1834impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for Service
1835where
1836 ___H: ServiceHandler<___T>,
1837{
1838 fn on_connection(handler: &___H, member: &str, server_end: ___T) {
1839 match member {
1840 "device" => handler.device(::fidl_next::ServerEnd::from_untyped(server_end)),
1841
1842 _ => unreachable!(),
1843 }
1844 }
1845}
1846
1847pub mod compat {
1849
1850 #[cfg(feature = "driver")]
1851 impl ::fidl_next::CompatFrom<crate::DeviceGetMaxTransferSizeResponse>
1852 for ::fidl_fuchsia_hardware_i2cimpl::DeviceGetMaxTransferSizeResponse
1853 {
1854 #[inline]
1855 fn compat_from(value: crate::DeviceGetMaxTransferSizeResponse) -> Self {
1856 Self { size: ::fidl_next::CompatFrom::compat_from(value.size) }
1857 }
1858 }
1859
1860 #[cfg(feature = "driver")]
1861 impl ::fidl_next::CompatFrom<::fidl_fuchsia_hardware_i2cimpl::DeviceGetMaxTransferSizeResponse>
1862 for crate::DeviceGetMaxTransferSizeResponse
1863 {
1864 #[inline]
1865 fn compat_from(
1866 value: ::fidl_fuchsia_hardware_i2cimpl::DeviceGetMaxTransferSizeResponse,
1867 ) -> Self {
1868 Self { size: ::fidl_next::CompatFrom::compat_from(value.size) }
1869 }
1870 }
1871
1872 #[cfg(feature = "driver")]
1873 impl ::fidl_next::CompatFrom<crate::DeviceSetBitrateRequest>
1874 for ::fidl_fuchsia_hardware_i2cimpl::DeviceSetBitrateRequest
1875 {
1876 #[inline]
1877 fn compat_from(value: crate::DeviceSetBitrateRequest) -> Self {
1878 Self { bitrate: ::fidl_next::CompatFrom::compat_from(value.bitrate) }
1879 }
1880 }
1881
1882 #[cfg(feature = "driver")]
1883 impl ::fidl_next::CompatFrom<::fidl_fuchsia_hardware_i2cimpl::DeviceSetBitrateRequest>
1884 for crate::DeviceSetBitrateRequest
1885 {
1886 #[inline]
1887 fn compat_from(value: ::fidl_fuchsia_hardware_i2cimpl::DeviceSetBitrateRequest) -> Self {
1888 Self { bitrate: ::fidl_next::CompatFrom::compat_from(value.bitrate) }
1889 }
1890 }
1891
1892 impl ::fidl_next::CompatFrom<crate::I2cImplOpType>
1893 for ::fidl_fuchsia_hardware_i2cimpl::I2cImplOpType
1894 {
1895 fn compat_from(value: crate::I2cImplOpType) -> Self {
1896 match value {
1897 crate::I2cImplOpType::ReadSize(value) => {
1898 Self::ReadSize(::fidl_next::CompatFrom::compat_from(value))
1899 }
1900
1901 crate::I2cImplOpType::WriteData(value) => {
1902 Self::WriteData(::fidl_next::CompatFrom::compat_from(value))
1903 }
1904 }
1905 }
1906 }
1907
1908 impl ::fidl_next::CompatFrom<::fidl_fuchsia_hardware_i2cimpl::I2cImplOpType>
1909 for crate::I2cImplOpType
1910 {
1911 fn compat_from(value: ::fidl_fuchsia_hardware_i2cimpl::I2cImplOpType) -> Self {
1912 match value {
1913 ::fidl_fuchsia_hardware_i2cimpl::I2cImplOpType::ReadSize(value) => {
1914 Self::ReadSize(::fidl_next::CompatFrom::compat_from(value))
1915 }
1916
1917 ::fidl_fuchsia_hardware_i2cimpl::I2cImplOpType::WriteData(value) => {
1918 Self::WriteData(::fidl_next::CompatFrom::compat_from(value))
1919 }
1920 }
1921 }
1922 }
1923
1924 impl ::fidl_next::CompatFrom<crate::I2cImplOp> for ::fidl_fuchsia_hardware_i2cimpl::I2cImplOp {
1925 #[inline]
1926 fn compat_from(value: crate::I2cImplOp) -> Self {
1927 Self {
1928 address: ::fidl_next::CompatFrom::compat_from(value.address),
1929
1930 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
1931
1932 stop: ::fidl_next::CompatFrom::compat_from(value.stop),
1933 }
1934 }
1935 }
1936
1937 impl ::fidl_next::CompatFrom<::fidl_fuchsia_hardware_i2cimpl::I2cImplOp> for crate::I2cImplOp {
1938 #[inline]
1939 fn compat_from(value: ::fidl_fuchsia_hardware_i2cimpl::I2cImplOp) -> Self {
1940 Self {
1941 address: ::fidl_next::CompatFrom::compat_from(value.address),
1942
1943 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
1944
1945 stop: ::fidl_next::CompatFrom::compat_from(value.stop),
1946 }
1947 }
1948 }
1949
1950 #[cfg(feature = "driver")]
1951 impl ::fidl_next::CompatFrom<crate::DeviceTransactRequest>
1952 for ::fidl_fuchsia_hardware_i2cimpl::DeviceTransactRequest
1953 {
1954 #[inline]
1955 fn compat_from(value: crate::DeviceTransactRequest) -> Self {
1956 Self { op: ::fidl_next::CompatFrom::compat_from(value.op) }
1957 }
1958 }
1959
1960 #[cfg(feature = "driver")]
1961 impl ::fidl_next::CompatFrom<::fidl_fuchsia_hardware_i2cimpl::DeviceTransactRequest>
1962 for crate::DeviceTransactRequest
1963 {
1964 #[inline]
1965 fn compat_from(value: ::fidl_fuchsia_hardware_i2cimpl::DeviceTransactRequest) -> Self {
1966 Self { op: ::fidl_next::CompatFrom::compat_from(value.op) }
1967 }
1968 }
1969
1970 impl ::fidl_next::CompatFrom<crate::ReadData> for ::fidl_fuchsia_hardware_i2cimpl::ReadData {
1971 #[inline]
1972 fn compat_from(value: crate::ReadData) -> Self {
1973 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
1974 }
1975 }
1976
1977 impl ::fidl_next::CompatFrom<::fidl_fuchsia_hardware_i2cimpl::ReadData> for crate::ReadData {
1978 #[inline]
1979 fn compat_from(value: ::fidl_fuchsia_hardware_i2cimpl::ReadData) -> Self {
1980 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
1981 }
1982 }
1983
1984 #[cfg(feature = "driver")]
1985 impl ::fidl_next::CompatFrom<crate::DeviceTransactResponse>
1986 for ::fidl_fuchsia_hardware_i2cimpl::DeviceTransactResponse
1987 {
1988 #[inline]
1989 fn compat_from(value: crate::DeviceTransactResponse) -> Self {
1990 Self { read: ::fidl_next::CompatFrom::compat_from(value.read) }
1991 }
1992 }
1993
1994 #[cfg(feature = "driver")]
1995 impl ::fidl_next::CompatFrom<::fidl_fuchsia_hardware_i2cimpl::DeviceTransactResponse>
1996 for crate::DeviceTransactResponse
1997 {
1998 #[inline]
1999 fn compat_from(value: ::fidl_fuchsia_hardware_i2cimpl::DeviceTransactResponse) -> Self {
2000 Self { read: ::fidl_next::CompatFrom::compat_from(value.read) }
2001 }
2002 }
2003
2004 #[cfg(target_os = "fuchsia")]
2005 pub type DeviceProxy = ::fidl_next::ClientSender<crate::Device>;
2008
2009 #[cfg(feature = "driver")]
2010 impl ::fidl_next::CompatFrom<crate::Device> for ::fidl_fuchsia_hardware_i2cimpl::DeviceMarker {
2011 fn compat_from(_: crate::Device) -> Self {
2012 Self
2013 }
2014 }
2015
2016 #[cfg(feature = "driver")]
2017 impl ::fidl_next::CompatFrom<::fidl_fuchsia_hardware_i2cimpl::DeviceMarker> for crate::Device {
2018 fn compat_from(_: ::fidl_fuchsia_hardware_i2cimpl::DeviceMarker) -> Self {
2019 Self
2020 }
2021 }
2022}