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<::fidl_next::fuchsia::zx::Status>,
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::fuchsia::Status,
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::fuchsia::Status>()
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 payload,
1744
1745 } = &mut *out_;
1746 }
1747
1748 ::fidl_next::Wire::zero_padding(payload);
1749 }
1750 }
1751
1752 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
1753 for ComponentControllerOnPublishDiagnosticsRequest<'de>
1754 where
1755 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1756 ___D: ::fidl_next::Decoder<'de>,
1757 ___D: ::fidl_next::fuchsia::HandleDecoder,
1758 {
1759 fn decode(
1760 slot_: ::fidl_next::Slot<'_, Self>,
1761 decoder_: &mut ___D,
1762 _: (),
1763 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1764 ::fidl_next::munge! {
1765 let Self {
1766 mut payload,
1767
1768 } = slot_;
1769 }
1770
1771 let _field = payload.as_mut();
1772
1773 ::fidl_next::Decode::decode(payload.as_mut(), decoder_, ())?;
1774
1775 Ok(())
1776 }
1777 }
1778
1779 impl<'de> ::fidl_next::IntoNatural for ComponentControllerOnPublishDiagnosticsRequest<'de> {
1780 type Natural = crate::natural::ComponentControllerOnPublishDiagnosticsRequest;
1781 }
1782
1783 #[repr(C)]
1785 pub struct ComponentStopInfo<'de> {
1786 pub(crate) table: ::fidl_next::wire::Table<'de>,
1787 }
1788
1789 impl<'de> Drop for ComponentStopInfo<'de> {
1790 fn drop(&mut self) {
1791 let _ = self.table.get(1).map(|envelope| unsafe {
1792 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Status>()
1793 });
1794
1795 let _ = self
1796 .table
1797 .get(2)
1798 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
1799 }
1800 }
1801
1802 impl ::fidl_next::Constrained for ComponentStopInfo<'_> {
1803 type Constraint = ();
1804
1805 fn validate(
1806 _: ::fidl_next::Slot<'_, Self>,
1807 _: Self::Constraint,
1808 ) -> Result<(), ::fidl_next::ValidationError> {
1809 Ok(())
1810 }
1811 }
1812
1813 unsafe impl ::fidl_next::Wire for ComponentStopInfo<'static> {
1814 type Narrowed<'de> = ComponentStopInfo<'de>;
1815
1816 #[inline]
1817 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1818 ::fidl_next::munge!(let Self { table } = out);
1819 ::fidl_next::wire::Table::zero_padding(table);
1820 }
1821 }
1822
1823 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentStopInfo<'de>
1824 where
1825 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1826 ___D: ::fidl_next::fuchsia::HandleDecoder,
1827 {
1828 fn decode(
1829 slot: ::fidl_next::Slot<'_, Self>,
1830 decoder: &mut ___D,
1831 _: (),
1832 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1833 ::fidl_next::munge!(let Self { table } = slot);
1834
1835 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1836 match ordinal {
1837 0 => unsafe { ::core::hint::unreachable_unchecked() },
1838
1839 1 => {
1840 ::fidl_next::wire::Envelope::decode_as::<
1841 ___D,
1842 ::fidl_next::wire::fuchsia::Status,
1843 >(slot.as_mut(), decoder, ())?;
1844
1845 Ok(())
1846 }
1847
1848 2 => {
1849 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
1850 slot.as_mut(),
1851 decoder,
1852 (),
1853 )?;
1854
1855 Ok(())
1856 }
1857
1858 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1859 }
1860 })
1861 }
1862 }
1863
1864 impl<'de> ComponentStopInfo<'de> {
1865 pub fn termination_status(
1866 &self,
1867 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Status> {
1868 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1869 }
1870
1871 pub fn exit_code(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
1872 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1873 }
1874 }
1875
1876 impl<'de> ::core::fmt::Debug for ComponentStopInfo<'de> {
1877 fn fmt(
1878 &self,
1879 f: &mut ::core::fmt::Formatter<'_>,
1880 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1881 f.debug_struct("ComponentStopInfo")
1882 .field("termination_status", &self.termination_status())
1883 .field("exit_code", &self.exit_code())
1884 .finish()
1885 }
1886 }
1887
1888 impl<'de> ::fidl_next::IntoNatural for ComponentStopInfo<'de> {
1889 type Natural = crate::natural::ComponentStopInfo;
1890 }
1891
1892 #[repr(C)]
1894 pub struct ComponentControllerOnEscrowRequest<'de> {
1895 pub(crate) table: ::fidl_next::wire::Table<'de>,
1896 }
1897
1898 impl<'de> Drop for ComponentControllerOnEscrowRequest<'de> {
1899 fn drop(&mut self) {
1900 let _ = self.table.get(1).map(|envelope| unsafe {
1901 envelope.read_unchecked::<::fidl_next::ServerEnd<
1902 ::fidl_next_fuchsia_io::Directory,
1903 ::fidl_next::wire::fuchsia::Channel,
1904 >>()
1905 });
1906
1907 let _ = self.table.get(2)
1908 .map(|envelope| unsafe {
1909 envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>()
1910 });
1911
1912 let _ = self.table.get(3).map(|envelope| unsafe {
1913 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
1914 });
1915 }
1916 }
1917
1918 impl ::fidl_next::Constrained for ComponentControllerOnEscrowRequest<'_> {
1919 type Constraint = ();
1920
1921 fn validate(
1922 _: ::fidl_next::Slot<'_, Self>,
1923 _: Self::Constraint,
1924 ) -> Result<(), ::fidl_next::ValidationError> {
1925 Ok(())
1926 }
1927 }
1928
1929 unsafe impl ::fidl_next::Wire for ComponentControllerOnEscrowRequest<'static> {
1930 type Narrowed<'de> = ComponentControllerOnEscrowRequest<'de>;
1931
1932 #[inline]
1933 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1934 ::fidl_next::munge!(let Self { table } = out);
1935 ::fidl_next::wire::Table::zero_padding(table);
1936 }
1937 }
1938
1939 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentControllerOnEscrowRequest<'de>
1940 where
1941 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1942 ___D: ::fidl_next::fuchsia::HandleDecoder,
1943 {
1944 fn decode(
1945 slot: ::fidl_next::Slot<'_, Self>,
1946 decoder: &mut ___D,
1947 _: (),
1948 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1949 ::fidl_next::munge!(let Self { table } = slot);
1950
1951 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1952 match ordinal {
1953 0 => unsafe { ::core::hint::unreachable_unchecked() },
1954
1955 1 => {
1956 ::fidl_next::wire::Envelope::decode_as::<
1957 ___D,
1958 ::fidl_next::ServerEnd<
1959 ::fidl_next_fuchsia_io::Directory,
1960 ::fidl_next::wire::fuchsia::Channel,
1961 >,
1962 >(slot.as_mut(), decoder, ())?;
1963
1964 Ok(())
1965 }
1966
1967 2 => {
1968 ::fidl_next::wire::Envelope::decode_as::<
1969 ___D,
1970 ::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef,
1971 >(slot.as_mut(), decoder, ())?;
1972
1973 Ok(())
1974 }
1975
1976 3 => {
1977 ::fidl_next::wire::Envelope::decode_as::<
1978 ___D,
1979 ::fidl_next::wire::fuchsia::EventPair,
1980 >(slot.as_mut(), decoder, ())?;
1981
1982 Ok(())
1983 }
1984
1985 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1986 }
1987 })
1988 }
1989 }
1990
1991 impl<'de> ComponentControllerOnEscrowRequest<'de> {
1992 pub fn outgoing_dir(
1993 &self,
1994 ) -> ::core::option::Option<
1995 &::fidl_next::ServerEnd<
1996 ::fidl_next_fuchsia_io::Directory,
1997 ::fidl_next::wire::fuchsia::Channel,
1998 >,
1999 > {
2000 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2001 }
2002
2003 pub fn escrowed_dictionary(
2004 &self,
2005 ) -> ::core::option::Option<&::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>
2006 {
2007 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2008 }
2009
2010 pub fn escrowed_dictionary_handle(
2011 &self,
2012 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2013 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2014 }
2015 }
2016
2017 impl<'de> ::core::fmt::Debug for ComponentControllerOnEscrowRequest<'de> {
2018 fn fmt(
2019 &self,
2020 f: &mut ::core::fmt::Formatter<'_>,
2021 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2022 f.debug_struct("ComponentControllerOnEscrowRequest")
2023 .field("outgoing_dir", &self.outgoing_dir())
2024 .field("escrowed_dictionary", &self.escrowed_dictionary())
2025 .field("escrowed_dictionary_handle", &self.escrowed_dictionary_handle())
2026 .finish()
2027 }
2028 }
2029
2030 impl<'de> ::fidl_next::IntoNatural for ComponentControllerOnEscrowRequest<'de> {
2031 type Natural = crate::natural::ComponentControllerOnEscrowRequest;
2032 }
2033
2034 #[repr(C)]
2036 pub struct ComponentNamespaceEntry<'de> {
2037 pub(crate) table: ::fidl_next::wire::Table<'de>,
2038 }
2039
2040 impl<'de> Drop for ComponentNamespaceEntry<'de> {
2041 fn drop(&mut self) {
2042 let _ = self.table.get(1).map(|envelope| unsafe {
2043 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2044 });
2045
2046 let _ = self.table.get(2).map(|envelope| unsafe {
2047 envelope.read_unchecked::<::fidl_next::ClientEnd<
2048 ::fidl_next_fuchsia_io::Directory,
2049 ::fidl_next::wire::fuchsia::Channel,
2050 >>()
2051 });
2052 }
2053 }
2054
2055 impl ::fidl_next::Constrained for ComponentNamespaceEntry<'_> {
2056 type Constraint = ();
2057
2058 fn validate(
2059 _: ::fidl_next::Slot<'_, Self>,
2060 _: Self::Constraint,
2061 ) -> Result<(), ::fidl_next::ValidationError> {
2062 Ok(())
2063 }
2064 }
2065
2066 unsafe impl ::fidl_next::Wire for ComponentNamespaceEntry<'static> {
2067 type Narrowed<'de> = ComponentNamespaceEntry<'de>;
2068
2069 #[inline]
2070 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2071 ::fidl_next::munge!(let Self { table } = out);
2072 ::fidl_next::wire::Table::zero_padding(table);
2073 }
2074 }
2075
2076 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentNamespaceEntry<'de>
2077 where
2078 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2079 ___D: ::fidl_next::fuchsia::HandleDecoder,
2080 {
2081 fn decode(
2082 slot: ::fidl_next::Slot<'_, Self>,
2083 decoder: &mut ___D,
2084 _: (),
2085 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2086 ::fidl_next::munge!(let Self { table } = slot);
2087
2088 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2089 match ordinal {
2090 0 => unsafe { ::core::hint::unreachable_unchecked() },
2091
2092 1 => {
2093 ::fidl_next::wire::Envelope::decode_as::<
2094 ___D,
2095 ::fidl_next::wire::String<'de>,
2096 >(slot.as_mut(), decoder, 4095)?;
2097
2098 let value = unsafe {
2099 slot.deref_unchecked()
2100 .deref_unchecked::<::fidl_next::wire::String<'_>>()
2101 };
2102
2103 if value.len() > 4095 {
2104 return Err(::fidl_next::DecodeError::VectorTooLong {
2105 size: value.len() as u64,
2106 limit: 4095,
2107 });
2108 }
2109
2110 Ok(())
2111 }
2112
2113 2 => {
2114 ::fidl_next::wire::Envelope::decode_as::<
2115 ___D,
2116 ::fidl_next::ClientEnd<
2117 ::fidl_next_fuchsia_io::Directory,
2118 ::fidl_next::wire::fuchsia::Channel,
2119 >,
2120 >(slot.as_mut(), decoder, ())?;
2121
2122 Ok(())
2123 }
2124
2125 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2126 }
2127 })
2128 }
2129 }
2130
2131 impl<'de> ComponentNamespaceEntry<'de> {
2132 pub fn path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2133 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2134 }
2135
2136 pub fn directory(
2137 &self,
2138 ) -> ::core::option::Option<
2139 &::fidl_next::ClientEnd<
2140 ::fidl_next_fuchsia_io::Directory,
2141 ::fidl_next::wire::fuchsia::Channel,
2142 >,
2143 > {
2144 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2145 }
2146 }
2147
2148 impl<'de> ::core::fmt::Debug for ComponentNamespaceEntry<'de> {
2149 fn fmt(
2150 &self,
2151 f: &mut ::core::fmt::Formatter<'_>,
2152 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2153 f.debug_struct("ComponentNamespaceEntry")
2154 .field("path", &self.path())
2155 .field("directory", &self.directory())
2156 .finish()
2157 }
2158 }
2159
2160 impl<'de> ::fidl_next::IntoNatural for ComponentNamespaceEntry<'de> {
2161 type Natural = crate::natural::ComponentNamespaceEntry;
2162 }
2163
2164 #[repr(C)]
2166 pub struct ComponentStartInfo<'de> {
2167 pub(crate) table: ::fidl_next::wire::Table<'de>,
2168 }
2169
2170 impl<'de> Drop for ComponentStartInfo<'de> {
2171 fn drop(&mut self) {
2172 let _ = self.table.get(1).map(|envelope| unsafe {
2173 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2174 });
2175
2176 let _ = self.table.get(2).map(|envelope| unsafe {
2177 envelope.read_unchecked::<::fidl_next_fuchsia_data::wire::Dictionary<'de>>()
2178 });
2179
2180 let _ = self.table.get(3)
2181 .map(|envelope| unsafe {
2182 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ComponentNamespaceEntry<'de>>>()
2183 });
2184
2185 let _ = self.table.get(4).map(|envelope| unsafe {
2186 envelope.read_unchecked::<::fidl_next::ServerEnd<
2187 ::fidl_next_fuchsia_io::Directory,
2188 ::fidl_next::wire::fuchsia::Channel,
2189 >>()
2190 });
2191
2192 let _ = self.table.get(5).map(|envelope| unsafe {
2193 envelope.read_unchecked::<::fidl_next::ServerEnd<
2194 ::fidl_next_fuchsia_io::Directory,
2195 ::fidl_next::wire::fuchsia::Channel,
2196 >>()
2197 });
2198
2199 let _ =
2200 self.table.get(6).map(|envelope| unsafe {
2201 envelope.read_unchecked::<::fidl_next::wire::Vector<
2202 'de,
2203 ::fidl_next_fuchsia_process::wire::HandleInfo,
2204 >>()
2205 });
2206
2207 let _ = self.table.get(7).map(|envelope| unsafe {
2208 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
2209 });
2210
2211 let _ = self.table.get(8).map(|envelope| unsafe {
2212 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2213 });
2214
2215 let _ = self.table.get(9).map(|envelope| unsafe {
2216 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
2217 });
2218
2219 let _ = self.table.get(10)
2220 .map(|envelope| unsafe {
2221 envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>()
2222 });
2223
2224 let _ = self.table.get(11).map(|envelope| unsafe {
2225 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2226 });
2227 }
2228 }
2229
2230 impl ::fidl_next::Constrained for ComponentStartInfo<'_> {
2231 type Constraint = ();
2232
2233 fn validate(
2234 _: ::fidl_next::Slot<'_, Self>,
2235 _: Self::Constraint,
2236 ) -> Result<(), ::fidl_next::ValidationError> {
2237 Ok(())
2238 }
2239 }
2240
2241 unsafe impl ::fidl_next::Wire for ComponentStartInfo<'static> {
2242 type Narrowed<'de> = ComponentStartInfo<'de>;
2243
2244 #[inline]
2245 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2246 ::fidl_next::munge!(let Self { table } = out);
2247 ::fidl_next::wire::Table::zero_padding(table);
2248 }
2249 }
2250
2251 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentStartInfo<'de>
2252 where
2253 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2254 ___D: ::fidl_next::fuchsia::HandleDecoder,
2255 {
2256 fn decode(
2257 slot: ::fidl_next::Slot<'_, Self>,
2258 decoder: &mut ___D,
2259 _: (),
2260 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2261 ::fidl_next::munge!(let Self { table } = slot);
2262
2263 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2264 match ordinal {
2265 0 => unsafe { ::core::hint::unreachable_unchecked() },
2266
2267 1 => {
2268 ::fidl_next::wire::Envelope::decode_as::<
2269 ___D,
2270 ::fidl_next::wire::String<'de>,
2271 >(slot.as_mut(), decoder, 4096)?;
2272
2273 let value = unsafe {
2274 slot.deref_unchecked()
2275 .deref_unchecked::<::fidl_next::wire::String<'_>>()
2276 };
2277
2278 if value.len() > 4096 {
2279 return Err(::fidl_next::DecodeError::VectorTooLong {
2280 size: value.len() as u64,
2281 limit: 4096,
2282 });
2283 }
2284
2285 Ok(())
2286 }
2287
2288 2 => {
2289 ::fidl_next::wire::Envelope::decode_as::<
2290 ___D,
2291 ::fidl_next_fuchsia_data::wire::Dictionary<'de>,
2292 >(slot.as_mut(), decoder, ())?;
2293
2294 Ok(())
2295 }
2296
2297 3 => {
2298 ::fidl_next::wire::Envelope::decode_as::<
2299 ___D,
2300 ::fidl_next::wire::Vector<
2301 'de,
2302 crate::wire::ComponentNamespaceEntry<'de>,
2303 >,
2304 >(slot.as_mut(), decoder, (32, ()))?;
2305
2306 let value = unsafe {
2307 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
2308 '_,
2309 crate::wire::ComponentNamespaceEntry<'_>,
2310 >>()
2311 };
2312
2313 if value.len() > 32 {
2314 return Err(::fidl_next::DecodeError::VectorTooLong {
2315 size: value.len() as u64,
2316 limit: 32,
2317 });
2318 }
2319
2320 Ok(())
2321 }
2322
2323 4 => {
2324 ::fidl_next::wire::Envelope::decode_as::<
2325 ___D,
2326 ::fidl_next::ServerEnd<
2327 ::fidl_next_fuchsia_io::Directory,
2328 ::fidl_next::wire::fuchsia::Channel,
2329 >,
2330 >(slot.as_mut(), decoder, ())?;
2331
2332 Ok(())
2333 }
2334
2335 5 => {
2336 ::fidl_next::wire::Envelope::decode_as::<
2337 ___D,
2338 ::fidl_next::ServerEnd<
2339 ::fidl_next_fuchsia_io::Directory,
2340 ::fidl_next::wire::fuchsia::Channel,
2341 >,
2342 >(slot.as_mut(), decoder, ())?;
2343
2344 Ok(())
2345 }
2346
2347 6 => {
2348 ::fidl_next::wire::Envelope::decode_as::<
2349 ___D,
2350 ::fidl_next::wire::Vector<
2351 'de,
2352 ::fidl_next_fuchsia_process::wire::HandleInfo,
2353 >,
2354 >(slot.as_mut(), decoder, (128, ()))?;
2355
2356 let value = unsafe {
2357 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
2358 '_,
2359 ::fidl_next_fuchsia_process::wire::HandleInfo,
2360 >>()
2361 };
2362
2363 if value.len() > 128 {
2364 return Err(::fidl_next::DecodeError::VectorTooLong {
2365 size: value.len() as u64,
2366 limit: 128,
2367 });
2368 }
2369
2370 Ok(())
2371 }
2372
2373 7 => {
2374 ::fidl_next::wire::Envelope::decode_as::<
2375 ___D,
2376 ::fidl_next_fuchsia_mem::wire::Data<'de>,
2377 >(slot.as_mut(), decoder, ())?;
2378
2379 Ok(())
2380 }
2381
2382 8 => {
2383 ::fidl_next::wire::Envelope::decode_as::<
2384 ___D,
2385 ::fidl_next::wire::fuchsia::EventPair,
2386 >(slot.as_mut(), decoder, ())?;
2387
2388 Ok(())
2389 }
2390
2391 9 => {
2392 ::fidl_next::wire::Envelope::decode_as::<
2393 ___D,
2394 ::fidl_next::wire::fuchsia::Event,
2395 >(slot.as_mut(), decoder, ())?;
2396
2397 Ok(())
2398 }
2399
2400 10 => {
2401 ::fidl_next::wire::Envelope::decode_as::<
2402 ___D,
2403 ::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef,
2404 >(slot.as_mut(), decoder, ())?;
2405
2406 Ok(())
2407 }
2408
2409 11 => {
2410 ::fidl_next::wire::Envelope::decode_as::<
2411 ___D,
2412 ::fidl_next::wire::fuchsia::EventPair,
2413 >(slot.as_mut(), decoder, ())?;
2414
2415 Ok(())
2416 }
2417
2418 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2419 }
2420 })
2421 }
2422 }
2423
2424 impl<'de> ComponentStartInfo<'de> {
2425 pub fn resolved_url(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2426 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2427 }
2428
2429 pub fn program(
2430 &self,
2431 ) -> ::core::option::Option<&::fidl_next_fuchsia_data::wire::Dictionary<'de>> {
2432 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2433 }
2434
2435 pub fn ns(
2436 &self,
2437 ) -> ::core::option::Option<
2438 &::fidl_next::wire::Vector<'de, crate::wire::ComponentNamespaceEntry<'de>>,
2439 > {
2440 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2441 }
2442
2443 pub fn outgoing_dir(
2444 &self,
2445 ) -> ::core::option::Option<
2446 &::fidl_next::ServerEnd<
2447 ::fidl_next_fuchsia_io::Directory,
2448 ::fidl_next::wire::fuchsia::Channel,
2449 >,
2450 > {
2451 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2452 }
2453
2454 pub fn runtime_dir(
2455 &self,
2456 ) -> ::core::option::Option<
2457 &::fidl_next::ServerEnd<
2458 ::fidl_next_fuchsia_io::Directory,
2459 ::fidl_next::wire::fuchsia::Channel,
2460 >,
2461 > {
2462 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
2463 }
2464
2465 pub fn numbered_handles(
2466 &self,
2467 ) -> ::core::option::Option<
2468 &::fidl_next::wire::Vector<'de, ::fidl_next_fuchsia_process::wire::HandleInfo>,
2469 > {
2470 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
2471 }
2472
2473 pub fn encoded_config(
2474 &self,
2475 ) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
2476 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
2477 }
2478
2479 pub fn break_on_start(
2480 &self,
2481 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2482 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
2483 }
2484
2485 pub fn component_instance(
2486 &self,
2487 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Event> {
2488 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
2489 }
2490
2491 pub fn escrowed_dictionary(
2492 &self,
2493 ) -> ::core::option::Option<&::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>
2494 {
2495 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
2496 }
2497
2498 pub fn escrowed_dictionary_handle(
2499 &self,
2500 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2501 unsafe { Some(self.table.get(11)?.deref_unchecked()) }
2502 }
2503 }
2504
2505 impl<'de> ::core::fmt::Debug for ComponentStartInfo<'de> {
2506 fn fmt(
2507 &self,
2508 f: &mut ::core::fmt::Formatter<'_>,
2509 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2510 f.debug_struct("ComponentStartInfo")
2511 .field("resolved_url", &self.resolved_url())
2512 .field("program", &self.program())
2513 .field("ns", &self.ns())
2514 .field("outgoing_dir", &self.outgoing_dir())
2515 .field("runtime_dir", &self.runtime_dir())
2516 .field("numbered_handles", &self.numbered_handles())
2517 .field("encoded_config", &self.encoded_config())
2518 .field("break_on_start", &self.break_on_start())
2519 .field("component_instance", &self.component_instance())
2520 .field("escrowed_dictionary", &self.escrowed_dictionary())
2521 .field("escrowed_dictionary_handle", &self.escrowed_dictionary_handle())
2522 .finish()
2523 }
2524 }
2525
2526 impl<'de> ::fidl_next::IntoNatural for ComponentStartInfo<'de> {
2527 type Natural = crate::natural::ComponentStartInfo;
2528 }
2529
2530 #[derive(Debug)]
2532 #[repr(C)]
2533 pub struct ComponentRunnerStartRequest<'de> {
2534 pub start_info: crate::wire::ComponentStartInfo<'de>,
2535
2536 pub controller:
2537 ::fidl_next::ServerEnd<crate::ComponentController, ::fidl_next::wire::fuchsia::Channel>,
2538 }
2539
2540 static_assertions::const_assert_eq!(std::mem::size_of::<ComponentRunnerStartRequest<'_>>(), 24);
2541 static_assertions::const_assert_eq!(std::mem::align_of::<ComponentRunnerStartRequest<'_>>(), 8);
2542
2543 static_assertions::const_assert_eq!(
2544 std::mem::offset_of!(ComponentRunnerStartRequest<'_>, start_info),
2545 0
2546 );
2547
2548 static_assertions::const_assert_eq!(
2549 std::mem::offset_of!(ComponentRunnerStartRequest<'_>, controller),
2550 16
2551 );
2552
2553 impl ::fidl_next::Constrained for ComponentRunnerStartRequest<'_> {
2554 type Constraint = ();
2555
2556 fn validate(
2557 _: ::fidl_next::Slot<'_, Self>,
2558 _: Self::Constraint,
2559 ) -> Result<(), ::fidl_next::ValidationError> {
2560 Ok(())
2561 }
2562 }
2563
2564 unsafe impl ::fidl_next::Wire for ComponentRunnerStartRequest<'static> {
2565 type Narrowed<'de> = ComponentRunnerStartRequest<'de>;
2566
2567 #[inline]
2568 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2569 ::fidl_next::munge! {
2570 let Self {
2571 start_info,
2572 controller,
2573
2574 } = &mut *out_;
2575 }
2576
2577 ::fidl_next::Wire::zero_padding(start_info);
2578
2579 ::fidl_next::Wire::zero_padding(controller);
2580
2581 unsafe {
2582 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
2583 }
2584 }
2585 }
2586
2587 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentRunnerStartRequest<'de>
2588 where
2589 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2590 ___D: ::fidl_next::Decoder<'de>,
2591 ___D: ::fidl_next::fuchsia::HandleDecoder,
2592 {
2593 fn decode(
2594 slot_: ::fidl_next::Slot<'_, Self>,
2595 decoder_: &mut ___D,
2596 _: (),
2597 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2598 if slot_.as_bytes()[20..24] != [0u8; 4] {
2599 return Err(::fidl_next::DecodeError::InvalidPadding);
2600 }
2601
2602 ::fidl_next::munge! {
2603 let Self {
2604 mut start_info,
2605 mut controller,
2606
2607 } = slot_;
2608 }
2609
2610 let _field = start_info.as_mut();
2611
2612 ::fidl_next::Decode::decode(start_info.as_mut(), decoder_, ())?;
2613
2614 let _field = controller.as_mut();
2615
2616 ::fidl_next::Decode::decode(controller.as_mut(), decoder_, ())?;
2617
2618 Ok(())
2619 }
2620 }
2621
2622 impl<'de> ::fidl_next::IntoNatural for ComponentRunnerStartRequest<'de> {
2623 type Natural = crate::natural::ComponentRunnerStartRequest;
2624 }
2625
2626 #[derive(Debug)]
2628 #[repr(C)]
2629 pub struct TaskProviderGetJobResponse {
2630 pub job: ::fidl_next::wire::fuchsia::Job,
2631 }
2632
2633 static_assertions::const_assert_eq!(std::mem::size_of::<TaskProviderGetJobResponse>(), 4);
2634 static_assertions::const_assert_eq!(std::mem::align_of::<TaskProviderGetJobResponse>(), 4);
2635
2636 static_assertions::const_assert_eq!(std::mem::offset_of!(TaskProviderGetJobResponse, job), 0);
2637
2638 impl ::fidl_next::Constrained for TaskProviderGetJobResponse {
2639 type Constraint = ();
2640
2641 fn validate(
2642 _: ::fidl_next::Slot<'_, Self>,
2643 _: Self::Constraint,
2644 ) -> Result<(), ::fidl_next::ValidationError> {
2645 Ok(())
2646 }
2647 }
2648
2649 unsafe impl ::fidl_next::Wire for TaskProviderGetJobResponse {
2650 type Narrowed<'de> = TaskProviderGetJobResponse;
2651
2652 #[inline]
2653 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2654 ::fidl_next::munge! {
2655 let Self {
2656 job,
2657
2658 } = &mut *out_;
2659 }
2660
2661 ::fidl_next::Wire::zero_padding(job);
2662 }
2663 }
2664
2665 unsafe impl<___D> ::fidl_next::Decode<___D> for TaskProviderGetJobResponse
2666 where
2667 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2668 ___D: ::fidl_next::fuchsia::HandleDecoder,
2669 {
2670 fn decode(
2671 slot_: ::fidl_next::Slot<'_, Self>,
2672 decoder_: &mut ___D,
2673 _: (),
2674 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2675 ::fidl_next::munge! {
2676 let Self {
2677 mut job,
2678
2679 } = slot_;
2680 }
2681
2682 let _field = job.as_mut();
2683
2684 ::fidl_next::Decode::decode(job.as_mut(), decoder_, ())?;
2685
2686 Ok(())
2687 }
2688 }
2689
2690 impl ::fidl_next::IntoNatural for TaskProviderGetJobResponse {
2691 type Natural = crate::natural::TaskProviderGetJobResponse;
2692 }
2693}
2694
2695pub mod wire_optional {
2696
2697 pub use fidl_next_common_fuchsia_component_runner::wire_optional::*;
2698
2699 #[repr(transparent)]
2700 pub struct Task<'de> {
2701 pub(crate) raw: ::fidl_next::wire::Union,
2702 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
2703 }
2704
2705 impl ::fidl_next::Constrained for Task<'_> {
2706 type Constraint = ();
2707
2708 fn validate(
2709 _: ::fidl_next::Slot<'_, Self>,
2710 _: Self::Constraint,
2711 ) -> Result<(), ::fidl_next::ValidationError> {
2712 Ok(())
2713 }
2714 }
2715
2716 unsafe impl ::fidl_next::Wire for Task<'static> {
2717 type Narrowed<'de> = Task<'de>;
2718
2719 #[inline]
2720 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2721 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
2722 ::fidl_next::wire::Union::zero_padding(raw);
2723 }
2724 }
2725
2726 impl<'de> Task<'de> {
2727 pub fn is_some(&self) -> bool {
2728 self.raw.is_some()
2729 }
2730
2731 pub fn is_none(&self) -> bool {
2732 self.raw.is_none()
2733 }
2734
2735 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Task<'de>> {
2736 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
2737 }
2738
2739 pub fn into_option(self) -> ::core::option::Option<crate::wire::Task<'de>> {
2740 if self.is_some() {
2741 Some(crate::wire::Task { raw: self.raw, _phantom: ::core::marker::PhantomData })
2742 } else {
2743 None
2744 }
2745 }
2746 }
2747
2748 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Task<'de>
2749 where
2750 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2751 ___D: ::fidl_next::Decoder<'de>,
2752 ___D: ::fidl_next::fuchsia::HandleDecoder,
2753 {
2754 fn decode(
2755 mut slot: ::fidl_next::Slot<'_, Self>,
2756 decoder: &mut ___D,
2757 _: (),
2758 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2759 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2760 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
2761 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Job>(
2762 raw,
2763 decoder,
2764 (),
2765 )?,
2766
2767 2 => ::fidl_next::wire::Union::decode_as::<
2768 ___D,
2769 ::fidl_next::wire::fuchsia::Process,
2770 >(raw, decoder, ())?,
2771
2772 3 => {
2773 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Thread>(
2774 raw,
2775 decoder,
2776 (),
2777 )?
2778 }
2779
2780 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
2781 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
2782 }
2783
2784 Ok(())
2785 }
2786 }
2787
2788 impl<'de> ::core::fmt::Debug for Task<'de> {
2789 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2790 self.as_ref().fmt(f)
2791 }
2792 }
2793
2794 impl<'de> ::fidl_next::IntoNatural for Task<'de> {
2795 type Natural = ::core::option::Option<crate::natural::Task>;
2796 }
2797}
2798
2799pub mod generic {
2800
2801 pub use fidl_next_common_fuchsia_component_runner::generic::*;
2802
2803 pub struct ComponentControllerOnPublishDiagnosticsRequest<T0> {
2805 pub payload: T0,
2806 }
2807
2808 unsafe impl<___E, T0>
2809 ::fidl_next::Encode<
2810 crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>,
2811 ___E,
2812 > for ComponentControllerOnPublishDiagnosticsRequest<T0>
2813 where
2814 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2815 ___E: ::fidl_next::Encoder,
2816 ___E: ::fidl_next::fuchsia::HandleEncoder,
2817 T0: ::fidl_next::Encode<crate::wire::ComponentDiagnostics<'static>, ___E>,
2818 {
2819 #[inline]
2820 fn encode(
2821 self,
2822 encoder_: &mut ___E,
2823 out_: &mut ::core::mem::MaybeUninit<
2824 crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>,
2825 >,
2826 _: (),
2827 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2828 ::fidl_next::munge! {
2829 let crate::wire::ComponentControllerOnPublishDiagnosticsRequest {
2830 payload,
2831
2832 } = out_;
2833 }
2834
2835 ::fidl_next::Encode::encode(self.payload, encoder_, payload, ())?;
2836
2837 Ok(())
2838 }
2839 }
2840
2841 pub struct ComponentRunnerStartRequest<T0, T1> {
2843 pub start_info: T0,
2844
2845 pub controller: T1,
2846 }
2847
2848 unsafe impl<___E, T0, T1>
2849 ::fidl_next::Encode<crate::wire::ComponentRunnerStartRequest<'static>, ___E>
2850 for ComponentRunnerStartRequest<T0, T1>
2851 where
2852 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2853 ___E: ::fidl_next::Encoder,
2854 ___E: ::fidl_next::fuchsia::HandleEncoder,
2855 T0: ::fidl_next::Encode<crate::wire::ComponentStartInfo<'static>, ___E>,
2856 T1: ::fidl_next::Encode<
2857 ::fidl_next::ServerEnd<
2858 crate::ComponentController,
2859 ::fidl_next::wire::fuchsia::Channel,
2860 >,
2861 ___E,
2862 >,
2863 {
2864 #[inline]
2865 fn encode(
2866 self,
2867 encoder_: &mut ___E,
2868 out_: &mut ::core::mem::MaybeUninit<crate::wire::ComponentRunnerStartRequest<'static>>,
2869 _: (),
2870 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2871 ::fidl_next::munge! {
2872 let crate::wire::ComponentRunnerStartRequest {
2873 start_info,
2874 controller,
2875
2876 } = out_;
2877 }
2878
2879 ::fidl_next::Encode::encode(self.start_info, encoder_, start_info, ())?;
2880
2881 ::fidl_next::Encode::encode(self.controller, encoder_, controller, ())?;
2882
2883 Ok(())
2884 }
2885 }
2886
2887 pub struct TaskProviderGetJobResponse<T0> {
2889 pub job: T0,
2890 }
2891
2892 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::TaskProviderGetJobResponse, ___E>
2893 for TaskProviderGetJobResponse<T0>
2894 where
2895 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2896 ___E: ::fidl_next::fuchsia::HandleEncoder,
2897 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Job, ___E>,
2898 {
2899 #[inline]
2900 fn encode(
2901 self,
2902 encoder_: &mut ___E,
2903 out_: &mut ::core::mem::MaybeUninit<crate::wire::TaskProviderGetJobResponse>,
2904 _: (),
2905 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2906 ::fidl_next::munge! {
2907 let crate::wire::TaskProviderGetJobResponse {
2908 job,
2909
2910 } = out_;
2911 }
2912
2913 ::fidl_next::Encode::encode(self.job, encoder_, job, ())?;
2914
2915 Ok(())
2916 }
2917 }
2918}
2919
2920pub use self::natural::*;
2921
2922#[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"]
2924#[derive(PartialEq, Debug)]
2925pub struct ComponentController;
2926
2927#[cfg(target_os = "fuchsia")]
2928impl ::fidl_next::HasTransport for ComponentController {
2929 type Transport = ::fidl_next::fuchsia::zx::Channel;
2930}
2931
2932pub mod component_controller {
2933 pub mod prelude {
2934 pub use crate::{
2935 ComponentController, ComponentControllerClientHandler,
2936 ComponentControllerLocalClientHandler, ComponentControllerLocalServerHandler,
2937 ComponentControllerServerHandler, component_controller,
2938 };
2939
2940 pub use crate::natural::ComponentControllerOnEscrowRequest;
2941
2942 pub use crate::natural::ComponentControllerOnPublishDiagnosticsRequest;
2943
2944 pub use crate::natural::ComponentStopInfo;
2945 }
2946
2947 pub struct Stop;
2948
2949 impl ::fidl_next::Method for Stop {
2950 const ORDINAL: u64 = 4804506821232171874;
2951 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2952 ::fidl_next::protocol::Flexibility::Strict;
2953
2954 type Protocol = crate::ComponentController;
2955
2956 type Request = ::fidl_next::wire::EmptyMessageBody;
2957 }
2958
2959 pub struct Kill;
2960
2961 impl ::fidl_next::Method for Kill {
2962 const ORDINAL: u64 = 4514346391631670964;
2963 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2964 ::fidl_next::protocol::Flexibility::Strict;
2965
2966 type Protocol = crate::ComponentController;
2967
2968 type Request = ::fidl_next::wire::EmptyMessageBody;
2969 }
2970
2971 pub struct OnPublishDiagnostics;
2972
2973 impl ::fidl_next::Method for OnPublishDiagnostics {
2974 const ORDINAL: u64 = 2240216199992207687;
2975 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2976 ::fidl_next::protocol::Flexibility::Strict;
2977
2978 type Protocol = crate::ComponentController;
2979
2980 type Request = crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>;
2981 }
2982
2983 pub struct OnEscrow;
2984
2985 impl ::fidl_next::Method for OnEscrow {
2986 const ORDINAL: u64 = 730448769712342012;
2987 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2988 ::fidl_next::protocol::Flexibility::Flexible;
2989
2990 type Protocol = crate::ComponentController;
2991
2992 type Request = crate::wire::ComponentControllerOnEscrowRequest<'static>;
2993 }
2994
2995 pub struct OnStop;
2996
2997 impl ::fidl_next::Method for OnStop {
2998 const ORDINAL: u64 = 4322651556509354674;
2999 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3000 ::fidl_next::protocol::Flexibility::Flexible;
3001
3002 type Protocol = crate::ComponentController;
3003
3004 type Request = crate::wire::ComponentStopInfo<'static>;
3005 }
3006
3007 mod ___detail {
3008 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ComponentController
3009 where
3010 ___T: ::fidl_next::Transport,
3011 {
3012 type Client = ComponentControllerClient<___T>;
3013 type Server = ComponentControllerServer<___T>;
3014 }
3015
3016 #[repr(transparent)]
3018 pub struct ComponentControllerClient<___T: ::fidl_next::Transport> {
3019 #[allow(dead_code)]
3020 client: ::fidl_next::protocol::Client<___T>,
3021 }
3022
3023 impl<___T> ComponentControllerClient<___T>
3024 where
3025 ___T: ::fidl_next::Transport,
3026 {
3027 #[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"]
3028 pub fn stop(&self) -> ::fidl_next::SendFuture<'_, ___T> {
3029 ::fidl_next::SendFuture::from_untyped(
3030 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
3031 4804506821232171874,
3032 <super::Stop as ::fidl_next::Method>::FLEXIBILITY,
3033 (),
3034 ),
3035 )
3036 }
3037
3038 #[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"]
3039 pub fn kill(&self) -> ::fidl_next::SendFuture<'_, ___T> {
3040 ::fidl_next::SendFuture::from_untyped(
3041 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
3042 4514346391631670964,
3043 <super::Kill as ::fidl_next::Method>::FLEXIBILITY,
3044 (),
3045 ),
3046 )
3047 }
3048 }
3049
3050 #[repr(transparent)]
3052 pub struct ComponentControllerServer<___T: ::fidl_next::Transport> {
3053 server: ::fidl_next::protocol::Server<___T>,
3054 }
3055
3056 impl<___T> ComponentControllerServer<___T>
3057 where
3058 ___T: ::fidl_next::Transport,
3059 {
3060 #[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"]
3061 pub fn on_publish_diagnostics(
3062 &self,
3063
3064 payload: impl ::fidl_next::Encode<
3065 crate::wire::ComponentDiagnostics<'static>,
3066 <___T as ::fidl_next::Transport>::SendBuffer,
3067 >,
3068 ) -> ::fidl_next::SendFuture<'_, ___T>
3069 where
3070 <___T as ::fidl_next::Transport>::SendBuffer:
3071 ::fidl_next::encoder::InternalHandleEncoder,
3072 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3073 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3074 {
3075 self.on_publish_diagnostics_with(
3076 crate::generic::ComponentControllerOnPublishDiagnosticsRequest { payload },
3077 )
3078 }
3079
3080 #[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"]
3081
3082 pub fn on_publish_diagnostics_with<___R>(
3083 &self,
3084 request: ___R,
3085 ) -> ::fidl_next::SendFuture<'_, ___T>
3086 where
3087 ___R: ::fidl_next::Encode<
3088 <super::OnPublishDiagnostics as ::fidl_next::Method>::Request,
3089 <___T as ::fidl_next::Transport>::SendBuffer,
3090 >,
3091 {
3092 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3093 2240216199992207687,
3094 <super::OnPublishDiagnostics as ::fidl_next::Method>::FLEXIBILITY,
3095 request,
3096 ))
3097 }
3098
3099 #[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"]
3100
3101 pub fn on_escrow_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3102 where
3103 ___R: ::fidl_next::Encode<
3104 <super::OnEscrow as ::fidl_next::Method>::Request,
3105 <___T as ::fidl_next::Transport>::SendBuffer,
3106 >,
3107 {
3108 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3109 730448769712342012,
3110 <super::OnEscrow as ::fidl_next::Method>::FLEXIBILITY,
3111 request,
3112 ))
3113 }
3114
3115 #[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"]
3116
3117 pub fn on_stop_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3118 where
3119 ___R: ::fidl_next::Encode<
3120 <super::OnStop as ::fidl_next::Method>::Request,
3121 <___T as ::fidl_next::Transport>::SendBuffer,
3122 >,
3123 {
3124 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3125 4322651556509354674,
3126 <super::OnStop as ::fidl_next::Method>::FLEXIBILITY,
3127 request,
3128 ))
3129 }
3130 }
3131 }
3132}
3133
3134#[diagnostic::on_unimplemented(
3135 note = "If {Self} implements the non-local ComponentControllerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3136)]
3137
3138pub trait ComponentControllerLocalClientHandler<
3142 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3143 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3144>
3145{
3146 #[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"]
3147 fn on_publish_diagnostics(
3148 &mut self,
3149
3150 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3151 ) -> impl ::core::future::Future<Output = ()>;
3152
3153 #[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"]
3154 fn on_escrow(
3155 &mut self,
3156
3157 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3158 ) -> impl ::core::future::Future<Output = ()>;
3159
3160 #[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"]
3161 fn on_stop(
3162 &mut self,
3163
3164 request: ::fidl_next::Request<component_controller::OnStop, ___T>,
3165 ) -> impl ::core::future::Future<Output = ()>;
3166
3167 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3168 ::core::future::ready(())
3169 }
3170}
3171
3172impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ComponentController
3173where
3174 ___H: ComponentControllerLocalClientHandler<___T>,
3175 ___T: ::fidl_next::Transport,
3176 for<'de> crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'de>: ::fidl_next::Decode<
3177 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3178 Constraint = (),
3179 >,
3180 for<'de> crate::wire::ComponentControllerOnEscrowRequest<'de>: ::fidl_next::Decode<
3181 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3182 Constraint = (),
3183 >,
3184 for<'de> crate::wire::ComponentStopInfo<'de>: ::fidl_next::Decode<
3185 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3186 Constraint = (),
3187 >,
3188{
3189 async fn on_event(
3190 handler: &mut ___H,
3191 mut message: ::fidl_next::Message<___T>,
3192 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3193 match *message.header().ordinal {
3194 2240216199992207687 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3195 Ok(decoded) => {
3196 handler
3197 .on_publish_diagnostics(::fidl_next::Request::from_decoded(decoded))
3198 .await;
3199 Ok(())
3200 }
3201 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3202 ordinal: 2240216199992207687,
3203 error,
3204 }),
3205 },
3206
3207 730448769712342012 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3208 Ok(decoded) => {
3209 handler.on_escrow(::fidl_next::Request::from_decoded(decoded)).await;
3210 Ok(())
3211 }
3212 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3213 ordinal: 730448769712342012,
3214 error,
3215 }),
3216 },
3217
3218 4322651556509354674 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3219 Ok(decoded) => {
3220 handler.on_stop(::fidl_next::Request::from_decoded(decoded)).await;
3221 Ok(())
3222 }
3223 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3224 ordinal: 4322651556509354674,
3225 error,
3226 }),
3227 },
3228
3229 ordinal => {
3230 handler.on_unknown_interaction(ordinal).await;
3231 if ::core::matches!(
3232 message.header().flexibility(),
3233 ::fidl_next::protocol::Flexibility::Strict
3234 ) {
3235 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3236 } else {
3237 Ok(())
3238 }
3239 }
3240 }
3241 }
3242}
3243
3244#[diagnostic::on_unimplemented(
3245 note = "If {Self} implements the non-local ComponentControllerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3246)]
3247
3248pub trait ComponentControllerLocalServerHandler<
3252 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3253 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3254>
3255{
3256 #[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"]
3257 fn stop(&mut self) -> impl ::core::future::Future<Output = ()>;
3258
3259 #[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"]
3260 fn kill(&mut self) -> impl ::core::future::Future<Output = ()>;
3261
3262 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3263 ::core::future::ready(())
3264 }
3265}
3266
3267impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ComponentController
3268where
3269 ___H: ComponentControllerLocalServerHandler<___T>,
3270 ___T: ::fidl_next::Transport,
3271{
3272 async fn on_one_way(
3273 handler: &mut ___H,
3274 mut message: ::fidl_next::Message<___T>,
3275 ) -> ::core::result::Result<
3276 (),
3277 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3278 > {
3279 match *message.header().ordinal {
3280 4804506821232171874 => {
3281 handler.stop().await;
3282 Ok(())
3283 }
3284
3285 4514346391631670964 => {
3286 handler.kill().await;
3287 Ok(())
3288 }
3289
3290 ordinal => {
3291 handler.on_unknown_interaction(ordinal).await;
3292 if ::core::matches!(
3293 message.header().flexibility(),
3294 ::fidl_next::protocol::Flexibility::Strict
3295 ) {
3296 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3297 } else {
3298 Ok(())
3299 }
3300 }
3301 }
3302 }
3303
3304 async fn on_two_way(
3305 handler: &mut ___H,
3306 mut message: ::fidl_next::Message<___T>,
3307 responder: ::fidl_next::protocol::Responder<___T>,
3308 ) -> ::core::result::Result<
3309 (),
3310 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3311 > {
3312 match *message.header().ordinal {
3313 ordinal => {
3314 handler.on_unknown_interaction(ordinal).await;
3315 if ::core::matches!(
3316 message.header().flexibility(),
3317 ::fidl_next::protocol::Flexibility::Strict
3318 ) {
3319 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3320 } else {
3321 responder
3322 .respond_framework_error(
3323 ordinal,
3324 ::fidl_next::FrameworkError::UnknownMethod,
3325 )
3326 .expect("encoding a framework error should never fail")
3327 .await?;
3328 Ok(())
3329 }
3330 }
3331 }
3332 }
3333}
3334
3335pub trait ComponentControllerClientHandler<
3339 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3340 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3341>
3342{
3343 #[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"]
3344 fn on_publish_diagnostics(
3345 &mut self,
3346
3347 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3348 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3349
3350 #[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"]
3351 fn on_escrow(
3352 &mut self,
3353
3354 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3355 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3356
3357 #[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"]
3358 fn on_stop(
3359 &mut self,
3360
3361 request: ::fidl_next::Request<component_controller::OnStop, ___T>,
3362 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3363
3364 fn on_unknown_interaction(
3365 &mut self,
3366 ordinal: u64,
3367 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3368 ::core::future::ready(())
3369 }
3370}
3371
3372impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ComponentController
3373where
3374 ___H: ComponentControllerClientHandler<___T> + ::core::marker::Send,
3375 ___T: ::fidl_next::Transport,
3376 for<'de> crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'de>: ::fidl_next::Decode<
3377 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3378 Constraint = (),
3379 >,
3380 for<'de> crate::wire::ComponentControllerOnEscrowRequest<'de>: ::fidl_next::Decode<
3381 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3382 Constraint = (),
3383 >,
3384 for<'de> crate::wire::ComponentStopInfo<'de>: ::fidl_next::Decode<
3385 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3386 Constraint = (),
3387 >,
3388{
3389 async fn on_event(
3390 handler: &mut ___H,
3391 mut message: ::fidl_next::Message<___T>,
3392 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3393 match *message.header().ordinal {
3394 2240216199992207687 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3395 Ok(decoded) => {
3396 handler
3397 .on_publish_diagnostics(::fidl_next::Request::from_decoded(decoded))
3398 .await;
3399 Ok(())
3400 }
3401 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3402 ordinal: 2240216199992207687,
3403 error,
3404 }),
3405 },
3406
3407 730448769712342012 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3408 Ok(decoded) => {
3409 handler.on_escrow(::fidl_next::Request::from_decoded(decoded)).await;
3410 Ok(())
3411 }
3412 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3413 ordinal: 730448769712342012,
3414 error,
3415 }),
3416 },
3417
3418 4322651556509354674 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3419 Ok(decoded) => {
3420 handler.on_stop(::fidl_next::Request::from_decoded(decoded)).await;
3421 Ok(())
3422 }
3423 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3424 ordinal: 4322651556509354674,
3425 error,
3426 }),
3427 },
3428
3429 ordinal => {
3430 handler.on_unknown_interaction(ordinal).await;
3431 if ::core::matches!(
3432 message.header().flexibility(),
3433 ::fidl_next::protocol::Flexibility::Strict
3434 ) {
3435 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3436 } else {
3437 Ok(())
3438 }
3439 }
3440 }
3441 }
3442}
3443
3444pub trait ComponentControllerServerHandler<
3448 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3449 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3450>
3451{
3452 #[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"]
3453 fn stop(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3454
3455 #[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"]
3456 fn kill(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3457
3458 fn on_unknown_interaction(
3459 &mut self,
3460 ordinal: u64,
3461 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3462 ::core::future::ready(())
3463 }
3464}
3465
3466impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ComponentController
3467where
3468 ___H: ComponentControllerServerHandler<___T> + ::core::marker::Send,
3469 ___T: ::fidl_next::Transport,
3470{
3471 async fn on_one_way(
3472 handler: &mut ___H,
3473 mut message: ::fidl_next::Message<___T>,
3474 ) -> ::core::result::Result<
3475 (),
3476 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3477 > {
3478 match *message.header().ordinal {
3479 4804506821232171874 => {
3480 handler.stop().await;
3481 Ok(())
3482 }
3483
3484 4514346391631670964 => {
3485 handler.kill().await;
3486 Ok(())
3487 }
3488
3489 ordinal => {
3490 handler.on_unknown_interaction(ordinal).await;
3491 if ::core::matches!(
3492 message.header().flexibility(),
3493 ::fidl_next::protocol::Flexibility::Strict
3494 ) {
3495 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3496 } else {
3497 Ok(())
3498 }
3499 }
3500 }
3501 }
3502
3503 async fn on_two_way(
3504 handler: &mut ___H,
3505 mut message: ::fidl_next::Message<___T>,
3506 responder: ::fidl_next::protocol::Responder<___T>,
3507 ) -> ::core::result::Result<
3508 (),
3509 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3510 > {
3511 match *message.header().ordinal {
3512 ordinal => {
3513 handler.on_unknown_interaction(ordinal).await;
3514 if ::core::matches!(
3515 message.header().flexibility(),
3516 ::fidl_next::protocol::Flexibility::Strict
3517 ) {
3518 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3519 } else {
3520 responder
3521 .respond_framework_error(
3522 ordinal,
3523 ::fidl_next::FrameworkError::UnknownMethod,
3524 )
3525 .expect("encoding a framework error should never fail")
3526 .await?;
3527 Ok(())
3528 }
3529 }
3530 }
3531 }
3532}
3533
3534impl<___T> ComponentControllerClientHandler<___T> for ::fidl_next::IgnoreEvents
3535where
3536 ___T: ::fidl_next::Transport,
3537{
3538 async fn on_publish_diagnostics(
3539 &mut self,
3540
3541 _: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3542 ) {
3543 }
3544
3545 async fn on_escrow(&mut self, _: ::fidl_next::Request<component_controller::OnEscrow, ___T>) {}
3546
3547 async fn on_stop(&mut self, _: ::fidl_next::Request<component_controller::OnStop, ___T>) {}
3548
3549 async fn on_unknown_interaction(&mut self, _: u64) {}
3550}
3551
3552impl<___H, ___T> ComponentControllerLocalClientHandler<___T> for ::fidl_next::Local<___H>
3553where
3554 ___H: ComponentControllerClientHandler<___T>,
3555 ___T: ::fidl_next::Transport,
3556{
3557 async fn on_publish_diagnostics(
3558 &mut self,
3559
3560 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3561 ) {
3562 ___H::on_publish_diagnostics(&mut self.0, request).await
3563 }
3564
3565 async fn on_escrow(
3566 &mut self,
3567
3568 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3569 ) {
3570 ___H::on_escrow(&mut self.0, request).await
3571 }
3572
3573 async fn on_stop(&mut self, request: ::fidl_next::Request<component_controller::OnStop, ___T>) {
3574 ___H::on_stop(&mut self.0, request).await
3575 }
3576
3577 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3578 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3579 }
3580}
3581
3582impl<___H, ___T> ComponentControllerLocalServerHandler<___T> for ::fidl_next::Local<___H>
3583where
3584 ___H: ComponentControllerServerHandler<___T>,
3585 ___T: ::fidl_next::Transport,
3586{
3587 async fn stop(&mut self) {
3588 ___H::stop(&mut self.0).await
3589 }
3590
3591 async fn kill(&mut self) {
3592 ___H::kill(&mut self.0).await
3593 }
3594
3595 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3596 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3597 }
3598}
3599
3600#[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"]
3602#[derive(PartialEq, Debug)]
3603pub struct ComponentRunner;
3604
3605impl ::fidl_next::Discoverable for ComponentRunner {
3606 const PROTOCOL_NAME: &'static str = "fuchsia.component.runner.ComponentRunner";
3607}
3608
3609#[cfg(target_os = "fuchsia")]
3610impl ::fidl_next::HasTransport for ComponentRunner {
3611 type Transport = ::fidl_next::fuchsia::zx::Channel;
3612}
3613
3614pub mod component_runner {
3615 pub mod prelude {
3616 pub use crate::{
3617 ComponentRunner, ComponentRunnerClientHandler, ComponentRunnerLocalClientHandler,
3618 ComponentRunnerLocalServerHandler, ComponentRunnerServerHandler, component_runner,
3619 };
3620
3621 pub use crate::natural::ComponentRunnerStartRequest;
3622 }
3623
3624 pub struct Start;
3625
3626 impl ::fidl_next::Method for Start {
3627 const ORDINAL: u64 = 780715659970866697;
3628 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3629 ::fidl_next::protocol::Flexibility::Strict;
3630
3631 type Protocol = crate::ComponentRunner;
3632
3633 type Request = crate::wire::ComponentRunnerStartRequest<'static>;
3634 }
3635
3636 mod ___detail {
3637 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ComponentRunner
3638 where
3639 ___T: ::fidl_next::Transport,
3640 {
3641 type Client = ComponentRunnerClient<___T>;
3642 type Server = ComponentRunnerServer<___T>;
3643 }
3644
3645 #[repr(transparent)]
3647 pub struct ComponentRunnerClient<___T: ::fidl_next::Transport> {
3648 #[allow(dead_code)]
3649 client: ::fidl_next::protocol::Client<___T>,
3650 }
3651
3652 impl<___T> ComponentRunnerClient<___T>
3653 where
3654 ___T: ::fidl_next::Transport,
3655 {
3656 #[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"]
3657 pub fn start(
3658 &self,
3659
3660 start_info: impl ::fidl_next::Encode<
3661 crate::wire::ComponentStartInfo<'static>,
3662 <___T as ::fidl_next::Transport>::SendBuffer,
3663 >,
3664
3665 controller: impl ::fidl_next::Encode<
3666 ::fidl_next::ServerEnd<
3667 crate::ComponentController,
3668 ::fidl_next::wire::fuchsia::Channel,
3669 >,
3670 <___T as ::fidl_next::Transport>::SendBuffer,
3671 >,
3672 ) -> ::fidl_next::SendFuture<'_, ___T>
3673 where
3674 <___T as ::fidl_next::Transport>::SendBuffer:
3675 ::fidl_next::encoder::InternalHandleEncoder,
3676 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3677 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3678 {
3679 self.start_with(crate::generic::ComponentRunnerStartRequest {
3680 start_info,
3681
3682 controller,
3683 })
3684 }
3685
3686 #[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"]
3687 pub fn start_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3688 where
3689 ___R: ::fidl_next::Encode<
3690 crate::wire::ComponentRunnerStartRequest<'static>,
3691 <___T as ::fidl_next::Transport>::SendBuffer,
3692 >,
3693 {
3694 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3695 780715659970866697,
3696 <super::Start as ::fidl_next::Method>::FLEXIBILITY,
3697 request,
3698 ))
3699 }
3700 }
3701
3702 #[repr(transparent)]
3704 pub struct ComponentRunnerServer<___T: ::fidl_next::Transport> {
3705 server: ::fidl_next::protocol::Server<___T>,
3706 }
3707
3708 impl<___T> ComponentRunnerServer<___T> where ___T: ::fidl_next::Transport {}
3709 }
3710}
3711
3712#[diagnostic::on_unimplemented(
3713 note = "If {Self} implements the non-local ComponentRunnerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3714)]
3715
3716pub trait ComponentRunnerLocalClientHandler<
3720 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3721 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3722>
3723{
3724 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3725 ::core::future::ready(())
3726 }
3727}
3728
3729impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ComponentRunner
3730where
3731 ___H: ComponentRunnerLocalClientHandler<___T>,
3732 ___T: ::fidl_next::Transport,
3733{
3734 async fn on_event(
3735 handler: &mut ___H,
3736 mut message: ::fidl_next::Message<___T>,
3737 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3738 match *message.header().ordinal {
3739 ordinal => {
3740 handler.on_unknown_interaction(ordinal).await;
3741 if ::core::matches!(
3742 message.header().flexibility(),
3743 ::fidl_next::protocol::Flexibility::Strict
3744 ) {
3745 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3746 } else {
3747 Ok(())
3748 }
3749 }
3750 }
3751 }
3752}
3753
3754#[diagnostic::on_unimplemented(
3755 note = "If {Self} implements the non-local ComponentRunnerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3756)]
3757
3758pub trait ComponentRunnerLocalServerHandler<
3762 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3763 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3764>
3765{
3766 #[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"]
3767 fn start(
3768 &mut self,
3769
3770 request: ::fidl_next::Request<component_runner::Start, ___T>,
3771 ) -> impl ::core::future::Future<Output = ()>;
3772
3773 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3774 ::core::future::ready(())
3775 }
3776}
3777
3778impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ComponentRunner
3779where
3780 ___H: ComponentRunnerLocalServerHandler<___T>,
3781 ___T: ::fidl_next::Transport,
3782 for<'de> crate::wire::ComponentRunnerStartRequest<'de>: ::fidl_next::Decode<
3783 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3784 Constraint = (),
3785 >,
3786{
3787 async fn on_one_way(
3788 handler: &mut ___H,
3789 mut message: ::fidl_next::Message<___T>,
3790 ) -> ::core::result::Result<
3791 (),
3792 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3793 > {
3794 match *message.header().ordinal {
3795 780715659970866697 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3796 Ok(decoded) => {
3797 handler.start(::fidl_next::Request::from_decoded(decoded)).await;
3798 Ok(())
3799 }
3800 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3801 ordinal: 780715659970866697,
3802 error,
3803 }),
3804 },
3805
3806 ordinal => {
3807 handler.on_unknown_interaction(ordinal).await;
3808 if ::core::matches!(
3809 message.header().flexibility(),
3810 ::fidl_next::protocol::Flexibility::Strict
3811 ) {
3812 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3813 } else {
3814 Ok(())
3815 }
3816 }
3817 }
3818 }
3819
3820 async fn on_two_way(
3821 handler: &mut ___H,
3822 mut message: ::fidl_next::Message<___T>,
3823 responder: ::fidl_next::protocol::Responder<___T>,
3824 ) -> ::core::result::Result<
3825 (),
3826 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3827 > {
3828 match *message.header().ordinal {
3829 ordinal => {
3830 handler.on_unknown_interaction(ordinal).await;
3831 if ::core::matches!(
3832 message.header().flexibility(),
3833 ::fidl_next::protocol::Flexibility::Strict
3834 ) {
3835 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3836 } else {
3837 responder
3838 .respond_framework_error(
3839 ordinal,
3840 ::fidl_next::FrameworkError::UnknownMethod,
3841 )
3842 .expect("encoding a framework error should never fail")
3843 .await?;
3844 Ok(())
3845 }
3846 }
3847 }
3848 }
3849}
3850
3851pub trait ComponentRunnerClientHandler<
3855 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3856 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3857>
3858{
3859 fn on_unknown_interaction(
3860 &mut self,
3861 ordinal: u64,
3862 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3863 ::core::future::ready(())
3864 }
3865}
3866
3867impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ComponentRunner
3868where
3869 ___H: ComponentRunnerClientHandler<___T> + ::core::marker::Send,
3870 ___T: ::fidl_next::Transport,
3871{
3872 async fn on_event(
3873 handler: &mut ___H,
3874 mut message: ::fidl_next::Message<___T>,
3875 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3876 match *message.header().ordinal {
3877 ordinal => {
3878 handler.on_unknown_interaction(ordinal).await;
3879 if ::core::matches!(
3880 message.header().flexibility(),
3881 ::fidl_next::protocol::Flexibility::Strict
3882 ) {
3883 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3884 } else {
3885 Ok(())
3886 }
3887 }
3888 }
3889 }
3890}
3891
3892pub trait ComponentRunnerServerHandler<
3896 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3897 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3898>
3899{
3900 #[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"]
3901 fn start(
3902 &mut self,
3903
3904 request: ::fidl_next::Request<component_runner::Start, ___T>,
3905 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3906
3907 fn on_unknown_interaction(
3908 &mut self,
3909 ordinal: u64,
3910 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3911 ::core::future::ready(())
3912 }
3913}
3914
3915impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ComponentRunner
3916where
3917 ___H: ComponentRunnerServerHandler<___T> + ::core::marker::Send,
3918 ___T: ::fidl_next::Transport,
3919 for<'de> crate::wire::ComponentRunnerStartRequest<'de>: ::fidl_next::Decode<
3920 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3921 Constraint = (),
3922 >,
3923{
3924 async fn on_one_way(
3925 handler: &mut ___H,
3926 mut message: ::fidl_next::Message<___T>,
3927 ) -> ::core::result::Result<
3928 (),
3929 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3930 > {
3931 match *message.header().ordinal {
3932 780715659970866697 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3933 Ok(decoded) => {
3934 handler.start(::fidl_next::Request::from_decoded(decoded)).await;
3935 Ok(())
3936 }
3937 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3938 ordinal: 780715659970866697,
3939 error,
3940 }),
3941 },
3942
3943 ordinal => {
3944 handler.on_unknown_interaction(ordinal).await;
3945 if ::core::matches!(
3946 message.header().flexibility(),
3947 ::fidl_next::protocol::Flexibility::Strict
3948 ) {
3949 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3950 } else {
3951 Ok(())
3952 }
3953 }
3954 }
3955 }
3956
3957 async fn on_two_way(
3958 handler: &mut ___H,
3959 mut message: ::fidl_next::Message<___T>,
3960 responder: ::fidl_next::protocol::Responder<___T>,
3961 ) -> ::core::result::Result<
3962 (),
3963 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3964 > {
3965 match *message.header().ordinal {
3966 ordinal => {
3967 handler.on_unknown_interaction(ordinal).await;
3968 if ::core::matches!(
3969 message.header().flexibility(),
3970 ::fidl_next::protocol::Flexibility::Strict
3971 ) {
3972 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3973 } else {
3974 responder
3975 .respond_framework_error(
3976 ordinal,
3977 ::fidl_next::FrameworkError::UnknownMethod,
3978 )
3979 .expect("encoding a framework error should never fail")
3980 .await?;
3981 Ok(())
3982 }
3983 }
3984 }
3985 }
3986}
3987
3988impl<___T> ComponentRunnerClientHandler<___T> for ::fidl_next::IgnoreEvents
3989where
3990 ___T: ::fidl_next::Transport,
3991{
3992 async fn on_unknown_interaction(&mut self, _: u64) {}
3993}
3994
3995impl<___H, ___T> ComponentRunnerLocalClientHandler<___T> for ::fidl_next::Local<___H>
3996where
3997 ___H: ComponentRunnerClientHandler<___T>,
3998 ___T: ::fidl_next::Transport,
3999{
4000 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4001 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4002 }
4003}
4004
4005impl<___H, ___T> ComponentRunnerLocalServerHandler<___T> for ::fidl_next::Local<___H>
4006where
4007 ___H: ComponentRunnerServerHandler<___T>,
4008 ___T: ::fidl_next::Transport,
4009{
4010 async fn start(&mut self, request: ::fidl_next::Request<component_runner::Start, ___T>) {
4011 ___H::start(&mut self.0, request).await
4012 }
4013
4014 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4015 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4016 }
4017}
4018
4019#[doc = " Served by runners that want to make a zircon job available through their runtime directory.\n"]
4021#[derive(PartialEq, Debug)]
4022pub struct TaskProvider;
4023
4024impl ::fidl_next::Discoverable for TaskProvider {
4025 const PROTOCOL_NAME: &'static str = "fuchsia.component.runner.TaskProvider";
4026}
4027
4028#[cfg(target_os = "fuchsia")]
4029impl ::fidl_next::HasTransport for TaskProvider {
4030 type Transport = ::fidl_next::fuchsia::zx::Channel;
4031}
4032
4033pub mod task_provider {
4034 pub mod prelude {
4035 pub use crate::{
4036 TaskProvider, TaskProviderClientHandler, TaskProviderLocalClientHandler,
4037 TaskProviderLocalServerHandler, TaskProviderServerHandler, task_provider,
4038 };
4039
4040 pub use crate::natural::TaskProviderGetJobResponse;
4041 }
4042
4043 pub struct GetJob;
4044
4045 impl ::fidl_next::Method for GetJob {
4046 const ORDINAL: u64 = 5520468615388521389;
4047 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4048 ::fidl_next::protocol::Flexibility::Strict;
4049
4050 type Protocol = crate::TaskProvider;
4051
4052 type Request = ::fidl_next::wire::EmptyMessageBody;
4053 }
4054
4055 impl ::fidl_next::TwoWayMethod for GetJob {
4056 type Response = ::fidl_next::wire::Result<
4057 'static,
4058 crate::wire::TaskProviderGetJobResponse,
4059 ::fidl_next::wire::fuchsia::Status,
4060 >;
4061 }
4062
4063 impl<___R> ::fidl_next::Respond<___R> for GetJob {
4064 type Output = ::core::result::Result<
4065 crate::generic::TaskProviderGetJobResponse<___R>,
4066 ::fidl_next::util::Never,
4067 >;
4068
4069 fn respond(response: ___R) -> Self::Output {
4070 ::core::result::Result::Ok(crate::generic::TaskProviderGetJobResponse { job: response })
4071 }
4072 }
4073
4074 impl<___R> ::fidl_next::RespondErr<___R> for GetJob {
4075 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
4076
4077 fn respond_err(response: ___R) -> Self::Output {
4078 ::core::result::Result::Err(response)
4079 }
4080 }
4081
4082 mod ___detail {
4083 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::TaskProvider
4084 where
4085 ___T: ::fidl_next::Transport,
4086 {
4087 type Client = TaskProviderClient<___T>;
4088 type Server = TaskProviderServer<___T>;
4089 }
4090
4091 #[repr(transparent)]
4093 pub struct TaskProviderClient<___T: ::fidl_next::Transport> {
4094 #[allow(dead_code)]
4095 client: ::fidl_next::protocol::Client<___T>,
4096 }
4097
4098 impl<___T> TaskProviderClient<___T>
4099 where
4100 ___T: ::fidl_next::Transport,
4101 {
4102 #[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"]
4103 pub fn get_job(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetJob, ___T> {
4104 ::fidl_next::TwoWayFuture::from_untyped(
4105 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4106 5520468615388521389,
4107 <super::GetJob as ::fidl_next::Method>::FLEXIBILITY,
4108 (),
4109 ),
4110 )
4111 }
4112 }
4113
4114 #[repr(transparent)]
4116 pub struct TaskProviderServer<___T: ::fidl_next::Transport> {
4117 server: ::fidl_next::protocol::Server<___T>,
4118 }
4119
4120 impl<___T> TaskProviderServer<___T> where ___T: ::fidl_next::Transport {}
4121 }
4122}
4123
4124#[diagnostic::on_unimplemented(
4125 note = "If {Self} implements the non-local TaskProviderClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4126)]
4127
4128pub trait TaskProviderLocalClientHandler<
4132 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4133 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4134>
4135{
4136 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4137 ::core::future::ready(())
4138 }
4139}
4140
4141impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for TaskProvider
4142where
4143 ___H: TaskProviderLocalClientHandler<___T>,
4144 ___T: ::fidl_next::Transport,
4145{
4146 async fn on_event(
4147 handler: &mut ___H,
4148 mut message: ::fidl_next::Message<___T>,
4149 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4150 match *message.header().ordinal {
4151 ordinal => {
4152 handler.on_unknown_interaction(ordinal).await;
4153 if ::core::matches!(
4154 message.header().flexibility(),
4155 ::fidl_next::protocol::Flexibility::Strict
4156 ) {
4157 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4158 } else {
4159 Ok(())
4160 }
4161 }
4162 }
4163 }
4164}
4165
4166#[diagnostic::on_unimplemented(
4167 note = "If {Self} implements the non-local TaskProviderServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4168)]
4169
4170pub trait TaskProviderLocalServerHandler<
4174 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4175 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4176>
4177{
4178 #[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"]
4179 fn get_job(
4180 &mut self,
4181
4182 responder: ::fidl_next::Responder<task_provider::GetJob, ___T>,
4183 ) -> impl ::core::future::Future<Output = ()>;
4184
4185 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4186 ::core::future::ready(())
4187 }
4188}
4189
4190impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for TaskProvider
4191where
4192 ___H: TaskProviderLocalServerHandler<___T>,
4193 ___T: ::fidl_next::Transport,
4194{
4195 async fn on_one_way(
4196 handler: &mut ___H,
4197 mut message: ::fidl_next::Message<___T>,
4198 ) -> ::core::result::Result<
4199 (),
4200 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4201 > {
4202 match *message.header().ordinal {
4203 ordinal => {
4204 handler.on_unknown_interaction(ordinal).await;
4205 if ::core::matches!(
4206 message.header().flexibility(),
4207 ::fidl_next::protocol::Flexibility::Strict
4208 ) {
4209 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4210 } else {
4211 Ok(())
4212 }
4213 }
4214 }
4215 }
4216
4217 async fn on_two_way(
4218 handler: &mut ___H,
4219 mut message: ::fidl_next::Message<___T>,
4220 responder: ::fidl_next::protocol::Responder<___T>,
4221 ) -> ::core::result::Result<
4222 (),
4223 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4224 > {
4225 match *message.header().ordinal {
4226 5520468615388521389 => {
4227 let responder = ::fidl_next::Responder::from_untyped(responder);
4228
4229 handler.get_job(responder).await;
4230 Ok(())
4231 }
4232
4233 ordinal => {
4234 handler.on_unknown_interaction(ordinal).await;
4235 if ::core::matches!(
4236 message.header().flexibility(),
4237 ::fidl_next::protocol::Flexibility::Strict
4238 ) {
4239 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4240 } else {
4241 responder
4242 .respond_framework_error(
4243 ordinal,
4244 ::fidl_next::FrameworkError::UnknownMethod,
4245 )
4246 .expect("encoding a framework error should never fail")
4247 .await?;
4248 Ok(())
4249 }
4250 }
4251 }
4252 }
4253}
4254
4255pub trait TaskProviderClientHandler<
4259 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4260 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4261>
4262{
4263 fn on_unknown_interaction(
4264 &mut self,
4265 ordinal: u64,
4266 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4267 ::core::future::ready(())
4268 }
4269}
4270
4271impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for TaskProvider
4272where
4273 ___H: TaskProviderClientHandler<___T> + ::core::marker::Send,
4274 ___T: ::fidl_next::Transport,
4275{
4276 async fn on_event(
4277 handler: &mut ___H,
4278 mut message: ::fidl_next::Message<___T>,
4279 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4280 match *message.header().ordinal {
4281 ordinal => {
4282 handler.on_unknown_interaction(ordinal).await;
4283 if ::core::matches!(
4284 message.header().flexibility(),
4285 ::fidl_next::protocol::Flexibility::Strict
4286 ) {
4287 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4288 } else {
4289 Ok(())
4290 }
4291 }
4292 }
4293 }
4294}
4295
4296pub trait TaskProviderServerHandler<
4300 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4301 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4302>
4303{
4304 #[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"]
4305 fn get_job(
4306 &mut self,
4307
4308 responder: ::fidl_next::Responder<task_provider::GetJob, ___T>,
4309 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4310
4311 fn on_unknown_interaction(
4312 &mut self,
4313 ordinal: u64,
4314 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4315 ::core::future::ready(())
4316 }
4317}
4318
4319impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for TaskProvider
4320where
4321 ___H: TaskProviderServerHandler<___T> + ::core::marker::Send,
4322 ___T: ::fidl_next::Transport,
4323{
4324 async fn on_one_way(
4325 handler: &mut ___H,
4326 mut message: ::fidl_next::Message<___T>,
4327 ) -> ::core::result::Result<
4328 (),
4329 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4330 > {
4331 match *message.header().ordinal {
4332 ordinal => {
4333 handler.on_unknown_interaction(ordinal).await;
4334 if ::core::matches!(
4335 message.header().flexibility(),
4336 ::fidl_next::protocol::Flexibility::Strict
4337 ) {
4338 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4339 } else {
4340 Ok(())
4341 }
4342 }
4343 }
4344 }
4345
4346 async fn on_two_way(
4347 handler: &mut ___H,
4348 mut message: ::fidl_next::Message<___T>,
4349 responder: ::fidl_next::protocol::Responder<___T>,
4350 ) -> ::core::result::Result<
4351 (),
4352 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4353 > {
4354 match *message.header().ordinal {
4355 5520468615388521389 => {
4356 let responder = ::fidl_next::Responder::from_untyped(responder);
4357
4358 handler.get_job(responder).await;
4359 Ok(())
4360 }
4361
4362 ordinal => {
4363 handler.on_unknown_interaction(ordinal).await;
4364 if ::core::matches!(
4365 message.header().flexibility(),
4366 ::fidl_next::protocol::Flexibility::Strict
4367 ) {
4368 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4369 } else {
4370 responder
4371 .respond_framework_error(
4372 ordinal,
4373 ::fidl_next::FrameworkError::UnknownMethod,
4374 )
4375 .expect("encoding a framework error should never fail")
4376 .await?;
4377 Ok(())
4378 }
4379 }
4380 }
4381 }
4382}
4383
4384impl<___T> TaskProviderClientHandler<___T> for ::fidl_next::IgnoreEvents
4385where
4386 ___T: ::fidl_next::Transport,
4387{
4388 async fn on_unknown_interaction(&mut self, _: u64) {}
4389}
4390
4391impl<___H, ___T> TaskProviderLocalClientHandler<___T> for ::fidl_next::Local<___H>
4392where
4393 ___H: TaskProviderClientHandler<___T>,
4394 ___T: ::fidl_next::Transport,
4395{
4396 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4397 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4398 }
4399}
4400
4401impl<___H, ___T> TaskProviderLocalServerHandler<___T> for ::fidl_next::Local<___H>
4402where
4403 ___H: TaskProviderServerHandler<___T>,
4404 ___T: ::fidl_next::Transport,
4405{
4406 async fn get_job(&mut self, responder: ::fidl_next::Responder<task_provider::GetJob, ___T>) {
4407 ___H::get_job(&mut self.0, responder).await
4408 }
4409
4410 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4411 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4412 }
4413}
4414
4415pub use fidl_next_common_fuchsia_component_runner::*;