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