fidl_fuchsia_component_internal/
fidl_fuchsia_component_internal.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_component_internal__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ChildInput {
16    pub child_name: String,
17    pub child_input: fidl_fuchsia_component_sandbox::DictionaryRef,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ChildInput {}
21
22/// A component's sandbox, which holds all of the capabilities that a component
23/// has access to, can provide to the system, and makes available to its
24/// children.
25#[derive(Debug, Default, PartialEq)]
26pub struct ComponentSandbox {
27    pub component_input: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
28    pub component_output: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
29    pub program_input: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
30    pub program_output: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
31    pub reserved: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
32    pub capability_sourced: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
33    pub declared_dictionaries: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
34    pub child_inputs: Option<Vec<ChildInput>>,
35    pub collection_inputs: Option<Vec<ChildInput>>,
36    #[doc(hidden)]
37    pub __source_breaking: fidl::marker::SourceBreaking,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ComponentSandbox {}
41
42#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
43pub struct ComponentSandboxRetrieverMarker;
44
45impl fidl::endpoints::ProtocolMarker for ComponentSandboxRetrieverMarker {
46    type Proxy = ComponentSandboxRetrieverProxy;
47    type RequestStream = ComponentSandboxRetrieverRequestStream;
48    #[cfg(target_os = "fuchsia")]
49    type SynchronousProxy = ComponentSandboxRetrieverSynchronousProxy;
50
51    const DEBUG_NAME: &'static str = "fuchsia.component.internal.ComponentSandboxRetriever";
52}
53impl fidl::endpoints::DiscoverableProtocolMarker for ComponentSandboxRetrieverMarker {}
54
55pub trait ComponentSandboxRetrieverProxyInterface: Send + Sync {
56    type GetMySandboxResponseFut: std::future::Future<Output = Result<ComponentSandbox, fidl::Error>>
57        + Send;
58    fn r#get_my_sandbox(&self) -> Self::GetMySandboxResponseFut;
59}
60#[derive(Debug)]
61#[cfg(target_os = "fuchsia")]
62pub struct ComponentSandboxRetrieverSynchronousProxy {
63    client: fidl::client::sync::Client,
64}
65
66#[cfg(target_os = "fuchsia")]
67impl fidl::endpoints::SynchronousProxy for ComponentSandboxRetrieverSynchronousProxy {
68    type Proxy = ComponentSandboxRetrieverProxy;
69    type Protocol = ComponentSandboxRetrieverMarker;
70
71    fn from_channel(inner: fidl::Channel) -> Self {
72        Self::new(inner)
73    }
74
75    fn into_channel(self) -> fidl::Channel {
76        self.client.into_channel()
77    }
78
79    fn as_channel(&self) -> &fidl::Channel {
80        self.client.as_channel()
81    }
82}
83
84#[cfg(target_os = "fuchsia")]
85impl ComponentSandboxRetrieverSynchronousProxy {
86    pub fn new(channel: fidl::Channel) -> Self {
87        let protocol_name =
88            <ComponentSandboxRetrieverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
89        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
90    }
91
92    pub fn into_channel(self) -> fidl::Channel {
93        self.client.into_channel()
94    }
95
96    /// Waits until an event arrives and returns it. It is safe for other
97    /// threads to make concurrent requests while waiting for an event.
98    pub fn wait_for_event(
99        &self,
100        deadline: zx::MonotonicInstant,
101    ) -> Result<ComponentSandboxRetrieverEvent, fidl::Error> {
102        ComponentSandboxRetrieverEvent::decode(self.client.wait_for_event(deadline)?)
103    }
104
105    pub fn r#get_my_sandbox(
106        &self,
107        ___deadline: zx::MonotonicInstant,
108    ) -> Result<ComponentSandbox, fidl::Error> {
109        let _response = self.client.send_query::<
110            fidl::encoding::EmptyPayload,
111            fidl::encoding::FlexibleType<ComponentSandbox>,
112        >(
113            (),
114            0x61ca075fb9860e84,
115            fidl::encoding::DynamicFlags::FLEXIBLE,
116            ___deadline,
117        )?
118        .into_result::<ComponentSandboxRetrieverMarker>("get_my_sandbox")?;
119        Ok(_response)
120    }
121}
122
123#[cfg(target_os = "fuchsia")]
124impl From<ComponentSandboxRetrieverSynchronousProxy> for zx::NullableHandle {
125    fn from(value: ComponentSandboxRetrieverSynchronousProxy) -> Self {
126        value.into_channel().into()
127    }
128}
129
130#[cfg(target_os = "fuchsia")]
131impl From<fidl::Channel> for ComponentSandboxRetrieverSynchronousProxy {
132    fn from(value: fidl::Channel) -> Self {
133        Self::new(value)
134    }
135}
136
137#[cfg(target_os = "fuchsia")]
138impl fidl::endpoints::FromClient for ComponentSandboxRetrieverSynchronousProxy {
139    type Protocol = ComponentSandboxRetrieverMarker;
140
141    fn from_client(value: fidl::endpoints::ClientEnd<ComponentSandboxRetrieverMarker>) -> Self {
142        Self::new(value.into_channel())
143    }
144}
145
146#[derive(Debug, Clone)]
147pub struct ComponentSandboxRetrieverProxy {
148    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
149}
150
151impl fidl::endpoints::Proxy for ComponentSandboxRetrieverProxy {
152    type Protocol = ComponentSandboxRetrieverMarker;
153
154    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
155        Self::new(inner)
156    }
157
158    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
159        self.client.into_channel().map_err(|client| Self { client })
160    }
161
162    fn as_channel(&self) -> &::fidl::AsyncChannel {
163        self.client.as_channel()
164    }
165}
166
167impl ComponentSandboxRetrieverProxy {
168    /// Create a new Proxy for fuchsia.component.internal/ComponentSandboxRetriever.
169    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
170        let protocol_name =
171            <ComponentSandboxRetrieverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
172        Self { client: fidl::client::Client::new(channel, protocol_name) }
173    }
174
175    /// Get a Stream of events from the remote end of the protocol.
176    ///
177    /// # Panics
178    ///
179    /// Panics if the event stream was already taken.
180    pub fn take_event_stream(&self) -> ComponentSandboxRetrieverEventStream {
181        ComponentSandboxRetrieverEventStream { event_receiver: self.client.take_event_receiver() }
182    }
183
184    pub fn r#get_my_sandbox(
185        &self,
186    ) -> fidl::client::QueryResponseFut<
187        ComponentSandbox,
188        fidl::encoding::DefaultFuchsiaResourceDialect,
189    > {
190        ComponentSandboxRetrieverProxyInterface::r#get_my_sandbox(self)
191    }
192}
193
194impl ComponentSandboxRetrieverProxyInterface for ComponentSandboxRetrieverProxy {
195    type GetMySandboxResponseFut = fidl::client::QueryResponseFut<
196        ComponentSandbox,
197        fidl::encoding::DefaultFuchsiaResourceDialect,
198    >;
199    fn r#get_my_sandbox(&self) -> Self::GetMySandboxResponseFut {
200        fn _decode(
201            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
202        ) -> Result<ComponentSandbox, fidl::Error> {
203            let _response = fidl::client::decode_transaction_body::<
204                fidl::encoding::FlexibleType<ComponentSandbox>,
205                fidl::encoding::DefaultFuchsiaResourceDialect,
206                0x61ca075fb9860e84,
207            >(_buf?)?
208            .into_result::<ComponentSandboxRetrieverMarker>("get_my_sandbox")?;
209            Ok(_response)
210        }
211        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ComponentSandbox>(
212            (),
213            0x61ca075fb9860e84,
214            fidl::encoding::DynamicFlags::FLEXIBLE,
215            _decode,
216        )
217    }
218}
219
220pub struct ComponentSandboxRetrieverEventStream {
221    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
222}
223
224impl std::marker::Unpin for ComponentSandboxRetrieverEventStream {}
225
226impl futures::stream::FusedStream for ComponentSandboxRetrieverEventStream {
227    fn is_terminated(&self) -> bool {
228        self.event_receiver.is_terminated()
229    }
230}
231
232impl futures::Stream for ComponentSandboxRetrieverEventStream {
233    type Item = Result<ComponentSandboxRetrieverEvent, fidl::Error>;
234
235    fn poll_next(
236        mut self: std::pin::Pin<&mut Self>,
237        cx: &mut std::task::Context<'_>,
238    ) -> std::task::Poll<Option<Self::Item>> {
239        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
240            &mut self.event_receiver,
241            cx
242        )?) {
243            Some(buf) => std::task::Poll::Ready(Some(ComponentSandboxRetrieverEvent::decode(buf))),
244            None => std::task::Poll::Ready(None),
245        }
246    }
247}
248
249#[derive(Debug)]
250pub enum ComponentSandboxRetrieverEvent {
251    #[non_exhaustive]
252    _UnknownEvent {
253        /// Ordinal of the event that was sent.
254        ordinal: u64,
255    },
256}
257
258impl ComponentSandboxRetrieverEvent {
259    /// Decodes a message buffer as a [`ComponentSandboxRetrieverEvent`].
260    fn decode(
261        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
262    ) -> Result<ComponentSandboxRetrieverEvent, fidl::Error> {
263        let (bytes, _handles) = buf.split_mut();
264        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
265        debug_assert_eq!(tx_header.tx_id, 0);
266        match tx_header.ordinal {
267            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
268                Ok(ComponentSandboxRetrieverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
269            }
270            _ => Err(fidl::Error::UnknownOrdinal {
271                ordinal: tx_header.ordinal,
272                protocol_name:
273                    <ComponentSandboxRetrieverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
274            }),
275        }
276    }
277}
278
279/// A Stream of incoming requests for fuchsia.component.internal/ComponentSandboxRetriever.
280pub struct ComponentSandboxRetrieverRequestStream {
281    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
282    is_terminated: bool,
283}
284
285impl std::marker::Unpin for ComponentSandboxRetrieverRequestStream {}
286
287impl futures::stream::FusedStream for ComponentSandboxRetrieverRequestStream {
288    fn is_terminated(&self) -> bool {
289        self.is_terminated
290    }
291}
292
293impl fidl::endpoints::RequestStream for ComponentSandboxRetrieverRequestStream {
294    type Protocol = ComponentSandboxRetrieverMarker;
295    type ControlHandle = ComponentSandboxRetrieverControlHandle;
296
297    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
298        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
299    }
300
301    fn control_handle(&self) -> Self::ControlHandle {
302        ComponentSandboxRetrieverControlHandle { inner: self.inner.clone() }
303    }
304
305    fn into_inner(
306        self,
307    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
308    {
309        (self.inner, self.is_terminated)
310    }
311
312    fn from_inner(
313        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
314        is_terminated: bool,
315    ) -> Self {
316        Self { inner, is_terminated }
317    }
318}
319
320impl futures::Stream for ComponentSandboxRetrieverRequestStream {
321    type Item = Result<ComponentSandboxRetrieverRequest, fidl::Error>;
322
323    fn poll_next(
324        mut self: std::pin::Pin<&mut Self>,
325        cx: &mut std::task::Context<'_>,
326    ) -> std::task::Poll<Option<Self::Item>> {
327        let this = &mut *self;
328        if this.inner.check_shutdown(cx) {
329            this.is_terminated = true;
330            return std::task::Poll::Ready(None);
331        }
332        if this.is_terminated {
333            panic!("polled ComponentSandboxRetrieverRequestStream after completion");
334        }
335        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
336            |bytes, handles| {
337                match this.inner.channel().read_etc(cx, bytes, handles) {
338                    std::task::Poll::Ready(Ok(())) => {}
339                    std::task::Poll::Pending => return std::task::Poll::Pending,
340                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
341                        this.is_terminated = true;
342                        return std::task::Poll::Ready(None);
343                    }
344                    std::task::Poll::Ready(Err(e)) => {
345                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
346                            e.into(),
347                        ))));
348                    }
349                }
350
351                // A message has been received from the channel
352                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
353
354                std::task::Poll::Ready(Some(match header.ordinal {
355                0x61ca075fb9860e84 => {
356                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
357                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
358                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
359                    let control_handle = ComponentSandboxRetrieverControlHandle {
360                        inner: this.inner.clone(),
361                    };
362                    Ok(ComponentSandboxRetrieverRequest::GetMySandbox {
363                        responder: ComponentSandboxRetrieverGetMySandboxResponder {
364                            control_handle: std::mem::ManuallyDrop::new(control_handle),
365                            tx_id: header.tx_id,
366                        },
367                    })
368                }
369                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
370                    Ok(ComponentSandboxRetrieverRequest::_UnknownMethod {
371                        ordinal: header.ordinal,
372                        control_handle: ComponentSandboxRetrieverControlHandle { inner: this.inner.clone() },
373                        method_type: fidl::MethodType::OneWay,
374                    })
375                }
376                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
377                    this.inner.send_framework_err(
378                        fidl::encoding::FrameworkErr::UnknownMethod,
379                        header.tx_id,
380                        header.ordinal,
381                        header.dynamic_flags(),
382                        (bytes, handles),
383                    )?;
384                    Ok(ComponentSandboxRetrieverRequest::_UnknownMethod {
385                        ordinal: header.ordinal,
386                        control_handle: ComponentSandboxRetrieverControlHandle { inner: this.inner.clone() },
387                        method_type: fidl::MethodType::TwoWay,
388                    })
389                }
390                _ => Err(fidl::Error::UnknownOrdinal {
391                    ordinal: header.ordinal,
392                    protocol_name: <ComponentSandboxRetrieverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
393                }),
394            }))
395            },
396        )
397    }
398}
399
400#[derive(Debug)]
401pub enum ComponentSandboxRetrieverRequest {
402    GetMySandbox {
403        responder: ComponentSandboxRetrieverGetMySandboxResponder,
404    },
405    /// An interaction was received which does not match any known method.
406    #[non_exhaustive]
407    _UnknownMethod {
408        /// Ordinal of the method that was called.
409        ordinal: u64,
410        control_handle: ComponentSandboxRetrieverControlHandle,
411        method_type: fidl::MethodType,
412    },
413}
414
415impl ComponentSandboxRetrieverRequest {
416    #[allow(irrefutable_let_patterns)]
417    pub fn into_get_my_sandbox(self) -> Option<(ComponentSandboxRetrieverGetMySandboxResponder)> {
418        if let ComponentSandboxRetrieverRequest::GetMySandbox { responder } = self {
419            Some((responder))
420        } else {
421            None
422        }
423    }
424
425    /// Name of the method defined in FIDL
426    pub fn method_name(&self) -> &'static str {
427        match *self {
428            ComponentSandboxRetrieverRequest::GetMySandbox { .. } => "get_my_sandbox",
429            ComponentSandboxRetrieverRequest::_UnknownMethod {
430                method_type: fidl::MethodType::OneWay,
431                ..
432            } => "unknown one-way method",
433            ComponentSandboxRetrieverRequest::_UnknownMethod {
434                method_type: fidl::MethodType::TwoWay,
435                ..
436            } => "unknown two-way method",
437        }
438    }
439}
440
441#[derive(Debug, Clone)]
442pub struct ComponentSandboxRetrieverControlHandle {
443    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
444}
445
446impl fidl::endpoints::ControlHandle for ComponentSandboxRetrieverControlHandle {
447    fn shutdown(&self) {
448        self.inner.shutdown()
449    }
450
451    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
452        self.inner.shutdown_with_epitaph(status)
453    }
454
455    fn is_closed(&self) -> bool {
456        self.inner.channel().is_closed()
457    }
458    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
459        self.inner.channel().on_closed()
460    }
461
462    #[cfg(target_os = "fuchsia")]
463    fn signal_peer(
464        &self,
465        clear_mask: zx::Signals,
466        set_mask: zx::Signals,
467    ) -> Result<(), zx_status::Status> {
468        use fidl::Peered;
469        self.inner.channel().signal_peer(clear_mask, set_mask)
470    }
471}
472
473impl ComponentSandboxRetrieverControlHandle {}
474
475#[must_use = "FIDL methods require a response to be sent"]
476#[derive(Debug)]
477pub struct ComponentSandboxRetrieverGetMySandboxResponder {
478    control_handle: std::mem::ManuallyDrop<ComponentSandboxRetrieverControlHandle>,
479    tx_id: u32,
480}
481
482/// Set the the channel to be shutdown (see [`ComponentSandboxRetrieverControlHandle::shutdown`])
483/// if the responder is dropped without sending a response, so that the client
484/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
485impl std::ops::Drop for ComponentSandboxRetrieverGetMySandboxResponder {
486    fn drop(&mut self) {
487        self.control_handle.shutdown();
488        // Safety: drops once, never accessed again
489        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
490    }
491}
492
493impl fidl::endpoints::Responder for ComponentSandboxRetrieverGetMySandboxResponder {
494    type ControlHandle = ComponentSandboxRetrieverControlHandle;
495
496    fn control_handle(&self) -> &ComponentSandboxRetrieverControlHandle {
497        &self.control_handle
498    }
499
500    fn drop_without_shutdown(mut self) {
501        // Safety: drops once, never accessed again due to mem::forget
502        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
503        // Prevent Drop from running (which would shut down the channel)
504        std::mem::forget(self);
505    }
506}
507
508impl ComponentSandboxRetrieverGetMySandboxResponder {
509    /// Sends a response to the FIDL transaction.
510    ///
511    /// Sets the channel to shutdown if an error occurs.
512    pub fn send(self, mut payload: ComponentSandbox) -> Result<(), fidl::Error> {
513        let _result = self.send_raw(payload);
514        if _result.is_err() {
515            self.control_handle.shutdown();
516        }
517        self.drop_without_shutdown();
518        _result
519    }
520
521    /// Similar to "send" but does not shutdown the channel if an error occurs.
522    pub fn send_no_shutdown_on_err(self, mut payload: ComponentSandbox) -> Result<(), fidl::Error> {
523        let _result = self.send_raw(payload);
524        self.drop_without_shutdown();
525        _result
526    }
527
528    fn send_raw(&self, mut payload: ComponentSandbox) -> Result<(), fidl::Error> {
529        self.control_handle.inner.send::<fidl::encoding::FlexibleType<ComponentSandbox>>(
530            fidl::encoding::Flexible::new(&mut payload),
531            self.tx_id,
532            0x61ca075fb9860e84,
533            fidl::encoding::DynamicFlags::FLEXIBLE,
534        )
535    }
536}
537
538mod internal {
539    use super::*;
540
541    impl fidl::encoding::ResourceTypeMarker for ChildInput {
542        type Borrowed<'a> = &'a mut Self;
543        fn take_or_borrow<'a>(
544            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
545        ) -> Self::Borrowed<'a> {
546            value
547        }
548    }
549
550    unsafe impl fidl::encoding::TypeMarker for ChildInput {
551        type Owned = Self;
552
553        #[inline(always)]
554        fn inline_align(_context: fidl::encoding::Context) -> usize {
555            8
556        }
557
558        #[inline(always)]
559        fn inline_size(_context: fidl::encoding::Context) -> usize {
560            24
561        }
562    }
563
564    unsafe impl fidl::encoding::Encode<ChildInput, fidl::encoding::DefaultFuchsiaResourceDialect>
565        for &mut ChildInput
566    {
567        #[inline]
568        unsafe fn encode(
569            self,
570            encoder: &mut fidl::encoding::Encoder<
571                '_,
572                fidl::encoding::DefaultFuchsiaResourceDialect,
573            >,
574            offset: usize,
575            _depth: fidl::encoding::Depth,
576        ) -> fidl::Result<()> {
577            encoder.debug_check_bounds::<ChildInput>(offset);
578            // Delegate to tuple encoding.
579            fidl::encoding::Encode::<ChildInput, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
580                (
581                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.child_name),
582                    <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.child_input),
583                ),
584                encoder, offset, _depth
585            )
586        }
587    }
588    unsafe impl<
589        T0: fidl::encoding::Encode<
590                fidl::encoding::BoundedString<1024>,
591                fidl::encoding::DefaultFuchsiaResourceDialect,
592            >,
593        T1: fidl::encoding::Encode<
594                fidl_fuchsia_component_sandbox::DictionaryRef,
595                fidl::encoding::DefaultFuchsiaResourceDialect,
596            >,
597    > fidl::encoding::Encode<ChildInput, fidl::encoding::DefaultFuchsiaResourceDialect>
598        for (T0, T1)
599    {
600        #[inline]
601        unsafe fn encode(
602            self,
603            encoder: &mut fidl::encoding::Encoder<
604                '_,
605                fidl::encoding::DefaultFuchsiaResourceDialect,
606            >,
607            offset: usize,
608            depth: fidl::encoding::Depth,
609        ) -> fidl::Result<()> {
610            encoder.debug_check_bounds::<ChildInput>(offset);
611            // Zero out padding regions. There's no need to apply masks
612            // because the unmasked parts will be overwritten by fields.
613            unsafe {
614                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
615                (ptr as *mut u64).write_unaligned(0);
616            }
617            // Write the fields.
618            self.0.encode(encoder, offset + 0, depth)?;
619            self.1.encode(encoder, offset + 16, depth)?;
620            Ok(())
621        }
622    }
623
624    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ChildInput {
625        #[inline(always)]
626        fn new_empty() -> Self {
627            Self {
628                child_name: fidl::new_empty!(
629                    fidl::encoding::BoundedString<1024>,
630                    fidl::encoding::DefaultFuchsiaResourceDialect
631                ),
632                child_input: fidl::new_empty!(
633                    fidl_fuchsia_component_sandbox::DictionaryRef,
634                    fidl::encoding::DefaultFuchsiaResourceDialect
635                ),
636            }
637        }
638
639        #[inline]
640        unsafe fn decode(
641            &mut self,
642            decoder: &mut fidl::encoding::Decoder<
643                '_,
644                fidl::encoding::DefaultFuchsiaResourceDialect,
645            >,
646            offset: usize,
647            _depth: fidl::encoding::Depth,
648        ) -> fidl::Result<()> {
649            decoder.debug_check_bounds::<Self>(offset);
650            // Verify that padding bytes are zero.
651            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
652            let padval = unsafe { (ptr as *const u64).read_unaligned() };
653            let mask = 0xffffffff00000000u64;
654            let maskedval = padval & mask;
655            if maskedval != 0 {
656                return Err(fidl::Error::NonZeroPadding {
657                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
658                });
659            }
660            fidl::decode!(
661                fidl::encoding::BoundedString<1024>,
662                fidl::encoding::DefaultFuchsiaResourceDialect,
663                &mut self.child_name,
664                decoder,
665                offset + 0,
666                _depth
667            )?;
668            fidl::decode!(
669                fidl_fuchsia_component_sandbox::DictionaryRef,
670                fidl::encoding::DefaultFuchsiaResourceDialect,
671                &mut self.child_input,
672                decoder,
673                offset + 16,
674                _depth
675            )?;
676            Ok(())
677        }
678    }
679
680    impl ComponentSandbox {
681        #[inline(always)]
682        fn max_ordinal_present(&self) -> u64 {
683            if let Some(_) = self.collection_inputs {
684                return 9;
685            }
686            if let Some(_) = self.child_inputs {
687                return 8;
688            }
689            if let Some(_) = self.declared_dictionaries {
690                return 7;
691            }
692            if let Some(_) = self.capability_sourced {
693                return 6;
694            }
695            if let Some(_) = self.reserved {
696                return 5;
697            }
698            if let Some(_) = self.program_output {
699                return 4;
700            }
701            if let Some(_) = self.program_input {
702                return 3;
703            }
704            if let Some(_) = self.component_output {
705                return 2;
706            }
707            if let Some(_) = self.component_input {
708                return 1;
709            }
710            0
711        }
712    }
713
714    impl fidl::encoding::ResourceTypeMarker for ComponentSandbox {
715        type Borrowed<'a> = &'a mut Self;
716        fn take_or_borrow<'a>(
717            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
718        ) -> Self::Borrowed<'a> {
719            value
720        }
721    }
722
723    unsafe impl fidl::encoding::TypeMarker for ComponentSandbox {
724        type Owned = Self;
725
726        #[inline(always)]
727        fn inline_align(_context: fidl::encoding::Context) -> usize {
728            8
729        }
730
731        #[inline(always)]
732        fn inline_size(_context: fidl::encoding::Context) -> usize {
733            16
734        }
735    }
736
737    unsafe impl
738        fidl::encoding::Encode<ComponentSandbox, fidl::encoding::DefaultFuchsiaResourceDialect>
739        for &mut ComponentSandbox
740    {
741        unsafe fn encode(
742            self,
743            encoder: &mut fidl::encoding::Encoder<
744                '_,
745                fidl::encoding::DefaultFuchsiaResourceDialect,
746            >,
747            offset: usize,
748            mut depth: fidl::encoding::Depth,
749        ) -> fidl::Result<()> {
750            encoder.debug_check_bounds::<ComponentSandbox>(offset);
751            // Vector header
752            let max_ordinal: u64 = self.max_ordinal_present();
753            encoder.write_num(max_ordinal, offset);
754            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
755            // Calling encoder.out_of_line_offset(0) is not allowed.
756            if max_ordinal == 0 {
757                return Ok(());
758            }
759            depth.increment()?;
760            let envelope_size = 8;
761            let bytes_len = max_ordinal as usize * envelope_size;
762            #[allow(unused_variables)]
763            let offset = encoder.out_of_line_offset(bytes_len);
764            let mut _prev_end_offset: usize = 0;
765            if 1 > max_ordinal {
766                return Ok(());
767            }
768
769            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
770            // are envelope_size bytes.
771            let cur_offset: usize = (1 - 1) * envelope_size;
772
773            // Zero reserved fields.
774            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
775
776            // Safety:
777            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
778            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
779            //   envelope_size bytes, there is always sufficient room.
780            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
781            self.component_input.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
782            encoder, offset + cur_offset, depth
783        )?;
784
785            _prev_end_offset = cur_offset + envelope_size;
786            if 2 > max_ordinal {
787                return Ok(());
788            }
789
790            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
791            // are envelope_size bytes.
792            let cur_offset: usize = (2 - 1) * envelope_size;
793
794            // Zero reserved fields.
795            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
796
797            // Safety:
798            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
799            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
800            //   envelope_size bytes, there is always sufficient room.
801            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
802            self.component_output.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
803            encoder, offset + cur_offset, depth
804        )?;
805
806            _prev_end_offset = cur_offset + envelope_size;
807            if 3 > max_ordinal {
808                return Ok(());
809            }
810
811            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
812            // are envelope_size bytes.
813            let cur_offset: usize = (3 - 1) * envelope_size;
814
815            // Zero reserved fields.
816            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
817
818            // Safety:
819            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
820            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
821            //   envelope_size bytes, there is always sufficient room.
822            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
823            self.program_input.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
824            encoder, offset + cur_offset, depth
825        )?;
826
827            _prev_end_offset = cur_offset + envelope_size;
828            if 4 > max_ordinal {
829                return Ok(());
830            }
831
832            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
833            // are envelope_size bytes.
834            let cur_offset: usize = (4 - 1) * envelope_size;
835
836            // Zero reserved fields.
837            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
838
839            // Safety:
840            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
841            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
842            //   envelope_size bytes, there is always sufficient room.
843            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
844            self.program_output.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
845            encoder, offset + cur_offset, depth
846        )?;
847
848            _prev_end_offset = cur_offset + envelope_size;
849            if 5 > max_ordinal {
850                return Ok(());
851            }
852
853            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
854            // are envelope_size bytes.
855            let cur_offset: usize = (5 - 1) * envelope_size;
856
857            // Zero reserved fields.
858            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
859
860            // Safety:
861            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
862            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
863            //   envelope_size bytes, there is always sufficient room.
864            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
865            self.reserved.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
866            encoder, offset + cur_offset, depth
867        )?;
868
869            _prev_end_offset = cur_offset + envelope_size;
870            if 6 > max_ordinal {
871                return Ok(());
872            }
873
874            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
875            // are envelope_size bytes.
876            let cur_offset: usize = (6 - 1) * envelope_size;
877
878            // Zero reserved fields.
879            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
880
881            // Safety:
882            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
883            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
884            //   envelope_size bytes, there is always sufficient room.
885            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
886            self.capability_sourced.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
887            encoder, offset + cur_offset, depth
888        )?;
889
890            _prev_end_offset = cur_offset + envelope_size;
891            if 7 > max_ordinal {
892                return Ok(());
893            }
894
895            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
896            // are envelope_size bytes.
897            let cur_offset: usize = (7 - 1) * envelope_size;
898
899            // Zero reserved fields.
900            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
901
902            // Safety:
903            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
904            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
905            //   envelope_size bytes, there is always sufficient room.
906            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
907            self.declared_dictionaries.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
908            encoder, offset + cur_offset, depth
909        )?;
910
911            _prev_end_offset = cur_offset + envelope_size;
912            if 8 > max_ordinal {
913                return Ok(());
914            }
915
916            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
917            // are envelope_size bytes.
918            let cur_offset: usize = (8 - 1) * envelope_size;
919
920            // Zero reserved fields.
921            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
922
923            // Safety:
924            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
925            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
926            //   envelope_size bytes, there is always sufficient room.
927            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ChildInput>, fidl::encoding::DefaultFuchsiaResourceDialect>(
928            self.child_inputs.as_mut().map(<fidl::encoding::UnboundedVector<ChildInput> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
929            encoder, offset + cur_offset, depth
930        )?;
931
932            _prev_end_offset = cur_offset + envelope_size;
933            if 9 > max_ordinal {
934                return Ok(());
935            }
936
937            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
938            // are envelope_size bytes.
939            let cur_offset: usize = (9 - 1) * envelope_size;
940
941            // Zero reserved fields.
942            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
943
944            // Safety:
945            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
946            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
947            //   envelope_size bytes, there is always sufficient room.
948            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ChildInput>, fidl::encoding::DefaultFuchsiaResourceDialect>(
949            self.collection_inputs.as_mut().map(<fidl::encoding::UnboundedVector<ChildInput> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
950            encoder, offset + cur_offset, depth
951        )?;
952
953            _prev_end_offset = cur_offset + envelope_size;
954
955            Ok(())
956        }
957    }
958
959    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
960        for ComponentSandbox
961    {
962        #[inline(always)]
963        fn new_empty() -> Self {
964            Self::default()
965        }
966
967        unsafe fn decode(
968            &mut self,
969            decoder: &mut fidl::encoding::Decoder<
970                '_,
971                fidl::encoding::DefaultFuchsiaResourceDialect,
972            >,
973            offset: usize,
974            mut depth: fidl::encoding::Depth,
975        ) -> fidl::Result<()> {
976            decoder.debug_check_bounds::<Self>(offset);
977            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
978                None => return Err(fidl::Error::NotNullable),
979                Some(len) => len,
980            };
981            // Calling decoder.out_of_line_offset(0) is not allowed.
982            if len == 0 {
983                return Ok(());
984            };
985            depth.increment()?;
986            let envelope_size = 8;
987            let bytes_len = len * envelope_size;
988            let offset = decoder.out_of_line_offset(bytes_len)?;
989            // Decode the envelope for each type.
990            let mut _next_ordinal_to_read = 0;
991            let mut next_offset = offset;
992            let end_offset = offset + bytes_len;
993            _next_ordinal_to_read += 1;
994            if next_offset >= end_offset {
995                return Ok(());
996            }
997
998            // Decode unknown envelopes for gaps in ordinals.
999            while _next_ordinal_to_read < 1 {
1000                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1001                _next_ordinal_to_read += 1;
1002                next_offset += envelope_size;
1003            }
1004
1005            let next_out_of_line = decoder.next_out_of_line();
1006            let handles_before = decoder.remaining_handles();
1007            if let Some((inlined, num_bytes, num_handles)) =
1008                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1009            {
1010                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1011                if inlined != (member_inline_size <= 4) {
1012                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1013                }
1014                let inner_offset;
1015                let mut inner_depth = depth.clone();
1016                if inlined {
1017                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1018                    inner_offset = next_offset;
1019                } else {
1020                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1021                    inner_depth.increment()?;
1022                }
1023                let val_ref = self.component_input.get_or_insert_with(|| {
1024                    fidl::new_empty!(
1025                        fidl_fuchsia_component_sandbox::DictionaryRef,
1026                        fidl::encoding::DefaultFuchsiaResourceDialect
1027                    )
1028                });
1029                fidl::decode!(
1030                    fidl_fuchsia_component_sandbox::DictionaryRef,
1031                    fidl::encoding::DefaultFuchsiaResourceDialect,
1032                    val_ref,
1033                    decoder,
1034                    inner_offset,
1035                    inner_depth
1036                )?;
1037                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1038                {
1039                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1040                }
1041                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1042                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1043                }
1044            }
1045
1046            next_offset += envelope_size;
1047            _next_ordinal_to_read += 1;
1048            if next_offset >= end_offset {
1049                return Ok(());
1050            }
1051
1052            // Decode unknown envelopes for gaps in ordinals.
1053            while _next_ordinal_to_read < 2 {
1054                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1055                _next_ordinal_to_read += 1;
1056                next_offset += envelope_size;
1057            }
1058
1059            let next_out_of_line = decoder.next_out_of_line();
1060            let handles_before = decoder.remaining_handles();
1061            if let Some((inlined, num_bytes, num_handles)) =
1062                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1063            {
1064                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1065                if inlined != (member_inline_size <= 4) {
1066                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1067                }
1068                let inner_offset;
1069                let mut inner_depth = depth.clone();
1070                if inlined {
1071                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1072                    inner_offset = next_offset;
1073                } else {
1074                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1075                    inner_depth.increment()?;
1076                }
1077                let val_ref = self.component_output.get_or_insert_with(|| {
1078                    fidl::new_empty!(
1079                        fidl_fuchsia_component_sandbox::DictionaryRef,
1080                        fidl::encoding::DefaultFuchsiaResourceDialect
1081                    )
1082                });
1083                fidl::decode!(
1084                    fidl_fuchsia_component_sandbox::DictionaryRef,
1085                    fidl::encoding::DefaultFuchsiaResourceDialect,
1086                    val_ref,
1087                    decoder,
1088                    inner_offset,
1089                    inner_depth
1090                )?;
1091                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1092                {
1093                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1094                }
1095                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1096                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1097                }
1098            }
1099
1100            next_offset += envelope_size;
1101            _next_ordinal_to_read += 1;
1102            if next_offset >= end_offset {
1103                return Ok(());
1104            }
1105
1106            // Decode unknown envelopes for gaps in ordinals.
1107            while _next_ordinal_to_read < 3 {
1108                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1109                _next_ordinal_to_read += 1;
1110                next_offset += envelope_size;
1111            }
1112
1113            let next_out_of_line = decoder.next_out_of_line();
1114            let handles_before = decoder.remaining_handles();
1115            if let Some((inlined, num_bytes, num_handles)) =
1116                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1117            {
1118                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1119                if inlined != (member_inline_size <= 4) {
1120                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1121                }
1122                let inner_offset;
1123                let mut inner_depth = depth.clone();
1124                if inlined {
1125                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1126                    inner_offset = next_offset;
1127                } else {
1128                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1129                    inner_depth.increment()?;
1130                }
1131                let val_ref = self.program_input.get_or_insert_with(|| {
1132                    fidl::new_empty!(
1133                        fidl_fuchsia_component_sandbox::DictionaryRef,
1134                        fidl::encoding::DefaultFuchsiaResourceDialect
1135                    )
1136                });
1137                fidl::decode!(
1138                    fidl_fuchsia_component_sandbox::DictionaryRef,
1139                    fidl::encoding::DefaultFuchsiaResourceDialect,
1140                    val_ref,
1141                    decoder,
1142                    inner_offset,
1143                    inner_depth
1144                )?;
1145                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1146                {
1147                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1148                }
1149                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1150                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1151                }
1152            }
1153
1154            next_offset += envelope_size;
1155            _next_ordinal_to_read += 1;
1156            if next_offset >= end_offset {
1157                return Ok(());
1158            }
1159
1160            // Decode unknown envelopes for gaps in ordinals.
1161            while _next_ordinal_to_read < 4 {
1162                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1163                _next_ordinal_to_read += 1;
1164                next_offset += envelope_size;
1165            }
1166
1167            let next_out_of_line = decoder.next_out_of_line();
1168            let handles_before = decoder.remaining_handles();
1169            if let Some((inlined, num_bytes, num_handles)) =
1170                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1171            {
1172                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1173                if inlined != (member_inline_size <= 4) {
1174                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1175                }
1176                let inner_offset;
1177                let mut inner_depth = depth.clone();
1178                if inlined {
1179                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1180                    inner_offset = next_offset;
1181                } else {
1182                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1183                    inner_depth.increment()?;
1184                }
1185                let val_ref = self.program_output.get_or_insert_with(|| {
1186                    fidl::new_empty!(
1187                        fidl_fuchsia_component_sandbox::DictionaryRef,
1188                        fidl::encoding::DefaultFuchsiaResourceDialect
1189                    )
1190                });
1191                fidl::decode!(
1192                    fidl_fuchsia_component_sandbox::DictionaryRef,
1193                    fidl::encoding::DefaultFuchsiaResourceDialect,
1194                    val_ref,
1195                    decoder,
1196                    inner_offset,
1197                    inner_depth
1198                )?;
1199                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1200                {
1201                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1202                }
1203                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1204                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1205                }
1206            }
1207
1208            next_offset += envelope_size;
1209            _next_ordinal_to_read += 1;
1210            if next_offset >= end_offset {
1211                return Ok(());
1212            }
1213
1214            // Decode unknown envelopes for gaps in ordinals.
1215            while _next_ordinal_to_read < 5 {
1216                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1217                _next_ordinal_to_read += 1;
1218                next_offset += envelope_size;
1219            }
1220
1221            let next_out_of_line = decoder.next_out_of_line();
1222            let handles_before = decoder.remaining_handles();
1223            if let Some((inlined, num_bytes, num_handles)) =
1224                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1225            {
1226                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1227                if inlined != (member_inline_size <= 4) {
1228                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1229                }
1230                let inner_offset;
1231                let mut inner_depth = depth.clone();
1232                if inlined {
1233                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1234                    inner_offset = next_offset;
1235                } else {
1236                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1237                    inner_depth.increment()?;
1238                }
1239                let val_ref = self.reserved.get_or_insert_with(|| {
1240                    fidl::new_empty!(
1241                        fidl_fuchsia_component_sandbox::DictionaryRef,
1242                        fidl::encoding::DefaultFuchsiaResourceDialect
1243                    )
1244                });
1245                fidl::decode!(
1246                    fidl_fuchsia_component_sandbox::DictionaryRef,
1247                    fidl::encoding::DefaultFuchsiaResourceDialect,
1248                    val_ref,
1249                    decoder,
1250                    inner_offset,
1251                    inner_depth
1252                )?;
1253                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1254                {
1255                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1256                }
1257                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1258                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1259                }
1260            }
1261
1262            next_offset += envelope_size;
1263            _next_ordinal_to_read += 1;
1264            if next_offset >= end_offset {
1265                return Ok(());
1266            }
1267
1268            // Decode unknown envelopes for gaps in ordinals.
1269            while _next_ordinal_to_read < 6 {
1270                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1271                _next_ordinal_to_read += 1;
1272                next_offset += envelope_size;
1273            }
1274
1275            let next_out_of_line = decoder.next_out_of_line();
1276            let handles_before = decoder.remaining_handles();
1277            if let Some((inlined, num_bytes, num_handles)) =
1278                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1279            {
1280                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1281                if inlined != (member_inline_size <= 4) {
1282                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1283                }
1284                let inner_offset;
1285                let mut inner_depth = depth.clone();
1286                if inlined {
1287                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1288                    inner_offset = next_offset;
1289                } else {
1290                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1291                    inner_depth.increment()?;
1292                }
1293                let val_ref = self.capability_sourced.get_or_insert_with(|| {
1294                    fidl::new_empty!(
1295                        fidl_fuchsia_component_sandbox::DictionaryRef,
1296                        fidl::encoding::DefaultFuchsiaResourceDialect
1297                    )
1298                });
1299                fidl::decode!(
1300                    fidl_fuchsia_component_sandbox::DictionaryRef,
1301                    fidl::encoding::DefaultFuchsiaResourceDialect,
1302                    val_ref,
1303                    decoder,
1304                    inner_offset,
1305                    inner_depth
1306                )?;
1307                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1308                {
1309                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1310                }
1311                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1312                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1313                }
1314            }
1315
1316            next_offset += envelope_size;
1317            _next_ordinal_to_read += 1;
1318            if next_offset >= end_offset {
1319                return Ok(());
1320            }
1321
1322            // Decode unknown envelopes for gaps in ordinals.
1323            while _next_ordinal_to_read < 7 {
1324                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1325                _next_ordinal_to_read += 1;
1326                next_offset += envelope_size;
1327            }
1328
1329            let next_out_of_line = decoder.next_out_of_line();
1330            let handles_before = decoder.remaining_handles();
1331            if let Some((inlined, num_bytes, num_handles)) =
1332                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1333            {
1334                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1335                if inlined != (member_inline_size <= 4) {
1336                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1337                }
1338                let inner_offset;
1339                let mut inner_depth = depth.clone();
1340                if inlined {
1341                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1342                    inner_offset = next_offset;
1343                } else {
1344                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1345                    inner_depth.increment()?;
1346                }
1347                let val_ref = self.declared_dictionaries.get_or_insert_with(|| {
1348                    fidl::new_empty!(
1349                        fidl_fuchsia_component_sandbox::DictionaryRef,
1350                        fidl::encoding::DefaultFuchsiaResourceDialect
1351                    )
1352                });
1353                fidl::decode!(
1354                    fidl_fuchsia_component_sandbox::DictionaryRef,
1355                    fidl::encoding::DefaultFuchsiaResourceDialect,
1356                    val_ref,
1357                    decoder,
1358                    inner_offset,
1359                    inner_depth
1360                )?;
1361                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1362                {
1363                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1364                }
1365                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1366                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1367                }
1368            }
1369
1370            next_offset += envelope_size;
1371            _next_ordinal_to_read += 1;
1372            if next_offset >= end_offset {
1373                return Ok(());
1374            }
1375
1376            // Decode unknown envelopes for gaps in ordinals.
1377            while _next_ordinal_to_read < 8 {
1378                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1379                _next_ordinal_to_read += 1;
1380                next_offset += envelope_size;
1381            }
1382
1383            let next_out_of_line = decoder.next_out_of_line();
1384            let handles_before = decoder.remaining_handles();
1385            if let Some((inlined, num_bytes, num_handles)) =
1386                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1387            {
1388                let member_inline_size = <fidl::encoding::UnboundedVector<ChildInput> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1389                if inlined != (member_inline_size <= 4) {
1390                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1391                }
1392                let inner_offset;
1393                let mut inner_depth = depth.clone();
1394                if inlined {
1395                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1396                    inner_offset = next_offset;
1397                } else {
1398                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1399                    inner_depth.increment()?;
1400                }
1401                let val_ref = self.child_inputs.get_or_insert_with(|| {
1402                    fidl::new_empty!(
1403                        fidl::encoding::UnboundedVector<ChildInput>,
1404                        fidl::encoding::DefaultFuchsiaResourceDialect
1405                    )
1406                });
1407                fidl::decode!(
1408                    fidl::encoding::UnboundedVector<ChildInput>,
1409                    fidl::encoding::DefaultFuchsiaResourceDialect,
1410                    val_ref,
1411                    decoder,
1412                    inner_offset,
1413                    inner_depth
1414                )?;
1415                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1416                {
1417                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1418                }
1419                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1420                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1421                }
1422            }
1423
1424            next_offset += envelope_size;
1425            _next_ordinal_to_read += 1;
1426            if next_offset >= end_offset {
1427                return Ok(());
1428            }
1429
1430            // Decode unknown envelopes for gaps in ordinals.
1431            while _next_ordinal_to_read < 9 {
1432                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1433                _next_ordinal_to_read += 1;
1434                next_offset += envelope_size;
1435            }
1436
1437            let next_out_of_line = decoder.next_out_of_line();
1438            let handles_before = decoder.remaining_handles();
1439            if let Some((inlined, num_bytes, num_handles)) =
1440                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1441            {
1442                let member_inline_size = <fidl::encoding::UnboundedVector<ChildInput> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1443                if inlined != (member_inline_size <= 4) {
1444                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1445                }
1446                let inner_offset;
1447                let mut inner_depth = depth.clone();
1448                if inlined {
1449                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1450                    inner_offset = next_offset;
1451                } else {
1452                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1453                    inner_depth.increment()?;
1454                }
1455                let val_ref = self.collection_inputs.get_or_insert_with(|| {
1456                    fidl::new_empty!(
1457                        fidl::encoding::UnboundedVector<ChildInput>,
1458                        fidl::encoding::DefaultFuchsiaResourceDialect
1459                    )
1460                });
1461                fidl::decode!(
1462                    fidl::encoding::UnboundedVector<ChildInput>,
1463                    fidl::encoding::DefaultFuchsiaResourceDialect,
1464                    val_ref,
1465                    decoder,
1466                    inner_offset,
1467                    inner_depth
1468                )?;
1469                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1470                {
1471                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1472                }
1473                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1474                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1475                }
1476            }
1477
1478            next_offset += envelope_size;
1479
1480            // Decode the remaining unknown envelopes.
1481            while next_offset < end_offset {
1482                _next_ordinal_to_read += 1;
1483                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1484                next_offset += envelope_size;
1485            }
1486
1487            Ok(())
1488        }
1489    }
1490}