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#[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    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
451        self.inner.shutdown_with_epitaph(status)
452    }
453
454    fn is_closed(&self) -> bool {
455        self.inner.channel().is_closed()
456    }
457    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
458        self.inner.channel().on_closed()
459    }
460
461    #[cfg(target_os = "fuchsia")]
462    fn signal_peer(
463        &self,
464        clear_mask: zx::Signals,
465        set_mask: zx::Signals,
466    ) -> Result<(), zx_status::Status> {
467        use fidl::Peered;
468        self.inner.channel().signal_peer(clear_mask, set_mask)
469    }
470}
471
472impl ComponentSandboxRetrieverControlHandle {}
473
474#[must_use = "FIDL methods require a response to be sent"]
475#[derive(Debug)]
476pub struct ComponentSandboxRetrieverGetMySandboxResponder {
477    control_handle: std::mem::ManuallyDrop<ComponentSandboxRetrieverControlHandle>,
478    tx_id: u32,
479}
480
481/// Set the the channel to be shutdown (see [`ComponentSandboxRetrieverControlHandle::shutdown`])
482/// if the responder is dropped without sending a response, so that the client
483/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
484impl std::ops::Drop for ComponentSandboxRetrieverGetMySandboxResponder {
485    fn drop(&mut self) {
486        self.control_handle.shutdown();
487        // Safety: drops once, never accessed again
488        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
489    }
490}
491
492impl fidl::endpoints::Responder for ComponentSandboxRetrieverGetMySandboxResponder {
493    type ControlHandle = ComponentSandboxRetrieverControlHandle;
494
495    fn control_handle(&self) -> &ComponentSandboxRetrieverControlHandle {
496        &self.control_handle
497    }
498
499    fn drop_without_shutdown(mut self) {
500        // Safety: drops once, never accessed again due to mem::forget
501        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
502        // Prevent Drop from running (which would shut down the channel)
503        std::mem::forget(self);
504    }
505}
506
507impl ComponentSandboxRetrieverGetMySandboxResponder {
508    /// Sends a response to the FIDL transaction.
509    ///
510    /// Sets the channel to shutdown if an error occurs.
511    pub fn send(self, mut payload: ComponentSandbox) -> Result<(), fidl::Error> {
512        let _result = self.send_raw(payload);
513        if _result.is_err() {
514            self.control_handle.shutdown();
515        }
516        self.drop_without_shutdown();
517        _result
518    }
519
520    /// Similar to "send" but does not shutdown the channel if an error occurs.
521    pub fn send_no_shutdown_on_err(self, mut payload: ComponentSandbox) -> Result<(), fidl::Error> {
522        let _result = self.send_raw(payload);
523        self.drop_without_shutdown();
524        _result
525    }
526
527    fn send_raw(&self, mut payload: ComponentSandbox) -> Result<(), fidl::Error> {
528        self.control_handle.inner.send::<fidl::encoding::FlexibleType<ComponentSandbox>>(
529            fidl::encoding::Flexible::new(&mut payload),
530            self.tx_id,
531            0x61ca075fb9860e84,
532            fidl::encoding::DynamicFlags::FLEXIBLE,
533        )
534    }
535}
536
537mod internal {
538    use super::*;
539
540    impl fidl::encoding::ResourceTypeMarker for ChildInput {
541        type Borrowed<'a> = &'a mut Self;
542        fn take_or_borrow<'a>(
543            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
544        ) -> Self::Borrowed<'a> {
545            value
546        }
547    }
548
549    unsafe impl fidl::encoding::TypeMarker for ChildInput {
550        type Owned = Self;
551
552        #[inline(always)]
553        fn inline_align(_context: fidl::encoding::Context) -> usize {
554            8
555        }
556
557        #[inline(always)]
558        fn inline_size(_context: fidl::encoding::Context) -> usize {
559            24
560        }
561    }
562
563    unsafe impl fidl::encoding::Encode<ChildInput, fidl::encoding::DefaultFuchsiaResourceDialect>
564        for &mut ChildInput
565    {
566        #[inline]
567        unsafe fn encode(
568            self,
569            encoder: &mut fidl::encoding::Encoder<
570                '_,
571                fidl::encoding::DefaultFuchsiaResourceDialect,
572            >,
573            offset: usize,
574            _depth: fidl::encoding::Depth,
575        ) -> fidl::Result<()> {
576            encoder.debug_check_bounds::<ChildInput>(offset);
577            // Delegate to tuple encoding.
578            fidl::encoding::Encode::<ChildInput, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
579                (
580                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.child_name),
581                    <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.child_input),
582                ),
583                encoder, offset, _depth
584            )
585        }
586    }
587    unsafe impl<
588            T0: fidl::encoding::Encode<
589                fidl::encoding::BoundedString<1024>,
590                fidl::encoding::DefaultFuchsiaResourceDialect,
591            >,
592            T1: fidl::encoding::Encode<
593                fidl_fuchsia_component_sandbox::DictionaryRef,
594                fidl::encoding::DefaultFuchsiaResourceDialect,
595            >,
596        > fidl::encoding::Encode<ChildInput, fidl::encoding::DefaultFuchsiaResourceDialect>
597        for (T0, T1)
598    {
599        #[inline]
600        unsafe fn encode(
601            self,
602            encoder: &mut fidl::encoding::Encoder<
603                '_,
604                fidl::encoding::DefaultFuchsiaResourceDialect,
605            >,
606            offset: usize,
607            depth: fidl::encoding::Depth,
608        ) -> fidl::Result<()> {
609            encoder.debug_check_bounds::<ChildInput>(offset);
610            // Zero out padding regions. There's no need to apply masks
611            // because the unmasked parts will be overwritten by fields.
612            unsafe {
613                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
614                (ptr as *mut u64).write_unaligned(0);
615            }
616            // Write the fields.
617            self.0.encode(encoder, offset + 0, depth)?;
618            self.1.encode(encoder, offset + 16, depth)?;
619            Ok(())
620        }
621    }
622
623    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ChildInput {
624        #[inline(always)]
625        fn new_empty() -> Self {
626            Self {
627                child_name: fidl::new_empty!(
628                    fidl::encoding::BoundedString<1024>,
629                    fidl::encoding::DefaultFuchsiaResourceDialect
630                ),
631                child_input: fidl::new_empty!(
632                    fidl_fuchsia_component_sandbox::DictionaryRef,
633                    fidl::encoding::DefaultFuchsiaResourceDialect
634                ),
635            }
636        }
637
638        #[inline]
639        unsafe fn decode(
640            &mut self,
641            decoder: &mut fidl::encoding::Decoder<
642                '_,
643                fidl::encoding::DefaultFuchsiaResourceDialect,
644            >,
645            offset: usize,
646            _depth: fidl::encoding::Depth,
647        ) -> fidl::Result<()> {
648            decoder.debug_check_bounds::<Self>(offset);
649            // Verify that padding bytes are zero.
650            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
651            let padval = unsafe { (ptr as *const u64).read_unaligned() };
652            let mask = 0xffffffff00000000u64;
653            let maskedval = padval & mask;
654            if maskedval != 0 {
655                return Err(fidl::Error::NonZeroPadding {
656                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
657                });
658            }
659            fidl::decode!(
660                fidl::encoding::BoundedString<1024>,
661                fidl::encoding::DefaultFuchsiaResourceDialect,
662                &mut self.child_name,
663                decoder,
664                offset + 0,
665                _depth
666            )?;
667            fidl::decode!(
668                fidl_fuchsia_component_sandbox::DictionaryRef,
669                fidl::encoding::DefaultFuchsiaResourceDialect,
670                &mut self.child_input,
671                decoder,
672                offset + 16,
673                _depth
674            )?;
675            Ok(())
676        }
677    }
678
679    impl ComponentSandbox {
680        #[inline(always)]
681        fn max_ordinal_present(&self) -> u64 {
682            if let Some(_) = self.collection_inputs {
683                return 9;
684            }
685            if let Some(_) = self.child_inputs {
686                return 8;
687            }
688            if let Some(_) = self.declared_dictionaries {
689                return 7;
690            }
691            if let Some(_) = self.capability_sourced {
692                return 6;
693            }
694            if let Some(_) = self.framework_output {
695                return 5;
696            }
697            if let Some(_) = self.program_output {
698                return 4;
699            }
700            if let Some(_) = self.program_input {
701                return 3;
702            }
703            if let Some(_) = self.component_output {
704                return 2;
705            }
706            if let Some(_) = self.component_input {
707                return 1;
708            }
709            0
710        }
711    }
712
713    impl fidl::encoding::ResourceTypeMarker for ComponentSandbox {
714        type Borrowed<'a> = &'a mut Self;
715        fn take_or_borrow<'a>(
716            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
717        ) -> Self::Borrowed<'a> {
718            value
719        }
720    }
721
722    unsafe impl fidl::encoding::TypeMarker for ComponentSandbox {
723        type Owned = Self;
724
725        #[inline(always)]
726        fn inline_align(_context: fidl::encoding::Context) -> usize {
727            8
728        }
729
730        #[inline(always)]
731        fn inline_size(_context: fidl::encoding::Context) -> usize {
732            16
733        }
734    }
735
736    unsafe impl
737        fidl::encoding::Encode<ComponentSandbox, fidl::encoding::DefaultFuchsiaResourceDialect>
738        for &mut ComponentSandbox
739    {
740        unsafe fn encode(
741            self,
742            encoder: &mut fidl::encoding::Encoder<
743                '_,
744                fidl::encoding::DefaultFuchsiaResourceDialect,
745            >,
746            offset: usize,
747            mut depth: fidl::encoding::Depth,
748        ) -> fidl::Result<()> {
749            encoder.debug_check_bounds::<ComponentSandbox>(offset);
750            // Vector header
751            let max_ordinal: u64 = self.max_ordinal_present();
752            encoder.write_num(max_ordinal, offset);
753            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
754            // Calling encoder.out_of_line_offset(0) is not allowed.
755            if max_ordinal == 0 {
756                return Ok(());
757            }
758            depth.increment()?;
759            let envelope_size = 8;
760            let bytes_len = max_ordinal as usize * envelope_size;
761            #[allow(unused_variables)]
762            let offset = encoder.out_of_line_offset(bytes_len);
763            let mut _prev_end_offset: usize = 0;
764            if 1 > max_ordinal {
765                return Ok(());
766            }
767
768            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
769            // are envelope_size bytes.
770            let cur_offset: usize = (1 - 1) * envelope_size;
771
772            // Zero reserved fields.
773            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
774
775            // Safety:
776            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
777            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
778            //   envelope_size bytes, there is always sufficient room.
779            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
780            self.component_input.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
781            encoder, offset + cur_offset, depth
782        )?;
783
784            _prev_end_offset = cur_offset + envelope_size;
785            if 2 > max_ordinal {
786                return Ok(());
787            }
788
789            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
790            // are envelope_size bytes.
791            let cur_offset: usize = (2 - 1) * envelope_size;
792
793            // Zero reserved fields.
794            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
795
796            // Safety:
797            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
798            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
799            //   envelope_size bytes, there is always sufficient room.
800            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
801            self.component_output.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
802            encoder, offset + cur_offset, depth
803        )?;
804
805            _prev_end_offset = cur_offset + envelope_size;
806            if 3 > max_ordinal {
807                return Ok(());
808            }
809
810            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
811            // are envelope_size bytes.
812            let cur_offset: usize = (3 - 1) * envelope_size;
813
814            // Zero reserved fields.
815            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
816
817            // Safety:
818            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
819            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
820            //   envelope_size bytes, there is always sufficient room.
821            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
822            self.program_input.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
823            encoder, offset + cur_offset, depth
824        )?;
825
826            _prev_end_offset = cur_offset + envelope_size;
827            if 4 > max_ordinal {
828                return Ok(());
829            }
830
831            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
832            // are envelope_size bytes.
833            let cur_offset: usize = (4 - 1) * envelope_size;
834
835            // Zero reserved fields.
836            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
837
838            // Safety:
839            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
840            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
841            //   envelope_size bytes, there is always sufficient room.
842            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
843            self.program_output.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
844            encoder, offset + cur_offset, depth
845        )?;
846
847            _prev_end_offset = cur_offset + envelope_size;
848            if 5 > max_ordinal {
849                return Ok(());
850            }
851
852            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
853            // are envelope_size bytes.
854            let cur_offset: usize = (5 - 1) * envelope_size;
855
856            // Zero reserved fields.
857            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
858
859            // Safety:
860            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
861            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
862            //   envelope_size bytes, there is always sufficient room.
863            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
864            self.framework_output.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
865            encoder, offset + cur_offset, depth
866        )?;
867
868            _prev_end_offset = cur_offset + envelope_size;
869            if 6 > max_ordinal {
870                return Ok(());
871            }
872
873            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
874            // are envelope_size bytes.
875            let cur_offset: usize = (6 - 1) * envelope_size;
876
877            // Zero reserved fields.
878            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
879
880            // Safety:
881            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
882            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
883            //   envelope_size bytes, there is always sufficient room.
884            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
885            self.capability_sourced.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
886            encoder, offset + cur_offset, depth
887        )?;
888
889            _prev_end_offset = cur_offset + envelope_size;
890            if 7 > max_ordinal {
891                return Ok(());
892            }
893
894            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
895            // are envelope_size bytes.
896            let cur_offset: usize = (7 - 1) * envelope_size;
897
898            // Zero reserved fields.
899            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
900
901            // Safety:
902            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
903            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
904            //   envelope_size bytes, there is always sufficient room.
905            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
906            self.declared_dictionaries.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
907            encoder, offset + cur_offset, depth
908        )?;
909
910            _prev_end_offset = cur_offset + envelope_size;
911            if 8 > max_ordinal {
912                return Ok(());
913            }
914
915            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
916            // are envelope_size bytes.
917            let cur_offset: usize = (8 - 1) * envelope_size;
918
919            // Zero reserved fields.
920            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
921
922            // Safety:
923            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
924            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
925            //   envelope_size bytes, there is always sufficient room.
926            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ChildInput>, fidl::encoding::DefaultFuchsiaResourceDialect>(
927            self.child_inputs.as_mut().map(<fidl::encoding::UnboundedVector<ChildInput> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
928            encoder, offset + cur_offset, depth
929        )?;
930
931            _prev_end_offset = cur_offset + envelope_size;
932            if 9 > max_ordinal {
933                return Ok(());
934            }
935
936            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
937            // are envelope_size bytes.
938            let cur_offset: usize = (9 - 1) * envelope_size;
939
940            // Zero reserved fields.
941            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
942
943            // Safety:
944            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
945            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
946            //   envelope_size bytes, there is always sufficient room.
947            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ChildInput>, fidl::encoding::DefaultFuchsiaResourceDialect>(
948            self.collection_inputs.as_mut().map(<fidl::encoding::UnboundedVector<ChildInput> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
949            encoder, offset + cur_offset, depth
950        )?;
951
952            _prev_end_offset = cur_offset + envelope_size;
953
954            Ok(())
955        }
956    }
957
958    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
959        for ComponentSandbox
960    {
961        #[inline(always)]
962        fn new_empty() -> Self {
963            Self::default()
964        }
965
966        unsafe fn decode(
967            &mut self,
968            decoder: &mut fidl::encoding::Decoder<
969                '_,
970                fidl::encoding::DefaultFuchsiaResourceDialect,
971            >,
972            offset: usize,
973            mut depth: fidl::encoding::Depth,
974        ) -> fidl::Result<()> {
975            decoder.debug_check_bounds::<Self>(offset);
976            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
977                None => return Err(fidl::Error::NotNullable),
978                Some(len) => len,
979            };
980            // Calling decoder.out_of_line_offset(0) is not allowed.
981            if len == 0 {
982                return Ok(());
983            };
984            depth.increment()?;
985            let envelope_size = 8;
986            let bytes_len = len * envelope_size;
987            let offset = decoder.out_of_line_offset(bytes_len)?;
988            // Decode the envelope for each type.
989            let mut _next_ordinal_to_read = 0;
990            let mut next_offset = offset;
991            let end_offset = offset + bytes_len;
992            _next_ordinal_to_read += 1;
993            if next_offset >= end_offset {
994                return Ok(());
995            }
996
997            // Decode unknown envelopes for gaps in ordinals.
998            while _next_ordinal_to_read < 1 {
999                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1000                _next_ordinal_to_read += 1;
1001                next_offset += envelope_size;
1002            }
1003
1004            let next_out_of_line = decoder.next_out_of_line();
1005            let handles_before = decoder.remaining_handles();
1006            if let Some((inlined, num_bytes, num_handles)) =
1007                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1008            {
1009                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1010                if inlined != (member_inline_size <= 4) {
1011                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1012                }
1013                let inner_offset;
1014                let mut inner_depth = depth.clone();
1015                if inlined {
1016                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1017                    inner_offset = next_offset;
1018                } else {
1019                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1020                    inner_depth.increment()?;
1021                }
1022                let val_ref = self.component_input.get_or_insert_with(|| {
1023                    fidl::new_empty!(
1024                        fidl_fuchsia_component_sandbox::DictionaryRef,
1025                        fidl::encoding::DefaultFuchsiaResourceDialect
1026                    )
1027                });
1028                fidl::decode!(
1029                    fidl_fuchsia_component_sandbox::DictionaryRef,
1030                    fidl::encoding::DefaultFuchsiaResourceDialect,
1031                    val_ref,
1032                    decoder,
1033                    inner_offset,
1034                    inner_depth
1035                )?;
1036                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1037                {
1038                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1039                }
1040                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1041                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1042                }
1043            }
1044
1045            next_offset += envelope_size;
1046            _next_ordinal_to_read += 1;
1047            if next_offset >= end_offset {
1048                return Ok(());
1049            }
1050
1051            // Decode unknown envelopes for gaps in ordinals.
1052            while _next_ordinal_to_read < 2 {
1053                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1054                _next_ordinal_to_read += 1;
1055                next_offset += envelope_size;
1056            }
1057
1058            let next_out_of_line = decoder.next_out_of_line();
1059            let handles_before = decoder.remaining_handles();
1060            if let Some((inlined, num_bytes, num_handles)) =
1061                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1062            {
1063                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1064                if inlined != (member_inline_size <= 4) {
1065                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1066                }
1067                let inner_offset;
1068                let mut inner_depth = depth.clone();
1069                if inlined {
1070                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1071                    inner_offset = next_offset;
1072                } else {
1073                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1074                    inner_depth.increment()?;
1075                }
1076                let val_ref = self.component_output.get_or_insert_with(|| {
1077                    fidl::new_empty!(
1078                        fidl_fuchsia_component_sandbox::DictionaryRef,
1079                        fidl::encoding::DefaultFuchsiaResourceDialect
1080                    )
1081                });
1082                fidl::decode!(
1083                    fidl_fuchsia_component_sandbox::DictionaryRef,
1084                    fidl::encoding::DefaultFuchsiaResourceDialect,
1085                    val_ref,
1086                    decoder,
1087                    inner_offset,
1088                    inner_depth
1089                )?;
1090                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1091                {
1092                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1093                }
1094                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1095                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1096                }
1097            }
1098
1099            next_offset += envelope_size;
1100            _next_ordinal_to_read += 1;
1101            if next_offset >= end_offset {
1102                return Ok(());
1103            }
1104
1105            // Decode unknown envelopes for gaps in ordinals.
1106            while _next_ordinal_to_read < 3 {
1107                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1108                _next_ordinal_to_read += 1;
1109                next_offset += envelope_size;
1110            }
1111
1112            let next_out_of_line = decoder.next_out_of_line();
1113            let handles_before = decoder.remaining_handles();
1114            if let Some((inlined, num_bytes, num_handles)) =
1115                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1116            {
1117                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1118                if inlined != (member_inline_size <= 4) {
1119                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1120                }
1121                let inner_offset;
1122                let mut inner_depth = depth.clone();
1123                if inlined {
1124                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1125                    inner_offset = next_offset;
1126                } else {
1127                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1128                    inner_depth.increment()?;
1129                }
1130                let val_ref = self.program_input.get_or_insert_with(|| {
1131                    fidl::new_empty!(
1132                        fidl_fuchsia_component_sandbox::DictionaryRef,
1133                        fidl::encoding::DefaultFuchsiaResourceDialect
1134                    )
1135                });
1136                fidl::decode!(
1137                    fidl_fuchsia_component_sandbox::DictionaryRef,
1138                    fidl::encoding::DefaultFuchsiaResourceDialect,
1139                    val_ref,
1140                    decoder,
1141                    inner_offset,
1142                    inner_depth
1143                )?;
1144                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1145                {
1146                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1147                }
1148                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1149                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1150                }
1151            }
1152
1153            next_offset += envelope_size;
1154            _next_ordinal_to_read += 1;
1155            if next_offset >= end_offset {
1156                return Ok(());
1157            }
1158
1159            // Decode unknown envelopes for gaps in ordinals.
1160            while _next_ordinal_to_read < 4 {
1161                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1162                _next_ordinal_to_read += 1;
1163                next_offset += envelope_size;
1164            }
1165
1166            let next_out_of_line = decoder.next_out_of_line();
1167            let handles_before = decoder.remaining_handles();
1168            if let Some((inlined, num_bytes, num_handles)) =
1169                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1170            {
1171                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1172                if inlined != (member_inline_size <= 4) {
1173                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1174                }
1175                let inner_offset;
1176                let mut inner_depth = depth.clone();
1177                if inlined {
1178                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1179                    inner_offset = next_offset;
1180                } else {
1181                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1182                    inner_depth.increment()?;
1183                }
1184                let val_ref = self.program_output.get_or_insert_with(|| {
1185                    fidl::new_empty!(
1186                        fidl_fuchsia_component_sandbox::DictionaryRef,
1187                        fidl::encoding::DefaultFuchsiaResourceDialect
1188                    )
1189                });
1190                fidl::decode!(
1191                    fidl_fuchsia_component_sandbox::DictionaryRef,
1192                    fidl::encoding::DefaultFuchsiaResourceDialect,
1193                    val_ref,
1194                    decoder,
1195                    inner_offset,
1196                    inner_depth
1197                )?;
1198                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1199                {
1200                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1201                }
1202                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1203                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1204                }
1205            }
1206
1207            next_offset += envelope_size;
1208            _next_ordinal_to_read += 1;
1209            if next_offset >= end_offset {
1210                return Ok(());
1211            }
1212
1213            // Decode unknown envelopes for gaps in ordinals.
1214            while _next_ordinal_to_read < 5 {
1215                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1216                _next_ordinal_to_read += 1;
1217                next_offset += envelope_size;
1218            }
1219
1220            let next_out_of_line = decoder.next_out_of_line();
1221            let handles_before = decoder.remaining_handles();
1222            if let Some((inlined, num_bytes, num_handles)) =
1223                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1224            {
1225                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1226                if inlined != (member_inline_size <= 4) {
1227                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1228                }
1229                let inner_offset;
1230                let mut inner_depth = depth.clone();
1231                if inlined {
1232                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1233                    inner_offset = next_offset;
1234                } else {
1235                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1236                    inner_depth.increment()?;
1237                }
1238                let val_ref = self.framework_output.get_or_insert_with(|| {
1239                    fidl::new_empty!(
1240                        fidl_fuchsia_component_sandbox::DictionaryRef,
1241                        fidl::encoding::DefaultFuchsiaResourceDialect
1242                    )
1243                });
1244                fidl::decode!(
1245                    fidl_fuchsia_component_sandbox::DictionaryRef,
1246                    fidl::encoding::DefaultFuchsiaResourceDialect,
1247                    val_ref,
1248                    decoder,
1249                    inner_offset,
1250                    inner_depth
1251                )?;
1252                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1253                {
1254                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1255                }
1256                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1257                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1258                }
1259            }
1260
1261            next_offset += envelope_size;
1262            _next_ordinal_to_read += 1;
1263            if next_offset >= end_offset {
1264                return Ok(());
1265            }
1266
1267            // Decode unknown envelopes for gaps in ordinals.
1268            while _next_ordinal_to_read < 6 {
1269                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1270                _next_ordinal_to_read += 1;
1271                next_offset += envelope_size;
1272            }
1273
1274            let next_out_of_line = decoder.next_out_of_line();
1275            let handles_before = decoder.remaining_handles();
1276            if let Some((inlined, num_bytes, num_handles)) =
1277                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1278            {
1279                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1280                if inlined != (member_inline_size <= 4) {
1281                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1282                }
1283                let inner_offset;
1284                let mut inner_depth = depth.clone();
1285                if inlined {
1286                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1287                    inner_offset = next_offset;
1288                } else {
1289                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1290                    inner_depth.increment()?;
1291                }
1292                let val_ref = self.capability_sourced.get_or_insert_with(|| {
1293                    fidl::new_empty!(
1294                        fidl_fuchsia_component_sandbox::DictionaryRef,
1295                        fidl::encoding::DefaultFuchsiaResourceDialect
1296                    )
1297                });
1298                fidl::decode!(
1299                    fidl_fuchsia_component_sandbox::DictionaryRef,
1300                    fidl::encoding::DefaultFuchsiaResourceDialect,
1301                    val_ref,
1302                    decoder,
1303                    inner_offset,
1304                    inner_depth
1305                )?;
1306                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1307                {
1308                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1309                }
1310                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1311                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1312                }
1313            }
1314
1315            next_offset += envelope_size;
1316            _next_ordinal_to_read += 1;
1317            if next_offset >= end_offset {
1318                return Ok(());
1319            }
1320
1321            // Decode unknown envelopes for gaps in ordinals.
1322            while _next_ordinal_to_read < 7 {
1323                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1324                _next_ordinal_to_read += 1;
1325                next_offset += envelope_size;
1326            }
1327
1328            let next_out_of_line = decoder.next_out_of_line();
1329            let handles_before = decoder.remaining_handles();
1330            if let Some((inlined, num_bytes, num_handles)) =
1331                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1332            {
1333                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1334                if inlined != (member_inline_size <= 4) {
1335                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1336                }
1337                let inner_offset;
1338                let mut inner_depth = depth.clone();
1339                if inlined {
1340                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1341                    inner_offset = next_offset;
1342                } else {
1343                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1344                    inner_depth.increment()?;
1345                }
1346                let val_ref = self.declared_dictionaries.get_or_insert_with(|| {
1347                    fidl::new_empty!(
1348                        fidl_fuchsia_component_sandbox::DictionaryRef,
1349                        fidl::encoding::DefaultFuchsiaResourceDialect
1350                    )
1351                });
1352                fidl::decode!(
1353                    fidl_fuchsia_component_sandbox::DictionaryRef,
1354                    fidl::encoding::DefaultFuchsiaResourceDialect,
1355                    val_ref,
1356                    decoder,
1357                    inner_offset,
1358                    inner_depth
1359                )?;
1360                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1361                {
1362                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1363                }
1364                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1365                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1366                }
1367            }
1368
1369            next_offset += envelope_size;
1370            _next_ordinal_to_read += 1;
1371            if next_offset >= end_offset {
1372                return Ok(());
1373            }
1374
1375            // Decode unknown envelopes for gaps in ordinals.
1376            while _next_ordinal_to_read < 8 {
1377                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1378                _next_ordinal_to_read += 1;
1379                next_offset += envelope_size;
1380            }
1381
1382            let next_out_of_line = decoder.next_out_of_line();
1383            let handles_before = decoder.remaining_handles();
1384            if let Some((inlined, num_bytes, num_handles)) =
1385                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1386            {
1387                let member_inline_size = <fidl::encoding::UnboundedVector<ChildInput> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1388                if inlined != (member_inline_size <= 4) {
1389                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1390                }
1391                let inner_offset;
1392                let mut inner_depth = depth.clone();
1393                if inlined {
1394                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1395                    inner_offset = next_offset;
1396                } else {
1397                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1398                    inner_depth.increment()?;
1399                }
1400                let val_ref = self.child_inputs.get_or_insert_with(|| {
1401                    fidl::new_empty!(
1402                        fidl::encoding::UnboundedVector<ChildInput>,
1403                        fidl::encoding::DefaultFuchsiaResourceDialect
1404                    )
1405                });
1406                fidl::decode!(
1407                    fidl::encoding::UnboundedVector<ChildInput>,
1408                    fidl::encoding::DefaultFuchsiaResourceDialect,
1409                    val_ref,
1410                    decoder,
1411                    inner_offset,
1412                    inner_depth
1413                )?;
1414                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1415                {
1416                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1417                }
1418                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1419                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1420                }
1421            }
1422
1423            next_offset += envelope_size;
1424            _next_ordinal_to_read += 1;
1425            if next_offset >= end_offset {
1426                return Ok(());
1427            }
1428
1429            // Decode unknown envelopes for gaps in ordinals.
1430            while _next_ordinal_to_read < 9 {
1431                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1432                _next_ordinal_to_read += 1;
1433                next_offset += envelope_size;
1434            }
1435
1436            let next_out_of_line = decoder.next_out_of_line();
1437            let handles_before = decoder.remaining_handles();
1438            if let Some((inlined, num_bytes, num_handles)) =
1439                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1440            {
1441                let member_inline_size = <fidl::encoding::UnboundedVector<ChildInput> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1442                if inlined != (member_inline_size <= 4) {
1443                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1444                }
1445                let inner_offset;
1446                let mut inner_depth = depth.clone();
1447                if inlined {
1448                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1449                    inner_offset = next_offset;
1450                } else {
1451                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1452                    inner_depth.increment()?;
1453                }
1454                let val_ref = self.collection_inputs.get_or_insert_with(|| {
1455                    fidl::new_empty!(
1456                        fidl::encoding::UnboundedVector<ChildInput>,
1457                        fidl::encoding::DefaultFuchsiaResourceDialect
1458                    )
1459                });
1460                fidl::decode!(
1461                    fidl::encoding::UnboundedVector<ChildInput>,
1462                    fidl::encoding::DefaultFuchsiaResourceDialect,
1463                    val_ref,
1464                    decoder,
1465                    inner_offset,
1466                    inner_depth
1467                )?;
1468                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1469                {
1470                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1471                }
1472                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1473                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1474                }
1475            }
1476
1477            next_offset += envelope_size;
1478
1479            // Decode the remaining unknown envelopes.
1480            while next_offset < end_offset {
1481                _next_ordinal_to_read += 1;
1482                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1483                next_offset += envelope_size;
1484            }
1485
1486            Ok(())
1487        }
1488    }
1489}