Skip to main content

fidl_next_fuchsia_hardware_network/
fidl_next_fuchsia_hardware_network.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7    pub use fidl_next_common_fuchsia_hardware_network::natural::*;
8
9    #[doc = " A VMO that can be used for data-plane operations.\n"]
10    #[derive(Debug, Default, PartialEq)]
11    pub struct DataVmo {
12        pub id: ::core::option::Option<u8>,
13
14        pub vmo: ::core::option::Option<::fidl_next::fuchsia::zx::Vmo>,
15
16        pub num_rx_buffers: ::core::option::Option<u16>,
17    }
18
19    impl DataVmo {
20        fn __max_ordinal(&self) -> usize {
21            if self.num_rx_buffers.is_some() {
22                return 3;
23            }
24
25            if self.vmo.is_some() {
26                return 2;
27            }
28
29            if self.id.is_some() {
30                return 1;
31            }
32
33            0
34        }
35    }
36
37    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DataVmo<'static>, ___E> for DataVmo
38    where
39        ___E: ::fidl_next::Encoder + ?Sized,
40        ___E: ::fidl_next::fuchsia::HandleEncoder,
41    {
42        #[inline]
43        fn encode(
44            mut self,
45            encoder: &mut ___E,
46            out: &mut ::core::mem::MaybeUninit<crate::wire::DataVmo<'static>>,
47            _: (),
48        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
49            ::fidl_next::munge!(let crate::wire::DataVmo { table } = out);
50
51            let max_ord = self.__max_ordinal();
52
53            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
54            ::fidl_next::Wire::zero_padding(&mut out);
55
56            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
57                ::fidl_next::wire::Envelope,
58            >(encoder, max_ord);
59
60            for i in 1..=max_ord {
61                match i {
62                    3 => {
63                        if let Some(value) = self.num_rx_buffers.take() {
64                            ::fidl_next::wire::Envelope::encode_value::<
65                                ::fidl_next::wire::Uint16,
66                                ___E,
67                            >(
68                                value, preallocated.encoder, &mut out, ()
69                            )?;
70                        } else {
71                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
72                        }
73                    }
74
75                    2 => {
76                        if let Some(value) = self.vmo.take() {
77                            ::fidl_next::wire::Envelope::encode_value::<
78                                ::fidl_next::wire::fuchsia::Vmo,
79                                ___E,
80                            >(
81                                value, preallocated.encoder, &mut out, ()
82                            )?;
83                        } else {
84                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
85                        }
86                    }
87
88                    1 => {
89                        if let Some(value) = self.id.take() {
90                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
91                                value,
92                                preallocated.encoder,
93                                &mut out,
94                                (),
95                            )?;
96                        } else {
97                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
98                        }
99                    }
100
101                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
102                }
103                unsafe {
104                    preallocated.write_next(out.assume_init_ref());
105                }
106            }
107
108            ::fidl_next::wire::Table::encode_len(table, max_ord);
109
110            Ok(())
111        }
112    }
113
114    impl<'de> ::fidl_next::FromWire<crate::wire::DataVmo<'de>> for DataVmo {
115        #[inline]
116        fn from_wire(wire_: crate::wire::DataVmo<'de>) -> Self {
117            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
118
119            let id = wire_.table.get(1);
120
121            let vmo = wire_.table.get(2);
122
123            let num_rx_buffers = wire_.table.get(3);
124
125            Self {
126                id: id.map(|envelope| {
127                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
128                }),
129
130                vmo: vmo.map(|envelope| {
131                    ::fidl_next::FromWire::from_wire(unsafe {
132                        envelope.read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
133                    })
134                }),
135
136                num_rx_buffers: num_rx_buffers.map(|envelope| {
137                    ::fidl_next::FromWire::from_wire(unsafe {
138                        envelope.read_unchecked::<::fidl_next::wire::Uint16>()
139                    })
140                }),
141            }
142        }
143    }
144
145    #[derive(Debug, PartialEq)]
146    pub enum DelegatedRxLeaseHandle {
147        Channel(::fidl_next::fuchsia::zx::Channel),
148
149        Eventpair(::fidl_next::fuchsia::zx::EventPair),
150
151        UnknownOrdinal_(u64),
152    }
153
154    impl DelegatedRxLeaseHandle {
155        pub fn is_unknown(&self) -> bool {
156            #[allow(unreachable_patterns)]
157            match self {
158                Self::UnknownOrdinal_(_) => true,
159                _ => false,
160            }
161        }
162    }
163
164    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DelegatedRxLeaseHandle<'static>, ___E>
165        for DelegatedRxLeaseHandle
166    where
167        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
168        ___E: ::fidl_next::Encoder,
169        ___E: ::fidl_next::fuchsia::HandleEncoder,
170    {
171        #[inline]
172        fn encode(
173            self,
174            encoder: &mut ___E,
175            out: &mut ::core::mem::MaybeUninit<crate::wire::DelegatedRxLeaseHandle<'static>>,
176            _: (),
177        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
178            ::fidl_next::munge!(let crate::wire::DelegatedRxLeaseHandle { raw, _phantom: _ } = out);
179
180            match self {
181                Self::Channel(value) => ::fidl_next::wire::Union::encode_as::<
182                    ___E,
183                    ::fidl_next::wire::fuchsia::Channel,
184                >(value, 1, encoder, raw, ())?,
185
186                Self::Eventpair(value) => ::fidl_next::wire::Union::encode_as::<
187                    ___E,
188                    ::fidl_next::wire::fuchsia::EventPair,
189                >(value, 2, encoder, raw, ())?,
190
191                Self::UnknownOrdinal_(ordinal) => {
192                    return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
193                }
194            }
195
196            Ok(())
197        }
198    }
199
200    unsafe impl<___E>
201        ::fidl_next::EncodeOption<crate::wire_optional::DelegatedRxLeaseHandle<'static>, ___E>
202        for DelegatedRxLeaseHandle
203    where
204        ___E: ?Sized,
205        DelegatedRxLeaseHandle:
206            ::fidl_next::Encode<crate::wire::DelegatedRxLeaseHandle<'static>, ___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                crate::wire_optional::DelegatedRxLeaseHandle<'static>,
214            >,
215            _: (),
216        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
217            ::fidl_next::munge!(let crate::wire_optional::DelegatedRxLeaseHandle { raw, _phantom: _ } = &mut *out);
218
219            if let Some(inner) = this {
220                let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
221                ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
222            } else {
223                ::fidl_next::wire::Union::encode_absent(raw);
224            }
225
226            Ok(())
227        }
228    }
229
230    impl<'de> ::fidl_next::FromWire<crate::wire::DelegatedRxLeaseHandle<'de>>
231        for DelegatedRxLeaseHandle
232    {
233        #[inline]
234        fn from_wire(wire: crate::wire::DelegatedRxLeaseHandle<'de>) -> Self {
235            let wire = ::core::mem::ManuallyDrop::new(wire);
236            match wire.raw.ordinal() {
237                1 => Self::Channel(::fidl_next::FromWire::from_wire(unsafe {
238                    wire.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Channel>()
239                })),
240
241                2 => Self::Eventpair(::fidl_next::FromWire::from_wire(unsafe {
242                    wire.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
243                })),
244
245                ord => return Self::UnknownOrdinal_(ord as u64),
246            }
247        }
248    }
249
250    impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DelegatedRxLeaseHandle<'de>>
251        for DelegatedRxLeaseHandle
252    {
253        #[inline]
254        fn from_wire_option(
255            wire: crate::wire_optional::DelegatedRxLeaseHandle<'de>,
256        ) -> ::core::option::Option<Self> {
257            if let Some(inner) = wire.into_option() {
258                Some(::fidl_next::FromWire::from_wire(inner))
259            } else {
260                None
261            }
262        }
263    }
264
265    impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DelegatedRxLeaseHandle<'de>>
266        for Box<DelegatedRxLeaseHandle>
267    {
268        #[inline]
269        fn from_wire_option(
270            wire: crate::wire_optional::DelegatedRxLeaseHandle<'de>,
271        ) -> ::core::option::Option<Self> {
272            <DelegatedRxLeaseHandle as ::fidl_next::FromWireOption<
273                crate::wire_optional::DelegatedRxLeaseHandle<'de>,
274            >>::from_wire_option(wire)
275            .map(Box::new)
276        }
277    }
278
279    #[doc = " An acquired lease that is propagated up to applications.\n"]
280    #[derive(Debug, Default, PartialEq)]
281    pub struct DelegatedRxLease {
282        pub hold_until_frame: ::core::option::Option<u64>,
283
284        pub handle: ::core::option::Option<crate::natural::DelegatedRxLeaseHandle>,
285    }
286
287    impl DelegatedRxLease {
288        fn __max_ordinal(&self) -> usize {
289            if self.handle.is_some() {
290                return 2;
291            }
292
293            if self.hold_until_frame.is_some() {
294                return 1;
295            }
296
297            0
298        }
299    }
300
301    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DelegatedRxLease<'static>, ___E>
302        for DelegatedRxLease
303    where
304        ___E: ::fidl_next::Encoder + ?Sized,
305        ___E: ::fidl_next::fuchsia::HandleEncoder,
306    {
307        #[inline]
308        fn encode(
309            mut self,
310            encoder: &mut ___E,
311            out: &mut ::core::mem::MaybeUninit<crate::wire::DelegatedRxLease<'static>>,
312            _: (),
313        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
314            ::fidl_next::munge!(let crate::wire::DelegatedRxLease { table } = out);
315
316            let max_ord = self.__max_ordinal();
317
318            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
319            ::fidl_next::Wire::zero_padding(&mut out);
320
321            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
322                ::fidl_next::wire::Envelope,
323            >(encoder, max_ord);
324
325            for i in 1..=max_ord {
326                match i {
327                    2 => {
328                        if let Some(value) = self.handle.take() {
329                            ::fidl_next::wire::Envelope::encode_value::<
330                                crate::wire::DelegatedRxLeaseHandle<'static>,
331                                ___E,
332                            >(
333                                value, preallocated.encoder, &mut out, ()
334                            )?;
335                        } else {
336                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
337                        }
338                    }
339
340                    1 => {
341                        if let Some(value) = self.hold_until_frame.take() {
342                            ::fidl_next::wire::Envelope::encode_value::<
343                                ::fidl_next::wire::Uint64,
344                                ___E,
345                            >(
346                                value, preallocated.encoder, &mut out, ()
347                            )?;
348                        } else {
349                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
350                        }
351                    }
352
353                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
354                }
355                unsafe {
356                    preallocated.write_next(out.assume_init_ref());
357                }
358            }
359
360            ::fidl_next::wire::Table::encode_len(table, max_ord);
361
362            Ok(())
363        }
364    }
365
366    impl<'de> ::fidl_next::FromWire<crate::wire::DelegatedRxLease<'de>> for DelegatedRxLease {
367        #[inline]
368        fn from_wire(wire_: crate::wire::DelegatedRxLease<'de>) -> Self {
369            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
370
371            let hold_until_frame = wire_.table.get(1);
372
373            let handle = wire_.table.get(2);
374
375            Self {
376                hold_until_frame: hold_until_frame.map(|envelope| {
377                    ::fidl_next::FromWire::from_wire(unsafe {
378                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
379                    })
380                }),
381
382                handle: handle.map(|envelope| {
383                    ::fidl_next::FromWire::from_wire(unsafe {
384                        envelope.read_unchecked::<crate::wire::DelegatedRxLeaseHandle<'de>>()
385                    })
386                }),
387            }
388        }
389    }
390
391    #[doc = " Session configuration.\n"]
392    #[derive(Debug, Default, PartialEq)]
393    pub struct SessionInfo {
394        pub descriptors: ::core::option::Option<::fidl_next::fuchsia::zx::Vmo>,
395
396        pub data: ::core::option::Option<::std::vec::Vec<crate::natural::DataVmo>>,
397
398        pub descriptor_version: ::core::option::Option<u8>,
399
400        pub descriptor_length: ::core::option::Option<u8>,
401
402        pub descriptor_count: ::core::option::Option<u16>,
403
404        pub options: ::core::option::Option<crate::natural::SessionFlags>,
405    }
406
407    impl SessionInfo {
408        fn __max_ordinal(&self) -> usize {
409            if self.options.is_some() {
410                return 6;
411            }
412
413            if self.descriptor_count.is_some() {
414                return 5;
415            }
416
417            if self.descriptor_length.is_some() {
418                return 4;
419            }
420
421            if self.descriptor_version.is_some() {
422                return 3;
423            }
424
425            if self.data.is_some() {
426                return 2;
427            }
428
429            if self.descriptors.is_some() {
430                return 1;
431            }
432
433            0
434        }
435    }
436
437    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SessionInfo<'static>, ___E> for SessionInfo
438    where
439        ___E: ::fidl_next::Encoder + ?Sized,
440        ___E: ::fidl_next::fuchsia::HandleEncoder,
441    {
442        #[inline]
443        fn encode(
444            mut self,
445            encoder: &mut ___E,
446            out: &mut ::core::mem::MaybeUninit<crate::wire::SessionInfo<'static>>,
447            _: (),
448        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
449            ::fidl_next::munge!(let crate::wire::SessionInfo { table } = out);
450
451            let max_ord = self.__max_ordinal();
452
453            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
454            ::fidl_next::Wire::zero_padding(&mut out);
455
456            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
457                ::fidl_next::wire::Envelope,
458            >(encoder, max_ord);
459
460            for i in 1..=max_ord {
461                match i {
462                    6 => {
463                        if let Some(value) = self.options.take() {
464                            ::fidl_next::wire::Envelope::encode_value::<
465                                crate::wire::SessionFlags,
466                                ___E,
467                            >(
468                                value, preallocated.encoder, &mut out, ()
469                            )?;
470                        } else {
471                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
472                        }
473                    }
474
475                    5 => {
476                        if let Some(value) = self.descriptor_count.take() {
477                            ::fidl_next::wire::Envelope::encode_value::<
478                                ::fidl_next::wire::Uint16,
479                                ___E,
480                            >(
481                                value, preallocated.encoder, &mut out, ()
482                            )?;
483                        } else {
484                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
485                        }
486                    }
487
488                    4 => {
489                        if let Some(value) = self.descriptor_length.take() {
490                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
491                                value,
492                                preallocated.encoder,
493                                &mut out,
494                                (),
495                            )?;
496                        } else {
497                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
498                        }
499                    }
500
501                    3 => {
502                        if let Some(value) = self.descriptor_version.take() {
503                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
504                                value,
505                                preallocated.encoder,
506                                &mut out,
507                                (),
508                            )?;
509                        } else {
510                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
511                        }
512                    }
513
514                    2 => {
515                        if let Some(value) = self.data.take() {
516                            ::fidl_next::wire::Envelope::encode_value::<
517                                ::fidl_next::wire::Vector<'static, crate::wire::DataVmo<'static>>,
518                                ___E,
519                            >(
520                                value, preallocated.encoder, &mut out, (32, ())
521                            )?;
522                        } else {
523                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
524                        }
525                    }
526
527                    1 => {
528                        if let Some(value) = self.descriptors.take() {
529                            ::fidl_next::wire::Envelope::encode_value::<
530                                ::fidl_next::wire::fuchsia::Vmo,
531                                ___E,
532                            >(
533                                value, preallocated.encoder, &mut out, ()
534                            )?;
535                        } else {
536                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
537                        }
538                    }
539
540                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
541                }
542                unsafe {
543                    preallocated.write_next(out.assume_init_ref());
544                }
545            }
546
547            ::fidl_next::wire::Table::encode_len(table, max_ord);
548
549            Ok(())
550        }
551    }
552
553    impl<'de> ::fidl_next::FromWire<crate::wire::SessionInfo<'de>> for SessionInfo {
554        #[inline]
555        fn from_wire(wire_: crate::wire::SessionInfo<'de>) -> Self {
556            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
557
558            let descriptors = wire_.table.get(1);
559
560            let data = wire_.table.get(2);
561
562            let descriptor_version = wire_.table.get(3);
563
564            let descriptor_length = wire_.table.get(4);
565
566            let descriptor_count = wire_.table.get(5);
567
568            let options = wire_.table.get(6);
569
570            Self {
571
572
573                descriptors: descriptors.map(|envelope| ::fidl_next::FromWire::from_wire(
574                    unsafe { envelope.read_unchecked::<::fidl_next::wire::fuchsia::Vmo>() }
575                )),
576
577
578                data: data.map(|envelope| ::fidl_next::FromWire::from_wire(
579                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DataVmo<'de>>>() }
580                )),
581
582
583                descriptor_version: descriptor_version.map(|envelope| ::fidl_next::FromWire::from_wire(
584                    unsafe { envelope.read_unchecked::<u8>() }
585                )),
586
587
588                descriptor_length: descriptor_length.map(|envelope| ::fidl_next::FromWire::from_wire(
589                    unsafe { envelope.read_unchecked::<u8>() }
590                )),
591
592
593                descriptor_count: descriptor_count.map(|envelope| ::fidl_next::FromWire::from_wire(
594                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint16>() }
595                )),
596
597
598                options: options.map(|envelope| ::fidl_next::FromWire::from_wire(
599                    unsafe { envelope.read_unchecked::<crate::wire::SessionFlags>() }
600                )),
601
602        }
603        }
604    }
605
606    #[derive(Debug, PartialEq)]
607    pub struct DeviceOpenSessionRequest {
608        pub session_name: ::std::string::String,
609
610        pub session_info: crate::natural::SessionInfo,
611    }
612
613    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceOpenSessionRequest<'static>, ___E>
614        for DeviceOpenSessionRequest
615    where
616        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
617        ___E: ::fidl_next::Encoder,
618        ___E: ::fidl_next::fuchsia::HandleEncoder,
619    {
620        #[inline]
621        fn encode(
622            self,
623            encoder_: &mut ___E,
624            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceOpenSessionRequest<'static>>,
625            _: (),
626        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
627            ::fidl_next::munge! {
628                let crate::wire::DeviceOpenSessionRequest {
629                    session_name,
630                    session_info,
631
632                } = out_;
633            }
634
635            ::fidl_next::Encode::encode(self.session_name, encoder_, session_name, 64)?;
636
637            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(session_name.as_mut_ptr()) };
638            ::fidl_next::Constrained::validate(_field, 64)?;
639
640            ::fidl_next::Encode::encode(self.session_info, encoder_, session_info, ())?;
641
642            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(session_info.as_mut_ptr()) };
643
644            Ok(())
645        }
646    }
647
648    unsafe impl<___E>
649        ::fidl_next::EncodeOption<
650            ::fidl_next::wire::Box<'static, crate::wire::DeviceOpenSessionRequest<'static>>,
651            ___E,
652        > for DeviceOpenSessionRequest
653    where
654        ___E: ::fidl_next::Encoder + ?Sized,
655        DeviceOpenSessionRequest:
656            ::fidl_next::Encode<crate::wire::DeviceOpenSessionRequest<'static>, ___E>,
657    {
658        #[inline]
659        fn encode_option(
660            this: ::core::option::Option<Self>,
661            encoder: &mut ___E,
662            out: &mut ::core::mem::MaybeUninit<
663                ::fidl_next::wire::Box<'static, crate::wire::DeviceOpenSessionRequest<'static>>,
664            >,
665            _: (),
666        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
667            if let Some(inner) = this {
668                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
669                ::fidl_next::wire::Box::encode_present(out);
670            } else {
671                ::fidl_next::wire::Box::encode_absent(out);
672            }
673
674            Ok(())
675        }
676    }
677
678    impl<'de> ::fidl_next::FromWire<crate::wire::DeviceOpenSessionRequest<'de>>
679        for DeviceOpenSessionRequest
680    {
681        #[inline]
682        fn from_wire(wire: crate::wire::DeviceOpenSessionRequest<'de>) -> Self {
683            Self {
684                session_name: ::fidl_next::FromWire::from_wire(wire.session_name),
685
686                session_info: ::fidl_next::FromWire::from_wire(wire.session_info),
687            }
688        }
689    }
690
691    #[doc = " Data-plane FIFOs.\n"]
692    #[derive(Debug, PartialEq)]
693    #[repr(C)]
694    pub struct Fifos {
695        pub rx: ::fidl_next::fuchsia::zx::Fifo,
696
697        pub tx: ::fidl_next::fuchsia::zx::Fifo,
698    }
699
700    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Fifos, ___E> for Fifos
701    where
702        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
703        ___E: ::fidl_next::fuchsia::HandleEncoder,
704    {
705        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::Fifos> = unsafe {
706            ::fidl_next::CopyOptimization::enable_if(
707                true && <::fidl_next::fuchsia::zx::Fifo as ::fidl_next::Encode<
708                    ::fidl_next::wire::fuchsia::Fifo,
709                    ___E,
710                >>::COPY_OPTIMIZATION
711                    .is_enabled()
712                    && <::fidl_next::fuchsia::zx::Fifo as ::fidl_next::Encode<
713                        ::fidl_next::wire::fuchsia::Fifo,
714                        ___E,
715                    >>::COPY_OPTIMIZATION
716                        .is_enabled(),
717            )
718        };
719
720        #[inline]
721        fn encode(
722            self,
723            encoder_: &mut ___E,
724            out_: &mut ::core::mem::MaybeUninit<crate::wire::Fifos>,
725            _: (),
726        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
727            ::fidl_next::munge! {
728                let crate::wire::Fifos {
729                    rx,
730                    tx,
731
732                } = out_;
733            }
734
735            ::fidl_next::Encode::encode(self.rx, encoder_, rx, ())?;
736
737            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rx.as_mut_ptr()) };
738
739            ::fidl_next::Encode::encode(self.tx, encoder_, tx, ())?;
740
741            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tx.as_mut_ptr()) };
742
743            Ok(())
744        }
745    }
746
747    unsafe impl<___E>
748        ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Fifos>, ___E>
749        for Fifos
750    where
751        ___E: ::fidl_next::Encoder + ?Sized,
752        Fifos: ::fidl_next::Encode<crate::wire::Fifos, ___E>,
753    {
754        #[inline]
755        fn encode_option(
756            this: ::core::option::Option<Self>,
757            encoder: &mut ___E,
758            out: &mut ::core::mem::MaybeUninit<::fidl_next::wire::Box<'static, crate::wire::Fifos>>,
759            _: (),
760        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
761            if let Some(inner) = this {
762                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
763                ::fidl_next::wire::Box::encode_present(out);
764            } else {
765                ::fidl_next::wire::Box::encode_absent(out);
766            }
767
768            Ok(())
769        }
770    }
771
772    impl ::fidl_next::FromWire<crate::wire::Fifos> for Fifos {
773        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::Fifos, Self> = unsafe {
774            ::fidl_next::CopyOptimization::enable_if(
775                true && <::fidl_next::fuchsia::zx::Fifo as ::fidl_next::FromWire<
776                    ::fidl_next::wire::fuchsia::Fifo,
777                >>::COPY_OPTIMIZATION
778                    .is_enabled()
779                    && <::fidl_next::fuchsia::zx::Fifo as ::fidl_next::FromWire<
780                        ::fidl_next::wire::fuchsia::Fifo,
781                    >>::COPY_OPTIMIZATION
782                        .is_enabled(),
783            )
784        };
785
786        #[inline]
787        fn from_wire(wire: crate::wire::Fifos) -> Self {
788            Self {
789                rx: ::fidl_next::FromWire::from_wire(wire.rx),
790
791                tx: ::fidl_next::FromWire::from_wire(wire.tx),
792            }
793        }
794    }
795
796    #[derive(Debug, PartialEq)]
797    #[repr(C)]
798    pub struct DeviceOpenSessionResponse {
799        pub session: ::fidl_next::ClientEnd<crate::Session, ::fidl_next::fuchsia::zx::Channel>,
800
801        pub fifos: crate::natural::Fifos,
802    }
803
804    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceOpenSessionResponse, ___E>
805        for DeviceOpenSessionResponse
806    where
807        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
808        ___E: ::fidl_next::fuchsia::HandleEncoder,
809    {
810        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
811            Self,
812            crate::wire::DeviceOpenSessionResponse,
813        > = unsafe {
814            ::fidl_next::CopyOptimization::enable_if(
815            true
816
817                && <
818                    ::fidl_next::ClientEnd<crate::Session, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encode<::fidl_next::ClientEnd<crate::Session, ::fidl_next::wire::fuchsia::Channel>, ___E>
819                >::COPY_OPTIMIZATION.is_enabled()
820
821                && <
822                    crate::natural::Fifos as ::fidl_next::Encode<crate::wire::Fifos, ___E>
823                >::COPY_OPTIMIZATION.is_enabled()
824
825        )
826        };
827
828        #[inline]
829        fn encode(
830            self,
831            encoder_: &mut ___E,
832            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceOpenSessionResponse>,
833            _: (),
834        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
835            ::fidl_next::munge! {
836                let crate::wire::DeviceOpenSessionResponse {
837                    session,
838                    fifos,
839
840                } = out_;
841            }
842
843            ::fidl_next::Encode::encode(self.session, encoder_, session, ())?;
844
845            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(session.as_mut_ptr()) };
846
847            ::fidl_next::Encode::encode(self.fifos, encoder_, fifos, ())?;
848
849            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fifos.as_mut_ptr()) };
850
851            Ok(())
852        }
853    }
854
855    unsafe impl<___E>
856        ::fidl_next::EncodeOption<
857            ::fidl_next::wire::Box<'static, crate::wire::DeviceOpenSessionResponse>,
858            ___E,
859        > for DeviceOpenSessionResponse
860    where
861        ___E: ::fidl_next::Encoder + ?Sized,
862        DeviceOpenSessionResponse:
863            ::fidl_next::Encode<crate::wire::DeviceOpenSessionResponse, ___E>,
864    {
865        #[inline]
866        fn encode_option(
867            this: ::core::option::Option<Self>,
868            encoder: &mut ___E,
869            out: &mut ::core::mem::MaybeUninit<
870                ::fidl_next::wire::Box<'static, crate::wire::DeviceOpenSessionResponse>,
871            >,
872            _: (),
873        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
874            if let Some(inner) = this {
875                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
876                ::fidl_next::wire::Box::encode_present(out);
877            } else {
878                ::fidl_next::wire::Box::encode_absent(out);
879            }
880
881            Ok(())
882        }
883    }
884
885    impl ::fidl_next::FromWire<crate::wire::DeviceOpenSessionResponse> for DeviceOpenSessionResponse {
886        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
887            crate::wire::DeviceOpenSessionResponse,
888            Self,
889        > = unsafe {
890            ::fidl_next::CopyOptimization::enable_if(
891            true
892
893                && <
894                    ::fidl_next::ClientEnd<crate::Session, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ClientEnd<crate::Session, ::fidl_next::wire::fuchsia::Channel>>
895                >::COPY_OPTIMIZATION.is_enabled()
896
897                && <
898                    crate::natural::Fifos as ::fidl_next::FromWire<crate::wire::Fifos>
899                >::COPY_OPTIMIZATION.is_enabled()
900
901        )
902        };
903
904        #[inline]
905        fn from_wire(wire: crate::wire::DeviceOpenSessionResponse) -> Self {
906            Self {
907                session: ::fidl_next::FromWire::from_wire(wire.session),
908
909                fifos: ::fidl_next::FromWire::from_wire(wire.fifos),
910            }
911        }
912    }
913
914    #[derive(Debug, PartialEq)]
915    pub struct DeviceGetPortRequest {
916        pub id: crate::natural::PortId,
917
918        pub port: ::fidl_next::ServerEnd<crate::Port, ::fidl_next::fuchsia::zx::Channel>,
919    }
920
921    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetPortRequest, ___E>
922        for DeviceGetPortRequest
923    where
924        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
925        ___E: ::fidl_next::fuchsia::HandleEncoder,
926    {
927        #[inline]
928        fn encode(
929            self,
930            encoder_: &mut ___E,
931            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPortRequest>,
932            _: (),
933        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
934            ::fidl_next::munge! {
935                let crate::wire::DeviceGetPortRequest {
936                    id,
937                    port,
938
939                } = out_;
940            }
941
942            ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
943
944            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(id.as_mut_ptr()) };
945
946            ::fidl_next::Encode::encode(self.port, encoder_, port, ())?;
947
948            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(port.as_mut_ptr()) };
949
950            Ok(())
951        }
952    }
953
954    unsafe impl<___E>
955        ::fidl_next::EncodeOption<
956            ::fidl_next::wire::Box<'static, crate::wire::DeviceGetPortRequest>,
957            ___E,
958        > for DeviceGetPortRequest
959    where
960        ___E: ::fidl_next::Encoder + ?Sized,
961        DeviceGetPortRequest: ::fidl_next::Encode<crate::wire::DeviceGetPortRequest, ___E>,
962    {
963        #[inline]
964        fn encode_option(
965            this: ::core::option::Option<Self>,
966            encoder: &mut ___E,
967            out: &mut ::core::mem::MaybeUninit<
968                ::fidl_next::wire::Box<'static, crate::wire::DeviceGetPortRequest>,
969            >,
970            _: (),
971        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
972            if let Some(inner) = this {
973                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
974                ::fidl_next::wire::Box::encode_present(out);
975            } else {
976                ::fidl_next::wire::Box::encode_absent(out);
977            }
978
979            Ok(())
980        }
981    }
982
983    impl ::fidl_next::FromWire<crate::wire::DeviceGetPortRequest> for DeviceGetPortRequest {
984        #[inline]
985        fn from_wire(wire: crate::wire::DeviceGetPortRequest) -> Self {
986            Self {
987                id: ::fidl_next::FromWire::from_wire(wire.id),
988
989                port: ::fidl_next::FromWire::from_wire(wire.port),
990            }
991        }
992    }
993
994    #[derive(Debug, PartialEq)]
995    #[repr(C)]
996    pub struct DeviceGetPortWatcherRequest {
997        pub watcher: ::fidl_next::ServerEnd<crate::PortWatcher, ::fidl_next::fuchsia::zx::Channel>,
998    }
999
1000    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetPortWatcherRequest, ___E>
1001        for DeviceGetPortWatcherRequest
1002    where
1003        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1004        ___E: ::fidl_next::fuchsia::HandleEncoder,
1005    {
1006        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1007            Self,
1008            crate::wire::DeviceGetPortWatcherRequest,
1009        > = unsafe {
1010            ::fidl_next::CopyOptimization::enable_if(
1011                true && <::fidl_next::ServerEnd<
1012                    crate::PortWatcher,
1013                    ::fidl_next::fuchsia::zx::Channel,
1014                > as ::fidl_next::Encode<
1015                    ::fidl_next::ServerEnd<crate::PortWatcher, ::fidl_next::wire::fuchsia::Channel>,
1016                    ___E,
1017                >>::COPY_OPTIMIZATION
1018                    .is_enabled(),
1019            )
1020        };
1021
1022        #[inline]
1023        fn encode(
1024            self,
1025            encoder_: &mut ___E,
1026            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPortWatcherRequest>,
1027            _: (),
1028        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1029            ::fidl_next::munge! {
1030                let crate::wire::DeviceGetPortWatcherRequest {
1031                    watcher,
1032
1033                } = out_;
1034            }
1035
1036            ::fidl_next::Encode::encode(self.watcher, encoder_, watcher, ())?;
1037
1038            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(watcher.as_mut_ptr()) };
1039
1040            Ok(())
1041        }
1042    }
1043
1044    unsafe impl<___E>
1045        ::fidl_next::EncodeOption<
1046            ::fidl_next::wire::Box<'static, crate::wire::DeviceGetPortWatcherRequest>,
1047            ___E,
1048        > for DeviceGetPortWatcherRequest
1049    where
1050        ___E: ::fidl_next::Encoder + ?Sized,
1051        DeviceGetPortWatcherRequest:
1052            ::fidl_next::Encode<crate::wire::DeviceGetPortWatcherRequest, ___E>,
1053    {
1054        #[inline]
1055        fn encode_option(
1056            this: ::core::option::Option<Self>,
1057            encoder: &mut ___E,
1058            out: &mut ::core::mem::MaybeUninit<
1059                ::fidl_next::wire::Box<'static, crate::wire::DeviceGetPortWatcherRequest>,
1060            >,
1061            _: (),
1062        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1063            if let Some(inner) = this {
1064                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1065                ::fidl_next::wire::Box::encode_present(out);
1066            } else {
1067                ::fidl_next::wire::Box::encode_absent(out);
1068            }
1069
1070            Ok(())
1071        }
1072    }
1073
1074    impl ::fidl_next::FromWire<crate::wire::DeviceGetPortWatcherRequest>
1075        for DeviceGetPortWatcherRequest
1076    {
1077        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1078            crate::wire::DeviceGetPortWatcherRequest,
1079            Self,
1080        > = unsafe {
1081            ::fidl_next::CopyOptimization::enable_if(
1082                true && <::fidl_next::ServerEnd<
1083                    crate::PortWatcher,
1084                    ::fidl_next::fuchsia::zx::Channel,
1085                > as ::fidl_next::FromWire<
1086                    ::fidl_next::ServerEnd<crate::PortWatcher, ::fidl_next::wire::fuchsia::Channel>,
1087                >>::COPY_OPTIMIZATION
1088                    .is_enabled(),
1089            )
1090        };
1091
1092        #[inline]
1093        fn from_wire(wire: crate::wire::DeviceGetPortWatcherRequest) -> Self {
1094            Self { watcher: ::fidl_next::FromWire::from_wire(wire.watcher) }
1095        }
1096    }
1097
1098    #[derive(Debug, PartialEq)]
1099    #[repr(C)]
1100    pub struct DeviceCloneRequest {
1101        pub device: ::fidl_next::ServerEnd<crate::Device, ::fidl_next::fuchsia::zx::Channel>,
1102    }
1103
1104    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceCloneRequest, ___E> for DeviceCloneRequest
1105    where
1106        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1107        ___E: ::fidl_next::fuchsia::HandleEncoder,
1108    {
1109        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1110            Self,
1111            crate::wire::DeviceCloneRequest,
1112        > = unsafe {
1113            ::fidl_next::CopyOptimization::enable_if(
1114            true
1115
1116                && <
1117                    ::fidl_next::ServerEnd<crate::Device, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encode<::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>, ___E>
1118                >::COPY_OPTIMIZATION.is_enabled()
1119
1120        )
1121        };
1122
1123        #[inline]
1124        fn encode(
1125            self,
1126            encoder_: &mut ___E,
1127            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceCloneRequest>,
1128            _: (),
1129        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1130            ::fidl_next::munge! {
1131                let crate::wire::DeviceCloneRequest {
1132                    device,
1133
1134                } = out_;
1135            }
1136
1137            ::fidl_next::Encode::encode(self.device, encoder_, device, ())?;
1138
1139            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(device.as_mut_ptr()) };
1140
1141            Ok(())
1142        }
1143    }
1144
1145    unsafe impl<___E>
1146        ::fidl_next::EncodeOption<
1147            ::fidl_next::wire::Box<'static, crate::wire::DeviceCloneRequest>,
1148            ___E,
1149        > for DeviceCloneRequest
1150    where
1151        ___E: ::fidl_next::Encoder + ?Sized,
1152        DeviceCloneRequest: ::fidl_next::Encode<crate::wire::DeviceCloneRequest, ___E>,
1153    {
1154        #[inline]
1155        fn encode_option(
1156            this: ::core::option::Option<Self>,
1157            encoder: &mut ___E,
1158            out: &mut ::core::mem::MaybeUninit<
1159                ::fidl_next::wire::Box<'static, crate::wire::DeviceCloneRequest>,
1160            >,
1161            _: (),
1162        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1163            if let Some(inner) = this {
1164                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1165                ::fidl_next::wire::Box::encode_present(out);
1166            } else {
1167                ::fidl_next::wire::Box::encode_absent(out);
1168            }
1169
1170            Ok(())
1171        }
1172    }
1173
1174    impl ::fidl_next::FromWire<crate::wire::DeviceCloneRequest> for DeviceCloneRequest {
1175        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1176            crate::wire::DeviceCloneRequest,
1177            Self,
1178        > = unsafe {
1179            ::fidl_next::CopyOptimization::enable_if(
1180            true
1181
1182                && <
1183                    ::fidl_next::ServerEnd<crate::Device, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>>
1184                >::COPY_OPTIMIZATION.is_enabled()
1185
1186        )
1187        };
1188
1189        #[inline]
1190        fn from_wire(wire: crate::wire::DeviceCloneRequest) -> Self {
1191            Self { device: ::fidl_next::FromWire::from_wire(wire.device) }
1192        }
1193    }
1194
1195    #[derive(Debug, PartialEq)]
1196    #[repr(C)]
1197    pub struct PortGetStatusWatcherRequest {
1198        pub watcher:
1199            ::fidl_next::ServerEnd<crate::StatusWatcher, ::fidl_next::fuchsia::zx::Channel>,
1200
1201        pub buffer: u32,
1202    }
1203
1204    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PortGetStatusWatcherRequest, ___E>
1205        for PortGetStatusWatcherRequest
1206    where
1207        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1208        ___E: ::fidl_next::fuchsia::HandleEncoder,
1209    {
1210        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1211            Self,
1212            crate::wire::PortGetStatusWatcherRequest,
1213        > = unsafe {
1214            ::fidl_next::CopyOptimization::enable_if(
1215            true
1216
1217                && <
1218                    ::fidl_next::ServerEnd<crate::StatusWatcher, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encode<::fidl_next::ServerEnd<crate::StatusWatcher, ::fidl_next::wire::fuchsia::Channel>, ___E>
1219                >::COPY_OPTIMIZATION.is_enabled()
1220
1221                && <
1222                    u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
1223                >::COPY_OPTIMIZATION.is_enabled()
1224
1225        )
1226        };
1227
1228        #[inline]
1229        fn encode(
1230            self,
1231            encoder_: &mut ___E,
1232            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetStatusWatcherRequest>,
1233            _: (),
1234        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1235            ::fidl_next::munge! {
1236                let crate::wire::PortGetStatusWatcherRequest {
1237                    watcher,
1238                    buffer,
1239
1240                } = out_;
1241            }
1242
1243            ::fidl_next::Encode::encode(self.watcher, encoder_, watcher, ())?;
1244
1245            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(watcher.as_mut_ptr()) };
1246
1247            ::fidl_next::Encode::encode(self.buffer, encoder_, buffer, ())?;
1248
1249            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(buffer.as_mut_ptr()) };
1250
1251            Ok(())
1252        }
1253    }
1254
1255    unsafe impl<___E>
1256        ::fidl_next::EncodeOption<
1257            ::fidl_next::wire::Box<'static, crate::wire::PortGetStatusWatcherRequest>,
1258            ___E,
1259        > for PortGetStatusWatcherRequest
1260    where
1261        ___E: ::fidl_next::Encoder + ?Sized,
1262        PortGetStatusWatcherRequest:
1263            ::fidl_next::Encode<crate::wire::PortGetStatusWatcherRequest, ___E>,
1264    {
1265        #[inline]
1266        fn encode_option(
1267            this: ::core::option::Option<Self>,
1268            encoder: &mut ___E,
1269            out: &mut ::core::mem::MaybeUninit<
1270                ::fidl_next::wire::Box<'static, crate::wire::PortGetStatusWatcherRequest>,
1271            >,
1272            _: (),
1273        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1274            if let Some(inner) = this {
1275                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1276                ::fidl_next::wire::Box::encode_present(out);
1277            } else {
1278                ::fidl_next::wire::Box::encode_absent(out);
1279            }
1280
1281            Ok(())
1282        }
1283    }
1284
1285    impl ::fidl_next::FromWire<crate::wire::PortGetStatusWatcherRequest>
1286        for PortGetStatusWatcherRequest
1287    {
1288        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1289            crate::wire::PortGetStatusWatcherRequest,
1290            Self,
1291        > = unsafe {
1292            ::fidl_next::CopyOptimization::enable_if(
1293                true && <::fidl_next::ServerEnd<
1294                    crate::StatusWatcher,
1295                    ::fidl_next::fuchsia::zx::Channel,
1296                > as ::fidl_next::FromWire<
1297                    ::fidl_next::ServerEnd<
1298                        crate::StatusWatcher,
1299                        ::fidl_next::wire::fuchsia::Channel,
1300                    >,
1301                >>::COPY_OPTIMIZATION
1302                    .is_enabled()
1303                    && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
1304                        .is_enabled(),
1305            )
1306        };
1307
1308        #[inline]
1309        fn from_wire(wire: crate::wire::PortGetStatusWatcherRequest) -> Self {
1310            Self {
1311                watcher: ::fidl_next::FromWire::from_wire(wire.watcher),
1312
1313                buffer: ::fidl_next::FromWire::from_wire(wire.buffer),
1314            }
1315        }
1316    }
1317
1318    #[derive(Debug, PartialEq)]
1319    #[repr(C)]
1320    pub struct PortGetMacRequest {
1321        pub mac: ::fidl_next::ServerEnd<crate::MacAddressing, ::fidl_next::fuchsia::zx::Channel>,
1322    }
1323
1324    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PortGetMacRequest, ___E> for PortGetMacRequest
1325    where
1326        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1327        ___E: ::fidl_next::fuchsia::HandleEncoder,
1328    {
1329        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1330            Self,
1331            crate::wire::PortGetMacRequest,
1332        > = unsafe {
1333            ::fidl_next::CopyOptimization::enable_if(
1334                true && <::fidl_next::ServerEnd<
1335                    crate::MacAddressing,
1336                    ::fidl_next::fuchsia::zx::Channel,
1337                > as ::fidl_next::Encode<
1338                    ::fidl_next::ServerEnd<
1339                        crate::MacAddressing,
1340                        ::fidl_next::wire::fuchsia::Channel,
1341                    >,
1342                    ___E,
1343                >>::COPY_OPTIMIZATION
1344                    .is_enabled(),
1345            )
1346        };
1347
1348        #[inline]
1349        fn encode(
1350            self,
1351            encoder_: &mut ___E,
1352            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetMacRequest>,
1353            _: (),
1354        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1355            ::fidl_next::munge! {
1356                let crate::wire::PortGetMacRequest {
1357                    mac,
1358
1359                } = out_;
1360            }
1361
1362            ::fidl_next::Encode::encode(self.mac, encoder_, mac, ())?;
1363
1364            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(mac.as_mut_ptr()) };
1365
1366            Ok(())
1367        }
1368    }
1369
1370    unsafe impl<___E>
1371        ::fidl_next::EncodeOption<
1372            ::fidl_next::wire::Box<'static, crate::wire::PortGetMacRequest>,
1373            ___E,
1374        > for PortGetMacRequest
1375    where
1376        ___E: ::fidl_next::Encoder + ?Sized,
1377        PortGetMacRequest: ::fidl_next::Encode<crate::wire::PortGetMacRequest, ___E>,
1378    {
1379        #[inline]
1380        fn encode_option(
1381            this: ::core::option::Option<Self>,
1382            encoder: &mut ___E,
1383            out: &mut ::core::mem::MaybeUninit<
1384                ::fidl_next::wire::Box<'static, crate::wire::PortGetMacRequest>,
1385            >,
1386            _: (),
1387        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1388            if let Some(inner) = this {
1389                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1390                ::fidl_next::wire::Box::encode_present(out);
1391            } else {
1392                ::fidl_next::wire::Box::encode_absent(out);
1393            }
1394
1395            Ok(())
1396        }
1397    }
1398
1399    impl ::fidl_next::FromWire<crate::wire::PortGetMacRequest> for PortGetMacRequest {
1400        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1401            crate::wire::PortGetMacRequest,
1402            Self,
1403        > = unsafe {
1404            ::fidl_next::CopyOptimization::enable_if(
1405                true && <::fidl_next::ServerEnd<
1406                    crate::MacAddressing,
1407                    ::fidl_next::fuchsia::zx::Channel,
1408                > as ::fidl_next::FromWire<
1409                    ::fidl_next::ServerEnd<
1410                        crate::MacAddressing,
1411                        ::fidl_next::wire::fuchsia::Channel,
1412                    >,
1413                >>::COPY_OPTIMIZATION
1414                    .is_enabled(),
1415            )
1416        };
1417
1418        #[inline]
1419        fn from_wire(wire: crate::wire::PortGetMacRequest) -> Self {
1420            Self { mac: ::fidl_next::FromWire::from_wire(wire.mac) }
1421        }
1422    }
1423
1424    #[derive(Debug, PartialEq)]
1425    #[repr(C)]
1426    pub struct PortGetDeviceRequest {
1427        pub device: ::fidl_next::ServerEnd<crate::Device, ::fidl_next::fuchsia::zx::Channel>,
1428    }
1429
1430    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PortGetDeviceRequest, ___E>
1431        for PortGetDeviceRequest
1432    where
1433        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1434        ___E: ::fidl_next::fuchsia::HandleEncoder,
1435    {
1436        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1437            Self,
1438            crate::wire::PortGetDeviceRequest,
1439        > = unsafe {
1440            ::fidl_next::CopyOptimization::enable_if(
1441            true
1442
1443                && <
1444                    ::fidl_next::ServerEnd<crate::Device, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encode<::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>, ___E>
1445                >::COPY_OPTIMIZATION.is_enabled()
1446
1447        )
1448        };
1449
1450        #[inline]
1451        fn encode(
1452            self,
1453            encoder_: &mut ___E,
1454            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetDeviceRequest>,
1455            _: (),
1456        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1457            ::fidl_next::munge! {
1458                let crate::wire::PortGetDeviceRequest {
1459                    device,
1460
1461                } = out_;
1462            }
1463
1464            ::fidl_next::Encode::encode(self.device, encoder_, device, ())?;
1465
1466            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(device.as_mut_ptr()) };
1467
1468            Ok(())
1469        }
1470    }
1471
1472    unsafe impl<___E>
1473        ::fidl_next::EncodeOption<
1474            ::fidl_next::wire::Box<'static, crate::wire::PortGetDeviceRequest>,
1475            ___E,
1476        > for PortGetDeviceRequest
1477    where
1478        ___E: ::fidl_next::Encoder + ?Sized,
1479        PortGetDeviceRequest: ::fidl_next::Encode<crate::wire::PortGetDeviceRequest, ___E>,
1480    {
1481        #[inline]
1482        fn encode_option(
1483            this: ::core::option::Option<Self>,
1484            encoder: &mut ___E,
1485            out: &mut ::core::mem::MaybeUninit<
1486                ::fidl_next::wire::Box<'static, crate::wire::PortGetDeviceRequest>,
1487            >,
1488            _: (),
1489        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1490            if let Some(inner) = this {
1491                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1492                ::fidl_next::wire::Box::encode_present(out);
1493            } else {
1494                ::fidl_next::wire::Box::encode_absent(out);
1495            }
1496
1497            Ok(())
1498        }
1499    }
1500
1501    impl ::fidl_next::FromWire<crate::wire::PortGetDeviceRequest> for PortGetDeviceRequest {
1502        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1503            crate::wire::PortGetDeviceRequest,
1504            Self,
1505        > = unsafe {
1506            ::fidl_next::CopyOptimization::enable_if(
1507            true
1508
1509                && <
1510                    ::fidl_next::ServerEnd<crate::Device, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>>
1511                >::COPY_OPTIMIZATION.is_enabled()
1512
1513        )
1514        };
1515
1516        #[inline]
1517        fn from_wire(wire: crate::wire::PortGetDeviceRequest) -> Self {
1518            Self { device: ::fidl_next::FromWire::from_wire(wire.device) }
1519        }
1520    }
1521
1522    #[derive(Debug, PartialEq)]
1523    #[repr(C)]
1524    pub struct PortCloneRequest {
1525        pub port: ::fidl_next::ServerEnd<crate::Port, ::fidl_next::fuchsia::zx::Channel>,
1526    }
1527
1528    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PortCloneRequest, ___E> for PortCloneRequest
1529    where
1530        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1531        ___E: ::fidl_next::fuchsia::HandleEncoder,
1532    {
1533        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1534            Self,
1535            crate::wire::PortCloneRequest,
1536        > = unsafe {
1537            ::fidl_next::CopyOptimization::enable_if(
1538            true
1539
1540                && <
1541                    ::fidl_next::ServerEnd<crate::Port, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encode<::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>, ___E>
1542                >::COPY_OPTIMIZATION.is_enabled()
1543
1544        )
1545        };
1546
1547        #[inline]
1548        fn encode(
1549            self,
1550            encoder_: &mut ___E,
1551            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortCloneRequest>,
1552            _: (),
1553        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1554            ::fidl_next::munge! {
1555                let crate::wire::PortCloneRequest {
1556                    port,
1557
1558                } = out_;
1559            }
1560
1561            ::fidl_next::Encode::encode(self.port, encoder_, port, ())?;
1562
1563            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(port.as_mut_ptr()) };
1564
1565            Ok(())
1566        }
1567    }
1568
1569    unsafe impl<___E>
1570        ::fidl_next::EncodeOption<
1571            ::fidl_next::wire::Box<'static, crate::wire::PortCloneRequest>,
1572            ___E,
1573        > for PortCloneRequest
1574    where
1575        ___E: ::fidl_next::Encoder + ?Sized,
1576        PortCloneRequest: ::fidl_next::Encode<crate::wire::PortCloneRequest, ___E>,
1577    {
1578        #[inline]
1579        fn encode_option(
1580            this: ::core::option::Option<Self>,
1581            encoder: &mut ___E,
1582            out: &mut ::core::mem::MaybeUninit<
1583                ::fidl_next::wire::Box<'static, crate::wire::PortCloneRequest>,
1584            >,
1585            _: (),
1586        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1587            if let Some(inner) = this {
1588                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1589                ::fidl_next::wire::Box::encode_present(out);
1590            } else {
1591                ::fidl_next::wire::Box::encode_absent(out);
1592            }
1593
1594            Ok(())
1595        }
1596    }
1597
1598    impl ::fidl_next::FromWire<crate::wire::PortCloneRequest> for PortCloneRequest {
1599        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1600            crate::wire::PortCloneRequest,
1601            Self,
1602        > = unsafe {
1603            ::fidl_next::CopyOptimization::enable_if(
1604            true
1605
1606                && <
1607                    ::fidl_next::ServerEnd<crate::Port, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>>
1608                >::COPY_OPTIMIZATION.is_enabled()
1609
1610        )
1611        };
1612
1613        #[inline]
1614        fn from_wire(wire: crate::wire::PortCloneRequest) -> Self {
1615            Self { port: ::fidl_next::FromWire::from_wire(wire.port) }
1616        }
1617    }
1618
1619    #[derive(Debug, PartialEq)]
1620    #[repr(C)]
1621    pub struct PortGetDiagnosticsRequest {
1622        pub diagnostics:
1623            ::fidl_next::ServerEnd<crate::Diagnostics, ::fidl_next::fuchsia::zx::Channel>,
1624    }
1625
1626    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PortGetDiagnosticsRequest, ___E>
1627        for PortGetDiagnosticsRequest
1628    where
1629        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1630        ___E: ::fidl_next::fuchsia::HandleEncoder,
1631    {
1632        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1633            Self,
1634            crate::wire::PortGetDiagnosticsRequest,
1635        > = unsafe {
1636            ::fidl_next::CopyOptimization::enable_if(
1637                true && <::fidl_next::ServerEnd<
1638                    crate::Diagnostics,
1639                    ::fidl_next::fuchsia::zx::Channel,
1640                > as ::fidl_next::Encode<
1641                    ::fidl_next::ServerEnd<crate::Diagnostics, ::fidl_next::wire::fuchsia::Channel>,
1642                    ___E,
1643                >>::COPY_OPTIMIZATION
1644                    .is_enabled(),
1645            )
1646        };
1647
1648        #[inline]
1649        fn encode(
1650            self,
1651            encoder_: &mut ___E,
1652            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetDiagnosticsRequest>,
1653            _: (),
1654        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1655            ::fidl_next::munge! {
1656                let crate::wire::PortGetDiagnosticsRequest {
1657                    diagnostics,
1658
1659                } = out_;
1660            }
1661
1662            ::fidl_next::Encode::encode(self.diagnostics, encoder_, diagnostics, ())?;
1663
1664            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(diagnostics.as_mut_ptr()) };
1665
1666            Ok(())
1667        }
1668    }
1669
1670    unsafe impl<___E>
1671        ::fidl_next::EncodeOption<
1672            ::fidl_next::wire::Box<'static, crate::wire::PortGetDiagnosticsRequest>,
1673            ___E,
1674        > for PortGetDiagnosticsRequest
1675    where
1676        ___E: ::fidl_next::Encoder + ?Sized,
1677        PortGetDiagnosticsRequest:
1678            ::fidl_next::Encode<crate::wire::PortGetDiagnosticsRequest, ___E>,
1679    {
1680        #[inline]
1681        fn encode_option(
1682            this: ::core::option::Option<Self>,
1683            encoder: &mut ___E,
1684            out: &mut ::core::mem::MaybeUninit<
1685                ::fidl_next::wire::Box<'static, crate::wire::PortGetDiagnosticsRequest>,
1686            >,
1687            _: (),
1688        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1689            if let Some(inner) = this {
1690                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1691                ::fidl_next::wire::Box::encode_present(out);
1692            } else {
1693                ::fidl_next::wire::Box::encode_absent(out);
1694            }
1695
1696            Ok(())
1697        }
1698    }
1699
1700    impl ::fidl_next::FromWire<crate::wire::PortGetDiagnosticsRequest> for PortGetDiagnosticsRequest {
1701        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1702            crate::wire::PortGetDiagnosticsRequest,
1703            Self,
1704        > = unsafe {
1705            ::fidl_next::CopyOptimization::enable_if(
1706                true && <::fidl_next::ServerEnd<
1707                    crate::Diagnostics,
1708                    ::fidl_next::fuchsia::zx::Channel,
1709                > as ::fidl_next::FromWire<
1710                    ::fidl_next::ServerEnd<crate::Diagnostics, ::fidl_next::wire::fuchsia::Channel>,
1711                >>::COPY_OPTIMIZATION
1712                    .is_enabled(),
1713            )
1714        };
1715
1716        #[inline]
1717        fn from_wire(wire: crate::wire::PortGetDiagnosticsRequest) -> Self {
1718            Self { diagnostics: ::fidl_next::FromWire::from_wire(wire.diagnostics) }
1719        }
1720    }
1721
1722    #[derive(Debug, PartialEq)]
1723    #[repr(C)]
1724    pub struct PortGetIdentityResponse {
1725        pub event: ::fidl_next::fuchsia::zx::Event,
1726    }
1727
1728    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PortGetIdentityResponse, ___E>
1729        for PortGetIdentityResponse
1730    where
1731        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1732        ___E: ::fidl_next::fuchsia::HandleEncoder,
1733    {
1734        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1735            Self,
1736            crate::wire::PortGetIdentityResponse,
1737        > = unsafe {
1738            ::fidl_next::CopyOptimization::enable_if(
1739                true && <::fidl_next::fuchsia::zx::Event as ::fidl_next::Encode<
1740                    ::fidl_next::wire::fuchsia::Event,
1741                    ___E,
1742                >>::COPY_OPTIMIZATION
1743                    .is_enabled(),
1744            )
1745        };
1746
1747        #[inline]
1748        fn encode(
1749            self,
1750            encoder_: &mut ___E,
1751            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetIdentityResponse>,
1752            _: (),
1753        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1754            ::fidl_next::munge! {
1755                let crate::wire::PortGetIdentityResponse {
1756                    event,
1757
1758                } = out_;
1759            }
1760
1761            ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
1762
1763            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event.as_mut_ptr()) };
1764
1765            Ok(())
1766        }
1767    }
1768
1769    unsafe impl<___E>
1770        ::fidl_next::EncodeOption<
1771            ::fidl_next::wire::Box<'static, crate::wire::PortGetIdentityResponse>,
1772            ___E,
1773        > for PortGetIdentityResponse
1774    where
1775        ___E: ::fidl_next::Encoder + ?Sized,
1776        PortGetIdentityResponse: ::fidl_next::Encode<crate::wire::PortGetIdentityResponse, ___E>,
1777    {
1778        #[inline]
1779        fn encode_option(
1780            this: ::core::option::Option<Self>,
1781            encoder: &mut ___E,
1782            out: &mut ::core::mem::MaybeUninit<
1783                ::fidl_next::wire::Box<'static, crate::wire::PortGetIdentityResponse>,
1784            >,
1785            _: (),
1786        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1787            if let Some(inner) = this {
1788                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1789                ::fidl_next::wire::Box::encode_present(out);
1790            } else {
1791                ::fidl_next::wire::Box::encode_absent(out);
1792            }
1793
1794            Ok(())
1795        }
1796    }
1797
1798    impl ::fidl_next::FromWire<crate::wire::PortGetIdentityResponse> for PortGetIdentityResponse {
1799        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1800            crate::wire::PortGetIdentityResponse,
1801            Self,
1802        > = unsafe {
1803            ::fidl_next::CopyOptimization::enable_if(
1804                true && <::fidl_next::fuchsia::zx::Event as ::fidl_next::FromWire<
1805                    ::fidl_next::wire::fuchsia::Event,
1806                >>::COPY_OPTIMIZATION
1807                    .is_enabled(),
1808            )
1809        };
1810
1811        #[inline]
1812        fn from_wire(wire: crate::wire::PortGetIdentityResponse) -> Self {
1813            Self { event: ::fidl_next::FromWire::from_wire(wire.event) }
1814        }
1815    }
1816
1817    #[derive(Debug, PartialEq)]
1818    #[repr(C)]
1819    pub struct PortGetPowerDependencyTokenResponse {
1820        pub token: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
1821    }
1822
1823    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PortGetPowerDependencyTokenResponse, ___E>
1824        for PortGetPowerDependencyTokenResponse
1825    where
1826        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1827        ___E: ::fidl_next::fuchsia::HandleEncoder,
1828    {
1829        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1830            Self,
1831            crate::wire::PortGetPowerDependencyTokenResponse,
1832        > = unsafe {
1833            ::fidl_next::CopyOptimization::enable_if(
1834            true
1835
1836                && <
1837                    ::core::option::Option<::fidl_next::fuchsia::zx::Event> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalEvent, ___E>
1838                >::COPY_OPTIMIZATION.is_enabled()
1839
1840        )
1841        };
1842
1843        #[inline]
1844        fn encode(
1845            self,
1846            encoder_: &mut ___E,
1847            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetPowerDependencyTokenResponse>,
1848            _: (),
1849        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1850            ::fidl_next::munge! {
1851                let crate::wire::PortGetPowerDependencyTokenResponse {
1852                    token,
1853
1854                } = out_;
1855            }
1856
1857            ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
1858
1859            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(token.as_mut_ptr()) };
1860
1861            Ok(())
1862        }
1863    }
1864
1865    unsafe impl<___E>
1866        ::fidl_next::EncodeOption<
1867            ::fidl_next::wire::Box<'static, crate::wire::PortGetPowerDependencyTokenResponse>,
1868            ___E,
1869        > for PortGetPowerDependencyTokenResponse
1870    where
1871        ___E: ::fidl_next::Encoder + ?Sized,
1872        PortGetPowerDependencyTokenResponse:
1873            ::fidl_next::Encode<crate::wire::PortGetPowerDependencyTokenResponse, ___E>,
1874    {
1875        #[inline]
1876        fn encode_option(
1877            this: ::core::option::Option<Self>,
1878            encoder: &mut ___E,
1879            out: &mut ::core::mem::MaybeUninit<
1880                ::fidl_next::wire::Box<'static, crate::wire::PortGetPowerDependencyTokenResponse>,
1881            >,
1882            _: (),
1883        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1884            if let Some(inner) = this {
1885                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1886                ::fidl_next::wire::Box::encode_present(out);
1887            } else {
1888                ::fidl_next::wire::Box::encode_absent(out);
1889            }
1890
1891            Ok(())
1892        }
1893    }
1894
1895    impl ::fidl_next::FromWire<crate::wire::PortGetPowerDependencyTokenResponse>
1896        for PortGetPowerDependencyTokenResponse
1897    {
1898        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1899            crate::wire::PortGetPowerDependencyTokenResponse,
1900            Self,
1901        > = unsafe {
1902            ::fidl_next::CopyOptimization::enable_if(
1903            true
1904
1905                && <
1906                    ::core::option::Option<::fidl_next::fuchsia::zx::Event> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::OptionalEvent>
1907                >::COPY_OPTIMIZATION.is_enabled()
1908
1909        )
1910        };
1911
1912        #[inline]
1913        fn from_wire(wire: crate::wire::PortGetPowerDependencyTokenResponse) -> Self {
1914            Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
1915        }
1916    }
1917
1918    #[derive(Debug, PartialEq)]
1919    pub struct SessionWatchDelegatedRxLeaseResponse {
1920        pub lease: crate::natural::DelegatedRxLease,
1921    }
1922
1923    unsafe impl<___E>
1924        ::fidl_next::Encode<crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>, ___E>
1925        for SessionWatchDelegatedRxLeaseResponse
1926    where
1927        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1928        ___E: ::fidl_next::Encoder,
1929        ___E: ::fidl_next::fuchsia::HandleEncoder,
1930    {
1931        #[inline]
1932        fn encode(
1933            self,
1934            encoder_: &mut ___E,
1935            out_: &mut ::core::mem::MaybeUninit<
1936                crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>,
1937            >,
1938            _: (),
1939        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1940            ::fidl_next::munge! {
1941                let crate::wire::SessionWatchDelegatedRxLeaseResponse {
1942                    lease,
1943
1944                } = out_;
1945            }
1946
1947            ::fidl_next::Encode::encode(self.lease, encoder_, lease, ())?;
1948
1949            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(lease.as_mut_ptr()) };
1950
1951            Ok(())
1952        }
1953    }
1954
1955    unsafe impl<___E>
1956        ::fidl_next::EncodeOption<
1957            ::fidl_next::wire::Box<
1958                'static,
1959                crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>,
1960            >,
1961            ___E,
1962        > for SessionWatchDelegatedRxLeaseResponse
1963    where
1964        ___E: ::fidl_next::Encoder + ?Sized,
1965        SessionWatchDelegatedRxLeaseResponse:
1966            ::fidl_next::Encode<crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>, ___E>,
1967    {
1968        #[inline]
1969        fn encode_option(
1970            this: ::core::option::Option<Self>,
1971            encoder: &mut ___E,
1972            out: &mut ::core::mem::MaybeUninit<
1973                ::fidl_next::wire::Box<
1974                    'static,
1975                    crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>,
1976                >,
1977            >,
1978            _: (),
1979        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1980            if let Some(inner) = this {
1981                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1982                ::fidl_next::wire::Box::encode_present(out);
1983            } else {
1984                ::fidl_next::wire::Box::encode_absent(out);
1985            }
1986
1987            Ok(())
1988        }
1989    }
1990
1991    impl<'de> ::fidl_next::FromWire<crate::wire::SessionWatchDelegatedRxLeaseResponse<'de>>
1992        for SessionWatchDelegatedRxLeaseResponse
1993    {
1994        #[inline]
1995        fn from_wire(wire: crate::wire::SessionWatchDelegatedRxLeaseResponse<'de>) -> Self {
1996            Self { lease: ::fidl_next::FromWire::from_wire(wire.lease) }
1997        }
1998    }
1999
2000    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2001    pub struct SessionRegisterForTxRequest {
2002        pub vmos: ::std::vec::Vec<u8>,
2003    }
2004
2005    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SessionRegisterForTxRequest<'static>, ___E>
2006        for SessionRegisterForTxRequest
2007    where
2008        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2009        ___E: ::fidl_next::Encoder,
2010        ___E: ::fidl_next::fuchsia::HandleEncoder,
2011    {
2012        #[inline]
2013        fn encode(
2014            self,
2015            encoder_: &mut ___E,
2016            out_: &mut ::core::mem::MaybeUninit<crate::wire::SessionRegisterForTxRequest<'static>>,
2017            _: (),
2018        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2019            ::fidl_next::munge! {
2020                let crate::wire::SessionRegisterForTxRequest {
2021                    vmos,
2022
2023                } = out_;
2024            }
2025
2026            ::fidl_next::Encode::encode(self.vmos, encoder_, vmos, (32, ()))?;
2027
2028            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(vmos.as_mut_ptr()) };
2029            ::fidl_next::Constrained::validate(_field, (32, ()))?;
2030
2031            Ok(())
2032        }
2033    }
2034
2035    unsafe impl<___E>
2036        ::fidl_next::EncodeOption<
2037            ::fidl_next::wire::Box<'static, crate::wire::SessionRegisterForTxRequest<'static>>,
2038            ___E,
2039        > for SessionRegisterForTxRequest
2040    where
2041        ___E: ::fidl_next::Encoder + ?Sized,
2042        SessionRegisterForTxRequest:
2043            ::fidl_next::Encode<crate::wire::SessionRegisterForTxRequest<'static>, ___E>,
2044    {
2045        #[inline]
2046        fn encode_option(
2047            this: ::core::option::Option<Self>,
2048            encoder: &mut ___E,
2049            out: &mut ::core::mem::MaybeUninit<
2050                ::fidl_next::wire::Box<'static, crate::wire::SessionRegisterForTxRequest<'static>>,
2051            >,
2052            _: (),
2053        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2054            if let Some(inner) = this {
2055                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2056                ::fidl_next::wire::Box::encode_present(out);
2057            } else {
2058                ::fidl_next::wire::Box::encode_absent(out);
2059            }
2060
2061            Ok(())
2062        }
2063    }
2064
2065    impl<'de> ::fidl_next::FromWire<crate::wire::SessionRegisterForTxRequest<'de>>
2066        for SessionRegisterForTxRequest
2067    {
2068        #[inline]
2069        fn from_wire(wire: crate::wire::SessionRegisterForTxRequest<'de>) -> Self {
2070            Self { vmos: ::fidl_next::FromWire::from_wire(wire.vmos) }
2071        }
2072    }
2073
2074    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2075    pub struct SessionUnregisterForTxRequest {
2076        pub vmos: ::std::vec::Vec<u8>,
2077    }
2078
2079    unsafe impl<___E> ::fidl_next::Encode<crate::wire::SessionUnregisterForTxRequest<'static>, ___E>
2080        for SessionUnregisterForTxRequest
2081    where
2082        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2083        ___E: ::fidl_next::Encoder,
2084        ___E: ::fidl_next::fuchsia::HandleEncoder,
2085    {
2086        #[inline]
2087        fn encode(
2088            self,
2089            encoder_: &mut ___E,
2090            out_: &mut ::core::mem::MaybeUninit<
2091                crate::wire::SessionUnregisterForTxRequest<'static>,
2092            >,
2093            _: (),
2094        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2095            ::fidl_next::munge! {
2096                let crate::wire::SessionUnregisterForTxRequest {
2097                    vmos,
2098
2099                } = out_;
2100            }
2101
2102            ::fidl_next::Encode::encode(self.vmos, encoder_, vmos, (32, ()))?;
2103
2104            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(vmos.as_mut_ptr()) };
2105            ::fidl_next::Constrained::validate(_field, (32, ()))?;
2106
2107            Ok(())
2108        }
2109    }
2110
2111    unsafe impl<___E>
2112        ::fidl_next::EncodeOption<
2113            ::fidl_next::wire::Box<'static, crate::wire::SessionUnregisterForTxRequest<'static>>,
2114            ___E,
2115        > for SessionUnregisterForTxRequest
2116    where
2117        ___E: ::fidl_next::Encoder + ?Sized,
2118        SessionUnregisterForTxRequest:
2119            ::fidl_next::Encode<crate::wire::SessionUnregisterForTxRequest<'static>, ___E>,
2120    {
2121        #[inline]
2122        fn encode_option(
2123            this: ::core::option::Option<Self>,
2124            encoder: &mut ___E,
2125            out: &mut ::core::mem::MaybeUninit<
2126                ::fidl_next::wire::Box<
2127                    'static,
2128                    crate::wire::SessionUnregisterForTxRequest<'static>,
2129                >,
2130            >,
2131            _: (),
2132        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2133            if let Some(inner) = this {
2134                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2135                ::fidl_next::wire::Box::encode_present(out);
2136            } else {
2137                ::fidl_next::wire::Box::encode_absent(out);
2138            }
2139
2140            Ok(())
2141        }
2142    }
2143
2144    impl<'de> ::fidl_next::FromWire<crate::wire::SessionUnregisterForTxRequest<'de>>
2145        for SessionUnregisterForTxRequest
2146    {
2147        #[inline]
2148        fn from_wire(wire: crate::wire::SessionUnregisterForTxRequest<'de>) -> Self {
2149            Self { vmos: ::fidl_next::FromWire::from_wire(wire.vmos) }
2150        }
2151    }
2152}
2153
2154pub mod wire {
2155
2156    pub use fidl_next_common_fuchsia_hardware_network::wire::*;
2157
2158    /// The wire type corresponding to [`DataVmo`].
2159    #[repr(C)]
2160    pub struct DataVmo<'de> {
2161        pub(crate) table: ::fidl_next::wire::Table<'de>,
2162    }
2163
2164    impl<'de> Drop for DataVmo<'de> {
2165        fn drop(&mut self) {
2166            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
2167
2168            let _ = self.table.get(2).map(|envelope| unsafe {
2169                envelope.read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
2170            });
2171
2172            let _ = self
2173                .table
2174                .get(3)
2175                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint16>() });
2176        }
2177    }
2178
2179    impl ::fidl_next::Constrained for DataVmo<'_> {
2180        type Constraint = ();
2181
2182        fn validate(
2183            _: ::fidl_next::Slot<'_, Self>,
2184            _: Self::Constraint,
2185        ) -> Result<(), ::fidl_next::ValidationError> {
2186            Ok(())
2187        }
2188    }
2189
2190    unsafe impl ::fidl_next::Wire for DataVmo<'static> {
2191        type Narrowed<'de> = DataVmo<'de>;
2192
2193        #[inline]
2194        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2195            ::fidl_next::munge!(let Self { table } = out);
2196            ::fidl_next::wire::Table::zero_padding(table);
2197        }
2198    }
2199
2200    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DataVmo<'de>
2201    where
2202        ___D: ::fidl_next::Decoder<'de> + ?Sized,
2203        ___D: ::fidl_next::fuchsia::HandleDecoder,
2204    {
2205        fn decode(
2206            slot: ::fidl_next::Slot<'_, Self>,
2207            decoder: &mut ___D,
2208            _: (),
2209        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2210            ::fidl_next::munge!(let Self { table } = slot);
2211
2212            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2213                match ordinal {
2214                    0 => unsafe { ::core::hint::unreachable_unchecked() },
2215
2216                    1 => {
2217                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
2218                            slot.as_mut(),
2219                            decoder,
2220                            (),
2221                        )?;
2222
2223                        Ok(())
2224                    }
2225
2226                    2 => {
2227                        ::fidl_next::wire::Envelope::decode_as::<
2228                            ___D,
2229                            ::fidl_next::wire::fuchsia::Vmo,
2230                        >(slot.as_mut(), decoder, ())?;
2231
2232                        Ok(())
2233                    }
2234
2235                    3 => {
2236                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint16>(
2237                            slot.as_mut(),
2238                            decoder,
2239                            (),
2240                        )?;
2241
2242                        Ok(())
2243                    }
2244
2245                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2246                }
2247            })
2248        }
2249    }
2250
2251    impl<'de> DataVmo<'de> {
2252        pub fn id(&self) -> ::core::option::Option<&u8> {
2253            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2254        }
2255
2256        pub fn take_id(&mut self) -> ::core::option::Option<u8> {
2257            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2258        }
2259
2260        pub fn vmo(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Vmo> {
2261            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2262        }
2263
2264        pub fn take_vmo(&mut self) -> ::core::option::Option<::fidl_next::wire::fuchsia::Vmo> {
2265            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2266        }
2267
2268        pub fn num_rx_buffers(&self) -> ::core::option::Option<&::fidl_next::wire::Uint16> {
2269            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2270        }
2271
2272        pub fn take_num_rx_buffers(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint16> {
2273            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2274        }
2275    }
2276
2277    impl<'de> ::core::fmt::Debug for DataVmo<'de> {
2278        fn fmt(
2279            &self,
2280            f: &mut ::core::fmt::Formatter<'_>,
2281        ) -> ::core::result::Result<(), ::core::fmt::Error> {
2282            f.debug_struct("DataVmo")
2283                .field("id", &self.id())
2284                .field("vmo", &self.vmo())
2285                .field("num_rx_buffers", &self.num_rx_buffers())
2286                .finish()
2287        }
2288    }
2289
2290    impl<'de> ::fidl_next::IntoNatural for DataVmo<'de> {
2291        type Natural = crate::natural::DataVmo;
2292    }
2293
2294    /// The wire type corresponding to [`DelegatedRxLeaseHandle`].
2295    #[repr(transparent)]
2296    pub struct DelegatedRxLeaseHandle<'de> {
2297        pub(crate) raw: ::fidl_next::wire::Union,
2298        pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
2299    }
2300
2301    impl<'de> Drop for DelegatedRxLeaseHandle<'de> {
2302        fn drop(&mut self) {
2303            match self.raw.ordinal() {
2304                1 => {
2305                    let _ = unsafe {
2306                        self.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Channel>()
2307                    };
2308                }
2309
2310                2 => {
2311                    let _ = unsafe {
2312                        self.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2313                    };
2314                }
2315
2316                _ => (),
2317            }
2318        }
2319    }
2320
2321    impl ::fidl_next::Constrained for DelegatedRxLeaseHandle<'_> {
2322        type Constraint = ();
2323
2324        fn validate(
2325            _: ::fidl_next::Slot<'_, Self>,
2326            _: Self::Constraint,
2327        ) -> Result<(), ::fidl_next::ValidationError> {
2328            Ok(())
2329        }
2330    }
2331
2332    unsafe impl ::fidl_next::Wire for DelegatedRxLeaseHandle<'static> {
2333        type Narrowed<'de> = DelegatedRxLeaseHandle<'de>;
2334
2335        #[inline]
2336        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2337            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
2338            ::fidl_next::wire::Union::zero_padding(raw);
2339        }
2340    }
2341
2342    pub mod delegated_rx_lease_handle {
2343        pub enum Ref<'de> {
2344            Channel(&'de ::fidl_next::wire::fuchsia::Channel),
2345
2346            Eventpair(&'de ::fidl_next::wire::fuchsia::EventPair),
2347
2348            UnknownOrdinal_(u64),
2349        }
2350
2351        pub enum Value {
2352            Channel(::fidl_next::wire::fuchsia::Channel),
2353
2354            Eventpair(::fidl_next::wire::fuchsia::EventPair),
2355
2356            UnknownOrdinal_(u64),
2357        }
2358    }
2359
2360    impl<'de> DelegatedRxLeaseHandle<'de> {
2361        pub fn as_ref(&self) -> crate::wire::delegated_rx_lease_handle::Ref<'_> {
2362            match self.raw.ordinal() {
2363                1 => crate::wire::delegated_rx_lease_handle::Ref::Channel(unsafe {
2364                    self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Channel>()
2365                }),
2366
2367                2 => crate::wire::delegated_rx_lease_handle::Ref::Eventpair(unsafe {
2368                    self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2369                }),
2370
2371                unknown => crate::wire::delegated_rx_lease_handle::Ref::UnknownOrdinal_(unknown),
2372            }
2373        }
2374
2375        pub fn into_inner(self) -> crate::wire::delegated_rx_lease_handle::Value {
2376            let this = ::core::mem::ManuallyDrop::new(self);
2377
2378            match this.raw.ordinal() {
2379                1 => crate::wire::delegated_rx_lease_handle::Value::Channel(unsafe {
2380                    this.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Channel>()
2381                }),
2382
2383                2 => crate::wire::delegated_rx_lease_handle::Value::Eventpair(unsafe {
2384                    this.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2385                }),
2386
2387                unknown => crate::wire::delegated_rx_lease_handle::Value::UnknownOrdinal_(unknown),
2388            }
2389        }
2390    }
2391
2392    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DelegatedRxLeaseHandle<'de>
2393    where
2394        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2395        ___D: ::fidl_next::Decoder<'de>,
2396        ___D: ::fidl_next::fuchsia::HandleDecoder,
2397    {
2398        fn decode(
2399            mut slot: ::fidl_next::Slot<'_, Self>,
2400            decoder: &mut ___D,
2401            _: (),
2402        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2403            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2404            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
2405                1 => ::fidl_next::wire::Union::decode_as::<
2406                    ___D,
2407                    ::fidl_next::wire::fuchsia::Channel,
2408                >(raw, decoder, ())?,
2409
2410                2 => ::fidl_next::wire::Union::decode_as::<
2411                    ___D,
2412                    ::fidl_next::wire::fuchsia::EventPair,
2413                >(raw, decoder, ())?,
2414
2415                _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
2416            }
2417
2418            Ok(())
2419        }
2420    }
2421
2422    impl<'de> ::core::fmt::Debug for DelegatedRxLeaseHandle<'de> {
2423        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2424            match self.raw.ordinal() {
2425                1 => unsafe {
2426                    self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Channel>().fmt(f)
2427                },
2428                2 => unsafe {
2429                    self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::EventPair>().fmt(f)
2430                },
2431                _ => unsafe { ::core::hint::unreachable_unchecked() },
2432            }
2433        }
2434    }
2435
2436    impl<'de> ::fidl_next::IntoNatural for DelegatedRxLeaseHandle<'de> {
2437        type Natural = crate::natural::DelegatedRxLeaseHandle;
2438    }
2439
2440    /// The wire type corresponding to [`DelegatedRxLease`].
2441    #[repr(C)]
2442    pub struct DelegatedRxLease<'de> {
2443        pub(crate) table: ::fidl_next::wire::Table<'de>,
2444    }
2445
2446    impl<'de> Drop for DelegatedRxLease<'de> {
2447        fn drop(&mut self) {
2448            let _ = self
2449                .table
2450                .get(1)
2451                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
2452
2453            let _ = self.table.get(2).map(|envelope| unsafe {
2454                envelope.read_unchecked::<crate::wire::DelegatedRxLeaseHandle<'de>>()
2455            });
2456        }
2457    }
2458
2459    impl ::fidl_next::Constrained for DelegatedRxLease<'_> {
2460        type Constraint = ();
2461
2462        fn validate(
2463            _: ::fidl_next::Slot<'_, Self>,
2464            _: Self::Constraint,
2465        ) -> Result<(), ::fidl_next::ValidationError> {
2466            Ok(())
2467        }
2468    }
2469
2470    unsafe impl ::fidl_next::Wire for DelegatedRxLease<'static> {
2471        type Narrowed<'de> = DelegatedRxLease<'de>;
2472
2473        #[inline]
2474        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2475            ::fidl_next::munge!(let Self { table } = out);
2476            ::fidl_next::wire::Table::zero_padding(table);
2477        }
2478    }
2479
2480    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DelegatedRxLease<'de>
2481    where
2482        ___D: ::fidl_next::Decoder<'de> + ?Sized,
2483        ___D: ::fidl_next::fuchsia::HandleDecoder,
2484    {
2485        fn decode(
2486            slot: ::fidl_next::Slot<'_, Self>,
2487            decoder: &mut ___D,
2488            _: (),
2489        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2490            ::fidl_next::munge!(let Self { table } = slot);
2491
2492            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2493                match ordinal {
2494                    0 => unsafe { ::core::hint::unreachable_unchecked() },
2495
2496                    1 => {
2497                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
2498                            slot.as_mut(),
2499                            decoder,
2500                            (),
2501                        )?;
2502
2503                        Ok(())
2504                    }
2505
2506                    2 => {
2507                        ::fidl_next::wire::Envelope::decode_as::<
2508                            ___D,
2509                            crate::wire::DelegatedRxLeaseHandle<'de>,
2510                        >(slot.as_mut(), decoder, ())?;
2511
2512                        Ok(())
2513                    }
2514
2515                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2516                }
2517            })
2518        }
2519    }
2520
2521    impl<'de> DelegatedRxLease<'de> {
2522        pub fn hold_until_frame(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
2523            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2524        }
2525
2526        pub fn take_hold_until_frame(
2527            &mut self,
2528        ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
2529            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2530        }
2531
2532        pub fn handle(&self) -> ::core::option::Option<&crate::wire::DelegatedRxLeaseHandle<'de>> {
2533            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2534        }
2535
2536        pub fn take_handle(
2537            &mut self,
2538        ) -> ::core::option::Option<crate::wire::DelegatedRxLeaseHandle<'de>> {
2539            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2540        }
2541    }
2542
2543    impl<'de> ::core::fmt::Debug for DelegatedRxLease<'de> {
2544        fn fmt(
2545            &self,
2546            f: &mut ::core::fmt::Formatter<'_>,
2547        ) -> ::core::result::Result<(), ::core::fmt::Error> {
2548            f.debug_struct("DelegatedRxLease")
2549                .field("hold_until_frame", &self.hold_until_frame())
2550                .field("handle", &self.handle())
2551                .finish()
2552        }
2553    }
2554
2555    impl<'de> ::fidl_next::IntoNatural for DelegatedRxLease<'de> {
2556        type Natural = crate::natural::DelegatedRxLease;
2557    }
2558
2559    /// The wire type corresponding to [`SessionInfo`].
2560    #[repr(C)]
2561    pub struct SessionInfo<'de> {
2562        pub(crate) table: ::fidl_next::wire::Table<'de>,
2563    }
2564
2565    impl<'de> Drop for SessionInfo<'de> {
2566        fn drop(&mut self) {
2567            let _ = self.table.get(1).map(|envelope| unsafe {
2568                envelope.read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
2569            });
2570
2571            let _ = self.table.get(2)
2572                .map(|envelope| unsafe {
2573                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DataVmo<'de>>>()
2574                });
2575
2576            let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
2577
2578            let _ = self.table.get(4).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
2579
2580            let _ = self
2581                .table
2582                .get(5)
2583                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint16>() });
2584
2585            let _ = self
2586                .table
2587                .get(6)
2588                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::SessionFlags>() });
2589        }
2590    }
2591
2592    impl ::fidl_next::Constrained for SessionInfo<'_> {
2593        type Constraint = ();
2594
2595        fn validate(
2596            _: ::fidl_next::Slot<'_, Self>,
2597            _: Self::Constraint,
2598        ) -> Result<(), ::fidl_next::ValidationError> {
2599            Ok(())
2600        }
2601    }
2602
2603    unsafe impl ::fidl_next::Wire for SessionInfo<'static> {
2604        type Narrowed<'de> = SessionInfo<'de>;
2605
2606        #[inline]
2607        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2608            ::fidl_next::munge!(let Self { table } = out);
2609            ::fidl_next::wire::Table::zero_padding(table);
2610        }
2611    }
2612
2613    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SessionInfo<'de>
2614    where
2615        ___D: ::fidl_next::Decoder<'de> + ?Sized,
2616        ___D: ::fidl_next::fuchsia::HandleDecoder,
2617    {
2618        fn decode(
2619            slot: ::fidl_next::Slot<'_, Self>,
2620            decoder: &mut ___D,
2621            _: (),
2622        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2623            ::fidl_next::munge!(let Self { table } = slot);
2624
2625            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2626                match ordinal {
2627                    0 => unsafe { ::core::hint::unreachable_unchecked() },
2628
2629                    1 => {
2630                        ::fidl_next::wire::Envelope::decode_as::<
2631                            ___D,
2632                            ::fidl_next::wire::fuchsia::Vmo,
2633                        >(slot.as_mut(), decoder, ())?;
2634
2635                        Ok(())
2636                    }
2637
2638                    2 => {
2639                        ::fidl_next::wire::Envelope::decode_as::<
2640                            ___D,
2641                            ::fidl_next::wire::Vector<'de, crate::wire::DataVmo<'de>>,
2642                        >(slot.as_mut(), decoder, (32, ()))?;
2643
2644                        let value = unsafe {
2645                            slot
2646                                            .deref_unchecked()
2647                                            .deref_unchecked::<
2648                                                ::fidl_next::wire::Vector<'_, crate::wire::DataVmo<'_>>
2649                                            >()
2650                        };
2651
2652                        if value.len() > 32 {
2653                            return Err(::fidl_next::DecodeError::VectorTooLong {
2654                                size: value.len() as u64,
2655                                limit: 32,
2656                            });
2657                        }
2658
2659                        Ok(())
2660                    }
2661
2662                    3 => {
2663                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
2664                            slot.as_mut(),
2665                            decoder,
2666                            (),
2667                        )?;
2668
2669                        Ok(())
2670                    }
2671
2672                    4 => {
2673                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
2674                            slot.as_mut(),
2675                            decoder,
2676                            (),
2677                        )?;
2678
2679                        Ok(())
2680                    }
2681
2682                    5 => {
2683                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint16>(
2684                            slot.as_mut(),
2685                            decoder,
2686                            (),
2687                        )?;
2688
2689                        Ok(())
2690                    }
2691
2692                    6 => {
2693                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::SessionFlags>(
2694                            slot.as_mut(),
2695                            decoder,
2696                            (),
2697                        )?;
2698
2699                        Ok(())
2700                    }
2701
2702                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2703                }
2704            })
2705        }
2706    }
2707
2708    impl<'de> SessionInfo<'de> {
2709        pub fn descriptors(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Vmo> {
2710            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2711        }
2712
2713        pub fn take_descriptors(
2714            &mut self,
2715        ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Vmo> {
2716            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2717        }
2718
2719        pub fn data(
2720            &self,
2721        ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::DataVmo<'de>>>
2722        {
2723            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2724        }
2725
2726        pub fn take_data(
2727            &mut self,
2728        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::DataVmo<'de>>>
2729        {
2730            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2731        }
2732
2733        pub fn descriptor_version(&self) -> ::core::option::Option<&u8> {
2734            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2735        }
2736
2737        pub fn take_descriptor_version(&mut self) -> ::core::option::Option<u8> {
2738            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2739        }
2740
2741        pub fn descriptor_length(&self) -> ::core::option::Option<&u8> {
2742            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2743        }
2744
2745        pub fn take_descriptor_length(&mut self) -> ::core::option::Option<u8> {
2746            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
2747        }
2748
2749        pub fn descriptor_count(&self) -> ::core::option::Option<&::fidl_next::wire::Uint16> {
2750            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
2751        }
2752
2753        pub fn take_descriptor_count(
2754            &mut self,
2755        ) -> ::core::option::Option<::fidl_next::wire::Uint16> {
2756            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
2757        }
2758
2759        pub fn options(&self) -> ::core::option::Option<&crate::wire::SessionFlags> {
2760            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
2761        }
2762
2763        pub fn take_options(&mut self) -> ::core::option::Option<crate::wire::SessionFlags> {
2764            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
2765        }
2766    }
2767
2768    impl<'de> ::core::fmt::Debug for SessionInfo<'de> {
2769        fn fmt(
2770            &self,
2771            f: &mut ::core::fmt::Formatter<'_>,
2772        ) -> ::core::result::Result<(), ::core::fmt::Error> {
2773            f.debug_struct("SessionInfo")
2774                .field("descriptors", &self.descriptors())
2775                .field("data", &self.data())
2776                .field("descriptor_version", &self.descriptor_version())
2777                .field("descriptor_length", &self.descriptor_length())
2778                .field("descriptor_count", &self.descriptor_count())
2779                .field("options", &self.options())
2780                .finish()
2781        }
2782    }
2783
2784    impl<'de> ::fidl_next::IntoNatural for SessionInfo<'de> {
2785        type Natural = crate::natural::SessionInfo;
2786    }
2787
2788    /// The wire type corresponding to [`DeviceOpenSessionRequest`].
2789    #[derive(Debug)]
2790    #[repr(C)]
2791    pub struct DeviceOpenSessionRequest<'de> {
2792        pub session_name: ::fidl_next::wire::String<'de>,
2793
2794        pub session_info: crate::wire::SessionInfo<'de>,
2795    }
2796
2797    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceOpenSessionRequest<'_>>(), 32);
2798    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceOpenSessionRequest<'_>>(), 8);
2799
2800    static_assertions::const_assert_eq!(
2801        std::mem::offset_of!(DeviceOpenSessionRequest<'_>, session_name),
2802        0
2803    );
2804
2805    static_assertions::const_assert_eq!(
2806        std::mem::offset_of!(DeviceOpenSessionRequest<'_>, session_info),
2807        16
2808    );
2809
2810    impl ::fidl_next::Constrained for DeviceOpenSessionRequest<'_> {
2811        type Constraint = ();
2812
2813        fn validate(
2814            _: ::fidl_next::Slot<'_, Self>,
2815            _: Self::Constraint,
2816        ) -> Result<(), ::fidl_next::ValidationError> {
2817            Ok(())
2818        }
2819    }
2820
2821    unsafe impl ::fidl_next::Wire for DeviceOpenSessionRequest<'static> {
2822        type Narrowed<'de> = DeviceOpenSessionRequest<'de>;
2823
2824        #[inline]
2825        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2826            ::fidl_next::munge! {
2827                let Self {
2828                    session_name,
2829                    session_info,
2830
2831                } = &mut *out_;
2832            }
2833
2834            ::fidl_next::Wire::zero_padding(session_name);
2835
2836            ::fidl_next::Wire::zero_padding(session_info);
2837        }
2838    }
2839
2840    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceOpenSessionRequest<'de>
2841    where
2842        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2843        ___D: ::fidl_next::Decoder<'de>,
2844        ___D: ::fidl_next::fuchsia::HandleDecoder,
2845    {
2846        fn decode(
2847            slot_: ::fidl_next::Slot<'_, Self>,
2848            decoder_: &mut ___D,
2849            _: (),
2850        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2851            ::fidl_next::munge! {
2852                let Self {
2853                    mut session_name,
2854                    mut session_info,
2855
2856                } = slot_;
2857            }
2858
2859            let _field = session_name.as_mut();
2860            ::fidl_next::Constrained::validate(_field, 64)?;
2861            ::fidl_next::Decode::decode(session_name.as_mut(), decoder_, 64)?;
2862
2863            let session_name = unsafe { session_name.deref_unchecked() };
2864
2865            if session_name.len() > 64 {
2866                return Err(::fidl_next::DecodeError::VectorTooLong {
2867                    size: session_name.len() as u64,
2868                    limit: 64,
2869                });
2870            }
2871
2872            let _field = session_info.as_mut();
2873
2874            ::fidl_next::Decode::decode(session_info.as_mut(), decoder_, ())?;
2875
2876            Ok(())
2877        }
2878    }
2879
2880    impl<'de> ::fidl_next::IntoNatural for DeviceOpenSessionRequest<'de> {
2881        type Natural = crate::natural::DeviceOpenSessionRequest;
2882    }
2883
2884    /// The wire type corresponding to [`Fifos`].
2885    #[derive(Debug)]
2886    #[repr(C)]
2887    pub struct Fifos {
2888        pub rx: ::fidl_next::wire::fuchsia::Fifo,
2889
2890        pub tx: ::fidl_next::wire::fuchsia::Fifo,
2891    }
2892
2893    static_assertions::const_assert_eq!(std::mem::size_of::<Fifos>(), 8);
2894    static_assertions::const_assert_eq!(std::mem::align_of::<Fifos>(), 4);
2895
2896    static_assertions::const_assert_eq!(std::mem::offset_of!(Fifos, rx), 0);
2897
2898    static_assertions::const_assert_eq!(std::mem::offset_of!(Fifos, tx), 4);
2899
2900    impl ::fidl_next::Constrained for Fifos {
2901        type Constraint = ();
2902
2903        fn validate(
2904            _: ::fidl_next::Slot<'_, Self>,
2905            _: Self::Constraint,
2906        ) -> Result<(), ::fidl_next::ValidationError> {
2907            Ok(())
2908        }
2909    }
2910
2911    unsafe impl ::fidl_next::Wire for Fifos {
2912        type Narrowed<'de> = Fifos;
2913
2914        #[inline]
2915        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2916            ::fidl_next::munge! {
2917                let Self {
2918                    rx,
2919                    tx,
2920
2921                } = &mut *out_;
2922            }
2923
2924            ::fidl_next::Wire::zero_padding(rx);
2925
2926            ::fidl_next::Wire::zero_padding(tx);
2927        }
2928    }
2929
2930    unsafe impl<___D> ::fidl_next::Decode<___D> for Fifos
2931    where
2932        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2933        ___D: ::fidl_next::fuchsia::HandleDecoder,
2934    {
2935        fn decode(
2936            slot_: ::fidl_next::Slot<'_, Self>,
2937            decoder_: &mut ___D,
2938            _: (),
2939        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2940            ::fidl_next::munge! {
2941                let Self {
2942                    mut rx,
2943                    mut tx,
2944
2945                } = slot_;
2946            }
2947
2948            let _field = rx.as_mut();
2949
2950            ::fidl_next::Decode::decode(rx.as_mut(), decoder_, ())?;
2951
2952            let _field = tx.as_mut();
2953
2954            ::fidl_next::Decode::decode(tx.as_mut(), decoder_, ())?;
2955
2956            Ok(())
2957        }
2958    }
2959
2960    impl ::fidl_next::IntoNatural for Fifos {
2961        type Natural = crate::natural::Fifos;
2962    }
2963
2964    /// The wire type corresponding to [`DeviceOpenSessionResponse`].
2965    #[derive(Debug)]
2966    #[repr(C)]
2967    pub struct DeviceOpenSessionResponse {
2968        pub session: ::fidl_next::ClientEnd<crate::Session, ::fidl_next::wire::fuchsia::Channel>,
2969
2970        pub fifos: crate::wire::Fifos,
2971    }
2972
2973    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceOpenSessionResponse>(), 12);
2974    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceOpenSessionResponse>(), 4);
2975
2976    static_assertions::const_assert_eq!(
2977        std::mem::offset_of!(DeviceOpenSessionResponse, session),
2978        0
2979    );
2980
2981    static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceOpenSessionResponse, fifos), 4);
2982
2983    impl ::fidl_next::Constrained for DeviceOpenSessionResponse {
2984        type Constraint = ();
2985
2986        fn validate(
2987            _: ::fidl_next::Slot<'_, Self>,
2988            _: Self::Constraint,
2989        ) -> Result<(), ::fidl_next::ValidationError> {
2990            Ok(())
2991        }
2992    }
2993
2994    unsafe impl ::fidl_next::Wire for DeviceOpenSessionResponse {
2995        type Narrowed<'de> = DeviceOpenSessionResponse;
2996
2997        #[inline]
2998        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2999            ::fidl_next::munge! {
3000                let Self {
3001                    session,
3002                    fifos,
3003
3004                } = &mut *out_;
3005            }
3006
3007            ::fidl_next::Wire::zero_padding(session);
3008
3009            ::fidl_next::Wire::zero_padding(fifos);
3010        }
3011    }
3012
3013    unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceOpenSessionResponse
3014    where
3015        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3016        ___D: ::fidl_next::fuchsia::HandleDecoder,
3017    {
3018        fn decode(
3019            slot_: ::fidl_next::Slot<'_, Self>,
3020            decoder_: &mut ___D,
3021            _: (),
3022        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3023            ::fidl_next::munge! {
3024                let Self {
3025                    mut session,
3026                    mut fifos,
3027
3028                } = slot_;
3029            }
3030
3031            let _field = session.as_mut();
3032
3033            ::fidl_next::Decode::decode(session.as_mut(), decoder_, ())?;
3034
3035            let _field = fifos.as_mut();
3036
3037            ::fidl_next::Decode::decode(fifos.as_mut(), decoder_, ())?;
3038
3039            Ok(())
3040        }
3041    }
3042
3043    impl ::fidl_next::IntoNatural for DeviceOpenSessionResponse {
3044        type Natural = crate::natural::DeviceOpenSessionResponse;
3045    }
3046
3047    /// The wire type corresponding to [`DeviceGetPortRequest`].
3048    #[derive(Debug)]
3049    #[repr(C)]
3050    pub struct DeviceGetPortRequest {
3051        pub id: crate::wire::PortId,
3052
3053        pub port: ::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>,
3054    }
3055
3056    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceGetPortRequest>(), 8);
3057    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceGetPortRequest>(), 4);
3058
3059    static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceGetPortRequest, id), 0);
3060
3061    static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceGetPortRequest, port), 4);
3062
3063    impl ::fidl_next::Constrained for DeviceGetPortRequest {
3064        type Constraint = ();
3065
3066        fn validate(
3067            _: ::fidl_next::Slot<'_, Self>,
3068            _: Self::Constraint,
3069        ) -> Result<(), ::fidl_next::ValidationError> {
3070            Ok(())
3071        }
3072    }
3073
3074    unsafe impl ::fidl_next::Wire for DeviceGetPortRequest {
3075        type Narrowed<'de> = DeviceGetPortRequest;
3076
3077        #[inline]
3078        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3079            ::fidl_next::munge! {
3080                let Self {
3081                    id,
3082                    port,
3083
3084                } = &mut *out_;
3085            }
3086
3087            ::fidl_next::Wire::zero_padding(id);
3088
3089            ::fidl_next::Wire::zero_padding(port);
3090
3091            unsafe {
3092                out_.as_mut_ptr().cast::<u8>().add(2).write_bytes(0, 2);
3093            }
3094        }
3095    }
3096
3097    unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetPortRequest
3098    where
3099        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3100        ___D: ::fidl_next::fuchsia::HandleDecoder,
3101    {
3102        fn decode(
3103            slot_: ::fidl_next::Slot<'_, Self>,
3104            decoder_: &mut ___D,
3105            _: (),
3106        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3107            if slot_.as_bytes()[2..4] != [0u8; 2] {
3108                return Err(::fidl_next::DecodeError::InvalidPadding);
3109            }
3110
3111            ::fidl_next::munge! {
3112                let Self {
3113                    mut id,
3114                    mut port,
3115
3116                } = slot_;
3117            }
3118
3119            let _field = id.as_mut();
3120
3121            ::fidl_next::Decode::decode(id.as_mut(), decoder_, ())?;
3122
3123            let _field = port.as_mut();
3124
3125            ::fidl_next::Decode::decode(port.as_mut(), decoder_, ())?;
3126
3127            Ok(())
3128        }
3129    }
3130
3131    impl ::fidl_next::IntoNatural for DeviceGetPortRequest {
3132        type Natural = crate::natural::DeviceGetPortRequest;
3133    }
3134
3135    /// The wire type corresponding to [`DeviceGetPortWatcherRequest`].
3136    #[derive(Debug)]
3137    #[repr(C)]
3138    pub struct DeviceGetPortWatcherRequest {
3139        pub watcher:
3140            ::fidl_next::ServerEnd<crate::PortWatcher, ::fidl_next::wire::fuchsia::Channel>,
3141    }
3142
3143    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceGetPortWatcherRequest>(), 4);
3144    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceGetPortWatcherRequest>(), 4);
3145
3146    static_assertions::const_assert_eq!(
3147        std::mem::offset_of!(DeviceGetPortWatcherRequest, watcher),
3148        0
3149    );
3150
3151    impl ::fidl_next::Constrained for DeviceGetPortWatcherRequest {
3152        type Constraint = ();
3153
3154        fn validate(
3155            _: ::fidl_next::Slot<'_, Self>,
3156            _: Self::Constraint,
3157        ) -> Result<(), ::fidl_next::ValidationError> {
3158            Ok(())
3159        }
3160    }
3161
3162    unsafe impl ::fidl_next::Wire for DeviceGetPortWatcherRequest {
3163        type Narrowed<'de> = DeviceGetPortWatcherRequest;
3164
3165        #[inline]
3166        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3167            ::fidl_next::munge! {
3168                let Self {
3169                    watcher,
3170
3171                } = &mut *out_;
3172            }
3173
3174            ::fidl_next::Wire::zero_padding(watcher);
3175        }
3176    }
3177
3178    unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetPortWatcherRequest
3179    where
3180        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3181        ___D: ::fidl_next::fuchsia::HandleDecoder,
3182    {
3183        fn decode(
3184            slot_: ::fidl_next::Slot<'_, Self>,
3185            decoder_: &mut ___D,
3186            _: (),
3187        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3188            ::fidl_next::munge! {
3189                let Self {
3190                    mut watcher,
3191
3192                } = slot_;
3193            }
3194
3195            let _field = watcher.as_mut();
3196
3197            ::fidl_next::Decode::decode(watcher.as_mut(), decoder_, ())?;
3198
3199            Ok(())
3200        }
3201    }
3202
3203    impl ::fidl_next::IntoNatural for DeviceGetPortWatcherRequest {
3204        type Natural = crate::natural::DeviceGetPortWatcherRequest;
3205    }
3206
3207    /// The wire type corresponding to [`DeviceCloneRequest`].
3208    #[derive(Debug)]
3209    #[repr(C)]
3210    pub struct DeviceCloneRequest {
3211        pub device: ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
3212    }
3213
3214    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceCloneRequest>(), 4);
3215    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceCloneRequest>(), 4);
3216
3217    static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceCloneRequest, device), 0);
3218
3219    impl ::fidl_next::Constrained for DeviceCloneRequest {
3220        type Constraint = ();
3221
3222        fn validate(
3223            _: ::fidl_next::Slot<'_, Self>,
3224            _: Self::Constraint,
3225        ) -> Result<(), ::fidl_next::ValidationError> {
3226            Ok(())
3227        }
3228    }
3229
3230    unsafe impl ::fidl_next::Wire for DeviceCloneRequest {
3231        type Narrowed<'de> = DeviceCloneRequest;
3232
3233        #[inline]
3234        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3235            ::fidl_next::munge! {
3236                let Self {
3237                    device,
3238
3239                } = &mut *out_;
3240            }
3241
3242            ::fidl_next::Wire::zero_padding(device);
3243        }
3244    }
3245
3246    unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceCloneRequest
3247    where
3248        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3249        ___D: ::fidl_next::fuchsia::HandleDecoder,
3250    {
3251        fn decode(
3252            slot_: ::fidl_next::Slot<'_, Self>,
3253            decoder_: &mut ___D,
3254            _: (),
3255        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3256            ::fidl_next::munge! {
3257                let Self {
3258                    mut device,
3259
3260                } = slot_;
3261            }
3262
3263            let _field = device.as_mut();
3264
3265            ::fidl_next::Decode::decode(device.as_mut(), decoder_, ())?;
3266
3267            Ok(())
3268        }
3269    }
3270
3271    impl ::fidl_next::IntoNatural for DeviceCloneRequest {
3272        type Natural = crate::natural::DeviceCloneRequest;
3273    }
3274
3275    /// The wire type corresponding to [`PortGetStatusWatcherRequest`].
3276    #[derive(Debug)]
3277    #[repr(C)]
3278    pub struct PortGetStatusWatcherRequest {
3279        pub watcher:
3280            ::fidl_next::ServerEnd<crate::StatusWatcher, ::fidl_next::wire::fuchsia::Channel>,
3281
3282        pub buffer: ::fidl_next::wire::Uint32,
3283    }
3284
3285    static_assertions::const_assert_eq!(std::mem::size_of::<PortGetStatusWatcherRequest>(), 8);
3286    static_assertions::const_assert_eq!(std::mem::align_of::<PortGetStatusWatcherRequest>(), 4);
3287
3288    static_assertions::const_assert_eq!(
3289        std::mem::offset_of!(PortGetStatusWatcherRequest, watcher),
3290        0
3291    );
3292
3293    static_assertions::const_assert_eq!(
3294        std::mem::offset_of!(PortGetStatusWatcherRequest, buffer),
3295        4
3296    );
3297
3298    impl ::fidl_next::Constrained for PortGetStatusWatcherRequest {
3299        type Constraint = ();
3300
3301        fn validate(
3302            _: ::fidl_next::Slot<'_, Self>,
3303            _: Self::Constraint,
3304        ) -> Result<(), ::fidl_next::ValidationError> {
3305            Ok(())
3306        }
3307    }
3308
3309    unsafe impl ::fidl_next::Wire for PortGetStatusWatcherRequest {
3310        type Narrowed<'de> = PortGetStatusWatcherRequest;
3311
3312        #[inline]
3313        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3314            ::fidl_next::munge! {
3315                let Self {
3316                    watcher,
3317                    buffer,
3318
3319                } = &mut *out_;
3320            }
3321
3322            ::fidl_next::Wire::zero_padding(watcher);
3323
3324            ::fidl_next::Wire::zero_padding(buffer);
3325        }
3326    }
3327
3328    unsafe impl<___D> ::fidl_next::Decode<___D> for PortGetStatusWatcherRequest
3329    where
3330        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3331        ___D: ::fidl_next::fuchsia::HandleDecoder,
3332    {
3333        fn decode(
3334            slot_: ::fidl_next::Slot<'_, Self>,
3335            decoder_: &mut ___D,
3336            _: (),
3337        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3338            ::fidl_next::munge! {
3339                let Self {
3340                    mut watcher,
3341                    mut buffer,
3342
3343                } = slot_;
3344            }
3345
3346            let _field = watcher.as_mut();
3347
3348            ::fidl_next::Decode::decode(watcher.as_mut(), decoder_, ())?;
3349
3350            let _field = buffer.as_mut();
3351
3352            ::fidl_next::Decode::decode(buffer.as_mut(), decoder_, ())?;
3353
3354            Ok(())
3355        }
3356    }
3357
3358    impl ::fidl_next::IntoNatural for PortGetStatusWatcherRequest {
3359        type Natural = crate::natural::PortGetStatusWatcherRequest;
3360    }
3361
3362    /// The wire type corresponding to [`PortGetMacRequest`].
3363    #[derive(Debug)]
3364    #[repr(C)]
3365    pub struct PortGetMacRequest {
3366        pub mac: ::fidl_next::ServerEnd<crate::MacAddressing, ::fidl_next::wire::fuchsia::Channel>,
3367    }
3368
3369    static_assertions::const_assert_eq!(std::mem::size_of::<PortGetMacRequest>(), 4);
3370    static_assertions::const_assert_eq!(std::mem::align_of::<PortGetMacRequest>(), 4);
3371
3372    static_assertions::const_assert_eq!(std::mem::offset_of!(PortGetMacRequest, mac), 0);
3373
3374    impl ::fidl_next::Constrained for PortGetMacRequest {
3375        type Constraint = ();
3376
3377        fn validate(
3378            _: ::fidl_next::Slot<'_, Self>,
3379            _: Self::Constraint,
3380        ) -> Result<(), ::fidl_next::ValidationError> {
3381            Ok(())
3382        }
3383    }
3384
3385    unsafe impl ::fidl_next::Wire for PortGetMacRequest {
3386        type Narrowed<'de> = PortGetMacRequest;
3387
3388        #[inline]
3389        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3390            ::fidl_next::munge! {
3391                let Self {
3392                    mac,
3393
3394                } = &mut *out_;
3395            }
3396
3397            ::fidl_next::Wire::zero_padding(mac);
3398        }
3399    }
3400
3401    unsafe impl<___D> ::fidl_next::Decode<___D> for PortGetMacRequest
3402    where
3403        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3404        ___D: ::fidl_next::fuchsia::HandleDecoder,
3405    {
3406        fn decode(
3407            slot_: ::fidl_next::Slot<'_, Self>,
3408            decoder_: &mut ___D,
3409            _: (),
3410        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3411            ::fidl_next::munge! {
3412                let Self {
3413                    mut mac,
3414
3415                } = slot_;
3416            }
3417
3418            let _field = mac.as_mut();
3419
3420            ::fidl_next::Decode::decode(mac.as_mut(), decoder_, ())?;
3421
3422            Ok(())
3423        }
3424    }
3425
3426    impl ::fidl_next::IntoNatural for PortGetMacRequest {
3427        type Natural = crate::natural::PortGetMacRequest;
3428    }
3429
3430    /// The wire type corresponding to [`PortGetDeviceRequest`].
3431    #[derive(Debug)]
3432    #[repr(C)]
3433    pub struct PortGetDeviceRequest {
3434        pub device: ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
3435    }
3436
3437    static_assertions::const_assert_eq!(std::mem::size_of::<PortGetDeviceRequest>(), 4);
3438    static_assertions::const_assert_eq!(std::mem::align_of::<PortGetDeviceRequest>(), 4);
3439
3440    static_assertions::const_assert_eq!(std::mem::offset_of!(PortGetDeviceRequest, device), 0);
3441
3442    impl ::fidl_next::Constrained for PortGetDeviceRequest {
3443        type Constraint = ();
3444
3445        fn validate(
3446            _: ::fidl_next::Slot<'_, Self>,
3447            _: Self::Constraint,
3448        ) -> Result<(), ::fidl_next::ValidationError> {
3449            Ok(())
3450        }
3451    }
3452
3453    unsafe impl ::fidl_next::Wire for PortGetDeviceRequest {
3454        type Narrowed<'de> = PortGetDeviceRequest;
3455
3456        #[inline]
3457        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3458            ::fidl_next::munge! {
3459                let Self {
3460                    device,
3461
3462                } = &mut *out_;
3463            }
3464
3465            ::fidl_next::Wire::zero_padding(device);
3466        }
3467    }
3468
3469    unsafe impl<___D> ::fidl_next::Decode<___D> for PortGetDeviceRequest
3470    where
3471        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3472        ___D: ::fidl_next::fuchsia::HandleDecoder,
3473    {
3474        fn decode(
3475            slot_: ::fidl_next::Slot<'_, Self>,
3476            decoder_: &mut ___D,
3477            _: (),
3478        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3479            ::fidl_next::munge! {
3480                let Self {
3481                    mut device,
3482
3483                } = slot_;
3484            }
3485
3486            let _field = device.as_mut();
3487
3488            ::fidl_next::Decode::decode(device.as_mut(), decoder_, ())?;
3489
3490            Ok(())
3491        }
3492    }
3493
3494    impl ::fidl_next::IntoNatural for PortGetDeviceRequest {
3495        type Natural = crate::natural::PortGetDeviceRequest;
3496    }
3497
3498    /// The wire type corresponding to [`PortCloneRequest`].
3499    #[derive(Debug)]
3500    #[repr(C)]
3501    pub struct PortCloneRequest {
3502        pub port: ::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>,
3503    }
3504
3505    static_assertions::const_assert_eq!(std::mem::size_of::<PortCloneRequest>(), 4);
3506    static_assertions::const_assert_eq!(std::mem::align_of::<PortCloneRequest>(), 4);
3507
3508    static_assertions::const_assert_eq!(std::mem::offset_of!(PortCloneRequest, port), 0);
3509
3510    impl ::fidl_next::Constrained for PortCloneRequest {
3511        type Constraint = ();
3512
3513        fn validate(
3514            _: ::fidl_next::Slot<'_, Self>,
3515            _: Self::Constraint,
3516        ) -> Result<(), ::fidl_next::ValidationError> {
3517            Ok(())
3518        }
3519    }
3520
3521    unsafe impl ::fidl_next::Wire for PortCloneRequest {
3522        type Narrowed<'de> = PortCloneRequest;
3523
3524        #[inline]
3525        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3526            ::fidl_next::munge! {
3527                let Self {
3528                    port,
3529
3530                } = &mut *out_;
3531            }
3532
3533            ::fidl_next::Wire::zero_padding(port);
3534        }
3535    }
3536
3537    unsafe impl<___D> ::fidl_next::Decode<___D> for PortCloneRequest
3538    where
3539        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3540        ___D: ::fidl_next::fuchsia::HandleDecoder,
3541    {
3542        fn decode(
3543            slot_: ::fidl_next::Slot<'_, Self>,
3544            decoder_: &mut ___D,
3545            _: (),
3546        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3547            ::fidl_next::munge! {
3548                let Self {
3549                    mut port,
3550
3551                } = slot_;
3552            }
3553
3554            let _field = port.as_mut();
3555
3556            ::fidl_next::Decode::decode(port.as_mut(), decoder_, ())?;
3557
3558            Ok(())
3559        }
3560    }
3561
3562    impl ::fidl_next::IntoNatural for PortCloneRequest {
3563        type Natural = crate::natural::PortCloneRequest;
3564    }
3565
3566    /// The wire type corresponding to [`PortGetDiagnosticsRequest`].
3567    #[derive(Debug)]
3568    #[repr(C)]
3569    pub struct PortGetDiagnosticsRequest {
3570        pub diagnostics:
3571            ::fidl_next::ServerEnd<crate::Diagnostics, ::fidl_next::wire::fuchsia::Channel>,
3572    }
3573
3574    static_assertions::const_assert_eq!(std::mem::size_of::<PortGetDiagnosticsRequest>(), 4);
3575    static_assertions::const_assert_eq!(std::mem::align_of::<PortGetDiagnosticsRequest>(), 4);
3576
3577    static_assertions::const_assert_eq!(
3578        std::mem::offset_of!(PortGetDiagnosticsRequest, diagnostics),
3579        0
3580    );
3581
3582    impl ::fidl_next::Constrained for PortGetDiagnosticsRequest {
3583        type Constraint = ();
3584
3585        fn validate(
3586            _: ::fidl_next::Slot<'_, Self>,
3587            _: Self::Constraint,
3588        ) -> Result<(), ::fidl_next::ValidationError> {
3589            Ok(())
3590        }
3591    }
3592
3593    unsafe impl ::fidl_next::Wire for PortGetDiagnosticsRequest {
3594        type Narrowed<'de> = PortGetDiagnosticsRequest;
3595
3596        #[inline]
3597        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3598            ::fidl_next::munge! {
3599                let Self {
3600                    diagnostics,
3601
3602                } = &mut *out_;
3603            }
3604
3605            ::fidl_next::Wire::zero_padding(diagnostics);
3606        }
3607    }
3608
3609    unsafe impl<___D> ::fidl_next::Decode<___D> for PortGetDiagnosticsRequest
3610    where
3611        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3612        ___D: ::fidl_next::fuchsia::HandleDecoder,
3613    {
3614        fn decode(
3615            slot_: ::fidl_next::Slot<'_, Self>,
3616            decoder_: &mut ___D,
3617            _: (),
3618        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3619            ::fidl_next::munge! {
3620                let Self {
3621                    mut diagnostics,
3622
3623                } = slot_;
3624            }
3625
3626            let _field = diagnostics.as_mut();
3627
3628            ::fidl_next::Decode::decode(diagnostics.as_mut(), decoder_, ())?;
3629
3630            Ok(())
3631        }
3632    }
3633
3634    impl ::fidl_next::IntoNatural for PortGetDiagnosticsRequest {
3635        type Natural = crate::natural::PortGetDiagnosticsRequest;
3636    }
3637
3638    /// The wire type corresponding to [`PortGetIdentityResponse`].
3639    #[derive(Debug)]
3640    #[repr(C)]
3641    pub struct PortGetIdentityResponse {
3642        pub event: ::fidl_next::wire::fuchsia::Event,
3643    }
3644
3645    static_assertions::const_assert_eq!(std::mem::size_of::<PortGetIdentityResponse>(), 4);
3646    static_assertions::const_assert_eq!(std::mem::align_of::<PortGetIdentityResponse>(), 4);
3647
3648    static_assertions::const_assert_eq!(std::mem::offset_of!(PortGetIdentityResponse, event), 0);
3649
3650    impl ::fidl_next::Constrained for PortGetIdentityResponse {
3651        type Constraint = ();
3652
3653        fn validate(
3654            _: ::fidl_next::Slot<'_, Self>,
3655            _: Self::Constraint,
3656        ) -> Result<(), ::fidl_next::ValidationError> {
3657            Ok(())
3658        }
3659    }
3660
3661    unsafe impl ::fidl_next::Wire for PortGetIdentityResponse {
3662        type Narrowed<'de> = PortGetIdentityResponse;
3663
3664        #[inline]
3665        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3666            ::fidl_next::munge! {
3667                let Self {
3668                    event,
3669
3670                } = &mut *out_;
3671            }
3672
3673            ::fidl_next::Wire::zero_padding(event);
3674        }
3675    }
3676
3677    unsafe impl<___D> ::fidl_next::Decode<___D> for PortGetIdentityResponse
3678    where
3679        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3680        ___D: ::fidl_next::fuchsia::HandleDecoder,
3681    {
3682        fn decode(
3683            slot_: ::fidl_next::Slot<'_, Self>,
3684            decoder_: &mut ___D,
3685            _: (),
3686        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3687            ::fidl_next::munge! {
3688                let Self {
3689                    mut event,
3690
3691                } = slot_;
3692            }
3693
3694            let _field = event.as_mut();
3695
3696            ::fidl_next::Decode::decode(event.as_mut(), decoder_, ())?;
3697
3698            Ok(())
3699        }
3700    }
3701
3702    impl ::fidl_next::IntoNatural for PortGetIdentityResponse {
3703        type Natural = crate::natural::PortGetIdentityResponse;
3704    }
3705
3706    /// The wire type corresponding to [`PortGetPowerDependencyTokenResponse`].
3707    #[derive(Debug)]
3708    #[repr(C)]
3709    pub struct PortGetPowerDependencyTokenResponse {
3710        pub token: ::fidl_next::wire::fuchsia::OptionalEvent,
3711    }
3712
3713    static_assertions::const_assert_eq!(
3714        std::mem::size_of::<PortGetPowerDependencyTokenResponse>(),
3715        4
3716    );
3717    static_assertions::const_assert_eq!(
3718        std::mem::align_of::<PortGetPowerDependencyTokenResponse>(),
3719        4
3720    );
3721
3722    static_assertions::const_assert_eq!(
3723        std::mem::offset_of!(PortGetPowerDependencyTokenResponse, token),
3724        0
3725    );
3726
3727    impl ::fidl_next::Constrained for PortGetPowerDependencyTokenResponse {
3728        type Constraint = ();
3729
3730        fn validate(
3731            _: ::fidl_next::Slot<'_, Self>,
3732            _: Self::Constraint,
3733        ) -> Result<(), ::fidl_next::ValidationError> {
3734            Ok(())
3735        }
3736    }
3737
3738    unsafe impl ::fidl_next::Wire for PortGetPowerDependencyTokenResponse {
3739        type Narrowed<'de> = PortGetPowerDependencyTokenResponse;
3740
3741        #[inline]
3742        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3743            ::fidl_next::munge! {
3744                let Self {
3745                    token,
3746
3747                } = &mut *out_;
3748            }
3749
3750            ::fidl_next::Wire::zero_padding(token);
3751        }
3752    }
3753
3754    unsafe impl<___D> ::fidl_next::Decode<___D> for PortGetPowerDependencyTokenResponse
3755    where
3756        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3757        ___D: ::fidl_next::fuchsia::HandleDecoder,
3758    {
3759        fn decode(
3760            slot_: ::fidl_next::Slot<'_, Self>,
3761            decoder_: &mut ___D,
3762            _: (),
3763        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3764            ::fidl_next::munge! {
3765                let Self {
3766                    mut token,
3767
3768                } = slot_;
3769            }
3770
3771            let _field = token.as_mut();
3772
3773            ::fidl_next::Decode::decode(token.as_mut(), decoder_, ())?;
3774
3775            Ok(())
3776        }
3777    }
3778
3779    impl ::fidl_next::IntoNatural for PortGetPowerDependencyTokenResponse {
3780        type Natural = crate::natural::PortGetPowerDependencyTokenResponse;
3781    }
3782
3783    /// The wire type corresponding to [`SessionWatchDelegatedRxLeaseResponse`].
3784    #[derive(Debug)]
3785    #[repr(C)]
3786    pub struct SessionWatchDelegatedRxLeaseResponse<'de> {
3787        pub lease: crate::wire::DelegatedRxLease<'de>,
3788    }
3789
3790    static_assertions::const_assert_eq!(
3791        std::mem::size_of::<SessionWatchDelegatedRxLeaseResponse<'_>>(),
3792        16
3793    );
3794    static_assertions::const_assert_eq!(
3795        std::mem::align_of::<SessionWatchDelegatedRxLeaseResponse<'_>>(),
3796        8
3797    );
3798
3799    static_assertions::const_assert_eq!(
3800        std::mem::offset_of!(SessionWatchDelegatedRxLeaseResponse<'_>, lease),
3801        0
3802    );
3803
3804    impl ::fidl_next::Constrained for SessionWatchDelegatedRxLeaseResponse<'_> {
3805        type Constraint = ();
3806
3807        fn validate(
3808            _: ::fidl_next::Slot<'_, Self>,
3809            _: Self::Constraint,
3810        ) -> Result<(), ::fidl_next::ValidationError> {
3811            Ok(())
3812        }
3813    }
3814
3815    unsafe impl ::fidl_next::Wire for SessionWatchDelegatedRxLeaseResponse<'static> {
3816        type Narrowed<'de> = SessionWatchDelegatedRxLeaseResponse<'de>;
3817
3818        #[inline]
3819        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3820            ::fidl_next::munge! {
3821                let Self {
3822                    lease,
3823
3824                } = &mut *out_;
3825            }
3826
3827            ::fidl_next::Wire::zero_padding(lease);
3828        }
3829    }
3830
3831    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SessionWatchDelegatedRxLeaseResponse<'de>
3832    where
3833        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3834        ___D: ::fidl_next::Decoder<'de>,
3835        ___D: ::fidl_next::fuchsia::HandleDecoder,
3836    {
3837        fn decode(
3838            slot_: ::fidl_next::Slot<'_, Self>,
3839            decoder_: &mut ___D,
3840            _: (),
3841        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3842            ::fidl_next::munge! {
3843                let Self {
3844                    mut lease,
3845
3846                } = slot_;
3847            }
3848
3849            let _field = lease.as_mut();
3850
3851            ::fidl_next::Decode::decode(lease.as_mut(), decoder_, ())?;
3852
3853            Ok(())
3854        }
3855    }
3856
3857    impl<'de> ::fidl_next::IntoNatural for SessionWatchDelegatedRxLeaseResponse<'de> {
3858        type Natural = crate::natural::SessionWatchDelegatedRxLeaseResponse;
3859    }
3860
3861    /// The wire type corresponding to [`SessionRegisterForTxRequest`].
3862    #[derive(Debug)]
3863    #[repr(C)]
3864    pub struct SessionRegisterForTxRequest<'de> {
3865        pub vmos: ::fidl_next::wire::Vector<'de, u8>,
3866    }
3867
3868    static_assertions::const_assert_eq!(std::mem::size_of::<SessionRegisterForTxRequest<'_>>(), 16);
3869    static_assertions::const_assert_eq!(std::mem::align_of::<SessionRegisterForTxRequest<'_>>(), 8);
3870
3871    static_assertions::const_assert_eq!(
3872        std::mem::offset_of!(SessionRegisterForTxRequest<'_>, vmos),
3873        0
3874    );
3875
3876    impl ::fidl_next::Constrained for SessionRegisterForTxRequest<'_> {
3877        type Constraint = ();
3878
3879        fn validate(
3880            _: ::fidl_next::Slot<'_, Self>,
3881            _: Self::Constraint,
3882        ) -> Result<(), ::fidl_next::ValidationError> {
3883            Ok(())
3884        }
3885    }
3886
3887    unsafe impl ::fidl_next::Wire for SessionRegisterForTxRequest<'static> {
3888        type Narrowed<'de> = SessionRegisterForTxRequest<'de>;
3889
3890        #[inline]
3891        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3892            ::fidl_next::munge! {
3893                let Self {
3894                    vmos,
3895
3896                } = &mut *out_;
3897            }
3898
3899            ::fidl_next::Wire::zero_padding(vmos);
3900        }
3901    }
3902
3903    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SessionRegisterForTxRequest<'de>
3904    where
3905        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3906        ___D: ::fidl_next::Decoder<'de>,
3907        ___D: ::fidl_next::fuchsia::HandleDecoder,
3908    {
3909        fn decode(
3910            slot_: ::fidl_next::Slot<'_, Self>,
3911            decoder_: &mut ___D,
3912            _: (),
3913        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3914            ::fidl_next::munge! {
3915                let Self {
3916                    mut vmos,
3917
3918                } = slot_;
3919            }
3920
3921            let _field = vmos.as_mut();
3922            ::fidl_next::Constrained::validate(_field, (32, ()))?;
3923            ::fidl_next::Decode::decode(vmos.as_mut(), decoder_, (32, ()))?;
3924
3925            let vmos = unsafe { vmos.deref_unchecked() };
3926
3927            if vmos.len() > 32 {
3928                return Err(::fidl_next::DecodeError::VectorTooLong {
3929                    size: vmos.len() as u64,
3930                    limit: 32,
3931                });
3932            }
3933
3934            Ok(())
3935        }
3936    }
3937
3938    impl<'de> ::fidl_next::IntoNatural for SessionRegisterForTxRequest<'de> {
3939        type Natural = crate::natural::SessionRegisterForTxRequest;
3940    }
3941
3942    /// The wire type corresponding to [`SessionUnregisterForTxRequest`].
3943    #[derive(Debug)]
3944    #[repr(C)]
3945    pub struct SessionUnregisterForTxRequest<'de> {
3946        pub vmos: ::fidl_next::wire::Vector<'de, u8>,
3947    }
3948
3949    static_assertions::const_assert_eq!(
3950        std::mem::size_of::<SessionUnregisterForTxRequest<'_>>(),
3951        16
3952    );
3953    static_assertions::const_assert_eq!(
3954        std::mem::align_of::<SessionUnregisterForTxRequest<'_>>(),
3955        8
3956    );
3957
3958    static_assertions::const_assert_eq!(
3959        std::mem::offset_of!(SessionUnregisterForTxRequest<'_>, vmos),
3960        0
3961    );
3962
3963    impl ::fidl_next::Constrained for SessionUnregisterForTxRequest<'_> {
3964        type Constraint = ();
3965
3966        fn validate(
3967            _: ::fidl_next::Slot<'_, Self>,
3968            _: Self::Constraint,
3969        ) -> Result<(), ::fidl_next::ValidationError> {
3970            Ok(())
3971        }
3972    }
3973
3974    unsafe impl ::fidl_next::Wire for SessionUnregisterForTxRequest<'static> {
3975        type Narrowed<'de> = SessionUnregisterForTxRequest<'de>;
3976
3977        #[inline]
3978        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3979            ::fidl_next::munge! {
3980                let Self {
3981                    vmos,
3982
3983                } = &mut *out_;
3984            }
3985
3986            ::fidl_next::Wire::zero_padding(vmos);
3987        }
3988    }
3989
3990    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SessionUnregisterForTxRequest<'de>
3991    where
3992        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3993        ___D: ::fidl_next::Decoder<'de>,
3994        ___D: ::fidl_next::fuchsia::HandleDecoder,
3995    {
3996        fn decode(
3997            slot_: ::fidl_next::Slot<'_, Self>,
3998            decoder_: &mut ___D,
3999            _: (),
4000        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4001            ::fidl_next::munge! {
4002                let Self {
4003                    mut vmos,
4004
4005                } = slot_;
4006            }
4007
4008            let _field = vmos.as_mut();
4009            ::fidl_next::Constrained::validate(_field, (32, ()))?;
4010            ::fidl_next::Decode::decode(vmos.as_mut(), decoder_, (32, ()))?;
4011
4012            let vmos = unsafe { vmos.deref_unchecked() };
4013
4014            if vmos.len() > 32 {
4015                return Err(::fidl_next::DecodeError::VectorTooLong {
4016                    size: vmos.len() as u64,
4017                    limit: 32,
4018                });
4019            }
4020
4021            Ok(())
4022        }
4023    }
4024
4025    impl<'de> ::fidl_next::IntoNatural for SessionUnregisterForTxRequest<'de> {
4026        type Natural = crate::natural::SessionUnregisterForTxRequest;
4027    }
4028}
4029
4030pub mod wire_optional {
4031
4032    pub use fidl_next_common_fuchsia_hardware_network::wire_optional::*;
4033
4034    #[repr(transparent)]
4035    pub struct DelegatedRxLeaseHandle<'de> {
4036        pub(crate) raw: ::fidl_next::wire::Union,
4037        pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4038    }
4039
4040    impl ::fidl_next::Constrained for DelegatedRxLeaseHandle<'_> {
4041        type Constraint = ();
4042
4043        fn validate(
4044            _: ::fidl_next::Slot<'_, Self>,
4045            _: Self::Constraint,
4046        ) -> Result<(), ::fidl_next::ValidationError> {
4047            Ok(())
4048        }
4049    }
4050
4051    unsafe impl ::fidl_next::Wire for DelegatedRxLeaseHandle<'static> {
4052        type Narrowed<'de> = DelegatedRxLeaseHandle<'de>;
4053
4054        #[inline]
4055        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4056            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4057            ::fidl_next::wire::Union::zero_padding(raw);
4058        }
4059    }
4060
4061    impl<'de> DelegatedRxLeaseHandle<'de> {
4062        pub fn is_some(&self) -> bool {
4063            self.raw.is_some()
4064        }
4065
4066        pub fn is_none(&self) -> bool {
4067            self.raw.is_none()
4068        }
4069
4070        pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::DelegatedRxLeaseHandle<'de>> {
4071            if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
4072        }
4073
4074        pub fn into_option(
4075            self,
4076        ) -> ::core::option::Option<crate::wire::DelegatedRxLeaseHandle<'de>> {
4077            if self.is_some() {
4078                Some(crate::wire::DelegatedRxLeaseHandle {
4079                    raw: self.raw,
4080                    _phantom: ::core::marker::PhantomData,
4081                })
4082            } else {
4083                None
4084            }
4085        }
4086    }
4087
4088    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DelegatedRxLeaseHandle<'de>
4089    where
4090        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4091        ___D: ::fidl_next::Decoder<'de>,
4092        ___D: ::fidl_next::fuchsia::HandleDecoder,
4093    {
4094        fn decode(
4095            mut slot: ::fidl_next::Slot<'_, Self>,
4096            decoder: &mut ___D,
4097            _: (),
4098        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4099            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4100            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
4101                1 => ::fidl_next::wire::Union::decode_as::<
4102                    ___D,
4103                    ::fidl_next::wire::fuchsia::Channel,
4104                >(raw, decoder, ())?,
4105
4106                2 => ::fidl_next::wire::Union::decode_as::<
4107                    ___D,
4108                    ::fidl_next::wire::fuchsia::EventPair,
4109                >(raw, decoder, ())?,
4110
4111                0 => ::fidl_next::wire::Union::decode_absent(raw)?,
4112                _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
4113            }
4114
4115            Ok(())
4116        }
4117    }
4118
4119    impl<'de> ::core::fmt::Debug for DelegatedRxLeaseHandle<'de> {
4120        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4121            self.as_ref().fmt(f)
4122        }
4123    }
4124
4125    impl<'de> ::fidl_next::IntoNatural for DelegatedRxLeaseHandle<'de> {
4126        type Natural = ::core::option::Option<crate::natural::DelegatedRxLeaseHandle>;
4127    }
4128}
4129
4130pub mod generic {
4131
4132    pub use fidl_next_common_fuchsia_hardware_network::generic::*;
4133
4134    /// The generic type corresponding to [`DeviceOpenSessionRequest`].
4135    pub struct DeviceOpenSessionRequest<T0, T1> {
4136        pub session_name: T0,
4137
4138        pub session_info: T1,
4139    }
4140
4141    unsafe impl<___E, T0, T1>
4142        ::fidl_next::Encode<crate::wire::DeviceOpenSessionRequest<'static>, ___E>
4143        for DeviceOpenSessionRequest<T0, T1>
4144    where
4145        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4146        ___E: ::fidl_next::Encoder,
4147        ___E: ::fidl_next::fuchsia::HandleEncoder,
4148        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4149        T1: ::fidl_next::Encode<crate::wire::SessionInfo<'static>, ___E>,
4150    {
4151        #[inline]
4152        fn encode(
4153            self,
4154            encoder_: &mut ___E,
4155            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceOpenSessionRequest<'static>>,
4156            _: (),
4157        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4158            ::fidl_next::munge! {
4159                let crate::wire::DeviceOpenSessionRequest {
4160                    session_name,
4161                    session_info,
4162
4163                } = out_;
4164            }
4165
4166            ::fidl_next::Encode::encode(self.session_name, encoder_, session_name, 64)?;
4167
4168            ::fidl_next::Encode::encode(self.session_info, encoder_, session_info, ())?;
4169
4170            Ok(())
4171        }
4172    }
4173
4174    unsafe impl<'a, ___E, T0, T1>
4175        ::fidl_next::Encode<crate::wire::DeviceOpenSessionRequest<'static>, ___E>
4176        for &'a DeviceOpenSessionRequest<T0, T1>
4177    where
4178        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4179        ___E: ::fidl_next::Encoder,
4180        ___E: ::fidl_next::fuchsia::HandleEncoder,
4181        &'a T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4182        &'a T1: ::fidl_next::Encode<crate::wire::SessionInfo<'static>, ___E>,
4183    {
4184        #[inline]
4185        fn encode(
4186            self,
4187            encoder_: &mut ___E,
4188            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceOpenSessionRequest<'static>>,
4189            _: (),
4190        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4191            ::fidl_next::munge! {
4192                let crate::wire::DeviceOpenSessionRequest {
4193                    session_name,
4194                    session_info,
4195
4196                } = out_;
4197            }
4198
4199            ::fidl_next::Encode::encode(&self.session_name, encoder_, session_name, 64)?;
4200
4201            ::fidl_next::Encode::encode(&self.session_info, encoder_, session_info, ())?;
4202
4203            Ok(())
4204        }
4205    }
4206
4207    /// The generic type corresponding to [`Fifos`].
4208    pub struct Fifos<T0, T1> {
4209        pub rx: T0,
4210
4211        pub tx: T1,
4212    }
4213
4214    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Fifos, ___E> for Fifos<T0, T1>
4215    where
4216        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4217        ___E: ::fidl_next::fuchsia::HandleEncoder,
4218        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Fifo, ___E>,
4219        T1: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Fifo, ___E>,
4220    {
4221        #[inline]
4222        fn encode(
4223            self,
4224            encoder_: &mut ___E,
4225            out_: &mut ::core::mem::MaybeUninit<crate::wire::Fifos>,
4226            _: (),
4227        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4228            ::fidl_next::munge! {
4229                let crate::wire::Fifos {
4230                    rx,
4231                    tx,
4232
4233                } = out_;
4234            }
4235
4236            ::fidl_next::Encode::encode(self.rx, encoder_, rx, ())?;
4237
4238            ::fidl_next::Encode::encode(self.tx, encoder_, tx, ())?;
4239
4240            Ok(())
4241        }
4242    }
4243
4244    unsafe impl<'a, ___E, T0, T1> ::fidl_next::Encode<crate::wire::Fifos, ___E> for &'a Fifos<T0, T1>
4245    where
4246        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4247        ___E: ::fidl_next::fuchsia::HandleEncoder,
4248        &'a T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Fifo, ___E>,
4249        &'a T1: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Fifo, ___E>,
4250    {
4251        #[inline]
4252        fn encode(
4253            self,
4254            encoder_: &mut ___E,
4255            out_: &mut ::core::mem::MaybeUninit<crate::wire::Fifos>,
4256            _: (),
4257        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4258            ::fidl_next::munge! {
4259                let crate::wire::Fifos {
4260                    rx,
4261                    tx,
4262
4263                } = out_;
4264            }
4265
4266            ::fidl_next::Encode::encode(&self.rx, encoder_, rx, ())?;
4267
4268            ::fidl_next::Encode::encode(&self.tx, encoder_, tx, ())?;
4269
4270            Ok(())
4271        }
4272    }
4273
4274    /// The generic type corresponding to [`DeviceOpenSessionResponse`].
4275    pub struct DeviceOpenSessionResponse<T0, T1> {
4276        pub session: T0,
4277
4278        pub fifos: T1,
4279    }
4280
4281    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::DeviceOpenSessionResponse, ___E>
4282        for DeviceOpenSessionResponse<T0, T1>
4283    where
4284        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4285        ___E: ::fidl_next::fuchsia::HandleEncoder,
4286        T0: ::fidl_next::Encode<
4287                ::fidl_next::ClientEnd<crate::Session, ::fidl_next::wire::fuchsia::Channel>,
4288                ___E,
4289            >,
4290        T1: ::fidl_next::Encode<crate::wire::Fifos, ___E>,
4291    {
4292        #[inline]
4293        fn encode(
4294            self,
4295            encoder_: &mut ___E,
4296            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceOpenSessionResponse>,
4297            _: (),
4298        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4299            ::fidl_next::munge! {
4300                let crate::wire::DeviceOpenSessionResponse {
4301                    session,
4302                    fifos,
4303
4304                } = out_;
4305            }
4306
4307            ::fidl_next::Encode::encode(self.session, encoder_, session, ())?;
4308
4309            ::fidl_next::Encode::encode(self.fifos, encoder_, fifos, ())?;
4310
4311            Ok(())
4312        }
4313    }
4314
4315    unsafe impl<'a, ___E, T0, T1> ::fidl_next::Encode<crate::wire::DeviceOpenSessionResponse, ___E>
4316        for &'a DeviceOpenSessionResponse<T0, T1>
4317    where
4318        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4319        ___E: ::fidl_next::fuchsia::HandleEncoder,
4320        &'a T0: ::fidl_next::Encode<
4321                ::fidl_next::ClientEnd<crate::Session, ::fidl_next::wire::fuchsia::Channel>,
4322                ___E,
4323            >,
4324        &'a T1: ::fidl_next::Encode<crate::wire::Fifos, ___E>,
4325    {
4326        #[inline]
4327        fn encode(
4328            self,
4329            encoder_: &mut ___E,
4330            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceOpenSessionResponse>,
4331            _: (),
4332        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4333            ::fidl_next::munge! {
4334                let crate::wire::DeviceOpenSessionResponse {
4335                    session,
4336                    fifos,
4337
4338                } = out_;
4339            }
4340
4341            ::fidl_next::Encode::encode(&self.session, encoder_, session, ())?;
4342
4343            ::fidl_next::Encode::encode(&self.fifos, encoder_, fifos, ())?;
4344
4345            Ok(())
4346        }
4347    }
4348
4349    /// The generic type corresponding to [`DeviceGetPortRequest`].
4350    pub struct DeviceGetPortRequest<T0, T1> {
4351        pub id: T0,
4352
4353        pub port: T1,
4354    }
4355
4356    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::DeviceGetPortRequest, ___E>
4357        for DeviceGetPortRequest<T0, T1>
4358    where
4359        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4360        ___E: ::fidl_next::fuchsia::HandleEncoder,
4361        T0: ::fidl_next::Encode<crate::wire::PortId, ___E>,
4362        T1: ::fidl_next::Encode<
4363                ::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>,
4364                ___E,
4365            >,
4366    {
4367        #[inline]
4368        fn encode(
4369            self,
4370            encoder_: &mut ___E,
4371            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPortRequest>,
4372            _: (),
4373        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4374            ::fidl_next::munge! {
4375                let crate::wire::DeviceGetPortRequest {
4376                    id,
4377                    port,
4378
4379                } = out_;
4380            }
4381
4382            ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
4383
4384            ::fidl_next::Encode::encode(self.port, encoder_, port, ())?;
4385
4386            Ok(())
4387        }
4388    }
4389
4390    unsafe impl<'a, ___E, T0, T1> ::fidl_next::Encode<crate::wire::DeviceGetPortRequest, ___E>
4391        for &'a DeviceGetPortRequest<T0, T1>
4392    where
4393        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4394        ___E: ::fidl_next::fuchsia::HandleEncoder,
4395        &'a T0: ::fidl_next::Encode<crate::wire::PortId, ___E>,
4396        &'a T1: ::fidl_next::Encode<
4397                ::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>,
4398                ___E,
4399            >,
4400    {
4401        #[inline]
4402        fn encode(
4403            self,
4404            encoder_: &mut ___E,
4405            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPortRequest>,
4406            _: (),
4407        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4408            ::fidl_next::munge! {
4409                let crate::wire::DeviceGetPortRequest {
4410                    id,
4411                    port,
4412
4413                } = out_;
4414            }
4415
4416            ::fidl_next::Encode::encode(&self.id, encoder_, id, ())?;
4417
4418            ::fidl_next::Encode::encode(&self.port, encoder_, port, ())?;
4419
4420            Ok(())
4421        }
4422    }
4423
4424    /// The generic type corresponding to [`DeviceGetPortWatcherRequest`].
4425    pub struct DeviceGetPortWatcherRequest<T0> {
4426        pub watcher: T0,
4427    }
4428
4429    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetPortWatcherRequest, ___E>
4430        for DeviceGetPortWatcherRequest<T0>
4431    where
4432        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4433        ___E: ::fidl_next::fuchsia::HandleEncoder,
4434        T0: ::fidl_next::Encode<
4435                ::fidl_next::ServerEnd<crate::PortWatcher, ::fidl_next::wire::fuchsia::Channel>,
4436                ___E,
4437            >,
4438    {
4439        #[inline]
4440        fn encode(
4441            self,
4442            encoder_: &mut ___E,
4443            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPortWatcherRequest>,
4444            _: (),
4445        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4446            ::fidl_next::munge! {
4447                let crate::wire::DeviceGetPortWatcherRequest {
4448                    watcher,
4449
4450                } = out_;
4451            }
4452
4453            ::fidl_next::Encode::encode(self.watcher, encoder_, watcher, ())?;
4454
4455            Ok(())
4456        }
4457    }
4458
4459    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetPortWatcherRequest, ___E>
4460        for &'a DeviceGetPortWatcherRequest<T0>
4461    where
4462        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4463        ___E: ::fidl_next::fuchsia::HandleEncoder,
4464        &'a T0: ::fidl_next::Encode<
4465                ::fidl_next::ServerEnd<crate::PortWatcher, ::fidl_next::wire::fuchsia::Channel>,
4466                ___E,
4467            >,
4468    {
4469        #[inline]
4470        fn encode(
4471            self,
4472            encoder_: &mut ___E,
4473            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPortWatcherRequest>,
4474            _: (),
4475        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4476            ::fidl_next::munge! {
4477                let crate::wire::DeviceGetPortWatcherRequest {
4478                    watcher,
4479
4480                } = out_;
4481            }
4482
4483            ::fidl_next::Encode::encode(&self.watcher, encoder_, watcher, ())?;
4484
4485            Ok(())
4486        }
4487    }
4488
4489    /// The generic type corresponding to [`DeviceCloneRequest`].
4490    pub struct DeviceCloneRequest<T0> {
4491        pub device: T0,
4492    }
4493
4494    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceCloneRequest, ___E>
4495        for DeviceCloneRequest<T0>
4496    where
4497        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4498        ___E: ::fidl_next::fuchsia::HandleEncoder,
4499        T0: ::fidl_next::Encode<
4500                ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
4501                ___E,
4502            >,
4503    {
4504        #[inline]
4505        fn encode(
4506            self,
4507            encoder_: &mut ___E,
4508            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceCloneRequest>,
4509            _: (),
4510        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4511            ::fidl_next::munge! {
4512                let crate::wire::DeviceCloneRequest {
4513                    device,
4514
4515                } = out_;
4516            }
4517
4518            ::fidl_next::Encode::encode(self.device, encoder_, device, ())?;
4519
4520            Ok(())
4521        }
4522    }
4523
4524    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::DeviceCloneRequest, ___E>
4525        for &'a DeviceCloneRequest<T0>
4526    where
4527        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4528        ___E: ::fidl_next::fuchsia::HandleEncoder,
4529        &'a T0: ::fidl_next::Encode<
4530                ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
4531                ___E,
4532            >,
4533    {
4534        #[inline]
4535        fn encode(
4536            self,
4537            encoder_: &mut ___E,
4538            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceCloneRequest>,
4539            _: (),
4540        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4541            ::fidl_next::munge! {
4542                let crate::wire::DeviceCloneRequest {
4543                    device,
4544
4545                } = out_;
4546            }
4547
4548            ::fidl_next::Encode::encode(&self.device, encoder_, device, ())?;
4549
4550            Ok(())
4551        }
4552    }
4553
4554    /// The generic type corresponding to [`PortGetStatusWatcherRequest`].
4555    pub struct PortGetStatusWatcherRequest<T0, T1> {
4556        pub watcher: T0,
4557
4558        pub buffer: T1,
4559    }
4560
4561    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::PortGetStatusWatcherRequest, ___E>
4562        for PortGetStatusWatcherRequest<T0, T1>
4563    where
4564        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4565        ___E: ::fidl_next::fuchsia::HandleEncoder,
4566        T0: ::fidl_next::Encode<
4567                ::fidl_next::ServerEnd<crate::StatusWatcher, ::fidl_next::wire::fuchsia::Channel>,
4568                ___E,
4569            >,
4570        T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
4571    {
4572        #[inline]
4573        fn encode(
4574            self,
4575            encoder_: &mut ___E,
4576            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetStatusWatcherRequest>,
4577            _: (),
4578        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4579            ::fidl_next::munge! {
4580                let crate::wire::PortGetStatusWatcherRequest {
4581                    watcher,
4582                    buffer,
4583
4584                } = out_;
4585            }
4586
4587            ::fidl_next::Encode::encode(self.watcher, encoder_, watcher, ())?;
4588
4589            ::fidl_next::Encode::encode(self.buffer, encoder_, buffer, ())?;
4590
4591            Ok(())
4592        }
4593    }
4594
4595    unsafe impl<'a, ___E, T0, T1>
4596        ::fidl_next::Encode<crate::wire::PortGetStatusWatcherRequest, ___E>
4597        for &'a PortGetStatusWatcherRequest<T0, T1>
4598    where
4599        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4600        ___E: ::fidl_next::fuchsia::HandleEncoder,
4601        &'a T0: ::fidl_next::Encode<
4602                ::fidl_next::ServerEnd<crate::StatusWatcher, ::fidl_next::wire::fuchsia::Channel>,
4603                ___E,
4604            >,
4605        &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
4606    {
4607        #[inline]
4608        fn encode(
4609            self,
4610            encoder_: &mut ___E,
4611            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetStatusWatcherRequest>,
4612            _: (),
4613        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4614            ::fidl_next::munge! {
4615                let crate::wire::PortGetStatusWatcherRequest {
4616                    watcher,
4617                    buffer,
4618
4619                } = out_;
4620            }
4621
4622            ::fidl_next::Encode::encode(&self.watcher, encoder_, watcher, ())?;
4623
4624            ::fidl_next::Encode::encode(&self.buffer, encoder_, buffer, ())?;
4625
4626            Ok(())
4627        }
4628    }
4629
4630    /// The generic type corresponding to [`PortGetMacRequest`].
4631    pub struct PortGetMacRequest<T0> {
4632        pub mac: T0,
4633    }
4634
4635    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::PortGetMacRequest, ___E>
4636        for PortGetMacRequest<T0>
4637    where
4638        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4639        ___E: ::fidl_next::fuchsia::HandleEncoder,
4640        T0: ::fidl_next::Encode<
4641                ::fidl_next::ServerEnd<crate::MacAddressing, ::fidl_next::wire::fuchsia::Channel>,
4642                ___E,
4643            >,
4644    {
4645        #[inline]
4646        fn encode(
4647            self,
4648            encoder_: &mut ___E,
4649            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetMacRequest>,
4650            _: (),
4651        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4652            ::fidl_next::munge! {
4653                let crate::wire::PortGetMacRequest {
4654                    mac,
4655
4656                } = out_;
4657            }
4658
4659            ::fidl_next::Encode::encode(self.mac, encoder_, mac, ())?;
4660
4661            Ok(())
4662        }
4663    }
4664
4665    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::PortGetMacRequest, ___E>
4666        for &'a PortGetMacRequest<T0>
4667    where
4668        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4669        ___E: ::fidl_next::fuchsia::HandleEncoder,
4670        &'a T0: ::fidl_next::Encode<
4671                ::fidl_next::ServerEnd<crate::MacAddressing, ::fidl_next::wire::fuchsia::Channel>,
4672                ___E,
4673            >,
4674    {
4675        #[inline]
4676        fn encode(
4677            self,
4678            encoder_: &mut ___E,
4679            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetMacRequest>,
4680            _: (),
4681        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4682            ::fidl_next::munge! {
4683                let crate::wire::PortGetMacRequest {
4684                    mac,
4685
4686                } = out_;
4687            }
4688
4689            ::fidl_next::Encode::encode(&self.mac, encoder_, mac, ())?;
4690
4691            Ok(())
4692        }
4693    }
4694
4695    /// The generic type corresponding to [`PortGetDeviceRequest`].
4696    pub struct PortGetDeviceRequest<T0> {
4697        pub device: T0,
4698    }
4699
4700    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::PortGetDeviceRequest, ___E>
4701        for PortGetDeviceRequest<T0>
4702    where
4703        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4704        ___E: ::fidl_next::fuchsia::HandleEncoder,
4705        T0: ::fidl_next::Encode<
4706                ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
4707                ___E,
4708            >,
4709    {
4710        #[inline]
4711        fn encode(
4712            self,
4713            encoder_: &mut ___E,
4714            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetDeviceRequest>,
4715            _: (),
4716        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4717            ::fidl_next::munge! {
4718                let crate::wire::PortGetDeviceRequest {
4719                    device,
4720
4721                } = out_;
4722            }
4723
4724            ::fidl_next::Encode::encode(self.device, encoder_, device, ())?;
4725
4726            Ok(())
4727        }
4728    }
4729
4730    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::PortGetDeviceRequest, ___E>
4731        for &'a PortGetDeviceRequest<T0>
4732    where
4733        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4734        ___E: ::fidl_next::fuchsia::HandleEncoder,
4735        &'a T0: ::fidl_next::Encode<
4736                ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
4737                ___E,
4738            >,
4739    {
4740        #[inline]
4741        fn encode(
4742            self,
4743            encoder_: &mut ___E,
4744            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetDeviceRequest>,
4745            _: (),
4746        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4747            ::fidl_next::munge! {
4748                let crate::wire::PortGetDeviceRequest {
4749                    device,
4750
4751                } = out_;
4752            }
4753
4754            ::fidl_next::Encode::encode(&self.device, encoder_, device, ())?;
4755
4756            Ok(())
4757        }
4758    }
4759
4760    /// The generic type corresponding to [`PortCloneRequest`].
4761    pub struct PortCloneRequest<T0> {
4762        pub port: T0,
4763    }
4764
4765    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::PortCloneRequest, ___E>
4766        for PortCloneRequest<T0>
4767    where
4768        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4769        ___E: ::fidl_next::fuchsia::HandleEncoder,
4770        T0: ::fidl_next::Encode<
4771                ::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>,
4772                ___E,
4773            >,
4774    {
4775        #[inline]
4776        fn encode(
4777            self,
4778            encoder_: &mut ___E,
4779            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortCloneRequest>,
4780            _: (),
4781        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4782            ::fidl_next::munge! {
4783                let crate::wire::PortCloneRequest {
4784                    port,
4785
4786                } = out_;
4787            }
4788
4789            ::fidl_next::Encode::encode(self.port, encoder_, port, ())?;
4790
4791            Ok(())
4792        }
4793    }
4794
4795    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::PortCloneRequest, ___E>
4796        for &'a PortCloneRequest<T0>
4797    where
4798        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4799        ___E: ::fidl_next::fuchsia::HandleEncoder,
4800        &'a T0: ::fidl_next::Encode<
4801                ::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>,
4802                ___E,
4803            >,
4804    {
4805        #[inline]
4806        fn encode(
4807            self,
4808            encoder_: &mut ___E,
4809            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortCloneRequest>,
4810            _: (),
4811        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4812            ::fidl_next::munge! {
4813                let crate::wire::PortCloneRequest {
4814                    port,
4815
4816                } = out_;
4817            }
4818
4819            ::fidl_next::Encode::encode(&self.port, encoder_, port, ())?;
4820
4821            Ok(())
4822        }
4823    }
4824
4825    /// The generic type corresponding to [`PortGetDiagnosticsRequest`].
4826    pub struct PortGetDiagnosticsRequest<T0> {
4827        pub diagnostics: T0,
4828    }
4829
4830    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::PortGetDiagnosticsRequest, ___E>
4831        for PortGetDiagnosticsRequest<T0>
4832    where
4833        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4834        ___E: ::fidl_next::fuchsia::HandleEncoder,
4835        T0: ::fidl_next::Encode<
4836                ::fidl_next::ServerEnd<crate::Diagnostics, ::fidl_next::wire::fuchsia::Channel>,
4837                ___E,
4838            >,
4839    {
4840        #[inline]
4841        fn encode(
4842            self,
4843            encoder_: &mut ___E,
4844            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetDiagnosticsRequest>,
4845            _: (),
4846        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4847            ::fidl_next::munge! {
4848                let crate::wire::PortGetDiagnosticsRequest {
4849                    diagnostics,
4850
4851                } = out_;
4852            }
4853
4854            ::fidl_next::Encode::encode(self.diagnostics, encoder_, diagnostics, ())?;
4855
4856            Ok(())
4857        }
4858    }
4859
4860    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::PortGetDiagnosticsRequest, ___E>
4861        for &'a PortGetDiagnosticsRequest<T0>
4862    where
4863        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4864        ___E: ::fidl_next::fuchsia::HandleEncoder,
4865        &'a T0: ::fidl_next::Encode<
4866                ::fidl_next::ServerEnd<crate::Diagnostics, ::fidl_next::wire::fuchsia::Channel>,
4867                ___E,
4868            >,
4869    {
4870        #[inline]
4871        fn encode(
4872            self,
4873            encoder_: &mut ___E,
4874            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetDiagnosticsRequest>,
4875            _: (),
4876        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4877            ::fidl_next::munge! {
4878                let crate::wire::PortGetDiagnosticsRequest {
4879                    diagnostics,
4880
4881                } = out_;
4882            }
4883
4884            ::fidl_next::Encode::encode(&self.diagnostics, encoder_, diagnostics, ())?;
4885
4886            Ok(())
4887        }
4888    }
4889
4890    /// The generic type corresponding to [`PortGetIdentityResponse`].
4891    pub struct PortGetIdentityResponse<T0> {
4892        pub event: T0,
4893    }
4894
4895    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::PortGetIdentityResponse, ___E>
4896        for PortGetIdentityResponse<T0>
4897    where
4898        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4899        ___E: ::fidl_next::fuchsia::HandleEncoder,
4900        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Event, ___E>,
4901    {
4902        #[inline]
4903        fn encode(
4904            self,
4905            encoder_: &mut ___E,
4906            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetIdentityResponse>,
4907            _: (),
4908        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4909            ::fidl_next::munge! {
4910                let crate::wire::PortGetIdentityResponse {
4911                    event,
4912
4913                } = out_;
4914            }
4915
4916            ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
4917
4918            Ok(())
4919        }
4920    }
4921
4922    unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::PortGetIdentityResponse, ___E>
4923        for &'a PortGetIdentityResponse<T0>
4924    where
4925        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4926        ___E: ::fidl_next::fuchsia::HandleEncoder,
4927        &'a T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Event, ___E>,
4928    {
4929        #[inline]
4930        fn encode(
4931            self,
4932            encoder_: &mut ___E,
4933            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetIdentityResponse>,
4934            _: (),
4935        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4936            ::fidl_next::munge! {
4937                let crate::wire::PortGetIdentityResponse {
4938                    event,
4939
4940                } = out_;
4941            }
4942
4943            ::fidl_next::Encode::encode(&self.event, encoder_, event, ())?;
4944
4945            Ok(())
4946        }
4947    }
4948
4949    /// The generic type corresponding to [`PortGetPowerDependencyTokenResponse`].
4950    pub struct PortGetPowerDependencyTokenResponse<T0> {
4951        pub token: T0,
4952    }
4953
4954    unsafe impl<___E, T0>
4955        ::fidl_next::Encode<crate::wire::PortGetPowerDependencyTokenResponse, ___E>
4956        for PortGetPowerDependencyTokenResponse<T0>
4957    where
4958        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4959        ___E: ::fidl_next::fuchsia::HandleEncoder,
4960        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalEvent, ___E>,
4961    {
4962        #[inline]
4963        fn encode(
4964            self,
4965            encoder_: &mut ___E,
4966            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetPowerDependencyTokenResponse>,
4967            _: (),
4968        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4969            ::fidl_next::munge! {
4970                let crate::wire::PortGetPowerDependencyTokenResponse {
4971                    token,
4972
4973                } = out_;
4974            }
4975
4976            ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
4977
4978            Ok(())
4979        }
4980    }
4981
4982    unsafe impl<'a, ___E, T0>
4983        ::fidl_next::Encode<crate::wire::PortGetPowerDependencyTokenResponse, ___E>
4984        for &'a PortGetPowerDependencyTokenResponse<T0>
4985    where
4986        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4987        ___E: ::fidl_next::fuchsia::HandleEncoder,
4988        &'a T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalEvent, ___E>,
4989    {
4990        #[inline]
4991        fn encode(
4992            self,
4993            encoder_: &mut ___E,
4994            out_: &mut ::core::mem::MaybeUninit<crate::wire::PortGetPowerDependencyTokenResponse>,
4995            _: (),
4996        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4997            ::fidl_next::munge! {
4998                let crate::wire::PortGetPowerDependencyTokenResponse {
4999                    token,
5000
5001                } = out_;
5002            }
5003
5004            ::fidl_next::Encode::encode(&self.token, encoder_, token, ())?;
5005
5006            Ok(())
5007        }
5008    }
5009
5010    /// The generic type corresponding to [`SessionWatchDelegatedRxLeaseResponse`].
5011    pub struct SessionWatchDelegatedRxLeaseResponse<T0> {
5012        pub lease: T0,
5013    }
5014
5015    unsafe impl<___E, T0>
5016        ::fidl_next::Encode<crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>, ___E>
5017        for SessionWatchDelegatedRxLeaseResponse<T0>
5018    where
5019        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5020        ___E: ::fidl_next::Encoder,
5021        ___E: ::fidl_next::fuchsia::HandleEncoder,
5022        T0: ::fidl_next::Encode<crate::wire::DelegatedRxLease<'static>, ___E>,
5023    {
5024        #[inline]
5025        fn encode(
5026            self,
5027            encoder_: &mut ___E,
5028            out_: &mut ::core::mem::MaybeUninit<
5029                crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>,
5030            >,
5031            _: (),
5032        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5033            ::fidl_next::munge! {
5034                let crate::wire::SessionWatchDelegatedRxLeaseResponse {
5035                    lease,
5036
5037                } = out_;
5038            }
5039
5040            ::fidl_next::Encode::encode(self.lease, encoder_, lease, ())?;
5041
5042            Ok(())
5043        }
5044    }
5045
5046    unsafe impl<'a, ___E, T0>
5047        ::fidl_next::Encode<crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>, ___E>
5048        for &'a SessionWatchDelegatedRxLeaseResponse<T0>
5049    where
5050        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5051        ___E: ::fidl_next::Encoder,
5052        ___E: ::fidl_next::fuchsia::HandleEncoder,
5053        &'a T0: ::fidl_next::Encode<crate::wire::DelegatedRxLease<'static>, ___E>,
5054    {
5055        #[inline]
5056        fn encode(
5057            self,
5058            encoder_: &mut ___E,
5059            out_: &mut ::core::mem::MaybeUninit<
5060                crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>,
5061            >,
5062            _: (),
5063        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5064            ::fidl_next::munge! {
5065                let crate::wire::SessionWatchDelegatedRxLeaseResponse {
5066                    lease,
5067
5068                } = out_;
5069            }
5070
5071            ::fidl_next::Encode::encode(&self.lease, encoder_, lease, ())?;
5072
5073            Ok(())
5074        }
5075    }
5076
5077    /// The generic type corresponding to [`SessionRegisterForTxRequest`].
5078    pub struct SessionRegisterForTxRequest<T0> {
5079        pub vmos: T0,
5080    }
5081
5082    unsafe impl<___E, T0>
5083        ::fidl_next::Encode<crate::wire::SessionRegisterForTxRequest<'static>, ___E>
5084        for SessionRegisterForTxRequest<T0>
5085    where
5086        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5087        ___E: ::fidl_next::Encoder,
5088        ___E: ::fidl_next::fuchsia::HandleEncoder,
5089        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
5090    {
5091        #[inline]
5092        fn encode(
5093            self,
5094            encoder_: &mut ___E,
5095            out_: &mut ::core::mem::MaybeUninit<crate::wire::SessionRegisterForTxRequest<'static>>,
5096            _: (),
5097        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5098            ::fidl_next::munge! {
5099                let crate::wire::SessionRegisterForTxRequest {
5100                    vmos,
5101
5102                } = out_;
5103            }
5104
5105            ::fidl_next::Encode::encode(self.vmos, encoder_, vmos, (32, ()))?;
5106
5107            Ok(())
5108        }
5109    }
5110
5111    unsafe impl<'a, ___E, T0>
5112        ::fidl_next::Encode<crate::wire::SessionRegisterForTxRequest<'static>, ___E>
5113        for &'a SessionRegisterForTxRequest<T0>
5114    where
5115        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5116        ___E: ::fidl_next::Encoder,
5117        ___E: ::fidl_next::fuchsia::HandleEncoder,
5118        &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
5119    {
5120        #[inline]
5121        fn encode(
5122            self,
5123            encoder_: &mut ___E,
5124            out_: &mut ::core::mem::MaybeUninit<crate::wire::SessionRegisterForTxRequest<'static>>,
5125            _: (),
5126        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5127            ::fidl_next::munge! {
5128                let crate::wire::SessionRegisterForTxRequest {
5129                    vmos,
5130
5131                } = out_;
5132            }
5133
5134            ::fidl_next::Encode::encode(&self.vmos, encoder_, vmos, (32, ()))?;
5135
5136            Ok(())
5137        }
5138    }
5139
5140    /// The generic type corresponding to [`SessionUnregisterForTxRequest`].
5141    pub struct SessionUnregisterForTxRequest<T0> {
5142        pub vmos: T0,
5143    }
5144
5145    unsafe impl<___E, T0>
5146        ::fidl_next::Encode<crate::wire::SessionUnregisterForTxRequest<'static>, ___E>
5147        for SessionUnregisterForTxRequest<T0>
5148    where
5149        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5150        ___E: ::fidl_next::Encoder,
5151        ___E: ::fidl_next::fuchsia::HandleEncoder,
5152        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
5153    {
5154        #[inline]
5155        fn encode(
5156            self,
5157            encoder_: &mut ___E,
5158            out_: &mut ::core::mem::MaybeUninit<
5159                crate::wire::SessionUnregisterForTxRequest<'static>,
5160            >,
5161            _: (),
5162        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5163            ::fidl_next::munge! {
5164                let crate::wire::SessionUnregisterForTxRequest {
5165                    vmos,
5166
5167                } = out_;
5168            }
5169
5170            ::fidl_next::Encode::encode(self.vmos, encoder_, vmos, (32, ()))?;
5171
5172            Ok(())
5173        }
5174    }
5175
5176    unsafe impl<'a, ___E, T0>
5177        ::fidl_next::Encode<crate::wire::SessionUnregisterForTxRequest<'static>, ___E>
5178        for &'a SessionUnregisterForTxRequest<T0>
5179    where
5180        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5181        ___E: ::fidl_next::Encoder,
5182        ___E: ::fidl_next::fuchsia::HandleEncoder,
5183        &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
5184    {
5185        #[inline]
5186        fn encode(
5187            self,
5188            encoder_: &mut ___E,
5189            out_: &mut ::core::mem::MaybeUninit<
5190                crate::wire::SessionUnregisterForTxRequest<'static>,
5191            >,
5192            _: (),
5193        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5194            ::fidl_next::munge! {
5195                let crate::wire::SessionUnregisterForTxRequest {
5196                    vmos,
5197
5198                } = out_;
5199            }
5200
5201            ::fidl_next::Encode::encode(&self.vmos, encoder_, vmos, (32, ()))?;
5202
5203            Ok(())
5204        }
5205    }
5206}
5207
5208pub use self::natural::*;
5209
5210/// The type corresponding to the Device protocol.
5211#[doc = " A Network Device.\n"]
5212#[derive(PartialEq, Debug)]
5213pub struct Device;
5214
5215#[cfg(target_os = "fuchsia")]
5216impl ::fidl_next::HasTransport for Device {
5217    type Transport = ::fidl_next::fuchsia::zx::Channel;
5218}
5219
5220pub mod device {
5221    pub mod prelude {
5222        pub use crate::{
5223            Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
5224            DeviceServerHandler, device,
5225        };
5226
5227        pub use crate::natural::DeviceCloneRequest;
5228
5229        pub use crate::natural::DeviceGetInfoResponse;
5230
5231        pub use crate::natural::DeviceGetPortRequest;
5232
5233        pub use crate::natural::DeviceGetPortWatcherRequest;
5234
5235        pub use crate::natural::DeviceOpenSessionRequest;
5236
5237        pub use crate::natural::DeviceOpenSessionResponse;
5238    }
5239
5240    pub struct GetInfo;
5241
5242    impl ::fidl_next::Method for GetInfo {
5243        const ORDINAL: u64 = 4345987561275952982;
5244        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
5245            ::fidl_next::protocol::Flexibility::Strict;
5246
5247        type Protocol = crate::Device;
5248
5249        type Request = ::fidl_next::wire::EmptyMessageBody;
5250    }
5251
5252    impl ::fidl_next::TwoWayMethod for GetInfo {
5253        type Response = ::fidl_next::wire::Strict<crate::wire::DeviceGetInfoResponse<'static>>;
5254    }
5255
5256    impl<___R> ::fidl_next::Respond<___R> for GetInfo {
5257        type Output = ::fidl_next::Strict<crate::generic::DeviceGetInfoResponse<___R>>;
5258
5259        fn respond(response: ___R) -> Self::Output {
5260            ::fidl_next::Strict(crate::generic::DeviceGetInfoResponse { info: response })
5261        }
5262    }
5263
5264    pub struct OpenSession;
5265
5266    impl ::fidl_next::Method for OpenSession {
5267        const ORDINAL: u64 = 2707801929272905575;
5268        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
5269            ::fidl_next::protocol::Flexibility::Strict;
5270
5271        type Protocol = crate::Device;
5272
5273        type Request = crate::wire::DeviceOpenSessionRequest<'static>;
5274    }
5275
5276    impl ::fidl_next::TwoWayMethod for OpenSession {
5277        type Response = ::fidl_next::wire::Result<
5278            'static,
5279            crate::wire::DeviceOpenSessionResponse,
5280            ::fidl_next::wire::fuchsia::Status,
5281        >;
5282    }
5283
5284    impl<___R> ::fidl_next::Respond<___R> for OpenSession {
5285        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
5286
5287        fn respond(response: ___R) -> Self::Output {
5288            ::core::result::Result::Ok(response)
5289        }
5290    }
5291
5292    impl<___R> ::fidl_next::RespondErr<___R> for OpenSession {
5293        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
5294
5295        fn respond_err(response: ___R) -> Self::Output {
5296            ::core::result::Result::Err(response)
5297        }
5298    }
5299
5300    pub struct GetPort;
5301
5302    impl ::fidl_next::Method for GetPort {
5303        const ORDINAL: u64 = 3749956066270225062;
5304        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
5305            ::fidl_next::protocol::Flexibility::Strict;
5306
5307        type Protocol = crate::Device;
5308
5309        type Request = crate::wire::DeviceGetPortRequest;
5310    }
5311
5312    pub struct GetPortWatcher;
5313
5314    impl ::fidl_next::Method for GetPortWatcher {
5315        const ORDINAL: u64 = 1175232559270043404;
5316        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
5317            ::fidl_next::protocol::Flexibility::Strict;
5318
5319        type Protocol = crate::Device;
5320
5321        type Request = crate::wire::DeviceGetPortWatcherRequest;
5322    }
5323
5324    pub struct Clone;
5325
5326    impl ::fidl_next::Method for Clone {
5327        const ORDINAL: u64 = 6377917349697198836;
5328        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
5329            ::fidl_next::protocol::Flexibility::Strict;
5330
5331        type Protocol = crate::Device;
5332
5333        type Request = crate::wire::DeviceCloneRequest;
5334    }
5335
5336    mod ___detail {
5337        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
5338        where
5339            ___T: ::fidl_next::Transport,
5340        {
5341            type Client = DeviceClient<___T>;
5342            type Server = DeviceServer<___T>;
5343        }
5344
5345        /// The client for the `Device` protocol.
5346        #[repr(transparent)]
5347        pub struct DeviceClient<___T: ::fidl_next::Transport> {
5348            #[allow(dead_code)]
5349            client: ::fidl_next::protocol::Client<___T>,
5350        }
5351
5352        impl<___T> DeviceClient<___T>
5353        where
5354            ___T: ::fidl_next::Transport,
5355        {
5356            #[doc = " Obtain information about device\n\n - response `info` device information.\n"]
5357            pub fn get_info(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetInfo, ___T> {
5358                ::fidl_next::TwoWayFuture::from_untyped(
5359                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
5360                        4345987561275952982,
5361                        <super::GetInfo as ::fidl_next::Method>::FLEXIBILITY,
5362                        (),
5363                    ),
5364                )
5365            }
5366
5367            #[doc = " Opens a new session with the network device.\n\n + request `session_name` is used as a debugging label attached to this\n session.\n + request `session_info` contains the necessary information to setup the\n session\'s data exchange.\n - response `session` a handle to control the session.\n - response `fifos` data-plane FIFOs attached to the session.\n * error `ZX_ERR_NOT_SUPPORTED` if `session_info` contains not supported\n frame types or descriptors set up.\n * error `ZX_ERR_INVALID_ARGS` if `session_info` is missing fields or\n contains invalid information.\n * error `ZX_ERR_INTERNAL` if the data VMO is rejected by the underlying\n device.\n"]
5368            pub fn open_session(
5369                &self,
5370
5371                session_name: impl ::fidl_next::Encode<
5372                    ::fidl_next::wire::String<'static>,
5373                    <___T as ::fidl_next::Transport>::SendBuffer,
5374                >,
5375
5376                session_info: impl ::fidl_next::Encode<
5377                    crate::wire::SessionInfo<'static>,
5378                    <___T as ::fidl_next::Transport>::SendBuffer,
5379                >,
5380            ) -> ::fidl_next::TwoWayFuture<'_, super::OpenSession, ___T>
5381            where
5382                <___T as ::fidl_next::Transport>::SendBuffer:
5383                    ::fidl_next::encoder::InternalHandleEncoder,
5384                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
5385                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
5386            {
5387                self.open_session_with(crate::generic::DeviceOpenSessionRequest {
5388                    session_name,
5389
5390                    session_info,
5391                })
5392            }
5393
5394            #[doc = " Opens a new session with the network device.\n\n + request `session_name` is used as a debugging label attached to this\n session.\n + request `session_info` contains the necessary information to setup the\n session\'s data exchange.\n - response `session` a handle to control the session.\n - response `fifos` data-plane FIFOs attached to the session.\n * error `ZX_ERR_NOT_SUPPORTED` if `session_info` contains not supported\n frame types or descriptors set up.\n * error `ZX_ERR_INVALID_ARGS` if `session_info` is missing fields or\n contains invalid information.\n * error `ZX_ERR_INTERNAL` if the data VMO is rejected by the underlying\n device.\n"]
5395            pub fn open_session_with<___R>(
5396                &self,
5397                request: ___R,
5398            ) -> ::fidl_next::TwoWayFuture<'_, super::OpenSession, ___T>
5399            where
5400                ___R: ::fidl_next::Encode<
5401                        crate::wire::DeviceOpenSessionRequest<'static>,
5402                        <___T as ::fidl_next::Transport>::SendBuffer,
5403                    >,
5404            {
5405                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
5406                    2707801929272905575,
5407                    <super::OpenSession as ::fidl_next::Method>::FLEXIBILITY,
5408                    request,
5409                ))
5410            }
5411
5412            #[doc = " Connects to a port the given `id`.\n\n + request `id` port to connect to.\n + request `port` server end of port channel.\n\n `port` is closed with a `ZX_ERR_NOT_FOUND` epitaph if no port with `id`\n exists.\n"]
5413            pub fn get_port(
5414                &self,
5415
5416                id: impl ::fidl_next::Encode<
5417                    crate::wire::PortId,
5418                    <___T as ::fidl_next::Transport>::SendBuffer,
5419                >,
5420
5421                port: impl ::fidl_next::Encode<
5422                    ::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>,
5423                    <___T as ::fidl_next::Transport>::SendBuffer,
5424                >,
5425            ) -> ::fidl_next::SendFuture<'_, ___T>
5426            where
5427                <___T as ::fidl_next::Transport>::SendBuffer:
5428                    ::fidl_next::encoder::InternalHandleEncoder,
5429                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
5430            {
5431                self.get_port_with(crate::generic::DeviceGetPortRequest { id, port })
5432            }
5433
5434            #[doc = " Connects to a port the given `id`.\n\n + request `id` port to connect to.\n + request `port` server end of port channel.\n\n `port` is closed with a `ZX_ERR_NOT_FOUND` epitaph if no port with `id`\n exists.\n"]
5435            pub fn get_port_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
5436            where
5437                ___R: ::fidl_next::Encode<
5438                        crate::wire::DeviceGetPortRequest,
5439                        <___T as ::fidl_next::Transport>::SendBuffer,
5440                    >,
5441            {
5442                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
5443                    3749956066270225062,
5444                    <super::GetPort as ::fidl_next::Method>::FLEXIBILITY,
5445                    request,
5446                ))
5447            }
5448
5449            #[doc = " Connects a [`PortWatcher`] to this device.\n\n + request `watcher` server end of watcher channel.\n"]
5450            pub fn get_port_watcher(
5451                &self,
5452
5453                watcher: impl ::fidl_next::Encode<
5454                    ::fidl_next::ServerEnd<crate::PortWatcher, ::fidl_next::wire::fuchsia::Channel>,
5455                    <___T as ::fidl_next::Transport>::SendBuffer,
5456                >,
5457            ) -> ::fidl_next::SendFuture<'_, ___T>
5458            where
5459                <___T as ::fidl_next::Transport>::SendBuffer:
5460                    ::fidl_next::encoder::InternalHandleEncoder,
5461                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
5462            {
5463                self.get_port_watcher_with(crate::generic::DeviceGetPortWatcherRequest { watcher })
5464            }
5465
5466            #[doc = " Connects a [`PortWatcher`] to this device.\n\n + request `watcher` server end of watcher channel.\n"]
5467            pub fn get_port_watcher_with<___R>(
5468                &self,
5469                request: ___R,
5470            ) -> ::fidl_next::SendFuture<'_, ___T>
5471            where
5472                ___R: ::fidl_next::Encode<
5473                        crate::wire::DeviceGetPortWatcherRequest,
5474                        <___T as ::fidl_next::Transport>::SendBuffer,
5475                    >,
5476            {
5477                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
5478                    1175232559270043404,
5479                    <super::GetPortWatcher as ::fidl_next::Method>::FLEXIBILITY,
5480                    request,
5481                ))
5482            }
5483
5484            #[doc = " Establishes a new connection to this device.\n\n + request `device` the server end for the new connection.\n"]
5485            pub fn clone(
5486                &self,
5487
5488                device: impl ::fidl_next::Encode<
5489                    ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
5490                    <___T as ::fidl_next::Transport>::SendBuffer,
5491                >,
5492            ) -> ::fidl_next::SendFuture<'_, ___T>
5493            where
5494                <___T as ::fidl_next::Transport>::SendBuffer:
5495                    ::fidl_next::encoder::InternalHandleEncoder,
5496                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
5497            {
5498                self.clone_with(crate::generic::DeviceCloneRequest { device })
5499            }
5500
5501            #[doc = " Establishes a new connection to this device.\n\n + request `device` the server end for the new connection.\n"]
5502            pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
5503            where
5504                ___R: ::fidl_next::Encode<
5505                        crate::wire::DeviceCloneRequest,
5506                        <___T as ::fidl_next::Transport>::SendBuffer,
5507                    >,
5508            {
5509                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
5510                    6377917349697198836,
5511                    <super::Clone as ::fidl_next::Method>::FLEXIBILITY,
5512                    request,
5513                ))
5514            }
5515        }
5516
5517        /// The server for the `Device` protocol.
5518        #[repr(transparent)]
5519        pub struct DeviceServer<___T: ::fidl_next::Transport> {
5520            server: ::fidl_next::protocol::Server<___T>,
5521        }
5522
5523        impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
5524    }
5525}
5526
5527#[diagnostic::on_unimplemented(
5528    note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
5529)]
5530
5531/// A client handler for the Device protocol.
5532///
5533/// See [`Device`] for more details.
5534pub trait DeviceLocalClientHandler<
5535    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5536    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5537>
5538{
5539}
5540
5541impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
5542where
5543    ___H: DeviceLocalClientHandler<___T>,
5544    ___T: ::fidl_next::Transport,
5545{
5546    async fn on_event(
5547        handler: &mut ___H,
5548        mut message: ::fidl_next::Message<___T>,
5549    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
5550        match *message.header().ordinal {
5551            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5552        }
5553    }
5554}
5555
5556#[diagnostic::on_unimplemented(
5557    note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
5558)]
5559
5560/// A server handler for the Device protocol.
5561///
5562/// See [`Device`] for more details.
5563pub trait DeviceLocalServerHandler<
5564    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5565    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5566>
5567{
5568    #[doc = " Obtain information about device\n\n - response `info` device information.\n"]
5569    fn get_info(
5570        &mut self,
5571
5572        responder: ::fidl_next::Responder<device::GetInfo, ___T>,
5573    ) -> impl ::core::future::Future<Output = ()>;
5574
5575    #[doc = " Opens a new session with the network device.\n\n + request `session_name` is used as a debugging label attached to this\n session.\n + request `session_info` contains the necessary information to setup the\n session\'s data exchange.\n - response `session` a handle to control the session.\n - response `fifos` data-plane FIFOs attached to the session.\n * error `ZX_ERR_NOT_SUPPORTED` if `session_info` contains not supported\n frame types or descriptors set up.\n * error `ZX_ERR_INVALID_ARGS` if `session_info` is missing fields or\n contains invalid information.\n * error `ZX_ERR_INTERNAL` if the data VMO is rejected by the underlying\n device.\n"]
5576    fn open_session(
5577        &mut self,
5578
5579        request: ::fidl_next::Request<device::OpenSession, ___T>,
5580
5581        responder: ::fidl_next::Responder<device::OpenSession, ___T>,
5582    ) -> impl ::core::future::Future<Output = ()>;
5583
5584    #[doc = " Connects to a port the given `id`.\n\n + request `id` port to connect to.\n + request `port` server end of port channel.\n\n `port` is closed with a `ZX_ERR_NOT_FOUND` epitaph if no port with `id`\n exists.\n"]
5585    fn get_port(
5586        &mut self,
5587
5588        request: ::fidl_next::Request<device::GetPort, ___T>,
5589    ) -> impl ::core::future::Future<Output = ()>;
5590
5591    #[doc = " Connects a [`PortWatcher`] to this device.\n\n + request `watcher` server end of watcher channel.\n"]
5592    fn get_port_watcher(
5593        &mut self,
5594
5595        request: ::fidl_next::Request<device::GetPortWatcher, ___T>,
5596    ) -> impl ::core::future::Future<Output = ()>;
5597
5598    #[doc = " Establishes a new connection to this device.\n\n + request `device` the server end for the new connection.\n"]
5599    fn clone(
5600        &mut self,
5601
5602        request: ::fidl_next::Request<device::Clone, ___T>,
5603    ) -> impl ::core::future::Future<Output = ()>;
5604}
5605
5606impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
5607where
5608    ___H: DeviceLocalServerHandler<___T>,
5609    ___T: ::fidl_next::Transport,
5610    for<'de> crate::wire::DeviceOpenSessionRequest<'de>: ::fidl_next::Decode<
5611            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5612            Constraint = (),
5613        >,
5614    for<'de> crate::wire::DeviceGetPortRequest: ::fidl_next::Decode<
5615            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5616            Constraint = (),
5617        >,
5618    for<'de> crate::wire::DeviceGetPortWatcherRequest: ::fidl_next::Decode<
5619            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5620            Constraint = (),
5621        >,
5622    for<'de> crate::wire::DeviceCloneRequest: ::fidl_next::Decode<
5623            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5624            Constraint = (),
5625        >,
5626{
5627    async fn on_one_way(
5628        handler: &mut ___H,
5629        mut message: ::fidl_next::Message<___T>,
5630    ) -> ::core::result::Result<
5631        (),
5632        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5633    > {
5634        match *message.header().ordinal {
5635            3749956066270225062 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5636                Ok(decoded) => {
5637                    handler.get_port(::fidl_next::Request::from_decoded(decoded)).await;
5638                    Ok(())
5639                }
5640                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5641                    ordinal: 3749956066270225062,
5642                    error,
5643                }),
5644            },
5645
5646            1175232559270043404 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5647                Ok(decoded) => {
5648                    handler.get_port_watcher(::fidl_next::Request::from_decoded(decoded)).await;
5649                    Ok(())
5650                }
5651                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5652                    ordinal: 1175232559270043404,
5653                    error,
5654                }),
5655            },
5656
5657            6377917349697198836 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5658                Ok(decoded) => {
5659                    handler.clone(::fidl_next::Request::from_decoded(decoded)).await;
5660                    Ok(())
5661                }
5662                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5663                    ordinal: 6377917349697198836,
5664                    error,
5665                }),
5666            },
5667
5668            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5669        }
5670    }
5671
5672    async fn on_two_way(
5673        handler: &mut ___H,
5674        mut message: ::fidl_next::Message<___T>,
5675        responder: ::fidl_next::protocol::Responder<___T>,
5676    ) -> ::core::result::Result<
5677        (),
5678        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5679    > {
5680        match *message.header().ordinal {
5681            4345987561275952982 => {
5682                let responder = ::fidl_next::Responder::from_untyped(responder);
5683
5684                handler.get_info(responder).await;
5685                Ok(())
5686            }
5687
5688            2707801929272905575 => {
5689                let responder = ::fidl_next::Responder::from_untyped(responder);
5690
5691                match ::fidl_next::AsDecoderExt::into_decoded(message) {
5692                    Ok(decoded) => {
5693                        handler
5694                            .open_session(::fidl_next::Request::from_decoded(decoded), responder)
5695                            .await;
5696                        Ok(())
5697                    }
5698                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5699                        ordinal: 2707801929272905575,
5700                        error,
5701                    }),
5702                }
5703            }
5704
5705            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5706        }
5707    }
5708}
5709
5710/// A client handler for the Device protocol.
5711///
5712/// See [`Device`] for more details.
5713pub trait DeviceClientHandler<
5714    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5715    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5716>
5717{
5718}
5719
5720impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
5721where
5722    ___H: DeviceClientHandler<___T> + ::core::marker::Send,
5723    ___T: ::fidl_next::Transport,
5724{
5725    async fn on_event(
5726        handler: &mut ___H,
5727        mut message: ::fidl_next::Message<___T>,
5728    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
5729        match *message.header().ordinal {
5730            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5731        }
5732    }
5733}
5734
5735/// A server handler for the Device protocol.
5736///
5737/// See [`Device`] for more details.
5738pub trait DeviceServerHandler<
5739    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5740    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5741>
5742{
5743    #[doc = " Obtain information about device\n\n - response `info` device information.\n"]
5744    fn get_info(
5745        &mut self,
5746
5747        responder: ::fidl_next::Responder<device::GetInfo, ___T>,
5748    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5749
5750    #[doc = " Opens a new session with the network device.\n\n + request `session_name` is used as a debugging label attached to this\n session.\n + request `session_info` contains the necessary information to setup the\n session\'s data exchange.\n - response `session` a handle to control the session.\n - response `fifos` data-plane FIFOs attached to the session.\n * error `ZX_ERR_NOT_SUPPORTED` if `session_info` contains not supported\n frame types or descriptors set up.\n * error `ZX_ERR_INVALID_ARGS` if `session_info` is missing fields or\n contains invalid information.\n * error `ZX_ERR_INTERNAL` if the data VMO is rejected by the underlying\n device.\n"]
5751    fn open_session(
5752        &mut self,
5753
5754        request: ::fidl_next::Request<device::OpenSession, ___T>,
5755
5756        responder: ::fidl_next::Responder<device::OpenSession, ___T>,
5757    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5758
5759    #[doc = " Connects to a port the given `id`.\n\n + request `id` port to connect to.\n + request `port` server end of port channel.\n\n `port` is closed with a `ZX_ERR_NOT_FOUND` epitaph if no port with `id`\n exists.\n"]
5760    fn get_port(
5761        &mut self,
5762
5763        request: ::fidl_next::Request<device::GetPort, ___T>,
5764    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5765
5766    #[doc = " Connects a [`PortWatcher`] to this device.\n\n + request `watcher` server end of watcher channel.\n"]
5767    fn get_port_watcher(
5768        &mut self,
5769
5770        request: ::fidl_next::Request<device::GetPortWatcher, ___T>,
5771    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5772
5773    #[doc = " Establishes a new connection to this device.\n\n + request `device` the server end for the new connection.\n"]
5774    fn clone(
5775        &mut self,
5776
5777        request: ::fidl_next::Request<device::Clone, ___T>,
5778    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5779}
5780
5781impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
5782where
5783    ___H: DeviceServerHandler<___T> + ::core::marker::Send,
5784    ___T: ::fidl_next::Transport,
5785    for<'de> crate::wire::DeviceOpenSessionRequest<'de>: ::fidl_next::Decode<
5786            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5787            Constraint = (),
5788        >,
5789    for<'de> crate::wire::DeviceGetPortRequest: ::fidl_next::Decode<
5790            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5791            Constraint = (),
5792        >,
5793    for<'de> crate::wire::DeviceGetPortWatcherRequest: ::fidl_next::Decode<
5794            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5795            Constraint = (),
5796        >,
5797    for<'de> crate::wire::DeviceCloneRequest: ::fidl_next::Decode<
5798            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5799            Constraint = (),
5800        >,
5801{
5802    async fn on_one_way(
5803        handler: &mut ___H,
5804        mut message: ::fidl_next::Message<___T>,
5805    ) -> ::core::result::Result<
5806        (),
5807        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5808    > {
5809        match *message.header().ordinal {
5810            3749956066270225062 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5811                Ok(decoded) => {
5812                    handler.get_port(::fidl_next::Request::from_decoded(decoded)).await;
5813                    Ok(())
5814                }
5815                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5816                    ordinal: 3749956066270225062,
5817                    error,
5818                }),
5819            },
5820
5821            1175232559270043404 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5822                Ok(decoded) => {
5823                    handler.get_port_watcher(::fidl_next::Request::from_decoded(decoded)).await;
5824                    Ok(())
5825                }
5826                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5827                    ordinal: 1175232559270043404,
5828                    error,
5829                }),
5830            },
5831
5832            6377917349697198836 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5833                Ok(decoded) => {
5834                    handler.clone(::fidl_next::Request::from_decoded(decoded)).await;
5835                    Ok(())
5836                }
5837                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5838                    ordinal: 6377917349697198836,
5839                    error,
5840                }),
5841            },
5842
5843            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5844        }
5845    }
5846
5847    async fn on_two_way(
5848        handler: &mut ___H,
5849        mut message: ::fidl_next::Message<___T>,
5850        responder: ::fidl_next::protocol::Responder<___T>,
5851    ) -> ::core::result::Result<
5852        (),
5853        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5854    > {
5855        match *message.header().ordinal {
5856            4345987561275952982 => {
5857                let responder = ::fidl_next::Responder::from_untyped(responder);
5858
5859                handler.get_info(responder).await;
5860                Ok(())
5861            }
5862
5863            2707801929272905575 => {
5864                let responder = ::fidl_next::Responder::from_untyped(responder);
5865
5866                match ::fidl_next::AsDecoderExt::into_decoded(message) {
5867                    Ok(decoded) => {
5868                        handler
5869                            .open_session(::fidl_next::Request::from_decoded(decoded), responder)
5870                            .await;
5871                        Ok(())
5872                    }
5873                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5874                        ordinal: 2707801929272905575,
5875                        error,
5876                    }),
5877                }
5878            }
5879
5880            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5881        }
5882    }
5883}
5884
5885impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
5886{}
5887
5888impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
5889where
5890    ___H: DeviceClientHandler<___T>,
5891    ___T: ::fidl_next::Transport,
5892{
5893}
5894
5895impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
5896where
5897    ___H: DeviceServerHandler<___T>,
5898    ___T: ::fidl_next::Transport,
5899{
5900    async fn get_info(&mut self, responder: ::fidl_next::Responder<device::GetInfo, ___T>) {
5901        ___H::get_info(&mut self.0, responder).await
5902    }
5903
5904    async fn open_session(
5905        &mut self,
5906
5907        request: ::fidl_next::Request<device::OpenSession, ___T>,
5908
5909        responder: ::fidl_next::Responder<device::OpenSession, ___T>,
5910    ) {
5911        ___H::open_session(&mut self.0, request, responder).await
5912    }
5913
5914    async fn get_port(&mut self, request: ::fidl_next::Request<device::GetPort, ___T>) {
5915        ___H::get_port(&mut self.0, request).await
5916    }
5917
5918    async fn get_port_watcher(
5919        &mut self,
5920
5921        request: ::fidl_next::Request<device::GetPortWatcher, ___T>,
5922    ) {
5923        ___H::get_port_watcher(&mut self.0, request).await
5924    }
5925
5926    async fn clone(&mut self, request: ::fidl_next::Request<device::Clone, ___T>) {
5927        ___H::clone(&mut self.0, request).await
5928    }
5929}
5930
5931/// The type corresponding to the Port protocol.
5932#[doc = " A logical port belonging to a [`Device`].\n"]
5933#[derive(PartialEq, Debug)]
5934pub struct Port;
5935
5936#[cfg(target_os = "fuchsia")]
5937impl ::fidl_next::HasTransport for Port {
5938    type Transport = ::fidl_next::fuchsia::zx::Channel;
5939}
5940
5941pub mod port {
5942    pub mod prelude {
5943        pub use crate::{
5944            Port, PortClientHandler, PortLocalClientHandler, PortLocalServerHandler,
5945            PortServerHandler, port,
5946        };
5947
5948        pub use crate::natural::PortCloneRequest;
5949
5950        pub use crate::natural::PortGetCountersResponse;
5951
5952        pub use crate::natural::PortGetDeviceRequest;
5953
5954        pub use crate::natural::PortGetDiagnosticsRequest;
5955
5956        pub use crate::natural::PortGetIdentityResponse;
5957
5958        pub use crate::natural::PortGetInfoResponse;
5959
5960        pub use crate::natural::PortGetMacRequest;
5961
5962        pub use crate::natural::PortGetPowerDependencyTokenResponse;
5963
5964        pub use crate::natural::PortGetStatusResponse;
5965
5966        pub use crate::natural::PortGetStatusWatcherRequest;
5967    }
5968
5969    pub struct GetInfo;
5970
5971    impl ::fidl_next::Method for GetInfo {
5972        const ORDINAL: u64 = 2840916356794502845;
5973        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
5974            ::fidl_next::protocol::Flexibility::Strict;
5975
5976        type Protocol = crate::Port;
5977
5978        type Request = ::fidl_next::wire::EmptyMessageBody;
5979    }
5980
5981    impl ::fidl_next::TwoWayMethod for GetInfo {
5982        type Response = ::fidl_next::wire::Strict<crate::wire::PortGetInfoResponse<'static>>;
5983    }
5984
5985    impl<___R> ::fidl_next::Respond<___R> for GetInfo {
5986        type Output = ::fidl_next::Strict<crate::generic::PortGetInfoResponse<___R>>;
5987
5988        fn respond(response: ___R) -> Self::Output {
5989            ::fidl_next::Strict(crate::generic::PortGetInfoResponse { info: response })
5990        }
5991    }
5992
5993    pub struct GetStatus;
5994
5995    impl ::fidl_next::Method for GetStatus {
5996        const ORDINAL: u64 = 4770830476791931058;
5997        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
5998            ::fidl_next::protocol::Flexibility::Strict;
5999
6000        type Protocol = crate::Port;
6001
6002        type Request = ::fidl_next::wire::EmptyMessageBody;
6003    }
6004
6005    impl ::fidl_next::TwoWayMethod for GetStatus {
6006        type Response = ::fidl_next::wire::Strict<crate::wire::PortGetStatusResponse<'static>>;
6007    }
6008
6009    impl<___R> ::fidl_next::Respond<___R> for GetStatus {
6010        type Output = ::fidl_next::Strict<crate::generic::PortGetStatusResponse<___R>>;
6011
6012        fn respond(response: ___R) -> Self::Output {
6013            ::fidl_next::Strict(crate::generic::PortGetStatusResponse { status: response })
6014        }
6015    }
6016
6017    pub struct GetStatusWatcher;
6018
6019    impl ::fidl_next::Method for GetStatusWatcher {
6020        const ORDINAL: u64 = 7300645848992176340;
6021        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6022            ::fidl_next::protocol::Flexibility::Strict;
6023
6024        type Protocol = crate::Port;
6025
6026        type Request = crate::wire::PortGetStatusWatcherRequest;
6027    }
6028
6029    pub struct GetMac;
6030
6031    impl ::fidl_next::Method for GetMac {
6032        const ORDINAL: u64 = 3201710345528787190;
6033        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6034            ::fidl_next::protocol::Flexibility::Strict;
6035
6036        type Protocol = crate::Port;
6037
6038        type Request = crate::wire::PortGetMacRequest;
6039    }
6040
6041    pub struct GetDevice;
6042
6043    impl ::fidl_next::Method for GetDevice {
6044        const ORDINAL: u64 = 9071172445315870080;
6045        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6046            ::fidl_next::protocol::Flexibility::Strict;
6047
6048        type Protocol = crate::Port;
6049
6050        type Request = crate::wire::PortGetDeviceRequest;
6051    }
6052
6053    pub struct Clone;
6054
6055    impl ::fidl_next::Method for Clone {
6056        const ORDINAL: u64 = 5640587099851277011;
6057        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6058            ::fidl_next::protocol::Flexibility::Strict;
6059
6060        type Protocol = crate::Port;
6061
6062        type Request = crate::wire::PortCloneRequest;
6063    }
6064
6065    pub struct GetCounters;
6066
6067    impl ::fidl_next::Method for GetCounters {
6068        const ORDINAL: u64 = 7647458529627650988;
6069        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6070            ::fidl_next::protocol::Flexibility::Strict;
6071
6072        type Protocol = crate::Port;
6073
6074        type Request = ::fidl_next::wire::EmptyMessageBody;
6075    }
6076
6077    impl ::fidl_next::TwoWayMethod for GetCounters {
6078        type Response = ::fidl_next::wire::Strict<crate::wire::PortGetCountersResponse<'static>>;
6079    }
6080
6081    impl<___R> ::fidl_next::Respond<___R> for GetCounters {
6082        type Output = ::fidl_next::Strict<___R>;
6083
6084        fn respond(response: ___R) -> Self::Output {
6085            ::fidl_next::Strict(response)
6086        }
6087    }
6088
6089    pub struct GetDiagnostics;
6090
6091    impl ::fidl_next::Method for GetDiagnostics {
6092        const ORDINAL: u64 = 4044138245999442332;
6093        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6094            ::fidl_next::protocol::Flexibility::Strict;
6095
6096        type Protocol = crate::Port;
6097
6098        type Request = crate::wire::PortGetDiagnosticsRequest;
6099    }
6100
6101    pub struct GetIdentity;
6102
6103    impl ::fidl_next::Method for GetIdentity {
6104        const ORDINAL: u64 = 8436171055106707034;
6105        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6106            ::fidl_next::protocol::Flexibility::Strict;
6107
6108        type Protocol = crate::Port;
6109
6110        type Request = ::fidl_next::wire::EmptyMessageBody;
6111    }
6112
6113    impl ::fidl_next::TwoWayMethod for GetIdentity {
6114        type Response = ::fidl_next::wire::Strict<crate::wire::PortGetIdentityResponse>;
6115    }
6116
6117    impl<___R> ::fidl_next::Respond<___R> for GetIdentity {
6118        type Output = ::fidl_next::Strict<crate::generic::PortGetIdentityResponse<___R>>;
6119
6120        fn respond(response: ___R) -> Self::Output {
6121            ::fidl_next::Strict(crate::generic::PortGetIdentityResponse { event: response })
6122        }
6123    }
6124
6125    pub struct GetPowerDependencyToken;
6126
6127    impl ::fidl_next::Method for GetPowerDependencyToken {
6128        const ORDINAL: u64 = 8929544763932440301;
6129        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6130            ::fidl_next::protocol::Flexibility::Strict;
6131
6132        type Protocol = crate::Port;
6133
6134        type Request = ::fidl_next::wire::EmptyMessageBody;
6135    }
6136
6137    impl ::fidl_next::TwoWayMethod for GetPowerDependencyToken {
6138        type Response = ::fidl_next::wire::Strict<crate::wire::PortGetPowerDependencyTokenResponse>;
6139    }
6140
6141    impl<___R> ::fidl_next::Respond<___R> for GetPowerDependencyToken {
6142        type Output =
6143            ::fidl_next::Strict<crate::generic::PortGetPowerDependencyTokenResponse<___R>>;
6144
6145        fn respond(response: ___R) -> Self::Output {
6146            ::fidl_next::Strict(crate::generic::PortGetPowerDependencyTokenResponse {
6147                token: response,
6148            })
6149        }
6150    }
6151
6152    mod ___detail {
6153        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Port
6154        where
6155            ___T: ::fidl_next::Transport,
6156        {
6157            type Client = PortClient<___T>;
6158            type Server = PortServer<___T>;
6159        }
6160
6161        /// The client for the `Port` protocol.
6162        #[repr(transparent)]
6163        pub struct PortClient<___T: ::fidl_next::Transport> {
6164            #[allow(dead_code)]
6165            client: ::fidl_next::protocol::Client<___T>,
6166        }
6167
6168        impl<___T> PortClient<___T>
6169        where
6170            ___T: ::fidl_next::Transport,
6171        {
6172            #[doc = " Obtain information about port.\n\n - response `info` port information.\n"]
6173            pub fn get_info(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetInfo, ___T> {
6174                ::fidl_next::TwoWayFuture::from_untyped(
6175                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
6176                        2840916356794502845,
6177                        <super::GetInfo as ::fidl_next::Method>::FLEXIBILITY,
6178                        (),
6179                    ),
6180                )
6181            }
6182
6183            #[doc = " Obtain the operating port status.\n\n - response `status` snapshot of port\'s current status.\n"]
6184            pub fn get_status(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetStatus, ___T> {
6185                ::fidl_next::TwoWayFuture::from_untyped(
6186                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
6187                        4770830476791931058,
6188                        <super::GetStatus as ::fidl_next::Method>::FLEXIBILITY,
6189                        (),
6190                    ),
6191                )
6192            }
6193
6194            #[doc = " Connects to a [`StatusWatcher`] to observe port status changes.\n\n + request `watcher` handle to the status watcher.\n + request `buffer` the number of status changes that the client requests\n to be stored by `StatusWatcher`. Values are capped at\n [`MAX_STATUS_BUFFER`]. A value of 0 or 1 causes the `StatusWatcher` to\n not keep any buffers on status changed. Clients that need to observe all\n changes to status (as opposed to only the current state) are encouraged\n to set a buffer value larger than 1, so that all edges can be observed.\n If `StatusWatcher`\'s internal queue is filled and new status changes\n occur, the oldest samples will be dropped to make room for new ones.\n"]
6195            pub fn get_status_watcher(
6196                &self,
6197
6198                watcher: impl ::fidl_next::Encode<
6199                    ::fidl_next::ServerEnd<
6200                        crate::StatusWatcher,
6201                        ::fidl_next::wire::fuchsia::Channel,
6202                    >,
6203                    <___T as ::fidl_next::Transport>::SendBuffer,
6204                >,
6205
6206                buffer: impl ::fidl_next::Encode<
6207                    ::fidl_next::wire::Uint32,
6208                    <___T as ::fidl_next::Transport>::SendBuffer,
6209                >,
6210            ) -> ::fidl_next::SendFuture<'_, ___T>
6211            where
6212                <___T as ::fidl_next::Transport>::SendBuffer:
6213                    ::fidl_next::encoder::InternalHandleEncoder,
6214                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
6215            {
6216                self.get_status_watcher_with(crate::generic::PortGetStatusWatcherRequest {
6217                    watcher,
6218
6219                    buffer,
6220                })
6221            }
6222
6223            #[doc = " Connects to a [`StatusWatcher`] to observe port status changes.\n\n + request `watcher` handle to the status watcher.\n + request `buffer` the number of status changes that the client requests\n to be stored by `StatusWatcher`. Values are capped at\n [`MAX_STATUS_BUFFER`]. A value of 0 or 1 causes the `StatusWatcher` to\n not keep any buffers on status changed. Clients that need to observe all\n changes to status (as opposed to only the current state) are encouraged\n to set a buffer value larger than 1, so that all edges can be observed.\n If `StatusWatcher`\'s internal queue is filled and new status changes\n occur, the oldest samples will be dropped to make room for new ones.\n"]
6224            pub fn get_status_watcher_with<___R>(
6225                &self,
6226                request: ___R,
6227            ) -> ::fidl_next::SendFuture<'_, ___T>
6228            where
6229                ___R: ::fidl_next::Encode<
6230                        crate::wire::PortGetStatusWatcherRequest,
6231                        <___T as ::fidl_next::Transport>::SendBuffer,
6232                    >,
6233            {
6234                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
6235                    7300645848992176340,
6236                    <super::GetStatusWatcher as ::fidl_next::Method>::FLEXIBILITY,
6237                    request,
6238                ))
6239            }
6240
6241            #[doc = " Connects to a [`MacAddressing`] associated with the port.\n\n + request `mac` mac handle. Closed with `ZX_ERR_NOT_SUPPORTED` if this\n port does not support mac addressing.\n"]
6242            pub fn get_mac(
6243                &self,
6244
6245                mac: impl ::fidl_next::Encode<
6246                    ::fidl_next::ServerEnd<
6247                        crate::MacAddressing,
6248                        ::fidl_next::wire::fuchsia::Channel,
6249                    >,
6250                    <___T as ::fidl_next::Transport>::SendBuffer,
6251                >,
6252            ) -> ::fidl_next::SendFuture<'_, ___T>
6253            where
6254                <___T as ::fidl_next::Transport>::SendBuffer:
6255                    ::fidl_next::encoder::InternalHandleEncoder,
6256                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
6257            {
6258                self.get_mac_with(crate::generic::PortGetMacRequest { mac })
6259            }
6260
6261            #[doc = " Connects to a [`MacAddressing`] associated with the port.\n\n + request `mac` mac handle. Closed with `ZX_ERR_NOT_SUPPORTED` if this\n port does not support mac addressing.\n"]
6262            pub fn get_mac_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
6263            where
6264                ___R: ::fidl_next::Encode<
6265                        crate::wire::PortGetMacRequest,
6266                        <___T as ::fidl_next::Transport>::SendBuffer,
6267                    >,
6268            {
6269                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
6270                    3201710345528787190,
6271                    <super::GetMac as ::fidl_next::Method>::FLEXIBILITY,
6272                    request,
6273                ))
6274            }
6275
6276            #[doc = " Connects to the [`Device`] this port belongs to.\n\n + request `device` grants access to the parent device.\n"]
6277            pub fn get_device(
6278                &self,
6279
6280                device: impl ::fidl_next::Encode<
6281                    ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
6282                    <___T as ::fidl_next::Transport>::SendBuffer,
6283                >,
6284            ) -> ::fidl_next::SendFuture<'_, ___T>
6285            where
6286                <___T as ::fidl_next::Transport>::SendBuffer:
6287                    ::fidl_next::encoder::InternalHandleEncoder,
6288                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
6289            {
6290                self.get_device_with(crate::generic::PortGetDeviceRequest { device })
6291            }
6292
6293            #[doc = " Connects to the [`Device`] this port belongs to.\n\n + request `device` grants access to the parent device.\n"]
6294            pub fn get_device_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
6295            where
6296                ___R: ::fidl_next::Encode<
6297                        crate::wire::PortGetDeviceRequest,
6298                        <___T as ::fidl_next::Transport>::SendBuffer,
6299                    >,
6300            {
6301                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
6302                    9071172445315870080,
6303                    <super::GetDevice as ::fidl_next::Method>::FLEXIBILITY,
6304                    request,
6305                ))
6306            }
6307
6308            #[doc = " Establishes a new connection to this port.\n\n + request `port` the server end for the new connection.\n"]
6309            pub fn clone(
6310                &self,
6311
6312                port: impl ::fidl_next::Encode<
6313                    ::fidl_next::ServerEnd<crate::Port, ::fidl_next::wire::fuchsia::Channel>,
6314                    <___T as ::fidl_next::Transport>::SendBuffer,
6315                >,
6316            ) -> ::fidl_next::SendFuture<'_, ___T>
6317            where
6318                <___T as ::fidl_next::Transport>::SendBuffer:
6319                    ::fidl_next::encoder::InternalHandleEncoder,
6320                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
6321            {
6322                self.clone_with(crate::generic::PortCloneRequest { port })
6323            }
6324
6325            #[doc = " Establishes a new connection to this port.\n\n + request `port` the server end for the new connection.\n"]
6326            pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
6327            where
6328                ___R: ::fidl_next::Encode<
6329                        crate::wire::PortCloneRequest,
6330                        <___T as ::fidl_next::Transport>::SendBuffer,
6331                    >,
6332            {
6333                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
6334                    5640587099851277011,
6335                    <super::Clone as ::fidl_next::Method>::FLEXIBILITY,
6336                    request,
6337                ))
6338            }
6339
6340            #[doc = " Retrieves a snapshot of traffic counters on this port.\n"]
6341            pub fn get_counters(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetCounters, ___T> {
6342                ::fidl_next::TwoWayFuture::from_untyped(
6343                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
6344                        7647458529627650988,
6345                        <super::GetCounters as ::fidl_next::Method>::FLEXIBILITY,
6346                        (),
6347                    ),
6348                )
6349            }
6350
6351            #[doc = " Grants access to [`Diagnostics`] for this port.\n\n + request `diagnostics` grants access to diagnostics information.\n"]
6352            pub fn get_diagnostics(
6353                &self,
6354
6355                diagnostics: impl ::fidl_next::Encode<
6356                    ::fidl_next::ServerEnd<crate::Diagnostics, ::fidl_next::wire::fuchsia::Channel>,
6357                    <___T as ::fidl_next::Transport>::SendBuffer,
6358                >,
6359            ) -> ::fidl_next::SendFuture<'_, ___T>
6360            where
6361                <___T as ::fidl_next::Transport>::SendBuffer:
6362                    ::fidl_next::encoder::InternalHandleEncoder,
6363                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
6364            {
6365                self.get_diagnostics_with(crate::generic::PortGetDiagnosticsRequest { diagnostics })
6366            }
6367
6368            #[doc = " Grants access to [`Diagnostics`] for this port.\n\n + request `diagnostics` grants access to diagnostics information.\n"]
6369            pub fn get_diagnostics_with<___R>(
6370                &self,
6371                request: ___R,
6372            ) -> ::fidl_next::SendFuture<'_, ___T>
6373            where
6374                ___R: ::fidl_next::Encode<
6375                        crate::wire::PortGetDiagnosticsRequest,
6376                        <___T as ::fidl_next::Transport>::SendBuffer,
6377                    >,
6378            {
6379                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
6380                    4044138245999442332,
6381                    <super::GetDiagnostics as ::fidl_next::Method>::FLEXIBILITY,
6382                    request,
6383                ))
6384            }
6385
6386            #[doc = " Retrieves a unique event handle that is always associated only with\n this port.\n\n This event may be used to uniquely identify a specific port instance\n across different APIs in the system.\n"]
6387            pub fn get_identity(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetIdentity, ___T> {
6388                ::fidl_next::TwoWayFuture::from_untyped(
6389                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
6390                        8436171055106707034,
6391                        <super::GetIdentity as ::fidl_next::Method>::FLEXIBILITY,
6392                        (),
6393                    ),
6394                )
6395            }
6396
6397            #[doc = " Gets the Power Broker dependency token for this port\'s power element.\n\n The token exposes two levels: `0` (off) and `1` (on). Clients lease\n level `1` whenever the port\'s datapath is required and hold the lease\n for as long as it is required. Drivers are free to internally\n power-manage a leased-but-idle port so long as it\'s invisible to upper\n layers.\n\n The token is fixed for the lifetime of the port.\n\n - response `token` absent if this port does not participate in power\n   management.\n - response `token` must have `zx.Rights.DUPLICATE`.\n"]
6398            pub fn get_power_dependency_token(
6399                &self,
6400            ) -> ::fidl_next::TwoWayFuture<'_, super::GetPowerDependencyToken, ___T> {
6401                ::fidl_next::TwoWayFuture::from_untyped(
6402                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
6403                        8929544763932440301,
6404                        <super::GetPowerDependencyToken as ::fidl_next::Method>::FLEXIBILITY,
6405                        (),
6406                    ),
6407                )
6408            }
6409        }
6410
6411        /// The server for the `Port` protocol.
6412        #[repr(transparent)]
6413        pub struct PortServer<___T: ::fidl_next::Transport> {
6414            server: ::fidl_next::protocol::Server<___T>,
6415        }
6416
6417        impl<___T> PortServer<___T> where ___T: ::fidl_next::Transport {}
6418    }
6419}
6420
6421#[diagnostic::on_unimplemented(
6422    note = "If {Self} implements the non-local PortClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
6423)]
6424
6425/// A client handler for the Port protocol.
6426///
6427/// See [`Port`] for more details.
6428pub trait PortLocalClientHandler<
6429    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
6430    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
6431>
6432{
6433}
6434
6435impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Port
6436where
6437    ___H: PortLocalClientHandler<___T>,
6438    ___T: ::fidl_next::Transport,
6439{
6440    async fn on_event(
6441        handler: &mut ___H,
6442        mut message: ::fidl_next::Message<___T>,
6443    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
6444        match *message.header().ordinal {
6445            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
6446        }
6447    }
6448}
6449
6450#[diagnostic::on_unimplemented(
6451    note = "If {Self} implements the non-local PortServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
6452)]
6453
6454/// A server handler for the Port protocol.
6455///
6456/// See [`Port`] for more details.
6457pub trait PortLocalServerHandler<
6458    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
6459    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
6460>
6461{
6462    #[doc = " Obtain information about port.\n\n - response `info` port information.\n"]
6463    fn get_info(
6464        &mut self,
6465
6466        responder: ::fidl_next::Responder<port::GetInfo, ___T>,
6467    ) -> impl ::core::future::Future<Output = ()>;
6468
6469    #[doc = " Obtain the operating port status.\n\n - response `status` snapshot of port\'s current status.\n"]
6470    fn get_status(
6471        &mut self,
6472
6473        responder: ::fidl_next::Responder<port::GetStatus, ___T>,
6474    ) -> impl ::core::future::Future<Output = ()>;
6475
6476    #[doc = " Connects to a [`StatusWatcher`] to observe port status changes.\n\n + request `watcher` handle to the status watcher.\n + request `buffer` the number of status changes that the client requests\n to be stored by `StatusWatcher`. Values are capped at\n [`MAX_STATUS_BUFFER`]. A value of 0 or 1 causes the `StatusWatcher` to\n not keep any buffers on status changed. Clients that need to observe all\n changes to status (as opposed to only the current state) are encouraged\n to set a buffer value larger than 1, so that all edges can be observed.\n If `StatusWatcher`\'s internal queue is filled and new status changes\n occur, the oldest samples will be dropped to make room for new ones.\n"]
6477    fn get_status_watcher(
6478        &mut self,
6479
6480        request: ::fidl_next::Request<port::GetStatusWatcher, ___T>,
6481    ) -> impl ::core::future::Future<Output = ()>;
6482
6483    #[doc = " Connects to a [`MacAddressing`] associated with the port.\n\n + request `mac` mac handle. Closed with `ZX_ERR_NOT_SUPPORTED` if this\n port does not support mac addressing.\n"]
6484    fn get_mac(
6485        &mut self,
6486
6487        request: ::fidl_next::Request<port::GetMac, ___T>,
6488    ) -> impl ::core::future::Future<Output = ()>;
6489
6490    #[doc = " Connects to the [`Device`] this port belongs to.\n\n + request `device` grants access to the parent device.\n"]
6491    fn get_device(
6492        &mut self,
6493
6494        request: ::fidl_next::Request<port::GetDevice, ___T>,
6495    ) -> impl ::core::future::Future<Output = ()>;
6496
6497    #[doc = " Establishes a new connection to this port.\n\n + request `port` the server end for the new connection.\n"]
6498    fn clone(
6499        &mut self,
6500
6501        request: ::fidl_next::Request<port::Clone, ___T>,
6502    ) -> impl ::core::future::Future<Output = ()>;
6503
6504    #[doc = " Retrieves a snapshot of traffic counters on this port.\n"]
6505    fn get_counters(
6506        &mut self,
6507
6508        responder: ::fidl_next::Responder<port::GetCounters, ___T>,
6509    ) -> impl ::core::future::Future<Output = ()>;
6510
6511    #[doc = " Grants access to [`Diagnostics`] for this port.\n\n + request `diagnostics` grants access to diagnostics information.\n"]
6512    fn get_diagnostics(
6513        &mut self,
6514
6515        request: ::fidl_next::Request<port::GetDiagnostics, ___T>,
6516    ) -> impl ::core::future::Future<Output = ()>;
6517
6518    #[doc = " Retrieves a unique event handle that is always associated only with\n this port.\n\n This event may be used to uniquely identify a specific port instance\n across different APIs in the system.\n"]
6519    fn get_identity(
6520        &mut self,
6521
6522        responder: ::fidl_next::Responder<port::GetIdentity, ___T>,
6523    ) -> impl ::core::future::Future<Output = ()>;
6524
6525    #[doc = " Gets the Power Broker dependency token for this port\'s power element.\n\n The token exposes two levels: `0` (off) and `1` (on). Clients lease\n level `1` whenever the port\'s datapath is required and hold the lease\n for as long as it is required. Drivers are free to internally\n power-manage a leased-but-idle port so long as it\'s invisible to upper\n layers.\n\n The token is fixed for the lifetime of the port.\n\n - response `token` absent if this port does not participate in power\n   management.\n - response `token` must have `zx.Rights.DUPLICATE`.\n"]
6526    fn get_power_dependency_token(
6527        &mut self,
6528
6529        responder: ::fidl_next::Responder<port::GetPowerDependencyToken, ___T>,
6530    ) -> impl ::core::future::Future<Output = ()>;
6531}
6532
6533impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Port
6534where
6535    ___H: PortLocalServerHandler<___T>,
6536    ___T: ::fidl_next::Transport,
6537    for<'de> crate::wire::PortGetStatusWatcherRequest: ::fidl_next::Decode<
6538            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6539            Constraint = (),
6540        >,
6541    for<'de> crate::wire::PortGetMacRequest: ::fidl_next::Decode<
6542            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6543            Constraint = (),
6544        >,
6545    for<'de> crate::wire::PortGetDeviceRequest: ::fidl_next::Decode<
6546            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6547            Constraint = (),
6548        >,
6549    for<'de> crate::wire::PortCloneRequest: ::fidl_next::Decode<
6550            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6551            Constraint = (),
6552        >,
6553    for<'de> crate::wire::PortGetDiagnosticsRequest: ::fidl_next::Decode<
6554            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6555            Constraint = (),
6556        >,
6557{
6558    async fn on_one_way(
6559        handler: &mut ___H,
6560        mut message: ::fidl_next::Message<___T>,
6561    ) -> ::core::result::Result<
6562        (),
6563        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
6564    > {
6565        match *message.header().ordinal {
6566            7300645848992176340 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6567                Ok(decoded) => {
6568                    handler.get_status_watcher(::fidl_next::Request::from_decoded(decoded)).await;
6569                    Ok(())
6570                }
6571                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6572                    ordinal: 7300645848992176340,
6573                    error,
6574                }),
6575            },
6576
6577            3201710345528787190 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6578                Ok(decoded) => {
6579                    handler.get_mac(::fidl_next::Request::from_decoded(decoded)).await;
6580                    Ok(())
6581                }
6582                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6583                    ordinal: 3201710345528787190,
6584                    error,
6585                }),
6586            },
6587
6588            9071172445315870080 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6589                Ok(decoded) => {
6590                    handler.get_device(::fidl_next::Request::from_decoded(decoded)).await;
6591                    Ok(())
6592                }
6593                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6594                    ordinal: 9071172445315870080,
6595                    error,
6596                }),
6597            },
6598
6599            5640587099851277011 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6600                Ok(decoded) => {
6601                    handler.clone(::fidl_next::Request::from_decoded(decoded)).await;
6602                    Ok(())
6603                }
6604                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6605                    ordinal: 5640587099851277011,
6606                    error,
6607                }),
6608            },
6609
6610            4044138245999442332 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6611                Ok(decoded) => {
6612                    handler.get_diagnostics(::fidl_next::Request::from_decoded(decoded)).await;
6613                    Ok(())
6614                }
6615                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6616                    ordinal: 4044138245999442332,
6617                    error,
6618                }),
6619            },
6620
6621            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
6622        }
6623    }
6624
6625    async fn on_two_way(
6626        handler: &mut ___H,
6627        mut message: ::fidl_next::Message<___T>,
6628        responder: ::fidl_next::protocol::Responder<___T>,
6629    ) -> ::core::result::Result<
6630        (),
6631        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
6632    > {
6633        match *message.header().ordinal {
6634            2840916356794502845 => {
6635                let responder = ::fidl_next::Responder::from_untyped(responder);
6636
6637                handler.get_info(responder).await;
6638                Ok(())
6639            }
6640
6641            4770830476791931058 => {
6642                let responder = ::fidl_next::Responder::from_untyped(responder);
6643
6644                handler.get_status(responder).await;
6645                Ok(())
6646            }
6647
6648            7647458529627650988 => {
6649                let responder = ::fidl_next::Responder::from_untyped(responder);
6650
6651                handler.get_counters(responder).await;
6652                Ok(())
6653            }
6654
6655            8436171055106707034 => {
6656                let responder = ::fidl_next::Responder::from_untyped(responder);
6657
6658                handler.get_identity(responder).await;
6659                Ok(())
6660            }
6661
6662            8929544763932440301 => {
6663                let responder = ::fidl_next::Responder::from_untyped(responder);
6664
6665                handler.get_power_dependency_token(responder).await;
6666                Ok(())
6667            }
6668
6669            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
6670        }
6671    }
6672}
6673
6674/// A client handler for the Port protocol.
6675///
6676/// See [`Port`] for more details.
6677pub trait PortClientHandler<
6678    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
6679    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
6680>
6681{
6682}
6683
6684impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Port
6685where
6686    ___H: PortClientHandler<___T> + ::core::marker::Send,
6687    ___T: ::fidl_next::Transport,
6688{
6689    async fn on_event(
6690        handler: &mut ___H,
6691        mut message: ::fidl_next::Message<___T>,
6692    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
6693        match *message.header().ordinal {
6694            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
6695        }
6696    }
6697}
6698
6699/// A server handler for the Port protocol.
6700///
6701/// See [`Port`] for more details.
6702pub trait PortServerHandler<
6703    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
6704    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
6705>
6706{
6707    #[doc = " Obtain information about port.\n\n - response `info` port information.\n"]
6708    fn get_info(
6709        &mut self,
6710
6711        responder: ::fidl_next::Responder<port::GetInfo, ___T>,
6712    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6713
6714    #[doc = " Obtain the operating port status.\n\n - response `status` snapshot of port\'s current status.\n"]
6715    fn get_status(
6716        &mut self,
6717
6718        responder: ::fidl_next::Responder<port::GetStatus, ___T>,
6719    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6720
6721    #[doc = " Connects to a [`StatusWatcher`] to observe port status changes.\n\n + request `watcher` handle to the status watcher.\n + request `buffer` the number of status changes that the client requests\n to be stored by `StatusWatcher`. Values are capped at\n [`MAX_STATUS_BUFFER`]. A value of 0 or 1 causes the `StatusWatcher` to\n not keep any buffers on status changed. Clients that need to observe all\n changes to status (as opposed to only the current state) are encouraged\n to set a buffer value larger than 1, so that all edges can be observed.\n If `StatusWatcher`\'s internal queue is filled and new status changes\n occur, the oldest samples will be dropped to make room for new ones.\n"]
6722    fn get_status_watcher(
6723        &mut self,
6724
6725        request: ::fidl_next::Request<port::GetStatusWatcher, ___T>,
6726    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6727
6728    #[doc = " Connects to a [`MacAddressing`] associated with the port.\n\n + request `mac` mac handle. Closed with `ZX_ERR_NOT_SUPPORTED` if this\n port does not support mac addressing.\n"]
6729    fn get_mac(
6730        &mut self,
6731
6732        request: ::fidl_next::Request<port::GetMac, ___T>,
6733    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6734
6735    #[doc = " Connects to the [`Device`] this port belongs to.\n\n + request `device` grants access to the parent device.\n"]
6736    fn get_device(
6737        &mut self,
6738
6739        request: ::fidl_next::Request<port::GetDevice, ___T>,
6740    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6741
6742    #[doc = " Establishes a new connection to this port.\n\n + request `port` the server end for the new connection.\n"]
6743    fn clone(
6744        &mut self,
6745
6746        request: ::fidl_next::Request<port::Clone, ___T>,
6747    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6748
6749    #[doc = " Retrieves a snapshot of traffic counters on this port.\n"]
6750    fn get_counters(
6751        &mut self,
6752
6753        responder: ::fidl_next::Responder<port::GetCounters, ___T>,
6754    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6755
6756    #[doc = " Grants access to [`Diagnostics`] for this port.\n\n + request `diagnostics` grants access to diagnostics information.\n"]
6757    fn get_diagnostics(
6758        &mut self,
6759
6760        request: ::fidl_next::Request<port::GetDiagnostics, ___T>,
6761    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6762
6763    #[doc = " Retrieves a unique event handle that is always associated only with\n this port.\n\n This event may be used to uniquely identify a specific port instance\n across different APIs in the system.\n"]
6764    fn get_identity(
6765        &mut self,
6766
6767        responder: ::fidl_next::Responder<port::GetIdentity, ___T>,
6768    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6769
6770    #[doc = " Gets the Power Broker dependency token for this port\'s power element.\n\n The token exposes two levels: `0` (off) and `1` (on). Clients lease\n level `1` whenever the port\'s datapath is required and hold the lease\n for as long as it is required. Drivers are free to internally\n power-manage a leased-but-idle port so long as it\'s invisible to upper\n layers.\n\n The token is fixed for the lifetime of the port.\n\n - response `token` absent if this port does not participate in power\n   management.\n - response `token` must have `zx.Rights.DUPLICATE`.\n"]
6771    fn get_power_dependency_token(
6772        &mut self,
6773
6774        responder: ::fidl_next::Responder<port::GetPowerDependencyToken, ___T>,
6775    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
6776}
6777
6778impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Port
6779where
6780    ___H: PortServerHandler<___T> + ::core::marker::Send,
6781    ___T: ::fidl_next::Transport,
6782    for<'de> crate::wire::PortGetStatusWatcherRequest: ::fidl_next::Decode<
6783            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6784            Constraint = (),
6785        >,
6786    for<'de> crate::wire::PortGetMacRequest: ::fidl_next::Decode<
6787            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6788            Constraint = (),
6789        >,
6790    for<'de> crate::wire::PortGetDeviceRequest: ::fidl_next::Decode<
6791            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6792            Constraint = (),
6793        >,
6794    for<'de> crate::wire::PortCloneRequest: ::fidl_next::Decode<
6795            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6796            Constraint = (),
6797        >,
6798    for<'de> crate::wire::PortGetDiagnosticsRequest: ::fidl_next::Decode<
6799            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
6800            Constraint = (),
6801        >,
6802{
6803    async fn on_one_way(
6804        handler: &mut ___H,
6805        mut message: ::fidl_next::Message<___T>,
6806    ) -> ::core::result::Result<
6807        (),
6808        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
6809    > {
6810        match *message.header().ordinal {
6811            7300645848992176340 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6812                Ok(decoded) => {
6813                    handler.get_status_watcher(::fidl_next::Request::from_decoded(decoded)).await;
6814                    Ok(())
6815                }
6816                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6817                    ordinal: 7300645848992176340,
6818                    error,
6819                }),
6820            },
6821
6822            3201710345528787190 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6823                Ok(decoded) => {
6824                    handler.get_mac(::fidl_next::Request::from_decoded(decoded)).await;
6825                    Ok(())
6826                }
6827                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6828                    ordinal: 3201710345528787190,
6829                    error,
6830                }),
6831            },
6832
6833            9071172445315870080 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6834                Ok(decoded) => {
6835                    handler.get_device(::fidl_next::Request::from_decoded(decoded)).await;
6836                    Ok(())
6837                }
6838                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6839                    ordinal: 9071172445315870080,
6840                    error,
6841                }),
6842            },
6843
6844            5640587099851277011 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6845                Ok(decoded) => {
6846                    handler.clone(::fidl_next::Request::from_decoded(decoded)).await;
6847                    Ok(())
6848                }
6849                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6850                    ordinal: 5640587099851277011,
6851                    error,
6852                }),
6853            },
6854
6855            4044138245999442332 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
6856                Ok(decoded) => {
6857                    handler.get_diagnostics(::fidl_next::Request::from_decoded(decoded)).await;
6858                    Ok(())
6859                }
6860                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
6861                    ordinal: 4044138245999442332,
6862                    error,
6863                }),
6864            },
6865
6866            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
6867        }
6868    }
6869
6870    async fn on_two_way(
6871        handler: &mut ___H,
6872        mut message: ::fidl_next::Message<___T>,
6873        responder: ::fidl_next::protocol::Responder<___T>,
6874    ) -> ::core::result::Result<
6875        (),
6876        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
6877    > {
6878        match *message.header().ordinal {
6879            2840916356794502845 => {
6880                let responder = ::fidl_next::Responder::from_untyped(responder);
6881
6882                handler.get_info(responder).await;
6883                Ok(())
6884            }
6885
6886            4770830476791931058 => {
6887                let responder = ::fidl_next::Responder::from_untyped(responder);
6888
6889                handler.get_status(responder).await;
6890                Ok(())
6891            }
6892
6893            7647458529627650988 => {
6894                let responder = ::fidl_next::Responder::from_untyped(responder);
6895
6896                handler.get_counters(responder).await;
6897                Ok(())
6898            }
6899
6900            8436171055106707034 => {
6901                let responder = ::fidl_next::Responder::from_untyped(responder);
6902
6903                handler.get_identity(responder).await;
6904                Ok(())
6905            }
6906
6907            8929544763932440301 => {
6908                let responder = ::fidl_next::Responder::from_untyped(responder);
6909
6910                handler.get_power_dependency_token(responder).await;
6911                Ok(())
6912            }
6913
6914            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
6915        }
6916    }
6917}
6918
6919impl<___T> PortClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
6920
6921impl<___H, ___T> PortLocalClientHandler<___T> for ::fidl_next::Local<___H>
6922where
6923    ___H: PortClientHandler<___T>,
6924    ___T: ::fidl_next::Transport,
6925{
6926}
6927
6928impl<___H, ___T> PortLocalServerHandler<___T> for ::fidl_next::Local<___H>
6929where
6930    ___H: PortServerHandler<___T>,
6931    ___T: ::fidl_next::Transport,
6932{
6933    async fn get_info(&mut self, responder: ::fidl_next::Responder<port::GetInfo, ___T>) {
6934        ___H::get_info(&mut self.0, responder).await
6935    }
6936
6937    async fn get_status(&mut self, responder: ::fidl_next::Responder<port::GetStatus, ___T>) {
6938        ___H::get_status(&mut self.0, responder).await
6939    }
6940
6941    async fn get_status_watcher(
6942        &mut self,
6943
6944        request: ::fidl_next::Request<port::GetStatusWatcher, ___T>,
6945    ) {
6946        ___H::get_status_watcher(&mut self.0, request).await
6947    }
6948
6949    async fn get_mac(&mut self, request: ::fidl_next::Request<port::GetMac, ___T>) {
6950        ___H::get_mac(&mut self.0, request).await
6951    }
6952
6953    async fn get_device(&mut self, request: ::fidl_next::Request<port::GetDevice, ___T>) {
6954        ___H::get_device(&mut self.0, request).await
6955    }
6956
6957    async fn clone(&mut self, request: ::fidl_next::Request<port::Clone, ___T>) {
6958        ___H::clone(&mut self.0, request).await
6959    }
6960
6961    async fn get_counters(&mut self, responder: ::fidl_next::Responder<port::GetCounters, ___T>) {
6962        ___H::get_counters(&mut self.0, responder).await
6963    }
6964
6965    async fn get_diagnostics(&mut self, request: ::fidl_next::Request<port::GetDiagnostics, ___T>) {
6966        ___H::get_diagnostics(&mut self.0, request).await
6967    }
6968
6969    async fn get_identity(&mut self, responder: ::fidl_next::Responder<port::GetIdentity, ___T>) {
6970        ___H::get_identity(&mut self.0, responder).await
6971    }
6972
6973    async fn get_power_dependency_token(
6974        &mut self,
6975
6976        responder: ::fidl_next::Responder<port::GetPowerDependencyToken, ___T>,
6977    ) {
6978        ___H::get_power_dependency_token(&mut self.0, responder).await
6979    }
6980}
6981
6982/// The type corresponding to the Service service.
6983#[derive(Debug)]
6984pub struct Service;
6985
6986impl ::fidl_next::DiscoverableService for Service {
6987    const SERVICE_NAME: &'static str = "fuchsia.hardware.network.Service";
6988    const MEMBER_NAMES: &'static [&'static str] = &["device", "device_topology"];
6989}
6990
6991impl ::fidl_next::HasServiceRequest<::fidl_next::fuchsia::zx::Channel> for Service {}
6992
6993impl<___C> ::fidl_next::Service<___C> for Service
6994where
6995    ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
6996    ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
6997{
6998    type Connector = ServiceConnector<___C>;
6999}
7000
7001/// A strongly-typed service connector for the `Service` service.
7002#[repr(transparent)]
7003pub struct ServiceConnector<___C> {
7004    #[allow(dead_code)]
7005    connector: ___C,
7006}
7007
7008impl<___C> ServiceConnector<___C>
7009where
7010    ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
7011    ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
7012{
7013    /// Attempts to connect to the `device` service member.
7014    pub fn device(
7015        &self,
7016        server_end: ::fidl_next::ServerEnd<crate::Device, ::fidl_next::fuchsia::zx::Channel>,
7017    ) -> ::core::result::Result<
7018        (),
7019        <___C as ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>>::Error,
7020    > {
7021        ::fidl_next::protocol::ServiceConnector::<
7022                ::fidl_next::fuchsia::zx::Channel
7023            >::connect_to_member(
7024                &self.connector,
7025                "device",
7026                server_end.into_untyped(),
7027            )
7028    }
7029
7030    /// Attempts to connect to the `device_topology` service member.
7031    pub fn device_topology(
7032        &self,
7033        server_end: ::fidl_next::ServerEnd<
7034            ::fidl_next_fuchsia_device_fs::TopologicalPath,
7035            ::fidl_next::fuchsia::zx::Channel,
7036        >,
7037    ) -> ::core::result::Result<
7038        (),
7039        <___C as ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>>::Error,
7040    > {
7041        ::fidl_next::protocol::ServiceConnector::<
7042                ::fidl_next::fuchsia::zx::Channel
7043            >::connect_to_member(
7044                &self.connector,
7045                "device_topology",
7046                server_end.into_untyped(),
7047            )
7048    }
7049}
7050
7051/// A service handler for the `Service` service.
7052pub trait ServiceHandler {
7053    /// Handles an attempt to connect to the `device` member.
7054    fn device(
7055        &self,
7056        server_end: ::fidl_next::ServerEnd<crate::Device, ::fidl_next::fuchsia::zx::Channel>,
7057    );
7058
7059    /// Handles an attempt to connect to the `device_topology` member.
7060    fn device_topology(
7061        &self,
7062        server_end: ::fidl_next::ServerEnd<
7063            ::fidl_next_fuchsia_device_fs::TopologicalPath,
7064            ::fidl_next::fuchsia::zx::Channel,
7065        >,
7066    );
7067}
7068
7069impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for Service
7070where
7071    ___H: ServiceHandler,
7072    ::fidl_next::fuchsia::zx::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
7073    ::fidl_next::fuchsia::zx::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
7074{
7075    fn on_connection(handler: &___H, member: &str, server_end: ___T) {
7076        use ::fidl_next::InstanceFromServiceTransport;
7077        match member {
7078            "device" => handler.device(::fidl_next::ServerEnd::from_untyped(
7079                ::fidl_next::fuchsia::zx::Channel::from_service_transport(server_end),
7080            )),
7081
7082            "device_topology" => handler.device_topology(::fidl_next::ServerEnd::from_untyped(
7083                ::fidl_next::fuchsia::zx::Channel::from_service_transport(server_end),
7084            )),
7085
7086            _ => unreachable!(),
7087        }
7088    }
7089}
7090
7091/// The type corresponding to the Session protocol.
7092#[doc = " Represents a session with a Network device.\n\n A session has a data plane and a control plane. The `Session` protocol\n represents the control plane of the session and the FIFOs and VMOs exchanged\n during the [`Device.OpenSession`] call are the data plane. Lifetime of the\n session is controlled by a `Session` protocol handle.\n\n Sessions must attach to ports of interest to start receiving and sending\n data. Sessions are always created with no ports attached.\n\n If a port is destroyed from the underlying device, it is automatically\n detached from the session.\n\n Inbound traffic is dispatched to all open sessions. Devices typically\n operate with a single primary session, see [`SessionFlags.PRIMARY`]. Each\n additional open session to the same device causes data copy overhead on the\n device\'s data path.\n\n The session is closed with an error epitaph if an invalid buffer descriptor\n is sent over either the tx or rx FIFOs. Invalid descriptors include:\n    - Descriptor index larger than [`SessionInfo.descriptor_count`].\n    - Descriptor chains larger than [`MAX_DESCRIPTOR_CHAIN`].\n    - rx buffers smaller than [`Info.min_rx_buffer_length`].\n    - tx buffers smaller than [`Info.min_tx_buffer_length`].\n    - tx buffers not respecting [`Info.min_tx_buffer_head`] or\n      [`Info.min_tx_buffer_tail`].\n"]
7093#[derive(PartialEq, Debug)]
7094pub struct Session;
7095
7096#[cfg(target_os = "fuchsia")]
7097impl ::fidl_next::HasTransport for Session {
7098    type Transport = ::fidl_next::fuchsia::zx::Channel;
7099}
7100
7101pub mod session {
7102    pub mod prelude {
7103        pub use crate::{
7104            Session, SessionClientHandler, SessionLocalClientHandler, SessionLocalServerHandler,
7105            SessionServerHandler, session,
7106        };
7107
7108        pub use crate::natural::SessionAttachRequest;
7109
7110        pub use crate::natural::SessionDetachRequest;
7111
7112        pub use crate::natural::SessionRegisterForTxRequest;
7113
7114        pub use crate::natural::SessionRegisterForTxResponse;
7115
7116        pub use crate::natural::SessionUnregisterForTxRequest;
7117
7118        pub use crate::natural::SessionUnregisterForTxResponse;
7119
7120        pub use crate::natural::SessionWatchDelegatedRxLeaseResponse;
7121
7122        pub use crate::natural::SessionAttachResponse;
7123
7124        pub use crate::natural::SessionDetachResponse;
7125    }
7126
7127    pub struct Attach;
7128
7129    impl ::fidl_next::Method for Attach {
7130        const ORDINAL: u64 = 2200510900121637753;
7131        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7132            ::fidl_next::protocol::Flexibility::Strict;
7133
7134        type Protocol = crate::Session;
7135
7136        type Request = crate::wire::SessionAttachRequest<'static>;
7137    }
7138
7139    impl ::fidl_next::TwoWayMethod for Attach {
7140        type Response = ::fidl_next::wire::Result<
7141            'static,
7142            crate::wire::SessionAttachResponse,
7143            ::fidl_next::wire::fuchsia::Status,
7144        >;
7145    }
7146
7147    impl<___R> ::fidl_next::Respond<___R> for Attach {
7148        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
7149
7150        fn respond(response: ___R) -> Self::Output {
7151            ::core::result::Result::Ok(response)
7152        }
7153    }
7154
7155    impl<___R> ::fidl_next::RespondErr<___R> for Attach {
7156        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
7157
7158        fn respond_err(response: ___R) -> Self::Output {
7159            ::core::result::Result::Err(response)
7160        }
7161    }
7162
7163    pub struct Detach;
7164
7165    impl ::fidl_next::Method for Detach {
7166        const ORDINAL: u64 = 7549173138887841895;
7167        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7168            ::fidl_next::protocol::Flexibility::Strict;
7169
7170        type Protocol = crate::Session;
7171
7172        type Request = crate::wire::SessionDetachRequest;
7173    }
7174
7175    impl ::fidl_next::TwoWayMethod for Detach {
7176        type Response = ::fidl_next::wire::Result<
7177            'static,
7178            crate::wire::SessionDetachResponse,
7179            ::fidl_next::wire::fuchsia::Status,
7180        >;
7181    }
7182
7183    impl<___R> ::fidl_next::Respond<___R> for Detach {
7184        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
7185
7186        fn respond(response: ___R) -> Self::Output {
7187            ::core::result::Result::Ok(response)
7188        }
7189    }
7190
7191    impl<___R> ::fidl_next::RespondErr<___R> for Detach {
7192        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
7193
7194        fn respond_err(response: ___R) -> Self::Output {
7195            ::core::result::Result::Err(response)
7196        }
7197    }
7198
7199    pub struct Close;
7200
7201    impl ::fidl_next::Method for Close {
7202        const ORDINAL: u64 = 4124541276668990198;
7203        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7204            ::fidl_next::protocol::Flexibility::Strict;
7205
7206        type Protocol = crate::Session;
7207
7208        type Request = ::fidl_next::wire::EmptyMessageBody;
7209    }
7210
7211    pub struct WatchDelegatedRxLease;
7212
7213    impl ::fidl_next::Method for WatchDelegatedRxLease {
7214        const ORDINAL: u64 = 8524612876345279413;
7215        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7216            ::fidl_next::protocol::Flexibility::Strict;
7217
7218        type Protocol = crate::Session;
7219
7220        type Request = ::fidl_next::wire::EmptyMessageBody;
7221    }
7222
7223    impl ::fidl_next::TwoWayMethod for WatchDelegatedRxLease {
7224        type Response =
7225            ::fidl_next::wire::Strict<crate::wire::SessionWatchDelegatedRxLeaseResponse<'static>>;
7226    }
7227
7228    impl<___R> ::fidl_next::Respond<___R> for WatchDelegatedRxLease {
7229        type Output =
7230            ::fidl_next::Strict<crate::generic::SessionWatchDelegatedRxLeaseResponse<___R>>;
7231
7232        fn respond(response: ___R) -> Self::Output {
7233            ::fidl_next::Strict(crate::generic::SessionWatchDelegatedRxLeaseResponse {
7234                lease: response,
7235            })
7236        }
7237    }
7238
7239    pub struct RegisterForTx;
7240
7241    impl ::fidl_next::Method for RegisterForTx {
7242        const ORDINAL: u64 = 3905209776239937562;
7243        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7244            ::fidl_next::protocol::Flexibility::Strict;
7245
7246        type Protocol = crate::Session;
7247
7248        type Request = crate::wire::SessionRegisterForTxRequest<'static>;
7249    }
7250
7251    impl ::fidl_next::TwoWayMethod for RegisterForTx {
7252        type Response = ::fidl_next::wire::Strict<crate::wire::SessionRegisterForTxResponse>;
7253    }
7254
7255    impl<___R> ::fidl_next::Respond<___R> for RegisterForTx {
7256        type Output = ::fidl_next::Strict<___R>;
7257
7258        fn respond(response: ___R) -> Self::Output {
7259            ::fidl_next::Strict(response)
7260        }
7261    }
7262
7263    pub struct UnregisterForTx;
7264
7265    impl ::fidl_next::Method for UnregisterForTx {
7266        const ORDINAL: u64 = 4500979904297707414;
7267        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7268            ::fidl_next::protocol::Flexibility::Strict;
7269
7270        type Protocol = crate::Session;
7271
7272        type Request = crate::wire::SessionUnregisterForTxRequest<'static>;
7273    }
7274
7275    impl ::fidl_next::TwoWayMethod for UnregisterForTx {
7276        type Response = ::fidl_next::wire::Strict<crate::wire::SessionUnregisterForTxResponse>;
7277    }
7278
7279    impl<___R> ::fidl_next::Respond<___R> for UnregisterForTx {
7280        type Output = ::fidl_next::Strict<___R>;
7281
7282        fn respond(response: ___R) -> Self::Output {
7283            ::fidl_next::Strict(response)
7284        }
7285    }
7286
7287    mod ___detail {
7288        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Session
7289        where
7290            ___T: ::fidl_next::Transport,
7291        {
7292            type Client = SessionClient<___T>;
7293            type Server = SessionServer<___T>;
7294        }
7295
7296        /// The client for the `Session` protocol.
7297        #[repr(transparent)]
7298        pub struct SessionClient<___T: ::fidl_next::Transport> {
7299            #[allow(dead_code)]
7300            client: ::fidl_next::protocol::Client<___T>,
7301        }
7302
7303        impl<___T> SessionClient<___T>
7304        where
7305            ___T: ::fidl_next::Transport,
7306        {
7307            #[doc = " Attaches the session to `port`.\n\n Once attached, the session starts to receive the subscribed frames over\n the data FIFOs and it may send frames destined to the specified `port`.\n\n + request `port` port to subscribe to.\n + request `rx_frames` Frame types of interest on the port.\n * error `ZX_ERR_NOT_FOUND` if `port` is not valid.\n * error `ZX_ERR_INVALID_ARGS` if `rx_frames` is not a subset of the\n port\'s supported frames.\n * error `ZX_ERR_ALREADY_BOUND` if `port` is already attached.\n"]
7308            pub fn attach(
7309                &self,
7310
7311                port: impl ::fidl_next::Encode<
7312                    crate::wire::PortId,
7313                    <___T as ::fidl_next::Transport>::SendBuffer,
7314                >,
7315
7316                rx_frames: impl ::fidl_next::Encode<
7317                    ::fidl_next::wire::Vector<'static, crate::wire::FrameType>,
7318                    <___T as ::fidl_next::Transport>::SendBuffer,
7319                >,
7320            ) -> ::fidl_next::TwoWayFuture<'_, super::Attach, ___T>
7321            where
7322                <___T as ::fidl_next::Transport>::SendBuffer:
7323                    ::fidl_next::encoder::InternalHandleEncoder,
7324                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
7325            {
7326                self.attach_with(crate::generic::SessionAttachRequest { port, rx_frames })
7327            }
7328
7329            #[doc = " Attaches the session to `port`.\n\n Once attached, the session starts to receive the subscribed frames over\n the data FIFOs and it may send frames destined to the specified `port`.\n\n + request `port` port to subscribe to.\n + request `rx_frames` Frame types of interest on the port.\n * error `ZX_ERR_NOT_FOUND` if `port` is not valid.\n * error `ZX_ERR_INVALID_ARGS` if `rx_frames` is not a subset of the\n port\'s supported frames.\n * error `ZX_ERR_ALREADY_BOUND` if `port` is already attached.\n"]
7330            pub fn attach_with<___R>(
7331                &self,
7332                request: ___R,
7333            ) -> ::fidl_next::TwoWayFuture<'_, super::Attach, ___T>
7334            where
7335                ___R: ::fidl_next::Encode<
7336                        crate::wire::SessionAttachRequest<'static>,
7337                        <___T as ::fidl_next::Transport>::SendBuffer,
7338                    >,
7339            {
7340                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7341                    2200510900121637753,
7342                    <super::Attach as ::fidl_next::Method>::FLEXIBILITY,
7343                    request,
7344                ))
7345            }
7346
7347            #[doc = " Detaches the session from `port`.\n\n Once detached, the session stops receiving frames from `port`. Frames\n sent to a detached port may be returned with an error. It is not\n necessary to call `Detach` on ports that are removed from the device,\n doing so causes `ZX_ERR_NOT_FOUND` to be returned.\n\n + request `port` port to subscribe to.\n * error `ZX_ERR_NOT_FOUND` if the session is not currently attached to\n the port.\n"]
7348            pub fn detach(
7349                &self,
7350
7351                port: impl ::fidl_next::Encode<
7352                    crate::wire::PortId,
7353                    <___T as ::fidl_next::Transport>::SendBuffer,
7354                >,
7355            ) -> ::fidl_next::TwoWayFuture<'_, super::Detach, ___T>
7356            where
7357                <___T as ::fidl_next::Transport>::SendBuffer:
7358                    ::fidl_next::encoder::InternalHandleEncoder,
7359            {
7360                self.detach_with(crate::generic::SessionDetachRequest { port })
7361            }
7362
7363            #[doc = " Detaches the session from `port`.\n\n Once detached, the session stops receiving frames from `port`. Frames\n sent to a detached port may be returned with an error. It is not\n necessary to call `Detach` on ports that are removed from the device,\n doing so causes `ZX_ERR_NOT_FOUND` to be returned.\n\n + request `port` port to subscribe to.\n * error `ZX_ERR_NOT_FOUND` if the session is not currently attached to\n the port.\n"]
7364            pub fn detach_with<___R>(
7365                &self,
7366                request: ___R,
7367            ) -> ::fidl_next::TwoWayFuture<'_, super::Detach, ___T>
7368            where
7369                ___R: ::fidl_next::Encode<
7370                        crate::wire::SessionDetachRequest,
7371                        <___T as ::fidl_next::Transport>::SendBuffer,
7372                    >,
7373            {
7374                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7375                    7549173138887841895,
7376                    <super::Detach as ::fidl_next::Method>::FLEXIBILITY,
7377                    request,
7378                ))
7379            }
7380
7381            #[doc = " Cleanly closes a session.\n\n This will cause the session to send a `ZX_ERR_CANCELLED` epitaph and\n proceed to close the Session channel. Clients may only assume that they\n own all the buffers that are currently owned by the session (sent over\n either the rx or tx FIFOs) once the epitaph is received. Closing the rx\n or tx FIFO is equivalent to calling `Close`.\n"]
7382            pub fn close(&self) -> ::fidl_next::SendFuture<'_, ___T> {
7383                ::fidl_next::SendFuture::from_untyped(
7384                    self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
7385                        4124541276668990198,
7386                        <super::Close as ::fidl_next::Method>::FLEXIBILITY,
7387                        (),
7388                    ),
7389                )
7390            }
7391
7392            #[doc = " Watchers for delegated receive wakeup leases.\n\n Calls block until a lease is delegated by the device. If a call to\n `WatchDelegatedRxLease` is made while a previous call is blocking, the\n session is closed with `ZX_ERR_BAD_STATE`. Will never yield any values\n for sessions created without [`SessionFlags.RECEIVE_RX_POWER_LEASES`].\n\n Given a single lease is assumed sufficient to keep the system awake, the\n server only keeps a single lease in its buffer. If a new delegated lease\n becomes available and the client hasn\'t popped the previous one with a\n call to `WatchDelegatedRxLease`, the server drops the previously pending\n lease.\n\n See [`DelegatedRxLease`] for how to handle delegated leases.\n"]
7393            pub fn watch_delegated_rx_lease(
7394                &self,
7395            ) -> ::fidl_next::TwoWayFuture<'_, super::WatchDelegatedRxLease, ___T> {
7396                ::fidl_next::TwoWayFuture::from_untyped(
7397                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7398                        8524612876345279413,
7399                        <super::WatchDelegatedRxLease as ::fidl_next::Method>::FLEXIBILITY,
7400                        (),
7401                    ),
7402                )
7403            }
7404
7405            #[doc = " Asks the network device to register the VMO for Tx.\n\n The network device prepares the VMOs in order and stops at the first\n error if any. It returns how many VMOs have been prepared alongside with\n the first error encountered. Note that network-device itself does not\n try to release earlier VMOs for a later error. It is up to the client\n how to recover from an error.\n\n * error `ZX_ERR_NOT_FOUND` if any of the VmoId is unknown.\n * error other zx status that can be reported by the driver.\n"]
7406            pub fn register_for_tx(
7407                &self,
7408
7409                vmos: impl ::fidl_next::Encode<
7410                    ::fidl_next::wire::Vector<'static, u8>,
7411                    <___T as ::fidl_next::Transport>::SendBuffer,
7412                >,
7413            ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterForTx, ___T>
7414            where
7415                <___T as ::fidl_next::Transport>::SendBuffer:
7416                    ::fidl_next::encoder::InternalHandleEncoder,
7417                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
7418                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7419            {
7420                self.register_for_tx_with(crate::generic::SessionRegisterForTxRequest { vmos })
7421            }
7422
7423            #[doc = " Asks the network device to register the VMO for Tx.\n\n The network device prepares the VMOs in order and stops at the first\n error if any. It returns how many VMOs have been prepared alongside with\n the first error encountered. Note that network-device itself does not\n try to release earlier VMOs for a later error. It is up to the client\n how to recover from an error.\n\n * error `ZX_ERR_NOT_FOUND` if any of the VmoId is unknown.\n * error other zx status that can be reported by the driver.\n"]
7424            pub fn register_for_tx_with<___R>(
7425                &self,
7426                request: ___R,
7427            ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterForTx, ___T>
7428            where
7429                ___R: ::fidl_next::Encode<
7430                        crate::wire::SessionRegisterForTxRequest<'static>,
7431                        <___T as ::fidl_next::Transport>::SendBuffer,
7432                    >,
7433            {
7434                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7435                    3905209776239937562,
7436                    <super::RegisterForTx as ::fidl_next::Method>::FLEXIBILITY,
7437                    request,
7438                ))
7439            }
7440
7441            #[doc = " Tells the device that the client will no longer use the VMO for Tx,\n if the VMO is also unused for Rx, the device is free to release it\n at the implementation driver.\n\n The network device processes the VMOs in order and stops at the first\n error if any. It returns how many VMOs have been marked as unused for Tx\n alongside with the first error encountered. Note that network-device\n itself does not try to re-register earlier VMOs for a later error. It is\n up to the client how to recover from an error.\n\n * error `ZX_ERR_NOT_FOUND` if any of the VmoId is unknown.\n * error other zx status that can be reported by the driver.\n"]
7442            pub fn unregister_for_tx(
7443                &self,
7444
7445                vmos: impl ::fidl_next::Encode<
7446                    ::fidl_next::wire::Vector<'static, u8>,
7447                    <___T as ::fidl_next::Transport>::SendBuffer,
7448                >,
7449            ) -> ::fidl_next::TwoWayFuture<'_, super::UnregisterForTx, ___T>
7450            where
7451                <___T as ::fidl_next::Transport>::SendBuffer:
7452                    ::fidl_next::encoder::InternalHandleEncoder,
7453                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
7454                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7455            {
7456                self.unregister_for_tx_with(crate::generic::SessionUnregisterForTxRequest { vmos })
7457            }
7458
7459            #[doc = " Tells the device that the client will no longer use the VMO for Tx,\n if the VMO is also unused for Rx, the device is free to release it\n at the implementation driver.\n\n The network device processes the VMOs in order and stops at the first\n error if any. It returns how many VMOs have been marked as unused for Tx\n alongside with the first error encountered. Note that network-device\n itself does not try to re-register earlier VMOs for a later error. It is\n up to the client how to recover from an error.\n\n * error `ZX_ERR_NOT_FOUND` if any of the VmoId is unknown.\n * error other zx status that can be reported by the driver.\n"]
7460            pub fn unregister_for_tx_with<___R>(
7461                &self,
7462                request: ___R,
7463            ) -> ::fidl_next::TwoWayFuture<'_, super::UnregisterForTx, ___T>
7464            where
7465                ___R: ::fidl_next::Encode<
7466                        crate::wire::SessionUnregisterForTxRequest<'static>,
7467                        <___T as ::fidl_next::Transport>::SendBuffer,
7468                    >,
7469            {
7470                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7471                    4500979904297707414,
7472                    <super::UnregisterForTx as ::fidl_next::Method>::FLEXIBILITY,
7473                    request,
7474                ))
7475            }
7476        }
7477
7478        /// The server for the `Session` protocol.
7479        #[repr(transparent)]
7480        pub struct SessionServer<___T: ::fidl_next::Transport> {
7481            server: ::fidl_next::protocol::Server<___T>,
7482        }
7483
7484        impl<___T> SessionServer<___T> where ___T: ::fidl_next::Transport {}
7485    }
7486}
7487
7488#[diagnostic::on_unimplemented(
7489    note = "If {Self} implements the non-local SessionClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
7490)]
7491
7492/// A client handler for the Session protocol.
7493///
7494/// See [`Session`] for more details.
7495pub trait SessionLocalClientHandler<
7496    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7497    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7498>
7499{
7500}
7501
7502impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Session
7503where
7504    ___H: SessionLocalClientHandler<___T>,
7505    ___T: ::fidl_next::Transport,
7506{
7507    async fn on_event(
7508        handler: &mut ___H,
7509        mut message: ::fidl_next::Message<___T>,
7510    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7511        match *message.header().ordinal {
7512            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7513        }
7514    }
7515}
7516
7517#[diagnostic::on_unimplemented(
7518    note = "If {Self} implements the non-local SessionServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
7519)]
7520
7521/// A server handler for the Session protocol.
7522///
7523/// See [`Session`] for more details.
7524pub trait SessionLocalServerHandler<
7525    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7526    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7527>
7528{
7529    #[doc = " Attaches the session to `port`.\n\n Once attached, the session starts to receive the subscribed frames over\n the data FIFOs and it may send frames destined to the specified `port`.\n\n + request `port` port to subscribe to.\n + request `rx_frames` Frame types of interest on the port.\n * error `ZX_ERR_NOT_FOUND` if `port` is not valid.\n * error `ZX_ERR_INVALID_ARGS` if `rx_frames` is not a subset of the\n port\'s supported frames.\n * error `ZX_ERR_ALREADY_BOUND` if `port` is already attached.\n"]
7530    fn attach(
7531        &mut self,
7532
7533        request: ::fidl_next::Request<session::Attach, ___T>,
7534
7535        responder: ::fidl_next::Responder<session::Attach, ___T>,
7536    ) -> impl ::core::future::Future<Output = ()>;
7537
7538    #[doc = " Detaches the session from `port`.\n\n Once detached, the session stops receiving frames from `port`. Frames\n sent to a detached port may be returned with an error. It is not\n necessary to call `Detach` on ports that are removed from the device,\n doing so causes `ZX_ERR_NOT_FOUND` to be returned.\n\n + request `port` port to subscribe to.\n * error `ZX_ERR_NOT_FOUND` if the session is not currently attached to\n the port.\n"]
7539    fn detach(
7540        &mut self,
7541
7542        request: ::fidl_next::Request<session::Detach, ___T>,
7543
7544        responder: ::fidl_next::Responder<session::Detach, ___T>,
7545    ) -> impl ::core::future::Future<Output = ()>;
7546
7547    #[doc = " Cleanly closes a session.\n\n This will cause the session to send a `ZX_ERR_CANCELLED` epitaph and\n proceed to close the Session channel. Clients may only assume that they\n own all the buffers that are currently owned by the session (sent over\n either the rx or tx FIFOs) once the epitaph is received. Closing the rx\n or tx FIFO is equivalent to calling `Close`.\n"]
7548    fn close(&mut self) -> impl ::core::future::Future<Output = ()>;
7549
7550    #[doc = " Watchers for delegated receive wakeup leases.\n\n Calls block until a lease is delegated by the device. If a call to\n `WatchDelegatedRxLease` is made while a previous call is blocking, the\n session is closed with `ZX_ERR_BAD_STATE`. Will never yield any values\n for sessions created without [`SessionFlags.RECEIVE_RX_POWER_LEASES`].\n\n Given a single lease is assumed sufficient to keep the system awake, the\n server only keeps a single lease in its buffer. If a new delegated lease\n becomes available and the client hasn\'t popped the previous one with a\n call to `WatchDelegatedRxLease`, the server drops the previously pending\n lease.\n\n See [`DelegatedRxLease`] for how to handle delegated leases.\n"]
7551    fn watch_delegated_rx_lease(
7552        &mut self,
7553
7554        responder: ::fidl_next::Responder<session::WatchDelegatedRxLease, ___T>,
7555    ) -> impl ::core::future::Future<Output = ()>;
7556
7557    #[doc = " Asks the network device to register the VMO for Tx.\n\n The network device prepares the VMOs in order and stops at the first\n error if any. It returns how many VMOs have been prepared alongside with\n the first error encountered. Note that network-device itself does not\n try to release earlier VMOs for a later error. It is up to the client\n how to recover from an error.\n\n * error `ZX_ERR_NOT_FOUND` if any of the VmoId is unknown.\n * error other zx status that can be reported by the driver.\n"]
7558    fn register_for_tx(
7559        &mut self,
7560
7561        request: ::fidl_next::Request<session::RegisterForTx, ___T>,
7562
7563        responder: ::fidl_next::Responder<session::RegisterForTx, ___T>,
7564    ) -> impl ::core::future::Future<Output = ()>;
7565
7566    #[doc = " Tells the device that the client will no longer use the VMO for Tx,\n if the VMO is also unused for Rx, the device is free to release it\n at the implementation driver.\n\n The network device processes the VMOs in order and stops at the first\n error if any. It returns how many VMOs have been marked as unused for Tx\n alongside with the first error encountered. Note that network-device\n itself does not try to re-register earlier VMOs for a later error. It is\n up to the client how to recover from an error.\n\n * error `ZX_ERR_NOT_FOUND` if any of the VmoId is unknown.\n * error other zx status that can be reported by the driver.\n"]
7567    fn unregister_for_tx(
7568        &mut self,
7569
7570        request: ::fidl_next::Request<session::UnregisterForTx, ___T>,
7571
7572        responder: ::fidl_next::Responder<session::UnregisterForTx, ___T>,
7573    ) -> impl ::core::future::Future<Output = ()>;
7574}
7575
7576impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Session
7577where
7578    ___H: SessionLocalServerHandler<___T>,
7579    ___T: ::fidl_next::Transport,
7580    for<'de> crate::wire::SessionAttachRequest<'de>: ::fidl_next::Decode<
7581            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7582            Constraint = (),
7583        >,
7584    for<'de> crate::wire::SessionDetachRequest: ::fidl_next::Decode<
7585            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7586            Constraint = (),
7587        >,
7588    for<'de> crate::wire::SessionRegisterForTxRequest<'de>: ::fidl_next::Decode<
7589            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7590            Constraint = (),
7591        >,
7592    for<'de> crate::wire::SessionUnregisterForTxRequest<'de>: ::fidl_next::Decode<
7593            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7594            Constraint = (),
7595        >,
7596{
7597    async fn on_one_way(
7598        handler: &mut ___H,
7599        mut message: ::fidl_next::Message<___T>,
7600    ) -> ::core::result::Result<
7601        (),
7602        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7603    > {
7604        match *message.header().ordinal {
7605            4124541276668990198 => {
7606                handler.close().await;
7607                Ok(())
7608            }
7609
7610            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7611        }
7612    }
7613
7614    async fn on_two_way(
7615        handler: &mut ___H,
7616        mut message: ::fidl_next::Message<___T>,
7617        responder: ::fidl_next::protocol::Responder<___T>,
7618    ) -> ::core::result::Result<
7619        (),
7620        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7621    > {
7622        match *message.header().ordinal {
7623            2200510900121637753 => {
7624                let responder = ::fidl_next::Responder::from_untyped(responder);
7625
7626                match ::fidl_next::AsDecoderExt::into_decoded(message) {
7627                    Ok(decoded) => {
7628                        handler
7629                            .attach(::fidl_next::Request::from_decoded(decoded), responder)
7630                            .await;
7631                        Ok(())
7632                    }
7633                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7634                        ordinal: 2200510900121637753,
7635                        error,
7636                    }),
7637                }
7638            }
7639
7640            7549173138887841895 => {
7641                let responder = ::fidl_next::Responder::from_untyped(responder);
7642
7643                match ::fidl_next::AsDecoderExt::into_decoded(message) {
7644                    Ok(decoded) => {
7645                        handler
7646                            .detach(::fidl_next::Request::from_decoded(decoded), responder)
7647                            .await;
7648                        Ok(())
7649                    }
7650                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7651                        ordinal: 7549173138887841895,
7652                        error,
7653                    }),
7654                }
7655            }
7656
7657            8524612876345279413 => {
7658                let responder = ::fidl_next::Responder::from_untyped(responder);
7659
7660                handler.watch_delegated_rx_lease(responder).await;
7661                Ok(())
7662            }
7663
7664            3905209776239937562 => {
7665                let responder = ::fidl_next::Responder::from_untyped(responder);
7666
7667                match ::fidl_next::AsDecoderExt::into_decoded(message) {
7668                    Ok(decoded) => {
7669                        handler
7670                            .register_for_tx(::fidl_next::Request::from_decoded(decoded), responder)
7671                            .await;
7672                        Ok(())
7673                    }
7674                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7675                        ordinal: 3905209776239937562,
7676                        error,
7677                    }),
7678                }
7679            }
7680
7681            4500979904297707414 => {
7682                let responder = ::fidl_next::Responder::from_untyped(responder);
7683
7684                match ::fidl_next::AsDecoderExt::into_decoded(message) {
7685                    Ok(decoded) => {
7686                        handler
7687                            .unregister_for_tx(
7688                                ::fidl_next::Request::from_decoded(decoded),
7689                                responder,
7690                            )
7691                            .await;
7692                        Ok(())
7693                    }
7694                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7695                        ordinal: 4500979904297707414,
7696                        error,
7697                    }),
7698                }
7699            }
7700
7701            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7702        }
7703    }
7704}
7705
7706/// A client handler for the Session protocol.
7707///
7708/// See [`Session`] for more details.
7709pub trait SessionClientHandler<
7710    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7711    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7712>
7713{
7714}
7715
7716impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Session
7717where
7718    ___H: SessionClientHandler<___T> + ::core::marker::Send,
7719    ___T: ::fidl_next::Transport,
7720{
7721    async fn on_event(
7722        handler: &mut ___H,
7723        mut message: ::fidl_next::Message<___T>,
7724    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7725        match *message.header().ordinal {
7726            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7727        }
7728    }
7729}
7730
7731/// A server handler for the Session protocol.
7732///
7733/// See [`Session`] for more details.
7734pub trait SessionServerHandler<
7735    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7736    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7737>
7738{
7739    #[doc = " Attaches the session to `port`.\n\n Once attached, the session starts to receive the subscribed frames over\n the data FIFOs and it may send frames destined to the specified `port`.\n\n + request `port` port to subscribe to.\n + request `rx_frames` Frame types of interest on the port.\n * error `ZX_ERR_NOT_FOUND` if `port` is not valid.\n * error `ZX_ERR_INVALID_ARGS` if `rx_frames` is not a subset of the\n port\'s supported frames.\n * error `ZX_ERR_ALREADY_BOUND` if `port` is already attached.\n"]
7740    fn attach(
7741        &mut self,
7742
7743        request: ::fidl_next::Request<session::Attach, ___T>,
7744
7745        responder: ::fidl_next::Responder<session::Attach, ___T>,
7746    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7747
7748    #[doc = " Detaches the session from `port`.\n\n Once detached, the session stops receiving frames from `port`. Frames\n sent to a detached port may be returned with an error. It is not\n necessary to call `Detach` on ports that are removed from the device,\n doing so causes `ZX_ERR_NOT_FOUND` to be returned.\n\n + request `port` port to subscribe to.\n * error `ZX_ERR_NOT_FOUND` if the session is not currently attached to\n the port.\n"]
7749    fn detach(
7750        &mut self,
7751
7752        request: ::fidl_next::Request<session::Detach, ___T>,
7753
7754        responder: ::fidl_next::Responder<session::Detach, ___T>,
7755    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7756
7757    #[doc = " Cleanly closes a session.\n\n This will cause the session to send a `ZX_ERR_CANCELLED` epitaph and\n proceed to close the Session channel. Clients may only assume that they\n own all the buffers that are currently owned by the session (sent over\n either the rx or tx FIFOs) once the epitaph is received. Closing the rx\n or tx FIFO is equivalent to calling `Close`.\n"]
7758    fn close(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7759
7760    #[doc = " Watchers for delegated receive wakeup leases.\n\n Calls block until a lease is delegated by the device. If a call to\n `WatchDelegatedRxLease` is made while a previous call is blocking, the\n session is closed with `ZX_ERR_BAD_STATE`. Will never yield any values\n for sessions created without [`SessionFlags.RECEIVE_RX_POWER_LEASES`].\n\n Given a single lease is assumed sufficient to keep the system awake, the\n server only keeps a single lease in its buffer. If a new delegated lease\n becomes available and the client hasn\'t popped the previous one with a\n call to `WatchDelegatedRxLease`, the server drops the previously pending\n lease.\n\n See [`DelegatedRxLease`] for how to handle delegated leases.\n"]
7761    fn watch_delegated_rx_lease(
7762        &mut self,
7763
7764        responder: ::fidl_next::Responder<session::WatchDelegatedRxLease, ___T>,
7765    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7766
7767    #[doc = " Asks the network device to register the VMO for Tx.\n\n The network device prepares the VMOs in order and stops at the first\n error if any. It returns how many VMOs have been prepared alongside with\n the first error encountered. Note that network-device itself does not\n try to release earlier VMOs for a later error. It is up to the client\n how to recover from an error.\n\n * error `ZX_ERR_NOT_FOUND` if any of the VmoId is unknown.\n * error other zx status that can be reported by the driver.\n"]
7768    fn register_for_tx(
7769        &mut self,
7770
7771        request: ::fidl_next::Request<session::RegisterForTx, ___T>,
7772
7773        responder: ::fidl_next::Responder<session::RegisterForTx, ___T>,
7774    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7775
7776    #[doc = " Tells the device that the client will no longer use the VMO for Tx,\n if the VMO is also unused for Rx, the device is free to release it\n at the implementation driver.\n\n The network device processes the VMOs in order and stops at the first\n error if any. It returns how many VMOs have been marked as unused for Tx\n alongside with the first error encountered. Note that network-device\n itself does not try to re-register earlier VMOs for a later error. It is\n up to the client how to recover from an error.\n\n * error `ZX_ERR_NOT_FOUND` if any of the VmoId is unknown.\n * error other zx status that can be reported by the driver.\n"]
7777    fn unregister_for_tx(
7778        &mut self,
7779
7780        request: ::fidl_next::Request<session::UnregisterForTx, ___T>,
7781
7782        responder: ::fidl_next::Responder<session::UnregisterForTx, ___T>,
7783    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7784}
7785
7786impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Session
7787where
7788    ___H: SessionServerHandler<___T> + ::core::marker::Send,
7789    ___T: ::fidl_next::Transport,
7790    for<'de> crate::wire::SessionAttachRequest<'de>: ::fidl_next::Decode<
7791            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7792            Constraint = (),
7793        >,
7794    for<'de> crate::wire::SessionDetachRequest: ::fidl_next::Decode<
7795            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7796            Constraint = (),
7797        >,
7798    for<'de> crate::wire::SessionRegisterForTxRequest<'de>: ::fidl_next::Decode<
7799            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7800            Constraint = (),
7801        >,
7802    for<'de> crate::wire::SessionUnregisterForTxRequest<'de>: ::fidl_next::Decode<
7803            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7804            Constraint = (),
7805        >,
7806{
7807    async fn on_one_way(
7808        handler: &mut ___H,
7809        mut message: ::fidl_next::Message<___T>,
7810    ) -> ::core::result::Result<
7811        (),
7812        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7813    > {
7814        match *message.header().ordinal {
7815            4124541276668990198 => {
7816                handler.close().await;
7817                Ok(())
7818            }
7819
7820            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7821        }
7822    }
7823
7824    async fn on_two_way(
7825        handler: &mut ___H,
7826        mut message: ::fidl_next::Message<___T>,
7827        responder: ::fidl_next::protocol::Responder<___T>,
7828    ) -> ::core::result::Result<
7829        (),
7830        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7831    > {
7832        match *message.header().ordinal {
7833            2200510900121637753 => {
7834                let responder = ::fidl_next::Responder::from_untyped(responder);
7835
7836                match ::fidl_next::AsDecoderExt::into_decoded(message) {
7837                    Ok(decoded) => {
7838                        handler
7839                            .attach(::fidl_next::Request::from_decoded(decoded), responder)
7840                            .await;
7841                        Ok(())
7842                    }
7843                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7844                        ordinal: 2200510900121637753,
7845                        error,
7846                    }),
7847                }
7848            }
7849
7850            7549173138887841895 => {
7851                let responder = ::fidl_next::Responder::from_untyped(responder);
7852
7853                match ::fidl_next::AsDecoderExt::into_decoded(message) {
7854                    Ok(decoded) => {
7855                        handler
7856                            .detach(::fidl_next::Request::from_decoded(decoded), responder)
7857                            .await;
7858                        Ok(())
7859                    }
7860                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7861                        ordinal: 7549173138887841895,
7862                        error,
7863                    }),
7864                }
7865            }
7866
7867            8524612876345279413 => {
7868                let responder = ::fidl_next::Responder::from_untyped(responder);
7869
7870                handler.watch_delegated_rx_lease(responder).await;
7871                Ok(())
7872            }
7873
7874            3905209776239937562 => {
7875                let responder = ::fidl_next::Responder::from_untyped(responder);
7876
7877                match ::fidl_next::AsDecoderExt::into_decoded(message) {
7878                    Ok(decoded) => {
7879                        handler
7880                            .register_for_tx(::fidl_next::Request::from_decoded(decoded), responder)
7881                            .await;
7882                        Ok(())
7883                    }
7884                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7885                        ordinal: 3905209776239937562,
7886                        error,
7887                    }),
7888                }
7889            }
7890
7891            4500979904297707414 => {
7892                let responder = ::fidl_next::Responder::from_untyped(responder);
7893
7894                match ::fidl_next::AsDecoderExt::into_decoded(message) {
7895                    Ok(decoded) => {
7896                        handler
7897                            .unregister_for_tx(
7898                                ::fidl_next::Request::from_decoded(decoded),
7899                                responder,
7900                            )
7901                            .await;
7902                        Ok(())
7903                    }
7904                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7905                        ordinal: 4500979904297707414,
7906                        error,
7907                    }),
7908                }
7909            }
7910
7911            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7912        }
7913    }
7914}
7915
7916impl<___T> SessionClientHandler<___T> for ::fidl_next::IgnoreEvents where
7917    ___T: ::fidl_next::Transport
7918{
7919}
7920
7921impl<___H, ___T> SessionLocalClientHandler<___T> for ::fidl_next::Local<___H>
7922where
7923    ___H: SessionClientHandler<___T>,
7924    ___T: ::fidl_next::Transport,
7925{
7926}
7927
7928impl<___H, ___T> SessionLocalServerHandler<___T> for ::fidl_next::Local<___H>
7929where
7930    ___H: SessionServerHandler<___T>,
7931    ___T: ::fidl_next::Transport,
7932{
7933    async fn attach(
7934        &mut self,
7935
7936        request: ::fidl_next::Request<session::Attach, ___T>,
7937
7938        responder: ::fidl_next::Responder<session::Attach, ___T>,
7939    ) {
7940        ___H::attach(&mut self.0, request, responder).await
7941    }
7942
7943    async fn detach(
7944        &mut self,
7945
7946        request: ::fidl_next::Request<session::Detach, ___T>,
7947
7948        responder: ::fidl_next::Responder<session::Detach, ___T>,
7949    ) {
7950        ___H::detach(&mut self.0, request, responder).await
7951    }
7952
7953    async fn close(&mut self) {
7954        ___H::close(&mut self.0).await
7955    }
7956
7957    async fn watch_delegated_rx_lease(
7958        &mut self,
7959
7960        responder: ::fidl_next::Responder<session::WatchDelegatedRxLease, ___T>,
7961    ) {
7962        ___H::watch_delegated_rx_lease(&mut self.0, responder).await
7963    }
7964
7965    async fn register_for_tx(
7966        &mut self,
7967
7968        request: ::fidl_next::Request<session::RegisterForTx, ___T>,
7969
7970        responder: ::fidl_next::Responder<session::RegisterForTx, ___T>,
7971    ) {
7972        ___H::register_for_tx(&mut self.0, request, responder).await
7973    }
7974
7975    async fn unregister_for_tx(
7976        &mut self,
7977
7978        request: ::fidl_next::Request<session::UnregisterForTx, ___T>,
7979
7980        responder: ::fidl_next::Responder<session::UnregisterForTx, ___T>,
7981    ) {
7982        ___H::unregister_for_tx(&mut self.0, request, responder).await
7983    }
7984}
7985
7986pub use fidl_next_common_fuchsia_hardware_network::*;