fidl_fuchsia_driver_test/
fidl_fuchsia_driver_test.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_driver_test_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct InternalGetBootDirectoryResponse {
16    pub boot_dir: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20    for InternalGetBootDirectoryResponse
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct InternalGetTestPackageResponse {
26    pub test_pkg_dir: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30    for InternalGetTestPackageResponse
31{
32}
33
34#[derive(Debug, PartialEq)]
35pub struct RealmStartRequest {
36    pub args: RealmArgs,
37}
38
39impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmStartRequest {}
40
41/// A list of arguments that can be used to configure DriverTestRealm.
42#[derive(Debug, Default, PartialEq)]
43pub struct RealmArgs {
44    /// This is what DriverManager will see as its boot directory.
45    /// Default: DriverTestRealm's package directory
46    pub boot: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
47    /// The URL for the driver that will be bound to root.
48    /// Default: fuchsia-boot:///dtr#meta/test-parent-sys.cm
49    /// NOTE: The test parent driver is not included by default. This must
50    ///  be included in your package to work correctly.
51    pub root_driver: Option<String>,
52    /// If this is true, then DriverManager will load DFv2 drivers.
53    /// Default: false
54    pub use_driver_framework_v2: Option<bool>,
55    /// If this is true, then DriverManager will enable the unit tests
56    /// for each driver that is loaded.
57    /// Default: false
58    pub driver_tests_enable_all: Option<bool>,
59    /// If this is true, then DriverManager will enable the unit tests
60    /// for each driver in this vector.
61    /// Default: empty
62    pub driver_tests_enable: Option<Vec<String>>,
63    /// If this is true, then DriverManager will disable the unit tests
64    /// for each driver in this vector. This overrides both a specific
65    /// request for enabling a test and the 'driver_tests_enable_all'
66    /// parameter.
67    /// Default: empty
68    pub driver_tests_disable: Option<Vec<String>>,
69    /// Set a log level for the specific driver.
70    /// Default: Log levels are set to INFO
71    pub driver_log_level: Option<Vec<DriverLog>>,
72    /// Disable specific drivers. These drivers will not be bound or loaded.
73    /// Default: empty
74    pub driver_disable: Option<Vec<String>>,
75    /// Specify drivers to bind 'eagerly'. This turns a driver that normally
76    /// binds as a fallback driver into a driver that will be bound normally.
77    /// Default: empty
78    pub driver_bind_eager: Option<Vec<String>>,
79    /// Specify the board name that drivers are aware of.
80    /// Default: driver-integration-test
81    pub board_name: Option<String>,
82    /// DEPRECATED: Use dtr_offers.
83    /// Specify additional offers from the test to a driver collection
84    /// Default: empty
85    pub offers: Option<Vec<Offer>>,
86    /// DEPRECATED: Use dtr_exposes.
87    /// Specify services to expose from the test to a driver collection
88    /// Default: empty
89    pub exposes: Option<Vec<Expose>>,
90    /// DEPRECATED: Use test_component to provide resolved test component.
91    /// The driver test realm can load drivers packaged with the test suite
92    /// through this directory. Note that this directory must be readable
93    /// and executable.
94    ///
95    /// This can be used if the test suite needs to use some drivers packaged
96    /// with the DriverTestRealm in addition to drivers packaged with the test
97    /// suite. In that case, the user can leave RealmArgs::boot unset and use
98    /// RealmArgs::pkg and RealmArgs::driver_urls.
99    ///
100    /// Drivers in this directory can be registered using the `driver_urls`
101    /// argument below.
102    ///
103    /// Default: DriverTestRealm's package directory.
104    pub pkg: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
105    /// Specify offers from the test to the driver test realm.
106    /// The driver test realm will forward these to the driver collections.
107    /// Default: empty
108    pub dtr_offers: Option<Vec<fidl_fuchsia_component_test::Capability>>,
109    /// Specify exposes from the driver test realm to the test.
110    /// The driver test realm will forward these from the driver collections.
111    /// Default: empty
112    pub dtr_exposes: Option<Vec<fidl_fuchsia_component_test::Capability>>,
113    /// The resolved component information of the test component that is starting
114    /// the driver test realm. This will be used to discover drivers that the test
115    /// wants to provide to the driver test realm. Drivers can be both in the test
116    /// component package, or a subpackage of the test component package.
117    /// By default all drivers discovered that don't also exist in the |boot| directory
118    /// will be considered to be base drivers.
119    /// Use |boot_driver_components| to provide a list of drivers that should be
120    /// boot drivers.
121    /// Default: empty
122    pub test_component: Option<fidl_fuchsia_component_resolution::Component>,
123    /// How long the driver index waits idle before it saves state, escrows its handles
124    /// with the component framework, and shuts down.
125    /// Default: never shuts down
126    pub driver_index_stop_timeout_millis: Option<i64>,
127    /// A list of software only devices that should be created. Typically this is used
128    /// to create fake hardware for tests. Devices will be spawned as platform devices
129    /// under the platform bus. Note that the platform bus must be the root driver for
130    /// this to do anything meaningful.
131    pub software_devices: Option<Vec<SoftwareDevice>>,
132    /// The list of driver component names that should be considered as boot drivers.
133    /// Boot drivers are started in the boot-drivers collection which has more
134    /// capabilities available to it.
135    /// Entries should be the component name (eg: "my_driver_component.cm").
136    /// Default: empty
137    pub boot_driver_components: Option<Vec<String>>,
138    /// Devicetree blob that should be handed to the board driver.
139    pub devicetree: Option<fidl::Vmo>,
140    /// Platform Vendor ID which should be specified to the platform bus driver.
141    pub platform_vid: Option<u32>,
142    /// Platform ID which should be specified to the platform bus driver.
143    pub platform_pid: Option<u32>,
144    #[doc(hidden)]
145    pub __source_breaking: fidl::marker::SourceBreaking,
146}
147
148impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmArgs {}
149
150#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
151pub struct DriverListsMarker;
152
153impl fidl::endpoints::ProtocolMarker for DriverListsMarker {
154    type Proxy = DriverListsProxy;
155    type RequestStream = DriverListsRequestStream;
156    #[cfg(target_os = "fuchsia")]
157    type SynchronousProxy = DriverListsSynchronousProxy;
158
159    const DEBUG_NAME: &'static str = "fuchsia.driver.test.DriverLists";
160}
161impl fidl::endpoints::DiscoverableProtocolMarker for DriverListsMarker {}
162pub type DriverListsGetDriverListsResult = Result<(Vec<String>, Vec<String>), i32>;
163
164pub trait DriverListsProxyInterface: Send + Sync {
165    type GetDriverListsResponseFut: std::future::Future<Output = Result<DriverListsGetDriverListsResult, fidl::Error>>
166        + Send;
167    fn r#get_driver_lists(&self) -> Self::GetDriverListsResponseFut;
168}
169#[derive(Debug)]
170#[cfg(target_os = "fuchsia")]
171pub struct DriverListsSynchronousProxy {
172    client: fidl::client::sync::Client,
173}
174
175#[cfg(target_os = "fuchsia")]
176impl fidl::endpoints::SynchronousProxy for DriverListsSynchronousProxy {
177    type Proxy = DriverListsProxy;
178    type Protocol = DriverListsMarker;
179
180    fn from_channel(inner: fidl::Channel) -> Self {
181        Self::new(inner)
182    }
183
184    fn into_channel(self) -> fidl::Channel {
185        self.client.into_channel()
186    }
187
188    fn as_channel(&self) -> &fidl::Channel {
189        self.client.as_channel()
190    }
191}
192
193#[cfg(target_os = "fuchsia")]
194impl DriverListsSynchronousProxy {
195    pub fn new(channel: fidl::Channel) -> Self {
196        let protocol_name = <DriverListsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
197        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
198    }
199
200    pub fn into_channel(self) -> fidl::Channel {
201        self.client.into_channel()
202    }
203
204    /// Waits until an event arrives and returns it. It is safe for other
205    /// threads to make concurrent requests while waiting for an event.
206    pub fn wait_for_event(
207        &self,
208        deadline: zx::MonotonicInstant,
209    ) -> Result<DriverListsEvent, fidl::Error> {
210        DriverListsEvent::decode(self.client.wait_for_event(deadline)?)
211    }
212
213    pub fn r#get_driver_lists(
214        &self,
215        ___deadline: zx::MonotonicInstant,
216    ) -> Result<DriverListsGetDriverListsResult, fidl::Error> {
217        let _response = self.client.send_query::<
218            fidl::encoding::EmptyPayload,
219            fidl::encoding::ResultType<DriverListsGetDriverListsResponse, i32>,
220        >(
221            (),
222            0x63c3de40e768357,
223            fidl::encoding::DynamicFlags::empty(),
224            ___deadline,
225        )?;
226        Ok(_response.map(|x| (x.boot_drivers, x.base_drivers)))
227    }
228}
229
230#[derive(Debug, Clone)]
231pub struct DriverListsProxy {
232    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
233}
234
235impl fidl::endpoints::Proxy for DriverListsProxy {
236    type Protocol = DriverListsMarker;
237
238    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
239        Self::new(inner)
240    }
241
242    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
243        self.client.into_channel().map_err(|client| Self { client })
244    }
245
246    fn as_channel(&self) -> &::fidl::AsyncChannel {
247        self.client.as_channel()
248    }
249}
250
251impl DriverListsProxy {
252    /// Create a new Proxy for fuchsia.driver.test/DriverLists.
253    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
254        let protocol_name = <DriverListsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
255        Self { client: fidl::client::Client::new(channel, protocol_name) }
256    }
257
258    /// Get a Stream of events from the remote end of the protocol.
259    ///
260    /// # Panics
261    ///
262    /// Panics if the event stream was already taken.
263    pub fn take_event_stream(&self) -> DriverListsEventStream {
264        DriverListsEventStream { event_receiver: self.client.take_event_receiver() }
265    }
266
267    pub fn r#get_driver_lists(
268        &self,
269    ) -> fidl::client::QueryResponseFut<
270        DriverListsGetDriverListsResult,
271        fidl::encoding::DefaultFuchsiaResourceDialect,
272    > {
273        DriverListsProxyInterface::r#get_driver_lists(self)
274    }
275}
276
277impl DriverListsProxyInterface for DriverListsProxy {
278    type GetDriverListsResponseFut = fidl::client::QueryResponseFut<
279        DriverListsGetDriverListsResult,
280        fidl::encoding::DefaultFuchsiaResourceDialect,
281    >;
282    fn r#get_driver_lists(&self) -> Self::GetDriverListsResponseFut {
283        fn _decode(
284            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
285        ) -> Result<DriverListsGetDriverListsResult, fidl::Error> {
286            let _response = fidl::client::decode_transaction_body::<
287                fidl::encoding::ResultType<DriverListsGetDriverListsResponse, i32>,
288                fidl::encoding::DefaultFuchsiaResourceDialect,
289                0x63c3de40e768357,
290            >(_buf?)?;
291            Ok(_response.map(|x| (x.boot_drivers, x.base_drivers)))
292        }
293        self.client
294            .send_query_and_decode::<fidl::encoding::EmptyPayload, DriverListsGetDriverListsResult>(
295                (),
296                0x63c3de40e768357,
297                fidl::encoding::DynamicFlags::empty(),
298                _decode,
299            )
300    }
301}
302
303pub struct DriverListsEventStream {
304    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
305}
306
307impl std::marker::Unpin for DriverListsEventStream {}
308
309impl futures::stream::FusedStream for DriverListsEventStream {
310    fn is_terminated(&self) -> bool {
311        self.event_receiver.is_terminated()
312    }
313}
314
315impl futures::Stream for DriverListsEventStream {
316    type Item = Result<DriverListsEvent, fidl::Error>;
317
318    fn poll_next(
319        mut self: std::pin::Pin<&mut Self>,
320        cx: &mut std::task::Context<'_>,
321    ) -> std::task::Poll<Option<Self::Item>> {
322        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
323            &mut self.event_receiver,
324            cx
325        )?) {
326            Some(buf) => std::task::Poll::Ready(Some(DriverListsEvent::decode(buf))),
327            None => std::task::Poll::Ready(None),
328        }
329    }
330}
331
332#[derive(Debug)]
333pub enum DriverListsEvent {}
334
335impl DriverListsEvent {
336    /// Decodes a message buffer as a [`DriverListsEvent`].
337    fn decode(
338        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
339    ) -> Result<DriverListsEvent, fidl::Error> {
340        let (bytes, _handles) = buf.split_mut();
341        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
342        debug_assert_eq!(tx_header.tx_id, 0);
343        match tx_header.ordinal {
344            _ => Err(fidl::Error::UnknownOrdinal {
345                ordinal: tx_header.ordinal,
346                protocol_name: <DriverListsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
347            }),
348        }
349    }
350}
351
352/// A Stream of incoming requests for fuchsia.driver.test/DriverLists.
353pub struct DriverListsRequestStream {
354    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
355    is_terminated: bool,
356}
357
358impl std::marker::Unpin for DriverListsRequestStream {}
359
360impl futures::stream::FusedStream for DriverListsRequestStream {
361    fn is_terminated(&self) -> bool {
362        self.is_terminated
363    }
364}
365
366impl fidl::endpoints::RequestStream for DriverListsRequestStream {
367    type Protocol = DriverListsMarker;
368    type ControlHandle = DriverListsControlHandle;
369
370    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
371        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
372    }
373
374    fn control_handle(&self) -> Self::ControlHandle {
375        DriverListsControlHandle { inner: self.inner.clone() }
376    }
377
378    fn into_inner(
379        self,
380    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
381    {
382        (self.inner, self.is_terminated)
383    }
384
385    fn from_inner(
386        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
387        is_terminated: bool,
388    ) -> Self {
389        Self { inner, is_terminated }
390    }
391}
392
393impl futures::Stream for DriverListsRequestStream {
394    type Item = Result<DriverListsRequest, fidl::Error>;
395
396    fn poll_next(
397        mut self: std::pin::Pin<&mut Self>,
398        cx: &mut std::task::Context<'_>,
399    ) -> std::task::Poll<Option<Self::Item>> {
400        let this = &mut *self;
401        if this.inner.check_shutdown(cx) {
402            this.is_terminated = true;
403            return std::task::Poll::Ready(None);
404        }
405        if this.is_terminated {
406            panic!("polled DriverListsRequestStream after completion");
407        }
408        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
409            |bytes, handles| {
410                match this.inner.channel().read_etc(cx, bytes, handles) {
411                    std::task::Poll::Ready(Ok(())) => {}
412                    std::task::Poll::Pending => return std::task::Poll::Pending,
413                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
414                        this.is_terminated = true;
415                        return std::task::Poll::Ready(None);
416                    }
417                    std::task::Poll::Ready(Err(e)) => {
418                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
419                            e.into(),
420                        ))))
421                    }
422                }
423
424                // A message has been received from the channel
425                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
426
427                std::task::Poll::Ready(Some(match header.ordinal {
428                    0x63c3de40e768357 => {
429                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
430                        let mut req = fidl::new_empty!(
431                            fidl::encoding::EmptyPayload,
432                            fidl::encoding::DefaultFuchsiaResourceDialect
433                        );
434                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
435                        let control_handle = DriverListsControlHandle { inner: this.inner.clone() };
436                        Ok(DriverListsRequest::GetDriverLists {
437                            responder: DriverListsGetDriverListsResponder {
438                                control_handle: std::mem::ManuallyDrop::new(control_handle),
439                                tx_id: header.tx_id,
440                            },
441                        })
442                    }
443                    _ => Err(fidl::Error::UnknownOrdinal {
444                        ordinal: header.ordinal,
445                        protocol_name:
446                            <DriverListsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
447                    }),
448                }))
449            },
450        )
451    }
452}
453
454/// This protocol is served when running with the driver_test_realm to be used by the
455/// driver index to dynamically get the list of drivers.
456#[derive(Debug)]
457pub enum DriverListsRequest {
458    GetDriverLists { responder: DriverListsGetDriverListsResponder },
459}
460
461impl DriverListsRequest {
462    #[allow(irrefutable_let_patterns)]
463    pub fn into_get_driver_lists(self) -> Option<(DriverListsGetDriverListsResponder)> {
464        if let DriverListsRequest::GetDriverLists { responder } = self {
465            Some((responder))
466        } else {
467            None
468        }
469    }
470
471    /// Name of the method defined in FIDL
472    pub fn method_name(&self) -> &'static str {
473        match *self {
474            DriverListsRequest::GetDriverLists { .. } => "get_driver_lists",
475        }
476    }
477}
478
479#[derive(Debug, Clone)]
480pub struct DriverListsControlHandle {
481    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
482}
483
484impl fidl::endpoints::ControlHandle for DriverListsControlHandle {
485    fn shutdown(&self) {
486        self.inner.shutdown()
487    }
488    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
489        self.inner.shutdown_with_epitaph(status)
490    }
491
492    fn is_closed(&self) -> bool {
493        self.inner.channel().is_closed()
494    }
495    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
496        self.inner.channel().on_closed()
497    }
498
499    #[cfg(target_os = "fuchsia")]
500    fn signal_peer(
501        &self,
502        clear_mask: zx::Signals,
503        set_mask: zx::Signals,
504    ) -> Result<(), zx_status::Status> {
505        use fidl::Peered;
506        self.inner.channel().signal_peer(clear_mask, set_mask)
507    }
508}
509
510impl DriverListsControlHandle {}
511
512#[must_use = "FIDL methods require a response to be sent"]
513#[derive(Debug)]
514pub struct DriverListsGetDriverListsResponder {
515    control_handle: std::mem::ManuallyDrop<DriverListsControlHandle>,
516    tx_id: u32,
517}
518
519/// Set the the channel to be shutdown (see [`DriverListsControlHandle::shutdown`])
520/// if the responder is dropped without sending a response, so that the client
521/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
522impl std::ops::Drop for DriverListsGetDriverListsResponder {
523    fn drop(&mut self) {
524        self.control_handle.shutdown();
525        // Safety: drops once, never accessed again
526        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
527    }
528}
529
530impl fidl::endpoints::Responder for DriverListsGetDriverListsResponder {
531    type ControlHandle = DriverListsControlHandle;
532
533    fn control_handle(&self) -> &DriverListsControlHandle {
534        &self.control_handle
535    }
536
537    fn drop_without_shutdown(mut self) {
538        // Safety: drops once, never accessed again due to mem::forget
539        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
540        // Prevent Drop from running (which would shut down the channel)
541        std::mem::forget(self);
542    }
543}
544
545impl DriverListsGetDriverListsResponder {
546    /// Sends a response to the FIDL transaction.
547    ///
548    /// Sets the channel to shutdown if an error occurs.
549    pub fn send(self, mut result: Result<(&[String], &[String]), i32>) -> Result<(), fidl::Error> {
550        let _result = self.send_raw(result);
551        if _result.is_err() {
552            self.control_handle.shutdown();
553        }
554        self.drop_without_shutdown();
555        _result
556    }
557
558    /// Similar to "send" but does not shutdown the channel if an error occurs.
559    pub fn send_no_shutdown_on_err(
560        self,
561        mut result: Result<(&[String], &[String]), i32>,
562    ) -> Result<(), fidl::Error> {
563        let _result = self.send_raw(result);
564        self.drop_without_shutdown();
565        _result
566    }
567
568    fn send_raw(&self, mut result: Result<(&[String], &[String]), i32>) -> Result<(), fidl::Error> {
569        self.control_handle
570            .inner
571            .send::<fidl::encoding::ResultType<DriverListsGetDriverListsResponse, i32>>(
572                result,
573                self.tx_id,
574                0x63c3de40e768357,
575                fidl::encoding::DynamicFlags::empty(),
576            )
577    }
578}
579
580#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
581pub struct InternalMarker;
582
583impl fidl::endpoints::ProtocolMarker for InternalMarker {
584    type Proxy = InternalProxy;
585    type RequestStream = InternalRequestStream;
586    #[cfg(target_os = "fuchsia")]
587    type SynchronousProxy = InternalSynchronousProxy;
588
589    const DEBUG_NAME: &'static str = "fuchsia.driver.test.Internal";
590}
591impl fidl::endpoints::DiscoverableProtocolMarker for InternalMarker {}
592pub type InternalGetTestPackageResult =
593    Result<Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, i32>;
594pub type InternalGetTestResolutionContextResult =
595    Result<Option<Box<fidl_fuchsia_component_resolution::Context>>, i32>;
596pub type InternalGetBootDirectoryResult =
597    Result<Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, i32>;
598pub type InternalGetBootDriverOverridesResult = Result<Vec<String>, i32>;
599
600pub trait InternalProxyInterface: Send + Sync {
601    type GetTestPackageResponseFut: std::future::Future<Output = Result<InternalGetTestPackageResult, fidl::Error>>
602        + Send;
603    fn r#get_test_package(&self) -> Self::GetTestPackageResponseFut;
604    type GetTestResolutionContextResponseFut: std::future::Future<Output = Result<InternalGetTestResolutionContextResult, fidl::Error>>
605        + Send;
606    fn r#get_test_resolution_context(&self) -> Self::GetTestResolutionContextResponseFut;
607    type GetBootDirectoryResponseFut: std::future::Future<Output = Result<InternalGetBootDirectoryResult, fidl::Error>>
608        + Send;
609    fn r#get_boot_directory(&self) -> Self::GetBootDirectoryResponseFut;
610    type GetBootDriverOverridesResponseFut: std::future::Future<Output = Result<InternalGetBootDriverOverridesResult, fidl::Error>>
611        + Send;
612    fn r#get_boot_driver_overrides(&self) -> Self::GetBootDriverOverridesResponseFut;
613}
614#[derive(Debug)]
615#[cfg(target_os = "fuchsia")]
616pub struct InternalSynchronousProxy {
617    client: fidl::client::sync::Client,
618}
619
620#[cfg(target_os = "fuchsia")]
621impl fidl::endpoints::SynchronousProxy for InternalSynchronousProxy {
622    type Proxy = InternalProxy;
623    type Protocol = InternalMarker;
624
625    fn from_channel(inner: fidl::Channel) -> Self {
626        Self::new(inner)
627    }
628
629    fn into_channel(self) -> fidl::Channel {
630        self.client.into_channel()
631    }
632
633    fn as_channel(&self) -> &fidl::Channel {
634        self.client.as_channel()
635    }
636}
637
638#[cfg(target_os = "fuchsia")]
639impl InternalSynchronousProxy {
640    pub fn new(channel: fidl::Channel) -> Self {
641        let protocol_name = <InternalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
642        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
643    }
644
645    pub fn into_channel(self) -> fidl::Channel {
646        self.client.into_channel()
647    }
648
649    /// Waits until an event arrives and returns it. It is safe for other
650    /// threads to make concurrent requests while waiting for an event.
651    pub fn wait_for_event(
652        &self,
653        deadline: zx::MonotonicInstant,
654    ) -> Result<InternalEvent, fidl::Error> {
655        InternalEvent::decode(self.client.wait_for_event(deadline)?)
656    }
657
658    /// Gets the test component's package directory. This is used to read drivers in this package.
659    /// If a test resolution context is available through |GetTestResolutionContext|, subpackages
660    /// in this test package are also discovered.
661    pub fn r#get_test_package(
662        &self,
663        ___deadline: zx::MonotonicInstant,
664    ) -> Result<InternalGetTestPackageResult, fidl::Error> {
665        let _response = self.client.send_query::<
666            fidl::encoding::EmptyPayload,
667            fidl::encoding::ResultType<InternalGetTestPackageResponse, i32>,
668        >(
669            (),
670            0x298c1d6e57d57db8,
671            fidl::encoding::DynamicFlags::empty(),
672            ___deadline,
673        )?;
674        Ok(_response.map(|x| x.test_pkg_dir))
675    }
676
677    /// Gets the test component's resolution context. This is used to open subpackages of the
678    /// test package.
679    pub fn r#get_test_resolution_context(
680        &self,
681        ___deadline: zx::MonotonicInstant,
682    ) -> Result<InternalGetTestResolutionContextResult, fidl::Error> {
683        let _response = self.client.send_query::<
684            fidl::encoding::EmptyPayload,
685            fidl::encoding::ResultType<InternalGetTestResolutionContextResponse, i32>,
686        >(
687            (),
688            0x78e5d4f1fefd67b7,
689            fidl::encoding::DynamicFlags::empty(),
690            ___deadline,
691        )?;
692        Ok(_response.map(|x| x.context))
693    }
694
695    /// Get the '/boot' directory to be used for the "fuchsia-boot:///" resolver.
696    /// If an invalid |boot_dir| is returned, the driver test realm's '/pkg' directory is
697    /// treated as the boot directory.
698    pub fn r#get_boot_directory(
699        &self,
700        ___deadline: zx::MonotonicInstant,
701    ) -> Result<InternalGetBootDirectoryResult, fidl::Error> {
702        let _response = self.client.send_query::<
703            fidl::encoding::EmptyPayload,
704            fidl::encoding::ResultType<InternalGetBootDirectoryResponse, i32>,
705        >(
706            (),
707            0x3e1969123c4dfb31,
708            fidl::encoding::DynamicFlags::empty(),
709            ___deadline,
710        )?;
711        Ok(_response.map(|x| x.boot_dir))
712    }
713
714    pub fn r#get_boot_driver_overrides(
715        &self,
716        ___deadline: zx::MonotonicInstant,
717    ) -> Result<InternalGetBootDriverOverridesResult, fidl::Error> {
718        let _response = self.client.send_query::<
719            fidl::encoding::EmptyPayload,
720            fidl::encoding::ResultType<InternalGetBootDriverOverridesResponse, i32>,
721        >(
722            (),
723            0x6a40991d8259e008,
724            fidl::encoding::DynamicFlags::empty(),
725            ___deadline,
726        )?;
727        Ok(_response.map(|x| x.boot_overrides))
728    }
729}
730
731#[derive(Debug, Clone)]
732pub struct InternalProxy {
733    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
734}
735
736impl fidl::endpoints::Proxy for InternalProxy {
737    type Protocol = InternalMarker;
738
739    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
740        Self::new(inner)
741    }
742
743    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
744        self.client.into_channel().map_err(|client| Self { client })
745    }
746
747    fn as_channel(&self) -> &::fidl::AsyncChannel {
748        self.client.as_channel()
749    }
750}
751
752impl InternalProxy {
753    /// Create a new Proxy for fuchsia.driver.test/Internal.
754    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
755        let protocol_name = <InternalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
756        Self { client: fidl::client::Client::new(channel, protocol_name) }
757    }
758
759    /// Get a Stream of events from the remote end of the protocol.
760    ///
761    /// # Panics
762    ///
763    /// Panics if the event stream was already taken.
764    pub fn take_event_stream(&self) -> InternalEventStream {
765        InternalEventStream { event_receiver: self.client.take_event_receiver() }
766    }
767
768    /// Gets the test component's package directory. This is used to read drivers in this package.
769    /// If a test resolution context is available through |GetTestResolutionContext|, subpackages
770    /// in this test package are also discovered.
771    pub fn r#get_test_package(
772        &self,
773    ) -> fidl::client::QueryResponseFut<
774        InternalGetTestPackageResult,
775        fidl::encoding::DefaultFuchsiaResourceDialect,
776    > {
777        InternalProxyInterface::r#get_test_package(self)
778    }
779
780    /// Gets the test component's resolution context. This is used to open subpackages of the
781    /// test package.
782    pub fn r#get_test_resolution_context(
783        &self,
784    ) -> fidl::client::QueryResponseFut<
785        InternalGetTestResolutionContextResult,
786        fidl::encoding::DefaultFuchsiaResourceDialect,
787    > {
788        InternalProxyInterface::r#get_test_resolution_context(self)
789    }
790
791    /// Get the '/boot' directory to be used for the "fuchsia-boot:///" resolver.
792    /// If an invalid |boot_dir| is returned, the driver test realm's '/pkg' directory is
793    /// treated as the boot directory.
794    pub fn r#get_boot_directory(
795        &self,
796    ) -> fidl::client::QueryResponseFut<
797        InternalGetBootDirectoryResult,
798        fidl::encoding::DefaultFuchsiaResourceDialect,
799    > {
800        InternalProxyInterface::r#get_boot_directory(self)
801    }
802
803    pub fn r#get_boot_driver_overrides(
804        &self,
805    ) -> fidl::client::QueryResponseFut<
806        InternalGetBootDriverOverridesResult,
807        fidl::encoding::DefaultFuchsiaResourceDialect,
808    > {
809        InternalProxyInterface::r#get_boot_driver_overrides(self)
810    }
811}
812
813impl InternalProxyInterface for InternalProxy {
814    type GetTestPackageResponseFut = fidl::client::QueryResponseFut<
815        InternalGetTestPackageResult,
816        fidl::encoding::DefaultFuchsiaResourceDialect,
817    >;
818    fn r#get_test_package(&self) -> Self::GetTestPackageResponseFut {
819        fn _decode(
820            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
821        ) -> Result<InternalGetTestPackageResult, fidl::Error> {
822            let _response = fidl::client::decode_transaction_body::<
823                fidl::encoding::ResultType<InternalGetTestPackageResponse, i32>,
824                fidl::encoding::DefaultFuchsiaResourceDialect,
825                0x298c1d6e57d57db8,
826            >(_buf?)?;
827            Ok(_response.map(|x| x.test_pkg_dir))
828        }
829        self.client
830            .send_query_and_decode::<fidl::encoding::EmptyPayload, InternalGetTestPackageResult>(
831                (),
832                0x298c1d6e57d57db8,
833                fidl::encoding::DynamicFlags::empty(),
834                _decode,
835            )
836    }
837
838    type GetTestResolutionContextResponseFut = fidl::client::QueryResponseFut<
839        InternalGetTestResolutionContextResult,
840        fidl::encoding::DefaultFuchsiaResourceDialect,
841    >;
842    fn r#get_test_resolution_context(&self) -> Self::GetTestResolutionContextResponseFut {
843        fn _decode(
844            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
845        ) -> Result<InternalGetTestResolutionContextResult, fidl::Error> {
846            let _response = fidl::client::decode_transaction_body::<
847                fidl::encoding::ResultType<InternalGetTestResolutionContextResponse, i32>,
848                fidl::encoding::DefaultFuchsiaResourceDialect,
849                0x78e5d4f1fefd67b7,
850            >(_buf?)?;
851            Ok(_response.map(|x| x.context))
852        }
853        self.client.send_query_and_decode::<
854            fidl::encoding::EmptyPayload,
855            InternalGetTestResolutionContextResult,
856        >(
857            (),
858            0x78e5d4f1fefd67b7,
859            fidl::encoding::DynamicFlags::empty(),
860            _decode,
861        )
862    }
863
864    type GetBootDirectoryResponseFut = fidl::client::QueryResponseFut<
865        InternalGetBootDirectoryResult,
866        fidl::encoding::DefaultFuchsiaResourceDialect,
867    >;
868    fn r#get_boot_directory(&self) -> Self::GetBootDirectoryResponseFut {
869        fn _decode(
870            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
871        ) -> Result<InternalGetBootDirectoryResult, fidl::Error> {
872            let _response = fidl::client::decode_transaction_body::<
873                fidl::encoding::ResultType<InternalGetBootDirectoryResponse, i32>,
874                fidl::encoding::DefaultFuchsiaResourceDialect,
875                0x3e1969123c4dfb31,
876            >(_buf?)?;
877            Ok(_response.map(|x| x.boot_dir))
878        }
879        self.client
880            .send_query_and_decode::<fidl::encoding::EmptyPayload, InternalGetBootDirectoryResult>(
881                (),
882                0x3e1969123c4dfb31,
883                fidl::encoding::DynamicFlags::empty(),
884                _decode,
885            )
886    }
887
888    type GetBootDriverOverridesResponseFut = fidl::client::QueryResponseFut<
889        InternalGetBootDriverOverridesResult,
890        fidl::encoding::DefaultFuchsiaResourceDialect,
891    >;
892    fn r#get_boot_driver_overrides(&self) -> Self::GetBootDriverOverridesResponseFut {
893        fn _decode(
894            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
895        ) -> Result<InternalGetBootDriverOverridesResult, fidl::Error> {
896            let _response = fidl::client::decode_transaction_body::<
897                fidl::encoding::ResultType<InternalGetBootDriverOverridesResponse, i32>,
898                fidl::encoding::DefaultFuchsiaResourceDialect,
899                0x6a40991d8259e008,
900            >(_buf?)?;
901            Ok(_response.map(|x| x.boot_overrides))
902        }
903        self.client.send_query_and_decode::<
904            fidl::encoding::EmptyPayload,
905            InternalGetBootDriverOverridesResult,
906        >(
907            (),
908            0x6a40991d8259e008,
909            fidl::encoding::DynamicFlags::empty(),
910            _decode,
911        )
912    }
913}
914
915pub struct InternalEventStream {
916    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
917}
918
919impl std::marker::Unpin for InternalEventStream {}
920
921impl futures::stream::FusedStream for InternalEventStream {
922    fn is_terminated(&self) -> bool {
923        self.event_receiver.is_terminated()
924    }
925}
926
927impl futures::Stream for InternalEventStream {
928    type Item = Result<InternalEvent, fidl::Error>;
929
930    fn poll_next(
931        mut self: std::pin::Pin<&mut Self>,
932        cx: &mut std::task::Context<'_>,
933    ) -> std::task::Poll<Option<Self::Item>> {
934        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
935            &mut self.event_receiver,
936            cx
937        )?) {
938            Some(buf) => std::task::Poll::Ready(Some(InternalEvent::decode(buf))),
939            None => std::task::Poll::Ready(None),
940        }
941    }
942}
943
944#[derive(Debug)]
945pub enum InternalEvent {}
946
947impl InternalEvent {
948    /// Decodes a message buffer as a [`InternalEvent`].
949    fn decode(
950        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
951    ) -> Result<InternalEvent, fidl::Error> {
952        let (bytes, _handles) = buf.split_mut();
953        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
954        debug_assert_eq!(tx_header.tx_id, 0);
955        match tx_header.ordinal {
956            _ => Err(fidl::Error::UnknownOrdinal {
957                ordinal: tx_header.ordinal,
958                protocol_name: <InternalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
959            }),
960        }
961    }
962}
963
964/// A Stream of incoming requests for fuchsia.driver.test/Internal.
965pub struct InternalRequestStream {
966    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
967    is_terminated: bool,
968}
969
970impl std::marker::Unpin for InternalRequestStream {}
971
972impl futures::stream::FusedStream for InternalRequestStream {
973    fn is_terminated(&self) -> bool {
974        self.is_terminated
975    }
976}
977
978impl fidl::endpoints::RequestStream for InternalRequestStream {
979    type Protocol = InternalMarker;
980    type ControlHandle = InternalControlHandle;
981
982    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
983        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
984    }
985
986    fn control_handle(&self) -> Self::ControlHandle {
987        InternalControlHandle { inner: self.inner.clone() }
988    }
989
990    fn into_inner(
991        self,
992    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
993    {
994        (self.inner, self.is_terminated)
995    }
996
997    fn from_inner(
998        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
999        is_terminated: bool,
1000    ) -> Self {
1001        Self { inner, is_terminated }
1002    }
1003}
1004
1005impl futures::Stream for InternalRequestStream {
1006    type Item = Result<InternalRequest, fidl::Error>;
1007
1008    fn poll_next(
1009        mut self: std::pin::Pin<&mut Self>,
1010        cx: &mut std::task::Context<'_>,
1011    ) -> std::task::Poll<Option<Self::Item>> {
1012        let this = &mut *self;
1013        if this.inner.check_shutdown(cx) {
1014            this.is_terminated = true;
1015            return std::task::Poll::Ready(None);
1016        }
1017        if this.is_terminated {
1018            panic!("polled InternalRequestStream after completion");
1019        }
1020        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1021            |bytes, handles| {
1022                match this.inner.channel().read_etc(cx, bytes, handles) {
1023                    std::task::Poll::Ready(Ok(())) => {}
1024                    std::task::Poll::Pending => return std::task::Poll::Pending,
1025                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1026                        this.is_terminated = true;
1027                        return std::task::Poll::Ready(None);
1028                    }
1029                    std::task::Poll::Ready(Err(e)) => {
1030                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1031                            e.into(),
1032                        ))))
1033                    }
1034                }
1035
1036                // A message has been received from the channel
1037                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1038
1039                std::task::Poll::Ready(Some(match header.ordinal {
1040                    0x298c1d6e57d57db8 => {
1041                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1042                        let mut req = fidl::new_empty!(
1043                            fidl::encoding::EmptyPayload,
1044                            fidl::encoding::DefaultFuchsiaResourceDialect
1045                        );
1046                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1047                        let control_handle = InternalControlHandle { inner: this.inner.clone() };
1048                        Ok(InternalRequest::GetTestPackage {
1049                            responder: InternalGetTestPackageResponder {
1050                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1051                                tx_id: header.tx_id,
1052                            },
1053                        })
1054                    }
1055                    0x78e5d4f1fefd67b7 => {
1056                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1057                        let mut req = fidl::new_empty!(
1058                            fidl::encoding::EmptyPayload,
1059                            fidl::encoding::DefaultFuchsiaResourceDialect
1060                        );
1061                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1062                        let control_handle = InternalControlHandle { inner: this.inner.clone() };
1063                        Ok(InternalRequest::GetTestResolutionContext {
1064                            responder: InternalGetTestResolutionContextResponder {
1065                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1066                                tx_id: header.tx_id,
1067                            },
1068                        })
1069                    }
1070                    0x3e1969123c4dfb31 => {
1071                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1072                        let mut req = fidl::new_empty!(
1073                            fidl::encoding::EmptyPayload,
1074                            fidl::encoding::DefaultFuchsiaResourceDialect
1075                        );
1076                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1077                        let control_handle = InternalControlHandle { inner: this.inner.clone() };
1078                        Ok(InternalRequest::GetBootDirectory {
1079                            responder: InternalGetBootDirectoryResponder {
1080                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1081                                tx_id: header.tx_id,
1082                            },
1083                        })
1084                    }
1085                    0x6a40991d8259e008 => {
1086                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1087                        let mut req = fidl::new_empty!(
1088                            fidl::encoding::EmptyPayload,
1089                            fidl::encoding::DefaultFuchsiaResourceDialect
1090                        );
1091                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1092                        let control_handle = InternalControlHandle { inner: this.inner.clone() };
1093                        Ok(InternalRequest::GetBootDriverOverrides {
1094                            responder: InternalGetBootDriverOverridesResponder {
1095                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1096                                tx_id: header.tx_id,
1097                            },
1098                        })
1099                    }
1100                    _ => Err(fidl::Error::UnknownOrdinal {
1101                        ordinal: header.ordinal,
1102                        protocol_name:
1103                            <InternalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1104                    }),
1105                }))
1106            },
1107        )
1108    }
1109}
1110
1111/// This protocol is served when running with the driver_test_realm to be used by the
1112/// fake-resolver component to access the various directories and metadata of the test it needs.
1113#[derive(Debug)]
1114pub enum InternalRequest {
1115    /// Gets the test component's package directory. This is used to read drivers in this package.
1116    /// If a test resolution context is available through |GetTestResolutionContext|, subpackages
1117    /// in this test package are also discovered.
1118    GetTestPackage {
1119        responder: InternalGetTestPackageResponder,
1120    },
1121    /// Gets the test component's resolution context. This is used to open subpackages of the
1122    /// test package.
1123    GetTestResolutionContext {
1124        responder: InternalGetTestResolutionContextResponder,
1125    },
1126    /// Get the '/boot' directory to be used for the "fuchsia-boot:///" resolver.
1127    /// If an invalid |boot_dir| is returned, the driver test realm's '/pkg' directory is
1128    /// treated as the boot directory.
1129    GetBootDirectory {
1130        responder: InternalGetBootDirectoryResponder,
1131    },
1132    GetBootDriverOverrides {
1133        responder: InternalGetBootDriverOverridesResponder,
1134    },
1135}
1136
1137impl InternalRequest {
1138    #[allow(irrefutable_let_patterns)]
1139    pub fn into_get_test_package(self) -> Option<(InternalGetTestPackageResponder)> {
1140        if let InternalRequest::GetTestPackage { responder } = self {
1141            Some((responder))
1142        } else {
1143            None
1144        }
1145    }
1146
1147    #[allow(irrefutable_let_patterns)]
1148    pub fn into_get_test_resolution_context(
1149        self,
1150    ) -> Option<(InternalGetTestResolutionContextResponder)> {
1151        if let InternalRequest::GetTestResolutionContext { responder } = self {
1152            Some((responder))
1153        } else {
1154            None
1155        }
1156    }
1157
1158    #[allow(irrefutable_let_patterns)]
1159    pub fn into_get_boot_directory(self) -> Option<(InternalGetBootDirectoryResponder)> {
1160        if let InternalRequest::GetBootDirectory { responder } = self {
1161            Some((responder))
1162        } else {
1163            None
1164        }
1165    }
1166
1167    #[allow(irrefutable_let_patterns)]
1168    pub fn into_get_boot_driver_overrides(
1169        self,
1170    ) -> Option<(InternalGetBootDriverOverridesResponder)> {
1171        if let InternalRequest::GetBootDriverOverrides { responder } = self {
1172            Some((responder))
1173        } else {
1174            None
1175        }
1176    }
1177
1178    /// Name of the method defined in FIDL
1179    pub fn method_name(&self) -> &'static str {
1180        match *self {
1181            InternalRequest::GetTestPackage { .. } => "get_test_package",
1182            InternalRequest::GetTestResolutionContext { .. } => "get_test_resolution_context",
1183            InternalRequest::GetBootDirectory { .. } => "get_boot_directory",
1184            InternalRequest::GetBootDriverOverrides { .. } => "get_boot_driver_overrides",
1185        }
1186    }
1187}
1188
1189#[derive(Debug, Clone)]
1190pub struct InternalControlHandle {
1191    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1192}
1193
1194impl fidl::endpoints::ControlHandle for InternalControlHandle {
1195    fn shutdown(&self) {
1196        self.inner.shutdown()
1197    }
1198    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1199        self.inner.shutdown_with_epitaph(status)
1200    }
1201
1202    fn is_closed(&self) -> bool {
1203        self.inner.channel().is_closed()
1204    }
1205    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1206        self.inner.channel().on_closed()
1207    }
1208
1209    #[cfg(target_os = "fuchsia")]
1210    fn signal_peer(
1211        &self,
1212        clear_mask: zx::Signals,
1213        set_mask: zx::Signals,
1214    ) -> Result<(), zx_status::Status> {
1215        use fidl::Peered;
1216        self.inner.channel().signal_peer(clear_mask, set_mask)
1217    }
1218}
1219
1220impl InternalControlHandle {}
1221
1222#[must_use = "FIDL methods require a response to be sent"]
1223#[derive(Debug)]
1224pub struct InternalGetTestPackageResponder {
1225    control_handle: std::mem::ManuallyDrop<InternalControlHandle>,
1226    tx_id: u32,
1227}
1228
1229/// Set the the channel to be shutdown (see [`InternalControlHandle::shutdown`])
1230/// if the responder is dropped without sending a response, so that the client
1231/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1232impl std::ops::Drop for InternalGetTestPackageResponder {
1233    fn drop(&mut self) {
1234        self.control_handle.shutdown();
1235        // Safety: drops once, never accessed again
1236        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1237    }
1238}
1239
1240impl fidl::endpoints::Responder for InternalGetTestPackageResponder {
1241    type ControlHandle = InternalControlHandle;
1242
1243    fn control_handle(&self) -> &InternalControlHandle {
1244        &self.control_handle
1245    }
1246
1247    fn drop_without_shutdown(mut self) {
1248        // Safety: drops once, never accessed again due to mem::forget
1249        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1250        // Prevent Drop from running (which would shut down the channel)
1251        std::mem::forget(self);
1252    }
1253}
1254
1255impl InternalGetTestPackageResponder {
1256    /// Sends a response to the FIDL transaction.
1257    ///
1258    /// Sets the channel to shutdown if an error occurs.
1259    pub fn send(
1260        self,
1261        mut result: Result<
1262            Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1263            i32,
1264        >,
1265    ) -> Result<(), fidl::Error> {
1266        let _result = self.send_raw(result);
1267        if _result.is_err() {
1268            self.control_handle.shutdown();
1269        }
1270        self.drop_without_shutdown();
1271        _result
1272    }
1273
1274    /// Similar to "send" but does not shutdown the channel if an error occurs.
1275    pub fn send_no_shutdown_on_err(
1276        self,
1277        mut result: Result<
1278            Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1279            i32,
1280        >,
1281    ) -> Result<(), fidl::Error> {
1282        let _result = self.send_raw(result);
1283        self.drop_without_shutdown();
1284        _result
1285    }
1286
1287    fn send_raw(
1288        &self,
1289        mut result: Result<
1290            Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1291            i32,
1292        >,
1293    ) -> Result<(), fidl::Error> {
1294        self.control_handle
1295            .inner
1296            .send::<fidl::encoding::ResultType<InternalGetTestPackageResponse, i32>>(
1297                result.map(|test_pkg_dir| (test_pkg_dir,)),
1298                self.tx_id,
1299                0x298c1d6e57d57db8,
1300                fidl::encoding::DynamicFlags::empty(),
1301            )
1302    }
1303}
1304
1305#[must_use = "FIDL methods require a response to be sent"]
1306#[derive(Debug)]
1307pub struct InternalGetTestResolutionContextResponder {
1308    control_handle: std::mem::ManuallyDrop<InternalControlHandle>,
1309    tx_id: u32,
1310}
1311
1312/// Set the the channel to be shutdown (see [`InternalControlHandle::shutdown`])
1313/// if the responder is dropped without sending a response, so that the client
1314/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1315impl std::ops::Drop for InternalGetTestResolutionContextResponder {
1316    fn drop(&mut self) {
1317        self.control_handle.shutdown();
1318        // Safety: drops once, never accessed again
1319        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1320    }
1321}
1322
1323impl fidl::endpoints::Responder for InternalGetTestResolutionContextResponder {
1324    type ControlHandle = InternalControlHandle;
1325
1326    fn control_handle(&self) -> &InternalControlHandle {
1327        &self.control_handle
1328    }
1329
1330    fn drop_without_shutdown(mut self) {
1331        // Safety: drops once, never accessed again due to mem::forget
1332        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1333        // Prevent Drop from running (which would shut down the channel)
1334        std::mem::forget(self);
1335    }
1336}
1337
1338impl InternalGetTestResolutionContextResponder {
1339    /// Sends a response to the FIDL transaction.
1340    ///
1341    /// Sets the channel to shutdown if an error occurs.
1342    pub fn send(
1343        self,
1344        mut result: Result<Option<&fidl_fuchsia_component_resolution::Context>, i32>,
1345    ) -> Result<(), fidl::Error> {
1346        let _result = self.send_raw(result);
1347        if _result.is_err() {
1348            self.control_handle.shutdown();
1349        }
1350        self.drop_without_shutdown();
1351        _result
1352    }
1353
1354    /// Similar to "send" but does not shutdown the channel if an error occurs.
1355    pub fn send_no_shutdown_on_err(
1356        self,
1357        mut result: Result<Option<&fidl_fuchsia_component_resolution::Context>, i32>,
1358    ) -> Result<(), fidl::Error> {
1359        let _result = self.send_raw(result);
1360        self.drop_without_shutdown();
1361        _result
1362    }
1363
1364    fn send_raw(
1365        &self,
1366        mut result: Result<Option<&fidl_fuchsia_component_resolution::Context>, i32>,
1367    ) -> Result<(), fidl::Error> {
1368        self.control_handle.inner.send::<fidl::encoding::ResultType<
1369            InternalGetTestResolutionContextResponse,
1370            i32,
1371        >>(
1372            result.map(|context| (context,)),
1373            self.tx_id,
1374            0x78e5d4f1fefd67b7,
1375            fidl::encoding::DynamicFlags::empty(),
1376        )
1377    }
1378}
1379
1380#[must_use = "FIDL methods require a response to be sent"]
1381#[derive(Debug)]
1382pub struct InternalGetBootDirectoryResponder {
1383    control_handle: std::mem::ManuallyDrop<InternalControlHandle>,
1384    tx_id: u32,
1385}
1386
1387/// Set the the channel to be shutdown (see [`InternalControlHandle::shutdown`])
1388/// if the responder is dropped without sending a response, so that the client
1389/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1390impl std::ops::Drop for InternalGetBootDirectoryResponder {
1391    fn drop(&mut self) {
1392        self.control_handle.shutdown();
1393        // Safety: drops once, never accessed again
1394        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1395    }
1396}
1397
1398impl fidl::endpoints::Responder for InternalGetBootDirectoryResponder {
1399    type ControlHandle = InternalControlHandle;
1400
1401    fn control_handle(&self) -> &InternalControlHandle {
1402        &self.control_handle
1403    }
1404
1405    fn drop_without_shutdown(mut self) {
1406        // Safety: drops once, never accessed again due to mem::forget
1407        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1408        // Prevent Drop from running (which would shut down the channel)
1409        std::mem::forget(self);
1410    }
1411}
1412
1413impl InternalGetBootDirectoryResponder {
1414    /// Sends a response to the FIDL transaction.
1415    ///
1416    /// Sets the channel to shutdown if an error occurs.
1417    pub fn send(
1418        self,
1419        mut result: Result<
1420            Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1421            i32,
1422        >,
1423    ) -> Result<(), fidl::Error> {
1424        let _result = self.send_raw(result);
1425        if _result.is_err() {
1426            self.control_handle.shutdown();
1427        }
1428        self.drop_without_shutdown();
1429        _result
1430    }
1431
1432    /// Similar to "send" but does not shutdown the channel if an error occurs.
1433    pub fn send_no_shutdown_on_err(
1434        self,
1435        mut result: Result<
1436            Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1437            i32,
1438        >,
1439    ) -> Result<(), fidl::Error> {
1440        let _result = self.send_raw(result);
1441        self.drop_without_shutdown();
1442        _result
1443    }
1444
1445    fn send_raw(
1446        &self,
1447        mut result: Result<
1448            Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1449            i32,
1450        >,
1451    ) -> Result<(), fidl::Error> {
1452        self.control_handle
1453            .inner
1454            .send::<fidl::encoding::ResultType<InternalGetBootDirectoryResponse, i32>>(
1455                result.map(|boot_dir| (boot_dir,)),
1456                self.tx_id,
1457                0x3e1969123c4dfb31,
1458                fidl::encoding::DynamicFlags::empty(),
1459            )
1460    }
1461}
1462
1463#[must_use = "FIDL methods require a response to be sent"]
1464#[derive(Debug)]
1465pub struct InternalGetBootDriverOverridesResponder {
1466    control_handle: std::mem::ManuallyDrop<InternalControlHandle>,
1467    tx_id: u32,
1468}
1469
1470/// Set the the channel to be shutdown (see [`InternalControlHandle::shutdown`])
1471/// if the responder is dropped without sending a response, so that the client
1472/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1473impl std::ops::Drop for InternalGetBootDriverOverridesResponder {
1474    fn drop(&mut self) {
1475        self.control_handle.shutdown();
1476        // Safety: drops once, never accessed again
1477        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1478    }
1479}
1480
1481impl fidl::endpoints::Responder for InternalGetBootDriverOverridesResponder {
1482    type ControlHandle = InternalControlHandle;
1483
1484    fn control_handle(&self) -> &InternalControlHandle {
1485        &self.control_handle
1486    }
1487
1488    fn drop_without_shutdown(mut self) {
1489        // Safety: drops once, never accessed again due to mem::forget
1490        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1491        // Prevent Drop from running (which would shut down the channel)
1492        std::mem::forget(self);
1493    }
1494}
1495
1496impl InternalGetBootDriverOverridesResponder {
1497    /// Sends a response to the FIDL transaction.
1498    ///
1499    /// Sets the channel to shutdown if an error occurs.
1500    pub fn send(self, mut result: Result<&[String], i32>) -> Result<(), fidl::Error> {
1501        let _result = self.send_raw(result);
1502        if _result.is_err() {
1503            self.control_handle.shutdown();
1504        }
1505        self.drop_without_shutdown();
1506        _result
1507    }
1508
1509    /// Similar to "send" but does not shutdown the channel if an error occurs.
1510    pub fn send_no_shutdown_on_err(
1511        self,
1512        mut result: Result<&[String], i32>,
1513    ) -> Result<(), fidl::Error> {
1514        let _result = self.send_raw(result);
1515        self.drop_without_shutdown();
1516        _result
1517    }
1518
1519    fn send_raw(&self, mut result: Result<&[String], i32>) -> Result<(), fidl::Error> {
1520        self.control_handle.inner.send::<fidl::encoding::ResultType<
1521            InternalGetBootDriverOverridesResponse,
1522            i32,
1523        >>(
1524            result.map(|boot_overrides| (boot_overrides,)),
1525            self.tx_id,
1526            0x6a40991d8259e008,
1527            fidl::encoding::DynamicFlags::empty(),
1528        )
1529    }
1530}
1531
1532#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1533pub struct RealmMarker;
1534
1535impl fidl::endpoints::ProtocolMarker for RealmMarker {
1536    type Proxy = RealmProxy;
1537    type RequestStream = RealmRequestStream;
1538    #[cfg(target_os = "fuchsia")]
1539    type SynchronousProxy = RealmSynchronousProxy;
1540
1541    const DEBUG_NAME: &'static str = "fuchsia.driver.test.Realm";
1542}
1543impl fidl::endpoints::DiscoverableProtocolMarker for RealmMarker {}
1544pub type RealmStartResult = Result<(), i32>;
1545
1546pub trait RealmProxyInterface: Send + Sync {
1547    type StartResponseFut: std::future::Future<Output = Result<RealmStartResult, fidl::Error>>
1548        + Send;
1549    fn r#start(&self, args: RealmArgs) -> Self::StartResponseFut;
1550}
1551#[derive(Debug)]
1552#[cfg(target_os = "fuchsia")]
1553pub struct RealmSynchronousProxy {
1554    client: fidl::client::sync::Client,
1555}
1556
1557#[cfg(target_os = "fuchsia")]
1558impl fidl::endpoints::SynchronousProxy for RealmSynchronousProxy {
1559    type Proxy = RealmProxy;
1560    type Protocol = RealmMarker;
1561
1562    fn from_channel(inner: fidl::Channel) -> Self {
1563        Self::new(inner)
1564    }
1565
1566    fn into_channel(self) -> fidl::Channel {
1567        self.client.into_channel()
1568    }
1569
1570    fn as_channel(&self) -> &fidl::Channel {
1571        self.client.as_channel()
1572    }
1573}
1574
1575#[cfg(target_os = "fuchsia")]
1576impl RealmSynchronousProxy {
1577    pub fn new(channel: fidl::Channel) -> Self {
1578        let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1579        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1580    }
1581
1582    pub fn into_channel(self) -> fidl::Channel {
1583        self.client.into_channel()
1584    }
1585
1586    /// Waits until an event arrives and returns it. It is safe for other
1587    /// threads to make concurrent requests while waiting for an event.
1588    pub fn wait_for_event(
1589        &self,
1590        deadline: zx::MonotonicInstant,
1591    ) -> Result<RealmEvent, fidl::Error> {
1592        RealmEvent::decode(self.client.wait_for_event(deadline)?)
1593    }
1594
1595    /// Start the realm. Calling this will cause DriverTestRealm to start
1596    /// servicing other protocols (like /dev/). `args` is used to configure
1597    /// the DriverTestRealm.
1598    ///
1599    /// * error `ZX_ERR_ALREADY_EXISTS` the realm has already had `Start` called.
1600    pub fn r#start(
1601        &self,
1602        mut args: RealmArgs,
1603        ___deadline: zx::MonotonicInstant,
1604    ) -> Result<RealmStartResult, fidl::Error> {
1605        let _response = self.client.send_query::<
1606            RealmStartRequest,
1607            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1608        >(
1609            (&mut args,),
1610            0x3dc6949d581e96fa,
1611            fidl::encoding::DynamicFlags::FLEXIBLE,
1612            ___deadline,
1613        )?
1614        .into_result::<RealmMarker>("start")?;
1615        Ok(_response.map(|x| x))
1616    }
1617}
1618
1619#[derive(Debug, Clone)]
1620pub struct RealmProxy {
1621    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1622}
1623
1624impl fidl::endpoints::Proxy for RealmProxy {
1625    type Protocol = RealmMarker;
1626
1627    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1628        Self::new(inner)
1629    }
1630
1631    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1632        self.client.into_channel().map_err(|client| Self { client })
1633    }
1634
1635    fn as_channel(&self) -> &::fidl::AsyncChannel {
1636        self.client.as_channel()
1637    }
1638}
1639
1640impl RealmProxy {
1641    /// Create a new Proxy for fuchsia.driver.test/Realm.
1642    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1643        let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1644        Self { client: fidl::client::Client::new(channel, protocol_name) }
1645    }
1646
1647    /// Get a Stream of events from the remote end of the protocol.
1648    ///
1649    /// # Panics
1650    ///
1651    /// Panics if the event stream was already taken.
1652    pub fn take_event_stream(&self) -> RealmEventStream {
1653        RealmEventStream { event_receiver: self.client.take_event_receiver() }
1654    }
1655
1656    /// Start the realm. Calling this will cause DriverTestRealm to start
1657    /// servicing other protocols (like /dev/). `args` is used to configure
1658    /// the DriverTestRealm.
1659    ///
1660    /// * error `ZX_ERR_ALREADY_EXISTS` the realm has already had `Start` called.
1661    pub fn r#start(
1662        &self,
1663        mut args: RealmArgs,
1664    ) -> fidl::client::QueryResponseFut<
1665        RealmStartResult,
1666        fidl::encoding::DefaultFuchsiaResourceDialect,
1667    > {
1668        RealmProxyInterface::r#start(self, args)
1669    }
1670}
1671
1672impl RealmProxyInterface for RealmProxy {
1673    type StartResponseFut = fidl::client::QueryResponseFut<
1674        RealmStartResult,
1675        fidl::encoding::DefaultFuchsiaResourceDialect,
1676    >;
1677    fn r#start(&self, mut args: RealmArgs) -> Self::StartResponseFut {
1678        fn _decode(
1679            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1680        ) -> Result<RealmStartResult, fidl::Error> {
1681            let _response = fidl::client::decode_transaction_body::<
1682                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1683                fidl::encoding::DefaultFuchsiaResourceDialect,
1684                0x3dc6949d581e96fa,
1685            >(_buf?)?
1686            .into_result::<RealmMarker>("start")?;
1687            Ok(_response.map(|x| x))
1688        }
1689        self.client.send_query_and_decode::<RealmStartRequest, RealmStartResult>(
1690            (&mut args,),
1691            0x3dc6949d581e96fa,
1692            fidl::encoding::DynamicFlags::FLEXIBLE,
1693            _decode,
1694        )
1695    }
1696}
1697
1698pub struct RealmEventStream {
1699    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1700}
1701
1702impl std::marker::Unpin for RealmEventStream {}
1703
1704impl futures::stream::FusedStream for RealmEventStream {
1705    fn is_terminated(&self) -> bool {
1706        self.event_receiver.is_terminated()
1707    }
1708}
1709
1710impl futures::Stream for RealmEventStream {
1711    type Item = Result<RealmEvent, fidl::Error>;
1712
1713    fn poll_next(
1714        mut self: std::pin::Pin<&mut Self>,
1715        cx: &mut std::task::Context<'_>,
1716    ) -> std::task::Poll<Option<Self::Item>> {
1717        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1718            &mut self.event_receiver,
1719            cx
1720        )?) {
1721            Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
1722            None => std::task::Poll::Ready(None),
1723        }
1724    }
1725}
1726
1727#[derive(Debug)]
1728pub enum RealmEvent {
1729    #[non_exhaustive]
1730    _UnknownEvent {
1731        /// Ordinal of the event that was sent.
1732        ordinal: u64,
1733    },
1734}
1735
1736impl RealmEvent {
1737    /// Decodes a message buffer as a [`RealmEvent`].
1738    fn decode(
1739        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1740    ) -> Result<RealmEvent, fidl::Error> {
1741        let (bytes, _handles) = buf.split_mut();
1742        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1743        debug_assert_eq!(tx_header.tx_id, 0);
1744        match tx_header.ordinal {
1745            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1746                Ok(RealmEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1747            }
1748            _ => Err(fidl::Error::UnknownOrdinal {
1749                ordinal: tx_header.ordinal,
1750                protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1751            }),
1752        }
1753    }
1754}
1755
1756/// A Stream of incoming requests for fuchsia.driver.test/Realm.
1757pub struct RealmRequestStream {
1758    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1759    is_terminated: bool,
1760}
1761
1762impl std::marker::Unpin for RealmRequestStream {}
1763
1764impl futures::stream::FusedStream for RealmRequestStream {
1765    fn is_terminated(&self) -> bool {
1766        self.is_terminated
1767    }
1768}
1769
1770impl fidl::endpoints::RequestStream for RealmRequestStream {
1771    type Protocol = RealmMarker;
1772    type ControlHandle = RealmControlHandle;
1773
1774    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1775        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1776    }
1777
1778    fn control_handle(&self) -> Self::ControlHandle {
1779        RealmControlHandle { inner: self.inner.clone() }
1780    }
1781
1782    fn into_inner(
1783        self,
1784    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1785    {
1786        (self.inner, self.is_terminated)
1787    }
1788
1789    fn from_inner(
1790        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1791        is_terminated: bool,
1792    ) -> Self {
1793        Self { inner, is_terminated }
1794    }
1795}
1796
1797impl futures::Stream for RealmRequestStream {
1798    type Item = Result<RealmRequest, fidl::Error>;
1799
1800    fn poll_next(
1801        mut self: std::pin::Pin<&mut Self>,
1802        cx: &mut std::task::Context<'_>,
1803    ) -> std::task::Poll<Option<Self::Item>> {
1804        let this = &mut *self;
1805        if this.inner.check_shutdown(cx) {
1806            this.is_terminated = true;
1807            return std::task::Poll::Ready(None);
1808        }
1809        if this.is_terminated {
1810            panic!("polled RealmRequestStream after completion");
1811        }
1812        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1813            |bytes, handles| {
1814                match this.inner.channel().read_etc(cx, bytes, handles) {
1815                    std::task::Poll::Ready(Ok(())) => {}
1816                    std::task::Poll::Pending => return std::task::Poll::Pending,
1817                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1818                        this.is_terminated = true;
1819                        return std::task::Poll::Ready(None);
1820                    }
1821                    std::task::Poll::Ready(Err(e)) => {
1822                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1823                            e.into(),
1824                        ))))
1825                    }
1826                }
1827
1828                // A message has been received from the channel
1829                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1830
1831                std::task::Poll::Ready(Some(match header.ordinal {
1832                    0x3dc6949d581e96fa => {
1833                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1834                        let mut req = fidl::new_empty!(
1835                            RealmStartRequest,
1836                            fidl::encoding::DefaultFuchsiaResourceDialect
1837                        );
1838                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmStartRequest>(&header, _body_bytes, handles, &mut req)?;
1839                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
1840                        Ok(RealmRequest::Start {
1841                            args: req.args,
1842
1843                            responder: RealmStartResponder {
1844                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1845                                tx_id: header.tx_id,
1846                            },
1847                        })
1848                    }
1849                    _ if header.tx_id == 0
1850                        && header
1851                            .dynamic_flags()
1852                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1853                    {
1854                        Ok(RealmRequest::_UnknownMethod {
1855                            ordinal: header.ordinal,
1856                            control_handle: RealmControlHandle { inner: this.inner.clone() },
1857                            method_type: fidl::MethodType::OneWay,
1858                        })
1859                    }
1860                    _ if header
1861                        .dynamic_flags()
1862                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1863                    {
1864                        this.inner.send_framework_err(
1865                            fidl::encoding::FrameworkErr::UnknownMethod,
1866                            header.tx_id,
1867                            header.ordinal,
1868                            header.dynamic_flags(),
1869                            (bytes, handles),
1870                        )?;
1871                        Ok(RealmRequest::_UnknownMethod {
1872                            ordinal: header.ordinal,
1873                            control_handle: RealmControlHandle { inner: this.inner.clone() },
1874                            method_type: fidl::MethodType::TwoWay,
1875                        })
1876                    }
1877                    _ => Err(fidl::Error::UnknownOrdinal {
1878                        ordinal: header.ordinal,
1879                        protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1880                    }),
1881                }))
1882            },
1883        )
1884    }
1885}
1886
1887/// This protocol is for the DriverTestRealm. It is an integration test
1888/// framework for drivers.
1889#[derive(Debug)]
1890pub enum RealmRequest {
1891    /// Start the realm. Calling this will cause DriverTestRealm to start
1892    /// servicing other protocols (like /dev/). `args` is used to configure
1893    /// the DriverTestRealm.
1894    ///
1895    /// * error `ZX_ERR_ALREADY_EXISTS` the realm has already had `Start` called.
1896    Start { args: RealmArgs, responder: RealmStartResponder },
1897    /// An interaction was received which does not match any known method.
1898    #[non_exhaustive]
1899    _UnknownMethod {
1900        /// Ordinal of the method that was called.
1901        ordinal: u64,
1902        control_handle: RealmControlHandle,
1903        method_type: fidl::MethodType,
1904    },
1905}
1906
1907impl RealmRequest {
1908    #[allow(irrefutable_let_patterns)]
1909    pub fn into_start(self) -> Option<(RealmArgs, RealmStartResponder)> {
1910        if let RealmRequest::Start { args, responder } = self {
1911            Some((args, responder))
1912        } else {
1913            None
1914        }
1915    }
1916
1917    /// Name of the method defined in FIDL
1918    pub fn method_name(&self) -> &'static str {
1919        match *self {
1920            RealmRequest::Start { .. } => "start",
1921            RealmRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1922                "unknown one-way method"
1923            }
1924            RealmRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1925                "unknown two-way method"
1926            }
1927        }
1928    }
1929}
1930
1931#[derive(Debug, Clone)]
1932pub struct RealmControlHandle {
1933    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1934}
1935
1936impl fidl::endpoints::ControlHandle for RealmControlHandle {
1937    fn shutdown(&self) {
1938        self.inner.shutdown()
1939    }
1940    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1941        self.inner.shutdown_with_epitaph(status)
1942    }
1943
1944    fn is_closed(&self) -> bool {
1945        self.inner.channel().is_closed()
1946    }
1947    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1948        self.inner.channel().on_closed()
1949    }
1950
1951    #[cfg(target_os = "fuchsia")]
1952    fn signal_peer(
1953        &self,
1954        clear_mask: zx::Signals,
1955        set_mask: zx::Signals,
1956    ) -> Result<(), zx_status::Status> {
1957        use fidl::Peered;
1958        self.inner.channel().signal_peer(clear_mask, set_mask)
1959    }
1960}
1961
1962impl RealmControlHandle {}
1963
1964#[must_use = "FIDL methods require a response to be sent"]
1965#[derive(Debug)]
1966pub struct RealmStartResponder {
1967    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
1968    tx_id: u32,
1969}
1970
1971/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
1972/// if the responder is dropped without sending a response, so that the client
1973/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1974impl std::ops::Drop for RealmStartResponder {
1975    fn drop(&mut self) {
1976        self.control_handle.shutdown();
1977        // Safety: drops once, never accessed again
1978        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1979    }
1980}
1981
1982impl fidl::endpoints::Responder for RealmStartResponder {
1983    type ControlHandle = RealmControlHandle;
1984
1985    fn control_handle(&self) -> &RealmControlHandle {
1986        &self.control_handle
1987    }
1988
1989    fn drop_without_shutdown(mut self) {
1990        // Safety: drops once, never accessed again due to mem::forget
1991        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1992        // Prevent Drop from running (which would shut down the channel)
1993        std::mem::forget(self);
1994    }
1995}
1996
1997impl RealmStartResponder {
1998    /// Sends a response to the FIDL transaction.
1999    ///
2000    /// Sets the channel to shutdown if an error occurs.
2001    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2002        let _result = self.send_raw(result);
2003        if _result.is_err() {
2004            self.control_handle.shutdown();
2005        }
2006        self.drop_without_shutdown();
2007        _result
2008    }
2009
2010    /// Similar to "send" but does not shutdown the channel if an error occurs.
2011    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2012        let _result = self.send_raw(result);
2013        self.drop_without_shutdown();
2014        _result
2015    }
2016
2017    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2018        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2019            fidl::encoding::EmptyStruct,
2020            i32,
2021        >>(
2022            fidl::encoding::FlexibleResult::new(result),
2023            self.tx_id,
2024            0x3dc6949d581e96fa,
2025            fidl::encoding::DynamicFlags::FLEXIBLE,
2026        )
2027    }
2028}
2029
2030mod internal {
2031    use super::*;
2032
2033    impl fidl::encoding::ResourceTypeMarker for InternalGetBootDirectoryResponse {
2034        type Borrowed<'a> = &'a mut Self;
2035        fn take_or_borrow<'a>(
2036            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2037        ) -> Self::Borrowed<'a> {
2038            value
2039        }
2040    }
2041
2042    unsafe impl fidl::encoding::TypeMarker for InternalGetBootDirectoryResponse {
2043        type Owned = Self;
2044
2045        #[inline(always)]
2046        fn inline_align(_context: fidl::encoding::Context) -> usize {
2047            4
2048        }
2049
2050        #[inline(always)]
2051        fn inline_size(_context: fidl::encoding::Context) -> usize {
2052            4
2053        }
2054    }
2055
2056    unsafe impl
2057        fidl::encoding::Encode<
2058            InternalGetBootDirectoryResponse,
2059            fidl::encoding::DefaultFuchsiaResourceDialect,
2060        > for &mut InternalGetBootDirectoryResponse
2061    {
2062        #[inline]
2063        unsafe fn encode(
2064            self,
2065            encoder: &mut fidl::encoding::Encoder<
2066                '_,
2067                fidl::encoding::DefaultFuchsiaResourceDialect,
2068            >,
2069            offset: usize,
2070            _depth: fidl::encoding::Depth,
2071        ) -> fidl::Result<()> {
2072            encoder.debug_check_bounds::<InternalGetBootDirectoryResponse>(offset);
2073            // Delegate to tuple encoding.
2074            fidl::encoding::Encode::<
2075                InternalGetBootDirectoryResponse,
2076                fidl::encoding::DefaultFuchsiaResourceDialect,
2077            >::encode(
2078                (<fidl::encoding::Optional<
2079                    fidl::encoding::Endpoint<
2080                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2081                    >,
2082                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2083                    &mut self.boot_dir
2084                ),),
2085                encoder,
2086                offset,
2087                _depth,
2088            )
2089        }
2090    }
2091    unsafe impl<
2092            T0: fidl::encoding::Encode<
2093                fidl::encoding::Optional<
2094                    fidl::encoding::Endpoint<
2095                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2096                    >,
2097                >,
2098                fidl::encoding::DefaultFuchsiaResourceDialect,
2099            >,
2100        >
2101        fidl::encoding::Encode<
2102            InternalGetBootDirectoryResponse,
2103            fidl::encoding::DefaultFuchsiaResourceDialect,
2104        > for (T0,)
2105    {
2106        #[inline]
2107        unsafe fn encode(
2108            self,
2109            encoder: &mut fidl::encoding::Encoder<
2110                '_,
2111                fidl::encoding::DefaultFuchsiaResourceDialect,
2112            >,
2113            offset: usize,
2114            depth: fidl::encoding::Depth,
2115        ) -> fidl::Result<()> {
2116            encoder.debug_check_bounds::<InternalGetBootDirectoryResponse>(offset);
2117            // Zero out padding regions. There's no need to apply masks
2118            // because the unmasked parts will be overwritten by fields.
2119            // Write the fields.
2120            self.0.encode(encoder, offset + 0, depth)?;
2121            Ok(())
2122        }
2123    }
2124
2125    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2126        for InternalGetBootDirectoryResponse
2127    {
2128        #[inline(always)]
2129        fn new_empty() -> Self {
2130            Self {
2131                boot_dir: fidl::new_empty!(
2132                    fidl::encoding::Optional<
2133                        fidl::encoding::Endpoint<
2134                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2135                        >,
2136                    >,
2137                    fidl::encoding::DefaultFuchsiaResourceDialect
2138                ),
2139            }
2140        }
2141
2142        #[inline]
2143        unsafe fn decode(
2144            &mut self,
2145            decoder: &mut fidl::encoding::Decoder<
2146                '_,
2147                fidl::encoding::DefaultFuchsiaResourceDialect,
2148            >,
2149            offset: usize,
2150            _depth: fidl::encoding::Depth,
2151        ) -> fidl::Result<()> {
2152            decoder.debug_check_bounds::<Self>(offset);
2153            // Verify that padding bytes are zero.
2154            fidl::decode!(
2155                fidl::encoding::Optional<
2156                    fidl::encoding::Endpoint<
2157                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2158                    >,
2159                >,
2160                fidl::encoding::DefaultFuchsiaResourceDialect,
2161                &mut self.boot_dir,
2162                decoder,
2163                offset + 0,
2164                _depth
2165            )?;
2166            Ok(())
2167        }
2168    }
2169
2170    impl fidl::encoding::ResourceTypeMarker for InternalGetTestPackageResponse {
2171        type Borrowed<'a> = &'a mut Self;
2172        fn take_or_borrow<'a>(
2173            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2174        ) -> Self::Borrowed<'a> {
2175            value
2176        }
2177    }
2178
2179    unsafe impl fidl::encoding::TypeMarker for InternalGetTestPackageResponse {
2180        type Owned = Self;
2181
2182        #[inline(always)]
2183        fn inline_align(_context: fidl::encoding::Context) -> usize {
2184            4
2185        }
2186
2187        #[inline(always)]
2188        fn inline_size(_context: fidl::encoding::Context) -> usize {
2189            4
2190        }
2191    }
2192
2193    unsafe impl
2194        fidl::encoding::Encode<
2195            InternalGetTestPackageResponse,
2196            fidl::encoding::DefaultFuchsiaResourceDialect,
2197        > for &mut InternalGetTestPackageResponse
2198    {
2199        #[inline]
2200        unsafe fn encode(
2201            self,
2202            encoder: &mut fidl::encoding::Encoder<
2203                '_,
2204                fidl::encoding::DefaultFuchsiaResourceDialect,
2205            >,
2206            offset: usize,
2207            _depth: fidl::encoding::Depth,
2208        ) -> fidl::Result<()> {
2209            encoder.debug_check_bounds::<InternalGetTestPackageResponse>(offset);
2210            // Delegate to tuple encoding.
2211            fidl::encoding::Encode::<
2212                InternalGetTestPackageResponse,
2213                fidl::encoding::DefaultFuchsiaResourceDialect,
2214            >::encode(
2215                (<fidl::encoding::Optional<
2216                    fidl::encoding::Endpoint<
2217                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2218                    >,
2219                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2220                    &mut self.test_pkg_dir
2221                ),),
2222                encoder,
2223                offset,
2224                _depth,
2225            )
2226        }
2227    }
2228    unsafe impl<
2229            T0: fidl::encoding::Encode<
2230                fidl::encoding::Optional<
2231                    fidl::encoding::Endpoint<
2232                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2233                    >,
2234                >,
2235                fidl::encoding::DefaultFuchsiaResourceDialect,
2236            >,
2237        >
2238        fidl::encoding::Encode<
2239            InternalGetTestPackageResponse,
2240            fidl::encoding::DefaultFuchsiaResourceDialect,
2241        > for (T0,)
2242    {
2243        #[inline]
2244        unsafe fn encode(
2245            self,
2246            encoder: &mut fidl::encoding::Encoder<
2247                '_,
2248                fidl::encoding::DefaultFuchsiaResourceDialect,
2249            >,
2250            offset: usize,
2251            depth: fidl::encoding::Depth,
2252        ) -> fidl::Result<()> {
2253            encoder.debug_check_bounds::<InternalGetTestPackageResponse>(offset);
2254            // Zero out padding regions. There's no need to apply masks
2255            // because the unmasked parts will be overwritten by fields.
2256            // Write the fields.
2257            self.0.encode(encoder, offset + 0, depth)?;
2258            Ok(())
2259        }
2260    }
2261
2262    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2263        for InternalGetTestPackageResponse
2264    {
2265        #[inline(always)]
2266        fn new_empty() -> Self {
2267            Self {
2268                test_pkg_dir: fidl::new_empty!(
2269                    fidl::encoding::Optional<
2270                        fidl::encoding::Endpoint<
2271                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2272                        >,
2273                    >,
2274                    fidl::encoding::DefaultFuchsiaResourceDialect
2275                ),
2276            }
2277        }
2278
2279        #[inline]
2280        unsafe fn decode(
2281            &mut self,
2282            decoder: &mut fidl::encoding::Decoder<
2283                '_,
2284                fidl::encoding::DefaultFuchsiaResourceDialect,
2285            >,
2286            offset: usize,
2287            _depth: fidl::encoding::Depth,
2288        ) -> fidl::Result<()> {
2289            decoder.debug_check_bounds::<Self>(offset);
2290            // Verify that padding bytes are zero.
2291            fidl::decode!(
2292                fidl::encoding::Optional<
2293                    fidl::encoding::Endpoint<
2294                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2295                    >,
2296                >,
2297                fidl::encoding::DefaultFuchsiaResourceDialect,
2298                &mut self.test_pkg_dir,
2299                decoder,
2300                offset + 0,
2301                _depth
2302            )?;
2303            Ok(())
2304        }
2305    }
2306
2307    impl fidl::encoding::ResourceTypeMarker for RealmStartRequest {
2308        type Borrowed<'a> = &'a mut Self;
2309        fn take_or_borrow<'a>(
2310            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2311        ) -> Self::Borrowed<'a> {
2312            value
2313        }
2314    }
2315
2316    unsafe impl fidl::encoding::TypeMarker for RealmStartRequest {
2317        type Owned = Self;
2318
2319        #[inline(always)]
2320        fn inline_align(_context: fidl::encoding::Context) -> usize {
2321            8
2322        }
2323
2324        #[inline(always)]
2325        fn inline_size(_context: fidl::encoding::Context) -> usize {
2326            16
2327        }
2328    }
2329
2330    unsafe impl
2331        fidl::encoding::Encode<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2332        for &mut RealmStartRequest
2333    {
2334        #[inline]
2335        unsafe fn encode(
2336            self,
2337            encoder: &mut fidl::encoding::Encoder<
2338                '_,
2339                fidl::encoding::DefaultFuchsiaResourceDialect,
2340            >,
2341            offset: usize,
2342            _depth: fidl::encoding::Depth,
2343        ) -> fidl::Result<()> {
2344            encoder.debug_check_bounds::<RealmStartRequest>(offset);
2345            // Delegate to tuple encoding.
2346            fidl::encoding::Encode::<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2347                (
2348                    <RealmArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
2349                ),
2350                encoder, offset, _depth
2351            )
2352        }
2353    }
2354    unsafe impl<T0: fidl::encoding::Encode<RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect>>
2355        fidl::encoding::Encode<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2356        for (T0,)
2357    {
2358        #[inline]
2359        unsafe fn encode(
2360            self,
2361            encoder: &mut fidl::encoding::Encoder<
2362                '_,
2363                fidl::encoding::DefaultFuchsiaResourceDialect,
2364            >,
2365            offset: usize,
2366            depth: fidl::encoding::Depth,
2367        ) -> fidl::Result<()> {
2368            encoder.debug_check_bounds::<RealmStartRequest>(offset);
2369            // Zero out padding regions. There's no need to apply masks
2370            // because the unmasked parts will be overwritten by fields.
2371            // Write the fields.
2372            self.0.encode(encoder, offset + 0, depth)?;
2373            Ok(())
2374        }
2375    }
2376
2377    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2378        for RealmStartRequest
2379    {
2380        #[inline(always)]
2381        fn new_empty() -> Self {
2382            Self {
2383                args: fidl::new_empty!(RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect),
2384            }
2385        }
2386
2387        #[inline]
2388        unsafe fn decode(
2389            &mut self,
2390            decoder: &mut fidl::encoding::Decoder<
2391                '_,
2392                fidl::encoding::DefaultFuchsiaResourceDialect,
2393            >,
2394            offset: usize,
2395            _depth: fidl::encoding::Depth,
2396        ) -> fidl::Result<()> {
2397            decoder.debug_check_bounds::<Self>(offset);
2398            // Verify that padding bytes are zero.
2399            fidl::decode!(
2400                RealmArgs,
2401                fidl::encoding::DefaultFuchsiaResourceDialect,
2402                &mut self.args,
2403                decoder,
2404                offset + 0,
2405                _depth
2406            )?;
2407            Ok(())
2408        }
2409    }
2410
2411    impl RealmArgs {
2412        #[inline(always)]
2413        fn max_ordinal_present(&self) -> u64 {
2414            if let Some(_) = self.platform_pid {
2415                return 22;
2416            }
2417            if let Some(_) = self.platform_vid {
2418                return 21;
2419            }
2420            if let Some(_) = self.devicetree {
2421                return 20;
2422            }
2423            if let Some(_) = self.boot_driver_components {
2424                return 19;
2425            }
2426            if let Some(_) = self.software_devices {
2427                return 18;
2428            }
2429            if let Some(_) = self.driver_index_stop_timeout_millis {
2430                return 17;
2431            }
2432            if let Some(_) = self.test_component {
2433                return 16;
2434            }
2435            if let Some(_) = self.dtr_exposes {
2436                return 15;
2437            }
2438            if let Some(_) = self.dtr_offers {
2439                return 14;
2440            }
2441            if let Some(_) = self.pkg {
2442                return 13;
2443            }
2444            if let Some(_) = self.exposes {
2445                return 12;
2446            }
2447            if let Some(_) = self.offers {
2448                return 11;
2449            }
2450            if let Some(_) = self.board_name {
2451                return 10;
2452            }
2453            if let Some(_) = self.driver_bind_eager {
2454                return 9;
2455            }
2456            if let Some(_) = self.driver_disable {
2457                return 8;
2458            }
2459            if let Some(_) = self.driver_log_level {
2460                return 7;
2461            }
2462            if let Some(_) = self.driver_tests_disable {
2463                return 6;
2464            }
2465            if let Some(_) = self.driver_tests_enable {
2466                return 5;
2467            }
2468            if let Some(_) = self.driver_tests_enable_all {
2469                return 4;
2470            }
2471            if let Some(_) = self.use_driver_framework_v2 {
2472                return 3;
2473            }
2474            if let Some(_) = self.root_driver {
2475                return 2;
2476            }
2477            if let Some(_) = self.boot {
2478                return 1;
2479            }
2480            0
2481        }
2482    }
2483
2484    impl fidl::encoding::ResourceTypeMarker for RealmArgs {
2485        type Borrowed<'a> = &'a mut Self;
2486        fn take_or_borrow<'a>(
2487            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2488        ) -> Self::Borrowed<'a> {
2489            value
2490        }
2491    }
2492
2493    unsafe impl fidl::encoding::TypeMarker for RealmArgs {
2494        type Owned = Self;
2495
2496        #[inline(always)]
2497        fn inline_align(_context: fidl::encoding::Context) -> usize {
2498            8
2499        }
2500
2501        #[inline(always)]
2502        fn inline_size(_context: fidl::encoding::Context) -> usize {
2503            16
2504        }
2505    }
2506
2507    unsafe impl fidl::encoding::Encode<RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
2508        for &mut RealmArgs
2509    {
2510        unsafe fn encode(
2511            self,
2512            encoder: &mut fidl::encoding::Encoder<
2513                '_,
2514                fidl::encoding::DefaultFuchsiaResourceDialect,
2515            >,
2516            offset: usize,
2517            mut depth: fidl::encoding::Depth,
2518        ) -> fidl::Result<()> {
2519            encoder.debug_check_bounds::<RealmArgs>(offset);
2520            // Vector header
2521            let max_ordinal: u64 = self.max_ordinal_present();
2522            encoder.write_num(max_ordinal, offset);
2523            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2524            // Calling encoder.out_of_line_offset(0) is not allowed.
2525            if max_ordinal == 0 {
2526                return Ok(());
2527            }
2528            depth.increment()?;
2529            let envelope_size = 8;
2530            let bytes_len = max_ordinal as usize * envelope_size;
2531            #[allow(unused_variables)]
2532            let offset = encoder.out_of_line_offset(bytes_len);
2533            let mut _prev_end_offset: usize = 0;
2534            if 1 > max_ordinal {
2535                return Ok(());
2536            }
2537
2538            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2539            // are envelope_size bytes.
2540            let cur_offset: usize = (1 - 1) * envelope_size;
2541
2542            // Zero reserved fields.
2543            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2544
2545            // Safety:
2546            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2547            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2548            //   envelope_size bytes, there is always sufficient room.
2549            fidl::encoding::encode_in_envelope_optional::<
2550                fidl::encoding::Endpoint<
2551                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2552                >,
2553                fidl::encoding::DefaultFuchsiaResourceDialect,
2554            >(
2555                self.boot.as_mut().map(
2556                    <fidl::encoding::Endpoint<
2557                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2558                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2559                ),
2560                encoder,
2561                offset + cur_offset,
2562                depth,
2563            )?;
2564
2565            _prev_end_offset = cur_offset + envelope_size;
2566            if 2 > max_ordinal {
2567                return Ok(());
2568            }
2569
2570            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2571            // are envelope_size bytes.
2572            let cur_offset: usize = (2 - 1) * envelope_size;
2573
2574            // Zero reserved fields.
2575            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2576
2577            // Safety:
2578            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2579            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2580            //   envelope_size bytes, there is always sufficient room.
2581            fidl::encoding::encode_in_envelope_optional::<
2582                fidl::encoding::UnboundedString,
2583                fidl::encoding::DefaultFuchsiaResourceDialect,
2584            >(
2585                self.root_driver.as_ref().map(
2586                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2587                ),
2588                encoder,
2589                offset + cur_offset,
2590                depth,
2591            )?;
2592
2593            _prev_end_offset = cur_offset + envelope_size;
2594            if 3 > max_ordinal {
2595                return Ok(());
2596            }
2597
2598            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2599            // are envelope_size bytes.
2600            let cur_offset: usize = (3 - 1) * envelope_size;
2601
2602            // Zero reserved fields.
2603            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2604
2605            // Safety:
2606            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2607            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2608            //   envelope_size bytes, there is always sufficient room.
2609            fidl::encoding::encode_in_envelope_optional::<
2610                bool,
2611                fidl::encoding::DefaultFuchsiaResourceDialect,
2612            >(
2613                self.use_driver_framework_v2
2614                    .as_ref()
2615                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2616                encoder,
2617                offset + cur_offset,
2618                depth,
2619            )?;
2620
2621            _prev_end_offset = cur_offset + envelope_size;
2622            if 4 > max_ordinal {
2623                return Ok(());
2624            }
2625
2626            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2627            // are envelope_size bytes.
2628            let cur_offset: usize = (4 - 1) * envelope_size;
2629
2630            // Zero reserved fields.
2631            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2632
2633            // Safety:
2634            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2635            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2636            //   envelope_size bytes, there is always sufficient room.
2637            fidl::encoding::encode_in_envelope_optional::<
2638                bool,
2639                fidl::encoding::DefaultFuchsiaResourceDialect,
2640            >(
2641                self.driver_tests_enable_all
2642                    .as_ref()
2643                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2644                encoder,
2645                offset + cur_offset,
2646                depth,
2647            )?;
2648
2649            _prev_end_offset = cur_offset + envelope_size;
2650            if 5 > max_ordinal {
2651                return Ok(());
2652            }
2653
2654            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2655            // are envelope_size bytes.
2656            let cur_offset: usize = (5 - 1) * envelope_size;
2657
2658            // Zero reserved fields.
2659            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2660
2661            // Safety:
2662            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2663            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2664            //   envelope_size bytes, there is always sufficient room.
2665            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2666            self.driver_tests_enable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
2667            encoder, offset + cur_offset, depth
2668        )?;
2669
2670            _prev_end_offset = cur_offset + envelope_size;
2671            if 6 > max_ordinal {
2672                return Ok(());
2673            }
2674
2675            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2676            // are envelope_size bytes.
2677            let cur_offset: usize = (6 - 1) * envelope_size;
2678
2679            // Zero reserved fields.
2680            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2681
2682            // Safety:
2683            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2684            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2685            //   envelope_size bytes, there is always sufficient room.
2686            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2687            self.driver_tests_disable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
2688            encoder, offset + cur_offset, depth
2689        )?;
2690
2691            _prev_end_offset = cur_offset + envelope_size;
2692            if 7 > max_ordinal {
2693                return Ok(());
2694            }
2695
2696            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2697            // are envelope_size bytes.
2698            let cur_offset: usize = (7 - 1) * envelope_size;
2699
2700            // Zero reserved fields.
2701            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2702
2703            // Safety:
2704            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2705            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2706            //   envelope_size bytes, there is always sufficient room.
2707            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<DriverLog>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2708            self.driver_log_level.as_ref().map(<fidl::encoding::UnboundedVector<DriverLog> as fidl::encoding::ValueTypeMarker>::borrow),
2709            encoder, offset + cur_offset, depth
2710        )?;
2711
2712            _prev_end_offset = cur_offset + envelope_size;
2713            if 8 > max_ordinal {
2714                return Ok(());
2715            }
2716
2717            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2718            // are envelope_size bytes.
2719            let cur_offset: usize = (8 - 1) * envelope_size;
2720
2721            // Zero reserved fields.
2722            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2723
2724            // Safety:
2725            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2726            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2727            //   envelope_size bytes, there is always sufficient room.
2728            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2729            self.driver_disable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
2730            encoder, offset + cur_offset, depth
2731        )?;
2732
2733            _prev_end_offset = cur_offset + envelope_size;
2734            if 9 > max_ordinal {
2735                return Ok(());
2736            }
2737
2738            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2739            // are envelope_size bytes.
2740            let cur_offset: usize = (9 - 1) * envelope_size;
2741
2742            // Zero reserved fields.
2743            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2744
2745            // Safety:
2746            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2747            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2748            //   envelope_size bytes, there is always sufficient room.
2749            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2750            self.driver_bind_eager.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
2751            encoder, offset + cur_offset, depth
2752        )?;
2753
2754            _prev_end_offset = cur_offset + envelope_size;
2755            if 10 > max_ordinal {
2756                return Ok(());
2757            }
2758
2759            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2760            // are envelope_size bytes.
2761            let cur_offset: usize = (10 - 1) * envelope_size;
2762
2763            // Zero reserved fields.
2764            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2765
2766            // Safety:
2767            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2768            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2769            //   envelope_size bytes, there is always sufficient room.
2770            fidl::encoding::encode_in_envelope_optional::<
2771                fidl::encoding::UnboundedString,
2772                fidl::encoding::DefaultFuchsiaResourceDialect,
2773            >(
2774                self.board_name.as_ref().map(
2775                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2776                ),
2777                encoder,
2778                offset + cur_offset,
2779                depth,
2780            )?;
2781
2782            _prev_end_offset = cur_offset + envelope_size;
2783            if 11 > max_ordinal {
2784                return Ok(());
2785            }
2786
2787            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2788            // are envelope_size bytes.
2789            let cur_offset: usize = (11 - 1) * envelope_size;
2790
2791            // Zero reserved fields.
2792            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2793
2794            // Safety:
2795            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2796            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2797            //   envelope_size bytes, there is always sufficient room.
2798            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Offer>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2799            self.offers.as_ref().map(<fidl::encoding::UnboundedVector<Offer> as fidl::encoding::ValueTypeMarker>::borrow),
2800            encoder, offset + cur_offset, depth
2801        )?;
2802
2803            _prev_end_offset = cur_offset + envelope_size;
2804            if 12 > max_ordinal {
2805                return Ok(());
2806            }
2807
2808            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2809            // are envelope_size bytes.
2810            let cur_offset: usize = (12 - 1) * envelope_size;
2811
2812            // Zero reserved fields.
2813            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2814
2815            // Safety:
2816            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2817            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2818            //   envelope_size bytes, there is always sufficient room.
2819            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Expose>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2820            self.exposes.as_ref().map(<fidl::encoding::UnboundedVector<Expose> as fidl::encoding::ValueTypeMarker>::borrow),
2821            encoder, offset + cur_offset, depth
2822        )?;
2823
2824            _prev_end_offset = cur_offset + envelope_size;
2825            if 13 > max_ordinal {
2826                return Ok(());
2827            }
2828
2829            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2830            // are envelope_size bytes.
2831            let cur_offset: usize = (13 - 1) * envelope_size;
2832
2833            // Zero reserved fields.
2834            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2835
2836            // Safety:
2837            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2838            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2839            //   envelope_size bytes, there is always sufficient room.
2840            fidl::encoding::encode_in_envelope_optional::<
2841                fidl::encoding::Endpoint<
2842                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2843                >,
2844                fidl::encoding::DefaultFuchsiaResourceDialect,
2845            >(
2846                self.pkg.as_mut().map(
2847                    <fidl::encoding::Endpoint<
2848                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
2849                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2850                ),
2851                encoder,
2852                offset + cur_offset,
2853                depth,
2854            )?;
2855
2856            _prev_end_offset = cur_offset + envelope_size;
2857            if 14 > max_ordinal {
2858                return Ok(());
2859            }
2860
2861            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2862            // are envelope_size bytes.
2863            let cur_offset: usize = (14 - 1) * envelope_size;
2864
2865            // Zero reserved fields.
2866            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2867
2868            // Safety:
2869            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2870            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2871            //   envelope_size bytes, there is always sufficient room.
2872            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2873            self.dtr_offers.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability> as fidl::encoding::ValueTypeMarker>::borrow),
2874            encoder, offset + cur_offset, depth
2875        )?;
2876
2877            _prev_end_offset = cur_offset + envelope_size;
2878            if 15 > max_ordinal {
2879                return Ok(());
2880            }
2881
2882            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2883            // are envelope_size bytes.
2884            let cur_offset: usize = (15 - 1) * envelope_size;
2885
2886            // Zero reserved fields.
2887            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2888
2889            // Safety:
2890            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2891            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2892            //   envelope_size bytes, there is always sufficient room.
2893            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2894            self.dtr_exposes.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability> as fidl::encoding::ValueTypeMarker>::borrow),
2895            encoder, offset + cur_offset, depth
2896        )?;
2897
2898            _prev_end_offset = cur_offset + envelope_size;
2899            if 16 > max_ordinal {
2900                return Ok(());
2901            }
2902
2903            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2904            // are envelope_size bytes.
2905            let cur_offset: usize = (16 - 1) * envelope_size;
2906
2907            // Zero reserved fields.
2908            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2909
2910            // Safety:
2911            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2912            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2913            //   envelope_size bytes, there is always sufficient room.
2914            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_resolution::Component, fidl::encoding::DefaultFuchsiaResourceDialect>(
2915            self.test_component.as_mut().map(<fidl_fuchsia_component_resolution::Component as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
2916            encoder, offset + cur_offset, depth
2917        )?;
2918
2919            _prev_end_offset = cur_offset + envelope_size;
2920            if 17 > max_ordinal {
2921                return Ok(());
2922            }
2923
2924            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2925            // are envelope_size bytes.
2926            let cur_offset: usize = (17 - 1) * envelope_size;
2927
2928            // Zero reserved fields.
2929            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2930
2931            // Safety:
2932            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2933            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2934            //   envelope_size bytes, there is always sufficient room.
2935            fidl::encoding::encode_in_envelope_optional::<
2936                i64,
2937                fidl::encoding::DefaultFuchsiaResourceDialect,
2938            >(
2939                self.driver_index_stop_timeout_millis
2940                    .as_ref()
2941                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2942                encoder,
2943                offset + cur_offset,
2944                depth,
2945            )?;
2946
2947            _prev_end_offset = cur_offset + envelope_size;
2948            if 18 > max_ordinal {
2949                return Ok(());
2950            }
2951
2952            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2953            // are envelope_size bytes.
2954            let cur_offset: usize = (18 - 1) * envelope_size;
2955
2956            // Zero reserved fields.
2957            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2958
2959            // Safety:
2960            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2961            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2962            //   envelope_size bytes, there is always sufficient room.
2963            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2964            self.software_devices.as_ref().map(<fidl::encoding::Vector<SoftwareDevice, 20> as fidl::encoding::ValueTypeMarker>::borrow),
2965            encoder, offset + cur_offset, depth
2966        )?;
2967
2968            _prev_end_offset = cur_offset + envelope_size;
2969            if 19 > max_ordinal {
2970                return Ok(());
2971            }
2972
2973            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2974            // are envelope_size bytes.
2975            let cur_offset: usize = (19 - 1) * envelope_size;
2976
2977            // Zero reserved fields.
2978            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2979
2980            // Safety:
2981            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2982            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2983            //   envelope_size bytes, there is always sufficient room.
2984            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2985            self.boot_driver_components.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
2986            encoder, offset + cur_offset, depth
2987        )?;
2988
2989            _prev_end_offset = cur_offset + envelope_size;
2990            if 20 > max_ordinal {
2991                return Ok(());
2992            }
2993
2994            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2995            // are envelope_size bytes.
2996            let cur_offset: usize = (20 - 1) * envelope_size;
2997
2998            // Zero reserved fields.
2999            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3000
3001            // Safety:
3002            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3003            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3004            //   envelope_size bytes, there is always sufficient room.
3005            fidl::encoding::encode_in_envelope_optional::<
3006                fidl::encoding::HandleType<
3007                    fidl::Vmo,
3008                    { fidl::ObjectType::VMO.into_raw() },
3009                    2147483648,
3010                >,
3011                fidl::encoding::DefaultFuchsiaResourceDialect,
3012            >(
3013                self.devicetree.as_mut().map(
3014                    <fidl::encoding::HandleType<
3015                        fidl::Vmo,
3016                        { fidl::ObjectType::VMO.into_raw() },
3017                        2147483648,
3018                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3019                ),
3020                encoder,
3021                offset + cur_offset,
3022                depth,
3023            )?;
3024
3025            _prev_end_offset = cur_offset + envelope_size;
3026            if 21 > max_ordinal {
3027                return Ok(());
3028            }
3029
3030            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3031            // are envelope_size bytes.
3032            let cur_offset: usize = (21 - 1) * envelope_size;
3033
3034            // Zero reserved fields.
3035            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3036
3037            // Safety:
3038            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3039            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3040            //   envelope_size bytes, there is always sufficient room.
3041            fidl::encoding::encode_in_envelope_optional::<
3042                u32,
3043                fidl::encoding::DefaultFuchsiaResourceDialect,
3044            >(
3045                self.platform_vid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3046                encoder,
3047                offset + cur_offset,
3048                depth,
3049            )?;
3050
3051            _prev_end_offset = cur_offset + envelope_size;
3052            if 22 > max_ordinal {
3053                return Ok(());
3054            }
3055
3056            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3057            // are envelope_size bytes.
3058            let cur_offset: usize = (22 - 1) * envelope_size;
3059
3060            // Zero reserved fields.
3061            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3062
3063            // Safety:
3064            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3065            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3066            //   envelope_size bytes, there is always sufficient room.
3067            fidl::encoding::encode_in_envelope_optional::<
3068                u32,
3069                fidl::encoding::DefaultFuchsiaResourceDialect,
3070            >(
3071                self.platform_pid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3072                encoder,
3073                offset + cur_offset,
3074                depth,
3075            )?;
3076
3077            _prev_end_offset = cur_offset + envelope_size;
3078
3079            Ok(())
3080        }
3081    }
3082
3083    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RealmArgs {
3084        #[inline(always)]
3085        fn new_empty() -> Self {
3086            Self::default()
3087        }
3088
3089        unsafe fn decode(
3090            &mut self,
3091            decoder: &mut fidl::encoding::Decoder<
3092                '_,
3093                fidl::encoding::DefaultFuchsiaResourceDialect,
3094            >,
3095            offset: usize,
3096            mut depth: fidl::encoding::Depth,
3097        ) -> fidl::Result<()> {
3098            decoder.debug_check_bounds::<Self>(offset);
3099            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3100                None => return Err(fidl::Error::NotNullable),
3101                Some(len) => len,
3102            };
3103            // Calling decoder.out_of_line_offset(0) is not allowed.
3104            if len == 0 {
3105                return Ok(());
3106            };
3107            depth.increment()?;
3108            let envelope_size = 8;
3109            let bytes_len = len * envelope_size;
3110            let offset = decoder.out_of_line_offset(bytes_len)?;
3111            // Decode the envelope for each type.
3112            let mut _next_ordinal_to_read = 0;
3113            let mut next_offset = offset;
3114            let end_offset = offset + bytes_len;
3115            _next_ordinal_to_read += 1;
3116            if next_offset >= end_offset {
3117                return Ok(());
3118            }
3119
3120            // Decode unknown envelopes for gaps in ordinals.
3121            while _next_ordinal_to_read < 1 {
3122                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3123                _next_ordinal_to_read += 1;
3124                next_offset += envelope_size;
3125            }
3126
3127            let next_out_of_line = decoder.next_out_of_line();
3128            let handles_before = decoder.remaining_handles();
3129            if let Some((inlined, num_bytes, num_handles)) =
3130                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3131            {
3132                let member_inline_size = <fidl::encoding::Endpoint<
3133                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3134                > as fidl::encoding::TypeMarker>::inline_size(
3135                    decoder.context
3136                );
3137                if inlined != (member_inline_size <= 4) {
3138                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3139                }
3140                let inner_offset;
3141                let mut inner_depth = depth.clone();
3142                if inlined {
3143                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3144                    inner_offset = next_offset;
3145                } else {
3146                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3147                    inner_depth.increment()?;
3148                }
3149                let val_ref = self.boot.get_or_insert_with(|| {
3150                    fidl::new_empty!(
3151                        fidl::encoding::Endpoint<
3152                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3153                        >,
3154                        fidl::encoding::DefaultFuchsiaResourceDialect
3155                    )
3156                });
3157                fidl::decode!(
3158                    fidl::encoding::Endpoint<
3159                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3160                    >,
3161                    fidl::encoding::DefaultFuchsiaResourceDialect,
3162                    val_ref,
3163                    decoder,
3164                    inner_offset,
3165                    inner_depth
3166                )?;
3167                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3168                {
3169                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3170                }
3171                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3172                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3173                }
3174            }
3175
3176            next_offset += envelope_size;
3177            _next_ordinal_to_read += 1;
3178            if next_offset >= end_offset {
3179                return Ok(());
3180            }
3181
3182            // Decode unknown envelopes for gaps in ordinals.
3183            while _next_ordinal_to_read < 2 {
3184                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3185                _next_ordinal_to_read += 1;
3186                next_offset += envelope_size;
3187            }
3188
3189            let next_out_of_line = decoder.next_out_of_line();
3190            let handles_before = decoder.remaining_handles();
3191            if let Some((inlined, num_bytes, num_handles)) =
3192                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3193            {
3194                let member_inline_size =
3195                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3196                        decoder.context,
3197                    );
3198                if inlined != (member_inline_size <= 4) {
3199                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3200                }
3201                let inner_offset;
3202                let mut inner_depth = depth.clone();
3203                if inlined {
3204                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3205                    inner_offset = next_offset;
3206                } else {
3207                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3208                    inner_depth.increment()?;
3209                }
3210                let val_ref = self.root_driver.get_or_insert_with(|| {
3211                    fidl::new_empty!(
3212                        fidl::encoding::UnboundedString,
3213                        fidl::encoding::DefaultFuchsiaResourceDialect
3214                    )
3215                });
3216                fidl::decode!(
3217                    fidl::encoding::UnboundedString,
3218                    fidl::encoding::DefaultFuchsiaResourceDialect,
3219                    val_ref,
3220                    decoder,
3221                    inner_offset,
3222                    inner_depth
3223                )?;
3224                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3225                {
3226                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3227                }
3228                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3229                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3230                }
3231            }
3232
3233            next_offset += envelope_size;
3234            _next_ordinal_to_read += 1;
3235            if next_offset >= end_offset {
3236                return Ok(());
3237            }
3238
3239            // Decode unknown envelopes for gaps in ordinals.
3240            while _next_ordinal_to_read < 3 {
3241                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3242                _next_ordinal_to_read += 1;
3243                next_offset += envelope_size;
3244            }
3245
3246            let next_out_of_line = decoder.next_out_of_line();
3247            let handles_before = decoder.remaining_handles();
3248            if let Some((inlined, num_bytes, num_handles)) =
3249                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3250            {
3251                let member_inline_size =
3252                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3253                if inlined != (member_inline_size <= 4) {
3254                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3255                }
3256                let inner_offset;
3257                let mut inner_depth = depth.clone();
3258                if inlined {
3259                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3260                    inner_offset = next_offset;
3261                } else {
3262                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3263                    inner_depth.increment()?;
3264                }
3265                let val_ref = self.use_driver_framework_v2.get_or_insert_with(|| {
3266                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
3267                });
3268                fidl::decode!(
3269                    bool,
3270                    fidl::encoding::DefaultFuchsiaResourceDialect,
3271                    val_ref,
3272                    decoder,
3273                    inner_offset,
3274                    inner_depth
3275                )?;
3276                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3277                {
3278                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3279                }
3280                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3281                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3282                }
3283            }
3284
3285            next_offset += envelope_size;
3286            _next_ordinal_to_read += 1;
3287            if next_offset >= end_offset {
3288                return Ok(());
3289            }
3290
3291            // Decode unknown envelopes for gaps in ordinals.
3292            while _next_ordinal_to_read < 4 {
3293                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3294                _next_ordinal_to_read += 1;
3295                next_offset += envelope_size;
3296            }
3297
3298            let next_out_of_line = decoder.next_out_of_line();
3299            let handles_before = decoder.remaining_handles();
3300            if let Some((inlined, num_bytes, num_handles)) =
3301                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3302            {
3303                let member_inline_size =
3304                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3305                if inlined != (member_inline_size <= 4) {
3306                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3307                }
3308                let inner_offset;
3309                let mut inner_depth = depth.clone();
3310                if inlined {
3311                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3312                    inner_offset = next_offset;
3313                } else {
3314                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3315                    inner_depth.increment()?;
3316                }
3317                let val_ref = self.driver_tests_enable_all.get_or_insert_with(|| {
3318                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
3319                });
3320                fidl::decode!(
3321                    bool,
3322                    fidl::encoding::DefaultFuchsiaResourceDialect,
3323                    val_ref,
3324                    decoder,
3325                    inner_offset,
3326                    inner_depth
3327                )?;
3328                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3329                {
3330                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3331                }
3332                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3333                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3334                }
3335            }
3336
3337            next_offset += envelope_size;
3338            _next_ordinal_to_read += 1;
3339            if next_offset >= end_offset {
3340                return Ok(());
3341            }
3342
3343            // Decode unknown envelopes for gaps in ordinals.
3344            while _next_ordinal_to_read < 5 {
3345                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3346                _next_ordinal_to_read += 1;
3347                next_offset += envelope_size;
3348            }
3349
3350            let next_out_of_line = decoder.next_out_of_line();
3351            let handles_before = decoder.remaining_handles();
3352            if let Some((inlined, num_bytes, num_handles)) =
3353                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3354            {
3355                let member_inline_size = <fidl::encoding::UnboundedVector<
3356                    fidl::encoding::UnboundedString,
3357                > as fidl::encoding::TypeMarker>::inline_size(
3358                    decoder.context
3359                );
3360                if inlined != (member_inline_size <= 4) {
3361                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3362                }
3363                let inner_offset;
3364                let mut inner_depth = depth.clone();
3365                if inlined {
3366                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3367                    inner_offset = next_offset;
3368                } else {
3369                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3370                    inner_depth.increment()?;
3371                }
3372                let val_ref = self.driver_tests_enable.get_or_insert_with(|| {
3373                    fidl::new_empty!(
3374                        fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
3375                        fidl::encoding::DefaultFuchsiaResourceDialect
3376                    )
3377                });
3378                fidl::decode!(
3379                    fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
3380                    fidl::encoding::DefaultFuchsiaResourceDialect,
3381                    val_ref,
3382                    decoder,
3383                    inner_offset,
3384                    inner_depth
3385                )?;
3386                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3387                {
3388                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3389                }
3390                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3391                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3392                }
3393            }
3394
3395            next_offset += envelope_size;
3396            _next_ordinal_to_read += 1;
3397            if next_offset >= end_offset {
3398                return Ok(());
3399            }
3400
3401            // Decode unknown envelopes for gaps in ordinals.
3402            while _next_ordinal_to_read < 6 {
3403                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3404                _next_ordinal_to_read += 1;
3405                next_offset += envelope_size;
3406            }
3407
3408            let next_out_of_line = decoder.next_out_of_line();
3409            let handles_before = decoder.remaining_handles();
3410            if let Some((inlined, num_bytes, num_handles)) =
3411                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3412            {
3413                let member_inline_size = <fidl::encoding::UnboundedVector<
3414                    fidl::encoding::UnboundedString,
3415                > as fidl::encoding::TypeMarker>::inline_size(
3416                    decoder.context
3417                );
3418                if inlined != (member_inline_size <= 4) {
3419                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3420                }
3421                let inner_offset;
3422                let mut inner_depth = depth.clone();
3423                if inlined {
3424                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3425                    inner_offset = next_offset;
3426                } else {
3427                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3428                    inner_depth.increment()?;
3429                }
3430                let val_ref = self.driver_tests_disable.get_or_insert_with(|| {
3431                    fidl::new_empty!(
3432                        fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
3433                        fidl::encoding::DefaultFuchsiaResourceDialect
3434                    )
3435                });
3436                fidl::decode!(
3437                    fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
3438                    fidl::encoding::DefaultFuchsiaResourceDialect,
3439                    val_ref,
3440                    decoder,
3441                    inner_offset,
3442                    inner_depth
3443                )?;
3444                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3445                {
3446                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3447                }
3448                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3449                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3450                }
3451            }
3452
3453            next_offset += envelope_size;
3454            _next_ordinal_to_read += 1;
3455            if next_offset >= end_offset {
3456                return Ok(());
3457            }
3458
3459            // Decode unknown envelopes for gaps in ordinals.
3460            while _next_ordinal_to_read < 7 {
3461                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3462                _next_ordinal_to_read += 1;
3463                next_offset += envelope_size;
3464            }
3465
3466            let next_out_of_line = decoder.next_out_of_line();
3467            let handles_before = decoder.remaining_handles();
3468            if let Some((inlined, num_bytes, num_handles)) =
3469                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3470            {
3471                let member_inline_size = <fidl::encoding::UnboundedVector<DriverLog> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3472                if inlined != (member_inline_size <= 4) {
3473                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3474                }
3475                let inner_offset;
3476                let mut inner_depth = depth.clone();
3477                if inlined {
3478                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3479                    inner_offset = next_offset;
3480                } else {
3481                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3482                    inner_depth.increment()?;
3483                }
3484                let val_ref = self.driver_log_level.get_or_insert_with(|| {
3485                    fidl::new_empty!(
3486                        fidl::encoding::UnboundedVector<DriverLog>,
3487                        fidl::encoding::DefaultFuchsiaResourceDialect
3488                    )
3489                });
3490                fidl::decode!(
3491                    fidl::encoding::UnboundedVector<DriverLog>,
3492                    fidl::encoding::DefaultFuchsiaResourceDialect,
3493                    val_ref,
3494                    decoder,
3495                    inner_offset,
3496                    inner_depth
3497                )?;
3498                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3499                {
3500                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3501                }
3502                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3503                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3504                }
3505            }
3506
3507            next_offset += envelope_size;
3508            _next_ordinal_to_read += 1;
3509            if next_offset >= end_offset {
3510                return Ok(());
3511            }
3512
3513            // Decode unknown envelopes for gaps in ordinals.
3514            while _next_ordinal_to_read < 8 {
3515                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3516                _next_ordinal_to_read += 1;
3517                next_offset += envelope_size;
3518            }
3519
3520            let next_out_of_line = decoder.next_out_of_line();
3521            let handles_before = decoder.remaining_handles();
3522            if let Some((inlined, num_bytes, num_handles)) =
3523                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3524            {
3525                let member_inline_size = <fidl::encoding::UnboundedVector<
3526                    fidl::encoding::UnboundedString,
3527                > as fidl::encoding::TypeMarker>::inline_size(
3528                    decoder.context
3529                );
3530                if inlined != (member_inline_size <= 4) {
3531                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3532                }
3533                let inner_offset;
3534                let mut inner_depth = depth.clone();
3535                if inlined {
3536                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3537                    inner_offset = next_offset;
3538                } else {
3539                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3540                    inner_depth.increment()?;
3541                }
3542                let val_ref = self.driver_disable.get_or_insert_with(|| {
3543                    fidl::new_empty!(
3544                        fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
3545                        fidl::encoding::DefaultFuchsiaResourceDialect
3546                    )
3547                });
3548                fidl::decode!(
3549                    fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
3550                    fidl::encoding::DefaultFuchsiaResourceDialect,
3551                    val_ref,
3552                    decoder,
3553                    inner_offset,
3554                    inner_depth
3555                )?;
3556                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3557                {
3558                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3559                }
3560                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3561                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3562                }
3563            }
3564
3565            next_offset += envelope_size;
3566            _next_ordinal_to_read += 1;
3567            if next_offset >= end_offset {
3568                return Ok(());
3569            }
3570
3571            // Decode unknown envelopes for gaps in ordinals.
3572            while _next_ordinal_to_read < 9 {
3573                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3574                _next_ordinal_to_read += 1;
3575                next_offset += envelope_size;
3576            }
3577
3578            let next_out_of_line = decoder.next_out_of_line();
3579            let handles_before = decoder.remaining_handles();
3580            if let Some((inlined, num_bytes, num_handles)) =
3581                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3582            {
3583                let member_inline_size = <fidl::encoding::UnboundedVector<
3584                    fidl::encoding::UnboundedString,
3585                > as fidl::encoding::TypeMarker>::inline_size(
3586                    decoder.context
3587                );
3588                if inlined != (member_inline_size <= 4) {
3589                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3590                }
3591                let inner_offset;
3592                let mut inner_depth = depth.clone();
3593                if inlined {
3594                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3595                    inner_offset = next_offset;
3596                } else {
3597                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3598                    inner_depth.increment()?;
3599                }
3600                let val_ref = self.driver_bind_eager.get_or_insert_with(|| {
3601                    fidl::new_empty!(
3602                        fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
3603                        fidl::encoding::DefaultFuchsiaResourceDialect
3604                    )
3605                });
3606                fidl::decode!(
3607                    fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
3608                    fidl::encoding::DefaultFuchsiaResourceDialect,
3609                    val_ref,
3610                    decoder,
3611                    inner_offset,
3612                    inner_depth
3613                )?;
3614                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3615                {
3616                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3617                }
3618                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3619                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3620                }
3621            }
3622
3623            next_offset += envelope_size;
3624            _next_ordinal_to_read += 1;
3625            if next_offset >= end_offset {
3626                return Ok(());
3627            }
3628
3629            // Decode unknown envelopes for gaps in ordinals.
3630            while _next_ordinal_to_read < 10 {
3631                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3632                _next_ordinal_to_read += 1;
3633                next_offset += envelope_size;
3634            }
3635
3636            let next_out_of_line = decoder.next_out_of_line();
3637            let handles_before = decoder.remaining_handles();
3638            if let Some((inlined, num_bytes, num_handles)) =
3639                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3640            {
3641                let member_inline_size =
3642                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3643                        decoder.context,
3644                    );
3645                if inlined != (member_inline_size <= 4) {
3646                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3647                }
3648                let inner_offset;
3649                let mut inner_depth = depth.clone();
3650                if inlined {
3651                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3652                    inner_offset = next_offset;
3653                } else {
3654                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3655                    inner_depth.increment()?;
3656                }
3657                let val_ref = self.board_name.get_or_insert_with(|| {
3658                    fidl::new_empty!(
3659                        fidl::encoding::UnboundedString,
3660                        fidl::encoding::DefaultFuchsiaResourceDialect
3661                    )
3662                });
3663                fidl::decode!(
3664                    fidl::encoding::UnboundedString,
3665                    fidl::encoding::DefaultFuchsiaResourceDialect,
3666                    val_ref,
3667                    decoder,
3668                    inner_offset,
3669                    inner_depth
3670                )?;
3671                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3672                {
3673                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3674                }
3675                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3676                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3677                }
3678            }
3679
3680            next_offset += envelope_size;
3681            _next_ordinal_to_read += 1;
3682            if next_offset >= end_offset {
3683                return Ok(());
3684            }
3685
3686            // Decode unknown envelopes for gaps in ordinals.
3687            while _next_ordinal_to_read < 11 {
3688                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3689                _next_ordinal_to_read += 1;
3690                next_offset += envelope_size;
3691            }
3692
3693            let next_out_of_line = decoder.next_out_of_line();
3694            let handles_before = decoder.remaining_handles();
3695            if let Some((inlined, num_bytes, num_handles)) =
3696                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3697            {
3698                let member_inline_size = <fidl::encoding::UnboundedVector<Offer> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3699                if inlined != (member_inline_size <= 4) {
3700                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3701                }
3702                let inner_offset;
3703                let mut inner_depth = depth.clone();
3704                if inlined {
3705                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3706                    inner_offset = next_offset;
3707                } else {
3708                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3709                    inner_depth.increment()?;
3710                }
3711                let val_ref = self.offers.get_or_insert_with(|| {
3712                    fidl::new_empty!(
3713                        fidl::encoding::UnboundedVector<Offer>,
3714                        fidl::encoding::DefaultFuchsiaResourceDialect
3715                    )
3716                });
3717                fidl::decode!(
3718                    fidl::encoding::UnboundedVector<Offer>,
3719                    fidl::encoding::DefaultFuchsiaResourceDialect,
3720                    val_ref,
3721                    decoder,
3722                    inner_offset,
3723                    inner_depth
3724                )?;
3725                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3726                {
3727                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3728                }
3729                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3730                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3731                }
3732            }
3733
3734            next_offset += envelope_size;
3735            _next_ordinal_to_read += 1;
3736            if next_offset >= end_offset {
3737                return Ok(());
3738            }
3739
3740            // Decode unknown envelopes for gaps in ordinals.
3741            while _next_ordinal_to_read < 12 {
3742                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3743                _next_ordinal_to_read += 1;
3744                next_offset += envelope_size;
3745            }
3746
3747            let next_out_of_line = decoder.next_out_of_line();
3748            let handles_before = decoder.remaining_handles();
3749            if let Some((inlined, num_bytes, num_handles)) =
3750                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3751            {
3752                let member_inline_size = <fidl::encoding::UnboundedVector<Expose> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3753                if inlined != (member_inline_size <= 4) {
3754                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3755                }
3756                let inner_offset;
3757                let mut inner_depth = depth.clone();
3758                if inlined {
3759                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3760                    inner_offset = next_offset;
3761                } else {
3762                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3763                    inner_depth.increment()?;
3764                }
3765                let val_ref = self.exposes.get_or_insert_with(|| {
3766                    fidl::new_empty!(
3767                        fidl::encoding::UnboundedVector<Expose>,
3768                        fidl::encoding::DefaultFuchsiaResourceDialect
3769                    )
3770                });
3771                fidl::decode!(
3772                    fidl::encoding::UnboundedVector<Expose>,
3773                    fidl::encoding::DefaultFuchsiaResourceDialect,
3774                    val_ref,
3775                    decoder,
3776                    inner_offset,
3777                    inner_depth
3778                )?;
3779                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3780                {
3781                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3782                }
3783                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3784                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3785                }
3786            }
3787
3788            next_offset += envelope_size;
3789            _next_ordinal_to_read += 1;
3790            if next_offset >= end_offset {
3791                return Ok(());
3792            }
3793
3794            // Decode unknown envelopes for gaps in ordinals.
3795            while _next_ordinal_to_read < 13 {
3796                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3797                _next_ordinal_to_read += 1;
3798                next_offset += envelope_size;
3799            }
3800
3801            let next_out_of_line = decoder.next_out_of_line();
3802            let handles_before = decoder.remaining_handles();
3803            if let Some((inlined, num_bytes, num_handles)) =
3804                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3805            {
3806                let member_inline_size = <fidl::encoding::Endpoint<
3807                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3808                > as fidl::encoding::TypeMarker>::inline_size(
3809                    decoder.context
3810                );
3811                if inlined != (member_inline_size <= 4) {
3812                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3813                }
3814                let inner_offset;
3815                let mut inner_depth = depth.clone();
3816                if inlined {
3817                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3818                    inner_offset = next_offset;
3819                } else {
3820                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3821                    inner_depth.increment()?;
3822                }
3823                let val_ref = self.pkg.get_or_insert_with(|| {
3824                    fidl::new_empty!(
3825                        fidl::encoding::Endpoint<
3826                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3827                        >,
3828                        fidl::encoding::DefaultFuchsiaResourceDialect
3829                    )
3830                });
3831                fidl::decode!(
3832                    fidl::encoding::Endpoint<
3833                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3834                    >,
3835                    fidl::encoding::DefaultFuchsiaResourceDialect,
3836                    val_ref,
3837                    decoder,
3838                    inner_offset,
3839                    inner_depth
3840                )?;
3841                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3842                {
3843                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3844                }
3845                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3846                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3847                }
3848            }
3849
3850            next_offset += envelope_size;
3851            _next_ordinal_to_read += 1;
3852            if next_offset >= end_offset {
3853                return Ok(());
3854            }
3855
3856            // Decode unknown envelopes for gaps in ordinals.
3857            while _next_ordinal_to_read < 14 {
3858                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3859                _next_ordinal_to_read += 1;
3860                next_offset += envelope_size;
3861            }
3862
3863            let next_out_of_line = decoder.next_out_of_line();
3864            let handles_before = decoder.remaining_handles();
3865            if let Some((inlined, num_bytes, num_handles)) =
3866                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3867            {
3868                let member_inline_size = <fidl::encoding::UnboundedVector<
3869                    fidl_fuchsia_component_test::Capability,
3870                > as fidl::encoding::TypeMarker>::inline_size(
3871                    decoder.context
3872                );
3873                if inlined != (member_inline_size <= 4) {
3874                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3875                }
3876                let inner_offset;
3877                let mut inner_depth = depth.clone();
3878                if inlined {
3879                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3880                    inner_offset = next_offset;
3881                } else {
3882                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3883                    inner_depth.increment()?;
3884                }
3885                let val_ref = self.dtr_offers.get_or_insert_with(|| {
3886                    fidl::new_empty!(
3887                        fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
3888                        fidl::encoding::DefaultFuchsiaResourceDialect
3889                    )
3890                });
3891                fidl::decode!(
3892                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
3893                    fidl::encoding::DefaultFuchsiaResourceDialect,
3894                    val_ref,
3895                    decoder,
3896                    inner_offset,
3897                    inner_depth
3898                )?;
3899                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3900                {
3901                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3902                }
3903                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3904                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3905                }
3906            }
3907
3908            next_offset += envelope_size;
3909            _next_ordinal_to_read += 1;
3910            if next_offset >= end_offset {
3911                return Ok(());
3912            }
3913
3914            // Decode unknown envelopes for gaps in ordinals.
3915            while _next_ordinal_to_read < 15 {
3916                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3917                _next_ordinal_to_read += 1;
3918                next_offset += envelope_size;
3919            }
3920
3921            let next_out_of_line = decoder.next_out_of_line();
3922            let handles_before = decoder.remaining_handles();
3923            if let Some((inlined, num_bytes, num_handles)) =
3924                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3925            {
3926                let member_inline_size = <fidl::encoding::UnboundedVector<
3927                    fidl_fuchsia_component_test::Capability,
3928                > as fidl::encoding::TypeMarker>::inline_size(
3929                    decoder.context
3930                );
3931                if inlined != (member_inline_size <= 4) {
3932                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3933                }
3934                let inner_offset;
3935                let mut inner_depth = depth.clone();
3936                if inlined {
3937                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3938                    inner_offset = next_offset;
3939                } else {
3940                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3941                    inner_depth.increment()?;
3942                }
3943                let val_ref = self.dtr_exposes.get_or_insert_with(|| {
3944                    fidl::new_empty!(
3945                        fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
3946                        fidl::encoding::DefaultFuchsiaResourceDialect
3947                    )
3948                });
3949                fidl::decode!(
3950                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
3951                    fidl::encoding::DefaultFuchsiaResourceDialect,
3952                    val_ref,
3953                    decoder,
3954                    inner_offset,
3955                    inner_depth
3956                )?;
3957                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3958                {
3959                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3960                }
3961                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3962                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3963                }
3964            }
3965
3966            next_offset += envelope_size;
3967            _next_ordinal_to_read += 1;
3968            if next_offset >= end_offset {
3969                return Ok(());
3970            }
3971
3972            // Decode unknown envelopes for gaps in ordinals.
3973            while _next_ordinal_to_read < 16 {
3974                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3975                _next_ordinal_to_read += 1;
3976                next_offset += envelope_size;
3977            }
3978
3979            let next_out_of_line = decoder.next_out_of_line();
3980            let handles_before = decoder.remaining_handles();
3981            if let Some((inlined, num_bytes, num_handles)) =
3982                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3983            {
3984                let member_inline_size = <fidl_fuchsia_component_resolution::Component as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3985                if inlined != (member_inline_size <= 4) {
3986                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3987                }
3988                let inner_offset;
3989                let mut inner_depth = depth.clone();
3990                if inlined {
3991                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3992                    inner_offset = next_offset;
3993                } else {
3994                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3995                    inner_depth.increment()?;
3996                }
3997                let val_ref = self.test_component.get_or_insert_with(|| {
3998                    fidl::new_empty!(
3999                        fidl_fuchsia_component_resolution::Component,
4000                        fidl::encoding::DefaultFuchsiaResourceDialect
4001                    )
4002                });
4003                fidl::decode!(
4004                    fidl_fuchsia_component_resolution::Component,
4005                    fidl::encoding::DefaultFuchsiaResourceDialect,
4006                    val_ref,
4007                    decoder,
4008                    inner_offset,
4009                    inner_depth
4010                )?;
4011                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4012                {
4013                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4014                }
4015                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4016                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4017                }
4018            }
4019
4020            next_offset += envelope_size;
4021            _next_ordinal_to_read += 1;
4022            if next_offset >= end_offset {
4023                return Ok(());
4024            }
4025
4026            // Decode unknown envelopes for gaps in ordinals.
4027            while _next_ordinal_to_read < 17 {
4028                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4029                _next_ordinal_to_read += 1;
4030                next_offset += envelope_size;
4031            }
4032
4033            let next_out_of_line = decoder.next_out_of_line();
4034            let handles_before = decoder.remaining_handles();
4035            if let Some((inlined, num_bytes, num_handles)) =
4036                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4037            {
4038                let member_inline_size =
4039                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4040                if inlined != (member_inline_size <= 4) {
4041                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4042                }
4043                let inner_offset;
4044                let mut inner_depth = depth.clone();
4045                if inlined {
4046                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4047                    inner_offset = next_offset;
4048                } else {
4049                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4050                    inner_depth.increment()?;
4051                }
4052                let val_ref = self.driver_index_stop_timeout_millis.get_or_insert_with(|| {
4053                    fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
4054                });
4055                fidl::decode!(
4056                    i64,
4057                    fidl::encoding::DefaultFuchsiaResourceDialect,
4058                    val_ref,
4059                    decoder,
4060                    inner_offset,
4061                    inner_depth
4062                )?;
4063                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4064                {
4065                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4066                }
4067                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4068                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4069                }
4070            }
4071
4072            next_offset += envelope_size;
4073            _next_ordinal_to_read += 1;
4074            if next_offset >= end_offset {
4075                return Ok(());
4076            }
4077
4078            // Decode unknown envelopes for gaps in ordinals.
4079            while _next_ordinal_to_read < 18 {
4080                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4081                _next_ordinal_to_read += 1;
4082                next_offset += envelope_size;
4083            }
4084
4085            let next_out_of_line = decoder.next_out_of_line();
4086            let handles_before = decoder.remaining_handles();
4087            if let Some((inlined, num_bytes, num_handles)) =
4088                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4089            {
4090                let member_inline_size = <fidl::encoding::Vector<SoftwareDevice, 20> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4091                if inlined != (member_inline_size <= 4) {
4092                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4093                }
4094                let inner_offset;
4095                let mut inner_depth = depth.clone();
4096                if inlined {
4097                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4098                    inner_offset = next_offset;
4099                } else {
4100                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4101                    inner_depth.increment()?;
4102                }
4103                let val_ref =
4104                self.software_devices.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect));
4105                fidl::decode!(fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4106                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4107                {
4108                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4109                }
4110                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4111                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4112                }
4113            }
4114
4115            next_offset += envelope_size;
4116            _next_ordinal_to_read += 1;
4117            if next_offset >= end_offset {
4118                return Ok(());
4119            }
4120
4121            // Decode unknown envelopes for gaps in ordinals.
4122            while _next_ordinal_to_read < 19 {
4123                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4124                _next_ordinal_to_read += 1;
4125                next_offset += envelope_size;
4126            }
4127
4128            let next_out_of_line = decoder.next_out_of_line();
4129            let handles_before = decoder.remaining_handles();
4130            if let Some((inlined, num_bytes, num_handles)) =
4131                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4132            {
4133                let member_inline_size = <fidl::encoding::UnboundedVector<
4134                    fidl::encoding::UnboundedString,
4135                > as fidl::encoding::TypeMarker>::inline_size(
4136                    decoder.context
4137                );
4138                if inlined != (member_inline_size <= 4) {
4139                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4140                }
4141                let inner_offset;
4142                let mut inner_depth = depth.clone();
4143                if inlined {
4144                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4145                    inner_offset = next_offset;
4146                } else {
4147                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4148                    inner_depth.increment()?;
4149                }
4150                let val_ref = self.boot_driver_components.get_or_insert_with(|| {
4151                    fidl::new_empty!(
4152                        fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4153                        fidl::encoding::DefaultFuchsiaResourceDialect
4154                    )
4155                });
4156                fidl::decode!(
4157                    fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4158                    fidl::encoding::DefaultFuchsiaResourceDialect,
4159                    val_ref,
4160                    decoder,
4161                    inner_offset,
4162                    inner_depth
4163                )?;
4164                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4165                {
4166                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4167                }
4168                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4169                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4170                }
4171            }
4172
4173            next_offset += envelope_size;
4174            _next_ordinal_to_read += 1;
4175            if next_offset >= end_offset {
4176                return Ok(());
4177            }
4178
4179            // Decode unknown envelopes for gaps in ordinals.
4180            while _next_ordinal_to_read < 20 {
4181                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4182                _next_ordinal_to_read += 1;
4183                next_offset += envelope_size;
4184            }
4185
4186            let next_out_of_line = decoder.next_out_of_line();
4187            let handles_before = decoder.remaining_handles();
4188            if let Some((inlined, num_bytes, num_handles)) =
4189                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4190            {
4191                let member_inline_size = <fidl::encoding::HandleType<
4192                    fidl::Vmo,
4193                    { fidl::ObjectType::VMO.into_raw() },
4194                    2147483648,
4195                > as fidl::encoding::TypeMarker>::inline_size(
4196                    decoder.context
4197                );
4198                if inlined != (member_inline_size <= 4) {
4199                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4200                }
4201                let inner_offset;
4202                let mut inner_depth = depth.clone();
4203                if inlined {
4204                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4205                    inner_offset = next_offset;
4206                } else {
4207                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4208                    inner_depth.increment()?;
4209                }
4210                let val_ref =
4211                self.devicetree.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
4212                fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4213                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4214                {
4215                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4216                }
4217                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4218                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4219                }
4220            }
4221
4222            next_offset += envelope_size;
4223            _next_ordinal_to_read += 1;
4224            if next_offset >= end_offset {
4225                return Ok(());
4226            }
4227
4228            // Decode unknown envelopes for gaps in ordinals.
4229            while _next_ordinal_to_read < 21 {
4230                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4231                _next_ordinal_to_read += 1;
4232                next_offset += envelope_size;
4233            }
4234
4235            let next_out_of_line = decoder.next_out_of_line();
4236            let handles_before = decoder.remaining_handles();
4237            if let Some((inlined, num_bytes, num_handles)) =
4238                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4239            {
4240                let member_inline_size =
4241                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4242                if inlined != (member_inline_size <= 4) {
4243                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4244                }
4245                let inner_offset;
4246                let mut inner_depth = depth.clone();
4247                if inlined {
4248                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4249                    inner_offset = next_offset;
4250                } else {
4251                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4252                    inner_depth.increment()?;
4253                }
4254                let val_ref = self.platform_vid.get_or_insert_with(|| {
4255                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
4256                });
4257                fidl::decode!(
4258                    u32,
4259                    fidl::encoding::DefaultFuchsiaResourceDialect,
4260                    val_ref,
4261                    decoder,
4262                    inner_offset,
4263                    inner_depth
4264                )?;
4265                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4266                {
4267                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4268                }
4269                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4270                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4271                }
4272            }
4273
4274            next_offset += envelope_size;
4275            _next_ordinal_to_read += 1;
4276            if next_offset >= end_offset {
4277                return Ok(());
4278            }
4279
4280            // Decode unknown envelopes for gaps in ordinals.
4281            while _next_ordinal_to_read < 22 {
4282                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4283                _next_ordinal_to_read += 1;
4284                next_offset += envelope_size;
4285            }
4286
4287            let next_out_of_line = decoder.next_out_of_line();
4288            let handles_before = decoder.remaining_handles();
4289            if let Some((inlined, num_bytes, num_handles)) =
4290                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4291            {
4292                let member_inline_size =
4293                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4294                if inlined != (member_inline_size <= 4) {
4295                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4296                }
4297                let inner_offset;
4298                let mut inner_depth = depth.clone();
4299                if inlined {
4300                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4301                    inner_offset = next_offset;
4302                } else {
4303                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4304                    inner_depth.increment()?;
4305                }
4306                let val_ref = self.platform_pid.get_or_insert_with(|| {
4307                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
4308                });
4309                fidl::decode!(
4310                    u32,
4311                    fidl::encoding::DefaultFuchsiaResourceDialect,
4312                    val_ref,
4313                    decoder,
4314                    inner_offset,
4315                    inner_depth
4316                )?;
4317                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4318                {
4319                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4320                }
4321                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4322                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4323                }
4324            }
4325
4326            next_offset += envelope_size;
4327
4328            // Decode the remaining unknown envelopes.
4329            while next_offset < end_offset {
4330                _next_ordinal_to_read += 1;
4331                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4332                next_offset += envelope_size;
4333            }
4334
4335            Ok(())
4336        }
4337    }
4338}