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