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