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