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