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