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    /// The generic type corresponding to [`DeviceSetNodesBandwidthResponse`].
3823    pub struct DeviceSetNodesBandwidthResponse<T0> {
3824        pub aggregated_bandwidth: T0,
3825    }
3826
3827    unsafe impl<___E, T0>
3828        ::fidl_next::Encode<crate::wire::DeviceSetNodesBandwidthResponse<'static>, ___E>
3829        for DeviceSetNodesBandwidthResponse<T0>
3830    where
3831        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3832        ___E: ::fidl_next::Encoder,
3833        T0: ::fidl_next::Encode<
3834                ::fidl_next::wire::Vector<'static, crate::wire::AggregatedBandwidth<'static>>,
3835                ___E,
3836            >,
3837    {
3838        #[inline]
3839        fn encode(
3840            self,
3841            encoder_: &mut ___E,
3842            out_: &mut ::core::mem::MaybeUninit<
3843                crate::wire::DeviceSetNodesBandwidthResponse<'static>,
3844            >,
3845            _: (),
3846        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3847            ::fidl_next::munge! {
3848                let crate::wire::DeviceSetNodesBandwidthResponse {
3849                    aggregated_bandwidth,
3850
3851                } = out_;
3852            }
3853
3854            ::fidl_next::Encode::encode(
3855                self.aggregated_bandwidth,
3856                encoder_,
3857                aggregated_bandwidth,
3858                (4294967295, ()),
3859            )?;
3860
3861            Ok(())
3862        }
3863    }
3864
3865    /// The generic type corresponding to [`DeviceGetNodeGraphResponse`].
3866    pub struct DeviceGetNodeGraphResponse<T0, T1> {
3867        pub nodes: T0,
3868
3869        pub edges: T1,
3870    }
3871
3872    unsafe impl<___E, T0, T1>
3873        ::fidl_next::Encode<crate::wire::DeviceGetNodeGraphResponse<'static>, ___E>
3874        for DeviceGetNodeGraphResponse<T0, T1>
3875    where
3876        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3877        ___E: ::fidl_next::Encoder,
3878        T0: ::fidl_next::Encode<
3879                ::fidl_next::wire::Vector<'static, crate::wire::Node<'static>>,
3880                ___E,
3881            >,
3882        T1: ::fidl_next::Encode<
3883                ::fidl_next::wire::Vector<'static, crate::wire::Edge<'static>>,
3884                ___E,
3885            >,
3886    {
3887        #[inline]
3888        fn encode(
3889            self,
3890            encoder_: &mut ___E,
3891            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetNodeGraphResponse<'static>>,
3892            _: (),
3893        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3894            ::fidl_next::munge! {
3895                let crate::wire::DeviceGetNodeGraphResponse {
3896                    nodes,
3897                    edges,
3898
3899                } = out_;
3900            }
3901
3902            ::fidl_next::Encode::encode(self.nodes, encoder_, nodes, (4294967295, ()))?;
3903
3904            ::fidl_next::Encode::encode(self.edges, encoder_, edges, (4294967295, ()))?;
3905
3906            Ok(())
3907        }
3908    }
3909
3910    /// The generic type corresponding to [`DeviceGetPathEndpointsResponse`].
3911    pub struct DeviceGetPathEndpointsResponse<T0> {
3912        pub paths: T0,
3913    }
3914
3915    unsafe impl<___E, T0>
3916        ::fidl_next::Encode<crate::wire::DeviceGetPathEndpointsResponse<'static>, ___E>
3917        for DeviceGetPathEndpointsResponse<T0>
3918    where
3919        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3920        ___E: ::fidl_next::Encoder,
3921        T0: ::fidl_next::Encode<
3922                ::fidl_next::wire::Vector<'static, crate::wire::PathEndpoints<'static>>,
3923                ___E,
3924            >,
3925    {
3926        #[inline]
3927        fn encode(
3928            self,
3929            encoder_: &mut ___E,
3930            out_: &mut ::core::mem::MaybeUninit<
3931                crate::wire::DeviceGetPathEndpointsResponse<'static>,
3932            >,
3933            _: (),
3934        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3935            ::fidl_next::munge! {
3936                let crate::wire::DeviceGetPathEndpointsResponse {
3937                    paths,
3938
3939                } = out_;
3940            }
3941
3942            ::fidl_next::Encode::encode(self.paths, encoder_, paths, (4294967295, ()))?;
3943
3944            Ok(())
3945        }
3946    }
3947
3948    /// The generic type corresponding to [`PathSetBandwidthResponse`].
3949    pub type PathSetBandwidthResponse = ();
3950}
3951
3952pub use self::natural::*;
3953
3954#[doc = " The largest allowed number of edges from one node to another.\n"]
3955pub const EDGES_MAX: u32 = 64 as u32;
3956
3957#[doc = " The longest allowed length for an interconnect or node name.\n"]
3958pub const NAME_MAX_LENGTH: u32 = 64 as u32;
3959
3960/// The type corresponding to the Device protocol.
3961#[derive(PartialEq, Debug)]
3962pub struct Device;
3963
3964impl ::fidl_next::Discoverable for Device {
3965    const PROTOCOL_NAME: &'static str = "fuchsia.hardware.interconnect.Device";
3966}
3967
3968#[cfg(target_os = "fuchsia")]
3969impl ::fidl_next::HasTransport for Device {
3970    type Transport = ::fidl_next::fuchsia::zx::Channel;
3971}
3972
3973pub mod device {
3974    pub mod prelude {
3975        pub use crate::{
3976            Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
3977            DeviceServerHandler, device,
3978        };
3979
3980        pub use crate::natural::DeviceSetNodesBandwidthRequest;
3981
3982        pub use crate::natural::DeviceGetNodeGraphResponse;
3983
3984        pub use crate::natural::DeviceGetPathEndpointsResponse;
3985
3986        pub use crate::natural::DeviceSetNodesBandwidthResponse;
3987    }
3988
3989    pub struct SetNodesBandwidth;
3990
3991    impl ::fidl_next::Method for SetNodesBandwidth {
3992        const ORDINAL: u64 = 4303628535058422804;
3993        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3994            ::fidl_next::protocol::Flexibility::Flexible;
3995
3996        type Protocol = crate::Device;
3997
3998        type Request = crate::wire::DeviceSetNodesBandwidthRequest<'static>;
3999    }
4000
4001    impl ::fidl_next::TwoWayMethod for SetNodesBandwidth {
4002        type Response = ::fidl_next::wire::Result<
4003            'static,
4004            crate::wire::DeviceSetNodesBandwidthResponse<'static>,
4005            ::fidl_next::wire::fuchsia::Status,
4006        >;
4007    }
4008
4009    impl<___R> ::fidl_next::Respond<___R> for SetNodesBandwidth {
4010        type Output = ::core::result::Result<
4011            crate::generic::DeviceSetNodesBandwidthResponse<___R>,
4012            ::fidl_next::never::Never,
4013        >;
4014
4015        fn respond(response: ___R) -> Self::Output {
4016            ::core::result::Result::Ok(crate::generic::DeviceSetNodesBandwidthResponse {
4017                aggregated_bandwidth: response,
4018            })
4019        }
4020    }
4021
4022    impl<___R> ::fidl_next::RespondErr<___R> for SetNodesBandwidth {
4023        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
4024
4025        fn respond_err(response: ___R) -> Self::Output {
4026            ::core::result::Result::Err(response)
4027        }
4028    }
4029
4030    pub struct GetNodeGraph;
4031
4032    impl ::fidl_next::Method for GetNodeGraph {
4033        const ORDINAL: u64 = 3415818272339886854;
4034        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4035            ::fidl_next::protocol::Flexibility::Flexible;
4036
4037        type Protocol = crate::Device;
4038
4039        type Request = ::fidl_next::wire::EmptyMessageBody;
4040    }
4041
4042    impl ::fidl_next::TwoWayMethod for GetNodeGraph {
4043        type Response =
4044            ::fidl_next::wire::Flexible<'static, crate::wire::DeviceGetNodeGraphResponse<'static>>;
4045    }
4046
4047    impl<___R> ::fidl_next::Respond<___R> for GetNodeGraph {
4048        type Output = ::fidl_next::Flexible<___R>;
4049
4050        fn respond(response: ___R) -> Self::Output {
4051            ::fidl_next::Flexible(response)
4052        }
4053    }
4054
4055    pub struct GetPathEndpoints;
4056
4057    impl ::fidl_next::Method for GetPathEndpoints {
4058        const ORDINAL: u64 = 7307906244320589403;
4059        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4060            ::fidl_next::protocol::Flexibility::Flexible;
4061
4062        type Protocol = crate::Device;
4063
4064        type Request = ::fidl_next::wire::EmptyMessageBody;
4065    }
4066
4067    impl ::fidl_next::TwoWayMethod for GetPathEndpoints {
4068        type Response = ::fidl_next::wire::Flexible<
4069            'static,
4070            crate::wire::DeviceGetPathEndpointsResponse<'static>,
4071        >;
4072    }
4073
4074    impl<___R> ::fidl_next::Respond<___R> for GetPathEndpoints {
4075        type Output = ::fidl_next::Flexible<crate::generic::DeviceGetPathEndpointsResponse<___R>>;
4076
4077        fn respond(response: ___R) -> Self::Output {
4078            ::fidl_next::Flexible(crate::generic::DeviceGetPathEndpointsResponse {
4079                paths: response,
4080            })
4081        }
4082    }
4083
4084    mod ___detail {
4085        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
4086        where
4087            ___T: ::fidl_next::Transport,
4088        {
4089            type Client = DeviceClient<___T>;
4090            type Server = DeviceServer<___T>;
4091        }
4092
4093        /// The client for the `Device` protocol.
4094        #[repr(transparent)]
4095        pub struct DeviceClient<___T: ::fidl_next::Transport> {
4096            #[allow(dead_code)]
4097            client: ::fidl_next::protocol::Client<___T>,
4098        }
4099
4100        impl<___T> DeviceClient<___T>
4101        where
4102            ___T: ::fidl_next::Transport,
4103        {
4104            pub fn set_nodes_bandwidth(
4105                &self,
4106
4107                nodes: impl ::fidl_next::Encode<
4108                    ::fidl_next::wire::Vector<'static, crate::wire::NodeBandwidth<'static>>,
4109                    <___T as ::fidl_next::Transport>::SendBuffer,
4110                >,
4111            ) -> ::fidl_next::TwoWayFuture<'_, super::SetNodesBandwidth, ___T>
4112            where
4113                <___T as ::fidl_next::Transport>::SendBuffer:
4114                    ::fidl_next::encoder::InternalHandleEncoder,
4115                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4116            {
4117                self.set_nodes_bandwidth_with(crate::generic::DeviceSetNodesBandwidthRequest {
4118                    nodes,
4119                })
4120            }
4121
4122            pub fn set_nodes_bandwidth_with<___R>(
4123                &self,
4124                request: ___R,
4125            ) -> ::fidl_next::TwoWayFuture<'_, super::SetNodesBandwidth, ___T>
4126            where
4127                ___R: ::fidl_next::Encode<
4128                        crate::wire::DeviceSetNodesBandwidthRequest<'static>,
4129                        <___T as ::fidl_next::Transport>::SendBuffer,
4130                    >,
4131            {
4132                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4133                    4303628535058422804,
4134                    <super::SetNodesBandwidth as ::fidl_next::Method>::FLEXIBILITY,
4135                    request,
4136                ))
4137            }
4138
4139            #[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"]
4140            pub fn get_node_graph(
4141                &self,
4142            ) -> ::fidl_next::TwoWayFuture<'_, super::GetNodeGraph, ___T> {
4143                ::fidl_next::TwoWayFuture::from_untyped(
4144                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4145                        3415818272339886854,
4146                        <super::GetNodeGraph as ::fidl_next::Method>::FLEXIBILITY,
4147                        (),
4148                    ),
4149                )
4150            }
4151
4152            #[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"]
4153            pub fn get_path_endpoints(
4154                &self,
4155            ) -> ::fidl_next::TwoWayFuture<'_, super::GetPathEndpoints, ___T> {
4156                ::fidl_next::TwoWayFuture::from_untyped(
4157                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4158                        7307906244320589403,
4159                        <super::GetPathEndpoints as ::fidl_next::Method>::FLEXIBILITY,
4160                        (),
4161                    ),
4162                )
4163            }
4164        }
4165
4166        /// The server for the `Device` protocol.
4167        #[repr(transparent)]
4168        pub struct DeviceServer<___T: ::fidl_next::Transport> {
4169            server: ::fidl_next::protocol::Server<___T>,
4170        }
4171
4172        impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
4173    }
4174}
4175
4176#[diagnostic::on_unimplemented(
4177    note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4178)]
4179
4180/// A client handler for the Device protocol.
4181///
4182/// See [`Device`] for more details.
4183pub trait DeviceLocalClientHandler<
4184    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4185    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4186>
4187{
4188    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4189        ::core::future::ready(())
4190    }
4191}
4192
4193impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
4194where
4195    ___H: DeviceLocalClientHandler<___T>,
4196    ___T: ::fidl_next::Transport,
4197{
4198    async fn on_event(
4199        handler: &mut ___H,
4200        mut message: ::fidl_next::Message<___T>,
4201    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4202        match *message.header().ordinal {
4203            ordinal => {
4204                handler.on_unknown_interaction(ordinal).await;
4205                if ::core::matches!(
4206                    message.header().flexibility(),
4207                    ::fidl_next::protocol::Flexibility::Strict
4208                ) {
4209                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4210                } else {
4211                    Ok(())
4212                }
4213            }
4214        }
4215    }
4216}
4217
4218#[diagnostic::on_unimplemented(
4219    note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4220)]
4221
4222/// A server handler for the Device protocol.
4223///
4224/// See [`Device`] for more details.
4225pub trait DeviceLocalServerHandler<
4226    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4227    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4228>
4229{
4230    fn set_nodes_bandwidth(
4231        &mut self,
4232
4233        request: ::fidl_next::Request<device::SetNodesBandwidth, ___T>,
4234
4235        responder: ::fidl_next::Responder<device::SetNodesBandwidth, ___T>,
4236    ) -> impl ::core::future::Future<Output = ()>;
4237
4238    #[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"]
4239    fn get_node_graph(
4240        &mut self,
4241
4242        responder: ::fidl_next::Responder<device::GetNodeGraph, ___T>,
4243    ) -> impl ::core::future::Future<Output = ()>;
4244
4245    #[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"]
4246    fn get_path_endpoints(
4247        &mut self,
4248
4249        responder: ::fidl_next::Responder<device::GetPathEndpoints, ___T>,
4250    ) -> impl ::core::future::Future<Output = ()>;
4251
4252    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4253        ::core::future::ready(())
4254    }
4255}
4256
4257impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
4258where
4259    ___H: DeviceLocalServerHandler<___T>,
4260    ___T: ::fidl_next::Transport,
4261    for<'de> crate::wire::DeviceSetNodesBandwidthRequest<'de>: ::fidl_next::Decode<
4262            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4263            Constraint = (),
4264        >,
4265{
4266    async fn on_one_way(
4267        handler: &mut ___H,
4268        mut message: ::fidl_next::Message<___T>,
4269    ) -> ::core::result::Result<
4270        (),
4271        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4272    > {
4273        match *message.header().ordinal {
4274            ordinal => {
4275                handler.on_unknown_interaction(ordinal).await;
4276                if ::core::matches!(
4277                    message.header().flexibility(),
4278                    ::fidl_next::protocol::Flexibility::Strict
4279                ) {
4280                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4281                } else {
4282                    Ok(())
4283                }
4284            }
4285        }
4286    }
4287
4288    async fn on_two_way(
4289        handler: &mut ___H,
4290        mut message: ::fidl_next::Message<___T>,
4291        responder: ::fidl_next::protocol::Responder<___T>,
4292    ) -> ::core::result::Result<
4293        (),
4294        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4295    > {
4296        match *message.header().ordinal {
4297            4303628535058422804 => {
4298                let responder = ::fidl_next::Responder::from_untyped(responder);
4299
4300                match ::fidl_next::AsDecoderExt::into_decoded(message) {
4301                    Ok(decoded) => {
4302                        handler
4303                            .set_nodes_bandwidth(
4304                                ::fidl_next::Request::from_decoded(decoded),
4305                                responder,
4306                            )
4307                            .await;
4308                        Ok(())
4309                    }
4310                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4311                        ordinal: 4303628535058422804,
4312                        error,
4313                    }),
4314                }
4315            }
4316
4317            3415818272339886854 => {
4318                let responder = ::fidl_next::Responder::from_untyped(responder);
4319
4320                handler.get_node_graph(responder).await;
4321                Ok(())
4322            }
4323
4324            7307906244320589403 => {
4325                let responder = ::fidl_next::Responder::from_untyped(responder);
4326
4327                handler.get_path_endpoints(responder).await;
4328                Ok(())
4329            }
4330
4331            ordinal => {
4332                handler.on_unknown_interaction(ordinal).await;
4333                if ::core::matches!(
4334                    message.header().flexibility(),
4335                    ::fidl_next::protocol::Flexibility::Strict
4336                ) {
4337                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4338                } else {
4339                    responder
4340                        .respond_framework_error(
4341                            ordinal,
4342                            ::fidl_next::FrameworkError::UnknownMethod,
4343                        )
4344                        .expect("encoding a framework error should never fail")
4345                        .await?;
4346                    Ok(())
4347                }
4348            }
4349        }
4350    }
4351}
4352
4353/// A client handler for the Device protocol.
4354///
4355/// See [`Device`] for more details.
4356pub trait DeviceClientHandler<
4357    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4358    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4359>
4360{
4361    fn on_unknown_interaction(
4362        &mut self,
4363        ordinal: u64,
4364    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4365        ::core::future::ready(())
4366    }
4367}
4368
4369impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
4370where
4371    ___H: DeviceClientHandler<___T> + ::core::marker::Send,
4372    ___T: ::fidl_next::Transport,
4373{
4374    async fn on_event(
4375        handler: &mut ___H,
4376        mut message: ::fidl_next::Message<___T>,
4377    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4378        match *message.header().ordinal {
4379            ordinal => {
4380                handler.on_unknown_interaction(ordinal).await;
4381                if ::core::matches!(
4382                    message.header().flexibility(),
4383                    ::fidl_next::protocol::Flexibility::Strict
4384                ) {
4385                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4386                } else {
4387                    Ok(())
4388                }
4389            }
4390        }
4391    }
4392}
4393
4394/// A server handler for the Device protocol.
4395///
4396/// See [`Device`] for more details.
4397pub trait DeviceServerHandler<
4398    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4399    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4400>
4401{
4402    fn set_nodes_bandwidth(
4403        &mut self,
4404
4405        request: ::fidl_next::Request<device::SetNodesBandwidth, ___T>,
4406
4407        responder: ::fidl_next::Responder<device::SetNodesBandwidth, ___T>,
4408    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4409
4410    #[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"]
4411    fn get_node_graph(
4412        &mut self,
4413
4414        responder: ::fidl_next::Responder<device::GetNodeGraph, ___T>,
4415    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4416
4417    #[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"]
4418    fn get_path_endpoints(
4419        &mut self,
4420
4421        responder: ::fidl_next::Responder<device::GetPathEndpoints, ___T>,
4422    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4423
4424    fn on_unknown_interaction(
4425        &mut self,
4426        ordinal: u64,
4427    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4428        ::core::future::ready(())
4429    }
4430}
4431
4432impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
4433where
4434    ___H: DeviceServerHandler<___T> + ::core::marker::Send,
4435    ___T: ::fidl_next::Transport,
4436    for<'de> crate::wire::DeviceSetNodesBandwidthRequest<'de>: ::fidl_next::Decode<
4437            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4438            Constraint = (),
4439        >,
4440{
4441    async fn on_one_way(
4442        handler: &mut ___H,
4443        mut message: ::fidl_next::Message<___T>,
4444    ) -> ::core::result::Result<
4445        (),
4446        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4447    > {
4448        match *message.header().ordinal {
4449            ordinal => {
4450                handler.on_unknown_interaction(ordinal).await;
4451                if ::core::matches!(
4452                    message.header().flexibility(),
4453                    ::fidl_next::protocol::Flexibility::Strict
4454                ) {
4455                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4456                } else {
4457                    Ok(())
4458                }
4459            }
4460        }
4461    }
4462
4463    async fn on_two_way(
4464        handler: &mut ___H,
4465        mut message: ::fidl_next::Message<___T>,
4466        responder: ::fidl_next::protocol::Responder<___T>,
4467    ) -> ::core::result::Result<
4468        (),
4469        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4470    > {
4471        match *message.header().ordinal {
4472            4303628535058422804 => {
4473                let responder = ::fidl_next::Responder::from_untyped(responder);
4474
4475                match ::fidl_next::AsDecoderExt::into_decoded(message) {
4476                    Ok(decoded) => {
4477                        handler
4478                            .set_nodes_bandwidth(
4479                                ::fidl_next::Request::from_decoded(decoded),
4480                                responder,
4481                            )
4482                            .await;
4483                        Ok(())
4484                    }
4485                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4486                        ordinal: 4303628535058422804,
4487                        error,
4488                    }),
4489                }
4490            }
4491
4492            3415818272339886854 => {
4493                let responder = ::fidl_next::Responder::from_untyped(responder);
4494
4495                handler.get_node_graph(responder).await;
4496                Ok(())
4497            }
4498
4499            7307906244320589403 => {
4500                let responder = ::fidl_next::Responder::from_untyped(responder);
4501
4502                handler.get_path_endpoints(responder).await;
4503                Ok(())
4504            }
4505
4506            ordinal => {
4507                handler.on_unknown_interaction(ordinal).await;
4508                if ::core::matches!(
4509                    message.header().flexibility(),
4510                    ::fidl_next::protocol::Flexibility::Strict
4511                ) {
4512                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4513                } else {
4514                    responder
4515                        .respond_framework_error(
4516                            ordinal,
4517                            ::fidl_next::FrameworkError::UnknownMethod,
4518                        )
4519                        .expect("encoding a framework error should never fail")
4520                        .await?;
4521                    Ok(())
4522                }
4523            }
4524        }
4525    }
4526}
4527
4528impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents
4529where
4530    ___T: ::fidl_next::Transport,
4531{
4532    async fn on_unknown_interaction(&mut self, _: u64) {}
4533}
4534
4535impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
4536where
4537    ___H: DeviceClientHandler<___T>,
4538    ___T: ::fidl_next::Transport,
4539{
4540    async fn on_unknown_interaction(&mut self, ordinal: u64) {
4541        ___H::on_unknown_interaction(&mut self.0, ordinal).await
4542    }
4543}
4544
4545impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
4546where
4547    ___H: DeviceServerHandler<___T>,
4548    ___T: ::fidl_next::Transport,
4549{
4550    async fn set_nodes_bandwidth(
4551        &mut self,
4552
4553        request: ::fidl_next::Request<device::SetNodesBandwidth, ___T>,
4554
4555        responder: ::fidl_next::Responder<device::SetNodesBandwidth, ___T>,
4556    ) {
4557        ___H::set_nodes_bandwidth(&mut self.0, request, responder).await
4558    }
4559
4560    async fn get_node_graph(
4561        &mut self,
4562
4563        responder: ::fidl_next::Responder<device::GetNodeGraph, ___T>,
4564    ) {
4565        ___H::get_node_graph(&mut self.0, responder).await
4566    }
4567
4568    async fn get_path_endpoints(
4569        &mut self,
4570
4571        responder: ::fidl_next::Responder<device::GetPathEndpoints, ___T>,
4572    ) {
4573        ___H::get_path_endpoints(&mut self.0, responder).await
4574    }
4575
4576    async fn on_unknown_interaction(&mut self, ordinal: u64) {
4577        ___H::on_unknown_interaction(&mut self.0, ordinal).await
4578    }
4579}
4580
4581/// The type corresponding to the Path protocol.
4582#[doc = " Represents a path from a node in one interconnect to another.\n"]
4583#[derive(PartialEq, Debug)]
4584pub struct Path;
4585
4586impl ::fidl_next::Discoverable for Path {
4587    const PROTOCOL_NAME: &'static str = "fuchsia.hardware.interconnect.Path";
4588}
4589
4590#[cfg(target_os = "fuchsia")]
4591impl ::fidl_next::HasTransport for Path {
4592    type Transport = ::fidl_next::fuchsia::zx::Channel;
4593}
4594
4595pub mod path {
4596    pub mod prelude {
4597        pub use crate::{
4598            Path, PathClientHandler, PathLocalClientHandler, PathLocalServerHandler,
4599            PathServerHandler, path,
4600        };
4601
4602        pub use crate::natural::BandwidthRequest;
4603
4604        pub use crate::natural::PathSetBandwidthResponse;
4605    }
4606
4607    pub struct SetBandwidth;
4608
4609    impl ::fidl_next::Method for SetBandwidth {
4610        const ORDINAL: u64 = 952067593201949981;
4611        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4612            ::fidl_next::protocol::Flexibility::Flexible;
4613
4614        type Protocol = crate::Path;
4615
4616        type Request = crate::wire::BandwidthRequest<'static>;
4617    }
4618
4619    impl ::fidl_next::TwoWayMethod for SetBandwidth {
4620        type Response = ::fidl_next::wire::Result<
4621            'static,
4622            crate::wire::PathSetBandwidthResponse,
4623            ::fidl_next::wire::fuchsia::Status,
4624        >;
4625    }
4626
4627    impl<___R> ::fidl_next::Respond<___R> for SetBandwidth {
4628        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
4629
4630        fn respond(response: ___R) -> Self::Output {
4631            ::core::result::Result::Ok(response)
4632        }
4633    }
4634
4635    impl<___R> ::fidl_next::RespondErr<___R> for SetBandwidth {
4636        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
4637
4638        fn respond_err(response: ___R) -> Self::Output {
4639            ::core::result::Result::Err(response)
4640        }
4641    }
4642
4643    mod ___detail {
4644        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Path
4645        where
4646            ___T: ::fidl_next::Transport,
4647        {
4648            type Client = PathClient<___T>;
4649            type Server = PathServer<___T>;
4650        }
4651
4652        /// The client for the `Path` protocol.
4653        #[repr(transparent)]
4654        pub struct PathClient<___T: ::fidl_next::Transport> {
4655            #[allow(dead_code)]
4656            client: ::fidl_next::protocol::Client<___T>,
4657        }
4658
4659        impl<___T> PathClient<___T>
4660        where
4661            ___T: ::fidl_next::Transport,
4662        {
4663            #[doc = " Sets the bandwidth interconnect path.\n"]
4664            pub fn set_bandwidth_with<___R>(
4665                &self,
4666                request: ___R,
4667            ) -> ::fidl_next::TwoWayFuture<'_, super::SetBandwidth, ___T>
4668            where
4669                ___R: ::fidl_next::Encode<
4670                        crate::wire::BandwidthRequest<'static>,
4671                        <___T as ::fidl_next::Transport>::SendBuffer,
4672                    >,
4673            {
4674                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4675                    952067593201949981,
4676                    <super::SetBandwidth as ::fidl_next::Method>::FLEXIBILITY,
4677                    request,
4678                ))
4679            }
4680        }
4681
4682        /// The server for the `Path` protocol.
4683        #[repr(transparent)]
4684        pub struct PathServer<___T: ::fidl_next::Transport> {
4685            server: ::fidl_next::protocol::Server<___T>,
4686        }
4687
4688        impl<___T> PathServer<___T> where ___T: ::fidl_next::Transport {}
4689    }
4690}
4691
4692#[diagnostic::on_unimplemented(
4693    note = "If {Self} implements the non-local PathClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4694)]
4695
4696/// A client handler for the Path protocol.
4697///
4698/// See [`Path`] for more details.
4699pub trait PathLocalClientHandler<
4700    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4701    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4702>
4703{
4704    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4705        ::core::future::ready(())
4706    }
4707}
4708
4709impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Path
4710where
4711    ___H: PathLocalClientHandler<___T>,
4712    ___T: ::fidl_next::Transport,
4713{
4714    async fn on_event(
4715        handler: &mut ___H,
4716        mut message: ::fidl_next::Message<___T>,
4717    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4718        match *message.header().ordinal {
4719            ordinal => {
4720                handler.on_unknown_interaction(ordinal).await;
4721                if ::core::matches!(
4722                    message.header().flexibility(),
4723                    ::fidl_next::protocol::Flexibility::Strict
4724                ) {
4725                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4726                } else {
4727                    Ok(())
4728                }
4729            }
4730        }
4731    }
4732}
4733
4734#[diagnostic::on_unimplemented(
4735    note = "If {Self} implements the non-local PathServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4736)]
4737
4738/// A server handler for the Path protocol.
4739///
4740/// See [`Path`] for more details.
4741pub trait PathLocalServerHandler<
4742    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4743    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4744>
4745{
4746    #[doc = " Sets the bandwidth interconnect path.\n"]
4747    fn set_bandwidth(
4748        &mut self,
4749
4750        request: ::fidl_next::Request<path::SetBandwidth, ___T>,
4751
4752        responder: ::fidl_next::Responder<path::SetBandwidth, ___T>,
4753    ) -> impl ::core::future::Future<Output = ()>;
4754
4755    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4756        ::core::future::ready(())
4757    }
4758}
4759
4760impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Path
4761where
4762    ___H: PathLocalServerHandler<___T>,
4763    ___T: ::fidl_next::Transport,
4764    for<'de> crate::wire::BandwidthRequest<'de>: ::fidl_next::Decode<
4765            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4766            Constraint = (),
4767        >,
4768{
4769    async fn on_one_way(
4770        handler: &mut ___H,
4771        mut message: ::fidl_next::Message<___T>,
4772    ) -> ::core::result::Result<
4773        (),
4774        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4775    > {
4776        match *message.header().ordinal {
4777            ordinal => {
4778                handler.on_unknown_interaction(ordinal).await;
4779                if ::core::matches!(
4780                    message.header().flexibility(),
4781                    ::fidl_next::protocol::Flexibility::Strict
4782                ) {
4783                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4784                } else {
4785                    Ok(())
4786                }
4787            }
4788        }
4789    }
4790
4791    async fn on_two_way(
4792        handler: &mut ___H,
4793        mut message: ::fidl_next::Message<___T>,
4794        responder: ::fidl_next::protocol::Responder<___T>,
4795    ) -> ::core::result::Result<
4796        (),
4797        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4798    > {
4799        match *message.header().ordinal {
4800            952067593201949981 => {
4801                let responder = ::fidl_next::Responder::from_untyped(responder);
4802
4803                match ::fidl_next::AsDecoderExt::into_decoded(message) {
4804                    Ok(decoded) => {
4805                        handler
4806                            .set_bandwidth(::fidl_next::Request::from_decoded(decoded), responder)
4807                            .await;
4808                        Ok(())
4809                    }
4810                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4811                        ordinal: 952067593201949981,
4812                        error,
4813                    }),
4814                }
4815            }
4816
4817            ordinal => {
4818                handler.on_unknown_interaction(ordinal).await;
4819                if ::core::matches!(
4820                    message.header().flexibility(),
4821                    ::fidl_next::protocol::Flexibility::Strict
4822                ) {
4823                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4824                } else {
4825                    responder
4826                        .respond_framework_error(
4827                            ordinal,
4828                            ::fidl_next::FrameworkError::UnknownMethod,
4829                        )
4830                        .expect("encoding a framework error should never fail")
4831                        .await?;
4832                    Ok(())
4833                }
4834            }
4835        }
4836    }
4837}
4838
4839/// A client handler for the Path protocol.
4840///
4841/// See [`Path`] for more details.
4842pub trait PathClientHandler<
4843    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4844    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4845>
4846{
4847    fn on_unknown_interaction(
4848        &mut self,
4849        ordinal: u64,
4850    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4851        ::core::future::ready(())
4852    }
4853}
4854
4855impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Path
4856where
4857    ___H: PathClientHandler<___T> + ::core::marker::Send,
4858    ___T: ::fidl_next::Transport,
4859{
4860    async fn on_event(
4861        handler: &mut ___H,
4862        mut message: ::fidl_next::Message<___T>,
4863    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4864        match *message.header().ordinal {
4865            ordinal => {
4866                handler.on_unknown_interaction(ordinal).await;
4867                if ::core::matches!(
4868                    message.header().flexibility(),
4869                    ::fidl_next::protocol::Flexibility::Strict
4870                ) {
4871                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4872                } else {
4873                    Ok(())
4874                }
4875            }
4876        }
4877    }
4878}
4879
4880/// A server handler for the Path protocol.
4881///
4882/// See [`Path`] for more details.
4883pub trait PathServerHandler<
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 = ()> + ::core::marker::Send;
4896
4897    fn on_unknown_interaction(
4898        &mut self,
4899        ordinal: u64,
4900    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4901        ::core::future::ready(())
4902    }
4903}
4904
4905impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Path
4906where
4907    ___H: PathServerHandler<___T> + ::core::marker::Send,
4908    ___T: ::fidl_next::Transport,
4909    for<'de> crate::wire::BandwidthRequest<'de>: ::fidl_next::Decode<
4910            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4911            Constraint = (),
4912        >,
4913{
4914    async fn on_one_way(
4915        handler: &mut ___H,
4916        mut message: ::fidl_next::Message<___T>,
4917    ) -> ::core::result::Result<
4918        (),
4919        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4920    > {
4921        match *message.header().ordinal {
4922            ordinal => {
4923                handler.on_unknown_interaction(ordinal).await;
4924                if ::core::matches!(
4925                    message.header().flexibility(),
4926                    ::fidl_next::protocol::Flexibility::Strict
4927                ) {
4928                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4929                } else {
4930                    Ok(())
4931                }
4932            }
4933        }
4934    }
4935
4936    async fn on_two_way(
4937        handler: &mut ___H,
4938        mut message: ::fidl_next::Message<___T>,
4939        responder: ::fidl_next::protocol::Responder<___T>,
4940    ) -> ::core::result::Result<
4941        (),
4942        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4943    > {
4944        match *message.header().ordinal {
4945            952067593201949981 => {
4946                let responder = ::fidl_next::Responder::from_untyped(responder);
4947
4948                match ::fidl_next::AsDecoderExt::into_decoded(message) {
4949                    Ok(decoded) => {
4950                        handler
4951                            .set_bandwidth(::fidl_next::Request::from_decoded(decoded), responder)
4952                            .await;
4953                        Ok(())
4954                    }
4955                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4956                        ordinal: 952067593201949981,
4957                        error,
4958                    }),
4959                }
4960            }
4961
4962            ordinal => {
4963                handler.on_unknown_interaction(ordinal).await;
4964                if ::core::matches!(
4965                    message.header().flexibility(),
4966                    ::fidl_next::protocol::Flexibility::Strict
4967                ) {
4968                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4969                } else {
4970                    responder
4971                        .respond_framework_error(
4972                            ordinal,
4973                            ::fidl_next::FrameworkError::UnknownMethod,
4974                        )
4975                        .expect("encoding a framework error should never fail")
4976                        .await?;
4977                    Ok(())
4978                }
4979            }
4980        }
4981    }
4982}
4983
4984impl<___T> PathClientHandler<___T> for ::fidl_next::IgnoreEvents
4985where
4986    ___T: ::fidl_next::Transport,
4987{
4988    async fn on_unknown_interaction(&mut self, _: u64) {}
4989}
4990
4991impl<___H, ___T> PathLocalClientHandler<___T> for ::fidl_next::Local<___H>
4992where
4993    ___H: PathClientHandler<___T>,
4994    ___T: ::fidl_next::Transport,
4995{
4996    async fn on_unknown_interaction(&mut self, ordinal: u64) {
4997        ___H::on_unknown_interaction(&mut self.0, ordinal).await
4998    }
4999}
5000
5001impl<___H, ___T> PathLocalServerHandler<___T> for ::fidl_next::Local<___H>
5002where
5003    ___H: PathServerHandler<___T>,
5004    ___T: ::fidl_next::Transport,
5005{
5006    async fn set_bandwidth(
5007        &mut self,
5008
5009        request: ::fidl_next::Request<path::SetBandwidth, ___T>,
5010
5011        responder: ::fidl_next::Responder<path::SetBandwidth, ___T>,
5012    ) {
5013        ___H::set_bandwidth(&mut self.0, request, responder).await
5014    }
5015
5016    async fn on_unknown_interaction(&mut self, ordinal: u64) {
5017        ___H::on_unknown_interaction(&mut self.0, ordinal).await
5018    }
5019}