1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(Debug)]
6pub enum Task {
7 Job(::fidl_next::fuchsia::zx::Handle),
8
9 Process(::fidl_next::fuchsia::zx::Handle),
10
11 Thread(::fidl_next::fuchsia::zx::Handle),
12
13 UnknownOrdinal_(u64),
14}
15
16impl ::fidl_next::Encodable for Task {
17 type Encoded = WireTask;
18}
19
20unsafe impl<___E> ::fidl_next::Encode<___E> for Task
21where
22 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23
24 ___E: ::fidl_next::fuchsia::HandleEncoder,
25{
26 #[inline]
27 fn encode(
28 self,
29 encoder: &mut ___E,
30 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31 ) -> Result<(), ::fidl_next::EncodeError> {
32 ::fidl_next::munge!(let WireTask { raw } = out);
33
34 match self {
35 Self::Job(value) => ::fidl_next::RawWireUnion::encode_as_static::<
36 ___E,
37 ::fidl_next::fuchsia::zx::Handle,
38 >(value, 1, encoder, raw)?,
39
40 Self::Process(value) => ::fidl_next::RawWireUnion::encode_as_static::<
41 ___E,
42 ::fidl_next::fuchsia::zx::Handle,
43 >(value, 2, encoder, raw)?,
44
45 Self::Thread(value) => ::fidl_next::RawWireUnion::encode_as_static::<
46 ___E,
47 ::fidl_next::fuchsia::zx::Handle,
48 >(value, 3, encoder, raw)?,
49
50 Self::UnknownOrdinal_(ordinal) => {
51 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
52 }
53 }
54
55 Ok(())
56 }
57}
58
59impl ::fidl_next::EncodableOption for Box<Task> {
60 type EncodedOption = WireOptionalTask;
61}
62
63unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Task>
64where
65 ___E: ?Sized,
66 Task: ::fidl_next::Encode<___E>,
67{
68 #[inline]
69 fn encode_option(
70 this: Option<Self>,
71 encoder: &mut ___E,
72 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
73 ) -> Result<(), ::fidl_next::EncodeError> {
74 ::fidl_next::munge!(let WireOptionalTask { raw } = &mut *out);
75
76 if let Some(inner) = this {
77 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
78 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
79 } else {
80 ::fidl_next::RawWireUnion::encode_absent(raw);
81 }
82
83 Ok(())
84 }
85}
86
87impl ::fidl_next::TakeFrom<WireTask> for Task {
88 #[inline]
89 fn take_from(from: &WireTask) -> Self {
90 match from.raw.ordinal() {
91 1 => Self::Job(::fidl_next::TakeFrom::take_from(unsafe {
92 from.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
93 })),
94
95 2 => Self::Process(::fidl_next::TakeFrom::take_from(unsafe {
96 from.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
97 })),
98
99 3 => Self::Thread(::fidl_next::TakeFrom::take_from(unsafe {
100 from.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
101 })),
102
103 _ => unsafe { ::core::hint::unreachable_unchecked() },
104 }
105 }
106}
107
108impl ::fidl_next::TakeFrom<WireOptionalTask> for Option<Box<Task>> {
109 #[inline]
110 fn take_from(from: &WireOptionalTask) -> Self {
111 if let Some(inner) = from.as_ref() {
112 Some(::fidl_next::TakeFrom::take_from(inner))
113 } else {
114 None
115 }
116 }
117}
118
119#[repr(transparent)]
121pub struct WireTask {
122 raw: ::fidl_next::RawWireUnion,
123}
124
125unsafe impl ::fidl_next::ZeroPadding for WireTask {
126 #[inline]
127 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
128 ::fidl_next::munge!(let Self { raw } = out);
129 ::fidl_next::RawWireUnion::zero_padding(raw);
130 }
131}
132
133pub mod task {
134 pub enum Ref<'union> {
135 Job(&'union ::fidl_next::fuchsia::WireHandle),
136
137 Process(&'union ::fidl_next::fuchsia::WireHandle),
138
139 Thread(&'union ::fidl_next::fuchsia::WireHandle),
140
141 UnknownOrdinal_(u64),
142 }
143}
144
145impl WireTask {
146 pub fn as_ref(&self) -> crate::task::Ref<'_> {
147 match self.raw.ordinal() {
148 1 => crate::task::Ref::Job(unsafe {
149 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
150 }),
151
152 2 => crate::task::Ref::Process(unsafe {
153 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
154 }),
155
156 3 => crate::task::Ref::Thread(unsafe {
157 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
158 }),
159
160 unknown => crate::task::Ref::UnknownOrdinal_(unknown),
161 }
162 }
163}
164
165unsafe impl<___D> ::fidl_next::Decode<___D> for WireTask
166where
167 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
168
169 ___D: ::fidl_next::fuchsia::HandleDecoder,
170{
171 fn decode(
172 mut slot: ::fidl_next::Slot<'_, Self>,
173 decoder: &mut ___D,
174 ) -> Result<(), ::fidl_next::DecodeError> {
175 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
176 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
177 1 => ::fidl_next::RawWireUnion::decode_as_static::<
178 ___D,
179 ::fidl_next::fuchsia::WireHandle,
180 >(raw, decoder)?,
181
182 2 => ::fidl_next::RawWireUnion::decode_as_static::<
183 ___D,
184 ::fidl_next::fuchsia::WireHandle,
185 >(raw, decoder)?,
186
187 3 => ::fidl_next::RawWireUnion::decode_as_static::<
188 ___D,
189 ::fidl_next::fuchsia::WireHandle,
190 >(raw, decoder)?,
191
192 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
193 }
194
195 Ok(())
196 }
197}
198
199impl ::core::fmt::Debug for WireTask {
200 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
201 match self.raw.ordinal() {
202 1 => unsafe {
203 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>().fmt(f)
204 },
205 2 => unsafe {
206 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>().fmt(f)
207 },
208 3 => unsafe {
209 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>().fmt(f)
210 },
211 _ => unsafe { ::core::hint::unreachable_unchecked() },
212 }
213 }
214}
215
216#[repr(transparent)]
217pub struct WireOptionalTask {
218 raw: ::fidl_next::RawWireUnion,
219}
220
221unsafe impl ::fidl_next::ZeroPadding for WireOptionalTask {
222 #[inline]
223 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
224 ::fidl_next::munge!(let Self { raw } = out);
225 ::fidl_next::RawWireUnion::zero_padding(raw);
226 }
227}
228
229impl WireOptionalTask {
230 pub fn is_some(&self) -> bool {
231 self.raw.is_some()
232 }
233
234 pub fn is_none(&self) -> bool {
235 self.raw.is_none()
236 }
237
238 pub fn as_ref(&self) -> Option<&WireTask> {
239 if self.is_some() {
240 Some(unsafe { &*(self as *const Self).cast() })
241 } else {
242 None
243 }
244 }
245}
246
247unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalTask
248where
249 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
250
251 ___D: ::fidl_next::fuchsia::HandleDecoder,
252{
253 fn decode(
254 mut slot: ::fidl_next::Slot<'_, Self>,
255 decoder: &mut ___D,
256 ) -> Result<(), ::fidl_next::DecodeError> {
257 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
258 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
259 1 => ::fidl_next::RawWireUnion::decode_as_static::<
260 ___D,
261 ::fidl_next::fuchsia::WireHandle,
262 >(raw, decoder)?,
263
264 2 => ::fidl_next::RawWireUnion::decode_as_static::<
265 ___D,
266 ::fidl_next::fuchsia::WireHandle,
267 >(raw, decoder)?,
268
269 3 => ::fidl_next::RawWireUnion::decode_as_static::<
270 ___D,
271 ::fidl_next::fuchsia::WireHandle,
272 >(raw, decoder)?,
273
274 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
275 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
276 }
277
278 Ok(())
279 }
280}
281
282impl ::core::fmt::Debug for WireOptionalTask {
283 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
284 self.as_ref().fmt(f)
285 }
286}
287
288#[derive(Debug, Default)]
289pub struct ComponentTasks {
290 pub component_task: Option<crate::Task>,
291
292 pub parent_task: Option<crate::Task>,
293}
294
295impl ComponentTasks {
296 fn __max_ordinal(&self) -> usize {
297 if self.component_task.is_some() {
298 return 1;
299 }
300
301 if self.parent_task.is_some() {
302 return 2;
303 }
304
305 0
306 }
307}
308
309impl ::fidl_next::Encodable for ComponentTasks {
310 type Encoded = WireComponentTasks;
311}
312
313unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentTasks
314where
315 ___E: ::fidl_next::Encoder + ?Sized,
316
317 ___E: ::fidl_next::fuchsia::HandleEncoder,
318{
319 #[inline]
320 fn encode(
321 mut self,
322 encoder: &mut ___E,
323 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
324 ) -> Result<(), ::fidl_next::EncodeError> {
325 ::fidl_next::munge!(let WireComponentTasks { table } = out);
326
327 let max_ord = self.__max_ordinal();
328
329 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
330 ::fidl_next::ZeroPadding::zero_padding(&mut out);
331
332 let mut preallocated =
333 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
334
335 for i in 1..=max_ord {
336 match i {
337 2 => {
338 if let Some(parent_task) = self.parent_task.take() {
339 ::fidl_next::WireEnvelope::encode_value(
340 parent_task,
341 preallocated.encoder,
342 &mut out,
343 )?;
344 } else {
345 ::fidl_next::WireEnvelope::encode_zero(&mut out)
346 }
347 }
348
349 1 => {
350 if let Some(component_task) = self.component_task.take() {
351 ::fidl_next::WireEnvelope::encode_value(
352 component_task,
353 preallocated.encoder,
354 &mut out,
355 )?;
356 } else {
357 ::fidl_next::WireEnvelope::encode_zero(&mut out)
358 }
359 }
360
361 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
362 }
363 unsafe {
364 preallocated.write_next(out.assume_init_ref());
365 }
366 }
367
368 ::fidl_next::WireTable::encode_len(table, max_ord);
369
370 Ok(())
371 }
372}
373
374impl ::fidl_next::TakeFrom<WireComponentTasks> for ComponentTasks {
375 #[inline]
376 fn take_from(from: &WireComponentTasks) -> Self {
377 Self {
378 component_task: from.component_task().map(::fidl_next::TakeFrom::take_from),
379
380 parent_task: from.parent_task().map(::fidl_next::TakeFrom::take_from),
381 }
382 }
383}
384
385#[repr(C)]
387pub struct WireComponentTasks {
388 table: ::fidl_next::WireTable,
389}
390
391unsafe impl ::fidl_next::ZeroPadding for WireComponentTasks {
392 #[inline]
393 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
394 ::fidl_next::munge!(let Self { table } = out);
395 ::fidl_next::WireTable::zero_padding(table);
396 }
397}
398
399unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentTasks
400where
401 ___D: ::fidl_next::Decoder + ?Sized,
402
403 ___D: ::fidl_next::fuchsia::HandleDecoder,
404{
405 fn decode(
406 slot: ::fidl_next::Slot<'_, Self>,
407 decoder: &mut ___D,
408 ) -> Result<(), ::fidl_next::DecodeError> {
409 ::fidl_next::munge!(let Self { table } = slot);
410
411 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
412 match ordinal {
413 0 => unsafe { ::core::hint::unreachable_unchecked() },
414
415 1 => {
416 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireTask>(
417 slot.as_mut(),
418 decoder,
419 )?;
420
421 Ok(())
422 }
423
424 2 => {
425 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireTask>(
426 slot.as_mut(),
427 decoder,
428 )?;
429
430 Ok(())
431 }
432
433 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
434 }
435 })
436 }
437}
438
439impl WireComponentTasks {
440 pub fn component_task(&self) -> Option<&crate::WireTask> {
441 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
442 }
443
444 pub fn parent_task(&self) -> Option<&crate::WireTask> {
445 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
446 }
447}
448
449impl ::core::fmt::Debug for WireComponentTasks {
450 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
451 f.debug_struct("ComponentTasks")
452 .field("component_task", &self.component_task())
453 .field("parent_task", &self.parent_task())
454 .finish()
455 }
456}
457
458#[derive(Debug, Default)]
459pub struct ComponentDiagnostics {
460 pub tasks: Option<crate::ComponentTasks>,
461}
462
463impl ComponentDiagnostics {
464 fn __max_ordinal(&self) -> usize {
465 if self.tasks.is_some() {
466 return 1;
467 }
468
469 0
470 }
471}
472
473impl ::fidl_next::Encodable for ComponentDiagnostics {
474 type Encoded = WireComponentDiagnostics;
475}
476
477unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentDiagnostics
478where
479 ___E: ::fidl_next::Encoder + ?Sized,
480
481 ___E: ::fidl_next::fuchsia::HandleEncoder,
482{
483 #[inline]
484 fn encode(
485 mut self,
486 encoder: &mut ___E,
487 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
488 ) -> Result<(), ::fidl_next::EncodeError> {
489 ::fidl_next::munge!(let WireComponentDiagnostics { table } = out);
490
491 let max_ord = self.__max_ordinal();
492
493 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
494 ::fidl_next::ZeroPadding::zero_padding(&mut out);
495
496 let mut preallocated =
497 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
498
499 for i in 1..=max_ord {
500 match i {
501 1 => {
502 if let Some(tasks) = self.tasks.take() {
503 ::fidl_next::WireEnvelope::encode_value(
504 tasks,
505 preallocated.encoder,
506 &mut out,
507 )?;
508 } else {
509 ::fidl_next::WireEnvelope::encode_zero(&mut out)
510 }
511 }
512
513 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
514 }
515 unsafe {
516 preallocated.write_next(out.assume_init_ref());
517 }
518 }
519
520 ::fidl_next::WireTable::encode_len(table, max_ord);
521
522 Ok(())
523 }
524}
525
526impl ::fidl_next::TakeFrom<WireComponentDiagnostics> for ComponentDiagnostics {
527 #[inline]
528 fn take_from(from: &WireComponentDiagnostics) -> Self {
529 Self { tasks: from.tasks().map(::fidl_next::TakeFrom::take_from) }
530 }
531}
532
533#[repr(C)]
535pub struct WireComponentDiagnostics {
536 table: ::fidl_next::WireTable,
537}
538
539unsafe impl ::fidl_next::ZeroPadding for WireComponentDiagnostics {
540 #[inline]
541 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
542 ::fidl_next::munge!(let Self { table } = out);
543 ::fidl_next::WireTable::zero_padding(table);
544 }
545}
546
547unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentDiagnostics
548where
549 ___D: ::fidl_next::Decoder + ?Sized,
550
551 ___D: ::fidl_next::fuchsia::HandleDecoder,
552{
553 fn decode(
554 slot: ::fidl_next::Slot<'_, Self>,
555 decoder: &mut ___D,
556 ) -> Result<(), ::fidl_next::DecodeError> {
557 ::fidl_next::munge!(let Self { table } = slot);
558
559 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
560 match ordinal {
561 0 => unsafe { ::core::hint::unreachable_unchecked() },
562
563 1 => {
564 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireComponentTasks>(
565 slot.as_mut(),
566 decoder,
567 )?;
568
569 Ok(())
570 }
571
572 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
573 }
574 })
575 }
576}
577
578impl WireComponentDiagnostics {
579 pub fn tasks(&self) -> Option<&crate::WireComponentTasks> {
580 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
581 }
582}
583
584impl ::core::fmt::Debug for WireComponentDiagnostics {
585 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
586 f.debug_struct("ComponentDiagnostics").field("tasks", &self.tasks()).finish()
587 }
588}
589
590#[derive(Debug)]
591pub struct ComponentControllerOnPublishDiagnosticsRequest {
592 pub payload: crate::ComponentDiagnostics,
593}
594
595impl ::fidl_next::Encodable for ComponentControllerOnPublishDiagnosticsRequest {
596 type Encoded = WireComponentControllerOnPublishDiagnosticsRequest;
597}
598
599unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentControllerOnPublishDiagnosticsRequest
600where
601 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
602
603 ___E: ::fidl_next::Encoder,
604
605 ___E: ::fidl_next::fuchsia::HandleEncoder,
606{
607 #[inline]
608 fn encode(
609 self,
610 encoder: &mut ___E,
611 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
612 ) -> Result<(), ::fidl_next::EncodeError> {
613 ::fidl_next::munge! {
614 let Self::Encoded {
615 payload,
616
617 } = out;
618 }
619
620 ::fidl_next::Encode::encode(self.payload, encoder, payload)?;
621
622 Ok(())
623 }
624}
625
626impl ::fidl_next::EncodableOption for Box<ComponentControllerOnPublishDiagnosticsRequest> {
627 type EncodedOption = ::fidl_next::WireBox<WireComponentControllerOnPublishDiagnosticsRequest>;
628}
629
630unsafe impl<___E> ::fidl_next::EncodeOption<___E>
631 for Box<ComponentControllerOnPublishDiagnosticsRequest>
632where
633 ___E: ::fidl_next::Encoder + ?Sized,
634 ComponentControllerOnPublishDiagnosticsRequest: ::fidl_next::Encode<___E>,
635{
636 #[inline]
637 fn encode_option(
638 this: Option<Self>,
639 encoder: &mut ___E,
640 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
641 ) -> Result<(), ::fidl_next::EncodeError> {
642 if let Some(inner) = this {
643 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
644 ::fidl_next::WireBox::encode_present(out);
645 } else {
646 ::fidl_next::WireBox::encode_absent(out);
647 }
648
649 Ok(())
650 }
651}
652
653impl ::fidl_next::TakeFrom<WireComponentControllerOnPublishDiagnosticsRequest>
654 for ComponentControllerOnPublishDiagnosticsRequest
655{
656 #[inline]
657 fn take_from(from: &WireComponentControllerOnPublishDiagnosticsRequest) -> Self {
658 Self { payload: ::fidl_next::TakeFrom::take_from(&from.payload) }
659 }
660}
661
662#[derive(Debug)]
664#[repr(C)]
665pub struct WireComponentControllerOnPublishDiagnosticsRequest {
666 pub payload: crate::WireComponentDiagnostics,
667}
668
669unsafe impl ::fidl_next::ZeroPadding for WireComponentControllerOnPublishDiagnosticsRequest {
670 #[inline]
671 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
672}
673
674unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentControllerOnPublishDiagnosticsRequest
675where
676 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
677
678 ___D: ::fidl_next::Decoder,
679
680 ___D: ::fidl_next::fuchsia::HandleDecoder,
681{
682 fn decode(
683 slot: ::fidl_next::Slot<'_, Self>,
684 decoder: &mut ___D,
685 ) -> Result<(), ::fidl_next::DecodeError> {
686 ::fidl_next::munge! {
687 let Self {
688 mut payload,
689
690 } = slot;
691 }
692
693 ::fidl_next::Decode::decode(payload.as_mut(), decoder)?;
694
695 Ok(())
696 }
697}
698
699#[derive(Debug, Default)]
700pub struct ComponentControllerOnEscrowRequest {
701 pub outgoing_dir: Option<
702 ::fidl_next::ServerEnd<
703 ::fidl_next::fuchsia::zx::Channel,
704 ::fidl_next_fuchsia_io::Directory,
705 >,
706 >,
707
708 pub escrowed_dictionary: Option<::fidl_next_fuchsia_component_sandbox::DictionaryRef>,
709}
710
711impl ComponentControllerOnEscrowRequest {
712 fn __max_ordinal(&self) -> usize {
713 if self.outgoing_dir.is_some() {
714 return 1;
715 }
716
717 if self.escrowed_dictionary.is_some() {
718 return 2;
719 }
720
721 0
722 }
723}
724
725impl ::fidl_next::Encodable for ComponentControllerOnEscrowRequest {
726 type Encoded = WireComponentControllerOnEscrowRequest;
727}
728
729unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentControllerOnEscrowRequest
730where
731 ___E: ::fidl_next::Encoder + ?Sized,
732
733 ___E: ::fidl_next::fuchsia::HandleEncoder,
734{
735 #[inline]
736 fn encode(
737 mut self,
738 encoder: &mut ___E,
739 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
740 ) -> Result<(), ::fidl_next::EncodeError> {
741 ::fidl_next::munge!(let WireComponentControllerOnEscrowRequest { table } = out);
742
743 let max_ord = self.__max_ordinal();
744
745 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
746 ::fidl_next::ZeroPadding::zero_padding(&mut out);
747
748 let mut preallocated =
749 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
750
751 for i in 1..=max_ord {
752 match i {
753 2 => {
754 if let Some(escrowed_dictionary) = self.escrowed_dictionary.take() {
755 ::fidl_next::WireEnvelope::encode_value(
756 escrowed_dictionary,
757 preallocated.encoder,
758 &mut out,
759 )?;
760 } else {
761 ::fidl_next::WireEnvelope::encode_zero(&mut out)
762 }
763 }
764
765 1 => {
766 if let Some(outgoing_dir) = self.outgoing_dir.take() {
767 ::fidl_next::WireEnvelope::encode_value(
768 outgoing_dir,
769 preallocated.encoder,
770 &mut out,
771 )?;
772 } else {
773 ::fidl_next::WireEnvelope::encode_zero(&mut out)
774 }
775 }
776
777 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
778 }
779 unsafe {
780 preallocated.write_next(out.assume_init_ref());
781 }
782 }
783
784 ::fidl_next::WireTable::encode_len(table, max_ord);
785
786 Ok(())
787 }
788}
789
790impl ::fidl_next::TakeFrom<WireComponentControllerOnEscrowRequest>
791 for ComponentControllerOnEscrowRequest
792{
793 #[inline]
794 fn take_from(from: &WireComponentControllerOnEscrowRequest) -> Self {
795 Self {
796 outgoing_dir: from.outgoing_dir().map(::fidl_next::TakeFrom::take_from),
797
798 escrowed_dictionary: from.escrowed_dictionary().map(::fidl_next::TakeFrom::take_from),
799 }
800 }
801}
802
803#[repr(C)]
805pub struct WireComponentControllerOnEscrowRequest {
806 table: ::fidl_next::WireTable,
807}
808
809unsafe impl ::fidl_next::ZeroPadding for WireComponentControllerOnEscrowRequest {
810 #[inline]
811 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
812 ::fidl_next::munge!(let Self { table } = out);
813 ::fidl_next::WireTable::zero_padding(table);
814 }
815}
816
817unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentControllerOnEscrowRequest
818where
819 ___D: ::fidl_next::Decoder + ?Sized,
820
821 ___D: ::fidl_next::fuchsia::HandleDecoder,
822{
823 fn decode(
824 slot: ::fidl_next::Slot<'_, Self>,
825 decoder: &mut ___D,
826 ) -> Result<(), ::fidl_next::DecodeError> {
827 ::fidl_next::munge!(let Self { table } = slot);
828
829 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
830 match ordinal {
831 0 => unsafe { ::core::hint::unreachable_unchecked() },
832
833 1 => {
834 ::fidl_next::WireEnvelope::decode_as::<
835 ___D,
836 ::fidl_next::ServerEnd<
837 ::fidl_next::fuchsia::WireChannel,
838 ::fidl_next_fuchsia_io::Directory,
839 >,
840 >(slot.as_mut(), decoder)?;
841
842 Ok(())
843 }
844
845 2 => {
846 ::fidl_next::WireEnvelope::decode_as::<
847 ___D,
848 ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
849 >(slot.as_mut(), decoder)?;
850
851 Ok(())
852 }
853
854 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
855 }
856 })
857 }
858}
859
860impl WireComponentControllerOnEscrowRequest {
861 pub fn outgoing_dir(
862 &self,
863 ) -> Option<
864 &::fidl_next::ServerEnd<
865 ::fidl_next::fuchsia::WireChannel,
866 ::fidl_next_fuchsia_io::Directory,
867 >,
868 > {
869 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
870 }
871
872 pub fn escrowed_dictionary(
873 &self,
874 ) -> Option<&::fidl_next_fuchsia_component_sandbox::WireDictionaryRef> {
875 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
876 }
877}
878
879impl ::core::fmt::Debug for WireComponentControllerOnEscrowRequest {
880 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
881 f.debug_struct("ComponentControllerOnEscrowRequest")
882 .field("outgoing_dir", &self.outgoing_dir())
883 .field("escrowed_dictionary", &self.escrowed_dictionary())
884 .finish()
885 }
886}
887
888#[derive(Debug, Default)]
889pub struct ComponentStopInfo {
890 pub termination_status: Option<i32>,
891
892 pub exit_code: Option<i64>,
893}
894
895impl ComponentStopInfo {
896 fn __max_ordinal(&self) -> usize {
897 if self.termination_status.is_some() {
898 return 1;
899 }
900
901 if self.exit_code.is_some() {
902 return 2;
903 }
904
905 0
906 }
907}
908
909impl ::fidl_next::Encodable for ComponentStopInfo {
910 type Encoded = WireComponentStopInfo;
911}
912
913unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentStopInfo
914where
915 ___E: ::fidl_next::Encoder + ?Sized,
916
917 ___E: ::fidl_next::fuchsia::HandleEncoder,
918{
919 #[inline]
920 fn encode(
921 mut self,
922 encoder: &mut ___E,
923 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
924 ) -> Result<(), ::fidl_next::EncodeError> {
925 ::fidl_next::munge!(let WireComponentStopInfo { table } = out);
926
927 let max_ord = self.__max_ordinal();
928
929 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
930 ::fidl_next::ZeroPadding::zero_padding(&mut out);
931
932 let mut preallocated =
933 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
934
935 for i in 1..=max_ord {
936 match i {
937 2 => {
938 if let Some(exit_code) = self.exit_code.take() {
939 ::fidl_next::WireEnvelope::encode_value(
940 exit_code,
941 preallocated.encoder,
942 &mut out,
943 )?;
944 } else {
945 ::fidl_next::WireEnvelope::encode_zero(&mut out)
946 }
947 }
948
949 1 => {
950 if let Some(termination_status) = self.termination_status.take() {
951 ::fidl_next::WireEnvelope::encode_value(
952 termination_status,
953 preallocated.encoder,
954 &mut out,
955 )?;
956 } else {
957 ::fidl_next::WireEnvelope::encode_zero(&mut out)
958 }
959 }
960
961 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
962 }
963 unsafe {
964 preallocated.write_next(out.assume_init_ref());
965 }
966 }
967
968 ::fidl_next::WireTable::encode_len(table, max_ord);
969
970 Ok(())
971 }
972}
973
974impl ::fidl_next::TakeFrom<WireComponentStopInfo> for ComponentStopInfo {
975 #[inline]
976 fn take_from(from: &WireComponentStopInfo) -> Self {
977 Self {
978 termination_status: from.termination_status().map(::fidl_next::TakeFrom::take_from),
979
980 exit_code: from.exit_code().map(::fidl_next::TakeFrom::take_from),
981 }
982 }
983}
984
985#[repr(C)]
987pub struct WireComponentStopInfo {
988 table: ::fidl_next::WireTable,
989}
990
991unsafe impl ::fidl_next::ZeroPadding for WireComponentStopInfo {
992 #[inline]
993 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
994 ::fidl_next::munge!(let Self { table } = out);
995 ::fidl_next::WireTable::zero_padding(table);
996 }
997}
998
999unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentStopInfo
1000where
1001 ___D: ::fidl_next::Decoder + ?Sized,
1002
1003 ___D: ::fidl_next::fuchsia::HandleDecoder,
1004{
1005 fn decode(
1006 slot: ::fidl_next::Slot<'_, Self>,
1007 decoder: &mut ___D,
1008 ) -> Result<(), ::fidl_next::DecodeError> {
1009 ::fidl_next::munge!(let Self { table } = slot);
1010
1011 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1012 match ordinal {
1013 0 => unsafe { ::core::hint::unreachable_unchecked() },
1014
1015 1 => {
1016 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI32>(
1017 slot.as_mut(),
1018 decoder,
1019 )?;
1020
1021 Ok(())
1022 }
1023
1024 2 => {
1025 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI64>(
1026 slot.as_mut(),
1027 decoder,
1028 )?;
1029
1030 Ok(())
1031 }
1032
1033 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1034 }
1035 })
1036 }
1037}
1038
1039impl WireComponentStopInfo {
1040 pub fn termination_status(&self) -> Option<&::fidl_next::WireI32> {
1041 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1042 }
1043
1044 pub fn exit_code(&self) -> Option<&::fidl_next::WireI64> {
1045 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1046 }
1047}
1048
1049impl ::core::fmt::Debug for WireComponentStopInfo {
1050 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1051 f.debug_struct("ComponentStopInfo")
1052 .field("termination_status", &self.termination_status())
1053 .field("exit_code", &self.exit_code())
1054 .finish()
1055 }
1056}
1057
1058#[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"]
1060#[derive(Debug)]
1061pub struct ComponentController;
1062
1063pub mod component_controller {
1064 pub mod prelude {
1065 pub use crate::{
1066 component_controller, ComponentController, ComponentControllerClientHandler,
1067 ComponentControllerClientSender, ComponentControllerServerHandler,
1068 ComponentControllerServerSender,
1069 };
1070
1071 pub use crate::ComponentControllerOnEscrowRequest;
1072
1073 pub use crate::ComponentControllerOnPublishDiagnosticsRequest;
1074
1075 pub use crate::ComponentStopInfo;
1076 }
1077
1078 pub struct Stop;
1079
1080 impl ::fidl_next::Method for Stop {
1081 const ORDINAL: u64 = 4804506821232171874;
1082
1083 type Protocol = crate::ComponentController;
1084
1085 type Request = ();
1086
1087 type Response = ::fidl_next::Never;
1088 }
1089
1090 pub struct Kill;
1091
1092 impl ::fidl_next::Method for Kill {
1093 const ORDINAL: u64 = 4514346391631670964;
1094
1095 type Protocol = crate::ComponentController;
1096
1097 type Request = ();
1098
1099 type Response = ::fidl_next::Never;
1100 }
1101
1102 pub struct OnPublishDiagnostics;
1103
1104 impl ::fidl_next::Method for OnPublishDiagnostics {
1105 const ORDINAL: u64 = 2240216199992207687;
1106
1107 type Protocol = crate::ComponentController;
1108
1109 type Request = ::fidl_next::Never;
1110
1111 type Response = crate::WireComponentControllerOnPublishDiagnosticsRequest;
1112 }
1113
1114 pub struct OnEscrow;
1115
1116 impl ::fidl_next::Method for OnEscrow {
1117 const ORDINAL: u64 = 730448769712342012;
1118
1119 type Protocol = crate::ComponentController;
1120
1121 type Request = ::fidl_next::Never;
1122
1123 type Response = crate::WireComponentControllerOnEscrowRequest;
1124 }
1125
1126 pub struct OnStop;
1127
1128 impl ::fidl_next::Method for OnStop {
1129 const ORDINAL: u64 = 4322651556509354674;
1130
1131 type Protocol = crate::ComponentController;
1132
1133 type Request = ::fidl_next::Never;
1134
1135 type Response = crate::WireComponentStopInfo;
1136 }
1137}
1138
1139pub trait ComponentControllerClientSender {
1141 type Transport: ::fidl_next::Transport;
1142
1143 #[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"]
1144 fn stop(
1145 &self,
1146 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
1147
1148 #[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"]
1149 fn kill(
1150 &self,
1151 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
1152}
1153
1154impl<___T> ComponentControllerClientSender for ::fidl_next::ClientSender<___T, ComponentController>
1155where
1156 ___T: ::fidl_next::Transport,
1157{
1158 type Transport = ___T;
1159
1160 #[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"]
1161 fn stop(
1162 &self,
1163 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
1164 self.as_untyped().send_one_way(4804506821232171874, ())
1165 }
1166
1167 #[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"]
1168 fn kill(
1169 &self,
1170 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
1171 self.as_untyped().send_one_way(4514346391631670964, ())
1172 }
1173}
1174
1175pub trait ComponentControllerClientHandler<___T: ::fidl_next::Transport> {
1179 #[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"]
1180 fn on_publish_diagnostics(
1181 &mut self,
1182 sender: &::fidl_next::ClientSender<___T, ComponentController>,
1183
1184 event: ::fidl_next::Response<___T, component_controller::OnPublishDiagnostics>,
1185 );
1186
1187 #[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"]
1188 fn on_escrow(
1189 &mut self,
1190 sender: &::fidl_next::ClientSender<___T, ComponentController>,
1191
1192 event: ::fidl_next::Response<___T, component_controller::OnEscrow>,
1193 );
1194
1195 #[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"]
1196 fn on_stop(
1197 &mut self,
1198 sender: &::fidl_next::ClientSender<___T, ComponentController>,
1199
1200 event: ::fidl_next::Response<___T, component_controller::OnStop>,
1201 );
1202
1203 fn on_unknown_interaction(
1204 &mut self,
1205 sender: &::fidl_next::ClientSender<___T, ComponentController>,
1206 ordinal: u64,
1207 ) {
1208 sender.close();
1209 }
1210}
1211
1212impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for ComponentController
1213where
1214 ___T: ::fidl_next::Transport,
1215 ___H: ComponentControllerClientHandler<___T>,
1216
1217 <component_controller::OnPublishDiagnostics as ::fidl_next::Method>::Response:
1218 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1219
1220 <component_controller::OnEscrow as ::fidl_next::Method>::Response:
1221 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1222
1223 <component_controller::OnStop as ::fidl_next::Method>::Response:
1224 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1225{
1226 fn on_event(
1227 handler: &mut ___H,
1228 sender: &::fidl_next::ClientSender<___T, Self>,
1229 ordinal: u64,
1230 buffer: ___T::RecvBuffer,
1231 ) {
1232 match ordinal {
1233 2240216199992207687 => match ::fidl_next::DecoderExt::decode(buffer) {
1234 Ok(decoded) => handler.on_publish_diagnostics(sender, decoded),
1235 Err(e) => {
1236 sender.close();
1237 }
1238 },
1239
1240 730448769712342012 => match ::fidl_next::DecoderExt::decode(buffer) {
1241 Ok(decoded) => handler.on_escrow(sender, decoded),
1242 Err(e) => {
1243 sender.close();
1244 }
1245 },
1246
1247 4322651556509354674 => match ::fidl_next::DecoderExt::decode(buffer) {
1248 Ok(decoded) => handler.on_stop(sender, decoded),
1249 Err(e) => {
1250 sender.close();
1251 }
1252 },
1253
1254 ordinal => handler.on_unknown_interaction(sender, ordinal),
1255 }
1256 }
1257}
1258
1259pub trait ComponentControllerServerSender {
1261 type Transport: ::fidl_next::Transport;
1262
1263 #[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"]
1264
1265 fn on_publish_diagnostics<___R>(
1266 &self,
1267 request: ___R,
1268 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
1269 where
1270 ___R: ::fidl_next::Encode<
1271 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1272 Encoded = <component_controller::OnPublishDiagnostics as ::fidl_next::Method>::Response,
1273 >;
1274
1275 #[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"]
1276
1277 fn on_escrow<___R>(
1278 &self,
1279 request: ___R,
1280 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
1281 where
1282 ___R: ::fidl_next::Encode<
1283 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1284 Encoded = <component_controller::OnEscrow as ::fidl_next::Method>::Response,
1285 >;
1286
1287 #[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"]
1288
1289 fn on_stop<___R>(
1290 &self,
1291 request: ___R,
1292 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
1293 where
1294 ___R: ::fidl_next::Encode<
1295 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1296 Encoded = <component_controller::OnStop as ::fidl_next::Method>::Response,
1297 >;
1298}
1299
1300impl<___T> ComponentControllerServerSender for ::fidl_next::ServerSender<___T, ComponentController>
1301where
1302 ___T: ::fidl_next::Transport,
1303{
1304 type Transport = ___T;
1305
1306 #[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"]
1307
1308 fn on_publish_diagnostics<___R>(
1309 &self,
1310 request: ___R,
1311 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
1312 where
1313 ___R: ::fidl_next::Encode<
1314 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1315 Encoded = <component_controller::OnPublishDiagnostics as ::fidl_next::Method>::Response,
1316 >,
1317 {
1318 self.as_untyped().send_event(2240216199992207687, request)
1319 }
1320
1321 #[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"]
1322
1323 fn on_escrow<___R>(
1324 &self,
1325 request: ___R,
1326 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
1327 where
1328 ___R: ::fidl_next::Encode<
1329 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1330 Encoded = <component_controller::OnEscrow as ::fidl_next::Method>::Response,
1331 >,
1332 {
1333 self.as_untyped().send_event(730448769712342012, request)
1334 }
1335
1336 #[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"]
1337
1338 fn on_stop<___R>(
1339 &self,
1340 request: ___R,
1341 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
1342 where
1343 ___R: ::fidl_next::Encode<
1344 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1345 Encoded = <component_controller::OnStop as ::fidl_next::Method>::Response,
1346 >,
1347 {
1348 self.as_untyped().send_event(4322651556509354674, request)
1349 }
1350}
1351
1352pub trait ComponentControllerServerHandler<___T: ::fidl_next::Transport> {
1356 #[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"]
1357 fn stop(&mut self, sender: &::fidl_next::ServerSender<___T, ComponentController>);
1358
1359 #[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"]
1360 fn kill(&mut self, sender: &::fidl_next::ServerSender<___T, ComponentController>);
1361
1362 fn on_unknown_interaction(
1363 &mut self,
1364 sender: &::fidl_next::ServerSender<___T, ComponentController>,
1365 ordinal: u64,
1366 ) {
1367 sender.close();
1368 }
1369}
1370
1371impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for ComponentController
1372where
1373 ___T: ::fidl_next::Transport,
1374 ___H: ComponentControllerServerHandler<___T>,
1375{
1376 fn on_one_way(
1377 handler: &mut ___H,
1378 sender: &::fidl_next::ServerSender<___T, Self>,
1379 ordinal: u64,
1380 buffer: ___T::RecvBuffer,
1381 ) {
1382 match ordinal {
1383 4804506821232171874 => {
1384 handler.stop(sender);
1385 }
1386
1387 4514346391631670964 => {
1388 handler.kill(sender);
1389 }
1390
1391 ordinal => handler.on_unknown_interaction(sender, ordinal),
1392 }
1393 }
1394
1395 fn on_two_way(
1396 handler: &mut ___H,
1397 sender: &::fidl_next::ServerSender<___T, Self>,
1398 ordinal: u64,
1399 buffer: ___T::RecvBuffer,
1400 responder: ::fidl_next::protocol::Responder,
1401 ) {
1402 match ordinal {
1403 ordinal => handler.on_unknown_interaction(sender, ordinal),
1404 }
1405 }
1406}
1407
1408#[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"]
1409#[derive(Debug, Default)]
1410pub struct ComponentNamespaceEntry {
1411 pub path: Option<String>,
1412
1413 pub directory: Option<
1414 ::fidl_next::ClientEnd<
1415 ::fidl_next::fuchsia::zx::Channel,
1416 ::fidl_next_fuchsia_io::Directory,
1417 >,
1418 >,
1419}
1420
1421impl ComponentNamespaceEntry {
1422 fn __max_ordinal(&self) -> usize {
1423 if self.path.is_some() {
1424 return 1;
1425 }
1426
1427 if self.directory.is_some() {
1428 return 2;
1429 }
1430
1431 0
1432 }
1433}
1434
1435impl ::fidl_next::Encodable for ComponentNamespaceEntry {
1436 type Encoded = WireComponentNamespaceEntry;
1437}
1438
1439unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentNamespaceEntry
1440where
1441 ___E: ::fidl_next::Encoder + ?Sized,
1442
1443 ___E: ::fidl_next::fuchsia::HandleEncoder,
1444{
1445 #[inline]
1446 fn encode(
1447 mut self,
1448 encoder: &mut ___E,
1449 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1450 ) -> Result<(), ::fidl_next::EncodeError> {
1451 ::fidl_next::munge!(let WireComponentNamespaceEntry { table } = out);
1452
1453 let max_ord = self.__max_ordinal();
1454
1455 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1456 ::fidl_next::ZeroPadding::zero_padding(&mut out);
1457
1458 let mut preallocated =
1459 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1460
1461 for i in 1..=max_ord {
1462 match i {
1463 2 => {
1464 if let Some(directory) = self.directory.take() {
1465 ::fidl_next::WireEnvelope::encode_value(
1466 directory,
1467 preallocated.encoder,
1468 &mut out,
1469 )?;
1470 } else {
1471 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1472 }
1473 }
1474
1475 1 => {
1476 if let Some(path) = self.path.take() {
1477 ::fidl_next::WireEnvelope::encode_value(
1478 path,
1479 preallocated.encoder,
1480 &mut out,
1481 )?;
1482 } else {
1483 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1484 }
1485 }
1486
1487 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1488 }
1489 unsafe {
1490 preallocated.write_next(out.assume_init_ref());
1491 }
1492 }
1493
1494 ::fidl_next::WireTable::encode_len(table, max_ord);
1495
1496 Ok(())
1497 }
1498}
1499
1500impl ::fidl_next::TakeFrom<WireComponentNamespaceEntry> for ComponentNamespaceEntry {
1501 #[inline]
1502 fn take_from(from: &WireComponentNamespaceEntry) -> Self {
1503 Self {
1504 path: from.path().map(::fidl_next::TakeFrom::take_from),
1505
1506 directory: from.directory().map(::fidl_next::TakeFrom::take_from),
1507 }
1508 }
1509}
1510
1511#[repr(C)]
1513pub struct WireComponentNamespaceEntry {
1514 table: ::fidl_next::WireTable,
1515}
1516
1517unsafe impl ::fidl_next::ZeroPadding for WireComponentNamespaceEntry {
1518 #[inline]
1519 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1520 ::fidl_next::munge!(let Self { table } = out);
1521 ::fidl_next::WireTable::zero_padding(table);
1522 }
1523}
1524
1525unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentNamespaceEntry
1526where
1527 ___D: ::fidl_next::Decoder + ?Sized,
1528
1529 ___D: ::fidl_next::fuchsia::HandleDecoder,
1530{
1531 fn decode(
1532 slot: ::fidl_next::Slot<'_, Self>,
1533 decoder: &mut ___D,
1534 ) -> Result<(), ::fidl_next::DecodeError> {
1535 ::fidl_next::munge!(let Self { table } = slot);
1536
1537 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1538 match ordinal {
1539 0 => unsafe { ::core::hint::unreachable_unchecked() },
1540
1541 1 => {
1542 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
1543 slot.as_mut(),
1544 decoder,
1545 )?;
1546
1547 let path = unsafe {
1548 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
1549 };
1550
1551 if path.len() > 4095 {
1552 return Err(::fidl_next::DecodeError::VectorTooLong {
1553 size: path.len() as u64,
1554 limit: 4095,
1555 });
1556 }
1557
1558 Ok(())
1559 }
1560
1561 2 => {
1562 ::fidl_next::WireEnvelope::decode_as::<
1563 ___D,
1564 ::fidl_next::ClientEnd<
1565 ::fidl_next::fuchsia::WireChannel,
1566 ::fidl_next_fuchsia_io::Directory,
1567 >,
1568 >(slot.as_mut(), decoder)?;
1569
1570 Ok(())
1571 }
1572
1573 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1574 }
1575 })
1576 }
1577}
1578
1579impl WireComponentNamespaceEntry {
1580 pub fn path(&self) -> Option<&::fidl_next::WireString> {
1581 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1582 }
1583
1584 pub fn directory(
1585 &self,
1586 ) -> Option<
1587 &::fidl_next::ClientEnd<
1588 ::fidl_next::fuchsia::WireChannel,
1589 ::fidl_next_fuchsia_io::Directory,
1590 >,
1591 > {
1592 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1593 }
1594}
1595
1596impl ::core::fmt::Debug for WireComponentNamespaceEntry {
1597 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1598 f.debug_struct("ComponentNamespaceEntry")
1599 .field("path", &self.path())
1600 .field("directory", &self.directory())
1601 .finish()
1602 }
1603}
1604
1605pub const MAX_NAMESPACE_COUNT: u32 = 32;
1606
1607pub const MAX_HANDLE_COUNT: u32 = 128;
1608
1609#[doc = " Parameters for starting a new component instance.\n"]
1610#[derive(Debug, Default)]
1611pub struct ComponentStartInfo {
1612 pub resolved_url: Option<String>,
1613
1614 pub program: Option<::fidl_next_fuchsia_data::Dictionary>,
1615
1616 pub ns: Option<Vec<crate::ComponentNamespaceEntry>>,
1617
1618 pub outgoing_dir: Option<
1619 ::fidl_next::ServerEnd<
1620 ::fidl_next::fuchsia::zx::Channel,
1621 ::fidl_next_fuchsia_io::Directory,
1622 >,
1623 >,
1624
1625 pub runtime_dir: Option<
1626 ::fidl_next::ServerEnd<
1627 ::fidl_next::fuchsia::zx::Channel,
1628 ::fidl_next_fuchsia_io::Directory,
1629 >,
1630 >,
1631
1632 pub numbered_handles: Option<Vec<::fidl_next_fuchsia_process::HandleInfo>>,
1633
1634 pub encoded_config: Option<::fidl_next_fuchsia_mem::Data>,
1635
1636 pub break_on_start: Option<::fidl_next::fuchsia::zx::Handle>,
1637
1638 pub component_instance: Option<::fidl_next::fuchsia::zx::Handle>,
1639
1640 pub escrowed_dictionary: Option<::fidl_next_fuchsia_component_sandbox::DictionaryRef>,
1641}
1642
1643impl ComponentStartInfo {
1644 fn __max_ordinal(&self) -> usize {
1645 if self.resolved_url.is_some() {
1646 return 1;
1647 }
1648
1649 if self.program.is_some() {
1650 return 2;
1651 }
1652
1653 if self.ns.is_some() {
1654 return 3;
1655 }
1656
1657 if self.outgoing_dir.is_some() {
1658 return 4;
1659 }
1660
1661 if self.runtime_dir.is_some() {
1662 return 5;
1663 }
1664
1665 if self.numbered_handles.is_some() {
1666 return 6;
1667 }
1668
1669 if self.encoded_config.is_some() {
1670 return 7;
1671 }
1672
1673 if self.break_on_start.is_some() {
1674 return 8;
1675 }
1676
1677 if self.component_instance.is_some() {
1678 return 9;
1679 }
1680
1681 if self.escrowed_dictionary.is_some() {
1682 return 10;
1683 }
1684
1685 0
1686 }
1687}
1688
1689impl ::fidl_next::Encodable for ComponentStartInfo {
1690 type Encoded = WireComponentStartInfo;
1691}
1692
1693unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentStartInfo
1694where
1695 ___E: ::fidl_next::Encoder + ?Sized,
1696
1697 ___E: ::fidl_next::fuchsia::HandleEncoder,
1698{
1699 #[inline]
1700 fn encode(
1701 mut self,
1702 encoder: &mut ___E,
1703 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1704 ) -> Result<(), ::fidl_next::EncodeError> {
1705 ::fidl_next::munge!(let WireComponentStartInfo { table } = out);
1706
1707 let max_ord = self.__max_ordinal();
1708
1709 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1710 ::fidl_next::ZeroPadding::zero_padding(&mut out);
1711
1712 let mut preallocated =
1713 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1714
1715 for i in 1..=max_ord {
1716 match i {
1717 10 => {
1718 if let Some(escrowed_dictionary) = self.escrowed_dictionary.take() {
1719 ::fidl_next::WireEnvelope::encode_value(
1720 escrowed_dictionary,
1721 preallocated.encoder,
1722 &mut out,
1723 )?;
1724 } else {
1725 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1726 }
1727 }
1728
1729 9 => {
1730 if let Some(component_instance) = self.component_instance.take() {
1731 ::fidl_next::WireEnvelope::encode_value(
1732 component_instance,
1733 preallocated.encoder,
1734 &mut out,
1735 )?;
1736 } else {
1737 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1738 }
1739 }
1740
1741 8 => {
1742 if let Some(break_on_start) = self.break_on_start.take() {
1743 ::fidl_next::WireEnvelope::encode_value(
1744 break_on_start,
1745 preallocated.encoder,
1746 &mut out,
1747 )?;
1748 } else {
1749 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1750 }
1751 }
1752
1753 7 => {
1754 if let Some(encoded_config) = self.encoded_config.take() {
1755 ::fidl_next::WireEnvelope::encode_value(
1756 encoded_config,
1757 preallocated.encoder,
1758 &mut out,
1759 )?;
1760 } else {
1761 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1762 }
1763 }
1764
1765 6 => {
1766 if let Some(numbered_handles) = self.numbered_handles.take() {
1767 ::fidl_next::WireEnvelope::encode_value(
1768 numbered_handles,
1769 preallocated.encoder,
1770 &mut out,
1771 )?;
1772 } else {
1773 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1774 }
1775 }
1776
1777 5 => {
1778 if let Some(runtime_dir) = self.runtime_dir.take() {
1779 ::fidl_next::WireEnvelope::encode_value(
1780 runtime_dir,
1781 preallocated.encoder,
1782 &mut out,
1783 )?;
1784 } else {
1785 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1786 }
1787 }
1788
1789 4 => {
1790 if let Some(outgoing_dir) = self.outgoing_dir.take() {
1791 ::fidl_next::WireEnvelope::encode_value(
1792 outgoing_dir,
1793 preallocated.encoder,
1794 &mut out,
1795 )?;
1796 } else {
1797 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1798 }
1799 }
1800
1801 3 => {
1802 if let Some(ns) = self.ns.take() {
1803 ::fidl_next::WireEnvelope::encode_value(
1804 ns,
1805 preallocated.encoder,
1806 &mut out,
1807 )?;
1808 } else {
1809 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1810 }
1811 }
1812
1813 2 => {
1814 if let Some(program) = self.program.take() {
1815 ::fidl_next::WireEnvelope::encode_value(
1816 program,
1817 preallocated.encoder,
1818 &mut out,
1819 )?;
1820 } else {
1821 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1822 }
1823 }
1824
1825 1 => {
1826 if let Some(resolved_url) = self.resolved_url.take() {
1827 ::fidl_next::WireEnvelope::encode_value(
1828 resolved_url,
1829 preallocated.encoder,
1830 &mut out,
1831 )?;
1832 } else {
1833 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1834 }
1835 }
1836
1837 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1838 }
1839 unsafe {
1840 preallocated.write_next(out.assume_init_ref());
1841 }
1842 }
1843
1844 ::fidl_next::WireTable::encode_len(table, max_ord);
1845
1846 Ok(())
1847 }
1848}
1849
1850impl ::fidl_next::TakeFrom<WireComponentStartInfo> for ComponentStartInfo {
1851 #[inline]
1852 fn take_from(from: &WireComponentStartInfo) -> Self {
1853 Self {
1854 resolved_url: from.resolved_url().map(::fidl_next::TakeFrom::take_from),
1855
1856 program: from.program().map(::fidl_next::TakeFrom::take_from),
1857
1858 ns: from.ns().map(::fidl_next::TakeFrom::take_from),
1859
1860 outgoing_dir: from.outgoing_dir().map(::fidl_next::TakeFrom::take_from),
1861
1862 runtime_dir: from.runtime_dir().map(::fidl_next::TakeFrom::take_from),
1863
1864 numbered_handles: from.numbered_handles().map(::fidl_next::TakeFrom::take_from),
1865
1866 encoded_config: from.encoded_config().map(::fidl_next::TakeFrom::take_from),
1867
1868 break_on_start: from.break_on_start().map(::fidl_next::TakeFrom::take_from),
1869
1870 component_instance: from.component_instance().map(::fidl_next::TakeFrom::take_from),
1871
1872 escrowed_dictionary: from.escrowed_dictionary().map(::fidl_next::TakeFrom::take_from),
1873 }
1874 }
1875}
1876
1877#[repr(C)]
1879pub struct WireComponentStartInfo {
1880 table: ::fidl_next::WireTable,
1881}
1882
1883unsafe impl ::fidl_next::ZeroPadding for WireComponentStartInfo {
1884 #[inline]
1885 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1886 ::fidl_next::munge!(let Self { table } = out);
1887 ::fidl_next::WireTable::zero_padding(table);
1888 }
1889}
1890
1891unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentStartInfo
1892where
1893 ___D: ::fidl_next::Decoder + ?Sized,
1894
1895 ___D: ::fidl_next::fuchsia::HandleDecoder,
1896{
1897 fn decode(
1898 slot: ::fidl_next::Slot<'_, Self>,
1899 decoder: &mut ___D,
1900 ) -> Result<(), ::fidl_next::DecodeError> {
1901 ::fidl_next::munge!(let Self { table } = slot);
1902
1903 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1904 match ordinal {
1905 0 => unsafe { ::core::hint::unreachable_unchecked() },
1906
1907 1 => {
1908 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
1909 slot.as_mut(),
1910 decoder,
1911 )?;
1912
1913 let resolved_url = unsafe {
1914 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
1915 };
1916
1917 if resolved_url.len() > 4096 {
1918 return Err(::fidl_next::DecodeError::VectorTooLong {
1919 size: resolved_url.len() as u64,
1920 limit: 4096,
1921 });
1922 }
1923
1924 Ok(())
1925 }
1926
1927 2 => {
1928 ::fidl_next::WireEnvelope::decode_as::<
1929 ___D,
1930 ::fidl_next_fuchsia_data::WireDictionary,
1931 >(slot.as_mut(), decoder)?;
1932
1933 Ok(())
1934 }
1935
1936 3 => {
1937 ::fidl_next::WireEnvelope::decode_as::<
1938 ___D,
1939 ::fidl_next::WireVector<crate::WireComponentNamespaceEntry>,
1940 >(slot.as_mut(), decoder)?;
1941
1942 let ns = unsafe {
1943 slot
1944 .deref_unchecked()
1945 .deref_unchecked::<
1946 ::fidl_next::WireVector<crate::WireComponentNamespaceEntry>
1947 >()
1948 };
1949
1950 if ns.len() > 32 {
1951 return Err(::fidl_next::DecodeError::VectorTooLong {
1952 size: ns.len() as u64,
1953 limit: 32,
1954 });
1955 }
1956
1957 Ok(())
1958 }
1959
1960 4 => {
1961 ::fidl_next::WireEnvelope::decode_as::<
1962 ___D,
1963 ::fidl_next::ServerEnd<
1964 ::fidl_next::fuchsia::WireChannel,
1965 ::fidl_next_fuchsia_io::Directory,
1966 >,
1967 >(slot.as_mut(), decoder)?;
1968
1969 Ok(())
1970 }
1971
1972 5 => {
1973 ::fidl_next::WireEnvelope::decode_as::<
1974 ___D,
1975 ::fidl_next::ServerEnd<
1976 ::fidl_next::fuchsia::WireChannel,
1977 ::fidl_next_fuchsia_io::Directory,
1978 >,
1979 >(slot.as_mut(), decoder)?;
1980
1981 Ok(())
1982 }
1983
1984 6 => {
1985 ::fidl_next::WireEnvelope::decode_as::<
1986 ___D,
1987 ::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>,
1988 >(slot.as_mut(), decoder)?;
1989
1990 let numbered_handles = unsafe {
1991 slot
1992 .deref_unchecked()
1993 .deref_unchecked::<
1994 ::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>
1995 >()
1996 };
1997
1998 if numbered_handles.len() > 128 {
1999 return Err(::fidl_next::DecodeError::VectorTooLong {
2000 size: numbered_handles.len() as u64,
2001 limit: 128,
2002 });
2003 }
2004
2005 Ok(())
2006 }
2007
2008 7 => {
2009 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next_fuchsia_mem::WireData>(
2010 slot.as_mut(),
2011 decoder,
2012 )?;
2013
2014 Ok(())
2015 }
2016
2017 8 => {
2018 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
2019 slot.as_mut(),
2020 decoder,
2021 )?;
2022
2023 Ok(())
2024 }
2025
2026 9 => {
2027 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
2028 slot.as_mut(),
2029 decoder,
2030 )?;
2031
2032 Ok(())
2033 }
2034
2035 10 => {
2036 ::fidl_next::WireEnvelope::decode_as::<
2037 ___D,
2038 ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
2039 >(slot.as_mut(), decoder)?;
2040
2041 Ok(())
2042 }
2043
2044 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2045 }
2046 })
2047 }
2048}
2049
2050impl WireComponentStartInfo {
2051 pub fn resolved_url(&self) -> Option<&::fidl_next::WireString> {
2052 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2053 }
2054
2055 pub fn program(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary> {
2056 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2057 }
2058
2059 pub fn ns(&self) -> Option<&::fidl_next::WireVector<crate::WireComponentNamespaceEntry>> {
2060 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2061 }
2062
2063 pub fn outgoing_dir(
2064 &self,
2065 ) -> Option<
2066 &::fidl_next::ServerEnd<
2067 ::fidl_next::fuchsia::WireChannel,
2068 ::fidl_next_fuchsia_io::Directory,
2069 >,
2070 > {
2071 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2072 }
2073
2074 pub fn runtime_dir(
2075 &self,
2076 ) -> Option<
2077 &::fidl_next::ServerEnd<
2078 ::fidl_next::fuchsia::WireChannel,
2079 ::fidl_next_fuchsia_io::Directory,
2080 >,
2081 > {
2082 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
2083 }
2084
2085 pub fn numbered_handles(
2086 &self,
2087 ) -> Option<&::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>> {
2088 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
2089 }
2090
2091 pub fn encoded_config(&self) -> Option<&::fidl_next_fuchsia_mem::WireData> {
2092 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
2093 }
2094
2095 pub fn break_on_start(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
2096 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
2097 }
2098
2099 pub fn component_instance(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
2100 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
2101 }
2102
2103 pub fn escrowed_dictionary(
2104 &self,
2105 ) -> Option<&::fidl_next_fuchsia_component_sandbox::WireDictionaryRef> {
2106 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
2107 }
2108}
2109
2110impl ::core::fmt::Debug for WireComponentStartInfo {
2111 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2112 f.debug_struct("ComponentStartInfo")
2113 .field("resolved_url", &self.resolved_url())
2114 .field("program", &self.program())
2115 .field("ns", &self.ns())
2116 .field("outgoing_dir", &self.outgoing_dir())
2117 .field("runtime_dir", &self.runtime_dir())
2118 .field("numbered_handles", &self.numbered_handles())
2119 .field("encoded_config", &self.encoded_config())
2120 .field("break_on_start", &self.break_on_start())
2121 .field("component_instance", &self.component_instance())
2122 .field("escrowed_dictionary", &self.escrowed_dictionary())
2123 .finish()
2124 }
2125}
2126
2127#[derive(Debug)]
2128pub struct ComponentRunnerStartRequest {
2129 pub start_info: crate::ComponentStartInfo,
2130
2131 pub controller:
2132 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::ComponentController>,
2133}
2134
2135impl ::fidl_next::Encodable for ComponentRunnerStartRequest {
2136 type Encoded = WireComponentRunnerStartRequest;
2137}
2138
2139unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentRunnerStartRequest
2140where
2141 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2142
2143 ___E: ::fidl_next::Encoder,
2144
2145 ___E: ::fidl_next::fuchsia::HandleEncoder,
2146{
2147 #[inline]
2148 fn encode(
2149 self,
2150 encoder: &mut ___E,
2151 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2152 ) -> Result<(), ::fidl_next::EncodeError> {
2153 ::fidl_next::munge! {
2154 let Self::Encoded {
2155 start_info,
2156 controller,
2157
2158 } = out;
2159 }
2160
2161 ::fidl_next::Encode::encode(self.start_info, encoder, start_info)?;
2162
2163 ::fidl_next::Encode::encode(self.controller, encoder, controller)?;
2164
2165 Ok(())
2166 }
2167}
2168
2169impl ::fidl_next::EncodableOption for Box<ComponentRunnerStartRequest> {
2170 type EncodedOption = ::fidl_next::WireBox<WireComponentRunnerStartRequest>;
2171}
2172
2173unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ComponentRunnerStartRequest>
2174where
2175 ___E: ::fidl_next::Encoder + ?Sized,
2176 ComponentRunnerStartRequest: ::fidl_next::Encode<___E>,
2177{
2178 #[inline]
2179 fn encode_option(
2180 this: Option<Self>,
2181 encoder: &mut ___E,
2182 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2183 ) -> Result<(), ::fidl_next::EncodeError> {
2184 if let Some(inner) = this {
2185 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
2186 ::fidl_next::WireBox::encode_present(out);
2187 } else {
2188 ::fidl_next::WireBox::encode_absent(out);
2189 }
2190
2191 Ok(())
2192 }
2193}
2194
2195impl ::fidl_next::TakeFrom<WireComponentRunnerStartRequest> for ComponentRunnerStartRequest {
2196 #[inline]
2197 fn take_from(from: &WireComponentRunnerStartRequest) -> Self {
2198 Self {
2199 start_info: ::fidl_next::TakeFrom::take_from(&from.start_info),
2200
2201 controller: ::fidl_next::TakeFrom::take_from(&from.controller),
2202 }
2203 }
2204}
2205
2206#[derive(Debug)]
2208#[repr(C)]
2209pub struct WireComponentRunnerStartRequest {
2210 pub start_info: crate::WireComponentStartInfo,
2211
2212 pub controller:
2213 ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::ComponentController>,
2214}
2215
2216unsafe impl ::fidl_next::ZeroPadding for WireComponentRunnerStartRequest {
2217 #[inline]
2218 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2219 unsafe {
2220 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
2221 }
2222 }
2223}
2224
2225unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentRunnerStartRequest
2226where
2227 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2228
2229 ___D: ::fidl_next::Decoder,
2230
2231 ___D: ::fidl_next::fuchsia::HandleDecoder,
2232{
2233 fn decode(
2234 slot: ::fidl_next::Slot<'_, Self>,
2235 decoder: &mut ___D,
2236 ) -> Result<(), ::fidl_next::DecodeError> {
2237 ::fidl_next::munge! {
2238 let Self {
2239 mut start_info,
2240 mut controller,
2241
2242 } = slot;
2243 }
2244
2245 ::fidl_next::Decode::decode(start_info.as_mut(), decoder)?;
2246
2247 ::fidl_next::Decode::decode(controller.as_mut(), decoder)?;
2248
2249 Ok(())
2250 }
2251}
2252
2253#[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"]
2255#[derive(Debug)]
2256pub struct ComponentRunner;
2257
2258impl ::fidl_next::Discoverable for ComponentRunner {
2259 const PROTOCOL_NAME: &'static str = "component_runner";
2260}
2261
2262pub mod component_runner {
2263 pub mod prelude {
2264 pub use crate::{
2265 component_runner, ComponentRunner, ComponentRunnerClientHandler,
2266 ComponentRunnerClientSender, ComponentRunnerServerHandler, ComponentRunnerServerSender,
2267 };
2268
2269 pub use crate::ComponentRunnerStartRequest;
2270 }
2271
2272 pub struct Start;
2273
2274 impl ::fidl_next::Method for Start {
2275 const ORDINAL: u64 = 780715659970866697;
2276
2277 type Protocol = crate::ComponentRunner;
2278
2279 type Request = crate::WireComponentRunnerStartRequest;
2280
2281 type Response = ::fidl_next::Never;
2282 }
2283}
2284
2285pub trait ComponentRunnerClientSender {
2287 type Transport: ::fidl_next::Transport;
2288
2289 #[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"]
2290 fn start<___R>(
2291 &self,
2292 request: ___R,
2293 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
2294 where
2295 ___R: ::fidl_next::Encode<
2296 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
2297 Encoded = crate::WireComponentRunnerStartRequest,
2298 >;
2299}
2300
2301impl<___T> ComponentRunnerClientSender for ::fidl_next::ClientSender<___T, ComponentRunner>
2302where
2303 ___T: ::fidl_next::Transport,
2304{
2305 type Transport = ___T;
2306
2307 #[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"]
2308 fn start<___R>(
2309 &self,
2310 request: ___R,
2311 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
2312 where
2313 ___R: ::fidl_next::Encode<
2314 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
2315 Encoded = crate::WireComponentRunnerStartRequest,
2316 >,
2317 {
2318 self.as_untyped().send_one_way(780715659970866697, request)
2319 }
2320}
2321
2322pub trait ComponentRunnerClientHandler<___T: ::fidl_next::Transport> {
2326 fn on_unknown_interaction(
2327 &mut self,
2328 sender: &::fidl_next::ClientSender<___T, ComponentRunner>,
2329 ordinal: u64,
2330 ) {
2331 sender.close();
2332 }
2333}
2334
2335impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for ComponentRunner
2336where
2337 ___T: ::fidl_next::Transport,
2338 ___H: ComponentRunnerClientHandler<___T>,
2339{
2340 fn on_event(
2341 handler: &mut ___H,
2342 sender: &::fidl_next::ClientSender<___T, Self>,
2343 ordinal: u64,
2344 buffer: ___T::RecvBuffer,
2345 ) {
2346 match ordinal {
2347 ordinal => handler.on_unknown_interaction(sender, ordinal),
2348 }
2349 }
2350}
2351
2352pub trait ComponentRunnerServerSender {
2354 type Transport: ::fidl_next::Transport;
2355}
2356
2357impl<___T> ComponentRunnerServerSender for ::fidl_next::ServerSender<___T, ComponentRunner>
2358where
2359 ___T: ::fidl_next::Transport,
2360{
2361 type Transport = ___T;
2362}
2363
2364pub trait ComponentRunnerServerHandler<___T: ::fidl_next::Transport> {
2368 #[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"]
2369 fn start(
2370 &mut self,
2371 sender: &::fidl_next::ServerSender<___T, ComponentRunner>,
2372
2373 request: ::fidl_next::Request<___T, component_runner::Start>,
2374 );
2375
2376 fn on_unknown_interaction(
2377 &mut self,
2378 sender: &::fidl_next::ServerSender<___T, ComponentRunner>,
2379 ordinal: u64,
2380 ) {
2381 sender.close();
2382 }
2383}
2384
2385impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for ComponentRunner
2386where
2387 ___T: ::fidl_next::Transport,
2388 ___H: ComponentRunnerServerHandler<___T>,
2389
2390 crate::WireComponentRunnerStartRequest:
2391 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2392{
2393 fn on_one_way(
2394 handler: &mut ___H,
2395 sender: &::fidl_next::ServerSender<___T, Self>,
2396 ordinal: u64,
2397 buffer: ___T::RecvBuffer,
2398 ) {
2399 match ordinal {
2400 780715659970866697 => match ::fidl_next::DecoderExt::decode(buffer) {
2401 Ok(decoded) => handler.start(sender, decoded),
2402 Err(e) => {
2403 sender.close();
2404 }
2405 },
2406
2407 ordinal => handler.on_unknown_interaction(sender, ordinal),
2408 }
2409 }
2410
2411 fn on_two_way(
2412 handler: &mut ___H,
2413 sender: &::fidl_next::ServerSender<___T, Self>,
2414 ordinal: u64,
2415 buffer: ___T::RecvBuffer,
2416 responder: ::fidl_next::protocol::Responder,
2417 ) {
2418 match ordinal {
2419 ordinal => handler.on_unknown_interaction(sender, ordinal),
2420 }
2421 }
2422}
2423
2424#[derive(Debug)]
2425#[repr(C)]
2426pub struct TaskProviderGetJobResponse {
2427 pub job: ::fidl_next::fuchsia::zx::Handle,
2428}
2429
2430impl ::fidl_next::Encodable for TaskProviderGetJobResponse {
2431 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
2432 ::fidl_next::CopyOptimization::enable_if(
2433 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
2434 .is_enabled(),
2435 )
2436 };
2437
2438 type Encoded = WireTaskProviderGetJobResponse;
2439}
2440
2441unsafe impl<___E> ::fidl_next::Encode<___E> for TaskProviderGetJobResponse
2442where
2443 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2444
2445 ___E: ::fidl_next::fuchsia::HandleEncoder,
2446{
2447 #[inline]
2448 fn encode(
2449 self,
2450 encoder: &mut ___E,
2451 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2452 ) -> Result<(), ::fidl_next::EncodeError> {
2453 ::fidl_next::munge! {
2454 let Self::Encoded {
2455 job,
2456
2457 } = out;
2458 }
2459
2460 ::fidl_next::Encode::encode(self.job, encoder, job)?;
2461
2462 Ok(())
2463 }
2464}
2465
2466impl ::fidl_next::EncodableOption for Box<TaskProviderGetJobResponse> {
2467 type EncodedOption = ::fidl_next::WireBox<WireTaskProviderGetJobResponse>;
2468}
2469
2470unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<TaskProviderGetJobResponse>
2471where
2472 ___E: ::fidl_next::Encoder + ?Sized,
2473 TaskProviderGetJobResponse: ::fidl_next::Encode<___E>,
2474{
2475 #[inline]
2476 fn encode_option(
2477 this: Option<Self>,
2478 encoder: &mut ___E,
2479 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2480 ) -> Result<(), ::fidl_next::EncodeError> {
2481 if let Some(inner) = this {
2482 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
2483 ::fidl_next::WireBox::encode_present(out);
2484 } else {
2485 ::fidl_next::WireBox::encode_absent(out);
2486 }
2487
2488 Ok(())
2489 }
2490}
2491
2492impl ::fidl_next::TakeFrom<WireTaskProviderGetJobResponse> for TaskProviderGetJobResponse {
2493 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
2494 ::fidl_next::CopyOptimization::enable_if(
2495 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
2496 .is_enabled(),
2497 )
2498 };
2499
2500 #[inline]
2501 fn take_from(from: &WireTaskProviderGetJobResponse) -> Self {
2502 Self { job: ::fidl_next::TakeFrom::take_from(&from.job) }
2503 }
2504}
2505
2506#[derive(Debug)]
2508#[repr(C)]
2509pub struct WireTaskProviderGetJobResponse {
2510 pub job: ::fidl_next::fuchsia::WireHandle,
2511}
2512
2513unsafe impl ::fidl_next::ZeroPadding for WireTaskProviderGetJobResponse {
2514 #[inline]
2515 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2516}
2517
2518unsafe impl<___D> ::fidl_next::Decode<___D> for WireTaskProviderGetJobResponse
2519where
2520 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2521
2522 ___D: ::fidl_next::fuchsia::HandleDecoder,
2523{
2524 fn decode(
2525 slot: ::fidl_next::Slot<'_, Self>,
2526 decoder: &mut ___D,
2527 ) -> Result<(), ::fidl_next::DecodeError> {
2528 ::fidl_next::munge! {
2529 let Self {
2530 mut job,
2531
2532 } = slot;
2533 }
2534
2535 ::fidl_next::Decode::decode(job.as_mut(), decoder)?;
2536
2537 Ok(())
2538 }
2539}
2540
2541#[doc = " Served by runners that want to make a zircon job available through their runtime directory.\n"]
2543#[derive(Debug)]
2544pub struct TaskProvider;
2545
2546impl ::fidl_next::Discoverable for TaskProvider {
2547 const PROTOCOL_NAME: &'static str = "task_provider";
2548}
2549
2550pub mod task_provider {
2551 pub mod prelude {
2552 pub use crate::{
2553 task_provider, TaskProvider, TaskProviderClientHandler, TaskProviderClientSender,
2554 TaskProviderServerHandler, TaskProviderServerSender,
2555 };
2556
2557 pub use crate::TaskProviderGetJobResponse;
2558 }
2559
2560 pub struct GetJob;
2561
2562 impl ::fidl_next::Method for GetJob {
2563 const ORDINAL: u64 = 5520468615388521389;
2564
2565 type Protocol = crate::TaskProvider;
2566
2567 type Request = ();
2568
2569 type Response =
2570 ::fidl_next::WireResult<crate::WireTaskProviderGetJobResponse, ::fidl_next::WireI32>;
2571 }
2572}
2573
2574pub trait TaskProviderClientSender {
2576 type Transport: ::fidl_next::Transport;
2577
2578 #[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"]
2579 fn get_job(
2580 &self,
2581 ) -> Result<
2582 ::fidl_next::ResponseFuture<'_, Self::Transport, task_provider::GetJob>,
2583 ::fidl_next::EncodeError,
2584 >;
2585}
2586
2587impl<___T> TaskProviderClientSender for ::fidl_next::ClientSender<___T, TaskProvider>
2588where
2589 ___T: ::fidl_next::Transport,
2590{
2591 type Transport = ___T;
2592
2593 #[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"]
2594 fn get_job(
2595 &self,
2596 ) -> Result<
2597 ::fidl_next::ResponseFuture<'_, Self::Transport, task_provider::GetJob>,
2598 ::fidl_next::EncodeError,
2599 > {
2600 self.as_untyped()
2601 .send_two_way(5520468615388521389, ())
2602 .map(::fidl_next::ResponseFuture::from_untyped)
2603 }
2604}
2605
2606pub trait TaskProviderClientHandler<___T: ::fidl_next::Transport> {
2610 fn on_unknown_interaction(
2611 &mut self,
2612 sender: &::fidl_next::ClientSender<___T, TaskProvider>,
2613 ordinal: u64,
2614 ) {
2615 sender.close();
2616 }
2617}
2618
2619impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for TaskProvider
2620where
2621 ___T: ::fidl_next::Transport,
2622 ___H: TaskProviderClientHandler<___T>,
2623
2624 <task_provider::GetJob as ::fidl_next::Method>::Response:
2625 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2626{
2627 fn on_event(
2628 handler: &mut ___H,
2629 sender: &::fidl_next::ClientSender<___T, Self>,
2630 ordinal: u64,
2631 buffer: ___T::RecvBuffer,
2632 ) {
2633 match ordinal {
2634 ordinal => handler.on_unknown_interaction(sender, ordinal),
2635 }
2636 }
2637}
2638
2639pub trait TaskProviderServerSender {
2641 type Transport: ::fidl_next::Transport;
2642}
2643
2644impl<___T> TaskProviderServerSender for ::fidl_next::ServerSender<___T, TaskProvider>
2645where
2646 ___T: ::fidl_next::Transport,
2647{
2648 type Transport = ___T;
2649}
2650
2651pub trait TaskProviderServerHandler<___T: ::fidl_next::Transport> {
2655 #[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"]
2656 fn get_job(
2657 &mut self,
2658 sender: &::fidl_next::ServerSender<___T, TaskProvider>,
2659
2660 responder: ::fidl_next::Responder<task_provider::GetJob>,
2661 );
2662
2663 fn on_unknown_interaction(
2664 &mut self,
2665 sender: &::fidl_next::ServerSender<___T, TaskProvider>,
2666 ordinal: u64,
2667 ) {
2668 sender.close();
2669 }
2670}
2671
2672impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for TaskProvider
2673where
2674 ___T: ::fidl_next::Transport,
2675 ___H: TaskProviderServerHandler<___T>,
2676{
2677 fn on_one_way(
2678 handler: &mut ___H,
2679 sender: &::fidl_next::ServerSender<___T, Self>,
2680 ordinal: u64,
2681 buffer: ___T::RecvBuffer,
2682 ) {
2683 match ordinal {
2684 ordinal => handler.on_unknown_interaction(sender, ordinal),
2685 }
2686 }
2687
2688 fn on_two_way(
2689 handler: &mut ___H,
2690 sender: &::fidl_next::ServerSender<___T, Self>,
2691 ordinal: u64,
2692 buffer: ___T::RecvBuffer,
2693 responder: ::fidl_next::protocol::Responder,
2694 ) {
2695 match ordinal {
2696 5520468615388521389 => {
2697 let responder = ::fidl_next::Responder::from_untyped(responder);
2698
2699 handler.get_job(sender, responder);
2700 }
2701
2702 ordinal => handler.on_unknown_interaction(sender, ordinal),
2703 }
2704 }
2705}
2706
2707pub mod compat {
2709
2710 impl ::fidl_next::TakeFrom<crate::WireTask> for ::fidl_fuchsia_component_runner::Task {
2711 #[inline]
2712 fn take_from(from: &crate::WireTask) -> Self {
2713 match from.as_ref() {
2714 crate::task::Ref::Job(value) => Self::Job(::fidl_next::TakeFrom::take_from(value)),
2715
2716 crate::task::Ref::Process(value) => {
2717 Self::Process(::fidl_next::TakeFrom::take_from(value))
2718 }
2719
2720 crate::task::Ref::Thread(value) => {
2721 Self::Thread(::fidl_next::TakeFrom::take_from(value))
2722 }
2723
2724 crate::task::Ref::UnknownOrdinal_(unknown_ordinal) => {
2725 Self::__SourceBreaking { unknown_ordinal }
2726 }
2727 }
2728 }
2729 }
2730
2731 impl ::fidl_next::TakeFrom<crate::WireOptionalTask>
2732 for Option<Box<::fidl_fuchsia_component_runner::Task>>
2733 {
2734 #[inline]
2735 fn take_from(from: &crate::WireOptionalTask) -> Self {
2736 if let Some(inner) = from.as_ref() {
2737 Some(::fidl_next::TakeFrom::take_from(inner))
2738 } else {
2739 None
2740 }
2741 }
2742 }
2743
2744 impl ::fidl_next::TakeFrom<crate::WireComponentTasks>
2745 for ::fidl_fuchsia_component_runner::ComponentTasks
2746 {
2747 #[inline]
2748 fn take_from(from: &crate::WireComponentTasks) -> Self {
2749 Self {
2750 component_task: from.component_task().map(::fidl_next::TakeFrom::take_from),
2751
2752 parent_task: from.parent_task().map(::fidl_next::TakeFrom::take_from),
2753
2754 __source_breaking: ::fidl::marker::SourceBreaking,
2755 }
2756 }
2757 }
2758
2759 impl ::fidl_next::TakeFrom<crate::WireComponentDiagnostics>
2760 for ::fidl_fuchsia_component_runner::ComponentDiagnostics
2761 {
2762 #[inline]
2763 fn take_from(from: &crate::WireComponentDiagnostics) -> Self {
2764 Self {
2765 tasks: from.tasks().map(::fidl_next::TakeFrom::take_from),
2766
2767 __source_breaking: ::fidl::marker::SourceBreaking,
2768 }
2769 }
2770 }
2771
2772 impl ::fidl_next::TakeFrom<crate::WireComponentControllerOnPublishDiagnosticsRequest>
2773 for ::fidl_fuchsia_component_runner::ComponentControllerOnPublishDiagnosticsRequest
2774 {
2775 #[inline]
2776 fn take_from(from: &crate::WireComponentControllerOnPublishDiagnosticsRequest) -> Self {
2777 Self { payload: ::fidl_next::TakeFrom::take_from(&from.payload) }
2778 }
2779 }
2780
2781 impl ::fidl_next::TakeFrom<crate::WireComponentControllerOnEscrowRequest>
2782 for ::fidl_fuchsia_component_runner::ComponentControllerOnEscrowRequest
2783 {
2784 #[inline]
2785 fn take_from(from: &crate::WireComponentControllerOnEscrowRequest) -> Self {
2786 Self {
2787 outgoing_dir: from.outgoing_dir().map(::fidl_next::TakeFrom::take_from),
2788
2789 escrowed_dictionary: from
2790 .escrowed_dictionary()
2791 .map(::fidl_next::TakeFrom::take_from),
2792
2793 __source_breaking: ::fidl::marker::SourceBreaking,
2794 }
2795 }
2796 }
2797
2798 impl ::fidl_next::TakeFrom<crate::WireComponentStopInfo>
2799 for ::fidl_fuchsia_component_runner::ComponentStopInfo
2800 {
2801 #[inline]
2802 fn take_from(from: &crate::WireComponentStopInfo) -> Self {
2803 Self {
2804 termination_status: from.termination_status().map(::fidl_next::TakeFrom::take_from),
2805
2806 exit_code: from.exit_code().map(::fidl_next::TakeFrom::take_from),
2807
2808 __source_breaking: ::fidl::marker::SourceBreaking,
2809 }
2810 }
2811 }
2812
2813 #[cfg(target_os = "fuchsia")]
2814 pub type ComponentControllerProxy =
2817 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::ComponentController>;
2818
2819 impl ::fidl_next::TakeFrom<crate::ComponentController>
2820 for ::fidl_fuchsia_component_runner::ComponentControllerMarker
2821 {
2822 #[inline]
2823 fn take_from(from: &crate::ComponentController) -> Self {
2824 Self
2825 }
2826 }
2827
2828 impl ::fidl_next::TakeFrom<crate::WireComponentNamespaceEntry>
2829 for ::fidl_fuchsia_component_runner::ComponentNamespaceEntry
2830 {
2831 #[inline]
2832 fn take_from(from: &crate::WireComponentNamespaceEntry) -> Self {
2833 Self {
2834 path: from.path().map(::fidl_next::TakeFrom::take_from),
2835
2836 directory: from.directory().map(::fidl_next::TakeFrom::take_from),
2837
2838 __source_breaking: ::fidl::marker::SourceBreaking,
2839 }
2840 }
2841 }
2842
2843 impl ::fidl_next::TakeFrom<crate::WireComponentStartInfo>
2844 for ::fidl_fuchsia_component_runner::ComponentStartInfo
2845 {
2846 #[inline]
2847 fn take_from(from: &crate::WireComponentStartInfo) -> Self {
2848 Self {
2849 resolved_url: from.resolved_url().map(::fidl_next::TakeFrom::take_from),
2850
2851 program: from.program().map(::fidl_next::TakeFrom::take_from),
2852
2853 ns: from.ns().map(::fidl_next::TakeFrom::take_from),
2854
2855 outgoing_dir: from.outgoing_dir().map(::fidl_next::TakeFrom::take_from),
2856
2857 runtime_dir: from.runtime_dir().map(::fidl_next::TakeFrom::take_from),
2858
2859 numbered_handles: from.numbered_handles().map(::fidl_next::TakeFrom::take_from),
2860
2861 encoded_config: from.encoded_config().map(::fidl_next::TakeFrom::take_from),
2862
2863 break_on_start: from.break_on_start().map(::fidl_next::TakeFrom::take_from),
2864
2865 component_instance: from.component_instance().map(::fidl_next::TakeFrom::take_from),
2866
2867 escrowed_dictionary: from
2868 .escrowed_dictionary()
2869 .map(::fidl_next::TakeFrom::take_from),
2870
2871 __source_breaking: ::fidl::marker::SourceBreaking,
2872 }
2873 }
2874 }
2875
2876 impl ::fidl_next::TakeFrom<crate::WireComponentRunnerStartRequest>
2877 for ::fidl_fuchsia_component_runner::ComponentRunnerStartRequest
2878 {
2879 #[inline]
2880 fn take_from(from: &crate::WireComponentRunnerStartRequest) -> Self {
2881 Self {
2882 start_info: ::fidl_next::TakeFrom::take_from(&from.start_info),
2883
2884 controller: ::fidl_next::TakeFrom::take_from(&from.controller),
2885 }
2886 }
2887 }
2888
2889 #[cfg(target_os = "fuchsia")]
2890 pub type ComponentRunnerProxy =
2893 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::ComponentRunner>;
2894
2895 impl ::fidl_next::TakeFrom<crate::ComponentRunner>
2896 for ::fidl_fuchsia_component_runner::ComponentRunnerMarker
2897 {
2898 #[inline]
2899 fn take_from(from: &crate::ComponentRunner) -> Self {
2900 Self
2901 }
2902 }
2903
2904 impl ::fidl_next::TakeFrom<crate::WireTaskProviderGetJobResponse>
2905 for ::fidl_fuchsia_component_runner::TaskProviderGetJobResponse
2906 {
2907 #[inline]
2908 fn take_from(from: &crate::WireTaskProviderGetJobResponse) -> Self {
2909 Self { job: ::fidl_next::TakeFrom::take_from(&from.job) }
2910 }
2911 }
2912
2913 #[cfg(target_os = "fuchsia")]
2914 pub type TaskProviderProxy =
2917 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::TaskProvider>;
2918
2919 impl ::fidl_next::TakeFrom<crate::TaskProvider>
2920 for ::fidl_fuchsia_component_runner::TaskProviderMarker
2921 {
2922 #[inline]
2923 fn take_from(from: &crate::TaskProvider) -> Self {
2924 Self
2925 }
2926 }
2927}