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