1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[doc = " A framework-provided protocol that allows components that use it to bind to\n the component that exposes it. The act of connecting to this protocol will\n trigger the bind. Thus, this protocol contains no methods. For more details\n on binding, see\n https://fuchsia.dev/fuchsia-src/concepts/components/v2/lifecycle#binding.\n\n When a component connects to protocol, the component exposing this capability\n will be started if it\'s not already running. Upon a failure to start, the\n component framework will close the server end of the channel with a\n zx.Status epitaph.\n"]
7#[derive(Debug)]
8pub struct Binder;
9
10impl ::fidl_next::Discoverable for Binder {
11 const PROTOCOL_NAME: &'static str = "binder";
12}
13
14pub mod binder {
15 pub mod prelude {
16 pub use crate::{
17 binder, Binder, BinderClientHandler, BinderClientSender, BinderServerHandler,
18 BinderServerSender,
19 };
20 }
21}
22
23pub trait BinderClientSender {
25 type Transport: ::fidl_next::Transport;
26}
27
28impl<___T> BinderClientSender for ::fidl_next::ClientSender<___T, Binder>
29where
30 ___T: ::fidl_next::Transport,
31{
32 type Transport = ___T;
33}
34
35pub trait BinderClientHandler<___T: ::fidl_next::Transport> {}
39
40impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Binder
41where
42 ___T: ::fidl_next::Transport,
43 ___H: BinderClientHandler<___T>,
44{
45 fn on_event(
46 handler: &mut ___H,
47 sender: &::fidl_next::ClientSender<___T, Self>,
48 ordinal: u64,
49 buffer: ___T::RecvBuffer,
50 ) {
51 match ordinal {
52 ordinal => {
53 sender.close();
54 }
55 }
56 }
57}
58
59pub trait BinderServerSender {
61 type Transport: ::fidl_next::Transport;
62}
63
64impl<___T> BinderServerSender for ::fidl_next::ServerSender<___T, Binder>
65where
66 ___T: ::fidl_next::Transport,
67{
68 type Transport = ___T;
69}
70
71pub trait BinderServerHandler<___T: ::fidl_next::Transport> {}
75
76impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Binder
77where
78 ___T: ::fidl_next::Transport,
79 ___H: BinderServerHandler<___T>,
80{
81 fn on_one_way(
82 handler: &mut ___H,
83 sender: &::fidl_next::ServerSender<___T, Self>,
84 ordinal: u64,
85 buffer: ___T::RecvBuffer,
86 ) {
87 match ordinal {
88 ordinal => {
89 sender.close();
90 }
91 }
92 }
93
94 fn on_two_way(
95 handler: &mut ___H,
96 sender: &::fidl_next::ServerSender<___T, Self>,
97 ordinal: u64,
98 buffer: ___T::RecvBuffer,
99 responder: ::fidl_next::protocol::Responder,
100 ) {
101 match ordinal {
102 ordinal => {
103 sender.close();
104 }
105 }
106 }
107}
108
109pub const MAX_NAME_LENGTH: u64 = 255;
110
111pub type Name = String;
112
113pub type WireName = ::fidl_next::WireString;
115
116#[doc = " Payload for CapabilityRequested events\n"]
117#[derive(Debug)]
118pub struct CapabilityRequestedPayload {
119 pub name: Option<String>,
120
121 pub capability: Option<::fidl_next::fuchsia::zx::Handle>,
122}
123
124impl CapabilityRequestedPayload {
125 fn __max_ordinal(&self) -> usize {
126 if self.name.is_some() {
127 return 1;
128 }
129
130 if self.capability.is_some() {
131 return 2;
132 }
133
134 0
135 }
136}
137
138impl ::fidl_next::Encodable for CapabilityRequestedPayload {
139 type Encoded = WireCapabilityRequestedPayload;
140}
141
142unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityRequestedPayload
143where
144 ___E: ::fidl_next::Encoder + ?Sized,
145
146 ___E: ::fidl_next::fuchsia::HandleEncoder,
147{
148 #[inline]
149 fn encode(
150 &mut self,
151 encoder: &mut ___E,
152 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
153 ) -> Result<(), ::fidl_next::EncodeError> {
154 ::fidl_next::munge!(let WireCapabilityRequestedPayload { table } = out);
155
156 let max_ord = self.__max_ordinal();
157
158 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
159 ::fidl_next::ZeroPadding::zero_padding(&mut out);
160
161 let mut preallocated =
162 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
163
164 for i in 1..=max_ord {
165 match i {
166 2 => {
167 if let Some(capability) = &mut self.capability {
168 ::fidl_next::WireEnvelope::encode_value(
169 capability,
170 preallocated.encoder,
171 &mut out,
172 )?;
173 } else {
174 ::fidl_next::WireEnvelope::encode_zero(&mut out)
175 }
176 }
177
178 1 => {
179 if let Some(name) = &mut self.name {
180 ::fidl_next::WireEnvelope::encode_value(
181 name,
182 preallocated.encoder,
183 &mut out,
184 )?;
185 } else {
186 ::fidl_next::WireEnvelope::encode_zero(&mut out)
187 }
188 }
189
190 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
191 }
192 unsafe {
193 preallocated.write_next(out.assume_init_ref());
194 }
195 }
196
197 ::fidl_next::WireTable::encode_len(table, max_ord);
198
199 Ok(())
200 }
201}
202
203impl ::fidl_next::TakeFrom<WireCapabilityRequestedPayload> for CapabilityRequestedPayload {
204 #[inline]
205 fn take_from(from: &WireCapabilityRequestedPayload) -> Self {
206 Self {
207 name: from.name().map(::fidl_next::TakeFrom::take_from),
208
209 capability: from.capability().map(::fidl_next::TakeFrom::take_from),
210 }
211 }
212}
213
214#[repr(C)]
216pub struct WireCapabilityRequestedPayload {
217 table: ::fidl_next::WireTable,
218}
219
220unsafe impl ::fidl_next::ZeroPadding for WireCapabilityRequestedPayload {
221 #[inline]
222 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
223 ::fidl_next::munge!(let Self { table } = out);
224 ::fidl_next::WireTable::zero_padding(table);
225 }
226}
227
228unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityRequestedPayload
229where
230 ___D: ::fidl_next::Decoder + ?Sized,
231
232 ___D: ::fidl_next::fuchsia::HandleDecoder,
233{
234 fn decode(
235 slot: ::fidl_next::Slot<'_, Self>,
236 decoder: &mut ___D,
237 ) -> Result<(), ::fidl_next::DecodeError> {
238 ::fidl_next::munge!(let Self { table } = slot);
239
240 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
241 match ordinal {
242 0 => unsafe { ::core::hint::unreachable_unchecked() },
243
244 1 => {
245 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
246 slot.as_mut(),
247 decoder,
248 )?;
249
250 let name = unsafe {
251 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
252 };
253
254 if name.len() > 255 {
255 return Err(::fidl_next::DecodeError::VectorTooLong {
256 size: name.len() as u64,
257 limit: 255,
258 });
259 }
260
261 Ok(())
262 }
263
264 2 => {
265 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
266 slot.as_mut(),
267 decoder,
268 )?;
269
270 Ok(())
271 }
272
273 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
274 }
275 })
276 }
277}
278
279impl WireCapabilityRequestedPayload {
280 pub fn name(&self) -> Option<&::fidl_next::WireString> {
281 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
282 }
283
284 pub fn capability(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
285 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
286 }
287}
288
289impl ::core::fmt::Debug for WireCapabilityRequestedPayload {
290 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
291 f.debug_struct("CapabilityRequestedPayload")
292 .field("name", &self.name())
293 .field("capability", &self.capability())
294 .finish()
295 }
296}
297
298#[doc = " The maximum number of children that the a call `ChildIterator.Next`\n can return.\n Note, this is not a limit on the number of children that can be added\n to a component. This is merely a limit for a single invocation of the\n `Next` method.\n"]
299pub const MAX_CHILD_COUNT: u32 = 128;
300
301#[derive(Clone, Debug)]
302pub struct ChildIteratorNextResponse {
303 pub children: Vec<::fidl_next_fuchsia_component_decl::ChildRef>,
304}
305
306impl ::fidl_next::Encodable for ChildIteratorNextResponse {
307 type Encoded = WireChildIteratorNextResponse;
308}
309
310unsafe impl<___E> ::fidl_next::Encode<___E> for ChildIteratorNextResponse
311where
312 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
313
314 ___E: ::fidl_next::Encoder,
315{
316 #[inline]
317 fn encode(
318 &mut self,
319 encoder: &mut ___E,
320 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
321 ) -> Result<(), ::fidl_next::EncodeError> {
322 ::fidl_next::munge! {
323 let Self::Encoded {
324 children,
325
326 } = out;
327 }
328
329 ::fidl_next::Encode::encode(&mut self.children, encoder, children)?;
330
331 Ok(())
332 }
333}
334
335impl ::fidl_next::EncodableOption for Box<ChildIteratorNextResponse> {
336 type EncodedOption = ::fidl_next::WireBox<WireChildIteratorNextResponse>;
337}
338
339unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ChildIteratorNextResponse>
340where
341 ___E: ::fidl_next::Encoder + ?Sized,
342 ChildIteratorNextResponse: ::fidl_next::Encode<___E>,
343{
344 #[inline]
345 fn encode_option(
346 this: Option<&mut Self>,
347 encoder: &mut ___E,
348 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
349 ) -> Result<(), ::fidl_next::EncodeError> {
350 if let Some(inner) = this {
351 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
352 ::fidl_next::WireBox::encode_present(out);
353 } else {
354 ::fidl_next::WireBox::encode_absent(out);
355 }
356
357 Ok(())
358 }
359}
360
361impl ::fidl_next::TakeFrom<WireChildIteratorNextResponse> for ChildIteratorNextResponse {
362 #[inline]
363 fn take_from(from: &WireChildIteratorNextResponse) -> Self {
364 Self { children: ::fidl_next::TakeFrom::take_from(&from.children) }
365 }
366}
367
368#[derive(Debug)]
370#[repr(C)]
371pub struct WireChildIteratorNextResponse {
372 pub children: ::fidl_next::WireVector<::fidl_next_fuchsia_component_decl::WireChildRef>,
373}
374
375unsafe impl ::fidl_next::ZeroPadding for WireChildIteratorNextResponse {
376 #[inline]
377 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
378}
379
380unsafe impl<___D> ::fidl_next::Decode<___D> for WireChildIteratorNextResponse
381where
382 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
383
384 ___D: ::fidl_next::Decoder,
385{
386 fn decode(
387 slot: ::fidl_next::Slot<'_, Self>,
388 decoder: &mut ___D,
389 ) -> Result<(), ::fidl_next::DecodeError> {
390 ::fidl_next::munge! {
391 let Self {
392 mut children,
393
394 } = slot;
395 }
396
397 ::fidl_next::Decode::decode(children.as_mut(), decoder)?;
398
399 let children = unsafe { children.deref_unchecked() };
400
401 if children.len() > 128 {
402 return Err(::fidl_next::DecodeError::VectorTooLong {
403 size: children.len() as u64,
404 limit: 128,
405 });
406 }
407
408 Ok(())
409 }
410}
411
412#[doc = " A protocol to iterate over the list of children in a realm.\n"]
414#[derive(Debug)]
415pub struct ChildIterator;
416
417pub mod child_iterator {
418 pub mod prelude {
419 pub use crate::{
420 child_iterator, ChildIterator, ChildIteratorClientHandler, ChildIteratorClientSender,
421 ChildIteratorServerHandler, ChildIteratorServerSender,
422 };
423
424 pub use crate::ChildIteratorNextResponse;
425 }
426
427 pub struct Next;
428
429 impl ::fidl_next::Method for Next {
430 const ORDINAL: u64 = 4676077302722137352;
431
432 type Protocol = crate::ChildIterator;
433
434 type Request = ();
435
436 type Response = crate::WireChildIteratorNextResponse;
437 }
438}
439
440pub trait ChildIteratorClientSender {
442 type Transport: ::fidl_next::Transport;
443
444 #[doc = " Advance the iterator and return the next batch of children.\n\n Returns a vector of `ChildRef`. Returns an empty vector when there are\n no more children.\n"]
445 fn next(
446 &self,
447 ) -> Result<
448 ::fidl_next::ResponseFuture<'_, Self::Transport, child_iterator::Next>,
449 ::fidl_next::EncodeError,
450 >;
451}
452
453impl<___T> ChildIteratorClientSender for ::fidl_next::ClientSender<___T, ChildIterator>
454where
455 ___T: ::fidl_next::Transport,
456{
457 type Transport = ___T;
458
459 #[doc = " Advance the iterator and return the next batch of children.\n\n Returns a vector of `ChildRef`. Returns an empty vector when there are\n no more children.\n"]
460 fn next(
461 &self,
462 ) -> Result<
463 ::fidl_next::ResponseFuture<'_, Self::Transport, child_iterator::Next>,
464 ::fidl_next::EncodeError,
465 > {
466 self.as_untyped()
467 .send_two_way(4676077302722137352, &mut ())
468 .map(::fidl_next::ResponseFuture::from_untyped)
469 }
470}
471
472pub trait ChildIteratorClientHandler<___T: ::fidl_next::Transport> {}
476
477impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for ChildIterator
478where
479 ___T: ::fidl_next::Transport,
480 ___H: ChildIteratorClientHandler<___T>,
481
482 <child_iterator::Next as ::fidl_next::Method>::Response:
483 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
484{
485 fn on_event(
486 handler: &mut ___H,
487 sender: &::fidl_next::ClientSender<___T, Self>,
488 ordinal: u64,
489 buffer: ___T::RecvBuffer,
490 ) {
491 match ordinal {
492 ordinal => {
493 sender.close();
494 }
495 }
496 }
497}
498
499pub trait ChildIteratorServerSender {
501 type Transport: ::fidl_next::Transport;
502}
503
504impl<___T> ChildIteratorServerSender for ::fidl_next::ServerSender<___T, ChildIterator>
505where
506 ___T: ::fidl_next::Transport,
507{
508 type Transport = ___T;
509}
510
511pub trait ChildIteratorServerHandler<___T: ::fidl_next::Transport> {
515 #[doc = " Advance the iterator and return the next batch of children.\n\n Returns a vector of `ChildRef`. Returns an empty vector when there are\n no more children.\n"]
516 fn next(
517 &mut self,
518 sender: &::fidl_next::ServerSender<___T, ChildIterator>,
519
520 responder: ::fidl_next::Responder<child_iterator::Next>,
521 );
522}
523
524impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for ChildIterator
525where
526 ___T: ::fidl_next::Transport,
527 ___H: ChildIteratorServerHandler<___T>,
528{
529 fn on_one_way(
530 handler: &mut ___H,
531 sender: &::fidl_next::ServerSender<___T, Self>,
532 ordinal: u64,
533 buffer: ___T::RecvBuffer,
534 ) {
535 match ordinal {
536 ordinal => {
537 sender.close();
538 }
539 }
540 }
541
542 fn on_two_way(
543 handler: &mut ___H,
544 sender: &::fidl_next::ServerSender<___T, Self>,
545 ordinal: u64,
546 buffer: ___T::RecvBuffer,
547 responder: ::fidl_next::protocol::Responder,
548 ) {
549 match ordinal {
550 4676077302722137352 => {
551 let responder = ::fidl_next::Responder::from_untyped(responder);
552
553 handler.next(sender, responder);
554 }
555
556 ordinal => {
557 sender.close();
558 }
559 }
560 }
561}
562
563#[doc = " The maximum number of handles that can be passed to a created component.\n"]
564pub const MAX_HANDLE_COUNT: u32 = 128;
565
566pub const MAX_NAMESPACE_COUNT: u32 = 32;
567
568pub type ControllerStartResponse = ();
569
570pub type WireControllerStartResponse = ();
572
573#[derive(Debug)]
574#[repr(C)]
575pub struct ControllerIsStartedResponse {
576 pub is_started: bool,
577}
578
579impl ::fidl_next::Encodable for ControllerIsStartedResponse {
580 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
581 ::fidl_next::CopyOptimization::enable_if(
582 true && <bool as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
583 )
584 };
585
586 type Encoded = WireControllerIsStartedResponse;
587}
588
589unsafe impl<___E> ::fidl_next::Encode<___E> for ControllerIsStartedResponse
590where
591 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
592
593 ___E: ::fidl_next::fuchsia::HandleEncoder,
594{
595 #[inline]
596 fn encode(
597 &mut self,
598 encoder: &mut ___E,
599 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
600 ) -> Result<(), ::fidl_next::EncodeError> {
601 ::fidl_next::munge! {
602 let Self::Encoded {
603 is_started,
604
605 } = out;
606 }
607
608 ::fidl_next::Encode::encode(&mut self.is_started, encoder, is_started)?;
609
610 Ok(())
611 }
612}
613
614impl ::fidl_next::EncodableOption for Box<ControllerIsStartedResponse> {
615 type EncodedOption = ::fidl_next::WireBox<WireControllerIsStartedResponse>;
616}
617
618unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ControllerIsStartedResponse>
619where
620 ___E: ::fidl_next::Encoder + ?Sized,
621 ControllerIsStartedResponse: ::fidl_next::Encode<___E>,
622{
623 #[inline]
624 fn encode_option(
625 this: Option<&mut Self>,
626 encoder: &mut ___E,
627 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
628 ) -> Result<(), ::fidl_next::EncodeError> {
629 if let Some(inner) = this {
630 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
631 ::fidl_next::WireBox::encode_present(out);
632 } else {
633 ::fidl_next::WireBox::encode_absent(out);
634 }
635
636 Ok(())
637 }
638}
639
640impl ::fidl_next::TakeFrom<WireControllerIsStartedResponse> for ControllerIsStartedResponse {
641 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
642 ::fidl_next::CopyOptimization::enable_if(
643 true && <bool as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
644 )
645 };
646
647 #[inline]
648 fn take_from(from: &WireControllerIsStartedResponse) -> Self {
649 Self { is_started: ::fidl_next::TakeFrom::take_from(&from.is_started) }
650 }
651}
652
653#[derive(Debug)]
655#[repr(C)]
656pub struct WireControllerIsStartedResponse {
657 pub is_started: bool,
658}
659
660unsafe impl ::fidl_next::ZeroPadding for WireControllerIsStartedResponse {
661 #[inline]
662 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
663}
664
665unsafe impl<___D> ::fidl_next::Decode<___D> for WireControllerIsStartedResponse
666where
667 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
668
669 ___D: ::fidl_next::fuchsia::HandleDecoder,
670{
671 fn decode(
672 slot: ::fidl_next::Slot<'_, Self>,
673 decoder: &mut ___D,
674 ) -> Result<(), ::fidl_next::DecodeError> {
675 ::fidl_next::munge! {
676 let Self {
677 mut is_started,
678
679 } = slot;
680 }
681
682 ::fidl_next::Decode::decode(is_started.as_mut(), decoder)?;
683
684 Ok(())
685 }
686}
687
688pub const MAX_PATH_LENGTH: u64 = 4095;
689
690#[doc = " Standard error codes for component framework protocols.\n"]
691#[derive(Clone, Copy, Debug, PartialEq, Eq)]
692#[repr(u32)]
693pub enum Error {
694 Internal = 1,
695 InvalidArguments = 2,
696 Unsupported = 3,
697 AccessDenied = 4,
698 InstanceNotFound = 5,
699 InstanceAlreadyExists = 6,
700 InstanceCannotStart = 7,
701 InstanceCannotResolve = 8,
702 CollectionNotFound = 9,
703 ResourceUnavailable = 10,
704 InstanceDied = 11,
705 ResourceNotFound = 12,
706 InstanceCannotUnresolve = 13,
707 InstanceAlreadyStarted = 14,
708 UnknownOrdinal_(u32),
709}
710
711impl ::fidl_next::Encodable for Error {
712 type Encoded = WireError;
713}
714
715unsafe impl<___E> ::fidl_next::Encode<___E> for Error
716where
717 ___E: ?Sized,
718{
719 #[inline]
720 fn encode(
721 &mut self,
722 _: &mut ___E,
723 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
724 ) -> Result<(), ::fidl_next::EncodeError> {
725 ::fidl_next::munge!(let WireError { value } = out);
726 let _ = value.write(::fidl_next::WireU32::from(match *self {
727 Self::Internal => 1,
728
729 Self::InvalidArguments => 2,
730
731 Self::Unsupported => 3,
732
733 Self::AccessDenied => 4,
734
735 Self::InstanceNotFound => 5,
736
737 Self::InstanceAlreadyExists => 6,
738
739 Self::InstanceCannotStart => 7,
740
741 Self::InstanceCannotResolve => 8,
742
743 Self::CollectionNotFound => 9,
744
745 Self::ResourceUnavailable => 10,
746
747 Self::InstanceDied => 11,
748
749 Self::ResourceNotFound => 12,
750
751 Self::InstanceCannotUnresolve => 13,
752
753 Self::InstanceAlreadyStarted => 14,
754
755 Self::UnknownOrdinal_(value) => value,
756 }));
757
758 Ok(())
759 }
760}
761
762impl ::core::convert::From<WireError> for Error {
763 fn from(wire: WireError) -> Self {
764 match u32::from(wire.value) {
765 1 => Self::Internal,
766
767 2 => Self::InvalidArguments,
768
769 3 => Self::Unsupported,
770
771 4 => Self::AccessDenied,
772
773 5 => Self::InstanceNotFound,
774
775 6 => Self::InstanceAlreadyExists,
776
777 7 => Self::InstanceCannotStart,
778
779 8 => Self::InstanceCannotResolve,
780
781 9 => Self::CollectionNotFound,
782
783 10 => Self::ResourceUnavailable,
784
785 11 => Self::InstanceDied,
786
787 12 => Self::ResourceNotFound,
788
789 13 => Self::InstanceCannotUnresolve,
790
791 14 => Self::InstanceAlreadyStarted,
792
793 value => Self::UnknownOrdinal_(value),
794 }
795 }
796}
797
798impl ::fidl_next::TakeFrom<WireError> for Error {
799 #[inline]
800 fn take_from(from: &WireError) -> Self {
801 Self::from(*from)
802 }
803}
804
805#[derive(Clone, Copy, Debug, PartialEq, Eq)]
807#[repr(transparent)]
808pub struct WireError {
809 value: ::fidl_next::WireU32,
810}
811
812unsafe impl ::fidl_next::ZeroPadding for WireError {
813 #[inline]
814 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
815 }
817}
818
819impl WireError {
820 pub const INTERNAL: WireError = WireError { value: ::fidl_next::WireU32(1) };
821
822 pub const INVALID_ARGUMENTS: WireError = WireError { value: ::fidl_next::WireU32(2) };
823
824 pub const UNSUPPORTED: WireError = WireError { value: ::fidl_next::WireU32(3) };
825
826 pub const ACCESS_DENIED: WireError = WireError { value: ::fidl_next::WireU32(4) };
827
828 pub const INSTANCE_NOT_FOUND: WireError = WireError { value: ::fidl_next::WireU32(5) };
829
830 pub const INSTANCE_ALREADY_EXISTS: WireError = WireError { value: ::fidl_next::WireU32(6) };
831
832 pub const INSTANCE_CANNOT_START: WireError = WireError { value: ::fidl_next::WireU32(7) };
833
834 pub const INSTANCE_CANNOT_RESOLVE: WireError = WireError { value: ::fidl_next::WireU32(8) };
835
836 pub const COLLECTION_NOT_FOUND: WireError = WireError { value: ::fidl_next::WireU32(9) };
837
838 pub const RESOURCE_UNAVAILABLE: WireError = WireError { value: ::fidl_next::WireU32(10) };
839
840 pub const INSTANCE_DIED: WireError = WireError { value: ::fidl_next::WireU32(11) };
841
842 pub const RESOURCE_NOT_FOUND: WireError = WireError { value: ::fidl_next::WireU32(12) };
843
844 pub const INSTANCE_CANNOT_UNRESOLVE: WireError = WireError { value: ::fidl_next::WireU32(13) };
845
846 pub const INSTANCE_ALREADY_STARTED: WireError = WireError { value: ::fidl_next::WireU32(14) };
847}
848
849unsafe impl<___D> ::fidl_next::Decode<___D> for WireError
850where
851 ___D: ?Sized,
852{
853 fn decode(
854 slot: ::fidl_next::Slot<'_, Self>,
855 _: &mut ___D,
856 ) -> Result<(), ::fidl_next::DecodeError> {
857 Ok(())
858 }
859}
860
861impl ::core::convert::From<Error> for WireError {
862 fn from(natural: Error) -> Self {
863 match natural {
864 Error::Internal => WireError::INTERNAL,
865
866 Error::InvalidArguments => WireError::INVALID_ARGUMENTS,
867
868 Error::Unsupported => WireError::UNSUPPORTED,
869
870 Error::AccessDenied => WireError::ACCESS_DENIED,
871
872 Error::InstanceNotFound => WireError::INSTANCE_NOT_FOUND,
873
874 Error::InstanceAlreadyExists => WireError::INSTANCE_ALREADY_EXISTS,
875
876 Error::InstanceCannotStart => WireError::INSTANCE_CANNOT_START,
877
878 Error::InstanceCannotResolve => WireError::INSTANCE_CANNOT_RESOLVE,
879
880 Error::CollectionNotFound => WireError::COLLECTION_NOT_FOUND,
881
882 Error::ResourceUnavailable => WireError::RESOURCE_UNAVAILABLE,
883
884 Error::InstanceDied => WireError::INSTANCE_DIED,
885
886 Error::ResourceNotFound => WireError::RESOURCE_NOT_FOUND,
887
888 Error::InstanceCannotUnresolve => WireError::INSTANCE_CANNOT_UNRESOLVE,
889
890 Error::InstanceAlreadyStarted => WireError::INSTANCE_ALREADY_STARTED,
891
892 Error::UnknownOrdinal_(value) => WireError { value: ::fidl_next::WireU32::from(value) },
893 }
894 }
895}
896
897#[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"]
898#[derive(Debug)]
899pub struct NamespaceEntry {
900 pub path: Option<String>,
901
902 pub directory: Option<
903 ::fidl_next::ClientEnd<
904 ::fidl_next::fuchsia::zx::Channel,
905 ::fidl_next_fuchsia_io::Directory,
906 >,
907 >,
908}
909
910impl NamespaceEntry {
911 fn __max_ordinal(&self) -> usize {
912 if self.path.is_some() {
913 return 1;
914 }
915
916 if self.directory.is_some() {
917 return 2;
918 }
919
920 0
921 }
922}
923
924impl ::fidl_next::Encodable for NamespaceEntry {
925 type Encoded = WireNamespaceEntry;
926}
927
928unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceEntry
929where
930 ___E: ::fidl_next::Encoder + ?Sized,
931
932 ___E: ::fidl_next::fuchsia::HandleEncoder,
933{
934 #[inline]
935 fn encode(
936 &mut self,
937 encoder: &mut ___E,
938 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
939 ) -> Result<(), ::fidl_next::EncodeError> {
940 ::fidl_next::munge!(let WireNamespaceEntry { table } = out);
941
942 let max_ord = self.__max_ordinal();
943
944 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
945 ::fidl_next::ZeroPadding::zero_padding(&mut out);
946
947 let mut preallocated =
948 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
949
950 for i in 1..=max_ord {
951 match i {
952 2 => {
953 if let Some(directory) = &mut self.directory {
954 ::fidl_next::WireEnvelope::encode_value(
955 directory,
956 preallocated.encoder,
957 &mut out,
958 )?;
959 } else {
960 ::fidl_next::WireEnvelope::encode_zero(&mut out)
961 }
962 }
963
964 1 => {
965 if let Some(path) = &mut self.path {
966 ::fidl_next::WireEnvelope::encode_value(
967 path,
968 preallocated.encoder,
969 &mut out,
970 )?;
971 } else {
972 ::fidl_next::WireEnvelope::encode_zero(&mut out)
973 }
974 }
975
976 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
977 }
978 unsafe {
979 preallocated.write_next(out.assume_init_ref());
980 }
981 }
982
983 ::fidl_next::WireTable::encode_len(table, max_ord);
984
985 Ok(())
986 }
987}
988
989impl ::fidl_next::TakeFrom<WireNamespaceEntry> for NamespaceEntry {
990 #[inline]
991 fn take_from(from: &WireNamespaceEntry) -> Self {
992 Self {
993 path: from.path().map(::fidl_next::TakeFrom::take_from),
994
995 directory: from.directory().map(::fidl_next::TakeFrom::take_from),
996 }
997 }
998}
999
1000#[repr(C)]
1002pub struct WireNamespaceEntry {
1003 table: ::fidl_next::WireTable,
1004}
1005
1006unsafe impl ::fidl_next::ZeroPadding for WireNamespaceEntry {
1007 #[inline]
1008 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1009 ::fidl_next::munge!(let Self { table } = out);
1010 ::fidl_next::WireTable::zero_padding(table);
1011 }
1012}
1013
1014unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceEntry
1015where
1016 ___D: ::fidl_next::Decoder + ?Sized,
1017
1018 ___D: ::fidl_next::fuchsia::HandleDecoder,
1019{
1020 fn decode(
1021 slot: ::fidl_next::Slot<'_, Self>,
1022 decoder: &mut ___D,
1023 ) -> Result<(), ::fidl_next::DecodeError> {
1024 ::fidl_next::munge!(let Self { table } = slot);
1025
1026 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1027 match ordinal {
1028 0 => unsafe { ::core::hint::unreachable_unchecked() },
1029
1030 1 => {
1031 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
1032 slot.as_mut(),
1033 decoder,
1034 )?;
1035
1036 let path = unsafe {
1037 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
1038 };
1039
1040 if path.len() > 4095 {
1041 return Err(::fidl_next::DecodeError::VectorTooLong {
1042 size: path.len() as u64,
1043 limit: 4095,
1044 });
1045 }
1046
1047 Ok(())
1048 }
1049
1050 2 => {
1051 ::fidl_next::WireEnvelope::decode_as::<
1052 ___D,
1053 ::fidl_next::ClientEnd<
1054 ::fidl_next::fuchsia::WireChannel,
1055 ::fidl_next_fuchsia_io::Directory,
1056 >,
1057 >(slot.as_mut(), decoder)?;
1058
1059 Ok(())
1060 }
1061
1062 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1063 }
1064 })
1065 }
1066}
1067
1068impl WireNamespaceEntry {
1069 pub fn path(&self) -> Option<&::fidl_next::WireString> {
1070 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1071 }
1072
1073 pub fn directory(
1074 &self,
1075 ) -> Option<
1076 &::fidl_next::ClientEnd<
1077 ::fidl_next::fuchsia::WireChannel,
1078 ::fidl_next_fuchsia_io::Directory,
1079 >,
1080 > {
1081 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1082 }
1083}
1084
1085impl ::core::fmt::Debug for WireNamespaceEntry {
1086 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1087 f.debug_struct("NamespaceEntry")
1088 .field("path", &self.path())
1089 .field("directory", &self.directory())
1090 .finish()
1091 }
1092}
1093
1094#[derive(Debug)]
1095pub struct StartChildArgs {
1096 pub numbered_handles: Option<Vec<::fidl_next_fuchsia_process::HandleInfo>>,
1097
1098 pub namespace_entries: Option<Vec<crate::NamespaceEntry>>,
1099
1100 pub dictionary: Option<::fidl_next_fuchsia_component_sandbox::DictionaryRef>,
1101}
1102
1103impl StartChildArgs {
1104 fn __max_ordinal(&self) -> usize {
1105 if self.numbered_handles.is_some() {
1106 return 1;
1107 }
1108
1109 if self.namespace_entries.is_some() {
1110 return 2;
1111 }
1112
1113 if self.dictionary.is_some() {
1114 return 3;
1115 }
1116
1117 0
1118 }
1119}
1120
1121impl ::fidl_next::Encodable for StartChildArgs {
1122 type Encoded = WireStartChildArgs;
1123}
1124
1125unsafe impl<___E> ::fidl_next::Encode<___E> for StartChildArgs
1126where
1127 ___E: ::fidl_next::Encoder + ?Sized,
1128
1129 ___E: ::fidl_next::fuchsia::HandleEncoder,
1130{
1131 #[inline]
1132 fn encode(
1133 &mut self,
1134 encoder: &mut ___E,
1135 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1136 ) -> Result<(), ::fidl_next::EncodeError> {
1137 ::fidl_next::munge!(let WireStartChildArgs { table } = out);
1138
1139 let max_ord = self.__max_ordinal();
1140
1141 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1142 ::fidl_next::ZeroPadding::zero_padding(&mut out);
1143
1144 let mut preallocated =
1145 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1146
1147 for i in 1..=max_ord {
1148 match i {
1149 3 => {
1150 if let Some(dictionary) = &mut self.dictionary {
1151 ::fidl_next::WireEnvelope::encode_value(
1152 dictionary,
1153 preallocated.encoder,
1154 &mut out,
1155 )?;
1156 } else {
1157 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1158 }
1159 }
1160
1161 2 => {
1162 if let Some(namespace_entries) = &mut self.namespace_entries {
1163 ::fidl_next::WireEnvelope::encode_value(
1164 namespace_entries,
1165 preallocated.encoder,
1166 &mut out,
1167 )?;
1168 } else {
1169 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1170 }
1171 }
1172
1173 1 => {
1174 if let Some(numbered_handles) = &mut self.numbered_handles {
1175 ::fidl_next::WireEnvelope::encode_value(
1176 numbered_handles,
1177 preallocated.encoder,
1178 &mut out,
1179 )?;
1180 } else {
1181 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1182 }
1183 }
1184
1185 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1186 }
1187 unsafe {
1188 preallocated.write_next(out.assume_init_ref());
1189 }
1190 }
1191
1192 ::fidl_next::WireTable::encode_len(table, max_ord);
1193
1194 Ok(())
1195 }
1196}
1197
1198impl ::fidl_next::TakeFrom<WireStartChildArgs> for StartChildArgs {
1199 #[inline]
1200 fn take_from(from: &WireStartChildArgs) -> Self {
1201 Self {
1202 numbered_handles: from.numbered_handles().map(::fidl_next::TakeFrom::take_from),
1203
1204 namespace_entries: from.namespace_entries().map(::fidl_next::TakeFrom::take_from),
1205
1206 dictionary: from.dictionary().map(::fidl_next::TakeFrom::take_from),
1207 }
1208 }
1209}
1210
1211#[repr(C)]
1213pub struct WireStartChildArgs {
1214 table: ::fidl_next::WireTable,
1215}
1216
1217unsafe impl ::fidl_next::ZeroPadding for WireStartChildArgs {
1218 #[inline]
1219 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1220 ::fidl_next::munge!(let Self { table } = out);
1221 ::fidl_next::WireTable::zero_padding(table);
1222 }
1223}
1224
1225unsafe impl<___D> ::fidl_next::Decode<___D> for WireStartChildArgs
1226where
1227 ___D: ::fidl_next::Decoder + ?Sized,
1228
1229 ___D: ::fidl_next::fuchsia::HandleDecoder,
1230{
1231 fn decode(
1232 slot: ::fidl_next::Slot<'_, Self>,
1233 decoder: &mut ___D,
1234 ) -> Result<(), ::fidl_next::DecodeError> {
1235 ::fidl_next::munge!(let Self { table } = slot);
1236
1237 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1238 match ordinal {
1239 0 => unsafe { ::core::hint::unreachable_unchecked() },
1240
1241 1 => {
1242 ::fidl_next::WireEnvelope::decode_as::<
1243 ___D,
1244 ::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>,
1245 >(slot.as_mut(), decoder)?;
1246
1247 let numbered_handles = unsafe {
1248 slot
1249 .deref_unchecked()
1250 .deref_unchecked::<
1251 ::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>
1252 >()
1253 };
1254
1255 if numbered_handles.len() > 128 {
1256 return Err(::fidl_next::DecodeError::VectorTooLong {
1257 size: numbered_handles.len() as u64,
1258 limit: 128,
1259 });
1260 }
1261
1262 Ok(())
1263 }
1264
1265 2 => {
1266 ::fidl_next::WireEnvelope::decode_as::<
1267 ___D,
1268 ::fidl_next::WireVector<crate::WireNamespaceEntry>,
1269 >(slot.as_mut(), decoder)?;
1270
1271 let namespace_entries = unsafe {
1272 slot.deref_unchecked()
1273 .deref_unchecked::<::fidl_next::WireVector<crate::WireNamespaceEntry>>()
1274 };
1275
1276 if namespace_entries.len() > 32 {
1277 return Err(::fidl_next::DecodeError::VectorTooLong {
1278 size: namespace_entries.len() as u64,
1279 limit: 32,
1280 });
1281 }
1282
1283 Ok(())
1284 }
1285
1286 3 => {
1287 ::fidl_next::WireEnvelope::decode_as::<
1288 ___D,
1289 ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
1290 >(slot.as_mut(), decoder)?;
1291
1292 Ok(())
1293 }
1294
1295 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1296 }
1297 })
1298 }
1299}
1300
1301impl WireStartChildArgs {
1302 pub fn numbered_handles(
1303 &self,
1304 ) -> Option<&::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>> {
1305 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1306 }
1307
1308 pub fn namespace_entries(&self) -> Option<&::fidl_next::WireVector<crate::WireNamespaceEntry>> {
1309 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1310 }
1311
1312 pub fn dictionary(&self) -> Option<&::fidl_next_fuchsia_component_sandbox::WireDictionaryRef> {
1313 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1314 }
1315}
1316
1317impl ::core::fmt::Debug for WireStartChildArgs {
1318 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1319 f.debug_struct("StartChildArgs")
1320 .field("numbered_handles", &self.numbered_handles())
1321 .field("namespace_entries", &self.namespace_entries())
1322 .field("dictionary", &self.dictionary())
1323 .finish()
1324 }
1325}
1326
1327#[derive(Debug)]
1328pub struct ControllerStartRequest {
1329 pub args: crate::StartChildArgs,
1330
1331 pub execution_controller:
1332 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::ExecutionController>,
1333}
1334
1335impl ::fidl_next::Encodable for ControllerStartRequest {
1336 type Encoded = WireControllerStartRequest;
1337}
1338
1339unsafe impl<___E> ::fidl_next::Encode<___E> for ControllerStartRequest
1340where
1341 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1342
1343 ___E: ::fidl_next::Encoder,
1344
1345 ___E: ::fidl_next::fuchsia::HandleEncoder,
1346{
1347 #[inline]
1348 fn encode(
1349 &mut self,
1350 encoder: &mut ___E,
1351 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1352 ) -> Result<(), ::fidl_next::EncodeError> {
1353 ::fidl_next::munge! {
1354 let Self::Encoded {
1355 args,
1356 execution_controller,
1357
1358 } = out;
1359 }
1360
1361 ::fidl_next::Encode::encode(&mut self.args, encoder, args)?;
1362
1363 ::fidl_next::Encode::encode(&mut self.execution_controller, encoder, execution_controller)?;
1364
1365 Ok(())
1366 }
1367}
1368
1369impl ::fidl_next::EncodableOption for Box<ControllerStartRequest> {
1370 type EncodedOption = ::fidl_next::WireBox<WireControllerStartRequest>;
1371}
1372
1373unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ControllerStartRequest>
1374where
1375 ___E: ::fidl_next::Encoder + ?Sized,
1376 ControllerStartRequest: ::fidl_next::Encode<___E>,
1377{
1378 #[inline]
1379 fn encode_option(
1380 this: Option<&mut Self>,
1381 encoder: &mut ___E,
1382 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1383 ) -> Result<(), ::fidl_next::EncodeError> {
1384 if let Some(inner) = this {
1385 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1386 ::fidl_next::WireBox::encode_present(out);
1387 } else {
1388 ::fidl_next::WireBox::encode_absent(out);
1389 }
1390
1391 Ok(())
1392 }
1393}
1394
1395impl ::fidl_next::TakeFrom<WireControllerStartRequest> for ControllerStartRequest {
1396 #[inline]
1397 fn take_from(from: &WireControllerStartRequest) -> Self {
1398 Self {
1399 args: ::fidl_next::TakeFrom::take_from(&from.args),
1400
1401 execution_controller: ::fidl_next::TakeFrom::take_from(&from.execution_controller),
1402 }
1403 }
1404}
1405
1406#[derive(Debug)]
1408#[repr(C)]
1409pub struct WireControllerStartRequest {
1410 pub args: crate::WireStartChildArgs,
1411
1412 pub execution_controller:
1413 ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::ExecutionController>,
1414}
1415
1416unsafe impl ::fidl_next::ZeroPadding for WireControllerStartRequest {
1417 #[inline]
1418 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1419 unsafe {
1420 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
1421 }
1422 }
1423}
1424
1425unsafe impl<___D> ::fidl_next::Decode<___D> for WireControllerStartRequest
1426where
1427 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1428
1429 ___D: ::fidl_next::Decoder,
1430
1431 ___D: ::fidl_next::fuchsia::HandleDecoder,
1432{
1433 fn decode(
1434 slot: ::fidl_next::Slot<'_, Self>,
1435 decoder: &mut ___D,
1436 ) -> Result<(), ::fidl_next::DecodeError> {
1437 ::fidl_next::munge! {
1438 let Self {
1439 mut args,
1440 mut execution_controller,
1441
1442 } = slot;
1443 }
1444
1445 ::fidl_next::Decode::decode(args.as_mut(), decoder)?;
1446
1447 ::fidl_next::Decode::decode(execution_controller.as_mut(), decoder)?;
1448
1449 Ok(())
1450 }
1451}
1452
1453#[derive(Debug)]
1454#[repr(C)]
1455pub struct ControllerGetExposedDictionaryResponse {
1456 pub dictionary: ::fidl_next_fuchsia_component_sandbox::DictionaryRef,
1457}
1458
1459impl ::fidl_next::Encodable for ControllerGetExposedDictionaryResponse {
1460 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
1461 ::fidl_next::CopyOptimization::enable_if(
1462 true
1463
1464 && <
1465 ::fidl_next_fuchsia_component_sandbox::DictionaryRef as ::fidl_next::Encodable
1466 >::COPY_OPTIMIZATION.is_enabled()
1467
1468 )
1469 };
1470
1471 type Encoded = WireControllerGetExposedDictionaryResponse;
1472}
1473
1474unsafe impl<___E> ::fidl_next::Encode<___E> for ControllerGetExposedDictionaryResponse
1475where
1476 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1477
1478 ___E: ::fidl_next::fuchsia::HandleEncoder,
1479{
1480 #[inline]
1481 fn encode(
1482 &mut self,
1483 encoder: &mut ___E,
1484 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1485 ) -> Result<(), ::fidl_next::EncodeError> {
1486 ::fidl_next::munge! {
1487 let Self::Encoded {
1488 dictionary,
1489
1490 } = out;
1491 }
1492
1493 ::fidl_next::Encode::encode(&mut self.dictionary, encoder, dictionary)?;
1494
1495 Ok(())
1496 }
1497}
1498
1499impl ::fidl_next::EncodableOption for Box<ControllerGetExposedDictionaryResponse> {
1500 type EncodedOption = ::fidl_next::WireBox<WireControllerGetExposedDictionaryResponse>;
1501}
1502
1503unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ControllerGetExposedDictionaryResponse>
1504where
1505 ___E: ::fidl_next::Encoder + ?Sized,
1506 ControllerGetExposedDictionaryResponse: ::fidl_next::Encode<___E>,
1507{
1508 #[inline]
1509 fn encode_option(
1510 this: Option<&mut Self>,
1511 encoder: &mut ___E,
1512 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1513 ) -> Result<(), ::fidl_next::EncodeError> {
1514 if let Some(inner) = this {
1515 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1516 ::fidl_next::WireBox::encode_present(out);
1517 } else {
1518 ::fidl_next::WireBox::encode_absent(out);
1519 }
1520
1521 Ok(())
1522 }
1523}
1524
1525impl ::fidl_next::TakeFrom<WireControllerGetExposedDictionaryResponse>
1526 for ControllerGetExposedDictionaryResponse
1527{
1528 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
1529 ::fidl_next::CopyOptimization::enable_if(
1530 true
1531
1532 && <
1533 ::fidl_next_fuchsia_component_sandbox::DictionaryRef as ::fidl_next::Encodable
1534 >::COPY_OPTIMIZATION.is_enabled()
1535
1536 )
1537 };
1538
1539 #[inline]
1540 fn take_from(from: &WireControllerGetExposedDictionaryResponse) -> Self {
1541 Self { dictionary: ::fidl_next::TakeFrom::take_from(&from.dictionary) }
1542 }
1543}
1544
1545#[derive(Debug)]
1547#[repr(C)]
1548pub struct WireControllerGetExposedDictionaryResponse {
1549 pub dictionary: ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
1550}
1551
1552unsafe impl ::fidl_next::ZeroPadding for WireControllerGetExposedDictionaryResponse {
1553 #[inline]
1554 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1555}
1556
1557unsafe impl<___D> ::fidl_next::Decode<___D> for WireControllerGetExposedDictionaryResponse
1558where
1559 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1560
1561 ___D: ::fidl_next::fuchsia::HandleDecoder,
1562{
1563 fn decode(
1564 slot: ::fidl_next::Slot<'_, Self>,
1565 decoder: &mut ___D,
1566 ) -> Result<(), ::fidl_next::DecodeError> {
1567 ::fidl_next::munge! {
1568 let Self {
1569 mut dictionary,
1570
1571 } = slot;
1572 }
1573
1574 ::fidl_next::Decode::decode(dictionary.as_mut(), decoder)?;
1575
1576 Ok(())
1577 }
1578}
1579
1580pub type ControllerDestroyResponse = ();
1581
1582pub type WireControllerDestroyResponse = ();
1584
1585#[doc = " A protocol used to operate on a component.\n\n One may get access to a `Controller` when creating a component with the\n `Realm.CreateChild` method. You may also obtain a `Controller` for an\n existing child component with the `Realm.OpenController` method.\n"]
1587#[derive(Debug)]
1588pub struct Controller;
1589
1590pub mod controller {
1591 pub mod prelude {
1592 pub use crate::{
1593 controller, Controller, ControllerClientHandler, ControllerClientSender,
1594 ControllerServerHandler, ControllerServerSender,
1595 };
1596
1597 pub use crate::ControllerStartRequest;
1598
1599 pub use crate::ControllerDestroyResponse;
1600
1601 pub use crate::ControllerGetExposedDictionaryResponse;
1602
1603 pub use crate::ControllerIsStartedResponse;
1604
1605 pub use crate::ControllerStartResponse;
1606
1607 pub use crate::Error;
1608 }
1609
1610 pub struct Start;
1611
1612 impl ::fidl_next::Method for Start {
1613 const ORDINAL: u64 = 7532130149195770565;
1614
1615 type Protocol = crate::Controller;
1616
1617 type Request = crate::WireControllerStartRequest;
1618
1619 type Response =
1620 ::fidl_next::WireFlexibleResult<crate::WireControllerStartResponse, crate::WireError>;
1621 }
1622
1623 pub struct IsStarted;
1624
1625 impl ::fidl_next::Method for IsStarted {
1626 const ORDINAL: u64 = 2402079833990398915;
1627
1628 type Protocol = crate::Controller;
1629
1630 type Request = ();
1631
1632 type Response = ::fidl_next::WireFlexibleResult<
1633 crate::WireControllerIsStartedResponse,
1634 crate::WireError,
1635 >;
1636 }
1637
1638 pub struct GetExposedDictionary;
1639
1640 impl ::fidl_next::Method for GetExposedDictionary {
1641 const ORDINAL: u64 = 9099583788120940443;
1642
1643 type Protocol = crate::Controller;
1644
1645 type Request = ();
1646
1647 type Response = ::fidl_next::WireFlexibleResult<
1648 crate::WireControllerGetExposedDictionaryResponse,
1649 crate::WireError,
1650 >;
1651 }
1652
1653 pub struct Destroy;
1654
1655 impl ::fidl_next::Method for Destroy {
1656 const ORDINAL: u64 = 8381937394141370177;
1657
1658 type Protocol = crate::Controller;
1659
1660 type Request = ();
1661
1662 type Response =
1663 ::fidl_next::WireFlexibleResult<crate::WireControllerDestroyResponse, crate::WireError>;
1664 }
1665}
1666
1667pub trait ControllerClientSender {
1669 type Transport: ::fidl_next::Transport;
1670
1671 #[doc = " Start the component, optionally providing additional handles to be given\n to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is\n currently running.\n"]
1672 fn start<___R>(
1673 &self,
1674 request: &mut ___R,
1675 ) -> Result<
1676 ::fidl_next::ResponseFuture<'_, Self::Transport, controller::Start>,
1677 ::fidl_next::EncodeError,
1678 >
1679 where
1680 ___R: ::fidl_next::Encode<
1681 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1682 Encoded = crate::WireControllerStartRequest,
1683 >;
1684
1685 #[doc = " Returns true if this instance is currently running.\n"]
1686 fn is_started(
1687 &self,
1688 ) -> Result<
1689 ::fidl_next::ResponseFuture<'_, Self::Transport, controller::IsStarted>,
1690 ::fidl_next::EncodeError,
1691 >;
1692
1693 #[doc = " Returns the dictionary containing the component\'s exposed capabilities.\n"]
1694 fn get_exposed_dictionary(
1695 &self,
1696 ) -> Result<
1697 ::fidl_next::ResponseFuture<'_, Self::Transport, controller::GetExposedDictionary>,
1698 ::fidl_next::EncodeError,
1699 >;
1700
1701 #[doc = " Destroys this component. When this method returns, either:\n\n - Ok was returned, indicating destruction has begun.\n - An error was returned, and destruction will not be attempted.\n\n If Ok was returned, destruction will proceed in the background, but it\n hasn\'t necessarily completed yet. When it completes, the framework will\n close this [Controller] channel.\n\n Errors:\n\n - `ACCESS_DENIED`: Destruction of this component is not allowed.\n Currently, this can happen if the component is a static child of its\n parent.\n"]
1702 fn destroy(
1703 &self,
1704 ) -> Result<
1705 ::fidl_next::ResponseFuture<'_, Self::Transport, controller::Destroy>,
1706 ::fidl_next::EncodeError,
1707 >;
1708}
1709
1710impl<___T> ControllerClientSender for ::fidl_next::ClientSender<___T, Controller>
1711where
1712 ___T: ::fidl_next::Transport,
1713{
1714 type Transport = ___T;
1715
1716 #[doc = " Start the component, optionally providing additional handles to be given\n to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is\n currently running.\n"]
1717 fn start<___R>(
1718 &self,
1719 request: &mut ___R,
1720 ) -> Result<
1721 ::fidl_next::ResponseFuture<'_, Self::Transport, controller::Start>,
1722 ::fidl_next::EncodeError,
1723 >
1724 where
1725 ___R: ::fidl_next::Encode<
1726 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1727 Encoded = crate::WireControllerStartRequest,
1728 >,
1729 {
1730 self.as_untyped()
1731 .send_two_way(7532130149195770565, request)
1732 .map(::fidl_next::ResponseFuture::from_untyped)
1733 }
1734
1735 #[doc = " Returns true if this instance is currently running.\n"]
1736 fn is_started(
1737 &self,
1738 ) -> Result<
1739 ::fidl_next::ResponseFuture<'_, Self::Transport, controller::IsStarted>,
1740 ::fidl_next::EncodeError,
1741 > {
1742 self.as_untyped()
1743 .send_two_way(2402079833990398915, &mut ())
1744 .map(::fidl_next::ResponseFuture::from_untyped)
1745 }
1746
1747 #[doc = " Returns the dictionary containing the component\'s exposed capabilities.\n"]
1748 fn get_exposed_dictionary(
1749 &self,
1750 ) -> Result<
1751 ::fidl_next::ResponseFuture<'_, Self::Transport, controller::GetExposedDictionary>,
1752 ::fidl_next::EncodeError,
1753 > {
1754 self.as_untyped()
1755 .send_two_way(9099583788120940443, &mut ())
1756 .map(::fidl_next::ResponseFuture::from_untyped)
1757 }
1758
1759 #[doc = " Destroys this component. When this method returns, either:\n\n - Ok was returned, indicating destruction has begun.\n - An error was returned, and destruction will not be attempted.\n\n If Ok was returned, destruction will proceed in the background, but it\n hasn\'t necessarily completed yet. When it completes, the framework will\n close this [Controller] channel.\n\n Errors:\n\n - `ACCESS_DENIED`: Destruction of this component is not allowed.\n Currently, this can happen if the component is a static child of its\n parent.\n"]
1760 fn destroy(
1761 &self,
1762 ) -> Result<
1763 ::fidl_next::ResponseFuture<'_, Self::Transport, controller::Destroy>,
1764 ::fidl_next::EncodeError,
1765 > {
1766 self.as_untyped()
1767 .send_two_way(8381937394141370177, &mut ())
1768 .map(::fidl_next::ResponseFuture::from_untyped)
1769 }
1770}
1771
1772pub trait ControllerClientHandler<___T: ::fidl_next::Transport> {
1776 fn on_unknown_interaction(
1777 &mut self,
1778 sender: &::fidl_next::ClientSender<___T, Controller>,
1779 ordinal: u64,
1780 ) {
1781 sender.close();
1782 }
1783}
1784
1785impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Controller
1786where
1787 ___T: ::fidl_next::Transport,
1788 ___H: ControllerClientHandler<___T>,
1789
1790 <controller::Start as ::fidl_next::Method>::Response:
1791 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1792
1793 <controller::IsStarted as ::fidl_next::Method>::Response:
1794 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1795
1796 <controller::GetExposedDictionary as ::fidl_next::Method>::Response:
1797 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1798
1799 <controller::Destroy as ::fidl_next::Method>::Response:
1800 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1801{
1802 fn on_event(
1803 handler: &mut ___H,
1804 sender: &::fidl_next::ClientSender<___T, Self>,
1805 ordinal: u64,
1806 buffer: ___T::RecvBuffer,
1807 ) {
1808 match ordinal {
1809 ordinal => handler.on_unknown_interaction(sender, ordinal),
1810 }
1811 }
1812}
1813
1814pub trait ControllerServerSender {
1816 type Transport: ::fidl_next::Transport;
1817}
1818
1819impl<___T> ControllerServerSender for ::fidl_next::ServerSender<___T, Controller>
1820where
1821 ___T: ::fidl_next::Transport,
1822{
1823 type Transport = ___T;
1824}
1825
1826pub trait ControllerServerHandler<___T: ::fidl_next::Transport> {
1830 #[doc = " Start the component, optionally providing additional handles to be given\n to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is\n currently running.\n"]
1831 fn start(
1832 &mut self,
1833 sender: &::fidl_next::ServerSender<___T, Controller>,
1834
1835 request: ::fidl_next::RequestBuffer<___T, controller::Start>,
1836
1837 responder: ::fidl_next::Responder<controller::Start>,
1838 );
1839
1840 #[doc = " Returns true if this instance is currently running.\n"]
1841 fn is_started(
1842 &mut self,
1843 sender: &::fidl_next::ServerSender<___T, Controller>,
1844
1845 responder: ::fidl_next::Responder<controller::IsStarted>,
1846 );
1847
1848 #[doc = " Returns the dictionary containing the component\'s exposed capabilities.\n"]
1849 fn get_exposed_dictionary(
1850 &mut self,
1851 sender: &::fidl_next::ServerSender<___T, Controller>,
1852
1853 responder: ::fidl_next::Responder<controller::GetExposedDictionary>,
1854 );
1855
1856 #[doc = " Destroys this component. When this method returns, either:\n\n - Ok was returned, indicating destruction has begun.\n - An error was returned, and destruction will not be attempted.\n\n If Ok was returned, destruction will proceed in the background, but it\n hasn\'t necessarily completed yet. When it completes, the framework will\n close this [Controller] channel.\n\n Errors:\n\n - `ACCESS_DENIED`: Destruction of this component is not allowed.\n Currently, this can happen if the component is a static child of its\n parent.\n"]
1857 fn destroy(
1858 &mut self,
1859 sender: &::fidl_next::ServerSender<___T, Controller>,
1860
1861 responder: ::fidl_next::Responder<controller::Destroy>,
1862 );
1863
1864 fn on_unknown_interaction(
1865 &mut self,
1866 sender: &::fidl_next::ServerSender<___T, Controller>,
1867 ordinal: u64,
1868 ) {
1869 sender.close();
1870 }
1871}
1872
1873impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Controller
1874where
1875 ___T: ::fidl_next::Transport,
1876 ___H: ControllerServerHandler<___T>,
1877
1878 crate::WireControllerStartRequest:
1879 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1880{
1881 fn on_one_way(
1882 handler: &mut ___H,
1883 sender: &::fidl_next::ServerSender<___T, Self>,
1884 ordinal: u64,
1885 buffer: ___T::RecvBuffer,
1886 ) {
1887 match ordinal {
1888 ordinal => handler.on_unknown_interaction(sender, ordinal),
1889 }
1890 }
1891
1892 fn on_two_way(
1893 handler: &mut ___H,
1894 sender: &::fidl_next::ServerSender<___T, Self>,
1895 ordinal: u64,
1896 buffer: ___T::RecvBuffer,
1897 responder: ::fidl_next::protocol::Responder,
1898 ) {
1899 match ordinal {
1900 7532130149195770565 => {
1901 let responder = ::fidl_next::Responder::from_untyped(responder);
1902
1903 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
1904 handler.start(sender, buffer, responder);
1905 }
1906
1907 2402079833990398915 => {
1908 let responder = ::fidl_next::Responder::from_untyped(responder);
1909
1910 handler.is_started(sender, responder);
1911 }
1912
1913 9099583788120940443 => {
1914 let responder = ::fidl_next::Responder::from_untyped(responder);
1915
1916 handler.get_exposed_dictionary(sender, responder);
1917 }
1918
1919 8381937394141370177 => {
1920 let responder = ::fidl_next::Responder::from_untyped(responder);
1921
1922 handler.destroy(sender, responder);
1923 }
1924
1925 ordinal => handler.on_unknown_interaction(sender, ordinal),
1926 }
1927 }
1928}
1929
1930#[doc = " The maximum number of dynamic offers that can target a created component.\n"]
1931pub const MAX_DYNAMIC_OFFER_COUNT: u32 = 128;
1932
1933#[derive(Debug)]
1934pub struct CreateChildArgs {
1935 pub numbered_handles: Option<Vec<::fidl_next_fuchsia_process::HandleInfo>>,
1936
1937 pub dynamic_offers: Option<Vec<::fidl_next_fuchsia_component_decl::Offer>>,
1938
1939 pub controller:
1940 Option<::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Controller>>,
1941
1942 pub dictionary: Option<::fidl_next_fuchsia_component_sandbox::DictionaryRef>,
1943}
1944
1945impl CreateChildArgs {
1946 fn __max_ordinal(&self) -> usize {
1947 if self.numbered_handles.is_some() {
1948 return 1;
1949 }
1950
1951 if self.dynamic_offers.is_some() {
1952 return 2;
1953 }
1954
1955 if self.controller.is_some() {
1956 return 3;
1957 }
1958
1959 if self.dictionary.is_some() {
1960 return 4;
1961 }
1962
1963 0
1964 }
1965}
1966
1967impl ::fidl_next::Encodable for CreateChildArgs {
1968 type Encoded = WireCreateChildArgs;
1969}
1970
1971unsafe impl<___E> ::fidl_next::Encode<___E> for CreateChildArgs
1972where
1973 ___E: ::fidl_next::Encoder + ?Sized,
1974
1975 ___E: ::fidl_next::fuchsia::HandleEncoder,
1976{
1977 #[inline]
1978 fn encode(
1979 &mut self,
1980 encoder: &mut ___E,
1981 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1982 ) -> Result<(), ::fidl_next::EncodeError> {
1983 ::fidl_next::munge!(let WireCreateChildArgs { table } = out);
1984
1985 let max_ord = self.__max_ordinal();
1986
1987 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1988 ::fidl_next::ZeroPadding::zero_padding(&mut out);
1989
1990 let mut preallocated =
1991 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1992
1993 for i in 1..=max_ord {
1994 match i {
1995 4 => {
1996 if let Some(dictionary) = &mut self.dictionary {
1997 ::fidl_next::WireEnvelope::encode_value(
1998 dictionary,
1999 preallocated.encoder,
2000 &mut out,
2001 )?;
2002 } else {
2003 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2004 }
2005 }
2006
2007 3 => {
2008 if let Some(controller) = &mut self.controller {
2009 ::fidl_next::WireEnvelope::encode_value(
2010 controller,
2011 preallocated.encoder,
2012 &mut out,
2013 )?;
2014 } else {
2015 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2016 }
2017 }
2018
2019 2 => {
2020 if let Some(dynamic_offers) = &mut self.dynamic_offers {
2021 ::fidl_next::WireEnvelope::encode_value(
2022 dynamic_offers,
2023 preallocated.encoder,
2024 &mut out,
2025 )?;
2026 } else {
2027 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2028 }
2029 }
2030
2031 1 => {
2032 if let Some(numbered_handles) = &mut self.numbered_handles {
2033 ::fidl_next::WireEnvelope::encode_value(
2034 numbered_handles,
2035 preallocated.encoder,
2036 &mut out,
2037 )?;
2038 } else {
2039 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2040 }
2041 }
2042
2043 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2044 }
2045 unsafe {
2046 preallocated.write_next(out.assume_init_ref());
2047 }
2048 }
2049
2050 ::fidl_next::WireTable::encode_len(table, max_ord);
2051
2052 Ok(())
2053 }
2054}
2055
2056impl ::fidl_next::TakeFrom<WireCreateChildArgs> for CreateChildArgs {
2057 #[inline]
2058 fn take_from(from: &WireCreateChildArgs) -> Self {
2059 Self {
2060 numbered_handles: from.numbered_handles().map(::fidl_next::TakeFrom::take_from),
2061
2062 dynamic_offers: from.dynamic_offers().map(::fidl_next::TakeFrom::take_from),
2063
2064 controller: from.controller().map(::fidl_next::TakeFrom::take_from),
2065
2066 dictionary: from.dictionary().map(::fidl_next::TakeFrom::take_from),
2067 }
2068 }
2069}
2070
2071#[repr(C)]
2073pub struct WireCreateChildArgs {
2074 table: ::fidl_next::WireTable,
2075}
2076
2077unsafe impl ::fidl_next::ZeroPadding for WireCreateChildArgs {
2078 #[inline]
2079 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2080 ::fidl_next::munge!(let Self { table } = out);
2081 ::fidl_next::WireTable::zero_padding(table);
2082 }
2083}
2084
2085unsafe impl<___D> ::fidl_next::Decode<___D> for WireCreateChildArgs
2086where
2087 ___D: ::fidl_next::Decoder + ?Sized,
2088
2089 ___D: ::fidl_next::fuchsia::HandleDecoder,
2090{
2091 fn decode(
2092 slot: ::fidl_next::Slot<'_, Self>,
2093 decoder: &mut ___D,
2094 ) -> Result<(), ::fidl_next::DecodeError> {
2095 ::fidl_next::munge!(let Self { table } = slot);
2096
2097 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2098 match ordinal {
2099 0 => unsafe { ::core::hint::unreachable_unchecked() },
2100
2101 1 => {
2102 ::fidl_next::WireEnvelope::decode_as::<
2103 ___D,
2104 ::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>,
2105 >(slot.as_mut(), decoder)?;
2106
2107 let numbered_handles = unsafe {
2108 slot
2109 .deref_unchecked()
2110 .deref_unchecked::<
2111 ::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>
2112 >()
2113 };
2114
2115 if numbered_handles.len() > 128 {
2116 return Err(::fidl_next::DecodeError::VectorTooLong {
2117 size: numbered_handles.len() as u64,
2118 limit: 128,
2119 });
2120 }
2121
2122 Ok(())
2123 }
2124
2125 2 => {
2126 ::fidl_next::WireEnvelope::decode_as::<
2127 ___D,
2128 ::fidl_next::WireVector<::fidl_next_fuchsia_component_decl::WireOffer>,
2129 >(slot.as_mut(), decoder)?;
2130
2131 let dynamic_offers =
2132 unsafe {
2133 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<
2134 ::fidl_next_fuchsia_component_decl::WireOffer,
2135 >>()
2136 };
2137
2138 if dynamic_offers.len() > 128 {
2139 return Err(::fidl_next::DecodeError::VectorTooLong {
2140 size: dynamic_offers.len() as u64,
2141 limit: 128,
2142 });
2143 }
2144
2145 Ok(())
2146 }
2147
2148 3 => {
2149 ::fidl_next::WireEnvelope::decode_as::<
2150 ___D,
2151 ::fidl_next::ServerEnd<
2152 ::fidl_next::fuchsia::WireChannel,
2153 crate::Controller,
2154 >,
2155 >(slot.as_mut(), decoder)?;
2156
2157 Ok(())
2158 }
2159
2160 4 => {
2161 ::fidl_next::WireEnvelope::decode_as::<
2162 ___D,
2163 ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
2164 >(slot.as_mut(), decoder)?;
2165
2166 Ok(())
2167 }
2168
2169 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2170 }
2171 })
2172 }
2173}
2174
2175impl WireCreateChildArgs {
2176 pub fn numbered_handles(
2177 &self,
2178 ) -> Option<&::fidl_next::WireVector<::fidl_next_fuchsia_process::WireHandleInfo>> {
2179 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2180 }
2181
2182 pub fn dynamic_offers(
2183 &self,
2184 ) -> Option<&::fidl_next::WireVector<::fidl_next_fuchsia_component_decl::WireOffer>> {
2185 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2186 }
2187
2188 pub fn controller(
2189 &self,
2190 ) -> Option<&::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Controller>> {
2191 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2192 }
2193
2194 pub fn dictionary(&self) -> Option<&::fidl_next_fuchsia_component_sandbox::WireDictionaryRef> {
2195 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2196 }
2197}
2198
2199impl ::core::fmt::Debug for WireCreateChildArgs {
2200 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2201 f.debug_struct("CreateChildArgs")
2202 .field("numbered_handles", &self.numbered_handles())
2203 .field("dynamic_offers", &self.dynamic_offers())
2204 .field("controller", &self.controller())
2205 .field("dictionary", &self.dictionary())
2206 .finish()
2207 }
2208}
2209
2210#[doc = " Payload for DebugStarted events.\n"]
2211#[derive(Debug)]
2212pub struct DebugStartedPayload {
2213 pub runtime_dir: Option<
2214 ::fidl_next::ClientEnd<
2215 ::fidl_next::fuchsia::zx::Channel,
2216 ::fidl_next_fuchsia_io::Directory,
2217 >,
2218 >,
2219
2220 pub break_on_start: Option<::fidl_next::fuchsia::zx::Handle>,
2221}
2222
2223impl DebugStartedPayload {
2224 fn __max_ordinal(&self) -> usize {
2225 if self.runtime_dir.is_some() {
2226 return 1;
2227 }
2228
2229 if self.break_on_start.is_some() {
2230 return 2;
2231 }
2232
2233 0
2234 }
2235}
2236
2237impl ::fidl_next::Encodable for DebugStartedPayload {
2238 type Encoded = WireDebugStartedPayload;
2239}
2240
2241unsafe impl<___E> ::fidl_next::Encode<___E> for DebugStartedPayload
2242where
2243 ___E: ::fidl_next::Encoder + ?Sized,
2244
2245 ___E: ::fidl_next::fuchsia::HandleEncoder,
2246{
2247 #[inline]
2248 fn encode(
2249 &mut self,
2250 encoder: &mut ___E,
2251 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2252 ) -> Result<(), ::fidl_next::EncodeError> {
2253 ::fidl_next::munge!(let WireDebugStartedPayload { table } = out);
2254
2255 let max_ord = self.__max_ordinal();
2256
2257 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2258 ::fidl_next::ZeroPadding::zero_padding(&mut out);
2259
2260 let mut preallocated =
2261 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2262
2263 for i in 1..=max_ord {
2264 match i {
2265 2 => {
2266 if let Some(break_on_start) = &mut self.break_on_start {
2267 ::fidl_next::WireEnvelope::encode_value(
2268 break_on_start,
2269 preallocated.encoder,
2270 &mut out,
2271 )?;
2272 } else {
2273 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2274 }
2275 }
2276
2277 1 => {
2278 if let Some(runtime_dir) = &mut self.runtime_dir {
2279 ::fidl_next::WireEnvelope::encode_value(
2280 runtime_dir,
2281 preallocated.encoder,
2282 &mut out,
2283 )?;
2284 } else {
2285 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2286 }
2287 }
2288
2289 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2290 }
2291 unsafe {
2292 preallocated.write_next(out.assume_init_ref());
2293 }
2294 }
2295
2296 ::fidl_next::WireTable::encode_len(table, max_ord);
2297
2298 Ok(())
2299 }
2300}
2301
2302impl ::fidl_next::TakeFrom<WireDebugStartedPayload> for DebugStartedPayload {
2303 #[inline]
2304 fn take_from(from: &WireDebugStartedPayload) -> Self {
2305 Self {
2306 runtime_dir: from.runtime_dir().map(::fidl_next::TakeFrom::take_from),
2307
2308 break_on_start: from.break_on_start().map(::fidl_next::TakeFrom::take_from),
2309 }
2310 }
2311}
2312
2313#[repr(C)]
2315pub struct WireDebugStartedPayload {
2316 table: ::fidl_next::WireTable,
2317}
2318
2319unsafe impl ::fidl_next::ZeroPadding for WireDebugStartedPayload {
2320 #[inline]
2321 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2322 ::fidl_next::munge!(let Self { table } = out);
2323 ::fidl_next::WireTable::zero_padding(table);
2324 }
2325}
2326
2327unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugStartedPayload
2328where
2329 ___D: ::fidl_next::Decoder + ?Sized,
2330
2331 ___D: ::fidl_next::fuchsia::HandleDecoder,
2332{
2333 fn decode(
2334 slot: ::fidl_next::Slot<'_, Self>,
2335 decoder: &mut ___D,
2336 ) -> Result<(), ::fidl_next::DecodeError> {
2337 ::fidl_next::munge!(let Self { table } = slot);
2338
2339 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2340 match ordinal {
2341 0 => unsafe { ::core::hint::unreachable_unchecked() },
2342
2343 1 => {
2344 ::fidl_next::WireEnvelope::decode_as::<
2345 ___D,
2346 ::fidl_next::ClientEnd<
2347 ::fidl_next::fuchsia::WireChannel,
2348 ::fidl_next_fuchsia_io::Directory,
2349 >,
2350 >(slot.as_mut(), decoder)?;
2351
2352 Ok(())
2353 }
2354
2355 2 => {
2356 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
2357 slot.as_mut(),
2358 decoder,
2359 )?;
2360
2361 Ok(())
2362 }
2363
2364 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2365 }
2366 })
2367 }
2368}
2369
2370impl WireDebugStartedPayload {
2371 pub fn runtime_dir(
2372 &self,
2373 ) -> Option<
2374 &::fidl_next::ClientEnd<
2375 ::fidl_next::fuchsia::WireChannel,
2376 ::fidl_next_fuchsia_io::Directory,
2377 >,
2378 > {
2379 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2380 }
2381
2382 pub fn break_on_start(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
2383 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2384 }
2385}
2386
2387impl ::core::fmt::Debug for WireDebugStartedPayload {
2388 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2389 f.debug_struct("DebugStartedPayload")
2390 .field("runtime_dir", &self.runtime_dir())
2391 .field("break_on_start", &self.break_on_start())
2392 .finish()
2393 }
2394}
2395
2396#[doc = " Payload for Destroyed events.\n"]
2397#[derive(Clone, Debug)]
2398pub struct DestroyedPayload {}
2399
2400impl DestroyedPayload {
2401 fn __max_ordinal(&self) -> usize {
2402 0
2403 }
2404}
2405
2406impl ::fidl_next::Encodable for DestroyedPayload {
2407 type Encoded = WireDestroyedPayload;
2408}
2409
2410unsafe impl<___E> ::fidl_next::Encode<___E> for DestroyedPayload
2411where
2412 ___E: ::fidl_next::Encoder + ?Sized,
2413{
2414 #[inline]
2415 fn encode(
2416 &mut self,
2417 encoder: &mut ___E,
2418 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2419 ) -> Result<(), ::fidl_next::EncodeError> {
2420 ::fidl_next::munge!(let WireDestroyedPayload { table } = out);
2421
2422 let max_ord = self.__max_ordinal();
2423
2424 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2425 ::fidl_next::ZeroPadding::zero_padding(&mut out);
2426
2427 let mut preallocated =
2428 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2429
2430 for i in 1..=max_ord {
2431 match i {
2432 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2433 }
2434 unsafe {
2435 preallocated.write_next(out.assume_init_ref());
2436 }
2437 }
2438
2439 ::fidl_next::WireTable::encode_len(table, max_ord);
2440
2441 Ok(())
2442 }
2443}
2444
2445impl ::fidl_next::TakeFrom<WireDestroyedPayload> for DestroyedPayload {
2446 #[inline]
2447 fn take_from(from: &WireDestroyedPayload) -> Self {
2448 Self {}
2449 }
2450}
2451
2452#[repr(C)]
2454pub struct WireDestroyedPayload {
2455 table: ::fidl_next::WireTable,
2456}
2457
2458unsafe impl ::fidl_next::ZeroPadding for WireDestroyedPayload {
2459 #[inline]
2460 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2461 ::fidl_next::munge!(let Self { table } = out);
2462 ::fidl_next::WireTable::zero_padding(table);
2463 }
2464}
2465
2466unsafe impl<___D> ::fidl_next::Decode<___D> for WireDestroyedPayload
2467where
2468 ___D: ::fidl_next::Decoder + ?Sized,
2469{
2470 fn decode(
2471 slot: ::fidl_next::Slot<'_, Self>,
2472 decoder: &mut ___D,
2473 ) -> Result<(), ::fidl_next::DecodeError> {
2474 ::fidl_next::munge!(let Self { table } = slot);
2475
2476 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2477 match ordinal {
2478 0 => unsafe { ::core::hint::unreachable_unchecked() },
2479
2480 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2481 }
2482 })
2483 }
2484}
2485
2486impl WireDestroyedPayload {}
2487
2488impl ::core::fmt::Debug for WireDestroyedPayload {
2489 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2490 f.debug_struct("DestroyedPayload").finish()
2491 }
2492}
2493
2494#[doc = " Payload for DirectoryReady events\n"]
2495#[derive(Debug)]
2496pub struct DirectoryReadyPayload {
2497 pub name: Option<String>,
2498
2499 pub node: Option<
2500 ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, ::fidl_next_fuchsia_io::Node>,
2501 >,
2502}
2503
2504impl DirectoryReadyPayload {
2505 fn __max_ordinal(&self) -> usize {
2506 if self.name.is_some() {
2507 return 1;
2508 }
2509
2510 if self.node.is_some() {
2511 return 2;
2512 }
2513
2514 0
2515 }
2516}
2517
2518impl ::fidl_next::Encodable for DirectoryReadyPayload {
2519 type Encoded = WireDirectoryReadyPayload;
2520}
2521
2522unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadyPayload
2523where
2524 ___E: ::fidl_next::Encoder + ?Sized,
2525
2526 ___E: ::fidl_next::fuchsia::HandleEncoder,
2527{
2528 #[inline]
2529 fn encode(
2530 &mut self,
2531 encoder: &mut ___E,
2532 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2533 ) -> Result<(), ::fidl_next::EncodeError> {
2534 ::fidl_next::munge!(let WireDirectoryReadyPayload { table } = out);
2535
2536 let max_ord = self.__max_ordinal();
2537
2538 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2539 ::fidl_next::ZeroPadding::zero_padding(&mut out);
2540
2541 let mut preallocated =
2542 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2543
2544 for i in 1..=max_ord {
2545 match i {
2546 2 => {
2547 if let Some(node) = &mut self.node {
2548 ::fidl_next::WireEnvelope::encode_value(
2549 node,
2550 preallocated.encoder,
2551 &mut out,
2552 )?;
2553 } else {
2554 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2555 }
2556 }
2557
2558 1 => {
2559 if let Some(name) = &mut self.name {
2560 ::fidl_next::WireEnvelope::encode_value(
2561 name,
2562 preallocated.encoder,
2563 &mut out,
2564 )?;
2565 } else {
2566 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2567 }
2568 }
2569
2570 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2571 }
2572 unsafe {
2573 preallocated.write_next(out.assume_init_ref());
2574 }
2575 }
2576
2577 ::fidl_next::WireTable::encode_len(table, max_ord);
2578
2579 Ok(())
2580 }
2581}
2582
2583impl ::fidl_next::TakeFrom<WireDirectoryReadyPayload> for DirectoryReadyPayload {
2584 #[inline]
2585 fn take_from(from: &WireDirectoryReadyPayload) -> Self {
2586 Self {
2587 name: from.name().map(::fidl_next::TakeFrom::take_from),
2588
2589 node: from.node().map(::fidl_next::TakeFrom::take_from),
2590 }
2591 }
2592}
2593
2594#[repr(C)]
2596pub struct WireDirectoryReadyPayload {
2597 table: ::fidl_next::WireTable,
2598}
2599
2600unsafe impl ::fidl_next::ZeroPadding for WireDirectoryReadyPayload {
2601 #[inline]
2602 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2603 ::fidl_next::munge!(let Self { table } = out);
2604 ::fidl_next::WireTable::zero_padding(table);
2605 }
2606}
2607
2608unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadyPayload
2609where
2610 ___D: ::fidl_next::Decoder + ?Sized,
2611
2612 ___D: ::fidl_next::fuchsia::HandleDecoder,
2613{
2614 fn decode(
2615 slot: ::fidl_next::Slot<'_, Self>,
2616 decoder: &mut ___D,
2617 ) -> Result<(), ::fidl_next::DecodeError> {
2618 ::fidl_next::munge!(let Self { table } = slot);
2619
2620 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2621 match ordinal {
2622 0 => unsafe { ::core::hint::unreachable_unchecked() },
2623
2624 1 => {
2625 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
2626 slot.as_mut(),
2627 decoder,
2628 )?;
2629
2630 let name = unsafe {
2631 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
2632 };
2633
2634 if name.len() > 255 {
2635 return Err(::fidl_next::DecodeError::VectorTooLong {
2636 size: name.len() as u64,
2637 limit: 255,
2638 });
2639 }
2640
2641 Ok(())
2642 }
2643
2644 2 => {
2645 ::fidl_next::WireEnvelope::decode_as::<
2646 ___D,
2647 ::fidl_next::ClientEnd<
2648 ::fidl_next::fuchsia::WireChannel,
2649 ::fidl_next_fuchsia_io::Node,
2650 >,
2651 >(slot.as_mut(), decoder)?;
2652
2653 Ok(())
2654 }
2655
2656 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2657 }
2658 })
2659 }
2660}
2661
2662impl WireDirectoryReadyPayload {
2663 pub fn name(&self) -> Option<&::fidl_next::WireString> {
2664 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2665 }
2666
2667 pub fn node(
2668 &self,
2669 ) -> Option<
2670 &::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, ::fidl_next_fuchsia_io::Node>,
2671 > {
2672 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2673 }
2674}
2675
2676impl ::core::fmt::Debug for WireDirectoryReadyPayload {
2677 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2678 f.debug_struct("DirectoryReadyPayload")
2679 .field("name", &self.name())
2680 .field("node", &self.node())
2681 .finish()
2682 }
2683}
2684
2685#[doc = " Payload for Discovered events.\n"]
2686#[derive(Clone, Debug)]
2687pub struct DiscoveredPayload {}
2688
2689impl DiscoveredPayload {
2690 fn __max_ordinal(&self) -> usize {
2691 0
2692 }
2693}
2694
2695impl ::fidl_next::Encodable for DiscoveredPayload {
2696 type Encoded = WireDiscoveredPayload;
2697}
2698
2699unsafe impl<___E> ::fidl_next::Encode<___E> for DiscoveredPayload
2700where
2701 ___E: ::fidl_next::Encoder + ?Sized,
2702{
2703 #[inline]
2704 fn encode(
2705 &mut self,
2706 encoder: &mut ___E,
2707 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2708 ) -> Result<(), ::fidl_next::EncodeError> {
2709 ::fidl_next::munge!(let WireDiscoveredPayload { table } = out);
2710
2711 let max_ord = self.__max_ordinal();
2712
2713 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2714 ::fidl_next::ZeroPadding::zero_padding(&mut out);
2715
2716 let mut preallocated =
2717 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2718
2719 for i in 1..=max_ord {
2720 match i {
2721 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2722 }
2723 unsafe {
2724 preallocated.write_next(out.assume_init_ref());
2725 }
2726 }
2727
2728 ::fidl_next::WireTable::encode_len(table, max_ord);
2729
2730 Ok(())
2731 }
2732}
2733
2734impl ::fidl_next::TakeFrom<WireDiscoveredPayload> for DiscoveredPayload {
2735 #[inline]
2736 fn take_from(from: &WireDiscoveredPayload) -> Self {
2737 Self {}
2738 }
2739}
2740
2741#[repr(C)]
2743pub struct WireDiscoveredPayload {
2744 table: ::fidl_next::WireTable,
2745}
2746
2747unsafe impl ::fidl_next::ZeroPadding for WireDiscoveredPayload {
2748 #[inline]
2749 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2750 ::fidl_next::munge!(let Self { table } = out);
2751 ::fidl_next::WireTable::zero_padding(table);
2752 }
2753}
2754
2755unsafe impl<___D> ::fidl_next::Decode<___D> for WireDiscoveredPayload
2756where
2757 ___D: ::fidl_next::Decoder + ?Sized,
2758{
2759 fn decode(
2760 slot: ::fidl_next::Slot<'_, Self>,
2761 decoder: &mut ___D,
2762 ) -> Result<(), ::fidl_next::DecodeError> {
2763 ::fidl_next::munge!(let Self { table } = slot);
2764
2765 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2766 match ordinal {
2767 0 => unsafe { ::core::hint::unreachable_unchecked() },
2768
2769 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2770 }
2771 })
2772 }
2773}
2774
2775impl WireDiscoveredPayload {}
2776
2777impl ::core::fmt::Debug for WireDiscoveredPayload {
2778 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2779 f.debug_struct("DiscoveredPayload").finish()
2780 }
2781}
2782
2783pub const MAX_MONIKER_LENGTH: u32 = 4096;
2784
2785#[doc = " Payload for Purged events.\n"]
2786#[derive(Clone, Debug)]
2787pub struct PurgedPayload {}
2788
2789impl PurgedPayload {
2790 fn __max_ordinal(&self) -> usize {
2791 0
2792 }
2793}
2794
2795impl ::fidl_next::Encodable for PurgedPayload {
2796 type Encoded = WirePurgedPayload;
2797}
2798
2799unsafe impl<___E> ::fidl_next::Encode<___E> for PurgedPayload
2800where
2801 ___E: ::fidl_next::Encoder + ?Sized,
2802{
2803 #[inline]
2804 fn encode(
2805 &mut self,
2806 encoder: &mut ___E,
2807 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2808 ) -> Result<(), ::fidl_next::EncodeError> {
2809 ::fidl_next::munge!(let WirePurgedPayload { table } = out);
2810
2811 let max_ord = self.__max_ordinal();
2812
2813 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2814 ::fidl_next::ZeroPadding::zero_padding(&mut out);
2815
2816 let mut preallocated =
2817 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2818
2819 for i in 1..=max_ord {
2820 match i {
2821 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2822 }
2823 unsafe {
2824 preallocated.write_next(out.assume_init_ref());
2825 }
2826 }
2827
2828 ::fidl_next::WireTable::encode_len(table, max_ord);
2829
2830 Ok(())
2831 }
2832}
2833
2834impl ::fidl_next::TakeFrom<WirePurgedPayload> for PurgedPayload {
2835 #[inline]
2836 fn take_from(from: &WirePurgedPayload) -> Self {
2837 Self {}
2838 }
2839}
2840
2841#[repr(C)]
2843pub struct WirePurgedPayload {
2844 table: ::fidl_next::WireTable,
2845}
2846
2847unsafe impl ::fidl_next::ZeroPadding for WirePurgedPayload {
2848 #[inline]
2849 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2850 ::fidl_next::munge!(let Self { table } = out);
2851 ::fidl_next::WireTable::zero_padding(table);
2852 }
2853}
2854
2855unsafe impl<___D> ::fidl_next::Decode<___D> for WirePurgedPayload
2856where
2857 ___D: ::fidl_next::Decoder + ?Sized,
2858{
2859 fn decode(
2860 slot: ::fidl_next::Slot<'_, Self>,
2861 decoder: &mut ___D,
2862 ) -> Result<(), ::fidl_next::DecodeError> {
2863 ::fidl_next::munge!(let Self { table } = slot);
2864
2865 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2866 match ordinal {
2867 0 => unsafe { ::core::hint::unreachable_unchecked() },
2868
2869 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2870 }
2871 })
2872 }
2873}
2874
2875impl WirePurgedPayload {}
2876
2877impl ::core::fmt::Debug for WirePurgedPayload {
2878 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2879 f.debug_struct("PurgedPayload").finish()
2880 }
2881}
2882
2883#[doc = " Payload for Resolved events.\n"]
2884#[derive(Clone, Debug)]
2885pub struct ResolvedPayload {}
2886
2887impl ResolvedPayload {
2888 fn __max_ordinal(&self) -> usize {
2889 0
2890 }
2891}
2892
2893impl ::fidl_next::Encodable for ResolvedPayload {
2894 type Encoded = WireResolvedPayload;
2895}
2896
2897unsafe impl<___E> ::fidl_next::Encode<___E> for ResolvedPayload
2898where
2899 ___E: ::fidl_next::Encoder + ?Sized,
2900{
2901 #[inline]
2902 fn encode(
2903 &mut self,
2904 encoder: &mut ___E,
2905 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2906 ) -> Result<(), ::fidl_next::EncodeError> {
2907 ::fidl_next::munge!(let WireResolvedPayload { table } = out);
2908
2909 let max_ord = self.__max_ordinal();
2910
2911 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2912 ::fidl_next::ZeroPadding::zero_padding(&mut out);
2913
2914 let mut preallocated =
2915 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2916
2917 for i in 1..=max_ord {
2918 match i {
2919 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2920 }
2921 unsafe {
2922 preallocated.write_next(out.assume_init_ref());
2923 }
2924 }
2925
2926 ::fidl_next::WireTable::encode_len(table, max_ord);
2927
2928 Ok(())
2929 }
2930}
2931
2932impl ::fidl_next::TakeFrom<WireResolvedPayload> for ResolvedPayload {
2933 #[inline]
2934 fn take_from(from: &WireResolvedPayload) -> Self {
2935 Self {}
2936 }
2937}
2938
2939#[repr(C)]
2941pub struct WireResolvedPayload {
2942 table: ::fidl_next::WireTable,
2943}
2944
2945unsafe impl ::fidl_next::ZeroPadding for WireResolvedPayload {
2946 #[inline]
2947 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2948 ::fidl_next::munge!(let Self { table } = out);
2949 ::fidl_next::WireTable::zero_padding(table);
2950 }
2951}
2952
2953unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolvedPayload
2954where
2955 ___D: ::fidl_next::Decoder + ?Sized,
2956{
2957 fn decode(
2958 slot: ::fidl_next::Slot<'_, Self>,
2959 decoder: &mut ___D,
2960 ) -> Result<(), ::fidl_next::DecodeError> {
2961 ::fidl_next::munge!(let Self { table } = slot);
2962
2963 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2964 match ordinal {
2965 0 => unsafe { ::core::hint::unreachable_unchecked() },
2966
2967 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2968 }
2969 })
2970 }
2971}
2972
2973impl WireResolvedPayload {}
2974
2975impl ::core::fmt::Debug for WireResolvedPayload {
2976 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2977 f.debug_struct("ResolvedPayload").finish()
2978 }
2979}
2980
2981#[doc = " Payload for Started events.\n"]
2982#[derive(Clone, Debug)]
2983pub struct StartedPayload {}
2984
2985impl StartedPayload {
2986 fn __max_ordinal(&self) -> usize {
2987 0
2988 }
2989}
2990
2991impl ::fidl_next::Encodable for StartedPayload {
2992 type Encoded = WireStartedPayload;
2993}
2994
2995unsafe impl<___E> ::fidl_next::Encode<___E> for StartedPayload
2996where
2997 ___E: ::fidl_next::Encoder + ?Sized,
2998{
2999 #[inline]
3000 fn encode(
3001 &mut self,
3002 encoder: &mut ___E,
3003 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3004 ) -> Result<(), ::fidl_next::EncodeError> {
3005 ::fidl_next::munge!(let WireStartedPayload { table } = out);
3006
3007 let max_ord = self.__max_ordinal();
3008
3009 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3010 ::fidl_next::ZeroPadding::zero_padding(&mut out);
3011
3012 let mut preallocated =
3013 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3014
3015 for i in 1..=max_ord {
3016 match i {
3017 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3018 }
3019 unsafe {
3020 preallocated.write_next(out.assume_init_ref());
3021 }
3022 }
3023
3024 ::fidl_next::WireTable::encode_len(table, max_ord);
3025
3026 Ok(())
3027 }
3028}
3029
3030impl ::fidl_next::TakeFrom<WireStartedPayload> for StartedPayload {
3031 #[inline]
3032 fn take_from(from: &WireStartedPayload) -> Self {
3033 Self {}
3034 }
3035}
3036
3037#[repr(C)]
3039pub struct WireStartedPayload {
3040 table: ::fidl_next::WireTable,
3041}
3042
3043unsafe impl ::fidl_next::ZeroPadding for WireStartedPayload {
3044 #[inline]
3045 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3046 ::fidl_next::munge!(let Self { table } = out);
3047 ::fidl_next::WireTable::zero_padding(table);
3048 }
3049}
3050
3051unsafe impl<___D> ::fidl_next::Decode<___D> for WireStartedPayload
3052where
3053 ___D: ::fidl_next::Decoder + ?Sized,
3054{
3055 fn decode(
3056 slot: ::fidl_next::Slot<'_, Self>,
3057 decoder: &mut ___D,
3058 ) -> Result<(), ::fidl_next::DecodeError> {
3059 ::fidl_next::munge!(let Self { table } = slot);
3060
3061 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3062 match ordinal {
3063 0 => unsafe { ::core::hint::unreachable_unchecked() },
3064
3065 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3066 }
3067 })
3068 }
3069}
3070
3071impl WireStartedPayload {}
3072
3073impl ::core::fmt::Debug for WireStartedPayload {
3074 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3075 f.debug_struct("StartedPayload").finish()
3076 }
3077}
3078
3079#[doc = " Payload for Unresolved events.\n"]
3080#[derive(Clone, Debug)]
3081pub struct UnresolvedPayload {}
3082
3083impl UnresolvedPayload {
3084 fn __max_ordinal(&self) -> usize {
3085 0
3086 }
3087}
3088
3089impl ::fidl_next::Encodable for UnresolvedPayload {
3090 type Encoded = WireUnresolvedPayload;
3091}
3092
3093unsafe impl<___E> ::fidl_next::Encode<___E> for UnresolvedPayload
3094where
3095 ___E: ::fidl_next::Encoder + ?Sized,
3096{
3097 #[inline]
3098 fn encode(
3099 &mut self,
3100 encoder: &mut ___E,
3101 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3102 ) -> Result<(), ::fidl_next::EncodeError> {
3103 ::fidl_next::munge!(let WireUnresolvedPayload { table } = out);
3104
3105 let max_ord = self.__max_ordinal();
3106
3107 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3108 ::fidl_next::ZeroPadding::zero_padding(&mut out);
3109
3110 let mut preallocated =
3111 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3112
3113 for i in 1..=max_ord {
3114 match i {
3115 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3116 }
3117 unsafe {
3118 preallocated.write_next(out.assume_init_ref());
3119 }
3120 }
3121
3122 ::fidl_next::WireTable::encode_len(table, max_ord);
3123
3124 Ok(())
3125 }
3126}
3127
3128impl ::fidl_next::TakeFrom<WireUnresolvedPayload> for UnresolvedPayload {
3129 #[inline]
3130 fn take_from(from: &WireUnresolvedPayload) -> Self {
3131 Self {}
3132 }
3133}
3134
3135#[repr(C)]
3137pub struct WireUnresolvedPayload {
3138 table: ::fidl_next::WireTable,
3139}
3140
3141unsafe impl ::fidl_next::ZeroPadding for WireUnresolvedPayload {
3142 #[inline]
3143 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3144 ::fidl_next::munge!(let Self { table } = out);
3145 ::fidl_next::WireTable::zero_padding(table);
3146 }
3147}
3148
3149unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnresolvedPayload
3150where
3151 ___D: ::fidl_next::Decoder + ?Sized,
3152{
3153 fn decode(
3154 slot: ::fidl_next::Slot<'_, Self>,
3155 decoder: &mut ___D,
3156 ) -> Result<(), ::fidl_next::DecodeError> {
3157 ::fidl_next::munge!(let Self { table } = slot);
3158
3159 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3160 match ordinal {
3161 0 => unsafe { ::core::hint::unreachable_unchecked() },
3162
3163 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3164 }
3165 })
3166 }
3167}
3168
3169impl WireUnresolvedPayload {}
3170
3171impl ::core::fmt::Debug for WireUnresolvedPayload {
3172 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3173 f.debug_struct("UnresolvedPayload").finish()
3174 }
3175}
3176
3177#[doc = " Payload for Stopped events.\n"]
3178#[derive(Clone, Debug)]
3179pub struct StoppedPayload {
3180 pub status: Option<i32>,
3181
3182 pub exit_code: Option<i64>,
3183}
3184
3185impl StoppedPayload {
3186 fn __max_ordinal(&self) -> usize {
3187 if self.status.is_some() {
3188 return 1;
3189 }
3190
3191 if self.exit_code.is_some() {
3192 return 2;
3193 }
3194
3195 0
3196 }
3197}
3198
3199impl ::fidl_next::Encodable for StoppedPayload {
3200 type Encoded = WireStoppedPayload;
3201}
3202
3203unsafe impl<___E> ::fidl_next::Encode<___E> for StoppedPayload
3204where
3205 ___E: ::fidl_next::Encoder + ?Sized,
3206{
3207 #[inline]
3208 fn encode(
3209 &mut self,
3210 encoder: &mut ___E,
3211 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3212 ) -> Result<(), ::fidl_next::EncodeError> {
3213 ::fidl_next::munge!(let WireStoppedPayload { table } = out);
3214
3215 let max_ord = self.__max_ordinal();
3216
3217 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3218 ::fidl_next::ZeroPadding::zero_padding(&mut out);
3219
3220 let mut preallocated =
3221 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3222
3223 for i in 1..=max_ord {
3224 match i {
3225 2 => {
3226 if let Some(exit_code) = &mut self.exit_code {
3227 ::fidl_next::WireEnvelope::encode_value(
3228 exit_code,
3229 preallocated.encoder,
3230 &mut out,
3231 )?;
3232 } else {
3233 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3234 }
3235 }
3236
3237 1 => {
3238 if let Some(status) = &mut self.status {
3239 ::fidl_next::WireEnvelope::encode_value(
3240 status,
3241 preallocated.encoder,
3242 &mut out,
3243 )?;
3244 } else {
3245 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3246 }
3247 }
3248
3249 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3250 }
3251 unsafe {
3252 preallocated.write_next(out.assume_init_ref());
3253 }
3254 }
3255
3256 ::fidl_next::WireTable::encode_len(table, max_ord);
3257
3258 Ok(())
3259 }
3260}
3261
3262impl ::fidl_next::TakeFrom<WireStoppedPayload> for StoppedPayload {
3263 #[inline]
3264 fn take_from(from: &WireStoppedPayload) -> Self {
3265 Self {
3266 status: from.status().map(::fidl_next::TakeFrom::take_from),
3267
3268 exit_code: from.exit_code().map(::fidl_next::TakeFrom::take_from),
3269 }
3270 }
3271}
3272
3273#[repr(C)]
3275pub struct WireStoppedPayload {
3276 table: ::fidl_next::WireTable,
3277}
3278
3279unsafe impl ::fidl_next::ZeroPadding for WireStoppedPayload {
3280 #[inline]
3281 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3282 ::fidl_next::munge!(let Self { table } = out);
3283 ::fidl_next::WireTable::zero_padding(table);
3284 }
3285}
3286
3287unsafe impl<___D> ::fidl_next::Decode<___D> for WireStoppedPayload
3288where
3289 ___D: ::fidl_next::Decoder + ?Sized,
3290{
3291 fn decode(
3292 slot: ::fidl_next::Slot<'_, Self>,
3293 decoder: &mut ___D,
3294 ) -> Result<(), ::fidl_next::DecodeError> {
3295 ::fidl_next::munge!(let Self { table } = slot);
3296
3297 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3298 match ordinal {
3299 0 => unsafe { ::core::hint::unreachable_unchecked() },
3300
3301 1 => {
3302 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI32>(
3303 slot.as_mut(),
3304 decoder,
3305 )?;
3306
3307 Ok(())
3308 }
3309
3310 2 => {
3311 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI64>(
3312 slot.as_mut(),
3313 decoder,
3314 )?;
3315
3316 Ok(())
3317 }
3318
3319 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3320 }
3321 })
3322 }
3323}
3324
3325impl WireStoppedPayload {
3326 pub fn status(&self) -> Option<&::fidl_next::WireI32> {
3327 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3328 }
3329
3330 pub fn exit_code(&self) -> Option<&::fidl_next::WireI64> {
3331 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3332 }
3333}
3334
3335impl ::core::fmt::Debug for WireStoppedPayload {
3336 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3337 f.debug_struct("StoppedPayload")
3338 .field("status", &self.status())
3339 .field("exit_code", &self.exit_code())
3340 .finish()
3341 }
3342}
3343
3344#[doc = " These EventTypes are used for the EventStream protocol.\n They are FIDL versions of the EventType enum in hooks.rs and have\n the same meaning.\n"]
3345#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3346#[repr(u32)]
3347pub enum EventType {
3348 CapabilityRequested = 1,
3349 DirectoryReady = 2,
3350 Discovered = 3,
3351 Destroyed = 4,
3352 Resolved = 5,
3353 Started = 6,
3354 Stopped = 7,
3355 DebugStarted = 8,
3356 Unresolved = 9,
3357}
3358
3359impl ::fidl_next::Encodable for EventType {
3360 type Encoded = WireEventType;
3361}
3362
3363unsafe impl<___E> ::fidl_next::Encode<___E> for EventType
3364where
3365 ___E: ?Sized,
3366{
3367 #[inline]
3368 fn encode(
3369 &mut self,
3370 _: &mut ___E,
3371 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3372 ) -> Result<(), ::fidl_next::EncodeError> {
3373 ::fidl_next::munge!(let WireEventType { value } = out);
3374 let _ = value.write(::fidl_next::WireU32::from(match *self {
3375 Self::CapabilityRequested => 1,
3376
3377 Self::DirectoryReady => 2,
3378
3379 Self::Discovered => 3,
3380
3381 Self::Destroyed => 4,
3382
3383 Self::Resolved => 5,
3384
3385 Self::Started => 6,
3386
3387 Self::Stopped => 7,
3388
3389 Self::DebugStarted => 8,
3390
3391 Self::Unresolved => 9,
3392 }));
3393
3394 Ok(())
3395 }
3396}
3397
3398impl ::core::convert::From<WireEventType> for EventType {
3399 fn from(wire: WireEventType) -> Self {
3400 match u32::from(wire.value) {
3401 1 => Self::CapabilityRequested,
3402
3403 2 => Self::DirectoryReady,
3404
3405 3 => Self::Discovered,
3406
3407 4 => Self::Destroyed,
3408
3409 5 => Self::Resolved,
3410
3411 6 => Self::Started,
3412
3413 7 => Self::Stopped,
3414
3415 8 => Self::DebugStarted,
3416
3417 9 => Self::Unresolved,
3418
3419 _ => unsafe { ::core::hint::unreachable_unchecked() },
3420 }
3421 }
3422}
3423
3424impl ::fidl_next::TakeFrom<WireEventType> for EventType {
3425 #[inline]
3426 fn take_from(from: &WireEventType) -> Self {
3427 Self::from(*from)
3428 }
3429}
3430
3431#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3433#[repr(transparent)]
3434pub struct WireEventType {
3435 value: ::fidl_next::WireU32,
3436}
3437
3438unsafe impl ::fidl_next::ZeroPadding for WireEventType {
3439 #[inline]
3440 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3441 }
3443}
3444
3445impl WireEventType {
3446 pub const CAPABILITY_REQUESTED: WireEventType =
3447 WireEventType { value: ::fidl_next::WireU32(1) };
3448
3449 pub const DIRECTORY_READY: WireEventType = WireEventType { value: ::fidl_next::WireU32(2) };
3450
3451 pub const DISCOVERED: WireEventType = WireEventType { value: ::fidl_next::WireU32(3) };
3452
3453 pub const DESTROYED: WireEventType = WireEventType { value: ::fidl_next::WireU32(4) };
3454
3455 pub const RESOLVED: WireEventType = WireEventType { value: ::fidl_next::WireU32(5) };
3456
3457 pub const STARTED: WireEventType = WireEventType { value: ::fidl_next::WireU32(6) };
3458
3459 pub const STOPPED: WireEventType = WireEventType { value: ::fidl_next::WireU32(7) };
3460
3461 pub const DEBUG_STARTED: WireEventType = WireEventType { value: ::fidl_next::WireU32(8) };
3462
3463 pub const UNRESOLVED: WireEventType = WireEventType { value: ::fidl_next::WireU32(9) };
3464}
3465
3466unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventType
3467where
3468 ___D: ?Sized,
3469{
3470 fn decode(
3471 slot: ::fidl_next::Slot<'_, Self>,
3472 _: &mut ___D,
3473 ) -> Result<(), ::fidl_next::DecodeError> {
3474 ::fidl_next::munge!(let Self { value } = slot);
3475
3476 match u32::from(*value) {
3477 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 => (),
3478 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
3479 }
3480
3481 Ok(())
3482 }
3483}
3484
3485impl ::core::convert::From<EventType> for WireEventType {
3486 fn from(natural: EventType) -> Self {
3487 match natural {
3488 EventType::CapabilityRequested => WireEventType::CAPABILITY_REQUESTED,
3489
3490 EventType::DirectoryReady => WireEventType::DIRECTORY_READY,
3491
3492 EventType::Discovered => WireEventType::DISCOVERED,
3493
3494 EventType::Destroyed => WireEventType::DESTROYED,
3495
3496 EventType::Resolved => WireEventType::RESOLVED,
3497
3498 EventType::Started => WireEventType::STARTED,
3499
3500 EventType::Stopped => WireEventType::STOPPED,
3501
3502 EventType::DebugStarted => WireEventType::DEBUG_STARTED,
3503
3504 EventType::Unresolved => WireEventType::UNRESOLVED,
3505 }
3506 }
3507}
3508
3509#[doc = " A head providing metadata about a target component instance.\n"]
3510#[derive(Clone, Debug)]
3511pub struct EventHeader {
3512 pub event_type: Option<crate::EventType>,
3513
3514 pub moniker: Option<String>,
3515
3516 pub component_url: Option<String>,
3517
3518 pub timestamp: Option<i64>,
3519}
3520
3521impl EventHeader {
3522 fn __max_ordinal(&self) -> usize {
3523 if self.event_type.is_some() {
3524 return 1;
3525 }
3526
3527 if self.moniker.is_some() {
3528 return 2;
3529 }
3530
3531 if self.component_url.is_some() {
3532 return 3;
3533 }
3534
3535 if self.timestamp.is_some() {
3536 return 4;
3537 }
3538
3539 0
3540 }
3541}
3542
3543impl ::fidl_next::Encodable for EventHeader {
3544 type Encoded = WireEventHeader;
3545}
3546
3547unsafe impl<___E> ::fidl_next::Encode<___E> for EventHeader
3548where
3549 ___E: ::fidl_next::Encoder + ?Sized,
3550{
3551 #[inline]
3552 fn encode(
3553 &mut self,
3554 encoder: &mut ___E,
3555 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3556 ) -> Result<(), ::fidl_next::EncodeError> {
3557 ::fidl_next::munge!(let WireEventHeader { table } = out);
3558
3559 let max_ord = self.__max_ordinal();
3560
3561 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3562 ::fidl_next::ZeroPadding::zero_padding(&mut out);
3563
3564 let mut preallocated =
3565 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3566
3567 for i in 1..=max_ord {
3568 match i {
3569 4 => {
3570 if let Some(timestamp) = &mut self.timestamp {
3571 ::fidl_next::WireEnvelope::encode_value(
3572 timestamp,
3573 preallocated.encoder,
3574 &mut out,
3575 )?;
3576 } else {
3577 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3578 }
3579 }
3580
3581 3 => {
3582 if let Some(component_url) = &mut self.component_url {
3583 ::fidl_next::WireEnvelope::encode_value(
3584 component_url,
3585 preallocated.encoder,
3586 &mut out,
3587 )?;
3588 } else {
3589 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3590 }
3591 }
3592
3593 2 => {
3594 if let Some(moniker) = &mut self.moniker {
3595 ::fidl_next::WireEnvelope::encode_value(
3596 moniker,
3597 preallocated.encoder,
3598 &mut out,
3599 )?;
3600 } else {
3601 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3602 }
3603 }
3604
3605 1 => {
3606 if let Some(event_type) = &mut self.event_type {
3607 ::fidl_next::WireEnvelope::encode_value(
3608 event_type,
3609 preallocated.encoder,
3610 &mut out,
3611 )?;
3612 } else {
3613 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3614 }
3615 }
3616
3617 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3618 }
3619 unsafe {
3620 preallocated.write_next(out.assume_init_ref());
3621 }
3622 }
3623
3624 ::fidl_next::WireTable::encode_len(table, max_ord);
3625
3626 Ok(())
3627 }
3628}
3629
3630impl ::fidl_next::TakeFrom<WireEventHeader> for EventHeader {
3631 #[inline]
3632 fn take_from(from: &WireEventHeader) -> Self {
3633 Self {
3634 event_type: from.event_type().map(::fidl_next::TakeFrom::take_from),
3635
3636 moniker: from.moniker().map(::fidl_next::TakeFrom::take_from),
3637
3638 component_url: from.component_url().map(::fidl_next::TakeFrom::take_from),
3639
3640 timestamp: from.timestamp().map(::fidl_next::TakeFrom::take_from),
3641 }
3642 }
3643}
3644
3645#[repr(C)]
3647pub struct WireEventHeader {
3648 table: ::fidl_next::WireTable,
3649}
3650
3651unsafe impl ::fidl_next::ZeroPadding for WireEventHeader {
3652 #[inline]
3653 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3654 ::fidl_next::munge!(let Self { table } = out);
3655 ::fidl_next::WireTable::zero_padding(table);
3656 }
3657}
3658
3659unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventHeader
3660where
3661 ___D: ::fidl_next::Decoder + ?Sized,
3662{
3663 fn decode(
3664 slot: ::fidl_next::Slot<'_, Self>,
3665 decoder: &mut ___D,
3666 ) -> Result<(), ::fidl_next::DecodeError> {
3667 ::fidl_next::munge!(let Self { table } = slot);
3668
3669 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3670 match ordinal {
3671 0 => unsafe { ::core::hint::unreachable_unchecked() },
3672
3673 1 => {
3674 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEventType>(
3675 slot.as_mut(),
3676 decoder,
3677 )?;
3678
3679 Ok(())
3680 }
3681
3682 2 => {
3683 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
3684 slot.as_mut(),
3685 decoder,
3686 )?;
3687
3688 let moniker = unsafe {
3689 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
3690 };
3691
3692 if moniker.len() > 4096 {
3693 return Err(::fidl_next::DecodeError::VectorTooLong {
3694 size: moniker.len() as u64,
3695 limit: 4096,
3696 });
3697 }
3698
3699 Ok(())
3700 }
3701
3702 3 => {
3703 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
3704 slot.as_mut(),
3705 decoder,
3706 )?;
3707
3708 let component_url = unsafe {
3709 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
3710 };
3711
3712 if component_url.len() > 4096 {
3713 return Err(::fidl_next::DecodeError::VectorTooLong {
3714 size: component_url.len() as u64,
3715 limit: 4096,
3716 });
3717 }
3718
3719 Ok(())
3720 }
3721
3722 4 => {
3723 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI64>(
3724 slot.as_mut(),
3725 decoder,
3726 )?;
3727
3728 Ok(())
3729 }
3730
3731 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3732 }
3733 })
3734 }
3735}
3736
3737impl WireEventHeader {
3738 pub fn event_type(&self) -> Option<&crate::WireEventType> {
3739 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3740 }
3741
3742 pub fn moniker(&self) -> Option<&::fidl_next::WireString> {
3743 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3744 }
3745
3746 pub fn component_url(&self) -> Option<&::fidl_next::WireString> {
3747 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
3748 }
3749
3750 pub fn timestamp(&self) -> Option<&::fidl_next::WireI64> {
3751 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
3752 }
3753}
3754
3755impl ::core::fmt::Debug for WireEventHeader {
3756 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3757 f.debug_struct("EventHeader")
3758 .field("event_type", &self.event_type())
3759 .field("moniker", &self.moniker())
3760 .field("component_url", &self.component_url())
3761 .field("timestamp", &self.timestamp())
3762 .finish()
3763 }
3764}
3765
3766#[doc = " Encapsulates additional data/protocols for some event types.\n"]
3767#[derive(Debug)]
3768pub enum EventPayload {
3769 CapabilityRequested(crate::CapabilityRequestedPayload),
3770
3771 Purged(crate::PurgedPayload),
3772
3773 DirectoryReady(crate::DirectoryReadyPayload),
3774
3775 Discovered(crate::DiscoveredPayload),
3776
3777 Destroyed(crate::DestroyedPayload),
3778
3779 Resolved(crate::ResolvedPayload),
3780
3781 Started(crate::StartedPayload),
3782
3783 Stopped(crate::StoppedPayload),
3784
3785 DebugStarted(crate::DebugStartedPayload),
3786
3787 Unresolved(crate::UnresolvedPayload),
3788
3789 UnknownOrdinal_(u64),
3790}
3791
3792impl ::fidl_next::Encodable for EventPayload {
3793 type Encoded = WireEventPayload;
3794}
3795
3796unsafe impl<___E> ::fidl_next::Encode<___E> for EventPayload
3797where
3798 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3799
3800 ___E: ::fidl_next::Encoder,
3801
3802 ___E: ::fidl_next::fuchsia::HandleEncoder,
3803{
3804 #[inline]
3805 fn encode(
3806 &mut self,
3807 encoder: &mut ___E,
3808 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3809 ) -> Result<(), ::fidl_next::EncodeError> {
3810 ::fidl_next::munge!(let WireEventPayload { raw } = out);
3811
3812 match self {
3813 Self::CapabilityRequested(value) => ::fidl_next::RawWireUnion::encode_as::<
3814 ___E,
3815 crate::CapabilityRequestedPayload,
3816 >(value, 1, encoder, raw)?,
3817
3818 Self::Purged(value) => ::fidl_next::RawWireUnion::encode_as::<
3819 ___E,
3820 crate::PurgedPayload,
3821 >(value, 2, encoder, raw)?,
3822
3823 Self::DirectoryReady(value) => ::fidl_next::RawWireUnion::encode_as::<
3824 ___E,
3825 crate::DirectoryReadyPayload,
3826 >(value, 3, encoder, raw)?,
3827
3828 Self::Discovered(value) => ::fidl_next::RawWireUnion::encode_as::<
3829 ___E,
3830 crate::DiscoveredPayload,
3831 >(value, 4, encoder, raw)?,
3832
3833 Self::Destroyed(value) => ::fidl_next::RawWireUnion::encode_as::<
3834 ___E,
3835 crate::DestroyedPayload,
3836 >(value, 5, encoder, raw)?,
3837
3838 Self::Resolved(value) => ::fidl_next::RawWireUnion::encode_as::<
3839 ___E,
3840 crate::ResolvedPayload,
3841 >(value, 6, encoder, raw)?,
3842
3843 Self::Started(value) => ::fidl_next::RawWireUnion::encode_as::<
3844 ___E,
3845 crate::StartedPayload,
3846 >(value, 7, encoder, raw)?,
3847
3848 Self::Stopped(value) => ::fidl_next::RawWireUnion::encode_as::<
3849 ___E,
3850 crate::StoppedPayload,
3851 >(value, 8, encoder, raw)?,
3852
3853 Self::DebugStarted(value) => ::fidl_next::RawWireUnion::encode_as::<
3854 ___E,
3855 crate::DebugStartedPayload,
3856 >(value, 9, encoder, raw)?,
3857
3858 Self::Unresolved(value) => ::fidl_next::RawWireUnion::encode_as::<
3859 ___E,
3860 crate::UnresolvedPayload,
3861 >(value, 10, encoder, raw)?,
3862
3863 Self::UnknownOrdinal_(ordinal) => {
3864 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
3865 }
3866 }
3867
3868 Ok(())
3869 }
3870}
3871
3872impl ::fidl_next::EncodableOption for Box<EventPayload> {
3873 type EncodedOption = WireOptionalEventPayload;
3874}
3875
3876unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<EventPayload>
3877where
3878 ___E: ?Sized,
3879 EventPayload: ::fidl_next::Encode<___E>,
3880{
3881 #[inline]
3882 fn encode_option(
3883 this: Option<&mut Self>,
3884 encoder: &mut ___E,
3885 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3886 ) -> Result<(), ::fidl_next::EncodeError> {
3887 ::fidl_next::munge!(let WireOptionalEventPayload { raw } = &mut *out);
3888
3889 if let Some(inner) = this {
3890 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3891 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
3892 } else {
3893 ::fidl_next::RawWireUnion::encode_absent(raw);
3894 }
3895
3896 Ok(())
3897 }
3898}
3899
3900impl ::fidl_next::TakeFrom<WireEventPayload> for EventPayload {
3901 #[inline]
3902 fn take_from(from: &WireEventPayload) -> Self {
3903 match from.raw.ordinal() {
3904 1 => Self::CapabilityRequested(::fidl_next::TakeFrom::take_from(unsafe {
3905 from.raw.get().deref_unchecked::<crate::WireCapabilityRequestedPayload>()
3906 })),
3907
3908 2 => Self::Purged(::fidl_next::TakeFrom::take_from(unsafe {
3909 from.raw.get().deref_unchecked::<crate::WirePurgedPayload>()
3910 })),
3911
3912 3 => Self::DirectoryReady(::fidl_next::TakeFrom::take_from(unsafe {
3913 from.raw.get().deref_unchecked::<crate::WireDirectoryReadyPayload>()
3914 })),
3915
3916 4 => Self::Discovered(::fidl_next::TakeFrom::take_from(unsafe {
3917 from.raw.get().deref_unchecked::<crate::WireDiscoveredPayload>()
3918 })),
3919
3920 5 => Self::Destroyed(::fidl_next::TakeFrom::take_from(unsafe {
3921 from.raw.get().deref_unchecked::<crate::WireDestroyedPayload>()
3922 })),
3923
3924 6 => Self::Resolved(::fidl_next::TakeFrom::take_from(unsafe {
3925 from.raw.get().deref_unchecked::<crate::WireResolvedPayload>()
3926 })),
3927
3928 7 => Self::Started(::fidl_next::TakeFrom::take_from(unsafe {
3929 from.raw.get().deref_unchecked::<crate::WireStartedPayload>()
3930 })),
3931
3932 8 => Self::Stopped(::fidl_next::TakeFrom::take_from(unsafe {
3933 from.raw.get().deref_unchecked::<crate::WireStoppedPayload>()
3934 })),
3935
3936 9 => Self::DebugStarted(::fidl_next::TakeFrom::take_from(unsafe {
3937 from.raw.get().deref_unchecked::<crate::WireDebugStartedPayload>()
3938 })),
3939
3940 10 => Self::Unresolved(::fidl_next::TakeFrom::take_from(unsafe {
3941 from.raw.get().deref_unchecked::<crate::WireUnresolvedPayload>()
3942 })),
3943
3944 _ => unsafe { ::core::hint::unreachable_unchecked() },
3945 }
3946 }
3947}
3948
3949impl ::fidl_next::TakeFrom<WireOptionalEventPayload> for Option<Box<EventPayload>> {
3950 #[inline]
3951 fn take_from(from: &WireOptionalEventPayload) -> Self {
3952 if let Some(inner) = from.as_ref() {
3953 Some(::fidl_next::TakeFrom::take_from(inner))
3954 } else {
3955 None
3956 }
3957 }
3958}
3959
3960#[repr(transparent)]
3962pub struct WireEventPayload {
3963 raw: ::fidl_next::RawWireUnion,
3964}
3965
3966unsafe impl ::fidl_next::ZeroPadding for WireEventPayload {
3967 #[inline]
3968 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3969 ::fidl_next::munge!(let Self { raw } = out);
3970 ::fidl_next::RawWireUnion::zero_padding(raw);
3971 }
3972}
3973
3974pub mod event_payload {
3975 pub enum Ref<'union> {
3976 CapabilityRequested(&'union crate::WireCapabilityRequestedPayload),
3977
3978 Purged(&'union crate::WirePurgedPayload),
3979
3980 DirectoryReady(&'union crate::WireDirectoryReadyPayload),
3981
3982 Discovered(&'union crate::WireDiscoveredPayload),
3983
3984 Destroyed(&'union crate::WireDestroyedPayload),
3985
3986 Resolved(&'union crate::WireResolvedPayload),
3987
3988 Started(&'union crate::WireStartedPayload),
3989
3990 Stopped(&'union crate::WireStoppedPayload),
3991
3992 DebugStarted(&'union crate::WireDebugStartedPayload),
3993
3994 Unresolved(&'union crate::WireUnresolvedPayload),
3995
3996 UnknownOrdinal_(u64),
3997 }
3998}
3999
4000impl WireEventPayload {
4001 pub fn as_ref(&self) -> crate::event_payload::Ref<'_> {
4002 match self.raw.ordinal() {
4003 1 => crate::event_payload::Ref::CapabilityRequested(unsafe {
4004 self.raw.get().deref_unchecked::<crate::WireCapabilityRequestedPayload>()
4005 }),
4006
4007 2 => crate::event_payload::Ref::Purged(unsafe {
4008 self.raw.get().deref_unchecked::<crate::WirePurgedPayload>()
4009 }),
4010
4011 3 => crate::event_payload::Ref::DirectoryReady(unsafe {
4012 self.raw.get().deref_unchecked::<crate::WireDirectoryReadyPayload>()
4013 }),
4014
4015 4 => crate::event_payload::Ref::Discovered(unsafe {
4016 self.raw.get().deref_unchecked::<crate::WireDiscoveredPayload>()
4017 }),
4018
4019 5 => crate::event_payload::Ref::Destroyed(unsafe {
4020 self.raw.get().deref_unchecked::<crate::WireDestroyedPayload>()
4021 }),
4022
4023 6 => crate::event_payload::Ref::Resolved(unsafe {
4024 self.raw.get().deref_unchecked::<crate::WireResolvedPayload>()
4025 }),
4026
4027 7 => crate::event_payload::Ref::Started(unsafe {
4028 self.raw.get().deref_unchecked::<crate::WireStartedPayload>()
4029 }),
4030
4031 8 => crate::event_payload::Ref::Stopped(unsafe {
4032 self.raw.get().deref_unchecked::<crate::WireStoppedPayload>()
4033 }),
4034
4035 9 => crate::event_payload::Ref::DebugStarted(unsafe {
4036 self.raw.get().deref_unchecked::<crate::WireDebugStartedPayload>()
4037 }),
4038
4039 10 => crate::event_payload::Ref::Unresolved(unsafe {
4040 self.raw.get().deref_unchecked::<crate::WireUnresolvedPayload>()
4041 }),
4042
4043 unknown => crate::event_payload::Ref::UnknownOrdinal_(unknown),
4044 }
4045 }
4046}
4047
4048unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventPayload
4049where
4050 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4051
4052 ___D: ::fidl_next::Decoder,
4053
4054 ___D: ::fidl_next::fuchsia::HandleDecoder,
4055{
4056 fn decode(
4057 mut slot: ::fidl_next::Slot<'_, Self>,
4058 decoder: &mut ___D,
4059 ) -> Result<(), ::fidl_next::DecodeError> {
4060 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
4061 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4062 1 => {
4063 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCapabilityRequestedPayload>(
4064 raw, decoder,
4065 )?
4066 }
4067
4068 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WirePurgedPayload>(
4069 raw, decoder,
4070 )?,
4071
4072 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryReadyPayload>(
4073 raw, decoder,
4074 )?,
4075
4076 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDiscoveredPayload>(
4077 raw, decoder,
4078 )?,
4079
4080 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDestroyedPayload>(
4081 raw, decoder,
4082 )?,
4083
4084 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolvedPayload>(
4085 raw, decoder,
4086 )?,
4087
4088 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStartedPayload>(
4089 raw, decoder,
4090 )?,
4091
4092 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStoppedPayload>(
4093 raw, decoder,
4094 )?,
4095
4096 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugStartedPayload>(
4097 raw, decoder,
4098 )?,
4099
4100 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnresolvedPayload>(
4101 raw, decoder,
4102 )?,
4103
4104 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4105 }
4106
4107 Ok(())
4108 }
4109}
4110
4111impl ::core::fmt::Debug for WireEventPayload {
4112 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4113 match self.raw.ordinal() {
4114 1 => unsafe {
4115 self.raw.get().deref_unchecked::<crate::WireCapabilityRequestedPayload>().fmt(f)
4116 },
4117 2 => unsafe { self.raw.get().deref_unchecked::<crate::WirePurgedPayload>().fmt(f) },
4118 3 => unsafe {
4119 self.raw.get().deref_unchecked::<crate::WireDirectoryReadyPayload>().fmt(f)
4120 },
4121 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireDiscoveredPayload>().fmt(f) },
4122 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireDestroyedPayload>().fmt(f) },
4123 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireResolvedPayload>().fmt(f) },
4124 7 => unsafe { self.raw.get().deref_unchecked::<crate::WireStartedPayload>().fmt(f) },
4125 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireStoppedPayload>().fmt(f) },
4126 9 => unsafe {
4127 self.raw.get().deref_unchecked::<crate::WireDebugStartedPayload>().fmt(f)
4128 },
4129 10 => unsafe {
4130 self.raw.get().deref_unchecked::<crate::WireUnresolvedPayload>().fmt(f)
4131 },
4132 _ => unsafe { ::core::hint::unreachable_unchecked() },
4133 }
4134 }
4135}
4136
4137#[repr(transparent)]
4138pub struct WireOptionalEventPayload {
4139 raw: ::fidl_next::RawWireUnion,
4140}
4141
4142unsafe impl ::fidl_next::ZeroPadding for WireOptionalEventPayload {
4143 #[inline]
4144 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4145 ::fidl_next::munge!(let Self { raw } = out);
4146 ::fidl_next::RawWireUnion::zero_padding(raw);
4147 }
4148}
4149
4150impl WireOptionalEventPayload {
4151 pub fn is_some(&self) -> bool {
4152 self.raw.is_some()
4153 }
4154
4155 pub fn is_none(&self) -> bool {
4156 self.raw.is_none()
4157 }
4158
4159 pub fn as_ref(&self) -> Option<&WireEventPayload> {
4160 if self.is_some() {
4161 Some(unsafe { &*(self as *const Self).cast() })
4162 } else {
4163 None
4164 }
4165 }
4166}
4167
4168unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalEventPayload
4169where
4170 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4171
4172 ___D: ::fidl_next::Decoder,
4173
4174 ___D: ::fidl_next::fuchsia::HandleDecoder,
4175{
4176 fn decode(
4177 mut slot: ::fidl_next::Slot<'_, Self>,
4178 decoder: &mut ___D,
4179 ) -> Result<(), ::fidl_next::DecodeError> {
4180 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
4181 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4182 1 => {
4183 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCapabilityRequestedPayload>(
4184 raw, decoder,
4185 )?
4186 }
4187
4188 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WirePurgedPayload>(
4189 raw, decoder,
4190 )?,
4191
4192 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryReadyPayload>(
4193 raw, decoder,
4194 )?,
4195
4196 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDiscoveredPayload>(
4197 raw, decoder,
4198 )?,
4199
4200 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDestroyedPayload>(
4201 raw, decoder,
4202 )?,
4203
4204 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolvedPayload>(
4205 raw, decoder,
4206 )?,
4207
4208 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStartedPayload>(
4209 raw, decoder,
4210 )?,
4211
4212 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStoppedPayload>(
4213 raw, decoder,
4214 )?,
4215
4216 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugStartedPayload>(
4217 raw, decoder,
4218 )?,
4219
4220 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnresolvedPayload>(
4221 raw, decoder,
4222 )?,
4223
4224 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
4225 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4226 }
4227
4228 Ok(())
4229 }
4230}
4231
4232impl ::core::fmt::Debug for WireOptionalEventPayload {
4233 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4234 self.as_ref().fmt(f)
4235 }
4236}
4237
4238#[doc = " Contains all information about a single event\n"]
4239#[derive(Debug)]
4240pub struct Event {
4241 pub header: Option<crate::EventHeader>,
4242
4243 pub payload: Option<crate::EventPayload>,
4244}
4245
4246impl Event {
4247 fn __max_ordinal(&self) -> usize {
4248 if self.header.is_some() {
4249 return 1;
4250 }
4251
4252 if self.payload.is_some() {
4253 return 2;
4254 }
4255
4256 0
4257 }
4258}
4259
4260impl ::fidl_next::Encodable for Event {
4261 type Encoded = WireEvent;
4262}
4263
4264unsafe impl<___E> ::fidl_next::Encode<___E> for Event
4265where
4266 ___E: ::fidl_next::Encoder + ?Sized,
4267
4268 ___E: ::fidl_next::fuchsia::HandleEncoder,
4269{
4270 #[inline]
4271 fn encode(
4272 &mut self,
4273 encoder: &mut ___E,
4274 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4275 ) -> Result<(), ::fidl_next::EncodeError> {
4276 ::fidl_next::munge!(let WireEvent { table } = out);
4277
4278 let max_ord = self.__max_ordinal();
4279
4280 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4281 ::fidl_next::ZeroPadding::zero_padding(&mut out);
4282
4283 let mut preallocated =
4284 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4285
4286 for i in 1..=max_ord {
4287 match i {
4288 2 => {
4289 if let Some(payload) = &mut self.payload {
4290 ::fidl_next::WireEnvelope::encode_value(
4291 payload,
4292 preallocated.encoder,
4293 &mut out,
4294 )?;
4295 } else {
4296 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4297 }
4298 }
4299
4300 1 => {
4301 if let Some(header) = &mut self.header {
4302 ::fidl_next::WireEnvelope::encode_value(
4303 header,
4304 preallocated.encoder,
4305 &mut out,
4306 )?;
4307 } else {
4308 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4309 }
4310 }
4311
4312 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4313 }
4314 unsafe {
4315 preallocated.write_next(out.assume_init_ref());
4316 }
4317 }
4318
4319 ::fidl_next::WireTable::encode_len(table, max_ord);
4320
4321 Ok(())
4322 }
4323}
4324
4325impl ::fidl_next::TakeFrom<WireEvent> for Event {
4326 #[inline]
4327 fn take_from(from: &WireEvent) -> Self {
4328 Self {
4329 header: from.header().map(::fidl_next::TakeFrom::take_from),
4330
4331 payload: from.payload().map(::fidl_next::TakeFrom::take_from),
4332 }
4333 }
4334}
4335
4336#[repr(C)]
4338pub struct WireEvent {
4339 table: ::fidl_next::WireTable,
4340}
4341
4342unsafe impl ::fidl_next::ZeroPadding for WireEvent {
4343 #[inline]
4344 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4345 ::fidl_next::munge!(let Self { table } = out);
4346 ::fidl_next::WireTable::zero_padding(table);
4347 }
4348}
4349
4350unsafe impl<___D> ::fidl_next::Decode<___D> for WireEvent
4351where
4352 ___D: ::fidl_next::Decoder + ?Sized,
4353
4354 ___D: ::fidl_next::fuchsia::HandleDecoder,
4355{
4356 fn decode(
4357 slot: ::fidl_next::Slot<'_, Self>,
4358 decoder: &mut ___D,
4359 ) -> Result<(), ::fidl_next::DecodeError> {
4360 ::fidl_next::munge!(let Self { table } = slot);
4361
4362 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4363 match ordinal {
4364 0 => unsafe { ::core::hint::unreachable_unchecked() },
4365
4366 1 => {
4367 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEventHeader>(
4368 slot.as_mut(),
4369 decoder,
4370 )?;
4371
4372 Ok(())
4373 }
4374
4375 2 => {
4376 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEventPayload>(
4377 slot.as_mut(),
4378 decoder,
4379 )?;
4380
4381 Ok(())
4382 }
4383
4384 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4385 }
4386 })
4387 }
4388}
4389
4390impl WireEvent {
4391 pub fn header(&self) -> Option<&crate::WireEventHeader> {
4392 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4393 }
4394
4395 pub fn payload(&self) -> Option<&crate::WireEventPayload> {
4396 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4397 }
4398}
4399
4400impl ::core::fmt::Debug for WireEvent {
4401 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
4402 f.debug_struct("Event")
4403 .field("header", &self.header())
4404 .field("payload", &self.payload())
4405 .finish()
4406 }
4407}
4408
4409#[derive(Debug)]
4410pub struct EventStreamGetNextResponse {
4411 pub events: Vec<crate::Event>,
4412}
4413
4414impl ::fidl_next::Encodable for EventStreamGetNextResponse {
4415 type Encoded = WireEventStreamGetNextResponse;
4416}
4417
4418unsafe impl<___E> ::fidl_next::Encode<___E> for EventStreamGetNextResponse
4419where
4420 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4421
4422 ___E: ::fidl_next::Encoder,
4423
4424 ___E: ::fidl_next::fuchsia::HandleEncoder,
4425{
4426 #[inline]
4427 fn encode(
4428 &mut self,
4429 encoder: &mut ___E,
4430 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4431 ) -> Result<(), ::fidl_next::EncodeError> {
4432 ::fidl_next::munge! {
4433 let Self::Encoded {
4434 events,
4435
4436 } = out;
4437 }
4438
4439 ::fidl_next::Encode::encode(&mut self.events, encoder, events)?;
4440
4441 Ok(())
4442 }
4443}
4444
4445impl ::fidl_next::EncodableOption for Box<EventStreamGetNextResponse> {
4446 type EncodedOption = ::fidl_next::WireBox<WireEventStreamGetNextResponse>;
4447}
4448
4449unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<EventStreamGetNextResponse>
4450where
4451 ___E: ::fidl_next::Encoder + ?Sized,
4452 EventStreamGetNextResponse: ::fidl_next::Encode<___E>,
4453{
4454 #[inline]
4455 fn encode_option(
4456 this: Option<&mut Self>,
4457 encoder: &mut ___E,
4458 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4459 ) -> Result<(), ::fidl_next::EncodeError> {
4460 if let Some(inner) = this {
4461 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4462 ::fidl_next::WireBox::encode_present(out);
4463 } else {
4464 ::fidl_next::WireBox::encode_absent(out);
4465 }
4466
4467 Ok(())
4468 }
4469}
4470
4471impl ::fidl_next::TakeFrom<WireEventStreamGetNextResponse> for EventStreamGetNextResponse {
4472 #[inline]
4473 fn take_from(from: &WireEventStreamGetNextResponse) -> Self {
4474 Self { events: ::fidl_next::TakeFrom::take_from(&from.events) }
4475 }
4476}
4477
4478#[derive(Debug)]
4480#[repr(C)]
4481pub struct WireEventStreamGetNextResponse {
4482 pub events: ::fidl_next::WireVector<crate::WireEvent>,
4483}
4484
4485unsafe impl ::fidl_next::ZeroPadding for WireEventStreamGetNextResponse {
4486 #[inline]
4487 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4488}
4489
4490unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventStreamGetNextResponse
4491where
4492 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4493
4494 ___D: ::fidl_next::Decoder,
4495
4496 ___D: ::fidl_next::fuchsia::HandleDecoder,
4497{
4498 fn decode(
4499 slot: ::fidl_next::Slot<'_, Self>,
4500 decoder: &mut ___D,
4501 ) -> Result<(), ::fidl_next::DecodeError> {
4502 ::fidl_next::munge! {
4503 let Self {
4504 mut events,
4505
4506 } = slot;
4507 }
4508
4509 ::fidl_next::Decode::decode(events.as_mut(), decoder)?;
4510
4511 Ok(())
4512 }
4513}
4514
4515#[doc = " Listener for events on the component hierarchy.\n Can\'t be used outside of the platform.\n"]
4517#[derive(Debug)]
4518pub struct EventStream;
4519
4520impl ::fidl_next::Discoverable for EventStream {
4521 const PROTOCOL_NAME: &'static str = "event_stream";
4522}
4523
4524pub mod event_stream {
4525 pub mod prelude {
4526 pub use crate::{
4527 event_stream, EventStream, EventStreamClientHandler, EventStreamClientSender,
4528 EventStreamServerHandler, EventStreamServerSender,
4529 };
4530
4531 pub use crate::EventStreamGetNextResponse;
4532 }
4533
4534 pub struct GetNext;
4535
4536 impl ::fidl_next::Method for GetNext {
4537 const ORDINAL: u64 = 4549982840421936006;
4538
4539 type Protocol = crate::EventStream;
4540
4541 type Request = ();
4542
4543 type Response = crate::WireEventStreamGetNextResponse;
4544 }
4545
4546 pub struct WaitForReady;
4547
4548 impl ::fidl_next::Method for WaitForReady {
4549 const ORDINAL: u64 = 3545212058508387970;
4550
4551 type Protocol = crate::EventStream;
4552
4553 type Request = ();
4554
4555 type Response = ();
4556 }
4557}
4558
4559pub trait EventStreamClientSender {
4561 type Transport: ::fidl_next::Transport;
4562
4563 fn get_next(
4564 &self,
4565 ) -> Result<
4566 ::fidl_next::ResponseFuture<'_, Self::Transport, event_stream::GetNext>,
4567 ::fidl_next::EncodeError,
4568 >;
4569
4570 #[doc = " Returns immediately. Used to indicate that the FIDL connection\n completed. This is needed for non-static streams to verify\n that subscribe has completed before components are started.\n"]
4571 fn wait_for_ready(
4572 &self,
4573 ) -> Result<
4574 ::fidl_next::ResponseFuture<'_, Self::Transport, event_stream::WaitForReady>,
4575 ::fidl_next::EncodeError,
4576 >;
4577}
4578
4579impl<___T> EventStreamClientSender for ::fidl_next::ClientSender<___T, EventStream>
4580where
4581 ___T: ::fidl_next::Transport,
4582{
4583 type Transport = ___T;
4584
4585 fn get_next(
4586 &self,
4587 ) -> Result<
4588 ::fidl_next::ResponseFuture<'_, Self::Transport, event_stream::GetNext>,
4589 ::fidl_next::EncodeError,
4590 > {
4591 self.as_untyped()
4592 .send_two_way(4549982840421936006, &mut ())
4593 .map(::fidl_next::ResponseFuture::from_untyped)
4594 }
4595
4596 #[doc = " Returns immediately. Used to indicate that the FIDL connection\n completed. This is needed for non-static streams to verify\n that subscribe has completed before components are started.\n"]
4597 fn wait_for_ready(
4598 &self,
4599 ) -> Result<
4600 ::fidl_next::ResponseFuture<'_, Self::Transport, event_stream::WaitForReady>,
4601 ::fidl_next::EncodeError,
4602 > {
4603 self.as_untyped()
4604 .send_two_way(3545212058508387970, &mut ())
4605 .map(::fidl_next::ResponseFuture::from_untyped)
4606 }
4607}
4608
4609pub trait EventStreamClientHandler<___T: ::fidl_next::Transport> {}
4613
4614impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for EventStream
4615where
4616 ___T: ::fidl_next::Transport,
4617 ___H: EventStreamClientHandler<___T>,
4618
4619 <event_stream::GetNext as ::fidl_next::Method>::Response:
4620 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
4621{
4622 fn on_event(
4623 handler: &mut ___H,
4624 sender: &::fidl_next::ClientSender<___T, Self>,
4625 ordinal: u64,
4626 buffer: ___T::RecvBuffer,
4627 ) {
4628 match ordinal {
4629 ordinal => {
4630 sender.close();
4631 }
4632 }
4633 }
4634}
4635
4636pub trait EventStreamServerSender {
4638 type Transport: ::fidl_next::Transport;
4639}
4640
4641impl<___T> EventStreamServerSender for ::fidl_next::ServerSender<___T, EventStream>
4642where
4643 ___T: ::fidl_next::Transport,
4644{
4645 type Transport = ___T;
4646}
4647
4648pub trait EventStreamServerHandler<___T: ::fidl_next::Transport> {
4652 fn get_next(
4653 &mut self,
4654 sender: &::fidl_next::ServerSender<___T, EventStream>,
4655
4656 responder: ::fidl_next::Responder<event_stream::GetNext>,
4657 );
4658
4659 #[doc = " Returns immediately. Used to indicate that the FIDL connection\n completed. This is needed for non-static streams to verify\n that subscribe has completed before components are started.\n"]
4660 fn wait_for_ready(
4661 &mut self,
4662 sender: &::fidl_next::ServerSender<___T, EventStream>,
4663
4664 responder: ::fidl_next::Responder<event_stream::WaitForReady>,
4665 );
4666}
4667
4668impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for EventStream
4669where
4670 ___T: ::fidl_next::Transport,
4671 ___H: EventStreamServerHandler<___T>,
4672{
4673 fn on_one_way(
4674 handler: &mut ___H,
4675 sender: &::fidl_next::ServerSender<___T, Self>,
4676 ordinal: u64,
4677 buffer: ___T::RecvBuffer,
4678 ) {
4679 match ordinal {
4680 ordinal => {
4681 sender.close();
4682 }
4683 }
4684 }
4685
4686 fn on_two_way(
4687 handler: &mut ___H,
4688 sender: &::fidl_next::ServerSender<___T, Self>,
4689 ordinal: u64,
4690 buffer: ___T::RecvBuffer,
4691 responder: ::fidl_next::protocol::Responder,
4692 ) {
4693 match ordinal {
4694 4549982840421936006 => {
4695 let responder = ::fidl_next::Responder::from_untyped(responder);
4696
4697 handler.get_next(sender, responder);
4698 }
4699
4700 3545212058508387970 => {
4701 let responder = ::fidl_next::Responder::from_untyped(responder);
4702
4703 handler.wait_for_ready(sender, responder);
4704 }
4705
4706 ordinal => {
4707 sender.close();
4708 }
4709 }
4710 }
4711}
4712
4713#[derive(Clone, Debug)]
4714pub struct ExecutionControllerOnStopRequest {
4715 pub stopped_payload: crate::StoppedPayload,
4716}
4717
4718impl ::fidl_next::Encodable for ExecutionControllerOnStopRequest {
4719 type Encoded = WireExecutionControllerOnStopRequest;
4720}
4721
4722unsafe impl<___E> ::fidl_next::Encode<___E> for ExecutionControllerOnStopRequest
4723where
4724 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4725
4726 ___E: ::fidl_next::Encoder,
4727{
4728 #[inline]
4729 fn encode(
4730 &mut self,
4731 encoder: &mut ___E,
4732 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4733 ) -> Result<(), ::fidl_next::EncodeError> {
4734 ::fidl_next::munge! {
4735 let Self::Encoded {
4736 stopped_payload,
4737
4738 } = out;
4739 }
4740
4741 ::fidl_next::Encode::encode(&mut self.stopped_payload, encoder, stopped_payload)?;
4742
4743 Ok(())
4744 }
4745}
4746
4747impl ::fidl_next::EncodableOption for Box<ExecutionControllerOnStopRequest> {
4748 type EncodedOption = ::fidl_next::WireBox<WireExecutionControllerOnStopRequest>;
4749}
4750
4751unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ExecutionControllerOnStopRequest>
4752where
4753 ___E: ::fidl_next::Encoder + ?Sized,
4754 ExecutionControllerOnStopRequest: ::fidl_next::Encode<___E>,
4755{
4756 #[inline]
4757 fn encode_option(
4758 this: Option<&mut Self>,
4759 encoder: &mut ___E,
4760 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4761 ) -> Result<(), ::fidl_next::EncodeError> {
4762 if let Some(inner) = this {
4763 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4764 ::fidl_next::WireBox::encode_present(out);
4765 } else {
4766 ::fidl_next::WireBox::encode_absent(out);
4767 }
4768
4769 Ok(())
4770 }
4771}
4772
4773impl ::fidl_next::TakeFrom<WireExecutionControllerOnStopRequest>
4774 for ExecutionControllerOnStopRequest
4775{
4776 #[inline]
4777 fn take_from(from: &WireExecutionControllerOnStopRequest) -> Self {
4778 Self { stopped_payload: ::fidl_next::TakeFrom::take_from(&from.stopped_payload) }
4779 }
4780}
4781
4782#[derive(Debug)]
4784#[repr(C)]
4785pub struct WireExecutionControllerOnStopRequest {
4786 pub stopped_payload: crate::WireStoppedPayload,
4787}
4788
4789unsafe impl ::fidl_next::ZeroPadding for WireExecutionControllerOnStopRequest {
4790 #[inline]
4791 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4792}
4793
4794unsafe impl<___D> ::fidl_next::Decode<___D> for WireExecutionControllerOnStopRequest
4795where
4796 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4797
4798 ___D: ::fidl_next::Decoder,
4799{
4800 fn decode(
4801 slot: ::fidl_next::Slot<'_, Self>,
4802 decoder: &mut ___D,
4803 ) -> Result<(), ::fidl_next::DecodeError> {
4804 ::fidl_next::munge! {
4805 let Self {
4806 mut stopped_payload,
4807
4808 } = slot;
4809 }
4810
4811 ::fidl_next::Decode::decode(stopped_payload.as_mut(), decoder)?;
4812
4813 Ok(())
4814 }
4815}
4816
4817#[derive(Debug)]
4819pub struct ExecutionController;
4820
4821pub mod execution_controller {
4822 pub mod prelude {
4823 pub use crate::{
4824 execution_controller, ExecutionController, ExecutionControllerClientHandler,
4825 ExecutionControllerClientSender, ExecutionControllerServerHandler,
4826 ExecutionControllerServerSender,
4827 };
4828
4829 pub use crate::ExecutionControllerOnStopRequest;
4830 }
4831
4832 pub struct Stop;
4833
4834 impl ::fidl_next::Method for Stop {
4835 const ORDINAL: u64 = 6256129817234858263;
4836
4837 type Protocol = crate::ExecutionController;
4838
4839 type Request = ();
4840
4841 type Response = ::fidl_next::Never;
4842 }
4843
4844 pub struct OnStop;
4845
4846 impl ::fidl_next::Method for OnStop {
4847 const ORDINAL: u64 = 7121600095714604415;
4848
4849 type Protocol = crate::ExecutionController;
4850
4851 type Request = ::fidl_next::Never;
4852
4853 type Response = crate::WireExecutionControllerOnStopRequest;
4854 }
4855}
4856
4857pub trait ExecutionControllerClientSender {
4859 type Transport: ::fidl_next::Transport;
4860
4861 #[doc = " Initiates a stop action on this component. Once complete, OnStop will be\n called with the stopped payload and this channel is closed.\n\n Note that a component may stop running on its own at any time, so it is\n possible for `OnStop` to be received before `Stop` is called.\n"]
4862 fn stop(
4863 &self,
4864 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
4865}
4866
4867impl<___T> ExecutionControllerClientSender for ::fidl_next::ClientSender<___T, ExecutionController>
4868where
4869 ___T: ::fidl_next::Transport,
4870{
4871 type Transport = ___T;
4872
4873 #[doc = " Initiates a stop action on this component. Once complete, OnStop will be\n called with the stopped payload and this channel is closed.\n\n Note that a component may stop running on its own at any time, so it is\n possible for `OnStop` to be received before `Stop` is called.\n"]
4874 fn stop(
4875 &self,
4876 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
4877 self.as_untyped().send_one_way(6256129817234858263, &mut ())
4878 }
4879}
4880
4881pub trait ExecutionControllerClientHandler<___T: ::fidl_next::Transport> {
4885 #[doc = " When the child is stopped due to `Stop` being called, the child exiting\n on its own, or for any other reason, `OnStop` is called and then this\n channel is closed.\n"]
4886 fn on_stop(
4887 &mut self,
4888 sender: &::fidl_next::ClientSender<___T, ExecutionController>,
4889
4890 message: ::fidl_next::ResponseBuffer<___T, execution_controller::OnStop>,
4891 );
4892
4893 fn on_unknown_interaction(
4894 &mut self,
4895 sender: &::fidl_next::ClientSender<___T, ExecutionController>,
4896 ordinal: u64,
4897 ) {
4898 sender.close();
4899 }
4900}
4901
4902impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for ExecutionController
4903where
4904 ___T: ::fidl_next::Transport,
4905 ___H: ExecutionControllerClientHandler<___T>,
4906
4907 <execution_controller::OnStop as ::fidl_next::Method>::Response:
4908 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
4909{
4910 fn on_event(
4911 handler: &mut ___H,
4912 sender: &::fidl_next::ClientSender<___T, Self>,
4913 ordinal: u64,
4914 buffer: ___T::RecvBuffer,
4915 ) {
4916 match ordinal {
4917 7121600095714604415 => {
4918 let buffer = ::fidl_next::ResponseBuffer::from_untyped(buffer);
4919 handler.on_stop(sender, buffer);
4920 }
4921
4922 ordinal => handler.on_unknown_interaction(sender, ordinal),
4923 }
4924 }
4925}
4926
4927pub trait ExecutionControllerServerSender {
4929 type Transport: ::fidl_next::Transport;
4930
4931 #[doc = " When the child is stopped due to `Stop` being called, the child exiting\n on its own, or for any other reason, `OnStop` is called and then this\n channel is closed.\n"]
4932
4933 fn on_stop<___R>(
4934 &self,
4935 request: &mut ___R,
4936 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
4937 where
4938 ___R: ::fidl_next::Encode<
4939 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
4940 Encoded = <execution_controller::OnStop as ::fidl_next::Method>::Response,
4941 >;
4942}
4943
4944impl<___T> ExecutionControllerServerSender for ::fidl_next::ServerSender<___T, ExecutionController>
4945where
4946 ___T: ::fidl_next::Transport,
4947{
4948 type Transport = ___T;
4949
4950 #[doc = " When the child is stopped due to `Stop` being called, the child exiting\n on its own, or for any other reason, `OnStop` is called and then this\n channel is closed.\n"]
4951
4952 fn on_stop<___R>(
4953 &self,
4954 request: &mut ___R,
4955 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
4956 where
4957 ___R: ::fidl_next::Encode<
4958 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
4959 Encoded = <execution_controller::OnStop as ::fidl_next::Method>::Response,
4960 >,
4961 {
4962 self.as_untyped().send_event(7121600095714604415, request)
4963 }
4964}
4965
4966pub trait ExecutionControllerServerHandler<___T: ::fidl_next::Transport> {
4970 #[doc = " Initiates a stop action on this component. Once complete, OnStop will be\n called with the stopped payload and this channel is closed.\n\n Note that a component may stop running on its own at any time, so it is\n possible for `OnStop` to be received before `Stop` is called.\n"]
4971 fn stop(&mut self, sender: &::fidl_next::ServerSender<___T, ExecutionController>);
4972
4973 fn on_unknown_interaction(
4974 &mut self,
4975 sender: &::fidl_next::ServerSender<___T, ExecutionController>,
4976 ordinal: u64,
4977 ) {
4978 sender.close();
4979 }
4980}
4981
4982impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for ExecutionController
4983where
4984 ___T: ::fidl_next::Transport,
4985 ___H: ExecutionControllerServerHandler<___T>,
4986{
4987 fn on_one_way(
4988 handler: &mut ___H,
4989 sender: &::fidl_next::ServerSender<___T, Self>,
4990 ordinal: u64,
4991 buffer: ___T::RecvBuffer,
4992 ) {
4993 match ordinal {
4994 6256129817234858263 => {
4995 handler.stop(sender);
4996 }
4997
4998 ordinal => handler.on_unknown_interaction(sender, ordinal),
4999 }
5000 }
5001
5002 fn on_two_way(
5003 handler: &mut ___H,
5004 sender: &::fidl_next::ServerSender<___T, Self>,
5005 ordinal: u64,
5006 buffer: ___T::RecvBuffer,
5007 responder: ::fidl_next::protocol::Responder,
5008 ) {
5009 match ordinal {
5010 ordinal => handler.on_unknown_interaction(sender, ordinal),
5011 }
5012 }
5013}
5014
5015#[derive(Debug)]
5016#[repr(C)]
5017pub struct IntrospectorGetMonikerRequest {
5018 pub component_instance: ::fidl_next::fuchsia::zx::Handle,
5019}
5020
5021impl ::fidl_next::Encodable for IntrospectorGetMonikerRequest {
5022 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
5023 ::fidl_next::CopyOptimization::enable_if(
5024 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
5025 .is_enabled(),
5026 )
5027 };
5028
5029 type Encoded = WireIntrospectorGetMonikerRequest;
5030}
5031
5032unsafe impl<___E> ::fidl_next::Encode<___E> for IntrospectorGetMonikerRequest
5033where
5034 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5035
5036 ___E: ::fidl_next::fuchsia::HandleEncoder,
5037{
5038 #[inline]
5039 fn encode(
5040 &mut self,
5041 encoder: &mut ___E,
5042 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5043 ) -> Result<(), ::fidl_next::EncodeError> {
5044 ::fidl_next::munge! {
5045 let Self::Encoded {
5046 component_instance,
5047
5048 } = out;
5049 }
5050
5051 ::fidl_next::Encode::encode(&mut self.component_instance, encoder, component_instance)?;
5052
5053 Ok(())
5054 }
5055}
5056
5057impl ::fidl_next::EncodableOption for Box<IntrospectorGetMonikerRequest> {
5058 type EncodedOption = ::fidl_next::WireBox<WireIntrospectorGetMonikerRequest>;
5059}
5060
5061unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<IntrospectorGetMonikerRequest>
5062where
5063 ___E: ::fidl_next::Encoder + ?Sized,
5064 IntrospectorGetMonikerRequest: ::fidl_next::Encode<___E>,
5065{
5066 #[inline]
5067 fn encode_option(
5068 this: Option<&mut Self>,
5069 encoder: &mut ___E,
5070 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5071 ) -> Result<(), ::fidl_next::EncodeError> {
5072 if let Some(inner) = this {
5073 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5074 ::fidl_next::WireBox::encode_present(out);
5075 } else {
5076 ::fidl_next::WireBox::encode_absent(out);
5077 }
5078
5079 Ok(())
5080 }
5081}
5082
5083impl ::fidl_next::TakeFrom<WireIntrospectorGetMonikerRequest> for IntrospectorGetMonikerRequest {
5084 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
5085 ::fidl_next::CopyOptimization::enable_if(
5086 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
5087 .is_enabled(),
5088 )
5089 };
5090
5091 #[inline]
5092 fn take_from(from: &WireIntrospectorGetMonikerRequest) -> Self {
5093 Self { component_instance: ::fidl_next::TakeFrom::take_from(&from.component_instance) }
5094 }
5095}
5096
5097#[derive(Debug)]
5099#[repr(C)]
5100pub struct WireIntrospectorGetMonikerRequest {
5101 pub component_instance: ::fidl_next::fuchsia::WireHandle,
5102}
5103
5104unsafe impl ::fidl_next::ZeroPadding for WireIntrospectorGetMonikerRequest {
5105 #[inline]
5106 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5107}
5108
5109unsafe impl<___D> ::fidl_next::Decode<___D> for WireIntrospectorGetMonikerRequest
5110where
5111 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5112
5113 ___D: ::fidl_next::fuchsia::HandleDecoder,
5114{
5115 fn decode(
5116 slot: ::fidl_next::Slot<'_, Self>,
5117 decoder: &mut ___D,
5118 ) -> Result<(), ::fidl_next::DecodeError> {
5119 ::fidl_next::munge! {
5120 let Self {
5121 mut component_instance,
5122
5123 } = slot;
5124 }
5125
5126 ::fidl_next::Decode::decode(component_instance.as_mut(), decoder)?;
5127
5128 Ok(())
5129 }
5130}
5131
5132#[derive(Clone, Debug)]
5133pub struct IntrospectorGetMonikerResponse {
5134 pub moniker: String,
5135}
5136
5137impl ::fidl_next::Encodable for IntrospectorGetMonikerResponse {
5138 type Encoded = WireIntrospectorGetMonikerResponse;
5139}
5140
5141unsafe impl<___E> ::fidl_next::Encode<___E> for IntrospectorGetMonikerResponse
5142where
5143 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5144
5145 ___E: ::fidl_next::Encoder,
5146{
5147 #[inline]
5148 fn encode(
5149 &mut self,
5150 encoder: &mut ___E,
5151 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5152 ) -> Result<(), ::fidl_next::EncodeError> {
5153 ::fidl_next::munge! {
5154 let Self::Encoded {
5155 moniker,
5156
5157 } = out;
5158 }
5159
5160 ::fidl_next::Encode::encode(&mut self.moniker, encoder, moniker)?;
5161
5162 Ok(())
5163 }
5164}
5165
5166impl ::fidl_next::EncodableOption for Box<IntrospectorGetMonikerResponse> {
5167 type EncodedOption = ::fidl_next::WireBox<WireIntrospectorGetMonikerResponse>;
5168}
5169
5170unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<IntrospectorGetMonikerResponse>
5171where
5172 ___E: ::fidl_next::Encoder + ?Sized,
5173 IntrospectorGetMonikerResponse: ::fidl_next::Encode<___E>,
5174{
5175 #[inline]
5176 fn encode_option(
5177 this: Option<&mut Self>,
5178 encoder: &mut ___E,
5179 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5180 ) -> Result<(), ::fidl_next::EncodeError> {
5181 if let Some(inner) = this {
5182 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5183 ::fidl_next::WireBox::encode_present(out);
5184 } else {
5185 ::fidl_next::WireBox::encode_absent(out);
5186 }
5187
5188 Ok(())
5189 }
5190}
5191
5192impl ::fidl_next::TakeFrom<WireIntrospectorGetMonikerResponse> for IntrospectorGetMonikerResponse {
5193 #[inline]
5194 fn take_from(from: &WireIntrospectorGetMonikerResponse) -> Self {
5195 Self { moniker: ::fidl_next::TakeFrom::take_from(&from.moniker) }
5196 }
5197}
5198
5199#[derive(Debug)]
5201#[repr(C)]
5202pub struct WireIntrospectorGetMonikerResponse {
5203 pub moniker: ::fidl_next::WireString,
5204}
5205
5206unsafe impl ::fidl_next::ZeroPadding for WireIntrospectorGetMonikerResponse {
5207 #[inline]
5208 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5209}
5210
5211unsafe impl<___D> ::fidl_next::Decode<___D> for WireIntrospectorGetMonikerResponse
5212where
5213 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5214
5215 ___D: ::fidl_next::Decoder,
5216{
5217 fn decode(
5218 slot: ::fidl_next::Slot<'_, Self>,
5219 decoder: &mut ___D,
5220 ) -> Result<(), ::fidl_next::DecodeError> {
5221 ::fidl_next::munge! {
5222 let Self {
5223 mut moniker,
5224
5225 } = slot;
5226 }
5227
5228 ::fidl_next::Decode::decode(moniker.as_mut(), decoder)?;
5229
5230 let moniker = unsafe { moniker.deref_unchecked() };
5231
5232 if moniker.len() > 4096 {
5233 return Err(::fidl_next::DecodeError::VectorTooLong {
5234 size: moniker.len() as u64,
5235 limit: 4096,
5236 });
5237 }
5238
5239 Ok(())
5240 }
5241}
5242
5243#[doc = " A protocol used by a component instance to obtain information about\n components in its own realm.\n\n This protocol only supports getting the moniker at the moment but could\n expand to other privileged information such as the URL of a component.\n\n The component framework provides this capability to components that use\n `fuchsia.component.Introspector` from framework.\n"]
5245#[derive(Debug)]
5246pub struct Introspector;
5247
5248impl ::fidl_next::Discoverable for Introspector {
5249 const PROTOCOL_NAME: &'static str = "introspector";
5250}
5251
5252pub mod introspector {
5253 pub mod prelude {
5254 pub use crate::{
5255 introspector, Introspector, IntrospectorClientHandler, IntrospectorClientSender,
5256 IntrospectorServerHandler, IntrospectorServerSender,
5257 };
5258
5259 pub use crate::Error;
5260
5261 pub use crate::IntrospectorGetMonikerRequest;
5262
5263 pub use crate::IntrospectorGetMonikerResponse;
5264 }
5265
5266 pub struct GetMoniker;
5267
5268 impl ::fidl_next::Method for GetMoniker {
5269 const ORDINAL: u64 = 214344082539672664;
5270
5271 type Protocol = crate::Introspector;
5272
5273 type Request = crate::WireIntrospectorGetMonikerRequest;
5274
5275 type Response = ::fidl_next::WireFlexibleResult<
5276 crate::WireIntrospectorGetMonikerResponse,
5277 crate::WireError,
5278 >;
5279 }
5280}
5281
5282pub trait IntrospectorClientSender {
5284 type Transport: ::fidl_next::Transport;
5285
5286 #[doc = " Obtains the moniker relative to this realm of the component\n corresponding to the provided token. Runners may obtain the token via\n `fuchsia.component.runner/ComponentStartInfo.component_instance`.\n\n Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or\n does not correspond to a component under this realm.\n"]
5287 fn get_moniker<___R>(
5288 &self,
5289 request: &mut ___R,
5290 ) -> Result<
5291 ::fidl_next::ResponseFuture<'_, Self::Transport, introspector::GetMoniker>,
5292 ::fidl_next::EncodeError,
5293 >
5294 where
5295 ___R: ::fidl_next::Encode<
5296 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
5297 Encoded = crate::WireIntrospectorGetMonikerRequest,
5298 >;
5299}
5300
5301impl<___T> IntrospectorClientSender for ::fidl_next::ClientSender<___T, Introspector>
5302where
5303 ___T: ::fidl_next::Transport,
5304{
5305 type Transport = ___T;
5306
5307 #[doc = " Obtains the moniker relative to this realm of the component\n corresponding to the provided token. Runners may obtain the token via\n `fuchsia.component.runner/ComponentStartInfo.component_instance`.\n\n Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or\n does not correspond to a component under this realm.\n"]
5308 fn get_moniker<___R>(
5309 &self,
5310 request: &mut ___R,
5311 ) -> Result<
5312 ::fidl_next::ResponseFuture<'_, Self::Transport, introspector::GetMoniker>,
5313 ::fidl_next::EncodeError,
5314 >
5315 where
5316 ___R: ::fidl_next::Encode<
5317 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
5318 Encoded = crate::WireIntrospectorGetMonikerRequest,
5319 >,
5320 {
5321 self.as_untyped()
5322 .send_two_way(214344082539672664, request)
5323 .map(::fidl_next::ResponseFuture::from_untyped)
5324 }
5325}
5326
5327pub trait IntrospectorClientHandler<___T: ::fidl_next::Transport> {
5331 fn on_unknown_interaction(
5332 &mut self,
5333 sender: &::fidl_next::ClientSender<___T, Introspector>,
5334 ordinal: u64,
5335 ) {
5336 sender.close();
5337 }
5338}
5339
5340impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Introspector
5341where
5342 ___T: ::fidl_next::Transport,
5343 ___H: IntrospectorClientHandler<___T>,
5344
5345 <introspector::GetMoniker as ::fidl_next::Method>::Response:
5346 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
5347{
5348 fn on_event(
5349 handler: &mut ___H,
5350 sender: &::fidl_next::ClientSender<___T, Self>,
5351 ordinal: u64,
5352 buffer: ___T::RecvBuffer,
5353 ) {
5354 match ordinal {
5355 ordinal => handler.on_unknown_interaction(sender, ordinal),
5356 }
5357 }
5358}
5359
5360pub trait IntrospectorServerSender {
5362 type Transport: ::fidl_next::Transport;
5363}
5364
5365impl<___T> IntrospectorServerSender for ::fidl_next::ServerSender<___T, Introspector>
5366where
5367 ___T: ::fidl_next::Transport,
5368{
5369 type Transport = ___T;
5370}
5371
5372pub trait IntrospectorServerHandler<___T: ::fidl_next::Transport> {
5376 #[doc = " Obtains the moniker relative to this realm of the component\n corresponding to the provided token. Runners may obtain the token via\n `fuchsia.component.runner/ComponentStartInfo.component_instance`.\n\n Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or\n does not correspond to a component under this realm.\n"]
5377 fn get_moniker(
5378 &mut self,
5379 sender: &::fidl_next::ServerSender<___T, Introspector>,
5380
5381 request: ::fidl_next::RequestBuffer<___T, introspector::GetMoniker>,
5382
5383 responder: ::fidl_next::Responder<introspector::GetMoniker>,
5384 );
5385
5386 fn on_unknown_interaction(
5387 &mut self,
5388 sender: &::fidl_next::ServerSender<___T, Introspector>,
5389 ordinal: u64,
5390 ) {
5391 sender.close();
5392 }
5393}
5394
5395impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Introspector
5396where
5397 ___T: ::fidl_next::Transport,
5398 ___H: IntrospectorServerHandler<___T>,
5399
5400 crate::WireIntrospectorGetMonikerRequest:
5401 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
5402{
5403 fn on_one_way(
5404 handler: &mut ___H,
5405 sender: &::fidl_next::ServerSender<___T, Self>,
5406 ordinal: u64,
5407 buffer: ___T::RecvBuffer,
5408 ) {
5409 match ordinal {
5410 ordinal => handler.on_unknown_interaction(sender, ordinal),
5411 }
5412 }
5413
5414 fn on_two_way(
5415 handler: &mut ___H,
5416 sender: &::fidl_next::ServerSender<___T, Self>,
5417 ordinal: u64,
5418 buffer: ___T::RecvBuffer,
5419 responder: ::fidl_next::protocol::Responder,
5420 ) {
5421 match ordinal {
5422 214344082539672664 => {
5423 let responder = ::fidl_next::Responder::from_untyped(responder);
5424
5425 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
5426 handler.get_moniker(sender, buffer, responder);
5427 }
5428
5429 ordinal => handler.on_unknown_interaction(sender, ordinal),
5430 }
5431 }
5432}
5433
5434#[doc = " The maximum string length of a capability ID.\n This value is currently set arbitrarily.\n"]
5435pub const MAX_CAPABILITY_ID_LENGTH: u64 = 50;
5436
5437pub const MAX_CHILD_NAME_LENGTH: u32 = 1024;
5438
5439#[doc = " The maximum string length of an error description.\n"]
5440pub const MAX_ERROR_DESCRIPTION_LENGTH: u64 = 100;
5441
5442#[doc = " The maximum number of events that a receiver can listen to.\n"]
5443pub const MAX_NUM_EVENTS_RECEIVED: u64 = 100;
5444
5445#[doc = " The maximum number of requests per event subscription.\n"]
5446pub const MAX_SUBSCRIPTION_REQUESTS: u32 = 2;
5447
5448pub const MAX_URL_SCHEME_LENGTH: u64 = 255;
5449
5450#[derive(Debug)]
5451pub struct NamespaceInputEntry {
5452 pub path: String,
5453
5454 pub dictionary: ::fidl_next::ClientEnd<
5455 ::fidl_next::fuchsia::zx::Channel,
5456 ::fidl_next_fuchsia_component_sandbox::Dictionary,
5457 >,
5458}
5459
5460impl ::fidl_next::Encodable for NamespaceInputEntry {
5461 type Encoded = WireNamespaceInputEntry;
5462}
5463
5464unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceInputEntry
5465where
5466 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5467
5468 ___E: ::fidl_next::Encoder,
5469
5470 ___E: ::fidl_next::fuchsia::HandleEncoder,
5471{
5472 #[inline]
5473 fn encode(
5474 &mut self,
5475 encoder: &mut ___E,
5476 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5477 ) -> Result<(), ::fidl_next::EncodeError> {
5478 ::fidl_next::munge! {
5479 let Self::Encoded {
5480 path,
5481 dictionary,
5482
5483 } = out;
5484 }
5485
5486 ::fidl_next::Encode::encode(&mut self.path, encoder, path)?;
5487
5488 ::fidl_next::Encode::encode(&mut self.dictionary, encoder, dictionary)?;
5489
5490 Ok(())
5491 }
5492}
5493
5494impl ::fidl_next::EncodableOption for Box<NamespaceInputEntry> {
5495 type EncodedOption = ::fidl_next::WireBox<WireNamespaceInputEntry>;
5496}
5497
5498unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NamespaceInputEntry>
5499where
5500 ___E: ::fidl_next::Encoder + ?Sized,
5501 NamespaceInputEntry: ::fidl_next::Encode<___E>,
5502{
5503 #[inline]
5504 fn encode_option(
5505 this: Option<&mut Self>,
5506 encoder: &mut ___E,
5507 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5508 ) -> Result<(), ::fidl_next::EncodeError> {
5509 if let Some(inner) = this {
5510 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5511 ::fidl_next::WireBox::encode_present(out);
5512 } else {
5513 ::fidl_next::WireBox::encode_absent(out);
5514 }
5515
5516 Ok(())
5517 }
5518}
5519
5520impl ::fidl_next::TakeFrom<WireNamespaceInputEntry> for NamespaceInputEntry {
5521 #[inline]
5522 fn take_from(from: &WireNamespaceInputEntry) -> Self {
5523 Self {
5524 path: ::fidl_next::TakeFrom::take_from(&from.path),
5525
5526 dictionary: ::fidl_next::TakeFrom::take_from(&from.dictionary),
5527 }
5528 }
5529}
5530
5531#[derive(Debug)]
5533#[repr(C)]
5534pub struct WireNamespaceInputEntry {
5535 pub path: ::fidl_next::WireString,
5536
5537 pub dictionary: ::fidl_next::ClientEnd<
5538 ::fidl_next::fuchsia::WireChannel,
5539 ::fidl_next_fuchsia_component_sandbox::Dictionary,
5540 >,
5541}
5542
5543unsafe impl ::fidl_next::ZeroPadding for WireNamespaceInputEntry {
5544 #[inline]
5545 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5546 unsafe {
5547 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
5548 }
5549 }
5550}
5551
5552unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceInputEntry
5553where
5554 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5555
5556 ___D: ::fidl_next::Decoder,
5557
5558 ___D: ::fidl_next::fuchsia::HandleDecoder,
5559{
5560 fn decode(
5561 slot: ::fidl_next::Slot<'_, Self>,
5562 decoder: &mut ___D,
5563 ) -> Result<(), ::fidl_next::DecodeError> {
5564 ::fidl_next::munge! {
5565 let Self {
5566 mut path,
5567 mut dictionary,
5568
5569 } = slot;
5570 }
5571
5572 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
5573
5574 let path = unsafe { path.deref_unchecked() };
5575
5576 if path.len() > 4095 {
5577 return Err(::fidl_next::DecodeError::VectorTooLong {
5578 size: path.len() as u64,
5579 limit: 4095,
5580 });
5581 }
5582
5583 ::fidl_next::Decode::decode(dictionary.as_mut(), decoder)?;
5584
5585 Ok(())
5586 }
5587}
5588
5589#[derive(Debug)]
5590pub struct NamespaceCreateRequest {
5591 pub entries: Vec<crate::NamespaceInputEntry>,
5592}
5593
5594impl ::fidl_next::Encodable for NamespaceCreateRequest {
5595 type Encoded = WireNamespaceCreateRequest;
5596}
5597
5598unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceCreateRequest
5599where
5600 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5601
5602 ___E: ::fidl_next::Encoder,
5603
5604 ___E: ::fidl_next::fuchsia::HandleEncoder,
5605{
5606 #[inline]
5607 fn encode(
5608 &mut self,
5609 encoder: &mut ___E,
5610 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5611 ) -> Result<(), ::fidl_next::EncodeError> {
5612 ::fidl_next::munge! {
5613 let Self::Encoded {
5614 entries,
5615
5616 } = out;
5617 }
5618
5619 ::fidl_next::Encode::encode(&mut self.entries, encoder, entries)?;
5620
5621 Ok(())
5622 }
5623}
5624
5625impl ::fidl_next::EncodableOption for Box<NamespaceCreateRequest> {
5626 type EncodedOption = ::fidl_next::WireBox<WireNamespaceCreateRequest>;
5627}
5628
5629unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NamespaceCreateRequest>
5630where
5631 ___E: ::fidl_next::Encoder + ?Sized,
5632 NamespaceCreateRequest: ::fidl_next::Encode<___E>,
5633{
5634 #[inline]
5635 fn encode_option(
5636 this: Option<&mut Self>,
5637 encoder: &mut ___E,
5638 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5639 ) -> Result<(), ::fidl_next::EncodeError> {
5640 if let Some(inner) = this {
5641 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5642 ::fidl_next::WireBox::encode_present(out);
5643 } else {
5644 ::fidl_next::WireBox::encode_absent(out);
5645 }
5646
5647 Ok(())
5648 }
5649}
5650
5651impl ::fidl_next::TakeFrom<WireNamespaceCreateRequest> for NamespaceCreateRequest {
5652 #[inline]
5653 fn take_from(from: &WireNamespaceCreateRequest) -> Self {
5654 Self { entries: ::fidl_next::TakeFrom::take_from(&from.entries) }
5655 }
5656}
5657
5658#[derive(Debug)]
5660#[repr(C)]
5661pub struct WireNamespaceCreateRequest {
5662 pub entries: ::fidl_next::WireVector<crate::WireNamespaceInputEntry>,
5663}
5664
5665unsafe impl ::fidl_next::ZeroPadding for WireNamespaceCreateRequest {
5666 #[inline]
5667 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5668}
5669
5670unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceCreateRequest
5671where
5672 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5673
5674 ___D: ::fidl_next::Decoder,
5675
5676 ___D: ::fidl_next::fuchsia::HandleDecoder,
5677{
5678 fn decode(
5679 slot: ::fidl_next::Slot<'_, Self>,
5680 decoder: &mut ___D,
5681 ) -> Result<(), ::fidl_next::DecodeError> {
5682 ::fidl_next::munge! {
5683 let Self {
5684 mut entries,
5685
5686 } = slot;
5687 }
5688
5689 ::fidl_next::Decode::decode(entries.as_mut(), decoder)?;
5690
5691 Ok(())
5692 }
5693}
5694
5695#[doc = " Error returned from methods in [`Namespace`].\n"]
5696#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5697#[repr(u32)]
5698pub enum NamespaceError {
5699 Shadow = 1,
5700 Duplicate = 2,
5701 Conversion = 3,
5702 BadEntry = 4,
5703 DictionaryRead = 5,
5704 UnknownOrdinal_(u32),
5705}
5706
5707impl ::fidl_next::Encodable for NamespaceError {
5708 type Encoded = WireNamespaceError;
5709}
5710
5711unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceError
5712where
5713 ___E: ?Sized,
5714{
5715 #[inline]
5716 fn encode(
5717 &mut self,
5718 _: &mut ___E,
5719 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5720 ) -> Result<(), ::fidl_next::EncodeError> {
5721 ::fidl_next::munge!(let WireNamespaceError { value } = out);
5722 let _ = value.write(::fidl_next::WireU32::from(match *self {
5723 Self::Shadow => 1,
5724
5725 Self::Duplicate => 2,
5726
5727 Self::Conversion => 3,
5728
5729 Self::BadEntry => 4,
5730
5731 Self::DictionaryRead => 5,
5732
5733 Self::UnknownOrdinal_(value) => value,
5734 }));
5735
5736 Ok(())
5737 }
5738}
5739
5740impl ::core::convert::From<WireNamespaceError> for NamespaceError {
5741 fn from(wire: WireNamespaceError) -> Self {
5742 match u32::from(wire.value) {
5743 1 => Self::Shadow,
5744
5745 2 => Self::Duplicate,
5746
5747 3 => Self::Conversion,
5748
5749 4 => Self::BadEntry,
5750
5751 5 => Self::DictionaryRead,
5752
5753 value => Self::UnknownOrdinal_(value),
5754 }
5755 }
5756}
5757
5758impl ::fidl_next::TakeFrom<WireNamespaceError> for NamespaceError {
5759 #[inline]
5760 fn take_from(from: &WireNamespaceError) -> Self {
5761 Self::from(*from)
5762 }
5763}
5764
5765#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5767#[repr(transparent)]
5768pub struct WireNamespaceError {
5769 value: ::fidl_next::WireU32,
5770}
5771
5772unsafe impl ::fidl_next::ZeroPadding for WireNamespaceError {
5773 #[inline]
5774 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5775 }
5777}
5778
5779impl WireNamespaceError {
5780 pub const SHADOW: WireNamespaceError = WireNamespaceError { value: ::fidl_next::WireU32(1) };
5781
5782 pub const DUPLICATE: WireNamespaceError = WireNamespaceError { value: ::fidl_next::WireU32(2) };
5783
5784 pub const CONVERSION: WireNamespaceError =
5785 WireNamespaceError { value: ::fidl_next::WireU32(3) };
5786
5787 pub const BAD_ENTRY: WireNamespaceError = WireNamespaceError { value: ::fidl_next::WireU32(4) };
5788
5789 pub const DICTIONARY_READ: WireNamespaceError =
5790 WireNamespaceError { value: ::fidl_next::WireU32(5) };
5791}
5792
5793unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceError
5794where
5795 ___D: ?Sized,
5796{
5797 fn decode(
5798 slot: ::fidl_next::Slot<'_, Self>,
5799 _: &mut ___D,
5800 ) -> Result<(), ::fidl_next::DecodeError> {
5801 Ok(())
5802 }
5803}
5804
5805impl ::core::convert::From<NamespaceError> for WireNamespaceError {
5806 fn from(natural: NamespaceError) -> Self {
5807 match natural {
5808 NamespaceError::Shadow => WireNamespaceError::SHADOW,
5809
5810 NamespaceError::Duplicate => WireNamespaceError::DUPLICATE,
5811
5812 NamespaceError::Conversion => WireNamespaceError::CONVERSION,
5813
5814 NamespaceError::BadEntry => WireNamespaceError::BAD_ENTRY,
5815
5816 NamespaceError::DictionaryRead => WireNamespaceError::DICTIONARY_READ,
5817
5818 NamespaceError::UnknownOrdinal_(value) => {
5819 WireNamespaceError { value: ::fidl_next::WireU32::from(value) }
5820 }
5821 }
5822 }
5823}
5824
5825#[derive(Debug)]
5826pub struct NamespaceCreateResponse {
5827 pub entries: Vec<crate::NamespaceEntry>,
5828}
5829
5830impl ::fidl_next::Encodable for NamespaceCreateResponse {
5831 type Encoded = WireNamespaceCreateResponse;
5832}
5833
5834unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceCreateResponse
5835where
5836 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5837
5838 ___E: ::fidl_next::Encoder,
5839
5840 ___E: ::fidl_next::fuchsia::HandleEncoder,
5841{
5842 #[inline]
5843 fn encode(
5844 &mut self,
5845 encoder: &mut ___E,
5846 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5847 ) -> Result<(), ::fidl_next::EncodeError> {
5848 ::fidl_next::munge! {
5849 let Self::Encoded {
5850 entries,
5851
5852 } = out;
5853 }
5854
5855 ::fidl_next::Encode::encode(&mut self.entries, encoder, entries)?;
5856
5857 Ok(())
5858 }
5859}
5860
5861impl ::fidl_next::EncodableOption for Box<NamespaceCreateResponse> {
5862 type EncodedOption = ::fidl_next::WireBox<WireNamespaceCreateResponse>;
5863}
5864
5865unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NamespaceCreateResponse>
5866where
5867 ___E: ::fidl_next::Encoder + ?Sized,
5868 NamespaceCreateResponse: ::fidl_next::Encode<___E>,
5869{
5870 #[inline]
5871 fn encode_option(
5872 this: Option<&mut Self>,
5873 encoder: &mut ___E,
5874 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5875 ) -> Result<(), ::fidl_next::EncodeError> {
5876 if let Some(inner) = this {
5877 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5878 ::fidl_next::WireBox::encode_present(out);
5879 } else {
5880 ::fidl_next::WireBox::encode_absent(out);
5881 }
5882
5883 Ok(())
5884 }
5885}
5886
5887impl ::fidl_next::TakeFrom<WireNamespaceCreateResponse> for NamespaceCreateResponse {
5888 #[inline]
5889 fn take_from(from: &WireNamespaceCreateResponse) -> Self {
5890 Self { entries: ::fidl_next::TakeFrom::take_from(&from.entries) }
5891 }
5892}
5893
5894#[derive(Debug)]
5896#[repr(C)]
5897pub struct WireNamespaceCreateResponse {
5898 pub entries: ::fidl_next::WireVector<crate::WireNamespaceEntry>,
5899}
5900
5901unsafe impl ::fidl_next::ZeroPadding for WireNamespaceCreateResponse {
5902 #[inline]
5903 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5904}
5905
5906unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceCreateResponse
5907where
5908 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5909
5910 ___D: ::fidl_next::Decoder,
5911
5912 ___D: ::fidl_next::fuchsia::HandleDecoder,
5913{
5914 fn decode(
5915 slot: ::fidl_next::Slot<'_, Self>,
5916 decoder: &mut ___D,
5917 ) -> Result<(), ::fidl_next::DecodeError> {
5918 ::fidl_next::munge! {
5919 let Self {
5920 mut entries,
5921
5922 } = slot;
5923 }
5924
5925 ::fidl_next::Decode::decode(entries.as_mut(), decoder)?;
5926
5927 Ok(())
5928 }
5929}
5930
5931#[doc = " Protocol for performing namespace operations.\n"]
5933#[derive(Debug)]
5934pub struct Namespace;
5935
5936impl ::fidl_next::Discoverable for Namespace {
5937 const PROTOCOL_NAME: &'static str = "namespace";
5938}
5939
5940pub mod namespace {
5941 pub mod prelude {
5942 pub use crate::{
5943 namespace, Namespace, NamespaceClientHandler, NamespaceClientSender,
5944 NamespaceServerHandler, NamespaceServerSender,
5945 };
5946
5947 pub use crate::NamespaceCreateRequest;
5948
5949 pub use crate::NamespaceError;
5950
5951 pub use crate::NamespaceCreateResponse;
5952 }
5953
5954 pub struct Create;
5955
5956 impl ::fidl_next::Method for Create {
5957 const ORDINAL: u64 = 4839678630846501113;
5958
5959 type Protocol = crate::Namespace;
5960
5961 type Request = crate::WireNamespaceCreateRequest;
5962
5963 type Response = ::fidl_next::WireFlexibleResult<
5964 crate::WireNamespaceCreateResponse,
5965 crate::WireNamespaceError,
5966 >;
5967 }
5968}
5969
5970pub trait NamespaceClientSender {
5972 type Transport: ::fidl_next::Transport;
5973
5974 fn create<___R>(
5975 &self,
5976 request: &mut ___R,
5977 ) -> Result<
5978 ::fidl_next::ResponseFuture<'_, Self::Transport, namespace::Create>,
5979 ::fidl_next::EncodeError,
5980 >
5981 where
5982 ___R: ::fidl_next::Encode<
5983 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
5984 Encoded = crate::WireNamespaceCreateRequest,
5985 >;
5986}
5987
5988impl<___T> NamespaceClientSender for ::fidl_next::ClientSender<___T, Namespace>
5989where
5990 ___T: ::fidl_next::Transport,
5991{
5992 type Transport = ___T;
5993
5994 fn create<___R>(
5995 &self,
5996 request: &mut ___R,
5997 ) -> Result<
5998 ::fidl_next::ResponseFuture<'_, Self::Transport, namespace::Create>,
5999 ::fidl_next::EncodeError,
6000 >
6001 where
6002 ___R: ::fidl_next::Encode<
6003 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6004 Encoded = crate::WireNamespaceCreateRequest,
6005 >,
6006 {
6007 self.as_untyped()
6008 .send_two_way(4839678630846501113, request)
6009 .map(::fidl_next::ResponseFuture::from_untyped)
6010 }
6011}
6012
6013pub trait NamespaceClientHandler<___T: ::fidl_next::Transport> {
6017 fn on_unknown_interaction(
6018 &mut self,
6019 sender: &::fidl_next::ClientSender<___T, Namespace>,
6020 ordinal: u64,
6021 ) {
6022 sender.close();
6023 }
6024}
6025
6026impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Namespace
6027where
6028 ___T: ::fidl_next::Transport,
6029 ___H: NamespaceClientHandler<___T>,
6030
6031 <namespace::Create as ::fidl_next::Method>::Response:
6032 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6033{
6034 fn on_event(
6035 handler: &mut ___H,
6036 sender: &::fidl_next::ClientSender<___T, Self>,
6037 ordinal: u64,
6038 buffer: ___T::RecvBuffer,
6039 ) {
6040 match ordinal {
6041 ordinal => handler.on_unknown_interaction(sender, ordinal),
6042 }
6043 }
6044}
6045
6046pub trait NamespaceServerSender {
6048 type Transport: ::fidl_next::Transport;
6049}
6050
6051impl<___T> NamespaceServerSender for ::fidl_next::ServerSender<___T, Namespace>
6052where
6053 ___T: ::fidl_next::Transport,
6054{
6055 type Transport = ___T;
6056}
6057
6058pub trait NamespaceServerHandler<___T: ::fidl_next::Transport> {
6062 fn create(
6063 &mut self,
6064 sender: &::fidl_next::ServerSender<___T, Namespace>,
6065
6066 request: ::fidl_next::RequestBuffer<___T, namespace::Create>,
6067
6068 responder: ::fidl_next::Responder<namespace::Create>,
6069 );
6070
6071 fn on_unknown_interaction(
6072 &mut self,
6073 sender: &::fidl_next::ServerSender<___T, Namespace>,
6074 ordinal: u64,
6075 ) {
6076 sender.close();
6077 }
6078}
6079
6080impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Namespace
6081where
6082 ___T: ::fidl_next::Transport,
6083 ___H: NamespaceServerHandler<___T>,
6084
6085 crate::WireNamespaceCreateRequest:
6086 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6087{
6088 fn on_one_way(
6089 handler: &mut ___H,
6090 sender: &::fidl_next::ServerSender<___T, Self>,
6091 ordinal: u64,
6092 buffer: ___T::RecvBuffer,
6093 ) {
6094 match ordinal {
6095 ordinal => handler.on_unknown_interaction(sender, ordinal),
6096 }
6097 }
6098
6099 fn on_two_way(
6100 handler: &mut ___H,
6101 sender: &::fidl_next::ServerSender<___T, Self>,
6102 ordinal: u64,
6103 buffer: ___T::RecvBuffer,
6104 responder: ::fidl_next::protocol::Responder,
6105 ) {
6106 match ordinal {
6107 4839678630846501113 => {
6108 let responder = ::fidl_next::Responder::from_untyped(responder);
6109
6110 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
6111 handler.create(sender, buffer, responder);
6112 }
6113
6114 ordinal => handler.on_unknown_interaction(sender, ordinal),
6115 }
6116 }
6117}
6118
6119pub type RealmOpenExposedDirResponse = ();
6120
6121pub type WireRealmOpenExposedDirResponse = ();
6123
6124pub type RealmCreateChildResponse = ();
6125
6126pub type WireRealmCreateChildResponse = ();
6128
6129#[derive(Clone, Debug)]
6130pub struct RealmDestroyChildRequest {
6131 pub child: ::fidl_next_fuchsia_component_decl::ChildRef,
6132}
6133
6134impl ::fidl_next::Encodable for RealmDestroyChildRequest {
6135 type Encoded = WireRealmDestroyChildRequest;
6136}
6137
6138unsafe impl<___E> ::fidl_next::Encode<___E> for RealmDestroyChildRequest
6139where
6140 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6141
6142 ___E: ::fidl_next::Encoder,
6143{
6144 #[inline]
6145 fn encode(
6146 &mut self,
6147 encoder: &mut ___E,
6148 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6149 ) -> Result<(), ::fidl_next::EncodeError> {
6150 ::fidl_next::munge! {
6151 let Self::Encoded {
6152 child,
6153
6154 } = out;
6155 }
6156
6157 ::fidl_next::Encode::encode(&mut self.child, encoder, child)?;
6158
6159 Ok(())
6160 }
6161}
6162
6163impl ::fidl_next::EncodableOption for Box<RealmDestroyChildRequest> {
6164 type EncodedOption = ::fidl_next::WireBox<WireRealmDestroyChildRequest>;
6165}
6166
6167unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<RealmDestroyChildRequest>
6168where
6169 ___E: ::fidl_next::Encoder + ?Sized,
6170 RealmDestroyChildRequest: ::fidl_next::Encode<___E>,
6171{
6172 #[inline]
6173 fn encode_option(
6174 this: Option<&mut Self>,
6175 encoder: &mut ___E,
6176 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6177 ) -> Result<(), ::fidl_next::EncodeError> {
6178 if let Some(inner) = this {
6179 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6180 ::fidl_next::WireBox::encode_present(out);
6181 } else {
6182 ::fidl_next::WireBox::encode_absent(out);
6183 }
6184
6185 Ok(())
6186 }
6187}
6188
6189impl ::fidl_next::TakeFrom<WireRealmDestroyChildRequest> for RealmDestroyChildRequest {
6190 #[inline]
6191 fn take_from(from: &WireRealmDestroyChildRequest) -> Self {
6192 Self { child: ::fidl_next::TakeFrom::take_from(&from.child) }
6193 }
6194}
6195
6196#[derive(Debug)]
6198#[repr(C)]
6199pub struct WireRealmDestroyChildRequest {
6200 pub child: ::fidl_next_fuchsia_component_decl::WireChildRef,
6201}
6202
6203unsafe impl ::fidl_next::ZeroPadding for WireRealmDestroyChildRequest {
6204 #[inline]
6205 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6206}
6207
6208unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmDestroyChildRequest
6209where
6210 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6211
6212 ___D: ::fidl_next::Decoder,
6213{
6214 fn decode(
6215 slot: ::fidl_next::Slot<'_, Self>,
6216 decoder: &mut ___D,
6217 ) -> Result<(), ::fidl_next::DecodeError> {
6218 ::fidl_next::munge! {
6219 let Self {
6220 mut child,
6221
6222 } = slot;
6223 }
6224
6225 ::fidl_next::Decode::decode(child.as_mut(), decoder)?;
6226
6227 Ok(())
6228 }
6229}
6230
6231pub type RealmDestroyChildResponse = ();
6232
6233pub type WireRealmDestroyChildResponse = ();
6235
6236#[derive(Debug)]
6237pub struct RealmListChildrenRequest {
6238 pub collection: ::fidl_next_fuchsia_component_decl::CollectionRef,
6239
6240 pub iter: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::ChildIterator>,
6241}
6242
6243impl ::fidl_next::Encodable for RealmListChildrenRequest {
6244 type Encoded = WireRealmListChildrenRequest;
6245}
6246
6247unsafe impl<___E> ::fidl_next::Encode<___E> for RealmListChildrenRequest
6248where
6249 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6250
6251 ___E: ::fidl_next::Encoder,
6252
6253 ___E: ::fidl_next::fuchsia::HandleEncoder,
6254{
6255 #[inline]
6256 fn encode(
6257 &mut self,
6258 encoder: &mut ___E,
6259 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6260 ) -> Result<(), ::fidl_next::EncodeError> {
6261 ::fidl_next::munge! {
6262 let Self::Encoded {
6263 collection,
6264 iter,
6265
6266 } = out;
6267 }
6268
6269 ::fidl_next::Encode::encode(&mut self.collection, encoder, collection)?;
6270
6271 ::fidl_next::Encode::encode(&mut self.iter, encoder, iter)?;
6272
6273 Ok(())
6274 }
6275}
6276
6277impl ::fidl_next::EncodableOption for Box<RealmListChildrenRequest> {
6278 type EncodedOption = ::fidl_next::WireBox<WireRealmListChildrenRequest>;
6279}
6280
6281unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<RealmListChildrenRequest>
6282where
6283 ___E: ::fidl_next::Encoder + ?Sized,
6284 RealmListChildrenRequest: ::fidl_next::Encode<___E>,
6285{
6286 #[inline]
6287 fn encode_option(
6288 this: Option<&mut Self>,
6289 encoder: &mut ___E,
6290 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6291 ) -> Result<(), ::fidl_next::EncodeError> {
6292 if let Some(inner) = this {
6293 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6294 ::fidl_next::WireBox::encode_present(out);
6295 } else {
6296 ::fidl_next::WireBox::encode_absent(out);
6297 }
6298
6299 Ok(())
6300 }
6301}
6302
6303impl ::fidl_next::TakeFrom<WireRealmListChildrenRequest> for RealmListChildrenRequest {
6304 #[inline]
6305 fn take_from(from: &WireRealmListChildrenRequest) -> Self {
6306 Self {
6307 collection: ::fidl_next::TakeFrom::take_from(&from.collection),
6308
6309 iter: ::fidl_next::TakeFrom::take_from(&from.iter),
6310 }
6311 }
6312}
6313
6314#[derive(Debug)]
6316#[repr(C)]
6317pub struct WireRealmListChildrenRequest {
6318 pub collection: ::fidl_next_fuchsia_component_decl::WireCollectionRef,
6319
6320 pub iter: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::ChildIterator>,
6321}
6322
6323unsafe impl ::fidl_next::ZeroPadding for WireRealmListChildrenRequest {
6324 #[inline]
6325 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6326 unsafe {
6327 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
6328 }
6329 }
6330}
6331
6332unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmListChildrenRequest
6333where
6334 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6335
6336 ___D: ::fidl_next::Decoder,
6337
6338 ___D: ::fidl_next::fuchsia::HandleDecoder,
6339{
6340 fn decode(
6341 slot: ::fidl_next::Slot<'_, Self>,
6342 decoder: &mut ___D,
6343 ) -> Result<(), ::fidl_next::DecodeError> {
6344 ::fidl_next::munge! {
6345 let Self {
6346 mut collection,
6347 mut iter,
6348
6349 } = slot;
6350 }
6351
6352 ::fidl_next::Decode::decode(collection.as_mut(), decoder)?;
6353
6354 ::fidl_next::Decode::decode(iter.as_mut(), decoder)?;
6355
6356 Ok(())
6357 }
6358}
6359
6360pub type RealmListChildrenResponse = ();
6361
6362pub type WireRealmListChildrenResponse = ();
6364
6365#[derive(Debug)]
6366pub struct RealmOpenControllerRequest {
6367 pub child: ::fidl_next_fuchsia_component_decl::ChildRef,
6368
6369 pub controller: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Controller>,
6370}
6371
6372impl ::fidl_next::Encodable for RealmOpenControllerRequest {
6373 type Encoded = WireRealmOpenControllerRequest;
6374}
6375
6376unsafe impl<___E> ::fidl_next::Encode<___E> for RealmOpenControllerRequest
6377where
6378 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6379
6380 ___E: ::fidl_next::Encoder,
6381
6382 ___E: ::fidl_next::fuchsia::HandleEncoder,
6383{
6384 #[inline]
6385 fn encode(
6386 &mut self,
6387 encoder: &mut ___E,
6388 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6389 ) -> Result<(), ::fidl_next::EncodeError> {
6390 ::fidl_next::munge! {
6391 let Self::Encoded {
6392 child,
6393 controller,
6394
6395 } = out;
6396 }
6397
6398 ::fidl_next::Encode::encode(&mut self.child, encoder, child)?;
6399
6400 ::fidl_next::Encode::encode(&mut self.controller, encoder, controller)?;
6401
6402 Ok(())
6403 }
6404}
6405
6406impl ::fidl_next::EncodableOption for Box<RealmOpenControllerRequest> {
6407 type EncodedOption = ::fidl_next::WireBox<WireRealmOpenControllerRequest>;
6408}
6409
6410unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<RealmOpenControllerRequest>
6411where
6412 ___E: ::fidl_next::Encoder + ?Sized,
6413 RealmOpenControllerRequest: ::fidl_next::Encode<___E>,
6414{
6415 #[inline]
6416 fn encode_option(
6417 this: Option<&mut Self>,
6418 encoder: &mut ___E,
6419 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6420 ) -> Result<(), ::fidl_next::EncodeError> {
6421 if let Some(inner) = this {
6422 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6423 ::fidl_next::WireBox::encode_present(out);
6424 } else {
6425 ::fidl_next::WireBox::encode_absent(out);
6426 }
6427
6428 Ok(())
6429 }
6430}
6431
6432impl ::fidl_next::TakeFrom<WireRealmOpenControllerRequest> for RealmOpenControllerRequest {
6433 #[inline]
6434 fn take_from(from: &WireRealmOpenControllerRequest) -> Self {
6435 Self {
6436 child: ::fidl_next::TakeFrom::take_from(&from.child),
6437
6438 controller: ::fidl_next::TakeFrom::take_from(&from.controller),
6439 }
6440 }
6441}
6442
6443#[derive(Debug)]
6445#[repr(C)]
6446pub struct WireRealmOpenControllerRequest {
6447 pub child: ::fidl_next_fuchsia_component_decl::WireChildRef,
6448
6449 pub controller: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Controller>,
6450}
6451
6452unsafe impl ::fidl_next::ZeroPadding for WireRealmOpenControllerRequest {
6453 #[inline]
6454 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6455 unsafe {
6456 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
6457 }
6458 }
6459}
6460
6461unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmOpenControllerRequest
6462where
6463 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6464
6465 ___D: ::fidl_next::Decoder,
6466
6467 ___D: ::fidl_next::fuchsia::HandleDecoder,
6468{
6469 fn decode(
6470 slot: ::fidl_next::Slot<'_, Self>,
6471 decoder: &mut ___D,
6472 ) -> Result<(), ::fidl_next::DecodeError> {
6473 ::fidl_next::munge! {
6474 let Self {
6475 mut child,
6476 mut controller,
6477
6478 } = slot;
6479 }
6480
6481 ::fidl_next::Decode::decode(child.as_mut(), decoder)?;
6482
6483 ::fidl_next::Decode::decode(controller.as_mut(), decoder)?;
6484
6485 Ok(())
6486 }
6487}
6488
6489pub type RealmOpenControllerResponse = ();
6490
6491pub type WireRealmOpenControllerResponse = ();
6493
6494#[derive(Debug)]
6495pub struct RealmOpenExposedDirRequest {
6496 pub child: ::fidl_next_fuchsia_component_decl::ChildRef,
6497
6498 pub exposed_dir: ::fidl_next::ServerEnd<
6499 ::fidl_next::fuchsia::zx::Channel,
6500 ::fidl_next_fuchsia_io::Directory,
6501 >,
6502}
6503
6504impl ::fidl_next::Encodable for RealmOpenExposedDirRequest {
6505 type Encoded = WireRealmOpenExposedDirRequest;
6506}
6507
6508unsafe impl<___E> ::fidl_next::Encode<___E> for RealmOpenExposedDirRequest
6509where
6510 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6511
6512 ___E: ::fidl_next::Encoder,
6513
6514 ___E: ::fidl_next::fuchsia::HandleEncoder,
6515{
6516 #[inline]
6517 fn encode(
6518 &mut self,
6519 encoder: &mut ___E,
6520 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6521 ) -> Result<(), ::fidl_next::EncodeError> {
6522 ::fidl_next::munge! {
6523 let Self::Encoded {
6524 child,
6525 exposed_dir,
6526
6527 } = out;
6528 }
6529
6530 ::fidl_next::Encode::encode(&mut self.child, encoder, child)?;
6531
6532 ::fidl_next::Encode::encode(&mut self.exposed_dir, encoder, exposed_dir)?;
6533
6534 Ok(())
6535 }
6536}
6537
6538impl ::fidl_next::EncodableOption for Box<RealmOpenExposedDirRequest> {
6539 type EncodedOption = ::fidl_next::WireBox<WireRealmOpenExposedDirRequest>;
6540}
6541
6542unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<RealmOpenExposedDirRequest>
6543where
6544 ___E: ::fidl_next::Encoder + ?Sized,
6545 RealmOpenExposedDirRequest: ::fidl_next::Encode<___E>,
6546{
6547 #[inline]
6548 fn encode_option(
6549 this: Option<&mut Self>,
6550 encoder: &mut ___E,
6551 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6552 ) -> Result<(), ::fidl_next::EncodeError> {
6553 if let Some(inner) = this {
6554 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6555 ::fidl_next::WireBox::encode_present(out);
6556 } else {
6557 ::fidl_next::WireBox::encode_absent(out);
6558 }
6559
6560 Ok(())
6561 }
6562}
6563
6564impl ::fidl_next::TakeFrom<WireRealmOpenExposedDirRequest> for RealmOpenExposedDirRequest {
6565 #[inline]
6566 fn take_from(from: &WireRealmOpenExposedDirRequest) -> Self {
6567 Self {
6568 child: ::fidl_next::TakeFrom::take_from(&from.child),
6569
6570 exposed_dir: ::fidl_next::TakeFrom::take_from(&from.exposed_dir),
6571 }
6572 }
6573}
6574
6575#[derive(Debug)]
6577#[repr(C)]
6578pub struct WireRealmOpenExposedDirRequest {
6579 pub child: ::fidl_next_fuchsia_component_decl::WireChildRef,
6580
6581 pub exposed_dir: ::fidl_next::ServerEnd<
6582 ::fidl_next::fuchsia::WireChannel,
6583 ::fidl_next_fuchsia_io::Directory,
6584 >,
6585}
6586
6587unsafe impl ::fidl_next::ZeroPadding for WireRealmOpenExposedDirRequest {
6588 #[inline]
6589 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6590 unsafe {
6591 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
6592 }
6593 }
6594}
6595
6596unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmOpenExposedDirRequest
6597where
6598 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6599
6600 ___D: ::fidl_next::Decoder,
6601
6602 ___D: ::fidl_next::fuchsia::HandleDecoder,
6603{
6604 fn decode(
6605 slot: ::fidl_next::Slot<'_, Self>,
6606 decoder: &mut ___D,
6607 ) -> Result<(), ::fidl_next::DecodeError> {
6608 ::fidl_next::munge! {
6609 let Self {
6610 mut child,
6611 mut exposed_dir,
6612
6613 } = slot;
6614 }
6615
6616 ::fidl_next::Decode::decode(child.as_mut(), decoder)?;
6617
6618 ::fidl_next::Decode::decode(exposed_dir.as_mut(), decoder)?;
6619
6620 Ok(())
6621 }
6622}
6623
6624#[derive(Debug)]
6625pub struct RealmCreateChildRequest {
6626 pub collection: ::fidl_next_fuchsia_component_decl::CollectionRef,
6627
6628 pub decl: ::fidl_next_fuchsia_component_decl::Child,
6629
6630 pub args: crate::CreateChildArgs,
6631}
6632
6633impl ::fidl_next::Encodable for RealmCreateChildRequest {
6634 type Encoded = WireRealmCreateChildRequest;
6635}
6636
6637unsafe impl<___E> ::fidl_next::Encode<___E> for RealmCreateChildRequest
6638where
6639 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6640
6641 ___E: ::fidl_next::Encoder,
6642
6643 ___E: ::fidl_next::fuchsia::HandleEncoder,
6644{
6645 #[inline]
6646 fn encode(
6647 &mut self,
6648 encoder: &mut ___E,
6649 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6650 ) -> Result<(), ::fidl_next::EncodeError> {
6651 ::fidl_next::munge! {
6652 let Self::Encoded {
6653 collection,
6654 decl,
6655 args,
6656
6657 } = out;
6658 }
6659
6660 ::fidl_next::Encode::encode(&mut self.collection, encoder, collection)?;
6661
6662 ::fidl_next::Encode::encode(&mut self.decl, encoder, decl)?;
6663
6664 ::fidl_next::Encode::encode(&mut self.args, encoder, args)?;
6665
6666 Ok(())
6667 }
6668}
6669
6670impl ::fidl_next::EncodableOption for Box<RealmCreateChildRequest> {
6671 type EncodedOption = ::fidl_next::WireBox<WireRealmCreateChildRequest>;
6672}
6673
6674unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<RealmCreateChildRequest>
6675where
6676 ___E: ::fidl_next::Encoder + ?Sized,
6677 RealmCreateChildRequest: ::fidl_next::Encode<___E>,
6678{
6679 #[inline]
6680 fn encode_option(
6681 this: Option<&mut Self>,
6682 encoder: &mut ___E,
6683 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6684 ) -> Result<(), ::fidl_next::EncodeError> {
6685 if let Some(inner) = this {
6686 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6687 ::fidl_next::WireBox::encode_present(out);
6688 } else {
6689 ::fidl_next::WireBox::encode_absent(out);
6690 }
6691
6692 Ok(())
6693 }
6694}
6695
6696impl ::fidl_next::TakeFrom<WireRealmCreateChildRequest> for RealmCreateChildRequest {
6697 #[inline]
6698 fn take_from(from: &WireRealmCreateChildRequest) -> Self {
6699 Self {
6700 collection: ::fidl_next::TakeFrom::take_from(&from.collection),
6701
6702 decl: ::fidl_next::TakeFrom::take_from(&from.decl),
6703
6704 args: ::fidl_next::TakeFrom::take_from(&from.args),
6705 }
6706 }
6707}
6708
6709#[derive(Debug)]
6711#[repr(C)]
6712pub struct WireRealmCreateChildRequest {
6713 pub collection: ::fidl_next_fuchsia_component_decl::WireCollectionRef,
6714
6715 pub decl: ::fidl_next_fuchsia_component_decl::WireChild,
6716
6717 pub args: crate::WireCreateChildArgs,
6718}
6719
6720unsafe impl ::fidl_next::ZeroPadding for WireRealmCreateChildRequest {
6721 #[inline]
6722 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6723}
6724
6725unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmCreateChildRequest
6726where
6727 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6728
6729 ___D: ::fidl_next::Decoder,
6730
6731 ___D: ::fidl_next::fuchsia::HandleDecoder,
6732{
6733 fn decode(
6734 slot: ::fidl_next::Slot<'_, Self>,
6735 decoder: &mut ___D,
6736 ) -> Result<(), ::fidl_next::DecodeError> {
6737 ::fidl_next::munge! {
6738 let Self {
6739 mut collection,
6740 mut decl,
6741 mut args,
6742
6743 } = slot;
6744 }
6745
6746 ::fidl_next::Decode::decode(collection.as_mut(), decoder)?;
6747
6748 ::fidl_next::Decode::decode(decl.as_mut(), decoder)?;
6749
6750 ::fidl_next::Decode::decode(args.as_mut(), decoder)?;
6751
6752 Ok(())
6753 }
6754}
6755
6756#[doc = " A protocol used by a component instance to manage its own realm, such as for\n binding to its children.\n\n Requests to this protocol are processed in the order they are received.\n Clients that wish to send requests in parallel should open multiple\n connections.\n\n The component framework provides this service to components that use\n `fuchsia.component.Realm`.\n"]
6758#[derive(Debug)]
6759pub struct Realm;
6760
6761impl ::fidl_next::Discoverable for Realm {
6762 const PROTOCOL_NAME: &'static str = "realm";
6763}
6764
6765pub mod realm {
6766 pub mod prelude {
6767 pub use crate::{
6768 realm, Realm, RealmClientHandler, RealmClientSender, RealmServerHandler,
6769 RealmServerSender,
6770 };
6771
6772 pub use crate::Error;
6773
6774 pub use crate::RealmCreateChildRequest;
6775
6776 pub use crate::RealmDestroyChildRequest;
6777
6778 pub use crate::RealmListChildrenRequest;
6779
6780 pub use crate::RealmOpenControllerRequest;
6781
6782 pub use crate::RealmOpenExposedDirRequest;
6783
6784 pub use crate::RealmCreateChildResponse;
6785
6786 pub use crate::RealmDestroyChildResponse;
6787
6788 pub use crate::RealmListChildrenResponse;
6789
6790 pub use crate::RealmOpenControllerResponse;
6791
6792 pub use crate::RealmOpenExposedDirResponse;
6793 }
6794
6795 pub struct OpenController;
6796
6797 impl ::fidl_next::Method for OpenController {
6798 const ORDINAL: u64 = 8165227925828473216;
6799
6800 type Protocol = crate::Realm;
6801
6802 type Request = crate::WireRealmOpenControllerRequest;
6803
6804 type Response =
6805 ::fidl_next::WireResult<crate::WireRealmOpenControllerResponse, crate::WireError>;
6806 }
6807
6808 pub struct OpenExposedDir;
6809
6810 impl ::fidl_next::Method for OpenExposedDir {
6811 const ORDINAL: u64 = 9194435320863127852;
6812
6813 type Protocol = crate::Realm;
6814
6815 type Request = crate::WireRealmOpenExposedDirRequest;
6816
6817 type Response =
6818 ::fidl_next::WireResult<crate::WireRealmOpenExposedDirResponse, crate::WireError>;
6819 }
6820
6821 pub struct CreateChild;
6822
6823 impl ::fidl_next::Method for CreateChild {
6824 const ORDINAL: u64 = 4892190024503489888;
6825
6826 type Protocol = crate::Realm;
6827
6828 type Request = crate::WireRealmCreateChildRequest;
6829
6830 type Response =
6831 ::fidl_next::WireResult<crate::WireRealmCreateChildResponse, crate::WireError>;
6832 }
6833
6834 pub struct DestroyChild;
6835
6836 impl ::fidl_next::Method for DestroyChild {
6837 const ORDINAL: u64 = 8203529889988252194;
6838
6839 type Protocol = crate::Realm;
6840
6841 type Request = crate::WireRealmDestroyChildRequest;
6842
6843 type Response =
6844 ::fidl_next::WireResult<crate::WireRealmDestroyChildResponse, crate::WireError>;
6845 }
6846
6847 pub struct ListChildren;
6848
6849 impl ::fidl_next::Method for ListChildren {
6850 const ORDINAL: u64 = 7532454435519185057;
6851
6852 type Protocol = crate::Realm;
6853
6854 type Request = crate::WireRealmListChildrenRequest;
6855
6856 type Response =
6857 ::fidl_next::WireResult<crate::WireRealmListChildrenResponse, crate::WireError>;
6858 }
6859}
6860
6861pub trait RealmClientSender {
6863 type Transport: ::fidl_next::Transport;
6864
6865 #[doc = " Operate on a child component. See documentation for [`Controller`].\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
6866 fn open_controller<___R>(
6867 &self,
6868 request: &mut ___R,
6869 ) -> Result<
6870 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::OpenController>,
6871 ::fidl_next::EncodeError,
6872 >
6873 where
6874 ___R: ::fidl_next::Encode<
6875 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6876 Encoded = crate::WireRealmOpenControllerRequest,
6877 >;
6878
6879 #[doc = " Opens the exposed directory of a child component instance. When this\n function successfully returns, `exposed_dir` is bound to a directory\n that contains the capabilities which the child exposed to its realm\n via `ComponentDecl.exposes` (specified via \"expose\" declarations in\n the component\'s manifest). The child component will not start as a\n result of this call. Instead, starting will occur iff the parent binds\n to one of the capabilities contained within `exposed_dir`.\n\n `exposed_dir` is open as long as `child` exists.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
6880 fn open_exposed_dir<___R>(
6881 &self,
6882 request: &mut ___R,
6883 ) -> Result<
6884 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::OpenExposedDir>,
6885 ::fidl_next::EncodeError,
6886 >
6887 where
6888 ___R: ::fidl_next::Encode<
6889 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6890 Encoded = crate::WireRealmOpenExposedDirRequest,
6891 >;
6892
6893 #[doc = " Creates a child component instance dynamically. When this function\n returns successfully, the instance exists, but it may not be running.\n\n The environment of the child instance is determined by the environment\n of the collection. `decl` must not set `environment`.\n\n If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,\n [CreateChild] will start the component and return once the component is\n started. Otherwise, [CreateChild] will return immediately after creating\n the component and will not start or resolve it.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`\n is not a valid declaration.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve\n in a `SingleRun` collection.\n - `NO_SPACE`: Could not allocate storage for the new instance.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
6894 fn create_child<___R>(
6895 &self,
6896 request: &mut ___R,
6897 ) -> Result<
6898 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::CreateChild>,
6899 ::fidl_next::EncodeError,
6900 >
6901 where
6902 ___R: ::fidl_next::Encode<
6903 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6904 Encoded = crate::WireRealmCreateChildRequest,
6905 >;
6906
6907 #[doc = " Destroys a dynamically-created component instance. When this function\n returns, the instance is destroyed and has stopped running. However,\n cleanup of the component\'s resources (such as its isolated storage) may\n happen in the background after this function returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer\n to a dynamic instance.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
6908 fn destroy_child<___R>(
6909 &self,
6910 request: &mut ___R,
6911 ) -> Result<
6912 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::DestroyChild>,
6913 ::fidl_next::EncodeError,
6914 >
6915 where
6916 ___R: ::fidl_next::Encode<
6917 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6918 Encoded = crate::WireRealmDestroyChildRequest,
6919 >;
6920
6921 #[doc = " Returns an iterator that lists all instances in a collection.\n\n NOTE: The results are not guaranteed to be consistent. Instances may be\n created or destroyed while the iterator is live, but those changes\n won\'t be observed by the iterator after this method returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`\n does not have `ZX_RIGHT_WAIT`.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n - If `iter` does not have standard channel rights, this function may\n return `ACCESS_DENIED` or component manager may close `iter`.\n"]
6922 fn list_children<___R>(
6923 &self,
6924 request: &mut ___R,
6925 ) -> Result<
6926 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::ListChildren>,
6927 ::fidl_next::EncodeError,
6928 >
6929 where
6930 ___R: ::fidl_next::Encode<
6931 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6932 Encoded = crate::WireRealmListChildrenRequest,
6933 >;
6934}
6935
6936impl<___T> RealmClientSender for ::fidl_next::ClientSender<___T, Realm>
6937where
6938 ___T: ::fidl_next::Transport,
6939{
6940 type Transport = ___T;
6941
6942 #[doc = " Operate on a child component. See documentation for [`Controller`].\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
6943 fn open_controller<___R>(
6944 &self,
6945 request: &mut ___R,
6946 ) -> Result<
6947 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::OpenController>,
6948 ::fidl_next::EncodeError,
6949 >
6950 where
6951 ___R: ::fidl_next::Encode<
6952 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6953 Encoded = crate::WireRealmOpenControllerRequest,
6954 >,
6955 {
6956 self.as_untyped()
6957 .send_two_way(8165227925828473216, request)
6958 .map(::fidl_next::ResponseFuture::from_untyped)
6959 }
6960
6961 #[doc = " Opens the exposed directory of a child component instance. When this\n function successfully returns, `exposed_dir` is bound to a directory\n that contains the capabilities which the child exposed to its realm\n via `ComponentDecl.exposes` (specified via \"expose\" declarations in\n the component\'s manifest). The child component will not start as a\n result of this call. Instead, starting will occur iff the parent binds\n to one of the capabilities contained within `exposed_dir`.\n\n `exposed_dir` is open as long as `child` exists.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
6962 fn open_exposed_dir<___R>(
6963 &self,
6964 request: &mut ___R,
6965 ) -> Result<
6966 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::OpenExposedDir>,
6967 ::fidl_next::EncodeError,
6968 >
6969 where
6970 ___R: ::fidl_next::Encode<
6971 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6972 Encoded = crate::WireRealmOpenExposedDirRequest,
6973 >,
6974 {
6975 self.as_untyped()
6976 .send_two_way(9194435320863127852, request)
6977 .map(::fidl_next::ResponseFuture::from_untyped)
6978 }
6979
6980 #[doc = " Creates a child component instance dynamically. When this function\n returns successfully, the instance exists, but it may not be running.\n\n The environment of the child instance is determined by the environment\n of the collection. `decl` must not set `environment`.\n\n If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,\n [CreateChild] will start the component and return once the component is\n started. Otherwise, [CreateChild] will return immediately after creating\n the component and will not start or resolve it.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`\n is not a valid declaration.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve\n in a `SingleRun` collection.\n - `NO_SPACE`: Could not allocate storage for the new instance.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
6981 fn create_child<___R>(
6982 &self,
6983 request: &mut ___R,
6984 ) -> Result<
6985 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::CreateChild>,
6986 ::fidl_next::EncodeError,
6987 >
6988 where
6989 ___R: ::fidl_next::Encode<
6990 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6991 Encoded = crate::WireRealmCreateChildRequest,
6992 >,
6993 {
6994 self.as_untyped()
6995 .send_two_way(4892190024503489888, request)
6996 .map(::fidl_next::ResponseFuture::from_untyped)
6997 }
6998
6999 #[doc = " Destroys a dynamically-created component instance. When this function\n returns, the instance is destroyed and has stopped running. However,\n cleanup of the component\'s resources (such as its isolated storage) may\n happen in the background after this function returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer\n to a dynamic instance.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
7000 fn destroy_child<___R>(
7001 &self,
7002 request: &mut ___R,
7003 ) -> Result<
7004 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::DestroyChild>,
7005 ::fidl_next::EncodeError,
7006 >
7007 where
7008 ___R: ::fidl_next::Encode<
7009 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7010 Encoded = crate::WireRealmDestroyChildRequest,
7011 >,
7012 {
7013 self.as_untyped()
7014 .send_two_way(8203529889988252194, request)
7015 .map(::fidl_next::ResponseFuture::from_untyped)
7016 }
7017
7018 #[doc = " Returns an iterator that lists all instances in a collection.\n\n NOTE: The results are not guaranteed to be consistent. Instances may be\n created or destroyed while the iterator is live, but those changes\n won\'t be observed by the iterator after this method returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`\n does not have `ZX_RIGHT_WAIT`.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n - If `iter` does not have standard channel rights, this function may\n return `ACCESS_DENIED` or component manager may close `iter`.\n"]
7019 fn list_children<___R>(
7020 &self,
7021 request: &mut ___R,
7022 ) -> Result<
7023 ::fidl_next::ResponseFuture<'_, Self::Transport, realm::ListChildren>,
7024 ::fidl_next::EncodeError,
7025 >
7026 where
7027 ___R: ::fidl_next::Encode<
7028 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7029 Encoded = crate::WireRealmListChildrenRequest,
7030 >,
7031 {
7032 self.as_untyped()
7033 .send_two_way(7532454435519185057, request)
7034 .map(::fidl_next::ResponseFuture::from_untyped)
7035 }
7036}
7037
7038pub trait RealmClientHandler<___T: ::fidl_next::Transport> {}
7042
7043impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Realm
7044where
7045 ___T: ::fidl_next::Transport,
7046 ___H: RealmClientHandler<___T>,
7047
7048 <realm::OpenController as ::fidl_next::Method>::Response:
7049 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7050
7051 <realm::OpenExposedDir as ::fidl_next::Method>::Response:
7052 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7053
7054 <realm::CreateChild as ::fidl_next::Method>::Response:
7055 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7056
7057 <realm::DestroyChild as ::fidl_next::Method>::Response:
7058 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7059
7060 <realm::ListChildren as ::fidl_next::Method>::Response:
7061 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7062{
7063 fn on_event(
7064 handler: &mut ___H,
7065 sender: &::fidl_next::ClientSender<___T, Self>,
7066 ordinal: u64,
7067 buffer: ___T::RecvBuffer,
7068 ) {
7069 match ordinal {
7070 ordinal => {
7071 sender.close();
7072 }
7073 }
7074 }
7075}
7076
7077pub trait RealmServerSender {
7079 type Transport: ::fidl_next::Transport;
7080}
7081
7082impl<___T> RealmServerSender for ::fidl_next::ServerSender<___T, Realm>
7083where
7084 ___T: ::fidl_next::Transport,
7085{
7086 type Transport = ___T;
7087}
7088
7089pub trait RealmServerHandler<___T: ::fidl_next::Transport> {
7093 #[doc = " Operate on a child component. See documentation for [`Controller`].\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
7094 fn open_controller(
7095 &mut self,
7096 sender: &::fidl_next::ServerSender<___T, Realm>,
7097
7098 request: ::fidl_next::RequestBuffer<___T, realm::OpenController>,
7099
7100 responder: ::fidl_next::Responder<realm::OpenController>,
7101 );
7102
7103 #[doc = " Opens the exposed directory of a child component instance. When this\n function successfully returns, `exposed_dir` is bound to a directory\n that contains the capabilities which the child exposed to its realm\n via `ComponentDecl.exposes` (specified via \"expose\" declarations in\n the component\'s manifest). The child component will not start as a\n result of this call. Instead, starting will occur iff the parent binds\n to one of the capabilities contained within `exposed_dir`.\n\n `exposed_dir` is open as long as `child` exists.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
7104 fn open_exposed_dir(
7105 &mut self,
7106 sender: &::fidl_next::ServerSender<___T, Realm>,
7107
7108 request: ::fidl_next::RequestBuffer<___T, realm::OpenExposedDir>,
7109
7110 responder: ::fidl_next::Responder<realm::OpenExposedDir>,
7111 );
7112
7113 #[doc = " Creates a child component instance dynamically. When this function\n returns successfully, the instance exists, but it may not be running.\n\n The environment of the child instance is determined by the environment\n of the collection. `decl` must not set `environment`.\n\n If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,\n [CreateChild] will start the component and return once the component is\n started. Otherwise, [CreateChild] will return immediately after creating\n the component and will not start or resolve it.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`\n is not a valid declaration.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve\n in a `SingleRun` collection.\n - `NO_SPACE`: Could not allocate storage for the new instance.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
7114 fn create_child(
7115 &mut self,
7116 sender: &::fidl_next::ServerSender<___T, Realm>,
7117
7118 request: ::fidl_next::RequestBuffer<___T, realm::CreateChild>,
7119
7120 responder: ::fidl_next::Responder<realm::CreateChild>,
7121 );
7122
7123 #[doc = " Destroys a dynamically-created component instance. When this function\n returns, the instance is destroyed and has stopped running. However,\n cleanup of the component\'s resources (such as its isolated storage) may\n happen in the background after this function returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer\n to a dynamic instance.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
7124 fn destroy_child(
7125 &mut self,
7126 sender: &::fidl_next::ServerSender<___T, Realm>,
7127
7128 request: ::fidl_next::RequestBuffer<___T, realm::DestroyChild>,
7129
7130 responder: ::fidl_next::Responder<realm::DestroyChild>,
7131 );
7132
7133 #[doc = " Returns an iterator that lists all instances in a collection.\n\n NOTE: The results are not guaranteed to be consistent. Instances may be\n created or destroyed while the iterator is live, but those changes\n won\'t be observed by the iterator after this method returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`\n does not have `ZX_RIGHT_WAIT`.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n - If `iter` does not have standard channel rights, this function may\n return `ACCESS_DENIED` or component manager may close `iter`.\n"]
7134 fn list_children(
7135 &mut self,
7136 sender: &::fidl_next::ServerSender<___T, Realm>,
7137
7138 request: ::fidl_next::RequestBuffer<___T, realm::ListChildren>,
7139
7140 responder: ::fidl_next::Responder<realm::ListChildren>,
7141 );
7142}
7143
7144impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Realm
7145where
7146 ___T: ::fidl_next::Transport,
7147 ___H: RealmServerHandler<___T>,
7148
7149 crate::WireRealmOpenControllerRequest:
7150 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7151
7152 crate::WireRealmOpenExposedDirRequest:
7153 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7154
7155 crate::WireRealmCreateChildRequest:
7156 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7157
7158 crate::WireRealmDestroyChildRequest:
7159 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7160
7161 crate::WireRealmListChildrenRequest:
7162 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7163{
7164 fn on_one_way(
7165 handler: &mut ___H,
7166 sender: &::fidl_next::ServerSender<___T, Self>,
7167 ordinal: u64,
7168 buffer: ___T::RecvBuffer,
7169 ) {
7170 match ordinal {
7171 ordinal => {
7172 sender.close();
7173 }
7174 }
7175 }
7176
7177 fn on_two_way(
7178 handler: &mut ___H,
7179 sender: &::fidl_next::ServerSender<___T, Self>,
7180 ordinal: u64,
7181 buffer: ___T::RecvBuffer,
7182 responder: ::fidl_next::protocol::Responder,
7183 ) {
7184 match ordinal {
7185 8165227925828473216 => {
7186 let responder = ::fidl_next::Responder::from_untyped(responder);
7187
7188 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
7189 handler.open_controller(sender, buffer, responder);
7190 }
7191
7192 9194435320863127852 => {
7193 let responder = ::fidl_next::Responder::from_untyped(responder);
7194
7195 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
7196 handler.open_exposed_dir(sender, buffer, responder);
7197 }
7198
7199 4892190024503489888 => {
7200 let responder = ::fidl_next::Responder::from_untyped(responder);
7201
7202 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
7203 handler.create_child(sender, buffer, responder);
7204 }
7205
7206 8203529889988252194 => {
7207 let responder = ::fidl_next::Responder::from_untyped(responder);
7208
7209 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
7210 handler.destroy_child(sender, buffer, responder);
7211 }
7212
7213 7532454435519185057 => {
7214 let responder = ::fidl_next::Responder::from_untyped(responder);
7215
7216 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
7217 handler.list_children(sender, buffer, responder);
7218 }
7219
7220 ordinal => {
7221 sender.close();
7222 }
7223 }
7224 }
7225}
7226
7227pub type ChildName = String;
7228
7229pub type WireChildName = ::fidl_next::WireString;
7231
7232pub type UrlScheme = String;
7233
7234pub type WireUrlScheme = ::fidl_next::WireString;
7236
7237pub mod compat {
7239
7240 #[cfg(target_os = "fuchsia")]
7241 pub type BinderProxy =
7244 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Binder>;
7245
7246 impl ::fidl_next::TakeFrom<crate::Binder> for ::fidl_fuchsia_component::BinderMarker {
7247 #[inline]
7248 fn take_from(from: &crate::Binder) -> Self {
7249 Self
7250 }
7251 }
7252
7253 impl ::fidl_next::TakeFrom<crate::WireCapabilityRequestedPayload>
7254 for ::fidl_fuchsia_component::CapabilityRequestedPayload
7255 {
7256 #[inline]
7257 fn take_from(from: &crate::WireCapabilityRequestedPayload) -> Self {
7258 Self {
7259 name: from.name().map(::fidl_next::TakeFrom::take_from),
7260
7261 capability: from.capability().map(::fidl_next::TakeFrom::take_from),
7262
7263 __source_breaking: ::fidl::marker::SourceBreaking,
7264 }
7265 }
7266 }
7267
7268 impl ::fidl_next::TakeFrom<crate::WireChildIteratorNextResponse>
7269 for ::fidl_fuchsia_component::ChildIteratorNextResponse
7270 {
7271 #[inline]
7272 fn take_from(from: &crate::WireChildIteratorNextResponse) -> Self {
7273 Self { children: ::fidl_next::TakeFrom::take_from(&from.children) }
7274 }
7275 }
7276
7277 #[cfg(target_os = "fuchsia")]
7278 pub type ChildIteratorProxy =
7281 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::ChildIterator>;
7282
7283 impl ::fidl_next::TakeFrom<crate::ChildIterator> for ::fidl_fuchsia_component::ChildIteratorMarker {
7284 #[inline]
7285 fn take_from(from: &crate::ChildIterator) -> Self {
7286 Self
7287 }
7288 }
7289
7290 impl ::fidl_next::TakeFrom<crate::WireControllerIsStartedResponse>
7291 for ::fidl_fuchsia_component::ControllerIsStartedResponse
7292 {
7293 #[inline]
7294 fn take_from(from: &crate::WireControllerIsStartedResponse) -> Self {
7295 Self { is_started: ::fidl_next::TakeFrom::take_from(&from.is_started) }
7296 }
7297 }
7298
7299 impl ::fidl_next::TakeFrom<crate::WireError> for ::fidl_fuchsia_component::Error {
7300 #[inline]
7301 fn take_from(from: &crate::WireError) -> Self {
7302 match crate::Error::from(*from) {
7303 crate::Error::Internal => Self::Internal,
7304
7305 crate::Error::InvalidArguments => Self::InvalidArguments,
7306
7307 crate::Error::Unsupported => Self::Unsupported,
7308
7309 crate::Error::AccessDenied => Self::AccessDenied,
7310
7311 crate::Error::InstanceNotFound => Self::InstanceNotFound,
7312
7313 crate::Error::InstanceAlreadyExists => Self::InstanceAlreadyExists,
7314
7315 crate::Error::InstanceCannotStart => Self::InstanceCannotStart,
7316
7317 crate::Error::InstanceCannotResolve => Self::InstanceCannotResolve,
7318
7319 crate::Error::CollectionNotFound => Self::CollectionNotFound,
7320
7321 crate::Error::ResourceUnavailable => Self::ResourceUnavailable,
7322
7323 crate::Error::InstanceDied => Self::InstanceDied,
7324
7325 crate::Error::ResourceNotFound => Self::ResourceNotFound,
7326
7327 crate::Error::InstanceCannotUnresolve => Self::InstanceCannotUnresolve,
7328
7329 crate::Error::InstanceAlreadyStarted => Self::InstanceAlreadyStarted,
7330
7331 crate::Error::UnknownOrdinal_(value) => {
7332 Self::__SourceBreaking { unknown_ordinal: value }
7333 }
7334 }
7335 }
7336 }
7337
7338 impl ::fidl_next::TakeFrom<crate::WireNamespaceEntry> for ::fidl_fuchsia_component::NamespaceEntry {
7339 #[inline]
7340 fn take_from(from: &crate::WireNamespaceEntry) -> Self {
7341 Self {
7342 path: from.path().map(::fidl_next::TakeFrom::take_from),
7343
7344 directory: from.directory().map(::fidl_next::TakeFrom::take_from),
7345
7346 __source_breaking: ::fidl::marker::SourceBreaking,
7347 }
7348 }
7349 }
7350
7351 impl ::fidl_next::TakeFrom<crate::WireStartChildArgs> for ::fidl_fuchsia_component::StartChildArgs {
7352 #[inline]
7353 fn take_from(from: &crate::WireStartChildArgs) -> Self {
7354 Self {
7355 numbered_handles: from.numbered_handles().map(::fidl_next::TakeFrom::take_from),
7356
7357 namespace_entries: from.namespace_entries().map(::fidl_next::TakeFrom::take_from),
7358
7359 dictionary: from.dictionary().map(::fidl_next::TakeFrom::take_from),
7360
7361 __source_breaking: ::fidl::marker::SourceBreaking,
7362 }
7363 }
7364 }
7365
7366 impl ::fidl_next::TakeFrom<crate::WireControllerStartRequest>
7367 for ::fidl_fuchsia_component::ControllerStartRequest
7368 {
7369 #[inline]
7370 fn take_from(from: &crate::WireControllerStartRequest) -> Self {
7371 Self {
7372 args: ::fidl_next::TakeFrom::take_from(&from.args),
7373
7374 execution_controller: ::fidl_next::TakeFrom::take_from(&from.execution_controller),
7375 }
7376 }
7377 }
7378
7379 impl ::fidl_next::TakeFrom<crate::WireControllerGetExposedDictionaryResponse>
7380 for ::fidl_fuchsia_component::ControllerGetExposedDictionaryResponse
7381 {
7382 #[inline]
7383 fn take_from(from: &crate::WireControllerGetExposedDictionaryResponse) -> Self {
7384 Self { dictionary: ::fidl_next::TakeFrom::take_from(&from.dictionary) }
7385 }
7386 }
7387
7388 #[cfg(target_os = "fuchsia")]
7389 pub type ControllerProxy =
7392 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Controller>;
7393
7394 impl ::fidl_next::TakeFrom<crate::Controller> for ::fidl_fuchsia_component::ControllerMarker {
7395 #[inline]
7396 fn take_from(from: &crate::Controller) -> Self {
7397 Self
7398 }
7399 }
7400
7401 impl ::fidl_next::TakeFrom<crate::WireCreateChildArgs>
7402 for ::fidl_fuchsia_component::CreateChildArgs
7403 {
7404 #[inline]
7405 fn take_from(from: &crate::WireCreateChildArgs) -> Self {
7406 Self {
7407 numbered_handles: from.numbered_handles().map(::fidl_next::TakeFrom::take_from),
7408
7409 dynamic_offers: from.dynamic_offers().map(::fidl_next::TakeFrom::take_from),
7410
7411 controller: from.controller().map(::fidl_next::TakeFrom::take_from),
7412
7413 dictionary: from.dictionary().map(::fidl_next::TakeFrom::take_from),
7414
7415 __source_breaking: ::fidl::marker::SourceBreaking,
7416 }
7417 }
7418 }
7419
7420 impl ::fidl_next::TakeFrom<crate::WireDebugStartedPayload>
7421 for ::fidl_fuchsia_component::DebugStartedPayload
7422 {
7423 #[inline]
7424 fn take_from(from: &crate::WireDebugStartedPayload) -> Self {
7425 Self {
7426 runtime_dir: from.runtime_dir().map(::fidl_next::TakeFrom::take_from),
7427
7428 break_on_start: from.break_on_start().map(::fidl_next::TakeFrom::take_from),
7429
7430 __source_breaking: ::fidl::marker::SourceBreaking,
7431 }
7432 }
7433 }
7434
7435 impl ::fidl_next::TakeFrom<crate::WireDestroyedPayload>
7436 for ::fidl_fuchsia_component::DestroyedPayload
7437 {
7438 #[inline]
7439 fn take_from(from: &crate::WireDestroyedPayload) -> Self {
7440 Self { __source_breaking: ::fidl::marker::SourceBreaking }
7441 }
7442 }
7443
7444 impl ::fidl_next::TakeFrom<crate::WireDirectoryReadyPayload>
7445 for ::fidl_fuchsia_component::DirectoryReadyPayload
7446 {
7447 #[inline]
7448 fn take_from(from: &crate::WireDirectoryReadyPayload) -> Self {
7449 Self {
7450 name: from.name().map(::fidl_next::TakeFrom::take_from),
7451
7452 node: from.node().map(::fidl_next::TakeFrom::take_from),
7453
7454 __source_breaking: ::fidl::marker::SourceBreaking,
7455 }
7456 }
7457 }
7458
7459 impl ::fidl_next::TakeFrom<crate::WireDiscoveredPayload>
7460 for ::fidl_fuchsia_component::DiscoveredPayload
7461 {
7462 #[inline]
7463 fn take_from(from: &crate::WireDiscoveredPayload) -> Self {
7464 Self { __source_breaking: ::fidl::marker::SourceBreaking }
7465 }
7466 }
7467
7468 impl ::fidl_next::TakeFrom<crate::WirePurgedPayload> for ::fidl_fuchsia_component::PurgedPayload {
7469 #[inline]
7470 fn take_from(from: &crate::WirePurgedPayload) -> Self {
7471 Self { __source_breaking: ::fidl::marker::SourceBreaking }
7472 }
7473 }
7474
7475 impl ::fidl_next::TakeFrom<crate::WireResolvedPayload>
7476 for ::fidl_fuchsia_component::ResolvedPayload
7477 {
7478 #[inline]
7479 fn take_from(from: &crate::WireResolvedPayload) -> Self {
7480 Self { __source_breaking: ::fidl::marker::SourceBreaking }
7481 }
7482 }
7483
7484 impl ::fidl_next::TakeFrom<crate::WireStartedPayload> for ::fidl_fuchsia_component::StartedPayload {
7485 #[inline]
7486 fn take_from(from: &crate::WireStartedPayload) -> Self {
7487 Self { __source_breaking: ::fidl::marker::SourceBreaking }
7488 }
7489 }
7490
7491 impl ::fidl_next::TakeFrom<crate::WireUnresolvedPayload>
7492 for ::fidl_fuchsia_component::UnresolvedPayload
7493 {
7494 #[inline]
7495 fn take_from(from: &crate::WireUnresolvedPayload) -> Self {
7496 Self { __source_breaking: ::fidl::marker::SourceBreaking }
7497 }
7498 }
7499
7500 impl ::fidl_next::TakeFrom<crate::WireStoppedPayload> for ::fidl_fuchsia_component::StoppedPayload {
7501 #[inline]
7502 fn take_from(from: &crate::WireStoppedPayload) -> Self {
7503 Self {
7504 status: from.status().map(::fidl_next::TakeFrom::take_from),
7505
7506 exit_code: from.exit_code().map(::fidl_next::TakeFrom::take_from),
7507
7508 __source_breaking: ::fidl::marker::SourceBreaking,
7509 }
7510 }
7511 }
7512
7513 impl ::fidl_next::TakeFrom<crate::WireEventType> for ::fidl_fuchsia_component::EventType {
7514 #[inline]
7515 fn take_from(from: &crate::WireEventType) -> Self {
7516 match crate::EventType::from(*from) {
7517 crate::EventType::CapabilityRequested => Self::CapabilityRequested,
7518
7519 crate::EventType::DirectoryReady => Self::DirectoryReady,
7520
7521 crate::EventType::Discovered => Self::Discovered,
7522
7523 crate::EventType::Destroyed => Self::Destroyed,
7524
7525 crate::EventType::Resolved => Self::Resolved,
7526
7527 crate::EventType::Started => Self::Started,
7528
7529 crate::EventType::Stopped => Self::Stopped,
7530
7531 crate::EventType::DebugStarted => Self::DebugStarted,
7532
7533 crate::EventType::Unresolved => Self::Unresolved,
7534 }
7535 }
7536 }
7537
7538 impl ::fidl_next::TakeFrom<crate::WireEventHeader> for ::fidl_fuchsia_component::EventHeader {
7539 #[inline]
7540 fn take_from(from: &crate::WireEventHeader) -> Self {
7541 Self {
7542 event_type: from.event_type().map(::fidl_next::TakeFrom::take_from),
7543
7544 moniker: from.moniker().map(::fidl_next::TakeFrom::take_from),
7545
7546 component_url: from.component_url().map(::fidl_next::TakeFrom::take_from),
7547
7548 timestamp: from.timestamp().map(::fidl_next::TakeFrom::take_from),
7549
7550 __source_breaking: ::fidl::marker::SourceBreaking,
7551 }
7552 }
7553 }
7554
7555 impl ::fidl_next::TakeFrom<crate::WireEventPayload> for ::fidl_fuchsia_component::EventPayload {
7556 #[inline]
7557 fn take_from(from: &crate::WireEventPayload) -> Self {
7558 match from.as_ref() {
7559 crate::event_payload::Ref::CapabilityRequested(value) => {
7560 Self::CapabilityRequested(::fidl_next::TakeFrom::take_from(value))
7561 }
7562
7563 crate::event_payload::Ref::Purged(value) => {
7564 Self::Purged(::fidl_next::TakeFrom::take_from(value))
7565 }
7566
7567 crate::event_payload::Ref::DirectoryReady(value) => {
7568 Self::DirectoryReady(::fidl_next::TakeFrom::take_from(value))
7569 }
7570
7571 crate::event_payload::Ref::Discovered(value) => {
7572 Self::Discovered(::fidl_next::TakeFrom::take_from(value))
7573 }
7574
7575 crate::event_payload::Ref::Destroyed(value) => {
7576 Self::Destroyed(::fidl_next::TakeFrom::take_from(value))
7577 }
7578
7579 crate::event_payload::Ref::Resolved(value) => {
7580 Self::Resolved(::fidl_next::TakeFrom::take_from(value))
7581 }
7582
7583 crate::event_payload::Ref::Started(value) => {
7584 Self::Started(::fidl_next::TakeFrom::take_from(value))
7585 }
7586
7587 crate::event_payload::Ref::Stopped(value) => {
7588 Self::Stopped(::fidl_next::TakeFrom::take_from(value))
7589 }
7590
7591 crate::event_payload::Ref::DebugStarted(value) => {
7592 Self::DebugStarted(::fidl_next::TakeFrom::take_from(value))
7593 }
7594
7595 crate::event_payload::Ref::Unresolved(value) => {
7596 Self::Unresolved(::fidl_next::TakeFrom::take_from(value))
7597 }
7598
7599 crate::event_payload::Ref::UnknownOrdinal_(unknown_ordinal) => {
7600 Self::__SourceBreaking { unknown_ordinal }
7601 }
7602 }
7603 }
7604 }
7605
7606 impl ::fidl_next::TakeFrom<crate::WireOptionalEventPayload>
7607 for Option<Box<::fidl_fuchsia_component::EventPayload>>
7608 {
7609 #[inline]
7610 fn take_from(from: &crate::WireOptionalEventPayload) -> Self {
7611 if let Some(inner) = from.as_ref() {
7612 Some(::fidl_next::TakeFrom::take_from(inner))
7613 } else {
7614 None
7615 }
7616 }
7617 }
7618
7619 impl ::fidl_next::TakeFrom<crate::WireEvent> for ::fidl_fuchsia_component::Event {
7620 #[inline]
7621 fn take_from(from: &crate::WireEvent) -> Self {
7622 Self {
7623 header: from.header().map(::fidl_next::TakeFrom::take_from),
7624
7625 payload: from.payload().map(::fidl_next::TakeFrom::take_from),
7626
7627 __source_breaking: ::fidl::marker::SourceBreaking,
7628 }
7629 }
7630 }
7631
7632 impl ::fidl_next::TakeFrom<crate::WireEventStreamGetNextResponse>
7633 for ::fidl_fuchsia_component::EventStreamGetNextResponse
7634 {
7635 #[inline]
7636 fn take_from(from: &crate::WireEventStreamGetNextResponse) -> Self {
7637 Self { events: ::fidl_next::TakeFrom::take_from(&from.events) }
7638 }
7639 }
7640
7641 #[cfg(target_os = "fuchsia")]
7642 pub type EventStreamProxy =
7645 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::EventStream>;
7646
7647 impl ::fidl_next::TakeFrom<crate::EventStream> for ::fidl_fuchsia_component::EventStreamMarker {
7648 #[inline]
7649 fn take_from(from: &crate::EventStream) -> Self {
7650 Self
7651 }
7652 }
7653
7654 impl ::fidl_next::TakeFrom<crate::WireExecutionControllerOnStopRequest>
7655 for ::fidl_fuchsia_component::ExecutionControllerOnStopRequest
7656 {
7657 #[inline]
7658 fn take_from(from: &crate::WireExecutionControllerOnStopRequest) -> Self {
7659 Self { stopped_payload: ::fidl_next::TakeFrom::take_from(&from.stopped_payload) }
7660 }
7661 }
7662
7663 #[cfg(target_os = "fuchsia")]
7664 pub type ExecutionControllerProxy =
7667 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::ExecutionController>;
7668
7669 impl ::fidl_next::TakeFrom<crate::ExecutionController>
7670 for ::fidl_fuchsia_component::ExecutionControllerMarker
7671 {
7672 #[inline]
7673 fn take_from(from: &crate::ExecutionController) -> Self {
7674 Self
7675 }
7676 }
7677
7678 impl ::fidl_next::TakeFrom<crate::WireIntrospectorGetMonikerRequest>
7679 for ::fidl_fuchsia_component::IntrospectorGetMonikerRequest
7680 {
7681 #[inline]
7682 fn take_from(from: &crate::WireIntrospectorGetMonikerRequest) -> Self {
7683 Self { component_instance: ::fidl_next::TakeFrom::take_from(&from.component_instance) }
7684 }
7685 }
7686
7687 impl ::fidl_next::TakeFrom<crate::WireIntrospectorGetMonikerResponse>
7688 for ::fidl_fuchsia_component::IntrospectorGetMonikerResponse
7689 {
7690 #[inline]
7691 fn take_from(from: &crate::WireIntrospectorGetMonikerResponse) -> Self {
7692 Self { moniker: ::fidl_next::TakeFrom::take_from(&from.moniker) }
7693 }
7694 }
7695
7696 #[cfg(target_os = "fuchsia")]
7697 pub type IntrospectorProxy =
7700 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Introspector>;
7701
7702 impl ::fidl_next::TakeFrom<crate::Introspector> for ::fidl_fuchsia_component::IntrospectorMarker {
7703 #[inline]
7704 fn take_from(from: &crate::Introspector) -> Self {
7705 Self
7706 }
7707 }
7708
7709 impl ::fidl_next::TakeFrom<crate::WireNamespaceInputEntry>
7710 for ::fidl_fuchsia_component::NamespaceInputEntry
7711 {
7712 #[inline]
7713 fn take_from(from: &crate::WireNamespaceInputEntry) -> Self {
7714 Self {
7715 path: ::fidl_next::TakeFrom::take_from(&from.path),
7716
7717 dictionary: ::fidl_next::TakeFrom::take_from(&from.dictionary),
7718 }
7719 }
7720 }
7721
7722 impl ::fidl_next::TakeFrom<crate::WireNamespaceCreateRequest>
7723 for ::fidl_fuchsia_component::NamespaceCreateRequest
7724 {
7725 #[inline]
7726 fn take_from(from: &crate::WireNamespaceCreateRequest) -> Self {
7727 Self { entries: ::fidl_next::TakeFrom::take_from(&from.entries) }
7728 }
7729 }
7730
7731 impl ::fidl_next::TakeFrom<crate::WireNamespaceError> for ::fidl_fuchsia_component::NamespaceError {
7732 #[inline]
7733 fn take_from(from: &crate::WireNamespaceError) -> Self {
7734 match crate::NamespaceError::from(*from) {
7735 crate::NamespaceError::Shadow => Self::Shadow,
7736
7737 crate::NamespaceError::Duplicate => Self::Duplicate,
7738
7739 crate::NamespaceError::Conversion => Self::Conversion,
7740
7741 crate::NamespaceError::BadEntry => Self::BadEntry,
7742
7743 crate::NamespaceError::DictionaryRead => Self::DictionaryRead,
7744
7745 crate::NamespaceError::UnknownOrdinal_(value) => {
7746 Self::__SourceBreaking { unknown_ordinal: value }
7747 }
7748 }
7749 }
7750 }
7751
7752 impl ::fidl_next::TakeFrom<crate::WireNamespaceCreateResponse>
7753 for ::fidl_fuchsia_component::NamespaceCreateResponse
7754 {
7755 #[inline]
7756 fn take_from(from: &crate::WireNamespaceCreateResponse) -> Self {
7757 Self { entries: ::fidl_next::TakeFrom::take_from(&from.entries) }
7758 }
7759 }
7760
7761 #[cfg(target_os = "fuchsia")]
7762 pub type NamespaceProxy =
7765 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Namespace>;
7766
7767 impl ::fidl_next::TakeFrom<crate::Namespace> for ::fidl_fuchsia_component::NamespaceMarker {
7768 #[inline]
7769 fn take_from(from: &crate::Namespace) -> Self {
7770 Self
7771 }
7772 }
7773
7774 impl ::fidl_next::TakeFrom<crate::WireRealmDestroyChildRequest>
7775 for ::fidl_fuchsia_component::RealmDestroyChildRequest
7776 {
7777 #[inline]
7778 fn take_from(from: &crate::WireRealmDestroyChildRequest) -> Self {
7779 Self { child: ::fidl_next::TakeFrom::take_from(&from.child) }
7780 }
7781 }
7782
7783 impl ::fidl_next::TakeFrom<crate::WireRealmListChildrenRequest>
7784 for ::fidl_fuchsia_component::RealmListChildrenRequest
7785 {
7786 #[inline]
7787 fn take_from(from: &crate::WireRealmListChildrenRequest) -> Self {
7788 Self {
7789 collection: ::fidl_next::TakeFrom::take_from(&from.collection),
7790
7791 iter: ::fidl_next::TakeFrom::take_from(&from.iter),
7792 }
7793 }
7794 }
7795
7796 impl ::fidl_next::TakeFrom<crate::WireRealmOpenControllerRequest>
7797 for ::fidl_fuchsia_component::RealmOpenControllerRequest
7798 {
7799 #[inline]
7800 fn take_from(from: &crate::WireRealmOpenControllerRequest) -> Self {
7801 Self {
7802 child: ::fidl_next::TakeFrom::take_from(&from.child),
7803
7804 controller: ::fidl_next::TakeFrom::take_from(&from.controller),
7805 }
7806 }
7807 }
7808
7809 impl ::fidl_next::TakeFrom<crate::WireRealmOpenExposedDirRequest>
7810 for ::fidl_fuchsia_component::RealmOpenExposedDirRequest
7811 {
7812 #[inline]
7813 fn take_from(from: &crate::WireRealmOpenExposedDirRequest) -> Self {
7814 Self {
7815 child: ::fidl_next::TakeFrom::take_from(&from.child),
7816
7817 exposed_dir: ::fidl_next::TakeFrom::take_from(&from.exposed_dir),
7818 }
7819 }
7820 }
7821
7822 impl ::fidl_next::TakeFrom<crate::WireRealmCreateChildRequest>
7823 for ::fidl_fuchsia_component::RealmCreateChildRequest
7824 {
7825 #[inline]
7826 fn take_from(from: &crate::WireRealmCreateChildRequest) -> Self {
7827 Self {
7828 collection: ::fidl_next::TakeFrom::take_from(&from.collection),
7829
7830 decl: ::fidl_next::TakeFrom::take_from(&from.decl),
7831
7832 args: ::fidl_next::TakeFrom::take_from(&from.args),
7833 }
7834 }
7835 }
7836
7837 #[cfg(target_os = "fuchsia")]
7838 pub type RealmProxy =
7841 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Realm>;
7842
7843 impl ::fidl_next::TakeFrom<crate::Realm> for ::fidl_fuchsia_component::RealmMarker {
7844 #[inline]
7845 fn take_from(from: &crate::Realm) -> Self {
7846 Self
7847 }
7848 }
7849}