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