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 _ =
2343 self.table.get(6).map(|envelope| unsafe {
2344 envelope.read_unchecked::<::fidl_next::wire::Vector<
2345 'de,
2346 ::fidl_next_fuchsia_process::wire::HandleInfo,
2347 >>()
2348 });
2349
2350 let _ = self.table.get(7).map(|envelope| unsafe {
2351 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
2352 });
2353
2354 let _ = self.table.get(8).map(|envelope| unsafe {
2355 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2356 });
2357
2358 let _ = self.table.get(9).map(|envelope| unsafe {
2359 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
2360 });
2361
2362 let _ = self.table.get(10)
2363 .map(|envelope| unsafe {
2364 envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>()
2365 });
2366
2367 let _ = self.table.get(11).map(|envelope| unsafe {
2368 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2369 });
2370 }
2371 }
2372
2373 impl ::fidl_next::Constrained for ComponentStartInfo<'_> {
2374 type Constraint = ();
2375
2376 fn validate(
2377 _: ::fidl_next::Slot<'_, Self>,
2378 _: Self::Constraint,
2379 ) -> Result<(), ::fidl_next::ValidationError> {
2380 Ok(())
2381 }
2382 }
2383
2384 unsafe impl ::fidl_next::Wire for ComponentStartInfo<'static> {
2385 type Narrowed<'de> = ComponentStartInfo<'de>;
2386
2387 #[inline]
2388 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2389 ::fidl_next::munge!(let Self { table } = out);
2390 ::fidl_next::wire::Table::zero_padding(table);
2391 }
2392 }
2393
2394 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentStartInfo<'de>
2395 where
2396 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2397 ___D: ::fidl_next::fuchsia::HandleDecoder,
2398 {
2399 fn decode(
2400 slot: ::fidl_next::Slot<'_, Self>,
2401 decoder: &mut ___D,
2402 _: (),
2403 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2404 ::fidl_next::munge!(let Self { table } = slot);
2405
2406 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2407 match ordinal {
2408 0 => unsafe { ::core::hint::unreachable_unchecked() },
2409
2410 1 => {
2411 ::fidl_next::wire::Envelope::decode_as::<
2412 ___D,
2413 ::fidl_next::wire::String<'de>,
2414 >(slot.as_mut(), decoder, 4096)?;
2415
2416 let value = unsafe {
2417 slot.deref_unchecked()
2418 .deref_unchecked::<::fidl_next::wire::String<'_>>()
2419 };
2420
2421 if value.len() > 4096 {
2422 return Err(::fidl_next::DecodeError::VectorTooLong {
2423 size: value.len() as u64,
2424 limit: 4096,
2425 });
2426 }
2427
2428 Ok(())
2429 }
2430
2431 2 => {
2432 ::fidl_next::wire::Envelope::decode_as::<
2433 ___D,
2434 ::fidl_next_fuchsia_data::wire::Dictionary<'de>,
2435 >(slot.as_mut(), decoder, ())?;
2436
2437 Ok(())
2438 }
2439
2440 3 => {
2441 ::fidl_next::wire::Envelope::decode_as::<
2442 ___D,
2443 ::fidl_next::wire::Vector<
2444 'de,
2445 crate::wire::ComponentNamespaceEntry<'de>,
2446 >,
2447 >(slot.as_mut(), decoder, (32, ()))?;
2448
2449 let value = unsafe {
2450 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
2451 '_,
2452 crate::wire::ComponentNamespaceEntry<'_>,
2453 >>()
2454 };
2455
2456 if value.len() > 32 {
2457 return Err(::fidl_next::DecodeError::VectorTooLong {
2458 size: value.len() as u64,
2459 limit: 32,
2460 });
2461 }
2462
2463 Ok(())
2464 }
2465
2466 4 => {
2467 ::fidl_next::wire::Envelope::decode_as::<
2468 ___D,
2469 ::fidl_next::ServerEnd<
2470 ::fidl_next_fuchsia_io::Directory,
2471 ::fidl_next::wire::fuchsia::Channel,
2472 >,
2473 >(slot.as_mut(), decoder, ())?;
2474
2475 Ok(())
2476 }
2477
2478 5 => {
2479 ::fidl_next::wire::Envelope::decode_as::<
2480 ___D,
2481 ::fidl_next::ServerEnd<
2482 ::fidl_next_fuchsia_io::Directory,
2483 ::fidl_next::wire::fuchsia::Channel,
2484 >,
2485 >(slot.as_mut(), decoder, ())?;
2486
2487 Ok(())
2488 }
2489
2490 6 => {
2491 ::fidl_next::wire::Envelope::decode_as::<
2492 ___D,
2493 ::fidl_next::wire::Vector<
2494 'de,
2495 ::fidl_next_fuchsia_process::wire::HandleInfo,
2496 >,
2497 >(slot.as_mut(), decoder, (128, ()))?;
2498
2499 let value = unsafe {
2500 slot.deref_unchecked().deref_unchecked::<::fidl_next::wire::Vector<
2501 '_,
2502 ::fidl_next_fuchsia_process::wire::HandleInfo,
2503 >>()
2504 };
2505
2506 if value.len() > 128 {
2507 return Err(::fidl_next::DecodeError::VectorTooLong {
2508 size: value.len() as u64,
2509 limit: 128,
2510 });
2511 }
2512
2513 Ok(())
2514 }
2515
2516 7 => {
2517 ::fidl_next::wire::Envelope::decode_as::<
2518 ___D,
2519 ::fidl_next_fuchsia_mem::wire::Data<'de>,
2520 >(slot.as_mut(), decoder, ())?;
2521
2522 Ok(())
2523 }
2524
2525 8 => {
2526 ::fidl_next::wire::Envelope::decode_as::<
2527 ___D,
2528 ::fidl_next::wire::fuchsia::EventPair,
2529 >(slot.as_mut(), decoder, ())?;
2530
2531 Ok(())
2532 }
2533
2534 9 => {
2535 ::fidl_next::wire::Envelope::decode_as::<
2536 ___D,
2537 ::fidl_next::wire::fuchsia::Event,
2538 >(slot.as_mut(), decoder, ())?;
2539
2540 Ok(())
2541 }
2542
2543 10 => {
2544 ::fidl_next::wire::Envelope::decode_as::<
2545 ___D,
2546 ::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef,
2547 >(slot.as_mut(), decoder, ())?;
2548
2549 Ok(())
2550 }
2551
2552 11 => {
2553 ::fidl_next::wire::Envelope::decode_as::<
2554 ___D,
2555 ::fidl_next::wire::fuchsia::EventPair,
2556 >(slot.as_mut(), decoder, ())?;
2557
2558 Ok(())
2559 }
2560
2561 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2562 }
2563 })
2564 }
2565 }
2566
2567 impl<'de> ComponentStartInfo<'de> {
2568 pub fn resolved_url(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2569 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2570 }
2571
2572 pub fn take_resolved_url(
2573 &mut self,
2574 ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2575 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2576 }
2577
2578 pub fn program(
2579 &self,
2580 ) -> ::core::option::Option<&::fidl_next_fuchsia_data::wire::Dictionary<'de>> {
2581 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2582 }
2583
2584 pub fn take_program(
2585 &mut self,
2586 ) -> ::core::option::Option<::fidl_next_fuchsia_data::wire::Dictionary<'de>> {
2587 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2588 }
2589
2590 pub fn ns(
2591 &self,
2592 ) -> ::core::option::Option<
2593 &::fidl_next::wire::Vector<'de, crate::wire::ComponentNamespaceEntry<'de>>,
2594 > {
2595 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2596 }
2597
2598 pub fn take_ns(
2599 &mut self,
2600 ) -> ::core::option::Option<
2601 ::fidl_next::wire::Vector<'de, crate::wire::ComponentNamespaceEntry<'de>>,
2602 > {
2603 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2604 }
2605
2606 pub fn outgoing_dir(
2607 &self,
2608 ) -> ::core::option::Option<
2609 &::fidl_next::ServerEnd<
2610 ::fidl_next_fuchsia_io::Directory,
2611 ::fidl_next::wire::fuchsia::Channel,
2612 >,
2613 > {
2614 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2615 }
2616
2617 pub fn take_outgoing_dir(
2618 &mut self,
2619 ) -> ::core::option::Option<
2620 ::fidl_next::ServerEnd<
2621 ::fidl_next_fuchsia_io::Directory,
2622 ::fidl_next::wire::fuchsia::Channel,
2623 >,
2624 > {
2625 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
2626 }
2627
2628 pub fn runtime_dir(
2629 &self,
2630 ) -> ::core::option::Option<
2631 &::fidl_next::ServerEnd<
2632 ::fidl_next_fuchsia_io::Directory,
2633 ::fidl_next::wire::fuchsia::Channel,
2634 >,
2635 > {
2636 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
2637 }
2638
2639 pub fn take_runtime_dir(
2640 &mut self,
2641 ) -> ::core::option::Option<
2642 ::fidl_next::ServerEnd<
2643 ::fidl_next_fuchsia_io::Directory,
2644 ::fidl_next::wire::fuchsia::Channel,
2645 >,
2646 > {
2647 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
2648 }
2649
2650 pub fn numbered_handles(
2651 &self,
2652 ) -> ::core::option::Option<
2653 &::fidl_next::wire::Vector<'de, ::fidl_next_fuchsia_process::wire::HandleInfo>,
2654 > {
2655 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
2656 }
2657
2658 pub fn take_numbered_handles(
2659 &mut self,
2660 ) -> ::core::option::Option<
2661 ::fidl_next::wire::Vector<'de, ::fidl_next_fuchsia_process::wire::HandleInfo>,
2662 > {
2663 unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
2664 }
2665
2666 pub fn encoded_config(
2667 &self,
2668 ) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
2669 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
2670 }
2671
2672 pub fn take_encoded_config(
2673 &mut self,
2674 ) -> ::core::option::Option<::fidl_next_fuchsia_mem::wire::Data<'de>> {
2675 unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
2676 }
2677
2678 pub fn break_on_start(
2679 &self,
2680 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2681 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
2682 }
2683
2684 pub fn take_break_on_start(
2685 &mut self,
2686 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
2687 unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
2688 }
2689
2690 pub fn component_instance(
2691 &self,
2692 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Event> {
2693 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
2694 }
2695
2696 pub fn take_component_instance(
2697 &mut self,
2698 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Event> {
2699 unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
2700 }
2701
2702 pub fn escrowed_dictionary(
2703 &self,
2704 ) -> ::core::option::Option<&::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>
2705 {
2706 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
2707 }
2708
2709 pub fn take_escrowed_dictionary(
2710 &mut self,
2711 ) -> ::core::option::Option<::fidl_next_fuchsia_component_sandbox::wire::DictionaryRef>
2712 {
2713 unsafe { Some(self.table.get_mut(10)?.take_unchecked()) }
2714 }
2715
2716 pub fn escrowed_dictionary_handle(
2717 &self,
2718 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2719 unsafe { Some(self.table.get(11)?.deref_unchecked()) }
2720 }
2721
2722 pub fn take_escrowed_dictionary_handle(
2723 &mut self,
2724 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
2725 unsafe { Some(self.table.get_mut(11)?.take_unchecked()) }
2726 }
2727 }
2728
2729 impl<'de> ::core::fmt::Debug for ComponentStartInfo<'de> {
2730 fn fmt(
2731 &self,
2732 f: &mut ::core::fmt::Formatter<'_>,
2733 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2734 f.debug_struct("ComponentStartInfo")
2735 .field("resolved_url", &self.resolved_url())
2736 .field("program", &self.program())
2737 .field("ns", &self.ns())
2738 .field("outgoing_dir", &self.outgoing_dir())
2739 .field("runtime_dir", &self.runtime_dir())
2740 .field("numbered_handles", &self.numbered_handles())
2741 .field("encoded_config", &self.encoded_config())
2742 .field("break_on_start", &self.break_on_start())
2743 .field("component_instance", &self.component_instance())
2744 .field("escrowed_dictionary", &self.escrowed_dictionary())
2745 .field("escrowed_dictionary_handle", &self.escrowed_dictionary_handle())
2746 .finish()
2747 }
2748 }
2749
2750 impl<'de> ::fidl_next::IntoNatural for ComponentStartInfo<'de> {
2751 type Natural = crate::natural::ComponentStartInfo;
2752 }
2753
2754 #[derive(Debug)]
2756 #[repr(C)]
2757 pub struct ComponentRunnerStartRequest<'de> {
2758 pub start_info: crate::wire::ComponentStartInfo<'de>,
2759
2760 pub controller:
2761 ::fidl_next::ServerEnd<crate::ComponentController, ::fidl_next::wire::fuchsia::Channel>,
2762 }
2763
2764 static_assertions::const_assert_eq!(std::mem::size_of::<ComponentRunnerStartRequest<'_>>(), 24);
2765 static_assertions::const_assert_eq!(std::mem::align_of::<ComponentRunnerStartRequest<'_>>(), 8);
2766
2767 static_assertions::const_assert_eq!(
2768 std::mem::offset_of!(ComponentRunnerStartRequest<'_>, start_info),
2769 0
2770 );
2771
2772 static_assertions::const_assert_eq!(
2773 std::mem::offset_of!(ComponentRunnerStartRequest<'_>, controller),
2774 16
2775 );
2776
2777 impl ::fidl_next::Constrained for ComponentRunnerStartRequest<'_> {
2778 type Constraint = ();
2779
2780 fn validate(
2781 _: ::fidl_next::Slot<'_, Self>,
2782 _: Self::Constraint,
2783 ) -> Result<(), ::fidl_next::ValidationError> {
2784 Ok(())
2785 }
2786 }
2787
2788 unsafe impl ::fidl_next::Wire for ComponentRunnerStartRequest<'static> {
2789 type Narrowed<'de> = ComponentRunnerStartRequest<'de>;
2790
2791 #[inline]
2792 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2793 ::fidl_next::munge! {
2794 let Self {
2795 start_info,
2796 controller,
2797
2798 } = &mut *out_;
2799 }
2800
2801 ::fidl_next::Wire::zero_padding(start_info);
2802
2803 ::fidl_next::Wire::zero_padding(controller);
2804
2805 unsafe {
2806 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
2807 }
2808 }
2809 }
2810
2811 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentRunnerStartRequest<'de>
2812 where
2813 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2814 ___D: ::fidl_next::Decoder<'de>,
2815 ___D: ::fidl_next::fuchsia::HandleDecoder,
2816 {
2817 fn decode(
2818 slot_: ::fidl_next::Slot<'_, Self>,
2819 decoder_: &mut ___D,
2820 _: (),
2821 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2822 if slot_.as_bytes()[20..24] != [0u8; 4] {
2823 return Err(::fidl_next::DecodeError::InvalidPadding);
2824 }
2825
2826 ::fidl_next::munge! {
2827 let Self {
2828 mut start_info,
2829 mut controller,
2830
2831 } = slot_;
2832 }
2833
2834 let _field = start_info.as_mut();
2835
2836 ::fidl_next::Decode::decode(start_info.as_mut(), decoder_, ())?;
2837
2838 let _field = controller.as_mut();
2839
2840 ::fidl_next::Decode::decode(controller.as_mut(), decoder_, ())?;
2841
2842 Ok(())
2843 }
2844 }
2845
2846 impl<'de> ::fidl_next::IntoNatural for ComponentRunnerStartRequest<'de> {
2847 type Natural = crate::natural::ComponentRunnerStartRequest;
2848 }
2849
2850 #[derive(Debug)]
2852 #[repr(C)]
2853 pub struct TaskProviderGetJobResponse {
2854 pub job: ::fidl_next::wire::fuchsia::Job,
2855 }
2856
2857 static_assertions::const_assert_eq!(std::mem::size_of::<TaskProviderGetJobResponse>(), 4);
2858 static_assertions::const_assert_eq!(std::mem::align_of::<TaskProviderGetJobResponse>(), 4);
2859
2860 static_assertions::const_assert_eq!(std::mem::offset_of!(TaskProviderGetJobResponse, job), 0);
2861
2862 impl ::fidl_next::Constrained for TaskProviderGetJobResponse {
2863 type Constraint = ();
2864
2865 fn validate(
2866 _: ::fidl_next::Slot<'_, Self>,
2867 _: Self::Constraint,
2868 ) -> Result<(), ::fidl_next::ValidationError> {
2869 Ok(())
2870 }
2871 }
2872
2873 unsafe impl ::fidl_next::Wire for TaskProviderGetJobResponse {
2874 type Narrowed<'de> = TaskProviderGetJobResponse;
2875
2876 #[inline]
2877 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2878 ::fidl_next::munge! {
2879 let Self {
2880 job,
2881
2882 } = &mut *out_;
2883 }
2884
2885 ::fidl_next::Wire::zero_padding(job);
2886 }
2887 }
2888
2889 unsafe impl<___D> ::fidl_next::Decode<___D> for TaskProviderGetJobResponse
2890 where
2891 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2892 ___D: ::fidl_next::fuchsia::HandleDecoder,
2893 {
2894 fn decode(
2895 slot_: ::fidl_next::Slot<'_, Self>,
2896 decoder_: &mut ___D,
2897 _: (),
2898 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2899 ::fidl_next::munge! {
2900 let Self {
2901 mut job,
2902
2903 } = slot_;
2904 }
2905
2906 let _field = job.as_mut();
2907
2908 ::fidl_next::Decode::decode(job.as_mut(), decoder_, ())?;
2909
2910 Ok(())
2911 }
2912 }
2913
2914 impl ::fidl_next::IntoNatural for TaskProviderGetJobResponse {
2915 type Natural = crate::natural::TaskProviderGetJobResponse;
2916 }
2917}
2918
2919pub mod wire_optional {
2920
2921 pub use fidl_next_common_fuchsia_component_runner::wire_optional::*;
2922
2923 #[repr(transparent)]
2924 pub struct Task<'de> {
2925 pub(crate) raw: ::fidl_next::wire::Union,
2926 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
2927 }
2928
2929 impl ::fidl_next::Constrained for Task<'_> {
2930 type Constraint = ();
2931
2932 fn validate(
2933 _: ::fidl_next::Slot<'_, Self>,
2934 _: Self::Constraint,
2935 ) -> Result<(), ::fidl_next::ValidationError> {
2936 Ok(())
2937 }
2938 }
2939
2940 unsafe impl ::fidl_next::Wire for Task<'static> {
2941 type Narrowed<'de> = Task<'de>;
2942
2943 #[inline]
2944 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2945 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
2946 ::fidl_next::wire::Union::zero_padding(raw);
2947 }
2948 }
2949
2950 impl<'de> Task<'de> {
2951 pub fn is_some(&self) -> bool {
2952 self.raw.is_some()
2953 }
2954
2955 pub fn is_none(&self) -> bool {
2956 self.raw.is_none()
2957 }
2958
2959 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Task<'de>> {
2960 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
2961 }
2962
2963 pub fn into_option(self) -> ::core::option::Option<crate::wire::Task<'de>> {
2964 if self.is_some() {
2965 Some(crate::wire::Task { raw: self.raw, _phantom: ::core::marker::PhantomData })
2966 } else {
2967 None
2968 }
2969 }
2970 }
2971
2972 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Task<'de>
2973 where
2974 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2975 ___D: ::fidl_next::Decoder<'de>,
2976 ___D: ::fidl_next::fuchsia::HandleDecoder,
2977 {
2978 fn decode(
2979 mut slot: ::fidl_next::Slot<'_, Self>,
2980 decoder: &mut ___D,
2981 _: (),
2982 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2983 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2984 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
2985 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Job>(
2986 raw,
2987 decoder,
2988 (),
2989 )?,
2990
2991 2 => ::fidl_next::wire::Union::decode_as::<
2992 ___D,
2993 ::fidl_next::wire::fuchsia::Process,
2994 >(raw, decoder, ())?,
2995
2996 3 => {
2997 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Thread>(
2998 raw,
2999 decoder,
3000 (),
3001 )?
3002 }
3003
3004 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
3005 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
3006 }
3007
3008 Ok(())
3009 }
3010 }
3011
3012 impl<'de> ::core::fmt::Debug for Task<'de> {
3013 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3014 self.as_ref().fmt(f)
3015 }
3016 }
3017
3018 impl<'de> ::fidl_next::IntoNatural for Task<'de> {
3019 type Natural = ::core::option::Option<crate::natural::Task>;
3020 }
3021}
3022
3023pub mod generic {
3024
3025 pub use fidl_next_common_fuchsia_component_runner::generic::*;
3026
3027 pub struct ComponentControllerOnPublishDiagnosticsRequest<T0> {
3029 pub payload: T0,
3030 }
3031
3032 unsafe impl<___E, T0>
3033 ::fidl_next::Encode<
3034 crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>,
3035 ___E,
3036 > for ComponentControllerOnPublishDiagnosticsRequest<T0>
3037 where
3038 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3039 ___E: ::fidl_next::Encoder,
3040 ___E: ::fidl_next::fuchsia::HandleEncoder,
3041 T0: ::fidl_next::Encode<crate::wire::ComponentDiagnostics<'static>, ___E>,
3042 {
3043 #[inline]
3044 fn encode(
3045 self,
3046 encoder_: &mut ___E,
3047 out_: &mut ::core::mem::MaybeUninit<
3048 crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>,
3049 >,
3050 _: (),
3051 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3052 ::fidl_next::munge! {
3053 let crate::wire::ComponentControllerOnPublishDiagnosticsRequest {
3054 payload,
3055
3056 } = out_;
3057 }
3058
3059 ::fidl_next::Encode::encode(self.payload, encoder_, payload, ())?;
3060
3061 Ok(())
3062 }
3063 }
3064
3065 pub struct ComponentRunnerStartRequest<T0, T1> {
3067 pub start_info: T0,
3068
3069 pub controller: T1,
3070 }
3071
3072 unsafe impl<___E, T0, T1>
3073 ::fidl_next::Encode<crate::wire::ComponentRunnerStartRequest<'static>, ___E>
3074 for ComponentRunnerStartRequest<T0, T1>
3075 where
3076 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3077 ___E: ::fidl_next::Encoder,
3078 ___E: ::fidl_next::fuchsia::HandleEncoder,
3079 T0: ::fidl_next::Encode<crate::wire::ComponentStartInfo<'static>, ___E>,
3080 T1: ::fidl_next::Encode<
3081 ::fidl_next::ServerEnd<
3082 crate::ComponentController,
3083 ::fidl_next::wire::fuchsia::Channel,
3084 >,
3085 ___E,
3086 >,
3087 {
3088 #[inline]
3089 fn encode(
3090 self,
3091 encoder_: &mut ___E,
3092 out_: &mut ::core::mem::MaybeUninit<crate::wire::ComponentRunnerStartRequest<'static>>,
3093 _: (),
3094 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3095 ::fidl_next::munge! {
3096 let crate::wire::ComponentRunnerStartRequest {
3097 start_info,
3098 controller,
3099
3100 } = out_;
3101 }
3102
3103 ::fidl_next::Encode::encode(self.start_info, encoder_, start_info, ())?;
3104
3105 ::fidl_next::Encode::encode(self.controller, encoder_, controller, ())?;
3106
3107 Ok(())
3108 }
3109 }
3110
3111 pub struct TaskProviderGetJobResponse<T0> {
3113 pub job: T0,
3114 }
3115
3116 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::TaskProviderGetJobResponse, ___E>
3117 for TaskProviderGetJobResponse<T0>
3118 where
3119 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3120 ___E: ::fidl_next::fuchsia::HandleEncoder,
3121 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Job, ___E>,
3122 {
3123 #[inline]
3124 fn encode(
3125 self,
3126 encoder_: &mut ___E,
3127 out_: &mut ::core::mem::MaybeUninit<crate::wire::TaskProviderGetJobResponse>,
3128 _: (),
3129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3130 ::fidl_next::munge! {
3131 let crate::wire::TaskProviderGetJobResponse {
3132 job,
3133
3134 } = out_;
3135 }
3136
3137 ::fidl_next::Encode::encode(self.job, encoder_, job, ())?;
3138
3139 Ok(())
3140 }
3141 }
3142}
3143
3144pub use self::natural::*;
3145
3146#[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"]
3148#[derive(PartialEq, Debug)]
3149pub struct ComponentController;
3150
3151#[cfg(target_os = "fuchsia")]
3152impl ::fidl_next::HasTransport for ComponentController {
3153 type Transport = ::fidl_next::fuchsia::zx::Channel;
3154}
3155
3156pub mod component_controller {
3157 pub mod prelude {
3158 pub use crate::{
3159 ComponentController, ComponentControllerClientHandler,
3160 ComponentControllerLocalClientHandler, ComponentControllerLocalServerHandler,
3161 ComponentControllerServerHandler, component_controller,
3162 };
3163
3164 pub use crate::natural::ComponentControllerOnEscrowRequest;
3165
3166 pub use crate::natural::ComponentControllerOnPublishDiagnosticsRequest;
3167
3168 pub use crate::natural::ComponentStopInfo;
3169 }
3170
3171 pub struct Stop;
3172
3173 impl ::fidl_next::Method for Stop {
3174 const ORDINAL: u64 = 4804506821232171874;
3175 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3176 ::fidl_next::protocol::Flexibility::Strict;
3177
3178 type Protocol = crate::ComponentController;
3179
3180 type Request = ::fidl_next::wire::EmptyMessageBody;
3181 }
3182
3183 pub struct Kill;
3184
3185 impl ::fidl_next::Method for Kill {
3186 const ORDINAL: u64 = 4514346391631670964;
3187 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3188 ::fidl_next::protocol::Flexibility::Strict;
3189
3190 type Protocol = crate::ComponentController;
3191
3192 type Request = ::fidl_next::wire::EmptyMessageBody;
3193 }
3194
3195 pub struct OnPublishDiagnostics;
3196
3197 impl ::fidl_next::Method for OnPublishDiagnostics {
3198 const ORDINAL: u64 = 2240216199992207687;
3199 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3200 ::fidl_next::protocol::Flexibility::Strict;
3201
3202 type Protocol = crate::ComponentController;
3203
3204 type Request = crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'static>;
3205 }
3206
3207 pub struct OnEscrow;
3208
3209 impl ::fidl_next::Method for OnEscrow {
3210 const ORDINAL: u64 = 730448769712342012;
3211 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3212 ::fidl_next::protocol::Flexibility::Flexible;
3213
3214 type Protocol = crate::ComponentController;
3215
3216 type Request = crate::wire::ComponentControllerOnEscrowRequest<'static>;
3217 }
3218
3219 pub struct OnStop;
3220
3221 impl ::fidl_next::Method for OnStop {
3222 const ORDINAL: u64 = 4322651556509354674;
3223 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3224 ::fidl_next::protocol::Flexibility::Flexible;
3225
3226 type Protocol = crate::ComponentController;
3227
3228 type Request = crate::wire::ComponentStopInfo<'static>;
3229 }
3230
3231 mod ___detail {
3232 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ComponentController
3233 where
3234 ___T: ::fidl_next::Transport,
3235 {
3236 type Client = ComponentControllerClient<___T>;
3237 type Server = ComponentControllerServer<___T>;
3238 }
3239
3240 #[repr(transparent)]
3242 pub struct ComponentControllerClient<___T: ::fidl_next::Transport> {
3243 #[allow(dead_code)]
3244 client: ::fidl_next::protocol::Client<___T>,
3245 }
3246
3247 impl<___T> ComponentControllerClient<___T>
3248 where
3249 ___T: ::fidl_next::Transport,
3250 {
3251 #[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"]
3252 pub fn stop(&self) -> ::fidl_next::SendFuture<'_, ___T> {
3253 ::fidl_next::SendFuture::from_untyped(
3254 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
3255 4804506821232171874,
3256 <super::Stop as ::fidl_next::Method>::FLEXIBILITY,
3257 (),
3258 ),
3259 )
3260 }
3261
3262 #[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"]
3263 pub fn kill(&self) -> ::fidl_next::SendFuture<'_, ___T> {
3264 ::fidl_next::SendFuture::from_untyped(
3265 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
3266 4514346391631670964,
3267 <super::Kill as ::fidl_next::Method>::FLEXIBILITY,
3268 (),
3269 ),
3270 )
3271 }
3272 }
3273
3274 #[repr(transparent)]
3276 pub struct ComponentControllerServer<___T: ::fidl_next::Transport> {
3277 server: ::fidl_next::protocol::Server<___T>,
3278 }
3279
3280 impl<___T> ComponentControllerServer<___T>
3281 where
3282 ___T: ::fidl_next::Transport,
3283 {
3284 #[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"]
3285 pub fn on_publish_diagnostics(
3286 &self,
3287
3288 payload: impl ::fidl_next::Encode<
3289 crate::wire::ComponentDiagnostics<'static>,
3290 <___T as ::fidl_next::Transport>::SendBuffer,
3291 >,
3292 ) -> ::fidl_next::SendFuture<'_, ___T>
3293 where
3294 <___T as ::fidl_next::Transport>::SendBuffer:
3295 ::fidl_next::encoder::InternalHandleEncoder,
3296 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3297 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3298 {
3299 self.on_publish_diagnostics_with(
3300 crate::generic::ComponentControllerOnPublishDiagnosticsRequest { payload },
3301 )
3302 }
3303
3304 #[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"]
3305
3306 pub fn on_publish_diagnostics_with<___R>(
3307 &self,
3308 request: ___R,
3309 ) -> ::fidl_next::SendFuture<'_, ___T>
3310 where
3311 ___R: ::fidl_next::Encode<
3312 <super::OnPublishDiagnostics as ::fidl_next::Method>::Request,
3313 <___T as ::fidl_next::Transport>::SendBuffer,
3314 >,
3315 {
3316 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3317 2240216199992207687,
3318 <super::OnPublishDiagnostics as ::fidl_next::Method>::FLEXIBILITY,
3319 request,
3320 ))
3321 }
3322
3323 #[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"]
3324
3325 pub fn on_escrow_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3326 where
3327 ___R: ::fidl_next::Encode<
3328 <super::OnEscrow as ::fidl_next::Method>::Request,
3329 <___T as ::fidl_next::Transport>::SendBuffer,
3330 >,
3331 {
3332 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3333 730448769712342012,
3334 <super::OnEscrow as ::fidl_next::Method>::FLEXIBILITY,
3335 request,
3336 ))
3337 }
3338
3339 #[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"]
3340
3341 pub fn on_stop_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3342 where
3343 ___R: ::fidl_next::Encode<
3344 <super::OnStop as ::fidl_next::Method>::Request,
3345 <___T as ::fidl_next::Transport>::SendBuffer,
3346 >,
3347 {
3348 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3349 4322651556509354674,
3350 <super::OnStop as ::fidl_next::Method>::FLEXIBILITY,
3351 request,
3352 ))
3353 }
3354 }
3355 }
3356}
3357
3358#[diagnostic::on_unimplemented(
3359 note = "If {Self} implements the non-local ComponentControllerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3360)]
3361
3362pub trait ComponentControllerLocalClientHandler<
3366 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3367 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3368>
3369{
3370 #[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"]
3371 fn on_publish_diagnostics(
3372 &mut self,
3373
3374 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3375 ) -> impl ::core::future::Future<Output = ()>;
3376
3377 #[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"]
3378 fn on_escrow(
3379 &mut self,
3380
3381 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3382 ) -> impl ::core::future::Future<Output = ()>;
3383
3384 #[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"]
3385 fn on_stop(
3386 &mut self,
3387
3388 request: ::fidl_next::Request<component_controller::OnStop, ___T>,
3389 ) -> impl ::core::future::Future<Output = ()>;
3390
3391 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3392 ::core::future::ready(())
3393 }
3394}
3395
3396impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ComponentController
3397where
3398 ___H: ComponentControllerLocalClientHandler<___T>,
3399 ___T: ::fidl_next::Transport,
3400 for<'de> crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'de>: ::fidl_next::Decode<
3401 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3402 Constraint = (),
3403 >,
3404 for<'de> crate::wire::ComponentControllerOnEscrowRequest<'de>: ::fidl_next::Decode<
3405 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3406 Constraint = (),
3407 >,
3408 for<'de> crate::wire::ComponentStopInfo<'de>: ::fidl_next::Decode<
3409 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3410 Constraint = (),
3411 >,
3412{
3413 async fn on_event(
3414 handler: &mut ___H,
3415 mut message: ::fidl_next::Message<___T>,
3416 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3417 match *message.header().ordinal {
3418 2240216199992207687 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3419 Ok(decoded) => {
3420 handler
3421 .on_publish_diagnostics(::fidl_next::Request::from_decoded(decoded))
3422 .await;
3423 Ok(())
3424 }
3425 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3426 ordinal: 2240216199992207687,
3427 error,
3428 }),
3429 },
3430
3431 730448769712342012 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3432 Ok(decoded) => {
3433 handler.on_escrow(::fidl_next::Request::from_decoded(decoded)).await;
3434 Ok(())
3435 }
3436 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3437 ordinal: 730448769712342012,
3438 error,
3439 }),
3440 },
3441
3442 4322651556509354674 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3443 Ok(decoded) => {
3444 handler.on_stop(::fidl_next::Request::from_decoded(decoded)).await;
3445 Ok(())
3446 }
3447 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3448 ordinal: 4322651556509354674,
3449 error,
3450 }),
3451 },
3452
3453 ordinal => {
3454 handler.on_unknown_interaction(ordinal).await;
3455 if ::core::matches!(
3456 message.header().flexibility(),
3457 ::fidl_next::protocol::Flexibility::Strict
3458 ) {
3459 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3460 } else {
3461 Ok(())
3462 }
3463 }
3464 }
3465 }
3466}
3467
3468#[diagnostic::on_unimplemented(
3469 note = "If {Self} implements the non-local ComponentControllerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3470)]
3471
3472pub trait ComponentControllerLocalServerHandler<
3476 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3477 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3478>
3479{
3480 #[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"]
3481 fn stop(&mut self) -> impl ::core::future::Future<Output = ()>;
3482
3483 #[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"]
3484 fn kill(&mut self) -> impl ::core::future::Future<Output = ()>;
3485
3486 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3487 ::core::future::ready(())
3488 }
3489}
3490
3491impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ComponentController
3492where
3493 ___H: ComponentControllerLocalServerHandler<___T>,
3494 ___T: ::fidl_next::Transport,
3495{
3496 async fn on_one_way(
3497 handler: &mut ___H,
3498 mut message: ::fidl_next::Message<___T>,
3499 ) -> ::core::result::Result<
3500 (),
3501 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3502 > {
3503 match *message.header().ordinal {
3504 4804506821232171874 => {
3505 handler.stop().await;
3506 Ok(())
3507 }
3508
3509 4514346391631670964 => {
3510 handler.kill().await;
3511 Ok(())
3512 }
3513
3514 ordinal => {
3515 handler.on_unknown_interaction(ordinal).await;
3516 if ::core::matches!(
3517 message.header().flexibility(),
3518 ::fidl_next::protocol::Flexibility::Strict
3519 ) {
3520 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3521 } else {
3522 Ok(())
3523 }
3524 }
3525 }
3526 }
3527
3528 async fn on_two_way(
3529 handler: &mut ___H,
3530 mut message: ::fidl_next::Message<___T>,
3531 responder: ::fidl_next::protocol::Responder<___T>,
3532 ) -> ::core::result::Result<
3533 (),
3534 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3535 > {
3536 match *message.header().ordinal {
3537 ordinal => {
3538 handler.on_unknown_interaction(ordinal).await;
3539 if ::core::matches!(
3540 message.header().flexibility(),
3541 ::fidl_next::protocol::Flexibility::Strict
3542 ) {
3543 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3544 } else {
3545 responder
3546 .respond_framework_error(
3547 ordinal,
3548 ::fidl_next::FrameworkError::UnknownMethod,
3549 )
3550 .expect("encoding a framework error should never fail")
3551 .await?;
3552 Ok(())
3553 }
3554 }
3555 }
3556 }
3557}
3558
3559pub trait ComponentControllerClientHandler<
3563 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3564 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3565>
3566{
3567 #[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"]
3568 fn on_publish_diagnostics(
3569 &mut self,
3570
3571 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3572 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3573
3574 #[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"]
3575 fn on_escrow(
3576 &mut self,
3577
3578 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3579 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3580
3581 #[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"]
3582 fn on_stop(
3583 &mut self,
3584
3585 request: ::fidl_next::Request<component_controller::OnStop, ___T>,
3586 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3587
3588 fn on_unknown_interaction(
3589 &mut self,
3590 ordinal: u64,
3591 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3592 ::core::future::ready(())
3593 }
3594}
3595
3596impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ComponentController
3597where
3598 ___H: ComponentControllerClientHandler<___T> + ::core::marker::Send,
3599 ___T: ::fidl_next::Transport,
3600 for<'de> crate::wire::ComponentControllerOnPublishDiagnosticsRequest<'de>: ::fidl_next::Decode<
3601 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3602 Constraint = (),
3603 >,
3604 for<'de> crate::wire::ComponentControllerOnEscrowRequest<'de>: ::fidl_next::Decode<
3605 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3606 Constraint = (),
3607 >,
3608 for<'de> crate::wire::ComponentStopInfo<'de>: ::fidl_next::Decode<
3609 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3610 Constraint = (),
3611 >,
3612{
3613 async fn on_event(
3614 handler: &mut ___H,
3615 mut message: ::fidl_next::Message<___T>,
3616 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3617 match *message.header().ordinal {
3618 2240216199992207687 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3619 Ok(decoded) => {
3620 handler
3621 .on_publish_diagnostics(::fidl_next::Request::from_decoded(decoded))
3622 .await;
3623 Ok(())
3624 }
3625 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3626 ordinal: 2240216199992207687,
3627 error,
3628 }),
3629 },
3630
3631 730448769712342012 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3632 Ok(decoded) => {
3633 handler.on_escrow(::fidl_next::Request::from_decoded(decoded)).await;
3634 Ok(())
3635 }
3636 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3637 ordinal: 730448769712342012,
3638 error,
3639 }),
3640 },
3641
3642 4322651556509354674 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3643 Ok(decoded) => {
3644 handler.on_stop(::fidl_next::Request::from_decoded(decoded)).await;
3645 Ok(())
3646 }
3647 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3648 ordinal: 4322651556509354674,
3649 error,
3650 }),
3651 },
3652
3653 ordinal => {
3654 handler.on_unknown_interaction(ordinal).await;
3655 if ::core::matches!(
3656 message.header().flexibility(),
3657 ::fidl_next::protocol::Flexibility::Strict
3658 ) {
3659 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3660 } else {
3661 Ok(())
3662 }
3663 }
3664 }
3665 }
3666}
3667
3668pub trait ComponentControllerServerHandler<
3672 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3673 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3674>
3675{
3676 #[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"]
3677 fn stop(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3678
3679 #[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"]
3680 fn kill(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3681
3682 fn on_unknown_interaction(
3683 &mut self,
3684 ordinal: u64,
3685 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3686 ::core::future::ready(())
3687 }
3688}
3689
3690impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ComponentController
3691where
3692 ___H: ComponentControllerServerHandler<___T> + ::core::marker::Send,
3693 ___T: ::fidl_next::Transport,
3694{
3695 async fn on_one_way(
3696 handler: &mut ___H,
3697 mut message: ::fidl_next::Message<___T>,
3698 ) -> ::core::result::Result<
3699 (),
3700 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3701 > {
3702 match *message.header().ordinal {
3703 4804506821232171874 => {
3704 handler.stop().await;
3705 Ok(())
3706 }
3707
3708 4514346391631670964 => {
3709 handler.kill().await;
3710 Ok(())
3711 }
3712
3713 ordinal => {
3714 handler.on_unknown_interaction(ordinal).await;
3715 if ::core::matches!(
3716 message.header().flexibility(),
3717 ::fidl_next::protocol::Flexibility::Strict
3718 ) {
3719 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3720 } else {
3721 Ok(())
3722 }
3723 }
3724 }
3725 }
3726
3727 async fn on_two_way(
3728 handler: &mut ___H,
3729 mut message: ::fidl_next::Message<___T>,
3730 responder: ::fidl_next::protocol::Responder<___T>,
3731 ) -> ::core::result::Result<
3732 (),
3733 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3734 > {
3735 match *message.header().ordinal {
3736 ordinal => {
3737 handler.on_unknown_interaction(ordinal).await;
3738 if ::core::matches!(
3739 message.header().flexibility(),
3740 ::fidl_next::protocol::Flexibility::Strict
3741 ) {
3742 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3743 } else {
3744 responder
3745 .respond_framework_error(
3746 ordinal,
3747 ::fidl_next::FrameworkError::UnknownMethod,
3748 )
3749 .expect("encoding a framework error should never fail")
3750 .await?;
3751 Ok(())
3752 }
3753 }
3754 }
3755 }
3756}
3757
3758impl<___T> ComponentControllerClientHandler<___T> for ::fidl_next::IgnoreEvents
3759where
3760 ___T: ::fidl_next::Transport,
3761{
3762 async fn on_publish_diagnostics(
3763 &mut self,
3764
3765 _: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3766 ) {
3767 }
3768
3769 async fn on_escrow(&mut self, _: ::fidl_next::Request<component_controller::OnEscrow, ___T>) {}
3770
3771 async fn on_stop(&mut self, _: ::fidl_next::Request<component_controller::OnStop, ___T>) {}
3772
3773 async fn on_unknown_interaction(&mut self, _: u64) {}
3774}
3775
3776impl<___H, ___T> ComponentControllerLocalClientHandler<___T> for ::fidl_next::Local<___H>
3777where
3778 ___H: ComponentControllerClientHandler<___T>,
3779 ___T: ::fidl_next::Transport,
3780{
3781 async fn on_publish_diagnostics(
3782 &mut self,
3783
3784 request: ::fidl_next::Request<component_controller::OnPublishDiagnostics, ___T>,
3785 ) {
3786 ___H::on_publish_diagnostics(&mut self.0, request).await
3787 }
3788
3789 async fn on_escrow(
3790 &mut self,
3791
3792 request: ::fidl_next::Request<component_controller::OnEscrow, ___T>,
3793 ) {
3794 ___H::on_escrow(&mut self.0, request).await
3795 }
3796
3797 async fn on_stop(&mut self, request: ::fidl_next::Request<component_controller::OnStop, ___T>) {
3798 ___H::on_stop(&mut self.0, request).await
3799 }
3800
3801 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3802 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3803 }
3804}
3805
3806impl<___H, ___T> ComponentControllerLocalServerHandler<___T> for ::fidl_next::Local<___H>
3807where
3808 ___H: ComponentControllerServerHandler<___T>,
3809 ___T: ::fidl_next::Transport,
3810{
3811 async fn stop(&mut self) {
3812 ___H::stop(&mut self.0).await
3813 }
3814
3815 async fn kill(&mut self) {
3816 ___H::kill(&mut self.0).await
3817 }
3818
3819 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3820 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3821 }
3822}
3823
3824#[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"]
3826#[derive(PartialEq, Debug)]
3827pub struct ComponentRunner;
3828
3829impl ::fidl_next::Discoverable for ComponentRunner {
3830 const PROTOCOL_NAME: &'static str = "fuchsia.component.runner.ComponentRunner";
3831}
3832
3833#[cfg(target_os = "fuchsia")]
3834impl ::fidl_next::HasTransport for ComponentRunner {
3835 type Transport = ::fidl_next::fuchsia::zx::Channel;
3836}
3837
3838pub mod component_runner {
3839 pub mod prelude {
3840 pub use crate::{
3841 ComponentRunner, ComponentRunnerClientHandler, ComponentRunnerLocalClientHandler,
3842 ComponentRunnerLocalServerHandler, ComponentRunnerServerHandler, component_runner,
3843 };
3844
3845 pub use crate::natural::ComponentRunnerStartRequest;
3846 }
3847
3848 pub struct Start;
3849
3850 impl ::fidl_next::Method for Start {
3851 const ORDINAL: u64 = 780715659970866697;
3852 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3853 ::fidl_next::protocol::Flexibility::Strict;
3854
3855 type Protocol = crate::ComponentRunner;
3856
3857 type Request = crate::wire::ComponentRunnerStartRequest<'static>;
3858 }
3859
3860 mod ___detail {
3861 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ComponentRunner
3862 where
3863 ___T: ::fidl_next::Transport,
3864 {
3865 type Client = ComponentRunnerClient<___T>;
3866 type Server = ComponentRunnerServer<___T>;
3867 }
3868
3869 #[repr(transparent)]
3871 pub struct ComponentRunnerClient<___T: ::fidl_next::Transport> {
3872 #[allow(dead_code)]
3873 client: ::fidl_next::protocol::Client<___T>,
3874 }
3875
3876 impl<___T> ComponentRunnerClient<___T>
3877 where
3878 ___T: ::fidl_next::Transport,
3879 {
3880 #[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"]
3881 pub fn start(
3882 &self,
3883
3884 start_info: impl ::fidl_next::Encode<
3885 crate::wire::ComponentStartInfo<'static>,
3886 <___T as ::fidl_next::Transport>::SendBuffer,
3887 >,
3888
3889 controller: impl ::fidl_next::Encode<
3890 ::fidl_next::ServerEnd<
3891 crate::ComponentController,
3892 ::fidl_next::wire::fuchsia::Channel,
3893 >,
3894 <___T as ::fidl_next::Transport>::SendBuffer,
3895 >,
3896 ) -> ::fidl_next::SendFuture<'_, ___T>
3897 where
3898 <___T as ::fidl_next::Transport>::SendBuffer:
3899 ::fidl_next::encoder::InternalHandleEncoder,
3900 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3901 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3902 {
3903 self.start_with(crate::generic::ComponentRunnerStartRequest {
3904 start_info,
3905
3906 controller,
3907 })
3908 }
3909
3910 #[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"]
3911 pub fn start_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3912 where
3913 ___R: ::fidl_next::Encode<
3914 crate::wire::ComponentRunnerStartRequest<'static>,
3915 <___T as ::fidl_next::Transport>::SendBuffer,
3916 >,
3917 {
3918 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3919 780715659970866697,
3920 <super::Start as ::fidl_next::Method>::FLEXIBILITY,
3921 request,
3922 ))
3923 }
3924 }
3925
3926 #[repr(transparent)]
3928 pub struct ComponentRunnerServer<___T: ::fidl_next::Transport> {
3929 server: ::fidl_next::protocol::Server<___T>,
3930 }
3931
3932 impl<___T> ComponentRunnerServer<___T> where ___T: ::fidl_next::Transport {}
3933 }
3934}
3935
3936#[diagnostic::on_unimplemented(
3937 note = "If {Self} implements the non-local ComponentRunnerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3938)]
3939
3940pub trait ComponentRunnerLocalClientHandler<
3944 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3945 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3946>
3947{
3948 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3949 ::core::future::ready(())
3950 }
3951}
3952
3953impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ComponentRunner
3954where
3955 ___H: ComponentRunnerLocalClientHandler<___T>,
3956 ___T: ::fidl_next::Transport,
3957{
3958 async fn on_event(
3959 handler: &mut ___H,
3960 mut message: ::fidl_next::Message<___T>,
3961 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3962 match *message.header().ordinal {
3963 ordinal => {
3964 handler.on_unknown_interaction(ordinal).await;
3965 if ::core::matches!(
3966 message.header().flexibility(),
3967 ::fidl_next::protocol::Flexibility::Strict
3968 ) {
3969 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3970 } else {
3971 Ok(())
3972 }
3973 }
3974 }
3975 }
3976}
3977
3978#[diagnostic::on_unimplemented(
3979 note = "If {Self} implements the non-local ComponentRunnerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3980)]
3981
3982pub trait ComponentRunnerLocalServerHandler<
3986 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3987 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3988>
3989{
3990 #[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"]
3991 fn start(
3992 &mut self,
3993
3994 request: ::fidl_next::Request<component_runner::Start, ___T>,
3995 ) -> impl ::core::future::Future<Output = ()>;
3996
3997 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3998 ::core::future::ready(())
3999 }
4000}
4001
4002impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ComponentRunner
4003where
4004 ___H: ComponentRunnerLocalServerHandler<___T>,
4005 ___T: ::fidl_next::Transport,
4006 for<'de> crate::wire::ComponentRunnerStartRequest<'de>: ::fidl_next::Decode<
4007 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4008 Constraint = (),
4009 >,
4010{
4011 async fn on_one_way(
4012 handler: &mut ___H,
4013 mut message: ::fidl_next::Message<___T>,
4014 ) -> ::core::result::Result<
4015 (),
4016 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4017 > {
4018 match *message.header().ordinal {
4019 780715659970866697 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4020 Ok(decoded) => {
4021 handler.start(::fidl_next::Request::from_decoded(decoded)).await;
4022 Ok(())
4023 }
4024 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4025 ordinal: 780715659970866697,
4026 error,
4027 }),
4028 },
4029
4030 ordinal => {
4031 handler.on_unknown_interaction(ordinal).await;
4032 if ::core::matches!(
4033 message.header().flexibility(),
4034 ::fidl_next::protocol::Flexibility::Strict
4035 ) {
4036 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4037 } else {
4038 Ok(())
4039 }
4040 }
4041 }
4042 }
4043
4044 async fn on_two_way(
4045 handler: &mut ___H,
4046 mut message: ::fidl_next::Message<___T>,
4047 responder: ::fidl_next::protocol::Responder<___T>,
4048 ) -> ::core::result::Result<
4049 (),
4050 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4051 > {
4052 match *message.header().ordinal {
4053 ordinal => {
4054 handler.on_unknown_interaction(ordinal).await;
4055 if ::core::matches!(
4056 message.header().flexibility(),
4057 ::fidl_next::protocol::Flexibility::Strict
4058 ) {
4059 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4060 } else {
4061 responder
4062 .respond_framework_error(
4063 ordinal,
4064 ::fidl_next::FrameworkError::UnknownMethod,
4065 )
4066 .expect("encoding a framework error should never fail")
4067 .await?;
4068 Ok(())
4069 }
4070 }
4071 }
4072 }
4073}
4074
4075pub trait ComponentRunnerClientHandler<
4079 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4080 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4081>
4082{
4083 fn on_unknown_interaction(
4084 &mut self,
4085 ordinal: u64,
4086 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4087 ::core::future::ready(())
4088 }
4089}
4090
4091impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ComponentRunner
4092where
4093 ___H: ComponentRunnerClientHandler<___T> + ::core::marker::Send,
4094 ___T: ::fidl_next::Transport,
4095{
4096 async fn on_event(
4097 handler: &mut ___H,
4098 mut message: ::fidl_next::Message<___T>,
4099 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4100 match *message.header().ordinal {
4101 ordinal => {
4102 handler.on_unknown_interaction(ordinal).await;
4103 if ::core::matches!(
4104 message.header().flexibility(),
4105 ::fidl_next::protocol::Flexibility::Strict
4106 ) {
4107 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4108 } else {
4109 Ok(())
4110 }
4111 }
4112 }
4113 }
4114}
4115
4116pub trait ComponentRunnerServerHandler<
4120 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4121 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4122>
4123{
4124 #[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"]
4125 fn start(
4126 &mut self,
4127
4128 request: ::fidl_next::Request<component_runner::Start, ___T>,
4129 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4130
4131 fn on_unknown_interaction(
4132 &mut self,
4133 ordinal: u64,
4134 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4135 ::core::future::ready(())
4136 }
4137}
4138
4139impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ComponentRunner
4140where
4141 ___H: ComponentRunnerServerHandler<___T> + ::core::marker::Send,
4142 ___T: ::fidl_next::Transport,
4143 for<'de> crate::wire::ComponentRunnerStartRequest<'de>: ::fidl_next::Decode<
4144 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4145 Constraint = (),
4146 >,
4147{
4148 async fn on_one_way(
4149 handler: &mut ___H,
4150 mut message: ::fidl_next::Message<___T>,
4151 ) -> ::core::result::Result<
4152 (),
4153 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4154 > {
4155 match *message.header().ordinal {
4156 780715659970866697 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4157 Ok(decoded) => {
4158 handler.start(::fidl_next::Request::from_decoded(decoded)).await;
4159 Ok(())
4160 }
4161 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4162 ordinal: 780715659970866697,
4163 error,
4164 }),
4165 },
4166
4167 ordinal => {
4168 handler.on_unknown_interaction(ordinal).await;
4169 if ::core::matches!(
4170 message.header().flexibility(),
4171 ::fidl_next::protocol::Flexibility::Strict
4172 ) {
4173 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4174 } else {
4175 Ok(())
4176 }
4177 }
4178 }
4179 }
4180
4181 async fn on_two_way(
4182 handler: &mut ___H,
4183 mut message: ::fidl_next::Message<___T>,
4184 responder: ::fidl_next::protocol::Responder<___T>,
4185 ) -> ::core::result::Result<
4186 (),
4187 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4188 > {
4189 match *message.header().ordinal {
4190 ordinal => {
4191 handler.on_unknown_interaction(ordinal).await;
4192 if ::core::matches!(
4193 message.header().flexibility(),
4194 ::fidl_next::protocol::Flexibility::Strict
4195 ) {
4196 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4197 } else {
4198 responder
4199 .respond_framework_error(
4200 ordinal,
4201 ::fidl_next::FrameworkError::UnknownMethod,
4202 )
4203 .expect("encoding a framework error should never fail")
4204 .await?;
4205 Ok(())
4206 }
4207 }
4208 }
4209 }
4210}
4211
4212impl<___T> ComponentRunnerClientHandler<___T> for ::fidl_next::IgnoreEvents
4213where
4214 ___T: ::fidl_next::Transport,
4215{
4216 async fn on_unknown_interaction(&mut self, _: u64) {}
4217}
4218
4219impl<___H, ___T> ComponentRunnerLocalClientHandler<___T> for ::fidl_next::Local<___H>
4220where
4221 ___H: ComponentRunnerClientHandler<___T>,
4222 ___T: ::fidl_next::Transport,
4223{
4224 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4225 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4226 }
4227}
4228
4229impl<___H, ___T> ComponentRunnerLocalServerHandler<___T> for ::fidl_next::Local<___H>
4230where
4231 ___H: ComponentRunnerServerHandler<___T>,
4232 ___T: ::fidl_next::Transport,
4233{
4234 async fn start(&mut self, request: ::fidl_next::Request<component_runner::Start, ___T>) {
4235 ___H::start(&mut self.0, request).await
4236 }
4237
4238 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4239 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4240 }
4241}
4242
4243#[doc = " Served by runners that want to make a zircon job available through their runtime directory.\n"]
4245#[derive(PartialEq, Debug)]
4246pub struct TaskProvider;
4247
4248impl ::fidl_next::Discoverable for TaskProvider {
4249 const PROTOCOL_NAME: &'static str = "fuchsia.component.runner.TaskProvider";
4250}
4251
4252#[cfg(target_os = "fuchsia")]
4253impl ::fidl_next::HasTransport for TaskProvider {
4254 type Transport = ::fidl_next::fuchsia::zx::Channel;
4255}
4256
4257pub mod task_provider {
4258 pub mod prelude {
4259 pub use crate::{
4260 TaskProvider, TaskProviderClientHandler, TaskProviderLocalClientHandler,
4261 TaskProviderLocalServerHandler, TaskProviderServerHandler, task_provider,
4262 };
4263
4264 pub use crate::natural::TaskProviderGetJobResponse;
4265 }
4266
4267 pub struct GetJob;
4268
4269 impl ::fidl_next::Method for GetJob {
4270 const ORDINAL: u64 = 5520468615388521389;
4271 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4272 ::fidl_next::protocol::Flexibility::Strict;
4273
4274 type Protocol = crate::TaskProvider;
4275
4276 type Request = ::fidl_next::wire::EmptyMessageBody;
4277 }
4278
4279 impl ::fidl_next::TwoWayMethod for GetJob {
4280 type Response = ::fidl_next::wire::Result<
4281 'static,
4282 crate::wire::TaskProviderGetJobResponse,
4283 ::fidl_next::wire::fuchsia::Status,
4284 >;
4285 }
4286
4287 impl<___R> ::fidl_next::Respond<___R> for GetJob {
4288 type Output = ::core::result::Result<
4289 crate::generic::TaskProviderGetJobResponse<___R>,
4290 ::fidl_next::never::Never,
4291 >;
4292
4293 fn respond(response: ___R) -> Self::Output {
4294 ::core::result::Result::Ok(crate::generic::TaskProviderGetJobResponse { job: response })
4295 }
4296 }
4297
4298 impl<___R> ::fidl_next::RespondErr<___R> for GetJob {
4299 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
4300
4301 fn respond_err(response: ___R) -> Self::Output {
4302 ::core::result::Result::Err(response)
4303 }
4304 }
4305
4306 mod ___detail {
4307 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::TaskProvider
4308 where
4309 ___T: ::fidl_next::Transport,
4310 {
4311 type Client = TaskProviderClient<___T>;
4312 type Server = TaskProviderServer<___T>;
4313 }
4314
4315 #[repr(transparent)]
4317 pub struct TaskProviderClient<___T: ::fidl_next::Transport> {
4318 #[allow(dead_code)]
4319 client: ::fidl_next::protocol::Client<___T>,
4320 }
4321
4322 impl<___T> TaskProviderClient<___T>
4323 where
4324 ___T: ::fidl_next::Transport,
4325 {
4326 #[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"]
4327 pub fn get_job(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetJob, ___T> {
4328 ::fidl_next::TwoWayFuture::from_untyped(
4329 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4330 5520468615388521389,
4331 <super::GetJob as ::fidl_next::Method>::FLEXIBILITY,
4332 (),
4333 ),
4334 )
4335 }
4336 }
4337
4338 #[repr(transparent)]
4340 pub struct TaskProviderServer<___T: ::fidl_next::Transport> {
4341 server: ::fidl_next::protocol::Server<___T>,
4342 }
4343
4344 impl<___T> TaskProviderServer<___T> where ___T: ::fidl_next::Transport {}
4345 }
4346}
4347
4348#[diagnostic::on_unimplemented(
4349 note = "If {Self} implements the non-local TaskProviderClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4350)]
4351
4352pub trait TaskProviderLocalClientHandler<
4356 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4357 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4358>
4359{
4360 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4361 ::core::future::ready(())
4362 }
4363}
4364
4365impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for TaskProvider
4366where
4367 ___H: TaskProviderLocalClientHandler<___T>,
4368 ___T: ::fidl_next::Transport,
4369{
4370 async fn on_event(
4371 handler: &mut ___H,
4372 mut message: ::fidl_next::Message<___T>,
4373 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4374 match *message.header().ordinal {
4375 ordinal => {
4376 handler.on_unknown_interaction(ordinal).await;
4377 if ::core::matches!(
4378 message.header().flexibility(),
4379 ::fidl_next::protocol::Flexibility::Strict
4380 ) {
4381 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4382 } else {
4383 Ok(())
4384 }
4385 }
4386 }
4387 }
4388}
4389
4390#[diagnostic::on_unimplemented(
4391 note = "If {Self} implements the non-local TaskProviderServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4392)]
4393
4394pub trait TaskProviderLocalServerHandler<
4398 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4399 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4400>
4401{
4402 #[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"]
4403 fn get_job(
4404 &mut self,
4405
4406 responder: ::fidl_next::Responder<task_provider::GetJob, ___T>,
4407 ) -> impl ::core::future::Future<Output = ()>;
4408
4409 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4410 ::core::future::ready(())
4411 }
4412}
4413
4414impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for TaskProvider
4415where
4416 ___H: TaskProviderLocalServerHandler<___T>,
4417 ___T: ::fidl_next::Transport,
4418{
4419 async fn on_one_way(
4420 handler: &mut ___H,
4421 mut message: ::fidl_next::Message<___T>,
4422 ) -> ::core::result::Result<
4423 (),
4424 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4425 > {
4426 match *message.header().ordinal {
4427 ordinal => {
4428 handler.on_unknown_interaction(ordinal).await;
4429 if ::core::matches!(
4430 message.header().flexibility(),
4431 ::fidl_next::protocol::Flexibility::Strict
4432 ) {
4433 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4434 } else {
4435 Ok(())
4436 }
4437 }
4438 }
4439 }
4440
4441 async fn on_two_way(
4442 handler: &mut ___H,
4443 mut message: ::fidl_next::Message<___T>,
4444 responder: ::fidl_next::protocol::Responder<___T>,
4445 ) -> ::core::result::Result<
4446 (),
4447 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4448 > {
4449 match *message.header().ordinal {
4450 5520468615388521389 => {
4451 let responder = ::fidl_next::Responder::from_untyped(responder);
4452
4453 handler.get_job(responder).await;
4454 Ok(())
4455 }
4456
4457 ordinal => {
4458 handler.on_unknown_interaction(ordinal).await;
4459 if ::core::matches!(
4460 message.header().flexibility(),
4461 ::fidl_next::protocol::Flexibility::Strict
4462 ) {
4463 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4464 } else {
4465 responder
4466 .respond_framework_error(
4467 ordinal,
4468 ::fidl_next::FrameworkError::UnknownMethod,
4469 )
4470 .expect("encoding a framework error should never fail")
4471 .await?;
4472 Ok(())
4473 }
4474 }
4475 }
4476 }
4477}
4478
4479pub trait TaskProviderClientHandler<
4483 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4484 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4485>
4486{
4487 fn on_unknown_interaction(
4488 &mut self,
4489 ordinal: u64,
4490 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4491 ::core::future::ready(())
4492 }
4493}
4494
4495impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for TaskProvider
4496where
4497 ___H: TaskProviderClientHandler<___T> + ::core::marker::Send,
4498 ___T: ::fidl_next::Transport,
4499{
4500 async fn on_event(
4501 handler: &mut ___H,
4502 mut message: ::fidl_next::Message<___T>,
4503 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4504 match *message.header().ordinal {
4505 ordinal => {
4506 handler.on_unknown_interaction(ordinal).await;
4507 if ::core::matches!(
4508 message.header().flexibility(),
4509 ::fidl_next::protocol::Flexibility::Strict
4510 ) {
4511 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4512 } else {
4513 Ok(())
4514 }
4515 }
4516 }
4517 }
4518}
4519
4520pub trait TaskProviderServerHandler<
4524 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4525 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4526>
4527{
4528 #[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"]
4529 fn get_job(
4530 &mut self,
4531
4532 responder: ::fidl_next::Responder<task_provider::GetJob, ___T>,
4533 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4534
4535 fn on_unknown_interaction(
4536 &mut self,
4537 ordinal: u64,
4538 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4539 ::core::future::ready(())
4540 }
4541}
4542
4543impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for TaskProvider
4544where
4545 ___H: TaskProviderServerHandler<___T> + ::core::marker::Send,
4546 ___T: ::fidl_next::Transport,
4547{
4548 async fn on_one_way(
4549 handler: &mut ___H,
4550 mut message: ::fidl_next::Message<___T>,
4551 ) -> ::core::result::Result<
4552 (),
4553 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4554 > {
4555 match *message.header().ordinal {
4556 ordinal => {
4557 handler.on_unknown_interaction(ordinal).await;
4558 if ::core::matches!(
4559 message.header().flexibility(),
4560 ::fidl_next::protocol::Flexibility::Strict
4561 ) {
4562 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4563 } else {
4564 Ok(())
4565 }
4566 }
4567 }
4568 }
4569
4570 async fn on_two_way(
4571 handler: &mut ___H,
4572 mut message: ::fidl_next::Message<___T>,
4573 responder: ::fidl_next::protocol::Responder<___T>,
4574 ) -> ::core::result::Result<
4575 (),
4576 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4577 > {
4578 match *message.header().ordinal {
4579 5520468615388521389 => {
4580 let responder = ::fidl_next::Responder::from_untyped(responder);
4581
4582 handler.get_job(responder).await;
4583 Ok(())
4584 }
4585
4586 ordinal => {
4587 handler.on_unknown_interaction(ordinal).await;
4588 if ::core::matches!(
4589 message.header().flexibility(),
4590 ::fidl_next::protocol::Flexibility::Strict
4591 ) {
4592 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4593 } else {
4594 responder
4595 .respond_framework_error(
4596 ordinal,
4597 ::fidl_next::FrameworkError::UnknownMethod,
4598 )
4599 .expect("encoding a framework error should never fail")
4600 .await?;
4601 Ok(())
4602 }
4603 }
4604 }
4605 }
4606}
4607
4608impl<___T> TaskProviderClientHandler<___T> for ::fidl_next::IgnoreEvents
4609where
4610 ___T: ::fidl_next::Transport,
4611{
4612 async fn on_unknown_interaction(&mut self, _: u64) {}
4613}
4614
4615impl<___H, ___T> TaskProviderLocalClientHandler<___T> for ::fidl_next::Local<___H>
4616where
4617 ___H: TaskProviderClientHandler<___T>,
4618 ___T: ::fidl_next::Transport,
4619{
4620 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4621 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4622 }
4623}
4624
4625impl<___H, ___T> TaskProviderLocalServerHandler<___T> for ::fidl_next::Local<___H>
4626where
4627 ___H: TaskProviderServerHandler<___T>,
4628 ___T: ::fidl_next::Transport,
4629{
4630 async fn get_job(&mut self, responder: ::fidl_next::Responder<task_provider::GetJob, ___T>) {
4631 ___H::get_job(&mut self.0, responder).await
4632 }
4633
4634 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4635 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4636 }
4637}
4638
4639pub use fidl_next_common_fuchsia_component_runner::*;