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