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 pub recoverable_bytes: ::core::option::Option<u64>,
546 }
547
548 impl ComponentControllerOnEscrowRequest {
549 fn __max_ordinal(&self) -> usize {
550 if self.recoverable_bytes.is_some() {
551 return 4;
552 }
553
554 if self.escrowed_dictionary_handle.is_some() {
555 return 3;
556 }
557
558 if self.escrowed_dictionary.is_some() {
559 return 2;
560 }
561
562 if self.outgoing_dir.is_some() {
563 return 1;
564 }
565
566 0
567 }
568 }
569
570 unsafe impl<___E>
571 ::fidl_next::Encode<crate::wire::ComponentControllerOnEscrowRequest<'static>, ___E>
572 for ComponentControllerOnEscrowRequest
573 where
574 ___E: ::fidl_next::Encoder + ?Sized,
575 ___E: ::fidl_next::fuchsia::HandleEncoder,
576 {
577 #[inline]
578 fn encode(
579 mut self,
580 encoder: &mut ___E,
581 out: &mut ::core::mem::MaybeUninit<
582 crate::wire::ComponentControllerOnEscrowRequest<'static>,
583 >,
584 _: (),
585 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
586 ::fidl_next::munge!(let crate::wire::ComponentControllerOnEscrowRequest { table } = out);
587
588 let max_ord = self.__max_ordinal();
589
590 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
591 ::fidl_next::Wire::zero_padding(&mut out);
592
593 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
594 ::fidl_next::wire::Envelope,
595 >(encoder, max_ord);
596
597 for i in 1..=max_ord {
598 match i {
599 4 => {
600 if let Some(value) = self.recoverable_bytes.take() {
601 ::fidl_next::wire::Envelope::encode_value::<
602 ::fidl_next::wire::Uint64,
603 ___E,
604 >(
605 value, preallocated.encoder, &mut out, ()
606 )?;
607 } else {
608 ::fidl_next::wire::Envelope::encode_zero(&mut out)
609 }
610 }
611
612 3 => {
613 if let Some(value) = self.escrowed_dictionary_handle.take() {
614 ::fidl_next::wire::Envelope::encode_value::<
615 ::fidl_next::wire::fuchsia::EventPair,
616 ___E,
617 >(
618 value, preallocated.encoder, &mut out, ()
619 )?;
620 } else {
621 ::fidl_next::wire::Envelope::encode_zero(&mut out)
622 }
623 }
624
625 2 => {
626 if let Some(value) = self.escrowed_dictionary.take() {
627 ::fidl_next::wire::Envelope::encode_value::<
628 ::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef,
629 ___E,
630 >(
631 value, preallocated.encoder, &mut out, ()
632 )?;
633 } else {
634 ::fidl_next::wire::Envelope::encode_zero(&mut out)
635 }
636 }
637
638 1 => {
639 if let Some(value) = self.outgoing_dir.take() {
640 ::fidl_next::wire::Envelope::encode_value::<
641 ::fidl_next::ServerEnd<
642 ::fidl_next_fuchsia_io::Directory,
643 ::fidl_next::wire::fuchsia::Channel,
644 >,
645 ___E,
646 >(
647 value, preallocated.encoder, &mut out, ()
648 )?;
649 } else {
650 ::fidl_next::wire::Envelope::encode_zero(&mut out)
651 }
652 }
653
654 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
655 }
656 unsafe {
657 preallocated.write_next(out.assume_init_ref());
658 }
659 }
660
661 ::fidl_next::wire::Table::encode_len(table, max_ord);
662
663 Ok(())
664 }
665 }
666
667 impl<'de> ::fidl_next::FromWire<crate::wire::ComponentControllerOnEscrowRequest<'de>>
668 for ComponentControllerOnEscrowRequest
669 {
670 #[inline]
671 fn from_wire(wire_: crate::wire::ComponentControllerOnEscrowRequest<'de>) -> Self {
672 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
673
674 let outgoing_dir = wire_.table.get(1);
675
676 let escrowed_dictionary = wire_.table.get(2);
677
678 let escrowed_dictionary_handle = wire_.table.get(3);
679
680 let recoverable_bytes = wire_.table.get(4);
681
682 Self {
683
684
685 outgoing_dir: outgoing_dir.map(|envelope| ::fidl_next::FromWire::from_wire(
686 unsafe { envelope.read_unchecked::<::fidl_next::ServerEnd<::fidl_next_fuchsia_io::Directory, ::fidl_next::wire::fuchsia::Channel>>() }
687 )),
688
689
690 escrowed_dictionary: escrowed_dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
691 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>() }
692 )),
693
694
695 escrowed_dictionary_handle: escrowed_dictionary_handle.map(|envelope| ::fidl_next::FromWire::from_wire(
696 unsafe { envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>() }
697 )),
698
699
700 recoverable_bytes: recoverable_bytes.map(|envelope| ::fidl_next::FromWire::from_wire(
701 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() }
702 )),
703
704 }
705 }
706 }
707
708 #[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"]
709 #[derive(Debug, Default, PartialEq)]
710 pub struct ComponentNamespaceEntry {
711 pub path: ::core::option::Option<::std::string::String>,
712
713 pub directory: ::core::option::Option<
714 ::fidl_next::ClientEnd<
715 ::fidl_next_fuchsia_io::Directory,
716 ::fidl_next::fuchsia::zx::Channel,
717 >,
718 >,
719 }
720
721 impl ComponentNamespaceEntry {
722 fn __max_ordinal(&self) -> usize {
723 if self.directory.is_some() {
724 return 2;
725 }
726
727 if self.path.is_some() {
728 return 1;
729 }
730
731 0
732 }
733 }
734
735 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ComponentNamespaceEntry<'static>, ___E>
736 for ComponentNamespaceEntry
737 where
738 ___E: ::fidl_next::Encoder + ?Sized,
739 ___E: ::fidl_next::fuchsia::HandleEncoder,
740 {
741 #[inline]
742 fn encode(
743 mut self,
744 encoder: &mut ___E,
745 out: &mut ::core::mem::MaybeUninit<crate::wire::ComponentNamespaceEntry<'static>>,
746 _: (),
747 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
748 ::fidl_next::munge!(let crate::wire::ComponentNamespaceEntry { table } = out);
749
750 let max_ord = self.__max_ordinal();
751
752 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
753 ::fidl_next::Wire::zero_padding(&mut out);
754
755 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
756 ::fidl_next::wire::Envelope,
757 >(encoder, max_ord);
758
759 for i in 1..=max_ord {
760 match i {
761 2 => {
762 if let Some(value) = self.directory.take() {
763 ::fidl_next::wire::Envelope::encode_value::<
764 ::fidl_next::ClientEnd<
765 ::fidl_next_fuchsia_io::Directory,
766 ::fidl_next::wire::fuchsia::Channel,
767 >,
768 ___E,
769 >(
770 value, preallocated.encoder, &mut out, ()
771 )?;
772 } else {
773 ::fidl_next::wire::Envelope::encode_zero(&mut out)
774 }
775 }
776
777 1 => {
778 if let Some(value) = self.path.take() {
779 ::fidl_next::wire::Envelope::encode_value::<
780 ::fidl_next::wire::String<'static>,
781 ___E,
782 >(
783 value, preallocated.encoder, &mut out, 4095
784 )?;
785 } else {
786 ::fidl_next::wire::Envelope::encode_zero(&mut out)
787 }
788 }
789
790 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
791 }
792 unsafe {
793 preallocated.write_next(out.assume_init_ref());
794 }
795 }
796
797 ::fidl_next::wire::Table::encode_len(table, max_ord);
798
799 Ok(())
800 }
801 }
802
803 impl<'de> ::fidl_next::FromWire<crate::wire::ComponentNamespaceEntry<'de>>
804 for ComponentNamespaceEntry
805 {
806 #[inline]
807 fn from_wire(wire_: crate::wire::ComponentNamespaceEntry<'de>) -> Self {
808 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
809
810 let path = wire_.table.get(1);
811
812 let directory = wire_.table.get(2);
813
814 Self {
815 path: path.map(|envelope| {
816 ::fidl_next::FromWire::from_wire(unsafe {
817 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
818 })
819 }),
820
821 directory: directory.map(|envelope| {
822 ::fidl_next::FromWire::from_wire(unsafe {
823 envelope.read_unchecked::<::fidl_next::ClientEnd<
824 ::fidl_next_fuchsia_io::Directory,
825 ::fidl_next::wire::fuchsia::Channel,
826 >>()
827 })
828 }),
829 }
830 }
831 }
832
833 #[doc = " Parameters for starting a new component instance.\n"]
834 #[derive(Debug, Default, PartialEq)]
835 pub struct ComponentStartInfo {
836 pub resolved_url: ::core::option::Option<::std::string::String>,
837
838 pub program: ::core::option::Option<::fidl_next_fuchsia_data::natural::Dictionary>,
839
840 pub ns: ::core::option::Option<::std::vec::Vec<crate::natural::ComponentNamespaceEntry>>,
841
842 pub outgoing_dir: ::core::option::Option<
843 ::fidl_next::ServerEnd<
844 ::fidl_next_fuchsia_io::Directory,
845 ::fidl_next::fuchsia::zx::Channel,
846 >,
847 >,
848
849 pub runtime_dir: ::core::option::Option<
850 ::fidl_next::ServerEnd<
851 ::fidl_next_fuchsia_io::Directory,
852 ::fidl_next::fuchsia::zx::Channel,
853 >,
854 >,
855
856 pub numbered_handles: ::core::option::Option<
857 ::std::vec::Vec<::fidl_next_fuchsia_process::natural::HandleInfo>,
858 >,
859
860 pub encoded_config: ::core::option::Option<::fidl_next_fuchsia_mem::natural::Data>,
861
862 pub break_on_start: ::core::option::Option<::fidl_next::fuchsia::zx::EventPair>,
863
864 pub component_instance: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
865
866 pub escrowed_dictionary:
867 ::core::option::Option<::fidl_next_fuchsia_component_sandbox::natural::DictionaryRef>,
868
869 pub escrowed_dictionary_handle: ::core::option::Option<::fidl_next::fuchsia::zx::EventPair>,
870 }
871
872 impl ComponentStartInfo {
873 fn __max_ordinal(&self) -> usize {
874 if self.escrowed_dictionary_handle.is_some() {
875 return 11;
876 }
877
878 if self.escrowed_dictionary.is_some() {
879 return 10;
880 }
881
882 if self.component_instance.is_some() {
883 return 9;
884 }
885
886 if self.break_on_start.is_some() {
887 return 8;
888 }
889
890 if self.encoded_config.is_some() {
891 return 7;
892 }
893
894 if self.numbered_handles.is_some() {
895 return 6;
896 }
897
898 if self.runtime_dir.is_some() {
899 return 5;
900 }
901
902 if self.outgoing_dir.is_some() {
903 return 4;
904 }
905
906 if self.ns.is_some() {
907 return 3;
908 }
909
910 if self.program.is_some() {
911 return 2;
912 }
913
914 if self.resolved_url.is_some() {
915 return 1;
916 }
917
918 0
919 }
920 }
921
922 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ComponentStartInfo<'static>, ___E>
923 for ComponentStartInfo
924 where
925 ___E: ::fidl_next::Encoder + ?Sized,
926 ___E: ::fidl_next::fuchsia::HandleEncoder,
927 {
928 #[inline]
929 fn encode(
930 mut self,
931 encoder: &mut ___E,
932 out: &mut ::core::mem::MaybeUninit<crate::wire::ComponentStartInfo<'static>>,
933 _: (),
934 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
935 ::fidl_next::munge!(let crate::wire::ComponentStartInfo { table } = out);
936
937 let max_ord = self.__max_ordinal();
938
939 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
940 ::fidl_next::Wire::zero_padding(&mut out);
941
942 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
943 ::fidl_next::wire::Envelope,
944 >(encoder, max_ord);
945
946 for i in 1..=max_ord {
947 match i {
948 11 => {
949 if let Some(value) = self.escrowed_dictionary_handle.take() {
950 ::fidl_next::wire::Envelope::encode_value::<
951 ::fidl_next::wire::fuchsia::EventPair,
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 10 => {
962 if let Some(value) = self.escrowed_dictionary.take() {
963 ::fidl_next::wire::Envelope::encode_value::<
964 ::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef,
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 9 => {
975 if let Some(value) = self.component_instance.take() {
976 ::fidl_next::wire::Envelope::encode_value::<
977 ::fidl_next::wire::fuchsia::Event,
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 8 => {
988 if let Some(value) = self.break_on_start.take() {
989 ::fidl_next::wire::Envelope::encode_value::<
990 ::fidl_next::wire::fuchsia::EventPair,
991 ___E,
992 >(
993 value, preallocated.encoder, &mut out, ()
994 )?;
995 } else {
996 ::fidl_next::wire::Envelope::encode_zero(&mut out)
997 }
998 }
999
1000 7 => {
1001 if let Some(value) = self.encoded_config.take() {
1002 ::fidl_next::wire::Envelope::encode_value::<
1003 ::fidl_next_fuchsia_mem::wire::Data<'static>,
1004 ___E,
1005 >(
1006 value, preallocated.encoder, &mut out, ()
1007 )?;
1008 } else {
1009 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1010 }
1011 }
1012
1013 6 => {
1014 if let Some(value) = self.numbered_handles.take() {
1015 ::fidl_next::wire::Envelope::encode_value::<
1016 ::fidl_next::wire::Vector<
1017 'static,
1018 ::fidl_next_fuchsia_process::wire::HandleInfo,
1019 >,
1020 ___E,
1021 >(
1022 value, preallocated.encoder, &mut out, (128, ())
1023 )?;
1024 } else {
1025 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1026 }
1027 }
1028
1029 5 => {
1030 if let Some(value) = self.runtime_dir.take() {
1031 ::fidl_next::wire::Envelope::encode_value::<
1032 ::fidl_next::ServerEnd<
1033 ::fidl_next_fuchsia_io::Directory,
1034 ::fidl_next::wire::fuchsia::Channel,
1035 >,
1036 ___E,
1037 >(
1038 value, preallocated.encoder, &mut out, ()
1039 )?;
1040 } else {
1041 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1042 }
1043 }
1044
1045 4 => {
1046 if let Some(value) = self.outgoing_dir.take() {
1047 ::fidl_next::wire::Envelope::encode_value::<
1048 ::fidl_next::ServerEnd<
1049 ::fidl_next_fuchsia_io::Directory,
1050 ::fidl_next::wire::fuchsia::Channel,
1051 >,
1052 ___E,
1053 >(
1054 value, preallocated.encoder, &mut out, ()
1055 )?;
1056 } else {
1057 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1058 }
1059 }
1060
1061 3 => {
1062 if let Some(value) = self.ns.take() {
1063 ::fidl_next::wire::Envelope::encode_value::<
1064 ::fidl_next::wire::Vector<
1065 'static,
1066 crate::wire::ComponentNamespaceEntry<'static>,
1067 >,
1068 ___E,
1069 >(
1070 value, preallocated.encoder, &mut out, (32, ())
1071 )?;
1072 } else {
1073 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1074 }
1075 }
1076
1077 2 => {
1078 if let Some(value) = self.program.take() {
1079 ::fidl_next::wire::Envelope::encode_value::<
1080 ::fidl_next_fuchsia_data::wire::Dictionary<'static>,
1081 ___E,
1082 >(
1083 value, preallocated.encoder, &mut out, ()
1084 )?;
1085 } else {
1086 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1087 }
1088 }
1089
1090 1 => {
1091 if let Some(value) = self.resolved_url.take() {
1092 ::fidl_next::wire::Envelope::encode_value::<
1093 ::fidl_next::wire::String<'static>,
1094 ___E,
1095 >(
1096 value, preallocated.encoder, &mut out, 4096
1097 )?;
1098 } else {
1099 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1100 }
1101 }
1102
1103 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1104 }
1105 unsafe {
1106 preallocated.write_next(out.assume_init_ref());
1107 }
1108 }
1109
1110 ::fidl_next::wire::Table::encode_len(table, max_ord);
1111
1112 Ok(())
1113 }
1114 }
1115
1116 impl<'de> ::fidl_next::FromWire<crate::wire::ComponentStartInfo<'de>> for ComponentStartInfo {
1117 #[inline]
1118 fn from_wire(wire_: crate::wire::ComponentStartInfo<'de>) -> Self {
1119 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1120
1121 let resolved_url = wire_.table.get(1);
1122
1123 let program = wire_.table.get(2);
1124
1125 let ns = wire_.table.get(3);
1126
1127 let outgoing_dir = wire_.table.get(4);
1128
1129 let runtime_dir = wire_.table.get(5);
1130
1131 let numbered_handles = wire_.table.get(6);
1132
1133 let encoded_config = wire_.table.get(7);
1134
1135 let break_on_start = wire_.table.get(8);
1136
1137 let component_instance = wire_.table.get(9);
1138
1139 let escrowed_dictionary = wire_.table.get(10);
1140
1141 let escrowed_dictionary_handle = wire_.table.get(11);
1142
1143 Self {
1144
1145
1146 resolved_url: resolved_url.map(|envelope| ::fidl_next::FromWire::from_wire(
1147 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
1148 )),
1149
1150
1151 program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
1152 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_data::wire::Dictionary<'de>>() }
1153 )),
1154
1155
1156 ns: ns.map(|envelope| ::fidl_next::FromWire::from_wire(
1157 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ComponentNamespaceEntry<'de>>>() }
1158 )),
1159
1160
1161 outgoing_dir: outgoing_dir.map(|envelope| ::fidl_next::FromWire::from_wire(
1162 unsafe { envelope.read_unchecked::<::fidl_next::ServerEnd<::fidl_next_fuchsia_io::Directory, ::fidl_next::wire::fuchsia::Channel>>() }
1163 )),
1164
1165
1166 runtime_dir: runtime_dir.map(|envelope| ::fidl_next::FromWire::from_wire(
1167 unsafe { envelope.read_unchecked::<::fidl_next::ServerEnd<::fidl_next_fuchsia_io::Directory, ::fidl_next::wire::fuchsia::Channel>>() }
1168 )),
1169
1170
1171 numbered_handles: numbered_handles.map(|envelope| ::fidl_next::FromWire::from_wire(
1172 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next_fuchsia_process::wire::HandleInfo>>() }
1173 )),
1174
1175
1176 encoded_config: encoded_config.map(|envelope| ::fidl_next::FromWire::from_wire(
1177 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>() }
1178 )),
1179
1180
1181 break_on_start: break_on_start.map(|envelope| ::fidl_next::FromWire::from_wire(
1182 unsafe { envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>() }
1183 )),
1184
1185
1186 component_instance: component_instance.map(|envelope| ::fidl_next::FromWire::from_wire(
1187 unsafe { envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>() }
1188 )),
1189
1190
1191 escrowed_dictionary: escrowed_dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
1192 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>() }
1193 )),
1194
1195
1196 escrowed_dictionary_handle: escrowed_dictionary_handle.map(|envelope| ::fidl_next::FromWire::from_wire(
1197 unsafe { envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>() }
1198 )),
1199
1200 }
1201 }
1202 }
1203
1204 #[derive(Debug, PartialEq)]
1205 pub struct ComponentRunnerStartRequest {
1206 pub start_info: crate::natural::ComponentStartInfo,
1207
1208 pub controller:
1209 ::fidl_next::ServerEnd<crate::ComponentController, ::fidl_next::fuchsia::zx::Channel>,
1210 }
1211
1212 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ComponentRunnerStartRequest<'static>, ___E>
1213 for ComponentRunnerStartRequest
1214 where
1215 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1216 ___E: ::fidl_next::Encoder,
1217 ___E: ::fidl_next::fuchsia::HandleEncoder,
1218 {
1219 #[inline]
1220 fn encode(
1221 self,
1222 encoder_: &mut ___E,
1223 out_: &mut ::core::mem::MaybeUninit<crate::wire::ComponentRunnerStartRequest<'static>>,
1224 _: (),
1225 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1226 ::fidl_next::munge! {
1227 let crate::wire::ComponentRunnerStartRequest {
1228 start_info,
1229 controller,
1230
1231 } = out_;
1232 }
1233
1234 ::fidl_next::Encode::encode(self.start_info, encoder_, start_info, ())?;
1235
1236 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(start_info.as_mut_ptr()) };
1237
1238 ::fidl_next::Encode::encode(self.controller, encoder_, controller, ())?;
1239
1240 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(controller.as_mut_ptr()) };
1241
1242 Ok(())
1243 }
1244 }
1245
1246 unsafe impl<___E>
1247 ::fidl_next::EncodeOption<
1248 ::fidl_next::wire::Box<'static, crate::wire::ComponentRunnerStartRequest<'static>>,
1249 ___E,
1250 > for ComponentRunnerStartRequest
1251 where
1252 ___E: ::fidl_next::Encoder + ?Sized,
1253 ComponentRunnerStartRequest:
1254 ::fidl_next::Encode<crate::wire::ComponentRunnerStartRequest<'static>, ___E>,
1255 {
1256 #[inline]
1257 fn encode_option(
1258 this: ::core::option::Option<Self>,
1259 encoder: &mut ___E,
1260 out: &mut ::core::mem::MaybeUninit<
1261 ::fidl_next::wire::Box<'static, crate::wire::ComponentRunnerStartRequest<'static>>,
1262 >,
1263 _: (),
1264 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1265 if let Some(inner) = this {
1266 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1267 ::fidl_next::wire::Box::encode_present(out);
1268 } else {
1269 ::fidl_next::wire::Box::encode_absent(out);
1270 }
1271
1272 Ok(())
1273 }
1274 }
1275
1276 impl<'de> ::fidl_next::FromWire<crate::wire::ComponentRunnerStartRequest<'de>>
1277 for ComponentRunnerStartRequest
1278 {
1279 #[inline]
1280 fn from_wire(wire: crate::wire::ComponentRunnerStartRequest<'de>) -> Self {
1281 Self {
1282 start_info: ::fidl_next::FromWire::from_wire(wire.start_info),
1283
1284 controller: ::fidl_next::FromWire::from_wire(wire.controller),
1285 }
1286 }
1287 }
1288
1289 #[derive(Debug, PartialEq)]
1290 #[repr(C)]
1291 pub struct TaskProviderGetJobResponse {
1292 pub job: ::fidl_next::fuchsia::zx::Job,
1293 }
1294
1295 unsafe impl<___E> ::fidl_next::Encode<crate::wire::TaskProviderGetJobResponse, ___E>
1296 for TaskProviderGetJobResponse
1297 where
1298 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1299 ___E: ::fidl_next::fuchsia::HandleEncoder,
1300 {
1301 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1302 Self,
1303 crate::wire::TaskProviderGetJobResponse,
1304 > = unsafe {
1305 ::fidl_next::CopyOptimization::enable_if(
1306 true && <::fidl_next::fuchsia::zx::Job as ::fidl_next::Encode<
1307 ::fidl_next::wire::fuchsia::Job,
1308 ___E,
1309 >>::COPY_OPTIMIZATION
1310 .is_enabled(),
1311 )
1312 };
1313
1314 #[inline]
1315 fn encode(
1316 self,
1317 encoder_: &mut ___E,
1318 out_: &mut ::core::mem::MaybeUninit<crate::wire::TaskProviderGetJobResponse>,
1319 _: (),
1320 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1321 ::fidl_next::munge! {
1322 let crate::wire::TaskProviderGetJobResponse {
1323 job,
1324
1325 } = out_;
1326 }
1327
1328 ::fidl_next::Encode::encode(self.job, encoder_, job, ())?;
1329
1330 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(job.as_mut_ptr()) };
1331
1332 Ok(())
1333 }
1334 }
1335
1336 unsafe impl<___E>
1337 ::fidl_next::EncodeOption<
1338 ::fidl_next::wire::Box<'static, crate::wire::TaskProviderGetJobResponse>,
1339 ___E,
1340 > for TaskProviderGetJobResponse
1341 where
1342 ___E: ::fidl_next::Encoder + ?Sized,
1343 TaskProviderGetJobResponse:
1344 ::fidl_next::Encode<crate::wire::TaskProviderGetJobResponse, ___E>,
1345 {
1346 #[inline]
1347 fn encode_option(
1348 this: ::core::option::Option<Self>,
1349 encoder: &mut ___E,
1350 out: &mut ::core::mem::MaybeUninit<
1351 ::fidl_next::wire::Box<'static, crate::wire::TaskProviderGetJobResponse>,
1352 >,
1353 _: (),
1354 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1355 if let Some(inner) = this {
1356 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1357 ::fidl_next::wire::Box::encode_present(out);
1358 } else {
1359 ::fidl_next::wire::Box::encode_absent(out);
1360 }
1361
1362 Ok(())
1363 }
1364 }
1365
1366 impl ::fidl_next::FromWire<crate::wire::TaskProviderGetJobResponse> for TaskProviderGetJobResponse {
1367 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1368 crate::wire::TaskProviderGetJobResponse,
1369 Self,
1370 > = unsafe {
1371 ::fidl_next::CopyOptimization::enable_if(
1372 true && <::fidl_next::fuchsia::zx::Job as ::fidl_next::FromWire<
1373 ::fidl_next::wire::fuchsia::Job,
1374 >>::COPY_OPTIMIZATION
1375 .is_enabled(),
1376 )
1377 };
1378
1379 #[inline]
1380 fn from_wire(wire: crate::wire::TaskProviderGetJobResponse) -> Self {
1381 Self { job: ::fidl_next::FromWire::from_wire(wire.job) }
1382 }
1383 }
1384}
1385
1386pub mod wire {
1387
1388 pub use fidl_next_common_fuchsia_component_runner::wire::*;
1389
1390 #[repr(transparent)]
1392 pub struct Task<'de> {
1393 pub(crate) raw: ::fidl_next::wire::Union,
1394 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1395 }
1396
1397 impl<'de> Drop for Task<'de> {
1398 fn drop(&mut self) {
1399 match self.raw.ordinal() {
1400 1 => {
1401 let _ = unsafe {
1402 self.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Job>()
1403 };
1404 }
1405
1406 2 => {
1407 let _ = unsafe {
1408 self.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Process>()
1409 };
1410 }
1411
1412 3 => {
1413 let _ = unsafe {
1414 self.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Thread>()
1415 };
1416 }
1417
1418 _ => (),
1419 }
1420 }
1421 }
1422
1423 impl ::fidl_next::Constrained for Task<'_> {
1424 type Constraint = ();
1425
1426 fn validate(
1427 _: ::fidl_next::Slot<'_, Self>,
1428 _: Self::Constraint,
1429 ) -> Result<(), ::fidl_next::ValidationError> {
1430 Ok(())
1431 }
1432 }
1433
1434 unsafe impl ::fidl_next::Wire for Task<'static> {
1435 type Narrowed<'de> = Task<'de>;
1436
1437 #[inline]
1438 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1439 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1440 ::fidl_next::wire::Union::zero_padding(raw);
1441 }
1442 }
1443
1444 pub mod task {
1445 pub enum Ref<'de> {
1446 Job(&'de ::fidl_next::wire::fuchsia::Job),
1447
1448 Process(&'de ::fidl_next::wire::fuchsia::Process),
1449
1450 Thread(&'de ::fidl_next::wire::fuchsia::Thread),
1451
1452 UnknownOrdinal_(u64),
1453 }
1454
1455 pub enum Value {
1456 Job(::fidl_next::wire::fuchsia::Job),
1457
1458 Process(::fidl_next::wire::fuchsia::Process),
1459
1460 Thread(::fidl_next::wire::fuchsia::Thread),
1461
1462 UnknownOrdinal_(u64),
1463 }
1464 }
1465
1466 impl<'de> Task<'de> {
1467 pub fn as_ref(&self) -> crate::wire::task::Ref<'_> {
1468 match self.raw.ordinal() {
1469 1 => crate::wire::task::Ref::Job(unsafe {
1470 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Job>()
1471 }),
1472
1473 2 => crate::wire::task::Ref::Process(unsafe {
1474 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Process>()
1475 }),
1476
1477 3 => crate::wire::task::Ref::Thread(unsafe {
1478 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Thread>()
1479 }),
1480
1481 unknown => crate::wire::task::Ref::UnknownOrdinal_(unknown),
1482 }
1483 }
1484
1485 pub fn into_inner(self) -> crate::wire::task::Value {
1486 let this = ::core::mem::ManuallyDrop::new(self);
1487
1488 match this.raw.ordinal() {
1489 1 => crate::wire::task::Value::Job(unsafe {
1490 this.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Job>()
1491 }),
1492
1493 2 => crate::wire::task::Value::Process(unsafe {
1494 this.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Process>()
1495 }),
1496
1497 3 => crate::wire::task::Value::Thread(unsafe {
1498 this.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Thread>()
1499 }),
1500
1501 unknown => crate::wire::task::Value::UnknownOrdinal_(unknown),
1502 }
1503 }
1504 }
1505
1506 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Task<'de>
1507 where
1508 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1509 ___D: ::fidl_next::Decoder<'de>,
1510 ___D: ::fidl_next::fuchsia::HandleDecoder,
1511 {
1512 fn decode(
1513 mut slot: ::fidl_next::Slot<'_, Self>,
1514 decoder: &mut ___D,
1515 _: (),
1516 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1517 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1518 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1519 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Job>(
1520 raw,
1521 decoder,
1522 (),
1523 )?,
1524
1525 2 => ::fidl_next::wire::Union::decode_as::<
1526 ___D,
1527 ::fidl_next::wire::fuchsia::Process,
1528 >(raw, decoder, ())?,
1529
1530 3 => {
1531 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Thread>(
1532 raw,
1533 decoder,
1534 (),
1535 )?
1536 }
1537
1538 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1539 }
1540
1541 Ok(())
1542 }
1543 }
1544
1545 impl<'de> ::core::fmt::Debug for Task<'de> {
1546 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1547 match self.raw.ordinal() {
1548 1 => unsafe {
1549 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Job>().fmt(f)
1550 },
1551 2 => unsafe {
1552 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Process>().fmt(f)
1553 },
1554 3 => unsafe {
1555 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Thread>().fmt(f)
1556 },
1557 _ => unsafe { ::core::hint::unreachable_unchecked() },
1558 }
1559 }
1560 }
1561
1562 impl<'de> ::fidl_next::IntoNatural for Task<'de> {
1563 type Natural = crate::natural::Task;
1564 }
1565
1566 #[repr(C)]
1568 pub struct ComponentTasks<'de> {
1569 pub(crate) table: ::fidl_next::wire::Table<'de>,
1570 }
1571
1572 impl<'de> Drop for ComponentTasks<'de> {
1573 fn drop(&mut self) {
1574 let _ = self
1575 .table
1576 .get(1)
1577 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Task<'de>>() });
1578
1579 let _ = self
1580 .table
1581 .get(2)
1582 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Task<'de>>() });
1583 }
1584 }
1585
1586 impl ::fidl_next::Constrained for ComponentTasks<'_> {
1587 type Constraint = ();
1588
1589 fn validate(
1590 _: ::fidl_next::Slot<'_, Self>,
1591 _: Self::Constraint,
1592 ) -> Result<(), ::fidl_next::ValidationError> {
1593 Ok(())
1594 }
1595 }
1596
1597 unsafe impl ::fidl_next::Wire for ComponentTasks<'static> {
1598 type Narrowed<'de> = ComponentTasks<'de>;
1599
1600 #[inline]
1601 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1602 ::fidl_next::munge!(let Self { table } = out);
1603 ::fidl_next::wire::Table::zero_padding(table);
1604 }
1605 }
1606
1607 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentTasks<'de>
1608 where
1609 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1610 ___D: ::fidl_next::fuchsia::HandleDecoder,
1611 {
1612 fn decode(
1613 slot: ::fidl_next::Slot<'_, Self>,
1614 decoder: &mut ___D,
1615 _: (),
1616 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1617 ::fidl_next::munge!(let Self { table } = slot);
1618
1619 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1620 match ordinal {
1621 0 => unsafe { ::core::hint::unreachable_unchecked() },
1622
1623 1 => {
1624 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Task<'de>>(
1625 slot.as_mut(),
1626 decoder,
1627 (),
1628 )?;
1629
1630 Ok(())
1631 }
1632
1633 2 => {
1634 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Task<'de>>(
1635 slot.as_mut(),
1636 decoder,
1637 (),
1638 )?;
1639
1640 Ok(())
1641 }
1642
1643 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1644 }
1645 })
1646 }
1647 }
1648
1649 impl<'de> ComponentTasks<'de> {
1650 pub fn component_task(&self) -> ::core::option::Option<&crate::wire::Task<'de>> {
1651 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1652 }
1653
1654 pub fn take_component_task(&mut self) -> ::core::option::Option<crate::wire::Task<'de>> {
1655 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1656 }
1657
1658 pub fn parent_task(&self) -> ::core::option::Option<&crate::wire::Task<'de>> {
1659 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1660 }
1661
1662 pub fn take_parent_task(&mut self) -> ::core::option::Option<crate::wire::Task<'de>> {
1663 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1664 }
1665 }
1666
1667 impl<'de> ::core::fmt::Debug for ComponentTasks<'de> {
1668 fn fmt(
1669 &self,
1670 f: &mut ::core::fmt::Formatter<'_>,
1671 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1672 f.debug_struct("ComponentTasks")
1673 .field("component_task", &self.component_task())
1674 .field("parent_task", &self.parent_task())
1675 .finish()
1676 }
1677 }
1678
1679 impl<'de> ::fidl_next::IntoNatural for ComponentTasks<'de> {
1680 type Natural = crate::natural::ComponentTasks;
1681 }
1682
1683 #[repr(C)]
1685 pub struct ComponentDiagnostics<'de> {
1686 pub(crate) table: ::fidl_next::wire::Table<'de>,
1687 }
1688
1689 impl<'de> Drop for ComponentDiagnostics<'de> {
1690 fn drop(&mut self) {
1691 let _ = self.table.get(1).map(|envelope| unsafe {
1692 envelope.read_unchecked::<crate::wire::ComponentTasks<'de>>()
1693 });
1694 }
1695 }
1696
1697 impl ::fidl_next::Constrained for ComponentDiagnostics<'_> {
1698 type Constraint = ();
1699
1700 fn validate(
1701 _: ::fidl_next::Slot<'_, Self>,
1702 _: Self::Constraint,
1703 ) -> Result<(), ::fidl_next::ValidationError> {
1704 Ok(())
1705 }
1706 }
1707
1708 unsafe impl ::fidl_next::Wire for ComponentDiagnostics<'static> {
1709 type Narrowed<'de> = ComponentDiagnostics<'de>;
1710
1711 #[inline]
1712 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1713 ::fidl_next::munge!(let Self { table } = out);
1714 ::fidl_next::wire::Table::zero_padding(table);
1715 }
1716 }
1717
1718 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentDiagnostics<'de>
1719 where
1720 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1721 ___D: ::fidl_next::fuchsia::HandleDecoder,
1722 {
1723 fn decode(
1724 slot: ::fidl_next::Slot<'_, Self>,
1725 decoder: &mut ___D,
1726 _: (),
1727 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1728 ::fidl_next::munge!(let Self { table } = slot);
1729
1730 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1731 match ordinal {
1732 0 => unsafe { ::core::hint::unreachable_unchecked() },
1733
1734 1 => {
1735 ::fidl_next::wire::Envelope::decode_as::<
1736 ___D,
1737 crate::wire::ComponentTasks<'de>,
1738 >(slot.as_mut(), decoder, ())?;
1739
1740 Ok(())
1741 }
1742
1743 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1744 }
1745 })
1746 }
1747 }
1748
1749 impl<'de> ComponentDiagnostics<'de> {
1750 pub fn tasks(&self) -> ::core::option::Option<&crate::wire::ComponentTasks<'de>> {
1751 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1752 }
1753
1754 pub fn take_tasks(&mut self) -> ::core::option::Option<crate::wire::ComponentTasks<'de>> {
1755 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1756 }
1757 }
1758
1759 impl<'de> ::core::fmt::Debug for ComponentDiagnostics<'de> {
1760 fn fmt(
1761 &self,
1762 f: &mut ::core::fmt::Formatter<'_>,
1763 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1764 f.debug_struct("ComponentDiagnostics").field("tasks", &self.tasks()).finish()
1765 }
1766 }
1767
1768 impl<'de> ::fidl_next::IntoNatural for ComponentDiagnostics<'de> {
1769 type Natural = crate::natural::ComponentDiagnostics;
1770 }
1771
1772 #[derive(Debug)]
1774 #[repr(C)]
1775 pub struct ComponentControllerOnPublishDiagnosticsRequest<'de> {
1776 pub payload: crate::wire::ComponentDiagnostics<'de>,
1777 }
1778
1779 static_assertions::const_assert_eq!(
1780 std::mem::size_of::<ComponentControllerOnPublishDiagnosticsRequest<'_>>(),
1781 16
1782 );
1783 static_assertions::const_assert_eq!(
1784 std::mem::align_of::<ComponentControllerOnPublishDiagnosticsRequest<'_>>(),
1785 8
1786 );
1787
1788 static_assertions::const_assert_eq!(
1789 std::mem::offset_of!(ComponentControllerOnPublishDiagnosticsRequest<'_>, payload),
1790 0
1791 );
1792
1793 impl ::fidl_next::Constrained for ComponentControllerOnPublishDiagnosticsRequest<'_> {
1794 type Constraint = ();
1795
1796 fn validate(
1797 _: ::fidl_next::Slot<'_, Self>,
1798 _: Self::Constraint,
1799 ) -> Result<(), ::fidl_next::ValidationError> {
1800 Ok(())
1801 }
1802 }
1803
1804 unsafe impl ::fidl_next::Wire for ComponentControllerOnPublishDiagnosticsRequest<'static> {
1805 type Narrowed<'de> = ComponentControllerOnPublishDiagnosticsRequest<'de>;
1806
1807 #[inline]
1808 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1809 ::fidl_next::munge! {
1810 let Self {
1811 payload,
1812
1813 } = &mut *out_;
1814 }
1815
1816 ::fidl_next::Wire::zero_padding(payload);
1817 }
1818 }
1819
1820 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
1821 for ComponentControllerOnPublishDiagnosticsRequest<'de>
1822 where
1823 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1824 ___D: ::fidl_next::Decoder<'de>,
1825 ___D: ::fidl_next::fuchsia::HandleDecoder,
1826 {
1827 fn decode(
1828 slot_: ::fidl_next::Slot<'_, Self>,
1829 decoder_: &mut ___D,
1830 _: (),
1831 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1832 ::fidl_next::munge! {
1833 let Self {
1834 mut payload,
1835
1836 } = slot_;
1837 }
1838
1839 let _field = payload.as_mut();
1840
1841 ::fidl_next::Decode::decode(payload.as_mut(), decoder_, ())?;
1842
1843 Ok(())
1844 }
1845 }
1846
1847 impl<'de> ::fidl_next::IntoNatural for ComponentControllerOnPublishDiagnosticsRequest<'de> {
1848 type Natural = crate::natural::ComponentControllerOnPublishDiagnosticsRequest;
1849 }
1850
1851 #[repr(C)]
1853 pub struct ComponentStopInfo<'de> {
1854 pub(crate) table: ::fidl_next::wire::Table<'de>,
1855 }
1856
1857 impl<'de> Drop for ComponentStopInfo<'de> {
1858 fn drop(&mut self) {
1859 let _ = self.table.get(1).map(|envelope| unsafe {
1860 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Status>()
1861 });
1862
1863 let _ = self
1864 .table
1865 .get(2)
1866 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
1867 }
1868 }
1869
1870 impl ::fidl_next::Constrained for ComponentStopInfo<'_> {
1871 type Constraint = ();
1872
1873 fn validate(
1874 _: ::fidl_next::Slot<'_, Self>,
1875 _: Self::Constraint,
1876 ) -> Result<(), ::fidl_next::ValidationError> {
1877 Ok(())
1878 }
1879 }
1880
1881 unsafe impl ::fidl_next::Wire for ComponentStopInfo<'static> {
1882 type Narrowed<'de> = ComponentStopInfo<'de>;
1883
1884 #[inline]
1885 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1886 ::fidl_next::munge!(let Self { table } = out);
1887 ::fidl_next::wire::Table::zero_padding(table);
1888 }
1889 }
1890
1891 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentStopInfo<'de>
1892 where
1893 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1894 ___D: ::fidl_next::fuchsia::HandleDecoder,
1895 {
1896 fn decode(
1897 slot: ::fidl_next::Slot<'_, Self>,
1898 decoder: &mut ___D,
1899 _: (),
1900 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1901 ::fidl_next::munge!(let Self { table } = slot);
1902
1903 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1904 match ordinal {
1905 0 => unsafe { ::core::hint::unreachable_unchecked() },
1906
1907 1 => {
1908 ::fidl_next::wire::Envelope::decode_as::<
1909 ___D,
1910 ::fidl_next::wire::fuchsia::Status,
1911 >(slot.as_mut(), decoder, ())?;
1912
1913 Ok(())
1914 }
1915
1916 2 => {
1917 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
1918 slot.as_mut(),
1919 decoder,
1920 (),
1921 )?;
1922
1923 Ok(())
1924 }
1925
1926 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1927 }
1928 })
1929 }
1930 }
1931
1932 impl<'de> ComponentStopInfo<'de> {
1933 pub fn termination_status(
1934 &self,
1935 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Status> {
1936 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1937 }
1938
1939 pub fn take_termination_status(
1940 &mut self,
1941 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Status> {
1942 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1943 }
1944
1945 pub fn exit_code(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
1946 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1947 }
1948
1949 pub fn take_exit_code(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
1950 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1951 }
1952 }
1953
1954 impl<'de> ::core::fmt::Debug for ComponentStopInfo<'de> {
1955 fn fmt(
1956 &self,
1957 f: &mut ::core::fmt::Formatter<'_>,
1958 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1959 f.debug_struct("ComponentStopInfo")
1960 .field("termination_status", &self.termination_status())
1961 .field("exit_code", &self.exit_code())
1962 .finish()
1963 }
1964 }
1965
1966 impl<'de> ::fidl_next::IntoNatural for ComponentStopInfo<'de> {
1967 type Natural = crate::natural::ComponentStopInfo;
1968 }
1969
1970 #[repr(C)]
1972 pub struct ComponentControllerOnEscrowRequest<'de> {
1973 pub(crate) table: ::fidl_next::wire::Table<'de>,
1974 }
1975
1976 impl<'de> Drop for ComponentControllerOnEscrowRequest<'de> {
1977 fn drop(&mut self) {
1978 let _ = self.table.get(1).map(|envelope| unsafe {
1979 envelope.read_unchecked::<::fidl_next::ServerEnd<
1980 ::fidl_next_fuchsia_io::Directory,
1981 ::fidl_next::wire::fuchsia::Channel,
1982 >>()
1983 });
1984
1985 let _ = self.table.get(2)
1986 .map(|envelope| unsafe {
1987 envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>()
1988 });
1989
1990 let _ = self.table.get(3).map(|envelope| unsafe {
1991 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
1992 });
1993
1994 let _ = self
1995 .table
1996 .get(4)
1997 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
1998 }
1999 }
2000
2001 impl ::fidl_next::Constrained for ComponentControllerOnEscrowRequest<'_> {
2002 type Constraint = ();
2003
2004 fn validate(
2005 _: ::fidl_next::Slot<'_, Self>,
2006 _: Self::Constraint,
2007 ) -> Result<(), ::fidl_next::ValidationError> {
2008 Ok(())
2009 }
2010 }
2011
2012 unsafe impl ::fidl_next::Wire for ComponentControllerOnEscrowRequest<'static> {
2013 type Narrowed<'de> = ComponentControllerOnEscrowRequest<'de>;
2014
2015 #[inline]
2016 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2017 ::fidl_next::munge!(let Self { table } = out);
2018 ::fidl_next::wire::Table::zero_padding(table);
2019 }
2020 }
2021
2022 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentControllerOnEscrowRequest<'de>
2023 where
2024 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2025 ___D: ::fidl_next::fuchsia::HandleDecoder,
2026 {
2027 fn decode(
2028 slot: ::fidl_next::Slot<'_, Self>,
2029 decoder: &mut ___D,
2030 _: (),
2031 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2032 ::fidl_next::munge!(let Self { table } = slot);
2033
2034 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2035 match ordinal {
2036 0 => unsafe { ::core::hint::unreachable_unchecked() },
2037
2038 1 => {
2039 ::fidl_next::wire::Envelope::decode_as::<
2040 ___D,
2041 ::fidl_next::ServerEnd<
2042 ::fidl_next_fuchsia_io::Directory,
2043 ::fidl_next::wire::fuchsia::Channel,
2044 >,
2045 >(slot.as_mut(), decoder, ())?;
2046
2047 Ok(())
2048 }
2049
2050 2 => {
2051 ::fidl_next::wire::Envelope::decode_as::<
2052 ___D,
2053 ::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef,
2054 >(slot.as_mut(), decoder, ())?;
2055
2056 Ok(())
2057 }
2058
2059 3 => {
2060 ::fidl_next::wire::Envelope::decode_as::<
2061 ___D,
2062 ::fidl_next::wire::fuchsia::EventPair,
2063 >(slot.as_mut(), decoder, ())?;
2064
2065 Ok(())
2066 }
2067
2068 4 => {
2069 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
2070 slot.as_mut(),
2071 decoder,
2072 (),
2073 )?;
2074
2075 Ok(())
2076 }
2077
2078 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2079 }
2080 })
2081 }
2082 }
2083
2084 impl<'de> ComponentControllerOnEscrowRequest<'de> {
2085 pub fn outgoing_dir(
2086 &self,
2087 ) -> ::core::option::Option<
2088 &::fidl_next::ServerEnd<
2089 ::fidl_next_fuchsia_io::Directory,
2090 ::fidl_next::wire::fuchsia::Channel,
2091 >,
2092 > {
2093 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2094 }
2095
2096 pub fn take_outgoing_dir(
2097 &mut self,
2098 ) -> ::core::option::Option<
2099 ::fidl_next::ServerEnd<
2100 ::fidl_next_fuchsia_io::Directory,
2101 ::fidl_next::wire::fuchsia::Channel,
2102 >,
2103 > {
2104 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2105 }
2106
2107 pub fn escrowed_dictionary(
2108 &self,
2109 ) -> ::core::option::Option<&::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>
2110 {
2111 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2112 }
2113
2114 pub fn take_escrowed_dictionary(
2115 &mut self,
2116 ) -> ::core::option::Option<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>
2117 {
2118 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2119 }
2120
2121 pub fn escrowed_dictionary_handle(
2122 &self,
2123 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2124 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2125 }
2126
2127 pub fn take_escrowed_dictionary_handle(
2128 &mut self,
2129 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
2130 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2131 }
2132
2133 pub fn recoverable_bytes(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
2134 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2135 }
2136
2137 pub fn take_recoverable_bytes(
2138 &mut self,
2139 ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
2140 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
2141 }
2142 }
2143
2144 impl<'de> ::core::fmt::Debug for ComponentControllerOnEscrowRequest<'de> {
2145 fn fmt(
2146 &self,
2147 f: &mut ::core::fmt::Formatter<'_>,
2148 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2149 f.debug_struct("ComponentControllerOnEscrowRequest")
2150 .field("outgoing_dir", &self.outgoing_dir())
2151 .field("escrowed_dictionary", &self.escrowed_dictionary())
2152 .field("escrowed_dictionary_handle", &self.escrowed_dictionary_handle())
2153 .field("recoverable_bytes", &self.recoverable_bytes())
2154 .finish()
2155 }
2156 }
2157
2158 impl<'de> ::fidl_next::IntoNatural for ComponentControllerOnEscrowRequest<'de> {
2159 type Natural = crate::natural::ComponentControllerOnEscrowRequest;
2160 }
2161
2162 #[repr(C)]
2164 pub struct ComponentNamespaceEntry<'de> {
2165 pub(crate) table: ::fidl_next::wire::Table<'de>,
2166 }
2167
2168 impl<'de> Drop for ComponentNamespaceEntry<'de> {
2169 fn drop(&mut self) {
2170 let _ = self.table.get(1).map(|envelope| unsafe {
2171 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2172 });
2173
2174 let _ = self.table.get(2).map(|envelope| unsafe {
2175 envelope.read_unchecked::<::fidl_next::ClientEnd<
2176 ::fidl_next_fuchsia_io::Directory,
2177 ::fidl_next::wire::fuchsia::Channel,
2178 >>()
2179 });
2180 }
2181 }
2182
2183 impl ::fidl_next::Constrained for ComponentNamespaceEntry<'_> {
2184 type Constraint = ();
2185
2186 fn validate(
2187 _: ::fidl_next::Slot<'_, Self>,
2188 _: Self::Constraint,
2189 ) -> Result<(), ::fidl_next::ValidationError> {
2190 Ok(())
2191 }
2192 }
2193
2194 unsafe impl ::fidl_next::Wire for ComponentNamespaceEntry<'static> {
2195 type Narrowed<'de> = ComponentNamespaceEntry<'de>;
2196
2197 #[inline]
2198 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2199 ::fidl_next::munge!(let Self { table } = out);
2200 ::fidl_next::wire::Table::zero_padding(table);
2201 }
2202 }
2203
2204 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentNamespaceEntry<'de>
2205 where
2206 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2207 ___D: ::fidl_next::fuchsia::HandleDecoder,
2208 {
2209 fn decode(
2210 slot: ::fidl_next::Slot<'_, Self>,
2211 decoder: &mut ___D,
2212 _: (),
2213 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2214 ::fidl_next::munge!(let Self { table } = slot);
2215
2216 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2217 match ordinal {
2218 0 => unsafe { ::core::hint::unreachable_unchecked() },
2219
2220 1 => {
2221 ::fidl_next::wire::Envelope::decode_as::<
2222 ___D,
2223 ::fidl_next::wire::String<'de>,
2224 >(slot.as_mut(), decoder, 4095)?;
2225
2226 let value = unsafe {
2227 slot.deref_unchecked()
2228 .deref_unchecked::<::fidl_next::wire::String<'_>>()
2229 };
2230
2231 if value.len() > 4095 {
2232 return Err(::fidl_next::DecodeError::VectorTooLong {
2233 size: value.len() as u64,
2234 limit: 4095,
2235 });
2236 }
2237
2238 Ok(())
2239 }
2240
2241 2 => {
2242 ::fidl_next::wire::Envelope::decode_as::<
2243 ___D,
2244 ::fidl_next::ClientEnd<
2245 ::fidl_next_fuchsia_io::Directory,
2246 ::fidl_next::wire::fuchsia::Channel,
2247 >,
2248 >(slot.as_mut(), decoder, ())?;
2249
2250 Ok(())
2251 }
2252
2253 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2254 }
2255 })
2256 }
2257 }
2258
2259 impl<'de> ComponentNamespaceEntry<'de> {
2260 pub fn path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2261 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2262 }
2263
2264 pub fn take_path(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2265 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2266 }
2267
2268 pub fn directory(
2269 &self,
2270 ) -> ::core::option::Option<
2271 &::fidl_next::ClientEnd<
2272 ::fidl_next_fuchsia_io::Directory,
2273 ::fidl_next::wire::fuchsia::Channel,
2274 >,
2275 > {
2276 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2277 }
2278
2279 pub fn take_directory(
2280 &mut self,
2281 ) -> ::core::option::Option<
2282 ::fidl_next::ClientEnd<
2283 ::fidl_next_fuchsia_io::Directory,
2284 ::fidl_next::wire::fuchsia::Channel,
2285 >,
2286 > {
2287 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2288 }
2289 }
2290
2291 impl<'de> ::core::fmt::Debug for ComponentNamespaceEntry<'de> {
2292 fn fmt(
2293 &self,
2294 f: &mut ::core::fmt::Formatter<'_>,
2295 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2296 f.debug_struct("ComponentNamespaceEntry")
2297 .field("path", &self.path())
2298 .field("directory", &self.directory())
2299 .finish()
2300 }
2301 }
2302
2303 impl<'de> ::fidl_next::IntoNatural for ComponentNamespaceEntry<'de> {
2304 type Natural = crate::natural::ComponentNamespaceEntry;
2305 }
2306
2307 #[repr(C)]
2309 pub struct ComponentStartInfo<'de> {
2310 pub(crate) table: ::fidl_next::wire::Table<'de>,
2311 }
2312
2313 impl<'de> Drop for ComponentStartInfo<'de> {
2314 fn drop(&mut self) {
2315 let _ = self.table.get(1).map(|envelope| unsafe {
2316 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2317 });
2318
2319 let _ = self.table.get(2).map(|envelope| unsafe {
2320 envelope.read_unchecked::<::fidl_next_fuchsia_data::wire::Dictionary<'de>>()
2321 });
2322
2323 let _ = self.table.get(3)
2324 .map(|envelope| unsafe {
2325 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ComponentNamespaceEntry<'de>>>()
2326 });
2327
2328 let _ = self.table.get(4).map(|envelope| unsafe {
2329 envelope.read_unchecked::<::fidl_next::ServerEnd<
2330 ::fidl_next_fuchsia_io::Directory,
2331 ::fidl_next::wire::fuchsia::Channel,
2332 >>()
2333 });
2334
2335 let _ = self.table.get(5).map(|envelope| unsafe {
2336 envelope.read_unchecked::<::fidl_next::ServerEnd<
2337 ::fidl_next_fuchsia_io::Directory,
2338 ::fidl_next::wire::fuchsia::Channel,
2339 >>()
2340 });
2341
2342 let _ = self.table.get(6).map(|envelope| unsafe {
2343 envelope.read_unchecked::<::fidl_next::wire::Vector<
2344 'de,
2345 ::fidl_next_fuchsia_process::wire::HandleInfo,
2346 >>()
2347 });
2348
2349 let _ = self.table.get(7).map(|envelope| unsafe {
2350 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
2351 });
2352
2353 let _ = self.table.get(8).map(|envelope| unsafe {
2354 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2355 });
2356
2357 let _ = self.table.get(9).map(|envelope| unsafe {
2358 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
2359 });
2360
2361 let _ = self.table.get(10)
2362 .map(|envelope| unsafe {
2363 envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>()
2364 });
2365
2366 let _ = self.table.get(11).map(|envelope| unsafe {
2367 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2368 });
2369 }
2370 }
2371
2372 impl ::fidl_next::Constrained for ComponentStartInfo<'_> {
2373 type Constraint = ();
2374
2375 fn validate(
2376 _: ::fidl_next::Slot<'_, Self>,
2377 _: Self::Constraint,
2378 ) -> Result<(), ::fidl_next::ValidationError> {
2379 Ok(())
2380 }
2381 }
2382
2383 unsafe impl ::fidl_next::Wire for ComponentStartInfo<'static> {
2384 type Narrowed<'de> = ComponentStartInfo<'de>;
2385
2386 #[inline]
2387 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2388 ::fidl_next::munge!(let Self { table } = out);
2389 ::fidl_next::wire::Table::zero_padding(table);
2390 }
2391 }
2392
2393 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentStartInfo<'de>
2394 where
2395 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2396 ___D: ::fidl_next::fuchsia::HandleDecoder,
2397 {
2398 fn decode(
2399 slot: ::fidl_next::Slot<'_, Self>,
2400 decoder: &mut ___D,
2401 _: (),
2402 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2403 ::fidl_next::munge!(let Self { table } = slot);
2404
2405 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2406 match ordinal {
2407 0 => unsafe { ::core::hint::unreachable_unchecked() },
2408
2409 1 => {
2410 ::fidl_next::wire::Envelope::decode_as::<
2411 ___D,
2412 ::fidl_next::wire::String<'de>,
2413 >(slot.as_mut(), decoder, 4096)?;
2414
2415 let value = unsafe {
2416 slot.deref_unchecked()
2417 .deref_unchecked::<::fidl_next::wire::String<'_>>()
2418 };
2419
2420 if value.len() > 4096 {
2421 return Err(::fidl_next::DecodeError::VectorTooLong {
2422 size: value.len() as u64,
2423 limit: 4096,
2424 });
2425 }
2426
2427 Ok(())
2428 }
2429
2430 2 => {
2431 ::fidl_next::wire::Envelope::decode_as::<
2432 ___D,
2433 ::fidl_next_fuchsia_data::wire::Dictionary<'de>,
2434 >(slot.as_mut(), decoder, ())?;
2435
2436 Ok(())
2437 }
2438
2439 3 => {
2440 ::fidl_next::wire::Envelope::decode_as::<
2441 ___D,
2442 ::fidl_next::wire::Vector<
2443 'de,
2444 crate::wire::ComponentNamespaceEntry<'de>,
2445 >,
2446 >(slot.as_mut(), decoder, (32, ()))?;
2447
2448 let value = unsafe {
2449 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
2450 '_,
2451 crate::wire::ComponentNamespaceEntry<'_>,
2452 >>()
2453 };
2454
2455 if value.len() > 32 {
2456 return Err(::fidl_next::DecodeError::VectorTooLong {
2457 size: value.len() as u64,
2458 limit: 32,
2459 });
2460 }
2461
2462 Ok(())
2463 }
2464
2465 4 => {
2466 ::fidl_next::wire::Envelope::decode_as::<
2467 ___D,
2468 ::fidl_next::ServerEnd<
2469 ::fidl_next_fuchsia_io::Directory,
2470 ::fidl_next::wire::fuchsia::Channel,
2471 >,
2472 >(slot.as_mut(), decoder, ())?;
2473
2474 Ok(())
2475 }
2476
2477 5 => {
2478 ::fidl_next::wire::Envelope::decode_as::<
2479 ___D,
2480 ::fidl_next::ServerEnd<
2481 ::fidl_next_fuchsia_io::Directory,
2482 ::fidl_next::wire::fuchsia::Channel,
2483 >,
2484 >(slot.as_mut(), decoder, ())?;
2485
2486 Ok(())
2487 }
2488
2489 6 => {
2490 ::fidl_next::wire::Envelope::decode_as::<
2491 ___D,
2492 ::fidl_next::wire::Vector<
2493 'de,
2494 ::fidl_next_fuchsia_process::wire::HandleInfo,
2495 >,
2496 >(slot.as_mut(), decoder, (128, ()))?;
2497
2498 let value = unsafe {
2499 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
2500 '_,
2501 ::fidl_next_fuchsia_process::wire::HandleInfo,
2502 >>()
2503 };
2504
2505 if value.len() > 128 {
2506 return Err(::fidl_next::DecodeError::VectorTooLong {
2507 size: value.len() as u64,
2508 limit: 128,
2509 });
2510 }
2511
2512 Ok(())
2513 }
2514
2515 7 => {
2516 ::fidl_next::wire::Envelope::decode_as::<
2517 ___D,
2518 ::fidl_next_fuchsia_mem::wire::Data<'de>,
2519 >(slot.as_mut(), decoder, ())?;
2520
2521 Ok(())
2522 }
2523
2524 8 => {
2525 ::fidl_next::wire::Envelope::decode_as::<
2526 ___D,
2527 ::fidl_next::wire::fuchsia::EventPair,
2528 >(slot.as_mut(), decoder, ())?;
2529
2530 Ok(())
2531 }
2532
2533 9 => {
2534 ::fidl_next::wire::Envelope::decode_as::<
2535 ___D,
2536 ::fidl_next::wire::fuchsia::Event,
2537 >(slot.as_mut(), decoder, ())?;
2538
2539 Ok(())
2540 }
2541
2542 10 => {
2543 ::fidl_next::wire::Envelope::decode_as::<
2544 ___D,
2545 ::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef,
2546 >(slot.as_mut(), decoder, ())?;
2547
2548 Ok(())
2549 }
2550
2551 11 => {
2552 ::fidl_next::wire::Envelope::decode_as::<
2553 ___D,
2554 ::fidl_next::wire::fuchsia::EventPair,
2555 >(slot.as_mut(), decoder, ())?;
2556
2557 Ok(())
2558 }
2559
2560 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2561 }
2562 })
2563 }
2564 }
2565
2566 impl<'de> ComponentStartInfo<'de> {
2567 pub fn resolved_url(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2568 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2569 }
2570
2571 pub fn take_resolved_url(
2572 &mut self,
2573 ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2574 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2575 }
2576
2577 pub fn program(
2578 &self,
2579 ) -> ::core::option::Option<&::fidl_next_fuchsia_data::wire::Dictionary<'de>> {
2580 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2581 }
2582
2583 pub fn take_program(
2584 &mut self,
2585 ) -> ::core::option::Option<::fidl_next_fuchsia_data::wire::Dictionary<'de>> {
2586 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2587 }
2588
2589 pub fn ns(
2590 &self,
2591 ) -> ::core::option::Option<
2592 &::fidl_next::wire::Vector<'de, crate::wire::ComponentNamespaceEntry<'de>>,
2593 > {
2594 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2595 }
2596
2597 pub fn take_ns(
2598 &mut self,
2599 ) -> ::core::option::Option<
2600 ::fidl_next::wire::Vector<'de, crate::wire::ComponentNamespaceEntry<'de>>,
2601 > {
2602 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2603 }
2604
2605 pub fn outgoing_dir(
2606 &self,
2607 ) -> ::core::option::Option<
2608 &::fidl_next::ServerEnd<
2609 ::fidl_next_fuchsia_io::Directory,
2610 ::fidl_next::wire::fuchsia::Channel,
2611 >,
2612 > {
2613 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2614 }
2615
2616 pub fn take_outgoing_dir(
2617 &mut self,
2618 ) -> ::core::option::Option<
2619 ::fidl_next::ServerEnd<
2620 ::fidl_next_fuchsia_io::Directory,
2621 ::fidl_next::wire::fuchsia::Channel,
2622 >,
2623 > {
2624 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
2625 }
2626
2627 pub fn runtime_dir(
2628 &self,
2629 ) -> ::core::option::Option<
2630 &::fidl_next::ServerEnd<
2631 ::fidl_next_fuchsia_io::Directory,
2632 ::fidl_next::wire::fuchsia::Channel,
2633 >,
2634 > {
2635 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
2636 }
2637
2638 pub fn take_runtime_dir(
2639 &mut self,
2640 ) -> ::core::option::Option<
2641 ::fidl_next::ServerEnd<
2642 ::fidl_next_fuchsia_io::Directory,
2643 ::fidl_next::wire::fuchsia::Channel,
2644 >,
2645 > {
2646 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
2647 }
2648
2649 pub fn numbered_handles(
2650 &self,
2651 ) -> ::core::option::Option<
2652 &::fidl_next::wire::Vector<'de, ::fidl_next_fuchsia_process::wire::HandleInfo>,
2653 > {
2654 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
2655 }
2656
2657 pub fn take_numbered_handles(
2658 &mut self,
2659 ) -> ::core::option::Option<
2660 ::fidl_next::wire::Vector<'de, ::fidl_next_fuchsia_process::wire::HandleInfo>,
2661 > {
2662 unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
2663 }
2664
2665 pub fn encoded_config(
2666 &self,
2667 ) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
2668 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
2669 }
2670
2671 pub fn take_encoded_config(
2672 &mut self,
2673 ) -> ::core::option::Option<::fidl_next_fuchsia_mem::wire::Data<'de>> {
2674 unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
2675 }
2676
2677 pub fn break_on_start(
2678 &self,
2679 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2680 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
2681 }
2682
2683 pub fn take_break_on_start(
2684 &mut self,
2685 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
2686 unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
2687 }
2688
2689 pub fn component_instance(
2690 &self,
2691 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Event> {
2692 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
2693 }
2694
2695 pub fn take_component_instance(
2696 &mut self,
2697 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Event> {
2698 unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
2699 }
2700
2701 pub fn escrowed_dictionary(
2702 &self,
2703 ) -> ::core::option::Option<&::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>
2704 {
2705 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
2706 }
2707
2708 pub fn take_escrowed_dictionary(
2709 &mut self,
2710 ) -> ::core::option::Option<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>
2711 {
2712 unsafe { Some(self.table.get_mut(10)?.take_unchecked()) }
2713 }
2714
2715 pub fn escrowed_dictionary_handle(
2716 &self,
2717 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2718 unsafe { Some(self.table.get(11)?.deref_unchecked()) }
2719 }
2720
2721 pub fn take_escrowed_dictionary_handle(
2722 &mut self,
2723 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
2724 unsafe { Some(self.table.get_mut(11)?.take_unchecked()) }
2725 }
2726 }
2727
2728 impl<'de> ::core::fmt::Debug for ComponentStartInfo<'de> {
2729 fn fmt(
2730 &self,
2731 f: &mut ::core::fmt::Formatter<'_>,
2732 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2733 f.debug_struct("ComponentStartInfo")
2734 .field("resolved_url", &self.resolved_url())
2735 .field("program", &self.program())
2736 .field("ns", &self.ns())
2737 .field("outgoing_dir", &self.outgoing_dir())
2738 .field("runtime_dir", &self.runtime_dir())
2739 .field("numbered_handles", &self.numbered_handles())
2740 .field("encoded_config", &self.encoded_config())
2741 .field("break_on_start", &self.break_on_start())
2742 .field("component_instance", &self.component_instance())
2743 .field("escrowed_dictionary", &self.escrowed_dictionary())
2744 .field("escrowed_dictionary_handle", &self.escrowed_dictionary_handle())
2745 .finish()
2746 }
2747 }
2748
2749 impl<'de> ::fidl_next::IntoNatural for ComponentStartInfo<'de> {
2750 type Natural = crate::natural::ComponentStartInfo;
2751 }
2752
2753 #[derive(Debug)]
2755 #[repr(C)]
2756 pub struct ComponentRunnerStartRequest<'de> {
2757 pub start_info: crate::wire::ComponentStartInfo<'de>,
2758
2759 pub controller:
2760 ::fidl_next::ServerEnd<crate::ComponentController, ::fidl_next::wire::fuchsia::Channel>,
2761 }
2762
2763 static_assertions::const_assert_eq!(std::mem::size_of::<ComponentRunnerStartRequest<'_>>(), 24);
2764 static_assertions::const_assert_eq!(std::mem::align_of::<ComponentRunnerStartRequest<'_>>(), 8);
2765
2766 static_assertions::const_assert_eq!(
2767 std::mem::offset_of!(ComponentRunnerStartRequest<'_>, start_info),
2768 0
2769 );
2770
2771 static_assertions::const_assert_eq!(
2772 std::mem::offset_of!(ComponentRunnerStartRequest<'_>, controller),
2773 16
2774 );
2775
2776 impl ::fidl_next::Constrained for ComponentRunnerStartRequest<'_> {
2777 type Constraint = ();
2778
2779 fn validate(
2780 _: ::fidl_next::Slot<'_, Self>,
2781 _: Self::Constraint,
2782 ) -> Result<(), ::fidl_next::ValidationError> {
2783 Ok(())
2784 }
2785 }
2786
2787 unsafe impl ::fidl_next::Wire for ComponentRunnerStartRequest<'static> {
2788 type Narrowed<'de> = ComponentRunnerStartRequest<'de>;
2789
2790 #[inline]
2791 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2792 ::fidl_next::munge! {
2793 let Self {
2794 start_info,
2795 controller,
2796
2797 } = &mut *out_;
2798 }
2799
2800 ::fidl_next::Wire::zero_padding(start_info);
2801
2802 ::fidl_next::Wire::zero_padding(controller);
2803
2804 unsafe {
2805 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
2806 }
2807 }
2808 }
2809
2810 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentRunnerStartRequest<'de>
2811 where
2812 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2813 ___D: ::fidl_next::Decoder<'de>,
2814 ___D: ::fidl_next::fuchsia::HandleDecoder,
2815 {
2816 fn decode(
2817 slot_: ::fidl_next::Slot<'_, Self>,
2818 decoder_: &mut ___D,
2819 _: (),
2820 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2821 if slot_.as_bytes()[20..24] != [0u8; 4] {
2822 return Err(::fidl_next::DecodeError::InvalidPadding);
2823 }
2824
2825 ::fidl_next::munge! {
2826 let Self {
2827 mut start_info,
2828 mut controller,
2829
2830 } = slot_;
2831 }
2832
2833 let _field = start_info.as_mut();
2834
2835 ::fidl_next::Decode::decode(start_info.as_mut(), decoder_, ())?;
2836
2837 let _field = controller.as_mut();
2838
2839 ::fidl_next::Decode::decode(controller.as_mut(), decoder_, ())?;
2840
2841 Ok(())
2842 }
2843 }
2844
2845 impl<'de> ::fidl_next::IntoNatural for ComponentRunnerStartRequest<'de> {
2846 type Natural = crate::natural::ComponentRunnerStartRequest;
2847 }
2848
2849 #[derive(Debug)]
2851 #[repr(C)]
2852 pub struct TaskProviderGetJobResponse {
2853 pub job: ::fidl_next::wire::fuchsia::Job,
2854 }
2855
2856 static_assertions::const_assert_eq!(std::mem::size_of::<TaskProviderGetJobResponse>(), 4);
2857 static_assertions::const_assert_eq!(std::mem::align_of::<TaskProviderGetJobResponse>(), 4);
2858
2859 static_assertions::const_assert_eq!(std::mem::offset_of!(TaskProviderGetJobResponse, job), 0);
2860
2861 impl ::fidl_next::Constrained for TaskProviderGetJobResponse {
2862 type Constraint = ();
2863
2864 fn validate(
2865 _: ::fidl_next::Slot<'_, Self>,
2866 _: Self::Constraint,
2867 ) -> Result<(), ::fidl_next::ValidationError> {
2868 Ok(())
2869 }
2870 }
2871
2872 unsafe impl ::fidl_next::Wire for TaskProviderGetJobResponse {
2873 type Narrowed<'de> = TaskProviderGetJobResponse;
2874
2875 #[inline]
2876 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2877 ::fidl_next::munge! {
2878 let Self {
2879 job,
2880
2881 } = &mut *out_;
2882 }
2883
2884 ::fidl_next::Wire::zero_padding(job);
2885 }
2886 }
2887
2888 unsafe impl<___D> ::fidl_next::Decode<___D> for TaskProviderGetJobResponse
2889 where
2890 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2891 ___D: ::fidl_next::fuchsia::HandleDecoder,
2892 {
2893 fn decode(
2894 slot_: ::fidl_next::Slot<'_, Self>,
2895 decoder_: &mut ___D,
2896 _: (),
2897 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2898 ::fidl_next::munge! {
2899 let Self {
2900 mut job,
2901
2902 } = slot_;
2903 }
2904
2905 let _field = job.as_mut();
2906
2907 ::fidl_next::Decode::decode(job.as_mut(), decoder_, ())?;
2908
2909 Ok(())
2910 }
2911 }
2912
2913 impl ::fidl_next::IntoNatural for TaskProviderGetJobResponse {
2914 type Natural = crate::natural::TaskProviderGetJobResponse;
2915 }
2916}
2917
2918pub mod wire_optional {
2919
2920 pub use fidl_next_common_fuchsia_component_runner::wire_optional::*;
2921
2922 #[repr(transparent)]
2923 pub struct Task<'de> {
2924 pub(crate) raw: ::fidl_next::wire::Union,
2925 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
2926 }
2927
2928 impl ::fidl_next::Constrained for Task<'_> {
2929 type Constraint = ();
2930
2931 fn validate(
2932 _: ::fidl_next::Slot<'_, Self>,
2933 _: Self::Constraint,
2934 ) -> Result<(), ::fidl_next::ValidationError> {
2935 Ok(())
2936 }
2937 }
2938
2939 unsafe impl ::fidl_next::Wire for Task<'static> {
2940 type Narrowed<'de> = Task<'de>;
2941
2942 #[inline]
2943 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2944 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
2945 ::fidl_next::wire::Union::zero_padding(raw);
2946 }
2947 }
2948
2949 impl<'de> Task<'de> {
2950 pub fn is_some(&self) -> bool {
2951 self.raw.is_some()
2952 }
2953
2954 pub fn is_none(&self) -> bool {
2955 self.raw.is_none()
2956 }
2957
2958 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Task<'de>> {
2959 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
2960 }
2961
2962 pub fn into_option(self) -> ::core::option::Option<crate::wire::Task<'de>> {
2963 if self.is_some() {
2964 Some(crate::wire::Task { raw: self.raw, _phantom: ::core::marker::PhantomData })
2965 } else {
2966 None
2967 }
2968 }
2969 }
2970
2971 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Task<'de>
2972 where
2973 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2974 ___D: ::fidl_next::Decoder<'de>,
2975 ___D: ::fidl_next::fuchsia::HandleDecoder,
2976 {
2977 fn decode(
2978 mut slot: ::fidl_next::Slot<'_, Self>,
2979 decoder: &mut ___D,
2980 _: (),
2981 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2982 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2983 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
2984 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Job>(
2985 raw,
2986 decoder,
2987 (),
2988 )?,
2989
2990 2 => ::fidl_next::wire::Union::decode_as::<
2991 ___D,
2992 ::fidl_next::wire::fuchsia::Process,
2993 >(raw, decoder, ())?,
2994
2995 3 => {
2996 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Thread>(
2997 raw,
2998 decoder,
2999 (),
3000 )?
3001 }
3002
3003 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
3004 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
3005 }
3006
3007 Ok(())
3008 }
3009 }
3010
3011 impl<'de> ::core::fmt::Debug for Task<'de> {
3012 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3013 self.as_ref().fmt(f)
3014 }
3015 }
3016
3017 impl<'de> ::fidl_next::IntoNatural for Task<'de> {
3018 type Natural = ::core::option::Option<crate::natural::Task>;
3019 }
3020}
3021
3022pub mod generic {
3023
3024 pub use fidl_next_common_fuchsia_component_runner::generic::*;
3025
3026 pub struct ComponentControllerOnPublishDiagnosticsRequest<T0> {
3028 pub payload: T0,
3029 }
3030
3031 unsafe impl<___E, T0>
3032 ::fidl_next::Encode<
3033 crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>,
3034 ___E,
3035 > for ComponentControllerOnPublishDiagnosticsRequest<T0>
3036 where
3037 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3038 ___E: ::fidl_next::Encoder,
3039 ___E: ::fidl_next::fuchsia::HandleEncoder,
3040 T0: ::fidl_next::Encode<crate::wire::ComponentDiagnostics<'static>, ___E>,
3041 {
3042 #[inline]
3043 fn encode(
3044 self,
3045 encoder_: &mut ___E,
3046 out_: &mut ::core::mem::MaybeUninit<
3047 crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>,
3048 >,
3049 _: (),
3050 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3051 ::fidl_next::munge! {
3052 let crate::wire::ComponentControllerOnPublishDiagnosticsRequest {
3053 payload,
3054
3055 } = out_;
3056 }
3057
3058 ::fidl_next::Encode::encode(self.payload, encoder_, payload, ())?;
3059
3060 Ok(())
3061 }
3062 }
3063
3064 pub struct ComponentRunnerStartRequest<T0, T1> {
3066 pub start_info: T0,
3067
3068 pub controller: T1,
3069 }
3070
3071 unsafe impl<___E, T0, T1>
3072 ::fidl_next::Encode<crate::wire::ComponentRunnerStartRequest<'static>, ___E>
3073 for ComponentRunnerStartRequest<T0, T1>
3074 where
3075 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3076 ___E: ::fidl_next::Encoder,
3077 ___E: ::fidl_next::fuchsia::HandleEncoder,
3078 T0: ::fidl_next::Encode<crate::wire::ComponentStartInfo<'static>, ___E>,
3079 T1: ::fidl_next::Encode<
3080 ::fidl_next::ServerEnd<
3081 crate::ComponentController,
3082 ::fidl_next::wire::fuchsia::Channel,
3083 >,
3084 ___E,
3085 >,
3086 {
3087 #[inline]
3088 fn encode(
3089 self,
3090 encoder_: &mut ___E,
3091 out_: &mut ::core::mem::MaybeUninit<crate::wire::ComponentRunnerStartRequest<'static>>,
3092 _: (),
3093 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3094 ::fidl_next::munge! {
3095 let crate::wire::ComponentRunnerStartRequest {
3096 start_info,
3097 controller,
3098
3099 } = out_;
3100 }
3101
3102 ::fidl_next::Encode::encode(self.start_info, encoder_, start_info, ())?;
3103
3104 ::fidl_next::Encode::encode(self.controller, encoder_, controller, ())?;
3105
3106 Ok(())
3107 }
3108 }
3109
3110 pub struct TaskProviderGetJobResponse<T0> {
3112 pub job: T0,
3113 }
3114
3115 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::TaskProviderGetJobResponse, ___E>
3116 for TaskProviderGetJobResponse<T0>
3117 where
3118 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3119 ___E: ::fidl_next::fuchsia::HandleEncoder,
3120 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Job, ___E>,
3121 {
3122 #[inline]
3123 fn encode(
3124 self,
3125 encoder_: &mut ___E,
3126 out_: &mut ::core::mem::MaybeUninit<crate::wire::TaskProviderGetJobResponse>,
3127 _: (),
3128 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3129 ::fidl_next::munge! {
3130 let crate::wire::TaskProviderGetJobResponse {
3131 job,
3132
3133 } = out_;
3134 }
3135
3136 ::fidl_next::Encode::encode(self.job, encoder_, job, ())?;
3137
3138 Ok(())
3139 }
3140 }
3141}
3142
3143pub use self::natural::*;
3144
3145#[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"]
3147#[derive(PartialEq, Debug)]
3148pub struct ComponentController;
3149
3150#[cfg(target_os = "fuchsia")]
3151impl ::fidl_next::HasTransport for ComponentController {
3152 type Transport = ::fidl_next::fuchsia::zx::Channel;
3153}
3154
3155pub mod component_controller {
3156 pub mod prelude {
3157 pub use crate::{
3158 ComponentController, ComponentControllerClientHandler,
3159 ComponentControllerLocalClientHandler, ComponentControllerLocalServerHandler,
3160 ComponentControllerServerHandler, component_controller,
3161 };
3162
3163 pub use crate::natural::ComponentControllerOnEscrowRequest;
3164
3165 pub use crate::natural::ComponentControllerOnPublishDiagnosticsRequest;
3166
3167 pub use crate::natural::ComponentStopInfo;
3168 }
3169
3170 pub struct Stop;
3171
3172 impl ::fidl_next::Method for Stop {
3173 const ORDINAL: u64 = 4804506821232171874;
3174 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3175 ::fidl_next::protocol::Flexibility::Strict;
3176
3177 type Protocol = crate::ComponentController;
3178
3179 type Request = ::fidl_next::wire::EmptyMessageBody;
3180 }
3181
3182 pub struct Kill;
3183
3184 impl ::fidl_next::Method for Kill {
3185 const ORDINAL: u64 = 4514346391631670964;
3186 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3187 ::fidl_next::protocol::Flexibility::Strict;
3188
3189 type Protocol = crate::ComponentController;
3190
3191 type Request = ::fidl_next::wire::EmptyMessageBody;
3192 }
3193
3194 pub struct OnPublishDiagnostics;
3195
3196 impl ::fidl_next::Method for OnPublishDiagnostics {
3197 const ORDINAL: u64 = 2240216199992207687;
3198 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3199 ::fidl_next::protocol::Flexibility::Strict;
3200
3201 type Protocol = crate::ComponentController;
3202
3203 type Request = crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>;
3204 }
3205
3206 pub struct OnEscrow;
3207
3208 impl ::fidl_next::Method for OnEscrow {
3209 const ORDINAL: u64 = 730448769712342012;
3210 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3211 ::fidl_next::protocol::Flexibility::Flexible;
3212
3213 type Protocol = crate::ComponentController;
3214
3215 type Request = crate::wire::ComponentControllerOnEscrowRequest<'static>;
3216 }
3217
3218 pub struct OnStop;
3219
3220 impl ::fidl_next::Method for OnStop {
3221 const ORDINAL: u64 = 4322651556509354674;
3222 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3223 ::fidl_next::protocol::Flexibility::Flexible;
3224
3225 type Protocol = crate::ComponentController;
3226
3227 type Request = crate::wire::ComponentStopInfo<'static>;
3228 }
3229
3230 mod ___detail {
3231 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ComponentController
3232 where
3233 ___T: ::fidl_next::Transport,
3234 {
3235 type Client = ComponentControllerClient<___T>;
3236 type Server = ComponentControllerServer<___T>;
3237 }
3238
3239 #[repr(transparent)]
3241 pub struct ComponentControllerClient<___T: ::fidl_next::Transport> {
3242 #[allow(dead_code)]
3243 client: ::fidl_next::protocol::Client<___T>,
3244 }
3245
3246 impl<___T> ComponentControllerClient<___T>
3247 where
3248 ___T: ::fidl_next::Transport,
3249 {
3250 #[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"]
3251 pub fn stop(&self) -> ::fidl_next::SendFuture<'_, ___T> {
3252 ::fidl_next::SendFuture::from_untyped(
3253 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
3254 4804506821232171874,
3255 <super::Stop as ::fidl_next::Method>::FLEXIBILITY,
3256 (),
3257 ),
3258 )
3259 }
3260
3261 #[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"]
3262 pub fn kill(&self) -> ::fidl_next::SendFuture<'_, ___T> {
3263 ::fidl_next::SendFuture::from_untyped(
3264 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
3265 4514346391631670964,
3266 <super::Kill as ::fidl_next::Method>::FLEXIBILITY,
3267 (),
3268 ),
3269 )
3270 }
3271 }
3272
3273 #[repr(transparent)]
3275 pub struct ComponentControllerServer<___T: ::fidl_next::Transport> {
3276 server: ::fidl_next::protocol::Server<___T>,
3277 }
3278
3279 impl<___T> ComponentControllerServer<___T>
3280 where
3281 ___T: ::fidl_next::Transport,
3282 {
3283 #[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"]
3284 pub fn on_publish_diagnostics(
3285 &self,
3286
3287 payload: impl ::fidl_next::Encode<
3288 crate::wire::ComponentDiagnostics<'static>,
3289 <___T as ::fidl_next::Transport>::SendBuffer,
3290 >,
3291 ) -> ::fidl_next::SendFuture<'_, ___T>
3292 where
3293 <___T as ::fidl_next::Transport>::SendBuffer:
3294 ::fidl_next::encoder::InternalHandleEncoder,
3295 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3296 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3297 {
3298 self.on_publish_diagnostics_with(
3299 crate::generic::ComponentControllerOnPublishDiagnosticsRequest { payload },
3300 )
3301 }
3302
3303 #[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"]
3304
3305 pub fn on_publish_diagnostics_with<___R>(
3306 &self,
3307 request: ___R,
3308 ) -> ::fidl_next::SendFuture<'_, ___T>
3309 where
3310 ___R: ::fidl_next::Encode<
3311 <super::OnPublishDiagnostics as ::fidl_next::Method>::Request,
3312 <___T as ::fidl_next::Transport>::SendBuffer,
3313 >,
3314 {
3315 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3316 2240216199992207687,
3317 <super::OnPublishDiagnostics as ::fidl_next::Method>::FLEXIBILITY,
3318 request,
3319 ))
3320 }
3321
3322 #[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"]
3323
3324 pub fn on_escrow_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3325 where
3326 ___R: ::fidl_next::Encode<
3327 <super::OnEscrow as ::fidl_next::Method>::Request,
3328 <___T as ::fidl_next::Transport>::SendBuffer,
3329 >,
3330 {
3331 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3332 730448769712342012,
3333 <super::OnEscrow as ::fidl_next::Method>::FLEXIBILITY,
3334 request,
3335 ))
3336 }
3337
3338 #[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"]
3339
3340 pub fn on_stop_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3341 where
3342 ___R: ::fidl_next::Encode<
3343 <super::OnStop as ::fidl_next::Method>::Request,
3344 <___T as ::fidl_next::Transport>::SendBuffer,
3345 >,
3346 {
3347 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3348 4322651556509354674,
3349 <super::OnStop as ::fidl_next::Method>::FLEXIBILITY,
3350 request,
3351 ))
3352 }
3353 }
3354 }
3355}
3356
3357#[diagnostic::on_unimplemented(
3358 note = "If {Self} implements the non-local ComponentControllerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3359)]
3360
3361pub trait ComponentControllerLocalClientHandler<
3365 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3366 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3367>
3368{
3369 #[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"]
3370 fn on_publish_diagnostics(
3371 &mut self,
3372
3373 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3374 ) -> impl ::core::future::Future<Output = ()>;
3375
3376 #[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"]
3377 fn on_escrow(
3378 &mut self,
3379
3380 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3381 ) -> impl ::core::future::Future<Output = ()>;
3382
3383 #[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"]
3384 fn on_stop(
3385 &mut self,
3386
3387 request: ::fidl_next::Request<component_controller::OnStop, ___T>,
3388 ) -> impl ::core::future::Future<Output = ()>;
3389
3390 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3391 ::core::future::ready(())
3392 }
3393}
3394
3395impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ComponentController
3396where
3397 ___H: ComponentControllerLocalClientHandler<___T>,
3398 ___T: ::fidl_next::Transport,
3399 for<'de> crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'de>: ::fidl_next::Decode<
3400 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3401 Constraint = (),
3402 >,
3403 for<'de> crate::wire::ComponentControllerOnEscrowRequest<'de>: ::fidl_next::Decode<
3404 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3405 Constraint = (),
3406 >,
3407 for<'de> crate::wire::ComponentStopInfo<'de>: ::fidl_next::Decode<
3408 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3409 Constraint = (),
3410 >,
3411{
3412 async fn on_event(
3413 handler: &mut ___H,
3414 mut message: ::fidl_next::Message<___T>,
3415 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3416 match *message.header().ordinal {
3417 2240216199992207687 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3418 Ok(decoded) => {
3419 handler
3420 .on_publish_diagnostics(::fidl_next::Request::from_decoded(decoded))
3421 .await;
3422 Ok(())
3423 }
3424 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3425 ordinal: 2240216199992207687,
3426 error,
3427 }),
3428 },
3429
3430 730448769712342012 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3431 Ok(decoded) => {
3432 handler.on_escrow(::fidl_next::Request::from_decoded(decoded)).await;
3433 Ok(())
3434 }
3435 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3436 ordinal: 730448769712342012,
3437 error,
3438 }),
3439 },
3440
3441 4322651556509354674 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3442 Ok(decoded) => {
3443 handler.on_stop(::fidl_next::Request::from_decoded(decoded)).await;
3444 Ok(())
3445 }
3446 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3447 ordinal: 4322651556509354674,
3448 error,
3449 }),
3450 },
3451
3452 ordinal => {
3453 handler.on_unknown_interaction(ordinal).await;
3454 if ::core::matches!(
3455 message.header().flexibility(),
3456 ::fidl_next::protocol::Flexibility::Strict
3457 ) {
3458 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3459 } else {
3460 Ok(())
3461 }
3462 }
3463 }
3464 }
3465}
3466
3467#[diagnostic::on_unimplemented(
3468 note = "If {Self} implements the non-local ComponentControllerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3469)]
3470
3471pub trait ComponentControllerLocalServerHandler<
3475 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3476 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3477>
3478{
3479 #[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"]
3480 fn stop(&mut self) -> impl ::core::future::Future<Output = ()>;
3481
3482 #[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"]
3483 fn kill(&mut self) -> impl ::core::future::Future<Output = ()>;
3484
3485 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3486 ::core::future::ready(())
3487 }
3488}
3489
3490impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ComponentController
3491where
3492 ___H: ComponentControllerLocalServerHandler<___T>,
3493 ___T: ::fidl_next::Transport,
3494{
3495 async fn on_one_way(
3496 handler: &mut ___H,
3497 mut message: ::fidl_next::Message<___T>,
3498 ) -> ::core::result::Result<
3499 (),
3500 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3501 > {
3502 match *message.header().ordinal {
3503 4804506821232171874 => {
3504 handler.stop().await;
3505 Ok(())
3506 }
3507
3508 4514346391631670964 => {
3509 handler.kill().await;
3510 Ok(())
3511 }
3512
3513 ordinal => {
3514 handler.on_unknown_interaction(ordinal).await;
3515 if ::core::matches!(
3516 message.header().flexibility(),
3517 ::fidl_next::protocol::Flexibility::Strict
3518 ) {
3519 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3520 } else {
3521 Ok(())
3522 }
3523 }
3524 }
3525 }
3526
3527 async fn on_two_way(
3528 handler: &mut ___H,
3529 mut message: ::fidl_next::Message<___T>,
3530 responder: ::fidl_next::protocol::Responder<___T>,
3531 ) -> ::core::result::Result<
3532 (),
3533 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3534 > {
3535 match *message.header().ordinal {
3536 ordinal => {
3537 handler.on_unknown_interaction(ordinal).await;
3538 if ::core::matches!(
3539 message.header().flexibility(),
3540 ::fidl_next::protocol::Flexibility::Strict
3541 ) {
3542 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3543 } else {
3544 responder
3545 .respond_framework_error(
3546 ordinal,
3547 ::fidl_next::FrameworkError::UnknownMethod,
3548 )
3549 .expect("encoding a framework error should never fail")
3550 .await?;
3551 Ok(())
3552 }
3553 }
3554 }
3555 }
3556}
3557
3558pub trait ComponentControllerClientHandler<
3562 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3563 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3564>
3565{
3566 #[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"]
3567 fn on_publish_diagnostics(
3568 &mut self,
3569
3570 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3571 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3572
3573 #[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"]
3574 fn on_escrow(
3575 &mut self,
3576
3577 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3578 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3579
3580 #[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"]
3581 fn on_stop(
3582 &mut self,
3583
3584 request: ::fidl_next::Request<component_controller::OnStop, ___T>,
3585 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3586
3587 fn on_unknown_interaction(
3588 &mut self,
3589 ordinal: u64,
3590 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3591 ::core::future::ready(())
3592 }
3593}
3594
3595impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ComponentController
3596where
3597 ___H: ComponentControllerClientHandler<___T> + ::core::marker::Send,
3598 ___T: ::fidl_next::Transport,
3599 for<'de> crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'de>: ::fidl_next::Decode<
3600 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3601 Constraint = (),
3602 >,
3603 for<'de> crate::wire::ComponentControllerOnEscrowRequest<'de>: ::fidl_next::Decode<
3604 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3605 Constraint = (),
3606 >,
3607 for<'de> crate::wire::ComponentStopInfo<'de>: ::fidl_next::Decode<
3608 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3609 Constraint = (),
3610 >,
3611{
3612 async fn on_event(
3613 handler: &mut ___H,
3614 mut message: ::fidl_next::Message<___T>,
3615 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3616 match *message.header().ordinal {
3617 2240216199992207687 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3618 Ok(decoded) => {
3619 handler
3620 .on_publish_diagnostics(::fidl_next::Request::from_decoded(decoded))
3621 .await;
3622 Ok(())
3623 }
3624 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3625 ordinal: 2240216199992207687,
3626 error,
3627 }),
3628 },
3629
3630 730448769712342012 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3631 Ok(decoded) => {
3632 handler.on_escrow(::fidl_next::Request::from_decoded(decoded)).await;
3633 Ok(())
3634 }
3635 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3636 ordinal: 730448769712342012,
3637 error,
3638 }),
3639 },
3640
3641 4322651556509354674 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3642 Ok(decoded) => {
3643 handler.on_stop(::fidl_next::Request::from_decoded(decoded)).await;
3644 Ok(())
3645 }
3646 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3647 ordinal: 4322651556509354674,
3648 error,
3649 }),
3650 },
3651
3652 ordinal => {
3653 handler.on_unknown_interaction(ordinal).await;
3654 if ::core::matches!(
3655 message.header().flexibility(),
3656 ::fidl_next::protocol::Flexibility::Strict
3657 ) {
3658 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3659 } else {
3660 Ok(())
3661 }
3662 }
3663 }
3664 }
3665}
3666
3667pub trait ComponentControllerServerHandler<
3671 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3672 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3673>
3674{
3675 #[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"]
3676 fn stop(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3677
3678 #[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"]
3679 fn kill(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3680
3681 fn on_unknown_interaction(
3682 &mut self,
3683 ordinal: u64,
3684 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3685 ::core::future::ready(())
3686 }
3687}
3688
3689impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ComponentController
3690where
3691 ___H: ComponentControllerServerHandler<___T> + ::core::marker::Send,
3692 ___T: ::fidl_next::Transport,
3693{
3694 async fn on_one_way(
3695 handler: &mut ___H,
3696 mut message: ::fidl_next::Message<___T>,
3697 ) -> ::core::result::Result<
3698 (),
3699 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3700 > {
3701 match *message.header().ordinal {
3702 4804506821232171874 => {
3703 handler.stop().await;
3704 Ok(())
3705 }
3706
3707 4514346391631670964 => {
3708 handler.kill().await;
3709 Ok(())
3710 }
3711
3712 ordinal => {
3713 handler.on_unknown_interaction(ordinal).await;
3714 if ::core::matches!(
3715 message.header().flexibility(),
3716 ::fidl_next::protocol::Flexibility::Strict
3717 ) {
3718 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3719 } else {
3720 Ok(())
3721 }
3722 }
3723 }
3724 }
3725
3726 async fn on_two_way(
3727 handler: &mut ___H,
3728 mut message: ::fidl_next::Message<___T>,
3729 responder: ::fidl_next::protocol::Responder<___T>,
3730 ) -> ::core::result::Result<
3731 (),
3732 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3733 > {
3734 match *message.header().ordinal {
3735 ordinal => {
3736 handler.on_unknown_interaction(ordinal).await;
3737 if ::core::matches!(
3738 message.header().flexibility(),
3739 ::fidl_next::protocol::Flexibility::Strict
3740 ) {
3741 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3742 } else {
3743 responder
3744 .respond_framework_error(
3745 ordinal,
3746 ::fidl_next::FrameworkError::UnknownMethod,
3747 )
3748 .expect("encoding a framework error should never fail")
3749 .await?;
3750 Ok(())
3751 }
3752 }
3753 }
3754 }
3755}
3756
3757impl<___T> ComponentControllerClientHandler<___T> for ::fidl_next::IgnoreEvents
3758where
3759 ___T: ::fidl_next::Transport,
3760{
3761 async fn on_publish_diagnostics(
3762 &mut self,
3763
3764 _: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3765 ) {
3766 }
3767
3768 async fn on_escrow(&mut self, _: ::fidl_next::Request<component_controller::OnEscrow, ___T>) {}
3769
3770 async fn on_stop(&mut self, _: ::fidl_next::Request<component_controller::OnStop, ___T>) {}
3771
3772 async fn on_unknown_interaction(&mut self, _: u64) {}
3773}
3774
3775impl<___H, ___T> ComponentControllerLocalClientHandler<___T> for ::fidl_next::Local<___H>
3776where
3777 ___H: ComponentControllerClientHandler<___T>,
3778 ___T: ::fidl_next::Transport,
3779{
3780 async fn on_publish_diagnostics(
3781 &mut self,
3782
3783 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3784 ) {
3785 ___H::on_publish_diagnostics(&mut self.0, request).await
3786 }
3787
3788 async fn on_escrow(
3789 &mut self,
3790
3791 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3792 ) {
3793 ___H::on_escrow(&mut self.0, request).await
3794 }
3795
3796 async fn on_stop(&mut self, request: ::fidl_next::Request<component_controller::OnStop, ___T>) {
3797 ___H::on_stop(&mut self.0, request).await
3798 }
3799
3800 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3801 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3802 }
3803}
3804
3805impl<___H, ___T> ComponentControllerLocalServerHandler<___T> for ::fidl_next::Local<___H>
3806where
3807 ___H: ComponentControllerServerHandler<___T>,
3808 ___T: ::fidl_next::Transport,
3809{
3810 async fn stop(&mut self) {
3811 ___H::stop(&mut self.0).await
3812 }
3813
3814 async fn kill(&mut self) {
3815 ___H::kill(&mut self.0).await
3816 }
3817
3818 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3819 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3820 }
3821}
3822
3823#[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"]
3825#[derive(PartialEq, Debug)]
3826pub struct ComponentRunner;
3827
3828impl ::fidl_next::Discoverable for ComponentRunner {
3829 const PROTOCOL_NAME: &'static str = "fuchsia.component.runner.ComponentRunner";
3830}
3831
3832#[cfg(target_os = "fuchsia")]
3833impl ::fidl_next::HasTransport for ComponentRunner {
3834 type Transport = ::fidl_next::fuchsia::zx::Channel;
3835}
3836
3837pub mod component_runner {
3838 pub mod prelude {
3839 pub use crate::{
3840 ComponentRunner, ComponentRunnerClientHandler, ComponentRunnerLocalClientHandler,
3841 ComponentRunnerLocalServerHandler, ComponentRunnerServerHandler, component_runner,
3842 };
3843
3844 pub use crate::natural::ComponentRunnerStartRequest;
3845 }
3846
3847 pub struct Start;
3848
3849 impl ::fidl_next::Method for Start {
3850 const ORDINAL: u64 = 780715659970866697;
3851 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3852 ::fidl_next::protocol::Flexibility::Strict;
3853
3854 type Protocol = crate::ComponentRunner;
3855
3856 type Request = crate::wire::ComponentRunnerStartRequest<'static>;
3857 }
3858
3859 mod ___detail {
3860 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ComponentRunner
3861 where
3862 ___T: ::fidl_next::Transport,
3863 {
3864 type Client = ComponentRunnerClient<___T>;
3865 type Server = ComponentRunnerServer<___T>;
3866 }
3867
3868 #[repr(transparent)]
3870 pub struct ComponentRunnerClient<___T: ::fidl_next::Transport> {
3871 #[allow(dead_code)]
3872 client: ::fidl_next::protocol::Client<___T>,
3873 }
3874
3875 impl<___T> ComponentRunnerClient<___T>
3876 where
3877 ___T: ::fidl_next::Transport,
3878 {
3879 #[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"]
3880 pub fn start(
3881 &self,
3882
3883 start_info: impl ::fidl_next::Encode<
3884 crate::wire::ComponentStartInfo<'static>,
3885 <___T as ::fidl_next::Transport>::SendBuffer,
3886 >,
3887
3888 controller: impl ::fidl_next::Encode<
3889 ::fidl_next::ServerEnd<
3890 crate::ComponentController,
3891 ::fidl_next::wire::fuchsia::Channel,
3892 >,
3893 <___T as ::fidl_next::Transport>::SendBuffer,
3894 >,
3895 ) -> ::fidl_next::SendFuture<'_, ___T>
3896 where
3897 <___T as ::fidl_next::Transport>::SendBuffer:
3898 ::fidl_next::encoder::InternalHandleEncoder,
3899 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3900 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3901 {
3902 self.start_with(crate::generic::ComponentRunnerStartRequest {
3903 start_info,
3904
3905 controller,
3906 })
3907 }
3908
3909 #[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"]
3910 pub fn start_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3911 where
3912 ___R: ::fidl_next::Encode<
3913 crate::wire::ComponentRunnerStartRequest<'static>,
3914 <___T as ::fidl_next::Transport>::SendBuffer,
3915 >,
3916 {
3917 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3918 780715659970866697,
3919 <super::Start as ::fidl_next::Method>::FLEXIBILITY,
3920 request,
3921 ))
3922 }
3923 }
3924
3925 #[repr(transparent)]
3927 pub struct ComponentRunnerServer<___T: ::fidl_next::Transport> {
3928 server: ::fidl_next::protocol::Server<___T>,
3929 }
3930
3931 impl<___T> ComponentRunnerServer<___T> where ___T: ::fidl_next::Transport {}
3932 }
3933}
3934
3935#[diagnostic::on_unimplemented(
3936 note = "If {Self} implements the non-local ComponentRunnerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3937)]
3938
3939pub trait ComponentRunnerLocalClientHandler<
3943 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3944 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3945>
3946{
3947 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3948 ::core::future::ready(())
3949 }
3950}
3951
3952impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ComponentRunner
3953where
3954 ___H: ComponentRunnerLocalClientHandler<___T>,
3955 ___T: ::fidl_next::Transport,
3956{
3957 async fn on_event(
3958 handler: &mut ___H,
3959 mut message: ::fidl_next::Message<___T>,
3960 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3961 match *message.header().ordinal {
3962 ordinal => {
3963 handler.on_unknown_interaction(ordinal).await;
3964 if ::core::matches!(
3965 message.header().flexibility(),
3966 ::fidl_next::protocol::Flexibility::Strict
3967 ) {
3968 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3969 } else {
3970 Ok(())
3971 }
3972 }
3973 }
3974 }
3975}
3976
3977#[diagnostic::on_unimplemented(
3978 note = "If {Self} implements the non-local ComponentRunnerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3979)]
3980
3981pub trait ComponentRunnerLocalServerHandler<
3985 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3986 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3987>
3988{
3989 #[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"]
3990 fn start(
3991 &mut self,
3992
3993 request: ::fidl_next::Request<component_runner::Start, ___T>,
3994 ) -> impl ::core::future::Future<Output = ()>;
3995
3996 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3997 ::core::future::ready(())
3998 }
3999}
4000
4001impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ComponentRunner
4002where
4003 ___H: ComponentRunnerLocalServerHandler<___T>,
4004 ___T: ::fidl_next::Transport,
4005 for<'de> crate::wire::ComponentRunnerStartRequest<'de>: ::fidl_next::Decode<
4006 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4007 Constraint = (),
4008 >,
4009{
4010 async fn on_one_way(
4011 handler: &mut ___H,
4012 mut message: ::fidl_next::Message<___T>,
4013 ) -> ::core::result::Result<
4014 (),
4015 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4016 > {
4017 match *message.header().ordinal {
4018 780715659970866697 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4019 Ok(decoded) => {
4020 handler.start(::fidl_next::Request::from_decoded(decoded)).await;
4021 Ok(())
4022 }
4023 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4024 ordinal: 780715659970866697,
4025 error,
4026 }),
4027 },
4028
4029 ordinal => {
4030 handler.on_unknown_interaction(ordinal).await;
4031 if ::core::matches!(
4032 message.header().flexibility(),
4033 ::fidl_next::protocol::Flexibility::Strict
4034 ) {
4035 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4036 } else {
4037 Ok(())
4038 }
4039 }
4040 }
4041 }
4042
4043 async fn on_two_way(
4044 handler: &mut ___H,
4045 mut message: ::fidl_next::Message<___T>,
4046 responder: ::fidl_next::protocol::Responder<___T>,
4047 ) -> ::core::result::Result<
4048 (),
4049 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4050 > {
4051 match *message.header().ordinal {
4052 ordinal => {
4053 handler.on_unknown_interaction(ordinal).await;
4054 if ::core::matches!(
4055 message.header().flexibility(),
4056 ::fidl_next::protocol::Flexibility::Strict
4057 ) {
4058 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4059 } else {
4060 responder
4061 .respond_framework_error(
4062 ordinal,
4063 ::fidl_next::FrameworkError::UnknownMethod,
4064 )
4065 .expect("encoding a framework error should never fail")
4066 .await?;
4067 Ok(())
4068 }
4069 }
4070 }
4071 }
4072}
4073
4074pub trait ComponentRunnerClientHandler<
4078 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4079 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4080>
4081{
4082 fn on_unknown_interaction(
4083 &mut self,
4084 ordinal: u64,
4085 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4086 ::core::future::ready(())
4087 }
4088}
4089
4090impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ComponentRunner
4091where
4092 ___H: ComponentRunnerClientHandler<___T> + ::core::marker::Send,
4093 ___T: ::fidl_next::Transport,
4094{
4095 async fn on_event(
4096 handler: &mut ___H,
4097 mut message: ::fidl_next::Message<___T>,
4098 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4099 match *message.header().ordinal {
4100 ordinal => {
4101 handler.on_unknown_interaction(ordinal).await;
4102 if ::core::matches!(
4103 message.header().flexibility(),
4104 ::fidl_next::protocol::Flexibility::Strict
4105 ) {
4106 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4107 } else {
4108 Ok(())
4109 }
4110 }
4111 }
4112 }
4113}
4114
4115pub trait ComponentRunnerServerHandler<
4119 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4120 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4121>
4122{
4123 #[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"]
4124 fn start(
4125 &mut self,
4126
4127 request: ::fidl_next::Request<component_runner::Start, ___T>,
4128 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4129
4130 fn on_unknown_interaction(
4131 &mut self,
4132 ordinal: u64,
4133 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4134 ::core::future::ready(())
4135 }
4136}
4137
4138impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ComponentRunner
4139where
4140 ___H: ComponentRunnerServerHandler<___T> + ::core::marker::Send,
4141 ___T: ::fidl_next::Transport,
4142 for<'de> crate::wire::ComponentRunnerStartRequest<'de>: ::fidl_next::Decode<
4143 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4144 Constraint = (),
4145 >,
4146{
4147 async fn on_one_way(
4148 handler: &mut ___H,
4149 mut message: ::fidl_next::Message<___T>,
4150 ) -> ::core::result::Result<
4151 (),
4152 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4153 > {
4154 match *message.header().ordinal {
4155 780715659970866697 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4156 Ok(decoded) => {
4157 handler.start(::fidl_next::Request::from_decoded(decoded)).await;
4158 Ok(())
4159 }
4160 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4161 ordinal: 780715659970866697,
4162 error,
4163 }),
4164 },
4165
4166 ordinal => {
4167 handler.on_unknown_interaction(ordinal).await;
4168 if ::core::matches!(
4169 message.header().flexibility(),
4170 ::fidl_next::protocol::Flexibility::Strict
4171 ) {
4172 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4173 } else {
4174 Ok(())
4175 }
4176 }
4177 }
4178 }
4179
4180 async fn on_two_way(
4181 handler: &mut ___H,
4182 mut message: ::fidl_next::Message<___T>,
4183 responder: ::fidl_next::protocol::Responder<___T>,
4184 ) -> ::core::result::Result<
4185 (),
4186 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4187 > {
4188 match *message.header().ordinal {
4189 ordinal => {
4190 handler.on_unknown_interaction(ordinal).await;
4191 if ::core::matches!(
4192 message.header().flexibility(),
4193 ::fidl_next::protocol::Flexibility::Strict
4194 ) {
4195 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4196 } else {
4197 responder
4198 .respond_framework_error(
4199 ordinal,
4200 ::fidl_next::FrameworkError::UnknownMethod,
4201 )
4202 .expect("encoding a framework error should never fail")
4203 .await?;
4204 Ok(())
4205 }
4206 }
4207 }
4208 }
4209}
4210
4211impl<___T> ComponentRunnerClientHandler<___T> for ::fidl_next::IgnoreEvents
4212where
4213 ___T: ::fidl_next::Transport,
4214{
4215 async fn on_unknown_interaction(&mut self, _: u64) {}
4216}
4217
4218impl<___H, ___T> ComponentRunnerLocalClientHandler<___T> for ::fidl_next::Local<___H>
4219where
4220 ___H: ComponentRunnerClientHandler<___T>,
4221 ___T: ::fidl_next::Transport,
4222{
4223 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4224 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4225 }
4226}
4227
4228impl<___H, ___T> ComponentRunnerLocalServerHandler<___T> for ::fidl_next::Local<___H>
4229where
4230 ___H: ComponentRunnerServerHandler<___T>,
4231 ___T: ::fidl_next::Transport,
4232{
4233 async fn start(&mut self, request: ::fidl_next::Request<component_runner::Start, ___T>) {
4234 ___H::start(&mut self.0, request).await
4235 }
4236
4237 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4238 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4239 }
4240}
4241
4242#[doc = " Served by runners that want to make a zircon job available through their runtime directory.\n"]
4244#[derive(PartialEq, Debug)]
4245pub struct TaskProvider;
4246
4247impl ::fidl_next::Discoverable for TaskProvider {
4248 const PROTOCOL_NAME: &'static str = "fuchsia.component.runner.TaskProvider";
4249}
4250
4251#[cfg(target_os = "fuchsia")]
4252impl ::fidl_next::HasTransport for TaskProvider {
4253 type Transport = ::fidl_next::fuchsia::zx::Channel;
4254}
4255
4256pub mod task_provider {
4257 pub mod prelude {
4258 pub use crate::{
4259 TaskProvider, TaskProviderClientHandler, TaskProviderLocalClientHandler,
4260 TaskProviderLocalServerHandler, TaskProviderServerHandler, task_provider,
4261 };
4262
4263 pub use crate::natural::TaskProviderGetJobResponse;
4264 }
4265
4266 pub struct GetJob;
4267
4268 impl ::fidl_next::Method for GetJob {
4269 const ORDINAL: u64 = 5520468615388521389;
4270 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4271 ::fidl_next::protocol::Flexibility::Strict;
4272
4273 type Protocol = crate::TaskProvider;
4274
4275 type Request = ::fidl_next::wire::EmptyMessageBody;
4276 }
4277
4278 impl ::fidl_next::TwoWayMethod for GetJob {
4279 type Response = ::fidl_next::wire::Result<
4280 'static,
4281 crate::wire::TaskProviderGetJobResponse,
4282 ::fidl_next::wire::fuchsia::Status,
4283 >;
4284 }
4285
4286 impl<___R> ::fidl_next::Respond<___R> for GetJob {
4287 type Output = ::core::result::Result<
4288 crate::generic::TaskProviderGetJobResponse<___R>,
4289 ::fidl_next::never::Never,
4290 >;
4291
4292 fn respond(response: ___R) -> Self::Output {
4293 ::core::result::Result::Ok(crate::generic::TaskProviderGetJobResponse { job: response })
4294 }
4295 }
4296
4297 impl<___R> ::fidl_next::RespondErr<___R> for GetJob {
4298 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
4299
4300 fn respond_err(response: ___R) -> Self::Output {
4301 ::core::result::Result::Err(response)
4302 }
4303 }
4304
4305 mod ___detail {
4306 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::TaskProvider
4307 where
4308 ___T: ::fidl_next::Transport,
4309 {
4310 type Client = TaskProviderClient<___T>;
4311 type Server = TaskProviderServer<___T>;
4312 }
4313
4314 #[repr(transparent)]
4316 pub struct TaskProviderClient<___T: ::fidl_next::Transport> {
4317 #[allow(dead_code)]
4318 client: ::fidl_next::protocol::Client<___T>,
4319 }
4320
4321 impl<___T> TaskProviderClient<___T>
4322 where
4323 ___T: ::fidl_next::Transport,
4324 {
4325 #[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"]
4326 pub fn get_job(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetJob, ___T> {
4327 ::fidl_next::TwoWayFuture::from_untyped(
4328 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4329 5520468615388521389,
4330 <super::GetJob as ::fidl_next::Method>::FLEXIBILITY,
4331 (),
4332 ),
4333 )
4334 }
4335 }
4336
4337 #[repr(transparent)]
4339 pub struct TaskProviderServer<___T: ::fidl_next::Transport> {
4340 server: ::fidl_next::protocol::Server<___T>,
4341 }
4342
4343 impl<___T> TaskProviderServer<___T> where ___T: ::fidl_next::Transport {}
4344 }
4345}
4346
4347#[diagnostic::on_unimplemented(
4348 note = "If {Self} implements the non-local TaskProviderClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4349)]
4350
4351pub trait TaskProviderLocalClientHandler<
4355 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4356 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4357>
4358{
4359 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4360 ::core::future::ready(())
4361 }
4362}
4363
4364impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for TaskProvider
4365where
4366 ___H: TaskProviderLocalClientHandler<___T>,
4367 ___T: ::fidl_next::Transport,
4368{
4369 async fn on_event(
4370 handler: &mut ___H,
4371 mut message: ::fidl_next::Message<___T>,
4372 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4373 match *message.header().ordinal {
4374 ordinal => {
4375 handler.on_unknown_interaction(ordinal).await;
4376 if ::core::matches!(
4377 message.header().flexibility(),
4378 ::fidl_next::protocol::Flexibility::Strict
4379 ) {
4380 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4381 } else {
4382 Ok(())
4383 }
4384 }
4385 }
4386 }
4387}
4388
4389#[diagnostic::on_unimplemented(
4390 note = "If {Self} implements the non-local TaskProviderServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4391)]
4392
4393pub trait TaskProviderLocalServerHandler<
4397 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4398 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4399>
4400{
4401 #[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"]
4402 fn get_job(
4403 &mut self,
4404
4405 responder: ::fidl_next::Responder<task_provider::GetJob, ___T>,
4406 ) -> impl ::core::future::Future<Output = ()>;
4407
4408 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4409 ::core::future::ready(())
4410 }
4411}
4412
4413impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for TaskProvider
4414where
4415 ___H: TaskProviderLocalServerHandler<___T>,
4416 ___T: ::fidl_next::Transport,
4417{
4418 async fn on_one_way(
4419 handler: &mut ___H,
4420 mut message: ::fidl_next::Message<___T>,
4421 ) -> ::core::result::Result<
4422 (),
4423 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4424 > {
4425 match *message.header().ordinal {
4426 ordinal => {
4427 handler.on_unknown_interaction(ordinal).await;
4428 if ::core::matches!(
4429 message.header().flexibility(),
4430 ::fidl_next::protocol::Flexibility::Strict
4431 ) {
4432 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4433 } else {
4434 Ok(())
4435 }
4436 }
4437 }
4438 }
4439
4440 async fn on_two_way(
4441 handler: &mut ___H,
4442 mut message: ::fidl_next::Message<___T>,
4443 responder: ::fidl_next::protocol::Responder<___T>,
4444 ) -> ::core::result::Result<
4445 (),
4446 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4447 > {
4448 match *message.header().ordinal {
4449 5520468615388521389 => {
4450 let responder = ::fidl_next::Responder::from_untyped(responder);
4451
4452 handler.get_job(responder).await;
4453 Ok(())
4454 }
4455
4456 ordinal => {
4457 handler.on_unknown_interaction(ordinal).await;
4458 if ::core::matches!(
4459 message.header().flexibility(),
4460 ::fidl_next::protocol::Flexibility::Strict
4461 ) {
4462 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4463 } else {
4464 responder
4465 .respond_framework_error(
4466 ordinal,
4467 ::fidl_next::FrameworkError::UnknownMethod,
4468 )
4469 .expect("encoding a framework error should never fail")
4470 .await?;
4471 Ok(())
4472 }
4473 }
4474 }
4475 }
4476}
4477
4478pub trait TaskProviderClientHandler<
4482 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4483 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4484>
4485{
4486 fn on_unknown_interaction(
4487 &mut self,
4488 ordinal: u64,
4489 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4490 ::core::future::ready(())
4491 }
4492}
4493
4494impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for TaskProvider
4495where
4496 ___H: TaskProviderClientHandler<___T> + ::core::marker::Send,
4497 ___T: ::fidl_next::Transport,
4498{
4499 async fn on_event(
4500 handler: &mut ___H,
4501 mut message: ::fidl_next::Message<___T>,
4502 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4503 match *message.header().ordinal {
4504 ordinal => {
4505 handler.on_unknown_interaction(ordinal).await;
4506 if ::core::matches!(
4507 message.header().flexibility(),
4508 ::fidl_next::protocol::Flexibility::Strict
4509 ) {
4510 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4511 } else {
4512 Ok(())
4513 }
4514 }
4515 }
4516 }
4517}
4518
4519pub trait TaskProviderServerHandler<
4523 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4524 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4525>
4526{
4527 #[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"]
4528 fn get_job(
4529 &mut self,
4530
4531 responder: ::fidl_next::Responder<task_provider::GetJob, ___T>,
4532 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4533
4534 fn on_unknown_interaction(
4535 &mut self,
4536 ordinal: u64,
4537 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4538 ::core::future::ready(())
4539 }
4540}
4541
4542impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for TaskProvider
4543where
4544 ___H: TaskProviderServerHandler<___T> + ::core::marker::Send,
4545 ___T: ::fidl_next::Transport,
4546{
4547 async fn on_one_way(
4548 handler: &mut ___H,
4549 mut message: ::fidl_next::Message<___T>,
4550 ) -> ::core::result::Result<
4551 (),
4552 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4553 > {
4554 match *message.header().ordinal {
4555 ordinal => {
4556 handler.on_unknown_interaction(ordinal).await;
4557 if ::core::matches!(
4558 message.header().flexibility(),
4559 ::fidl_next::protocol::Flexibility::Strict
4560 ) {
4561 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4562 } else {
4563 Ok(())
4564 }
4565 }
4566 }
4567 }
4568
4569 async fn on_two_way(
4570 handler: &mut ___H,
4571 mut message: ::fidl_next::Message<___T>,
4572 responder: ::fidl_next::protocol::Responder<___T>,
4573 ) -> ::core::result::Result<
4574 (),
4575 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4576 > {
4577 match *message.header().ordinal {
4578 5520468615388521389 => {
4579 let responder = ::fidl_next::Responder::from_untyped(responder);
4580
4581 handler.get_job(responder).await;
4582 Ok(())
4583 }
4584
4585 ordinal => {
4586 handler.on_unknown_interaction(ordinal).await;
4587 if ::core::matches!(
4588 message.header().flexibility(),
4589 ::fidl_next::protocol::Flexibility::Strict
4590 ) {
4591 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4592 } else {
4593 responder
4594 .respond_framework_error(
4595 ordinal,
4596 ::fidl_next::FrameworkError::UnknownMethod,
4597 )
4598 .expect("encoding a framework error should never fail")
4599 .await?;
4600 Ok(())
4601 }
4602 }
4603 }
4604 }
4605}
4606
4607impl<___T> TaskProviderClientHandler<___T> for ::fidl_next::IgnoreEvents
4608where
4609 ___T: ::fidl_next::Transport,
4610{
4611 async fn on_unknown_interaction(&mut self, _: u64) {}
4612}
4613
4614impl<___H, ___T> TaskProviderLocalClientHandler<___T> for ::fidl_next::Local<___H>
4615where
4616 ___H: TaskProviderClientHandler<___T>,
4617 ___T: ::fidl_next::Transport,
4618{
4619 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4620 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4621 }
4622}
4623
4624impl<___H, ___T> TaskProviderLocalServerHandler<___T> for ::fidl_next::Local<___H>
4625where
4626 ___H: TaskProviderServerHandler<___T>,
4627 ___T: ::fidl_next::Transport,
4628{
4629 async fn get_job(&mut self, responder: ::fidl_next::Responder<task_provider::GetJob, ___T>) {
4630 ___H::get_job(&mut self.0, responder).await
4631 }
4632
4633 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4634 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4635 }
4636}
4637
4638pub use fidl_next_common_fuchsia_component_runner::*;