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::{Driver, DriverClientHandler, DriverServerHandler, driver};
3393
3394 pub use crate::natural::DriverStartRequest;
3395
3396 pub use crate::natural::DriverStartResponse;
3397 }
3398
3399 pub struct Start;
3400
3401 impl ::fidl_next::Method for Start {
3402 const ORDINAL: u64 = 2863727161496985794;
3403 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3404 ::fidl_next::protocol::Flexibility::Flexible;
3405
3406 type Protocol = crate::Driver;
3407
3408 type Request = crate::wire::DriverStartRequest<'static>;
3409 }
3410
3411 impl ::fidl_next::TwoWayMethod for Start {
3412 type Response = ::fidl_next::wire::FlexibleResult<
3413 'static,
3414 crate::wire::DriverStartResponse,
3415 ::fidl_next::wire::Int32,
3416 >;
3417 }
3418
3419 impl<___R> ::fidl_next::Respond<___R> for Start {
3420 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
3421
3422 fn respond(response: ___R) -> Self::Output {
3423 ::fidl_next::FlexibleResult::Ok(response)
3424 }
3425 }
3426
3427 impl<___R> ::fidl_next::RespondErr<___R> for Start {
3428 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
3429
3430 fn respond_err(response: ___R) -> Self::Output {
3431 ::fidl_next::FlexibleResult::Err(response)
3432 }
3433 }
3434
3435 pub struct Stop;
3436
3437 impl ::fidl_next::Method for Stop {
3438 const ORDINAL: u64 = 5446759044519003197;
3439 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3440 ::fidl_next::protocol::Flexibility::Flexible;
3441
3442 type Protocol = crate::Driver;
3443
3444 type Request = ::fidl_next::wire::EmptyMessageBody;
3445 }
3446
3447 mod ___detail {
3448 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Driver
3449 where
3450 ___T: ::fidl_next::Transport,
3451 {
3452 type Client = DriverClient<___T>;
3453 type Server = DriverServer<___T>;
3454 }
3455
3456 #[repr(transparent)]
3458 pub struct DriverClient<___T: ::fidl_next::Transport> {
3459 #[allow(dead_code)]
3460 client: ::fidl_next::protocol::Client<___T>,
3461 }
3462
3463 impl<___T> DriverClient<___T>
3464 where
3465 ___T: ::fidl_next::Transport,
3466 {
3467 #[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"]
3468 pub fn start(
3469 &self,
3470
3471 start_args: impl ::fidl_next::Encode<
3472 crate::wire::DriverStartArgs<'static>,
3473 <___T as ::fidl_next::Transport>::SendBuffer,
3474 >,
3475 ) -> ::fidl_next::TwoWayFuture<'_, super::Start, ___T>
3476 where
3477 <___T as ::fidl_next::Transport>::SendBuffer:
3478 ::fidl_next::encoder::InternalHandleEncoder,
3479 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3480 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3481 {
3482 self.start_with(crate::generic::DriverStartRequest { start_args })
3483 }
3484
3485 #[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"]
3486 pub fn start_with<___R>(
3487 &self,
3488 request: ___R,
3489 ) -> ::fidl_next::TwoWayFuture<'_, super::Start, ___T>
3490 where
3491 ___R: ::fidl_next::Encode<
3492 crate::wire::DriverStartRequest<'static>,
3493 <___T as ::fidl_next::Transport>::SendBuffer,
3494 >,
3495 {
3496 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3497 2863727161496985794,
3498 <super::Start as ::fidl_next::Method>::FLEXIBILITY,
3499 request,
3500 ))
3501 }
3502
3503 #[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"]
3504 pub fn stop(&self) -> ::fidl_next::SendFuture<'_, ___T> {
3505 ::fidl_next::SendFuture::from_untyped(
3506 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
3507 5446759044519003197,
3508 <super::Stop as ::fidl_next::Method>::FLEXIBILITY,
3509 (),
3510 ),
3511 )
3512 }
3513 }
3514
3515 #[repr(transparent)]
3517 pub struct DriverServer<___T: ::fidl_next::Transport> {
3518 server: ::fidl_next::protocol::Server<___T>,
3519 }
3520
3521 impl<___T> DriverServer<___T> where ___T: ::fidl_next::Transport {}
3522 }
3523}
3524
3525pub trait DriverClientHandler<
3529 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
3530 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3531>
3532{
3533 fn on_unknown_interaction(
3534 &mut self,
3535 ordinal: u64,
3536 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3537 ::core::future::ready(())
3538 }
3539}
3540
3541impl<___T> DriverClientHandler<___T> for ::fidl_next::IgnoreEvents
3542where
3543 ___T: ::fidl_next::Transport,
3544{
3545 async fn on_unknown_interaction(&mut self, _: u64) {}
3546}
3547
3548impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Driver
3549where
3550 ___H: DriverClientHandler<___T> + ::core::marker::Send,
3551 ___T: ::fidl_next::Transport,
3552{
3553 async fn on_event(
3554 handler: &mut ___H,
3555 ordinal: u64,
3556 flexibility: ::fidl_next::protocol::Flexibility,
3557 body: ::fidl_next::Body<___T>,
3558 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3559 match ordinal {
3560 ordinal => {
3561 handler.on_unknown_interaction(ordinal).await;
3562 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3563 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3564 } else {
3565 Ok(())
3566 }
3567 }
3568 }
3569 }
3570}
3571
3572pub trait DriverServerHandler<
3576 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
3577 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3578>
3579{
3580 #[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"]
3581 fn start(
3582 &mut self,
3583
3584 request: ::fidl_next::Request<driver::Start, ___T>,
3585
3586 responder: ::fidl_next::Responder<driver::Start, ___T>,
3587 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3588
3589 #[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"]
3590 fn stop(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3591
3592 fn on_unknown_interaction(
3593 &mut self,
3594 ordinal: u64,
3595 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3596 ::core::future::ready(())
3597 }
3598}
3599
3600impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Driver
3601where
3602 ___H: DriverServerHandler<___T> + ::core::marker::Send,
3603 ___T: ::fidl_next::Transport,
3604 for<'de> crate::wire::DriverStartRequest<'de>: ::fidl_next::Decode<
3605 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3606 Constraint = (),
3607 >,
3608{
3609 async fn on_one_way(
3610 handler: &mut ___H,
3611 ordinal: u64,
3612 flexibility: ::fidl_next::protocol::Flexibility,
3613 body: ::fidl_next::Body<___T>,
3614 ) -> ::core::result::Result<
3615 (),
3616 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3617 > {
3618 match ordinal {
3619 5446759044519003197 => {
3620 handler.stop().await;
3621 Ok(())
3622 }
3623
3624 ordinal => {
3625 handler.on_unknown_interaction(ordinal).await;
3626 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3627 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3628 } else {
3629 Ok(())
3630 }
3631 }
3632 }
3633 }
3634
3635 async fn on_two_way(
3636 handler: &mut ___H,
3637 ordinal: u64,
3638 flexibility: ::fidl_next::protocol::Flexibility,
3639 body: ::fidl_next::Body<___T>,
3640 responder: ::fidl_next::protocol::Responder<___T>,
3641 ) -> ::core::result::Result<
3642 (),
3643 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3644 > {
3645 match ordinal {
3646 2863727161496985794 => {
3647 let responder = ::fidl_next::Responder::from_untyped(responder);
3648
3649 match ::fidl_next::AsDecoderExt::into_decoded(body) {
3650 Ok(decoded) => {
3651 handler.start(::fidl_next::Request::from_decoded(decoded), responder).await;
3652 Ok(())
3653 }
3654 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3655 ordinal: 2863727161496985794,
3656 error,
3657 }),
3658 }
3659 }
3660
3661 ordinal => {
3662 handler.on_unknown_interaction(ordinal).await;
3663 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3664 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3665 } else {
3666 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
3667 ordinal,
3668 flexibility,
3669 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
3670 )
3671 .expect("encoding a framework error should never fail")
3672 .await?;
3673 Ok(())
3674 }
3675 }
3676 }
3677 }
3678}
3679
3680#[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"]
3682#[derive(PartialEq, Debug)]
3683pub struct Node;
3684
3685#[cfg(target_os = "fuchsia")]
3686impl ::fidl_next::HasTransport for Node {
3687 type Transport = ::fidl_next::fuchsia::zx::Channel;
3688}
3689
3690pub mod node {
3691 pub mod prelude {
3692 pub use crate::{Node, NodeClientHandler, NodeServerHandler, node};
3693
3694 pub use crate::natural::NodeAddChildRequest;
3695
3696 pub use crate::natural::NodeError;
3697
3698 pub use crate::natural::NodeAddChildResponse;
3699 }
3700
3701 pub struct AddChild;
3702
3703 impl ::fidl_next::Method for AddChild {
3704 const ORDINAL: u64 = 8633697350522413353;
3705 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3706 ::fidl_next::protocol::Flexibility::Flexible;
3707
3708 type Protocol = crate::Node;
3709
3710 type Request = crate::wire::NodeAddChildRequest<'static>;
3711 }
3712
3713 impl ::fidl_next::TwoWayMethod for AddChild {
3714 type Response = ::fidl_next::wire::FlexibleResult<
3715 'static,
3716 crate::wire::NodeAddChildResponse,
3717 crate::wire::NodeError,
3718 >;
3719 }
3720
3721 impl<___R> ::fidl_next::Respond<___R> for AddChild {
3722 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
3723
3724 fn respond(response: ___R) -> Self::Output {
3725 ::fidl_next::FlexibleResult::Ok(response)
3726 }
3727 }
3728
3729 impl<___R> ::fidl_next::RespondErr<___R> for AddChild {
3730 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
3731
3732 fn respond_err(response: ___R) -> Self::Output {
3733 ::fidl_next::FlexibleResult::Err(response)
3734 }
3735 }
3736
3737 mod ___detail {
3738 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Node
3739 where
3740 ___T: ::fidl_next::Transport,
3741 {
3742 type Client = NodeClient<___T>;
3743 type Server = NodeServer<___T>;
3744 }
3745
3746 #[repr(transparent)]
3748 pub struct NodeClient<___T: ::fidl_next::Transport> {
3749 #[allow(dead_code)]
3750 client: ::fidl_next::protocol::Client<___T>,
3751 }
3752
3753 impl<___T> NodeClient<___T>
3754 where
3755 ___T: ::fidl_next::Transport,
3756 {
3757 #[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"]
3758 pub fn add_child(
3759 &self,
3760
3761 args: impl ::fidl_next::Encode<
3762 crate::wire::NodeAddArgs<'static>,
3763 <___T as ::fidl_next::Transport>::SendBuffer,
3764 >,
3765
3766 controller: impl ::fidl_next::Encode<
3767 ::fidl_next::ServerEnd<
3768 crate::NodeController,
3769 ::fidl_next::wire::fuchsia::Channel,
3770 >,
3771 <___T as ::fidl_next::Transport>::SendBuffer,
3772 >,
3773
3774 node: impl ::fidl_next::Encode<
3775 ::fidl_next::ServerEnd<
3776 crate::Node,
3777 ::fidl_next::wire::fuchsia::OptionalChannel,
3778 >,
3779 <___T as ::fidl_next::Transport>::SendBuffer,
3780 >,
3781 ) -> ::fidl_next::TwoWayFuture<'_, super::AddChild, ___T>
3782 where
3783 <___T as ::fidl_next::Transport>::SendBuffer:
3784 ::fidl_next::encoder::InternalHandleEncoder,
3785 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3786 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3787 {
3788 self.add_child_with(crate::generic::NodeAddChildRequest { args, controller, node })
3789 }
3790
3791 #[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"]
3792 pub fn add_child_with<___R>(
3793 &self,
3794 request: ___R,
3795 ) -> ::fidl_next::TwoWayFuture<'_, super::AddChild, ___T>
3796 where
3797 ___R: ::fidl_next::Encode<
3798 crate::wire::NodeAddChildRequest<'static>,
3799 <___T as ::fidl_next::Transport>::SendBuffer,
3800 >,
3801 {
3802 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3803 8633697350522413353,
3804 <super::AddChild as ::fidl_next::Method>::FLEXIBILITY,
3805 request,
3806 ))
3807 }
3808 }
3809
3810 #[repr(transparent)]
3812 pub struct NodeServer<___T: ::fidl_next::Transport> {
3813 server: ::fidl_next::protocol::Server<___T>,
3814 }
3815
3816 impl<___T> NodeServer<___T> where ___T: ::fidl_next::Transport {}
3817 }
3818}
3819
3820pub trait NodeClientHandler<
3824 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3825 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3826>
3827{
3828 fn on_unknown_interaction(
3829 &mut self,
3830 ordinal: u64,
3831 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3832 ::core::future::ready(())
3833 }
3834}
3835
3836impl<___T> NodeClientHandler<___T> for ::fidl_next::IgnoreEvents
3837where
3838 ___T: ::fidl_next::Transport,
3839{
3840 async fn on_unknown_interaction(&mut self, _: u64) {}
3841}
3842
3843impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Node
3844where
3845 ___H: NodeClientHandler<___T> + ::core::marker::Send,
3846 ___T: ::fidl_next::Transport,
3847{
3848 async fn on_event(
3849 handler: &mut ___H,
3850 ordinal: u64,
3851 flexibility: ::fidl_next::protocol::Flexibility,
3852 body: ::fidl_next::Body<___T>,
3853 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3854 match ordinal {
3855 ordinal => {
3856 handler.on_unknown_interaction(ordinal).await;
3857 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3858 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3859 } else {
3860 Ok(())
3861 }
3862 }
3863 }
3864 }
3865}
3866
3867pub trait NodeServerHandler<
3871 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3872 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3873>
3874{
3875 #[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"]
3876 fn add_child(
3877 &mut self,
3878
3879 request: ::fidl_next::Request<node::AddChild, ___T>,
3880
3881 responder: ::fidl_next::Responder<node::AddChild, ___T>,
3882 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3883
3884 fn on_unknown_interaction(
3885 &mut self,
3886 ordinal: u64,
3887 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3888 ::core::future::ready(())
3889 }
3890}
3891
3892impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Node
3893where
3894 ___H: NodeServerHandler<___T> + ::core::marker::Send,
3895 ___T: ::fidl_next::Transport,
3896 for<'de> crate::wire::NodeAddChildRequest<'de>: ::fidl_next::Decode<
3897 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3898 Constraint = (),
3899 >,
3900{
3901 async fn on_one_way(
3902 handler: &mut ___H,
3903 ordinal: u64,
3904 flexibility: ::fidl_next::protocol::Flexibility,
3905 body: ::fidl_next::Body<___T>,
3906 ) -> ::core::result::Result<
3907 (),
3908 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3909 > {
3910 match ordinal {
3911 ordinal => {
3912 handler.on_unknown_interaction(ordinal).await;
3913 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3914 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3915 } else {
3916 Ok(())
3917 }
3918 }
3919 }
3920 }
3921
3922 async fn on_two_way(
3923 handler: &mut ___H,
3924 ordinal: u64,
3925 flexibility: ::fidl_next::protocol::Flexibility,
3926 body: ::fidl_next::Body<___T>,
3927 responder: ::fidl_next::protocol::Responder<___T>,
3928 ) -> ::core::result::Result<
3929 (),
3930 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3931 > {
3932 match ordinal {
3933 8633697350522413353 => {
3934 let responder = ::fidl_next::Responder::from_untyped(responder);
3935
3936 match ::fidl_next::AsDecoderExt::into_decoded(body) {
3937 Ok(decoded) => {
3938 handler
3939 .add_child(::fidl_next::Request::from_decoded(decoded), responder)
3940 .await;
3941 Ok(())
3942 }
3943 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3944 ordinal: 8633697350522413353,
3945 error,
3946 }),
3947 }
3948 }
3949
3950 ordinal => {
3951 handler.on_unknown_interaction(ordinal).await;
3952 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3953 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3954 } else {
3955 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
3956 ordinal,
3957 flexibility,
3958 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
3959 )
3960 .expect("encoding a framework error should never fail")
3961 .await?;
3962 Ok(())
3963 }
3964 }
3965 }
3966 }
3967}
3968
3969#[doc = " Protocol through which a parent node controls one of its children.\n"]
3971#[derive(PartialEq, Debug)]
3972pub struct NodeController;
3973
3974#[cfg(target_os = "fuchsia")]
3975impl ::fidl_next::HasTransport for NodeController {
3976 type Transport = ::fidl_next::fuchsia::zx::Channel;
3977}
3978
3979pub mod node_controller {
3980 pub mod prelude {
3981 pub use crate::{
3982 NodeController, NodeControllerClientHandler, NodeControllerServerHandler,
3983 node_controller,
3984 };
3985
3986 pub use crate::natural::DriverResult;
3987
3988 pub use crate::natural::NodeControllerOnBindRequest;
3989
3990 pub use crate::natural::NodeControllerRequestBindRequest;
3991
3992 pub use crate::natural::NodeControllerRequestBindResponse;
3993 }
3994
3995 pub struct Remove;
3996
3997 impl ::fidl_next::Method for Remove {
3998 const ORDINAL: u64 = 6123359741742396225;
3999 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4000 ::fidl_next::protocol::Flexibility::Flexible;
4001
4002 type Protocol = crate::NodeController;
4003
4004 type Request = ::fidl_next::wire::EmptyMessageBody;
4005 }
4006
4007 pub struct RequestBind;
4008
4009 impl ::fidl_next::Method for RequestBind {
4010 const ORDINAL: u64 = 4735909333556220047;
4011 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4012 ::fidl_next::protocol::Flexibility::Flexible;
4013
4014 type Protocol = crate::NodeController;
4015
4016 type Request = crate::wire::NodeControllerRequestBindRequest<'static>;
4017 }
4018
4019 impl ::fidl_next::TwoWayMethod for RequestBind {
4020 type Response = ::fidl_next::wire::FlexibleResult<
4021 'static,
4022 crate::wire::NodeControllerRequestBindResponse,
4023 ::fidl_next::wire::Int32,
4024 >;
4025 }
4026
4027 impl<___R> ::fidl_next::Respond<___R> for RequestBind {
4028 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
4029
4030 fn respond(response: ___R) -> Self::Output {
4031 ::fidl_next::FlexibleResult::Ok(response)
4032 }
4033 }
4034
4035 impl<___R> ::fidl_next::RespondErr<___R> for RequestBind {
4036 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
4037
4038 fn respond_err(response: ___R) -> Self::Output {
4039 ::fidl_next::FlexibleResult::Err(response)
4040 }
4041 }
4042
4043 pub struct OnBind;
4044
4045 impl ::fidl_next::Method for OnBind {
4046 const ORDINAL: u64 = 5905369594807853098;
4047 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4048 ::fidl_next::protocol::Flexibility::Flexible;
4049
4050 type Protocol = crate::NodeController;
4051
4052 type Request = crate::wire::NodeControllerOnBindRequest<'static>;
4053 }
4054
4055 pub struct WaitForDriver;
4056
4057 impl ::fidl_next::Method for WaitForDriver {
4058 const ORDINAL: u64 = 7635589759067755399;
4059 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4060 ::fidl_next::protocol::Flexibility::Flexible;
4061
4062 type Protocol = crate::NodeController;
4063
4064 type Request = ::fidl_next::wire::EmptyMessageBody;
4065 }
4066
4067 impl ::fidl_next::TwoWayMethod for WaitForDriver {
4068 type Response = ::fidl_next::wire::FlexibleResult<
4069 'static,
4070 crate::wire::DriverResult<'static>,
4071 ::fidl_next::wire::Int32,
4072 >;
4073 }
4074
4075 impl<___R> ::fidl_next::Respond<___R> for WaitForDriver {
4076 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
4077
4078 fn respond(response: ___R) -> Self::Output {
4079 ::fidl_next::FlexibleResult::Ok(response)
4080 }
4081 }
4082
4083 impl<___R> ::fidl_next::RespondErr<___R> for WaitForDriver {
4084 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
4085
4086 fn respond_err(response: ___R) -> Self::Output {
4087 ::fidl_next::FlexibleResult::Err(response)
4088 }
4089 }
4090
4091 mod ___detail {
4092 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::NodeController
4093 where
4094 ___T: ::fidl_next::Transport,
4095 {
4096 type Client = NodeControllerClient<___T>;
4097 type Server = NodeControllerServer<___T>;
4098 }
4099
4100 #[repr(transparent)]
4102 pub struct NodeControllerClient<___T: ::fidl_next::Transport> {
4103 #[allow(dead_code)]
4104 client: ::fidl_next::protocol::Client<___T>,
4105 }
4106
4107 impl<___T> NodeControllerClient<___T>
4108 where
4109 ___T: ::fidl_next::Transport,
4110 {
4111 #[doc = " Removes the node and all of its children.\n"]
4112 pub fn remove(&self) -> ::fidl_next::SendFuture<'_, ___T> {
4113 ::fidl_next::SendFuture::from_untyped(
4114 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
4115 6123359741742396225,
4116 <super::Remove as ::fidl_next::Method>::FLEXIBILITY,
4117 (),
4118 ),
4119 )
4120 }
4121
4122 #[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"]
4123 pub fn request_bind_with<___R>(
4124 &self,
4125 request: ___R,
4126 ) -> ::fidl_next::TwoWayFuture<'_, super::RequestBind, ___T>
4127 where
4128 ___R: ::fidl_next::Encode<
4129 crate::wire::NodeControllerRequestBindRequest<'static>,
4130 <___T as ::fidl_next::Transport>::SendBuffer,
4131 >,
4132 {
4133 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4134 4735909333556220047,
4135 <super::RequestBind as ::fidl_next::Method>::FLEXIBILITY,
4136 request,
4137 ))
4138 }
4139
4140 #[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"]
4141 pub fn wait_for_driver(
4142 &self,
4143 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForDriver, ___T> {
4144 ::fidl_next::TwoWayFuture::from_untyped(
4145 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4146 7635589759067755399,
4147 <super::WaitForDriver as ::fidl_next::Method>::FLEXIBILITY,
4148 (),
4149 ),
4150 )
4151 }
4152 }
4153
4154 #[repr(transparent)]
4156 pub struct NodeControllerServer<___T: ::fidl_next::Transport> {
4157 server: ::fidl_next::protocol::Server<___T>,
4158 }
4159
4160 impl<___T> NodeControllerServer<___T>
4161 where
4162 ___T: ::fidl_next::Transport,
4163 {
4164 #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n Replaced with WaitForDriver.\n"]
4165
4166 pub fn on_bind_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
4167 where
4168 ___R: ::fidl_next::Encode<
4169 <super::OnBind as ::fidl_next::Method>::Request,
4170 <___T as ::fidl_next::Transport>::SendBuffer,
4171 >,
4172 {
4173 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
4174 5905369594807853098,
4175 <super::OnBind as ::fidl_next::Method>::FLEXIBILITY,
4176 request,
4177 ))
4178 }
4179 }
4180 }
4181}
4182
4183pub trait NodeControllerClientHandler<
4187 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4188 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4189>
4190{
4191 #[doc = " Event that is triggered when the associated `Node` is bound to a driver.\n Replaced with WaitForDriver.\n"]
4192 fn on_bind(
4193 &mut self,
4194
4195 request: ::fidl_next::Request<node_controller::OnBind, ___T>,
4196 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4197
4198 fn on_unknown_interaction(
4199 &mut self,
4200 ordinal: u64,
4201 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4202 ::core::future::ready(())
4203 }
4204}
4205
4206impl<___T> NodeControllerClientHandler<___T> for ::fidl_next::IgnoreEvents
4207where
4208 ___T: ::fidl_next::Transport,
4209{
4210 async fn on_bind(&mut self, _: ::fidl_next::Request<node_controller::OnBind, ___T>) {}
4211
4212 async fn on_unknown_interaction(&mut self, _: u64) {}
4213}
4214
4215impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for NodeController
4216where
4217 ___H: NodeControllerClientHandler<___T> + ::core::marker::Send,
4218 ___T: ::fidl_next::Transport,
4219 for<'de> crate::wire::NodeControllerOnBindRequest<'de>: ::fidl_next::Decode<
4220 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4221 Constraint = (),
4222 >,
4223{
4224 async fn on_event(
4225 handler: &mut ___H,
4226 ordinal: u64,
4227 flexibility: ::fidl_next::protocol::Flexibility,
4228 body: ::fidl_next::Body<___T>,
4229 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4230 match ordinal {
4231 5905369594807853098 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
4232 Ok(decoded) => {
4233 handler.on_bind(::fidl_next::Request::from_decoded(decoded)).await;
4234 Ok(())
4235 }
4236 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4237 ordinal: 5905369594807853098,
4238 error,
4239 }),
4240 },
4241
4242 ordinal => {
4243 handler.on_unknown_interaction(ordinal).await;
4244 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4245 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4246 } else {
4247 Ok(())
4248 }
4249 }
4250 }
4251 }
4252}
4253
4254pub trait NodeControllerServerHandler<
4258 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4259 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4260>
4261{
4262 #[doc = " Removes the node and all of its children.\n"]
4263 fn remove(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4264
4265 #[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"]
4266 fn request_bind(
4267 &mut self,
4268
4269 request: ::fidl_next::Request<node_controller::RequestBind, ___T>,
4270
4271 responder: ::fidl_next::Responder<node_controller::RequestBind, ___T>,
4272 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4273
4274 #[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"]
4275 fn wait_for_driver(
4276 &mut self,
4277
4278 responder: ::fidl_next::Responder<node_controller::WaitForDriver, ___T>,
4279 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4280
4281 fn on_unknown_interaction(
4282 &mut self,
4283 ordinal: u64,
4284 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4285 ::core::future::ready(())
4286 }
4287}
4288
4289impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for NodeController
4290where
4291 ___H: NodeControllerServerHandler<___T> + ::core::marker::Send,
4292 ___T: ::fidl_next::Transport,
4293 for<'de> crate::wire::NodeControllerRequestBindRequest<'de>: ::fidl_next::Decode<
4294 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4295 Constraint = (),
4296 >,
4297{
4298 async fn on_one_way(
4299 handler: &mut ___H,
4300 ordinal: u64,
4301 flexibility: ::fidl_next::protocol::Flexibility,
4302 body: ::fidl_next::Body<___T>,
4303 ) -> ::core::result::Result<
4304 (),
4305 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4306 > {
4307 match ordinal {
4308 6123359741742396225 => {
4309 handler.remove().await;
4310 Ok(())
4311 }
4312
4313 ordinal => {
4314 handler.on_unknown_interaction(ordinal).await;
4315 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4316 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4317 } else {
4318 Ok(())
4319 }
4320 }
4321 }
4322 }
4323
4324 async fn on_two_way(
4325 handler: &mut ___H,
4326 ordinal: u64,
4327 flexibility: ::fidl_next::protocol::Flexibility,
4328 body: ::fidl_next::Body<___T>,
4329 responder: ::fidl_next::protocol::Responder<___T>,
4330 ) -> ::core::result::Result<
4331 (),
4332 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4333 > {
4334 match ordinal {
4335 4735909333556220047 => {
4336 let responder = ::fidl_next::Responder::from_untyped(responder);
4337
4338 match ::fidl_next::AsDecoderExt::into_decoded(body) {
4339 Ok(decoded) => {
4340 handler
4341 .request_bind(::fidl_next::Request::from_decoded(decoded), responder)
4342 .await;
4343 Ok(())
4344 }
4345 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4346 ordinal: 4735909333556220047,
4347 error,
4348 }),
4349 }
4350 }
4351
4352 7635589759067755399 => {
4353 let responder = ::fidl_next::Responder::from_untyped(responder);
4354
4355 handler.wait_for_driver(responder).await;
4356 Ok(())
4357 }
4358
4359 ordinal => {
4360 handler.on_unknown_interaction(ordinal).await;
4361 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4362 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4363 } else {
4364 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
4365 ordinal,
4366 flexibility,
4367 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
4368 )
4369 .expect("encoding a framework error should never fail")
4370 .await?;
4371 Ok(())
4372 }
4373 }
4374 }
4375 }
4376}
4377
4378pub use fidl_next_common_fuchsia_driver_framework::*;