Skip to main content

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