Skip to main content

fidl_next_fuchsia_driver_framework/
fidl_next_fuchsia_driver_framework.rs

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