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