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