fidl_fuchsia_component_test/
fidl_fuchsia_component_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_component_test__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct BuilderBuildRequest {
16    pub runner: fidl::endpoints::ClientEnd<fidl_fuchsia_component_runner::ComponentRunnerMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BuilderBuildRequest {}
20
21/// The contents of a directory that should be provided by the realm builder
22/// server.
23#[derive(Debug, PartialEq)]
24pub struct DirectoryContents {
25    pub entries: Vec<DirectoryEntry>,
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryContents {}
29
30/// An entry in a directory.
31#[derive(Debug, PartialEq)]
32pub struct DirectoryEntry {
33    /// The path to the file. Valid examples include `foo.txt` and
34    /// `foo/bar.json`.
35    pub file_path: String,
36    /// The contents of the file.
37    pub file_contents: fidl_fuchsia_mem::Buffer,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryEntry {}
41
42#[derive(Debug, PartialEq)]
43pub struct RealmAddChildRealmFromDeclRequest {
44    /// The name of the child realm that is being added.
45    pub name: String,
46    /// The component's declaration.
47    pub decl: fidl_fuchsia_component_decl::Component,
48    /// Additional properties for the child.
49    pub options: ChildOptions,
50    /// The server end of the `Realm` channel that will be used to build the
51    /// sub-realm.
52    pub child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
53}
54
55impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
56    for RealmAddChildRealmFromDeclRequest
57{
58}
59
60#[derive(Debug, PartialEq)]
61pub struct RealmAddChildRealmFromRelativeUrlRequest {
62    /// The name of the child realm that is being added.
63    pub name: String,
64    /// The relative (fragment-only) URL.
65    pub relative_url: String,
66    /// Additional properties for the child.
67    pub options: ChildOptions,
68    /// The server end of the `Realm` channel that will be used to build the
69    /// sub-realm.
70    pub child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
71}
72
73impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
74    for RealmAddChildRealmFromRelativeUrlRequest
75{
76}
77
78#[derive(Debug, PartialEq)]
79pub struct RealmAddChildRealmRequest {
80    /// The name of the child realm that is being added.
81    pub name: String,
82    /// Additional properties for the child.
83    pub options: ChildOptions,
84    /// The server end of the `Realm` channel that will be used to build the
85    /// sub-realm.
86    pub child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmAddChildRealmRequest {}
90
91#[derive(Debug, PartialEq)]
92pub struct RealmAddStorageRequest {
93    /// The name of the storage capability.
94    pub name: String,
95    /// The target that this storage capability will be offered to.
96    pub to: Vec<fidl_fuchsia_component_decl::Ref>,
97    /// The server end to connect to this storage capability's
98    /// `fuchsia.sys2.StorageAdmin` protocol.
99    pub storage_admin:
100        Option<fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>>,
101}
102
103impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmAddStorageRequest {}
104
105#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
106pub struct RealmBuilderFactoryCreateFromRelativeUrlRequest {
107    pub pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
108    pub relative_url: String,
109    pub realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
110    pub builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
111}
112
113impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
114    for RealmBuilderFactoryCreateFromRelativeUrlRequest
115{
116}
117
118#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
119pub struct RealmBuilderFactoryCreateRequest {
120    pub pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
121    pub realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
122    pub builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
123}
124
125impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
126    for RealmBuilderFactoryCreateRequest
127{
128}
129
130#[derive(Debug, PartialEq)]
131pub struct RealmReadOnlyDirectoryRequest {
132    /// The name of the directory capability.
133    pub name: String,
134    /// The target that this directory will be offered to.
135    pub to: Vec<fidl_fuchsia_component_decl::Ref>,
136    /// The contents of the directory.
137    pub directory_contents: DirectoryContents,
138}
139
140impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
141    for RealmReadOnlyDirectoryRequest
142{
143}
144
145#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
146pub struct BuilderMarker;
147
148impl fidl::endpoints::ProtocolMarker for BuilderMarker {
149    type Proxy = BuilderProxy;
150    type RequestStream = BuilderRequestStream;
151    #[cfg(target_os = "fuchsia")]
152    type SynchronousProxy = BuilderSynchronousProxy;
153
154    const DEBUG_NAME: &'static str = "fuchsia.component.test.Builder";
155}
156impl fidl::endpoints::DiscoverableProtocolMarker for BuilderMarker {}
157pub type BuilderBuildResult = Result<String, RealmBuilderError>;
158
159pub trait BuilderProxyInterface: Send + Sync {
160    type BuildResponseFut: std::future::Future<Output = Result<BuilderBuildResult, fidl::Error>>
161        + Send;
162    fn r#build(
163        &self,
164        runner: fidl::endpoints::ClientEnd<fidl_fuchsia_component_runner::ComponentRunnerMarker>,
165    ) -> Self::BuildResponseFut;
166}
167#[derive(Debug)]
168#[cfg(target_os = "fuchsia")]
169pub struct BuilderSynchronousProxy {
170    client: fidl::client::sync::Client,
171}
172
173#[cfg(target_os = "fuchsia")]
174impl fidl::endpoints::SynchronousProxy for BuilderSynchronousProxy {
175    type Proxy = BuilderProxy;
176    type Protocol = BuilderMarker;
177
178    fn from_channel(inner: fidl::Channel) -> Self {
179        Self::new(inner)
180    }
181
182    fn into_channel(self) -> fidl::Channel {
183        self.client.into_channel()
184    }
185
186    fn as_channel(&self) -> &fidl::Channel {
187        self.client.as_channel()
188    }
189}
190
191#[cfg(target_os = "fuchsia")]
192impl BuilderSynchronousProxy {
193    pub fn new(channel: fidl::Channel) -> Self {
194        let protocol_name = <BuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
195        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
196    }
197
198    pub fn into_channel(self) -> fidl::Channel {
199        self.client.into_channel()
200    }
201
202    /// Waits until an event arrives and returns it. It is safe for other
203    /// threads to make concurrent requests while waiting for an event.
204    pub fn wait_for_event(
205        &self,
206        deadline: zx::MonotonicInstant,
207    ) -> Result<BuilderEvent, fidl::Error> {
208        BuilderEvent::decode(self.client.wait_for_event(deadline)?)
209    }
210
211    /// Assembles the realm being constructed and returns the URL for the root
212    /// component in the realm, which may then be used to create a new component
213    /// in any collection where fuchsia-test-component is properly set up. Once
214    /// this is called, any Realm channels for the realm will no longer be
215    /// usable. The `runner` argument must be provided if the `AddLocalChild`
216    /// function has been used in this realm, as this runner channel will be
217    /// used to inform the client when to start and stop running any local
218    /// component implementations.
219    ///
220    /// Errors:
221    /// - `INVALID_COMPONENT_DECL`: A component declaration failed validaiton.
222    /// - `BUILD_ALREADY_CALLED`: The `Build` function has been called multiple
223    ///   times on this channel.
224    pub fn r#build(
225        &self,
226        mut runner: fidl::endpoints::ClientEnd<
227            fidl_fuchsia_component_runner::ComponentRunnerMarker,
228        >,
229        ___deadline: zx::MonotonicInstant,
230    ) -> Result<BuilderBuildResult, fidl::Error> {
231        let _response = self.client.send_query::<BuilderBuildRequest, fidl::encoding::ResultType<
232            BuilderBuildResponse,
233            RealmBuilderError,
234        >>(
235            (runner,),
236            0x172ba0923ec91575,
237            fidl::encoding::DynamicFlags::empty(),
238            ___deadline,
239        )?;
240        Ok(_response.map(|x| x.root_component_url))
241    }
242}
243
244#[cfg(target_os = "fuchsia")]
245impl From<BuilderSynchronousProxy> for zx::NullableHandle {
246    fn from(value: BuilderSynchronousProxy) -> Self {
247        value.into_channel().into()
248    }
249}
250
251#[cfg(target_os = "fuchsia")]
252impl From<fidl::Channel> for BuilderSynchronousProxy {
253    fn from(value: fidl::Channel) -> Self {
254        Self::new(value)
255    }
256}
257
258#[cfg(target_os = "fuchsia")]
259impl fidl::endpoints::FromClient for BuilderSynchronousProxy {
260    type Protocol = BuilderMarker;
261
262    fn from_client(value: fidl::endpoints::ClientEnd<BuilderMarker>) -> Self {
263        Self::new(value.into_channel())
264    }
265}
266
267#[derive(Debug, Clone)]
268pub struct BuilderProxy {
269    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
270}
271
272impl fidl::endpoints::Proxy for BuilderProxy {
273    type Protocol = BuilderMarker;
274
275    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
276        Self::new(inner)
277    }
278
279    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
280        self.client.into_channel().map_err(|client| Self { client })
281    }
282
283    fn as_channel(&self) -> &::fidl::AsyncChannel {
284        self.client.as_channel()
285    }
286}
287
288impl BuilderProxy {
289    /// Create a new Proxy for fuchsia.component.test/Builder.
290    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
291        let protocol_name = <BuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
292        Self { client: fidl::client::Client::new(channel, protocol_name) }
293    }
294
295    /// Get a Stream of events from the remote end of the protocol.
296    ///
297    /// # Panics
298    ///
299    /// Panics if the event stream was already taken.
300    pub fn take_event_stream(&self) -> BuilderEventStream {
301        BuilderEventStream { event_receiver: self.client.take_event_receiver() }
302    }
303
304    /// Assembles the realm being constructed and returns the URL for the root
305    /// component in the realm, which may then be used to create a new component
306    /// in any collection where fuchsia-test-component is properly set up. Once
307    /// this is called, any Realm channels for the realm will no longer be
308    /// usable. The `runner` argument must be provided if the `AddLocalChild`
309    /// function has been used in this realm, as this runner channel will be
310    /// used to inform the client when to start and stop running any local
311    /// component implementations.
312    ///
313    /// Errors:
314    /// - `INVALID_COMPONENT_DECL`: A component declaration failed validaiton.
315    /// - `BUILD_ALREADY_CALLED`: The `Build` function has been called multiple
316    ///   times on this channel.
317    pub fn r#build(
318        &self,
319        mut runner: fidl::endpoints::ClientEnd<
320            fidl_fuchsia_component_runner::ComponentRunnerMarker,
321        >,
322    ) -> fidl::client::QueryResponseFut<
323        BuilderBuildResult,
324        fidl::encoding::DefaultFuchsiaResourceDialect,
325    > {
326        BuilderProxyInterface::r#build(self, runner)
327    }
328}
329
330impl BuilderProxyInterface for BuilderProxy {
331    type BuildResponseFut = fidl::client::QueryResponseFut<
332        BuilderBuildResult,
333        fidl::encoding::DefaultFuchsiaResourceDialect,
334    >;
335    fn r#build(
336        &self,
337        mut runner: fidl::endpoints::ClientEnd<
338            fidl_fuchsia_component_runner::ComponentRunnerMarker,
339        >,
340    ) -> Self::BuildResponseFut {
341        fn _decode(
342            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
343        ) -> Result<BuilderBuildResult, fidl::Error> {
344            let _response = fidl::client::decode_transaction_body::<
345                fidl::encoding::ResultType<BuilderBuildResponse, RealmBuilderError>,
346                fidl::encoding::DefaultFuchsiaResourceDialect,
347                0x172ba0923ec91575,
348            >(_buf?)?;
349            Ok(_response.map(|x| x.root_component_url))
350        }
351        self.client.send_query_and_decode::<BuilderBuildRequest, BuilderBuildResult>(
352            (runner,),
353            0x172ba0923ec91575,
354            fidl::encoding::DynamicFlags::empty(),
355            _decode,
356        )
357    }
358}
359
360pub struct BuilderEventStream {
361    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
362}
363
364impl std::marker::Unpin for BuilderEventStream {}
365
366impl futures::stream::FusedStream for BuilderEventStream {
367    fn is_terminated(&self) -> bool {
368        self.event_receiver.is_terminated()
369    }
370}
371
372impl futures::Stream for BuilderEventStream {
373    type Item = Result<BuilderEvent, fidl::Error>;
374
375    fn poll_next(
376        mut self: std::pin::Pin<&mut Self>,
377        cx: &mut std::task::Context<'_>,
378    ) -> std::task::Poll<Option<Self::Item>> {
379        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
380            &mut self.event_receiver,
381            cx
382        )?) {
383            Some(buf) => std::task::Poll::Ready(Some(BuilderEvent::decode(buf))),
384            None => std::task::Poll::Ready(None),
385        }
386    }
387}
388
389#[derive(Debug)]
390pub enum BuilderEvent {}
391
392impl BuilderEvent {
393    /// Decodes a message buffer as a [`BuilderEvent`].
394    fn decode(
395        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
396    ) -> Result<BuilderEvent, fidl::Error> {
397        let (bytes, _handles) = buf.split_mut();
398        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
399        debug_assert_eq!(tx_header.tx_id, 0);
400        match tx_header.ordinal {
401            _ => Err(fidl::Error::UnknownOrdinal {
402                ordinal: tx_header.ordinal,
403                protocol_name: <BuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
404            }),
405        }
406    }
407}
408
409/// A Stream of incoming requests for fuchsia.component.test/Builder.
410pub struct BuilderRequestStream {
411    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
412    is_terminated: bool,
413}
414
415impl std::marker::Unpin for BuilderRequestStream {}
416
417impl futures::stream::FusedStream for BuilderRequestStream {
418    fn is_terminated(&self) -> bool {
419        self.is_terminated
420    }
421}
422
423impl fidl::endpoints::RequestStream for BuilderRequestStream {
424    type Protocol = BuilderMarker;
425    type ControlHandle = BuilderControlHandle;
426
427    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
428        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
429    }
430
431    fn control_handle(&self) -> Self::ControlHandle {
432        BuilderControlHandle { inner: self.inner.clone() }
433    }
434
435    fn into_inner(
436        self,
437    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
438    {
439        (self.inner, self.is_terminated)
440    }
441
442    fn from_inner(
443        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
444        is_terminated: bool,
445    ) -> Self {
446        Self { inner, is_terminated }
447    }
448}
449
450impl futures::Stream for BuilderRequestStream {
451    type Item = Result<BuilderRequest, fidl::Error>;
452
453    fn poll_next(
454        mut self: std::pin::Pin<&mut Self>,
455        cx: &mut std::task::Context<'_>,
456    ) -> std::task::Poll<Option<Self::Item>> {
457        let this = &mut *self;
458        if this.inner.check_shutdown(cx) {
459            this.is_terminated = true;
460            return std::task::Poll::Ready(None);
461        }
462        if this.is_terminated {
463            panic!("polled BuilderRequestStream after completion");
464        }
465        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
466            |bytes, handles| {
467                match this.inner.channel().read_etc(cx, bytes, handles) {
468                    std::task::Poll::Ready(Ok(())) => {}
469                    std::task::Poll::Pending => return std::task::Poll::Pending,
470                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
471                        this.is_terminated = true;
472                        return std::task::Poll::Ready(None);
473                    }
474                    std::task::Poll::Ready(Err(e)) => {
475                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
476                            e.into(),
477                        ))));
478                    }
479                }
480
481                // A message has been received from the channel
482                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
483
484                std::task::Poll::Ready(Some(match header.ordinal {
485                    0x172ba0923ec91575 => {
486                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
487                        let mut req = fidl::new_empty!(
488                            BuilderBuildRequest,
489                            fidl::encoding::DefaultFuchsiaResourceDialect
490                        );
491                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BuilderBuildRequest>(&header, _body_bytes, handles, &mut req)?;
492                        let control_handle = BuilderControlHandle { inner: this.inner.clone() };
493                        Ok(BuilderRequest::Build {
494                            runner: req.runner,
495
496                            responder: BuilderBuildResponder {
497                                control_handle: std::mem::ManuallyDrop::new(control_handle),
498                                tx_id: header.tx_id,
499                            },
500                        })
501                    }
502                    _ => Err(fidl::Error::UnknownOrdinal {
503                        ordinal: header.ordinal,
504                        protocol_name:
505                            <BuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
506                    }),
507                }))
508            },
509        )
510    }
511}
512
513#[derive(Debug)]
514pub enum BuilderRequest {
515    /// Assembles the realm being constructed and returns the URL for the root
516    /// component in the realm, which may then be used to create a new component
517    /// in any collection where fuchsia-test-component is properly set up. Once
518    /// this is called, any Realm channels for the realm will no longer be
519    /// usable. The `runner` argument must be provided if the `AddLocalChild`
520    /// function has been used in this realm, as this runner channel will be
521    /// used to inform the client when to start and stop running any local
522    /// component implementations.
523    ///
524    /// Errors:
525    /// - `INVALID_COMPONENT_DECL`: A component declaration failed validaiton.
526    /// - `BUILD_ALREADY_CALLED`: The `Build` function has been called multiple
527    ///   times on this channel.
528    Build {
529        runner: fidl::endpoints::ClientEnd<fidl_fuchsia_component_runner::ComponentRunnerMarker>,
530        responder: BuilderBuildResponder,
531    },
532}
533
534impl BuilderRequest {
535    #[allow(irrefutable_let_patterns)]
536    pub fn into_build(
537        self,
538    ) -> Option<(
539        fidl::endpoints::ClientEnd<fidl_fuchsia_component_runner::ComponentRunnerMarker>,
540        BuilderBuildResponder,
541    )> {
542        if let BuilderRequest::Build { runner, responder } = self {
543            Some((runner, responder))
544        } else {
545            None
546        }
547    }
548
549    /// Name of the method defined in FIDL
550    pub fn method_name(&self) -> &'static str {
551        match *self {
552            BuilderRequest::Build { .. } => "build",
553        }
554    }
555}
556
557#[derive(Debug, Clone)]
558pub struct BuilderControlHandle {
559    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
560}
561
562impl fidl::endpoints::ControlHandle for BuilderControlHandle {
563    fn shutdown(&self) {
564        self.inner.shutdown()
565    }
566
567    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
568        self.inner.shutdown_with_epitaph(status)
569    }
570
571    fn is_closed(&self) -> bool {
572        self.inner.channel().is_closed()
573    }
574    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
575        self.inner.channel().on_closed()
576    }
577
578    #[cfg(target_os = "fuchsia")]
579    fn signal_peer(
580        &self,
581        clear_mask: zx::Signals,
582        set_mask: zx::Signals,
583    ) -> Result<(), zx_status::Status> {
584        use fidl::Peered;
585        self.inner.channel().signal_peer(clear_mask, set_mask)
586    }
587}
588
589impl BuilderControlHandle {}
590
591#[must_use = "FIDL methods require a response to be sent"]
592#[derive(Debug)]
593pub struct BuilderBuildResponder {
594    control_handle: std::mem::ManuallyDrop<BuilderControlHandle>,
595    tx_id: u32,
596}
597
598/// Set the the channel to be shutdown (see [`BuilderControlHandle::shutdown`])
599/// if the responder is dropped without sending a response, so that the client
600/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
601impl std::ops::Drop for BuilderBuildResponder {
602    fn drop(&mut self) {
603        self.control_handle.shutdown();
604        // Safety: drops once, never accessed again
605        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
606    }
607}
608
609impl fidl::endpoints::Responder for BuilderBuildResponder {
610    type ControlHandle = BuilderControlHandle;
611
612    fn control_handle(&self) -> &BuilderControlHandle {
613        &self.control_handle
614    }
615
616    fn drop_without_shutdown(mut self) {
617        // Safety: drops once, never accessed again due to mem::forget
618        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
619        // Prevent Drop from running (which would shut down the channel)
620        std::mem::forget(self);
621    }
622}
623
624impl BuilderBuildResponder {
625    /// Sends a response to the FIDL transaction.
626    ///
627    /// Sets the channel to shutdown if an error occurs.
628    pub fn send(self, mut result: Result<&str, RealmBuilderError>) -> Result<(), fidl::Error> {
629        let _result = self.send_raw(result);
630        if _result.is_err() {
631            self.control_handle.shutdown();
632        }
633        self.drop_without_shutdown();
634        _result
635    }
636
637    /// Similar to "send" but does not shutdown the channel if an error occurs.
638    pub fn send_no_shutdown_on_err(
639        self,
640        mut result: Result<&str, RealmBuilderError>,
641    ) -> Result<(), fidl::Error> {
642        let _result = self.send_raw(result);
643        self.drop_without_shutdown();
644        _result
645    }
646
647    fn send_raw(&self, mut result: Result<&str, RealmBuilderError>) -> Result<(), fidl::Error> {
648        self.control_handle
649            .inner
650            .send::<fidl::encoding::ResultType<BuilderBuildResponse, RealmBuilderError>>(
651                result.map(|root_component_url| (root_component_url,)),
652                self.tx_id,
653                0x172ba0923ec91575,
654                fidl::encoding::DynamicFlags::empty(),
655            )
656    }
657}
658
659#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
660pub struct RealmMarker;
661
662impl fidl::endpoints::ProtocolMarker for RealmMarker {
663    type Proxy = RealmProxy;
664    type RequestStream = RealmRequestStream;
665    #[cfg(target_os = "fuchsia")]
666    type SynchronousProxy = RealmSynchronousProxy;
667
668    const DEBUG_NAME: &'static str = "fuchsia.component.test.Realm";
669}
670impl fidl::endpoints::DiscoverableProtocolMarker for RealmMarker {}
671pub type RealmAddChildResult = Result<(), RealmBuilderError>;
672pub type RealmAddChildFromDeclResult = Result<(), RealmBuilderError>;
673pub type RealmAddLocalChildResult = Result<(), RealmBuilderError>;
674pub type RealmAddChildRealmResult = Result<(), RealmBuilderError>;
675pub type RealmAddChildRealmFromRelativeUrlResult = Result<(), RealmBuilderError>;
676pub type RealmAddChildRealmFromDeclResult = Result<(), RealmBuilderError>;
677pub type RealmGetComponentDeclResult =
678    Result<fidl_fuchsia_component_decl::Component, RealmBuilderError>;
679pub type RealmReplaceComponentDeclResult = Result<(), RealmBuilderError>;
680pub type RealmGetRealmDeclResult =
681    Result<fidl_fuchsia_component_decl::Component, RealmBuilderError>;
682pub type RealmReplaceRealmDeclResult = Result<(), RealmBuilderError>;
683pub type RealmUseNestedComponentManagerResult = Result<(), RealmBuilderError>;
684pub type RealmAddRouteResult = Result<(), RealmBuilderError>;
685pub type RealmAddRouteFromDictionaryResult = Result<(), RealmBuilderError>;
686pub type RealmReadOnlyDirectoryResult = Result<(), RealmBuilderError>;
687pub type RealmAddStorageResult = Result<(), RealmBuilderError>;
688pub type RealmInitMutableConfigFromPackageResult = Result<(), RealmBuilderError>;
689pub type RealmInitMutableConfigToEmptyResult = Result<(), RealmBuilderError>;
690pub type RealmAddCapabilityResult = Result<(), RealmBuilderError>;
691pub type RealmAddCollectionResult = Result<(), RealmBuilderError>;
692pub type RealmAddEnvironmentResult = Result<(), RealmBuilderError>;
693pub type RealmSetConfigValueResult = Result<(), RealmBuilderError>;
694
695pub trait RealmProxyInterface: Send + Sync {
696    type AddChildResponseFut: std::future::Future<Output = Result<RealmAddChildResult, fidl::Error>>
697        + Send;
698    fn r#add_child(
699        &self,
700        name: &str,
701        url: &str,
702        options: &ChildOptions,
703    ) -> Self::AddChildResponseFut;
704    type AddChildFromDeclResponseFut: std::future::Future<Output = Result<RealmAddChildFromDeclResult, fidl::Error>>
705        + Send;
706    fn r#add_child_from_decl(
707        &self,
708        name: &str,
709        decl: &fidl_fuchsia_component_decl::Component,
710        options: &ChildOptions,
711    ) -> Self::AddChildFromDeclResponseFut;
712    type AddLocalChildResponseFut: std::future::Future<Output = Result<RealmAddLocalChildResult, fidl::Error>>
713        + Send;
714    fn r#add_local_child(
715        &self,
716        name: &str,
717        options: &ChildOptions,
718    ) -> Self::AddLocalChildResponseFut;
719    type AddChildRealmResponseFut: std::future::Future<Output = Result<RealmAddChildRealmResult, fidl::Error>>
720        + Send;
721    fn r#add_child_realm(
722        &self,
723        name: &str,
724        options: &ChildOptions,
725        child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
726    ) -> Self::AddChildRealmResponseFut;
727    type AddChildRealmFromRelativeUrlResponseFut: std::future::Future<Output = Result<RealmAddChildRealmFromRelativeUrlResult, fidl::Error>>
728        + Send;
729    fn r#add_child_realm_from_relative_url(
730        &self,
731        name: &str,
732        relative_url: &str,
733        options: &ChildOptions,
734        child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
735    ) -> Self::AddChildRealmFromRelativeUrlResponseFut;
736    type AddChildRealmFromDeclResponseFut: std::future::Future<Output = Result<RealmAddChildRealmFromDeclResult, fidl::Error>>
737        + Send;
738    fn r#add_child_realm_from_decl(
739        &self,
740        name: &str,
741        decl: &fidl_fuchsia_component_decl::Component,
742        options: &ChildOptions,
743        child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
744    ) -> Self::AddChildRealmFromDeclResponseFut;
745    type GetComponentDeclResponseFut: std::future::Future<Output = Result<RealmGetComponentDeclResult, fidl::Error>>
746        + Send;
747    fn r#get_component_decl(&self, name: &str) -> Self::GetComponentDeclResponseFut;
748    type ReplaceComponentDeclResponseFut: std::future::Future<Output = Result<RealmReplaceComponentDeclResult, fidl::Error>>
749        + Send;
750    fn r#replace_component_decl(
751        &self,
752        name: &str,
753        component_decl: &fidl_fuchsia_component_decl::Component,
754    ) -> Self::ReplaceComponentDeclResponseFut;
755    type GetRealmDeclResponseFut: std::future::Future<Output = Result<RealmGetRealmDeclResult, fidl::Error>>
756        + Send;
757    fn r#get_realm_decl(&self) -> Self::GetRealmDeclResponseFut;
758    type ReplaceRealmDeclResponseFut: std::future::Future<Output = Result<RealmReplaceRealmDeclResult, fidl::Error>>
759        + Send;
760    fn r#replace_realm_decl(
761        &self,
762        component_decl: &fidl_fuchsia_component_decl::Component,
763    ) -> Self::ReplaceRealmDeclResponseFut;
764    type UseNestedComponentManagerResponseFut: std::future::Future<Output = Result<RealmUseNestedComponentManagerResult, fidl::Error>>
765        + Send;
766    fn r#use_nested_component_manager(
767        &self,
768        component_manager_relative_url: &str,
769    ) -> Self::UseNestedComponentManagerResponseFut;
770    type AddRouteResponseFut: std::future::Future<Output = Result<RealmAddRouteResult, fidl::Error>>
771        + Send;
772    fn r#add_route(
773        &self,
774        capabilities: &[Capability],
775        from: &fidl_fuchsia_component_decl::Ref,
776        to: &[fidl_fuchsia_component_decl::Ref],
777    ) -> Self::AddRouteResponseFut;
778    type AddRouteFromDictionaryResponseFut: std::future::Future<Output = Result<RealmAddRouteFromDictionaryResult, fidl::Error>>
779        + Send;
780    fn r#add_route_from_dictionary(
781        &self,
782        capabilities: &[Capability],
783        from: &fidl_fuchsia_component_decl::Ref,
784        from_dictionary: &str,
785        to: &[fidl_fuchsia_component_decl::Ref],
786    ) -> Self::AddRouteFromDictionaryResponseFut;
787    type ReadOnlyDirectoryResponseFut: std::future::Future<Output = Result<RealmReadOnlyDirectoryResult, fidl::Error>>
788        + Send;
789    fn r#read_only_directory(
790        &self,
791        name: &str,
792        to: &[fidl_fuchsia_component_decl::Ref],
793        directory_contents: DirectoryContents,
794    ) -> Self::ReadOnlyDirectoryResponseFut;
795    type AddStorageResponseFut: std::future::Future<Output = Result<RealmAddStorageResult, fidl::Error>>
796        + Send;
797    fn r#add_storage(
798        &self,
799        name: &str,
800        to: &[fidl_fuchsia_component_decl::Ref],
801        storage_admin: Option<
802            fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>,
803        >,
804    ) -> Self::AddStorageResponseFut;
805    type InitMutableConfigFromPackageResponseFut: std::future::Future<Output = Result<RealmInitMutableConfigFromPackageResult, fidl::Error>>
806        + Send;
807    fn r#init_mutable_config_from_package(
808        &self,
809        name: &str,
810    ) -> Self::InitMutableConfigFromPackageResponseFut;
811    type InitMutableConfigToEmptyResponseFut: std::future::Future<Output = Result<RealmInitMutableConfigToEmptyResult, fidl::Error>>
812        + Send;
813    fn r#init_mutable_config_to_empty(
814        &self,
815        name: &str,
816    ) -> Self::InitMutableConfigToEmptyResponseFut;
817    type AddCapabilityResponseFut: std::future::Future<Output = Result<RealmAddCapabilityResult, fidl::Error>>
818        + Send;
819    fn r#add_capability(
820        &self,
821        capability: &fidl_fuchsia_component_decl::Capability,
822    ) -> Self::AddCapabilityResponseFut;
823    type AddCollectionResponseFut: std::future::Future<Output = Result<RealmAddCollectionResult, fidl::Error>>
824        + Send;
825    fn r#add_collection(
826        &self,
827        collection: &fidl_fuchsia_component_decl::Collection,
828    ) -> Self::AddCollectionResponseFut;
829    type AddEnvironmentResponseFut: std::future::Future<Output = Result<RealmAddEnvironmentResult, fidl::Error>>
830        + Send;
831    fn r#add_environment(
832        &self,
833        environment: &fidl_fuchsia_component_decl::Environment,
834    ) -> Self::AddEnvironmentResponseFut;
835    type SetConfigValueResponseFut: std::future::Future<Output = Result<RealmSetConfigValueResult, fidl::Error>>
836        + Send;
837    fn r#set_config_value(
838        &self,
839        name: &str,
840        key: &str,
841        value: &fidl_fuchsia_component_decl::ConfigValueSpec,
842    ) -> Self::SetConfigValueResponseFut;
843}
844#[derive(Debug)]
845#[cfg(target_os = "fuchsia")]
846pub struct RealmSynchronousProxy {
847    client: fidl::client::sync::Client,
848}
849
850#[cfg(target_os = "fuchsia")]
851impl fidl::endpoints::SynchronousProxy for RealmSynchronousProxy {
852    type Proxy = RealmProxy;
853    type Protocol = RealmMarker;
854
855    fn from_channel(inner: fidl::Channel) -> Self {
856        Self::new(inner)
857    }
858
859    fn into_channel(self) -> fidl::Channel {
860        self.client.into_channel()
861    }
862
863    fn as_channel(&self) -> &fidl::Channel {
864        self.client.as_channel()
865    }
866}
867
868#[cfg(target_os = "fuchsia")]
869impl RealmSynchronousProxy {
870    pub fn new(channel: fidl::Channel) -> Self {
871        let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
872        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
873    }
874
875    pub fn into_channel(self) -> fidl::Channel {
876        self.client.into_channel()
877    }
878
879    /// Waits until an event arrives and returns it. It is safe for other
880    /// threads to make concurrent requests while waiting for an event.
881    pub fn wait_for_event(
882        &self,
883        deadline: zx::MonotonicInstant,
884    ) -> Result<RealmEvent, fidl::Error> {
885        RealmEvent::decode(self.client.wait_for_event(deadline)?)
886    }
887
888    /// Adds a component to the realm.
889    ///
890    /// The `url` can be in one of the following formats:
891    ///
892    /// - an absolute component URL (such as,
893    ///   "fuchsia-pkg://fuchsia.com/some-package#meta/some-component.cm")
894    /// - a relative path component URL to a subpackaged component (like,
895    ///   "some-subpackage#meta/subpackaged-component.cm"); or
896    /// - a relative fragment-only URL (like, `#meta/other-component.cm`;
897    ///   see https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
898    ///   indicating the path to a component manifest in the `pkg_dir` supplied
899    ///   to `RealmBuilderFactory::Create*()`.
900    ///
901    /// The realm builder client typically passes a handle to its own `/pkg`
902    /// directory, and bundles the `other-component` into the same package.
903    ///
904    /// Of the three URL types, _only_ component declarations added via the
905    /// fragment-only URL can be modified, via
906    /// `GetComponentDecl`/`ReplaceComponentDecl` because realm builder actually
907    /// performs its own component resolution from the component's manifest and
908    /// files bundled in the provided `pkg_dir` (typically from the package
909    /// shared by the realm builder client component and the components added
910    /// via fragment-only URL).
911    ///
912    /// Errors:
913    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
914    ///   given name.
915    /// - `INVALID_MANIFEST_EXTENSION`: `url` does not end with `.cm`
916    /// - `DECL_NOT_FOUND`: The test package does not contain the component
917    ///   declaration referenced by a fragment-only component URL.
918    /// - `DECL_READ_ERROR`: Encountered an I/O error when attempting to read a
919    ///   component declaration referenced by a fragment-only component URL from
920    ///   the test package.
921    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
922    ///   for this realm, and thus this `Realm` channel can no longer be used.
923    pub fn r#add_child(
924        &self,
925        mut name: &str,
926        mut url: &str,
927        mut options: &ChildOptions,
928        ___deadline: zx::MonotonicInstant,
929    ) -> Result<RealmAddChildResult, fidl::Error> {
930        let _response = self.client.send_query::<RealmAddChildRequest, fidl::encoding::ResultType<
931            fidl::encoding::EmptyStruct,
932            RealmBuilderError,
933        >>(
934            (name, url, options),
935            0x3f6c07627303d801,
936            fidl::encoding::DynamicFlags::empty(),
937            ___deadline,
938        )?;
939        Ok(_response.map(|x| x))
940    }
941
942    /// Adds a component to this realm whose declaration is set to `decl`. When
943    /// launched, the component will share the test package as its package
944    /// directory, and may access any resources from it.
945    ///
946    /// Errors:
947    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
948    ///   given name.
949    /// - `INVALID_COMPONENT_DECL`: `decl` failed validation.
950    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
951    ///   for this realm, and thus this `Realm` channel can no longer be used.
952    pub fn r#add_child_from_decl(
953        &self,
954        mut name: &str,
955        mut decl: &fidl_fuchsia_component_decl::Component,
956        mut options: &ChildOptions,
957        ___deadline: zx::MonotonicInstant,
958    ) -> Result<RealmAddChildFromDeclResult, fidl::Error> {
959        let _response =
960            self.client.send_query::<RealmAddChildFromDeclRequest, fidl::encoding::ResultType<
961                fidl::encoding::EmptyStruct,
962                RealmBuilderError,
963            >>(
964                (name, decl, options),
965                0x3950ad500258156d,
966                fidl::encoding::DynamicFlags::empty(),
967                ___deadline,
968            )?;
969        Ok(_response.map(|x| x))
970    }
971
972    /// Adds a component to the realm whose implementation will be provided by
973    /// the client. When this component should be started, the runner channel
974    /// passed into `Build` will receive a start request for a component whose
975    /// `ProgramDecl` contains the moniker from the root of the
976    /// constructed realm for the child that is to be run under the `program`
977    /// key `LOCAL_COMPONENT_NAME`.
978    ///
979    /// Errors:
980    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
981    ///   given name.
982    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
983    ///   for this realm, and thus this `Realm` channel can no longer be used.
984    pub fn r#add_local_child(
985        &self,
986        mut name: &str,
987        mut options: &ChildOptions,
988        ___deadline: zx::MonotonicInstant,
989    ) -> Result<RealmAddLocalChildResult, fidl::Error> {
990        let _response =
991            self.client.send_query::<RealmAddLocalChildRequest, fidl::encoding::ResultType<
992                fidl::encoding::EmptyStruct,
993                RealmBuilderError,
994            >>(
995                (name, options),
996                0x3249817bae10abbb,
997                fidl::encoding::DynamicFlags::empty(),
998                ___deadline,
999            )?;
1000        Ok(_response.map(|x| x))
1001    }
1002
1003    /// Adds a child realm which can be built with the client end of
1004    /// `child_realm`.
1005    ///
1006    /// Errors:
1007    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
1008    ///   given name.
1009    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1010    ///   for this realm, and thus this `Realm` channel can no longer be used.
1011    pub fn r#add_child_realm(
1012        &self,
1013        mut name: &str,
1014        mut options: &ChildOptions,
1015        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
1016        ___deadline: zx::MonotonicInstant,
1017    ) -> Result<RealmAddChildRealmResult, fidl::Error> {
1018        let _response =
1019            self.client.send_query::<RealmAddChildRealmRequest, fidl::encoding::ResultType<
1020                fidl::encoding::EmptyStruct,
1021                RealmBuilderError,
1022            >>(
1023                (name, options, child_realm),
1024                0x3fdf98db373b9458,
1025                fidl::encoding::DynamicFlags::empty(),
1026                ___deadline,
1027            )?;
1028        Ok(_response.map(|x| x))
1029    }
1030
1031    /// Adds a child realm which can be built with the client end of
1032    /// `child_realm`, and whose contents are initialized from `relative_url`.
1033    /// `relative_url` must be a fragment-only URL.
1034    pub fn r#add_child_realm_from_relative_url(
1035        &self,
1036        mut name: &str,
1037        mut relative_url: &str,
1038        mut options: &ChildOptions,
1039        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
1040        ___deadline: zx::MonotonicInstant,
1041    ) -> Result<RealmAddChildRealmFromRelativeUrlResult, fidl::Error> {
1042        let _response = self.client.send_query::<
1043            RealmAddChildRealmFromRelativeUrlRequest,
1044            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
1045        >(
1046            (name, relative_url, options, child_realm,),
1047            0x44c34c8dcbe06abb,
1048            fidl::encoding::DynamicFlags::empty(),
1049            ___deadline,
1050        )?;
1051        Ok(_response.map(|x| x))
1052    }
1053
1054    /// Adds a child realm which can be built with the client end of
1055    /// `child_realm`, and whose contents are initialized from `decl`.
1056    pub fn r#add_child_realm_from_decl(
1057        &self,
1058        mut name: &str,
1059        mut decl: &fidl_fuchsia_component_decl::Component,
1060        mut options: &ChildOptions,
1061        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
1062        ___deadline: zx::MonotonicInstant,
1063    ) -> Result<RealmAddChildRealmFromDeclResult, fidl::Error> {
1064        let _response = self.client.send_query::<
1065            RealmAddChildRealmFromDeclRequest,
1066            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
1067        >(
1068            (name, decl, options, child_realm,),
1069            0x142e5c326732862e,
1070            fidl::encoding::DynamicFlags::empty(),
1071            ___deadline,
1072        )?;
1073        Ok(_response.map(|x| x))
1074    }
1075
1076    /// Returns the component decl for the given component. `name` must refer to
1077    /// a component that is one of the following:
1078    ///
1079    /// - A component with a local implementation
1080    /// - A legacy component
1081    /// - A component added with a fragment-only URL (typically, components
1082    ///   bundled in the same package as the realm builder client, sharing the
1083    ///   same `/pkg` directory, for example, `#meta/other-component.cm`; see
1084    ///   https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
1085    /// - An automatically generated realm (ex: the root)
1086    ///
1087    /// Errors:
1088    /// - `NO_SUCH_CHILD`: This realm does not contain a child with the given
1089    ///   name.
1090    /// - `CHILD_DECL_NOT_VISIBLE`: The component decl cannot be fetched for
1091    ///   the referenced child, because the child was added to the realm using
1092    ///   a modern (not legacy) absolute URL or subpackaged component's relative
1093    ///   path URL.
1094    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1095    ///   for this realm, and thus this `Realm` channel can no longer be used.
1096    pub fn r#get_component_decl(
1097        &self,
1098        mut name: &str,
1099        ___deadline: zx::MonotonicInstant,
1100    ) -> Result<RealmGetComponentDeclResult, fidl::Error> {
1101        let _response =
1102            self.client.send_query::<RealmGetComponentDeclRequest, fidl::encoding::ResultType<
1103                RealmGetComponentDeclResponse,
1104                RealmBuilderError,
1105            >>(
1106                (name,),
1107                0x320832af6a4cbac6,
1108                fidl::encoding::DynamicFlags::empty(),
1109                ___deadline,
1110            )?;
1111        Ok(_response.map(|x| x.component_decl))
1112    }
1113
1114    /// Replaces the component decl for the given component. `name` must
1115    /// refer to a component that is one of the following:
1116    ///
1117    /// - A component with a local implementation
1118    /// - A legacy component
1119    /// - A component added with a fragment-only URL (typically, components
1120    ///   bundled in the same package as the realm builder client, sharing the
1121    ///   same `/pkg` directory, for example, `#meta/other-component.cm`; see
1122    ///   https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
1123    /// - An automatically generated realm (ex: the root)
1124    ///
1125    /// Errors:
1126    /// - `NO_SUCH_CHILD`: This realm does not contain a child with the given
1127    ///   name.
1128    /// - `CHILD_ALREADY_EXISTS`: The component whose decl is being replaced has
1129    ///   had a child added to it through realm builder with the same name as an
1130    ///   element in `component_decl.children`.
1131    /// - `CHILD_DECL_NOT_VISIBLE`: The component decl cannot be manipulated for
1132    ///   the referenced child, because the child was added to the realm using
1133    ///   an absolute (not relative) and modern (not legacy) URL.
1134    /// - `INVALID_COMPONENT_DECL`: `component_decl` failed validation.
1135    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1136    ///   for this realm, and thus this `Realm` channel can no longer be used.
1137    pub fn r#replace_component_decl(
1138        &self,
1139        mut name: &str,
1140        mut component_decl: &fidl_fuchsia_component_decl::Component,
1141        ___deadline: zx::MonotonicInstant,
1142    ) -> Result<RealmReplaceComponentDeclResult, fidl::Error> {
1143        let _response =
1144            self.client.send_query::<RealmReplaceComponentDeclRequest, fidl::encoding::ResultType<
1145                fidl::encoding::EmptyStruct,
1146                RealmBuilderError,
1147            >>(
1148                (name, component_decl),
1149                0x59cecf31b314cd5f,
1150                fidl::encoding::DynamicFlags::empty(),
1151                ___deadline,
1152            )?;
1153        Ok(_response.map(|x| x))
1154    }
1155
1156    /// Returns the component decl for this realm.
1157    ///
1158    /// Errors:
1159    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1160    ///   for this realm, and thus this `Realm` channel can no longer be used.
1161    pub fn r#get_realm_decl(
1162        &self,
1163        ___deadline: zx::MonotonicInstant,
1164    ) -> Result<RealmGetRealmDeclResult, fidl::Error> {
1165        let _response = self.client.send_query::<
1166            fidl::encoding::EmptyPayload,
1167            fidl::encoding::ResultType<RealmGetRealmDeclResponse, RealmBuilderError>,
1168        >(
1169            (),
1170            0x46fa05b17bd64269,
1171            fidl::encoding::DynamicFlags::empty(),
1172            ___deadline,
1173        )?;
1174        Ok(_response.map(|x| x.component_decl))
1175    }
1176
1177    /// Replaces the component decl for this realm.
1178    ///
1179    /// Errors:
1180    /// - `INVALID_COMPONENT_DECL`: `component_decl` failed validation.
1181    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1182    ///   for this realm, and thus this `Realm` channel can no longer be used.
1183    pub fn r#replace_realm_decl(
1184        &self,
1185        mut component_decl: &fidl_fuchsia_component_decl::Component,
1186        ___deadline: zx::MonotonicInstant,
1187    ) -> Result<RealmReplaceRealmDeclResult, fidl::Error> {
1188        let _response =
1189            self.client.send_query::<RealmReplaceRealmDeclRequest, fidl::encoding::ResultType<
1190                fidl::encoding::EmptyStruct,
1191                RealmBuilderError,
1192            >>(
1193                (component_decl,),
1194                0x48fcba4ac1338da9,
1195                fidl::encoding::DynamicFlags::empty(),
1196                ___deadline,
1197            )?;
1198        Ok(_response.map(|x| x))
1199    }
1200
1201    /// Inform the realm builder server that this realm is using a nested component manager. It's
1202    /// expected that the client library has already replaced the realm's declaration with a
1203    /// passthrough component manager declaration, with the exception of the root url.
1204    /// This method will arrange for [Builder.Build] to install the realm's generated url as the
1205    /// root url in this component manager.
1206    pub fn r#use_nested_component_manager(
1207        &self,
1208        mut component_manager_relative_url: &str,
1209        ___deadline: zx::MonotonicInstant,
1210    ) -> Result<RealmUseNestedComponentManagerResult, fidl::Error> {
1211        let _response = self.client.send_query::<
1212            RealmUseNestedComponentManagerRequest,
1213            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
1214        >(
1215            (component_manager_relative_url,),
1216            0x64bd27482f3dcc,
1217            fidl::encoding::DynamicFlags::empty(),
1218            ___deadline,
1219        )?;
1220        Ok(_response.map(|x| x))
1221    }
1222
1223    /// Identical to `AddRouteFromDictionary`, except it does not accept `from_dictionary` which
1224    /// it always sets to ".".
1225    pub fn r#add_route(
1226        &self,
1227        mut capabilities: &[Capability],
1228        mut from: &fidl_fuchsia_component_decl::Ref,
1229        mut to: &[fidl_fuchsia_component_decl::Ref],
1230        ___deadline: zx::MonotonicInstant,
1231    ) -> Result<RealmAddRouteResult, fidl::Error> {
1232        let _response = self.client.send_query::<RealmAddRouteRequest, fidl::encoding::ResultType<
1233            fidl::encoding::EmptyStruct,
1234            RealmBuilderError,
1235        >>(
1236            (capabilities, from, to),
1237            0x9d523295be53a0a,
1238            fidl::encoding::DynamicFlags::empty(),
1239            ___deadline,
1240        )?;
1241        Ok(_response.map(|x| x))
1242    }
1243
1244    /// Mutates component manifests in the realm such that every component in
1245    /// `to` will have a valid capability route for each item in `capabilities`
1246    /// provided by `from`.
1247    ///
1248    /// Errors:
1249    /// - `NO_SUCH_SOURCE`: `from` references a non-existent child.
1250    /// - `NO_SUCH_TARGET`: `to` references a non-existent child.
1251    /// - `CAPABILITIES_EMPTY`: `capabilities` is empty.
1252    /// - `TARGETS_EMPTY`: `to` is empty.
1253    /// - `SOURCE_AND_TARGET_MATCH`: `from` is equal to one of the elements in
1254    ///   `to`.
1255    /// - `INVALID_COMPONENT_DECL`: The requested route caused one of the
1256    ///   involved manifests to fail validation.
1257    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1258    ///   for this realm, and thus this `Realm` channel can no longer be used.
1259    pub fn r#add_route_from_dictionary(
1260        &self,
1261        mut capabilities: &[Capability],
1262        mut from: &fidl_fuchsia_component_decl::Ref,
1263        mut from_dictionary: &str,
1264        mut to: &[fidl_fuchsia_component_decl::Ref],
1265        ___deadline: zx::MonotonicInstant,
1266    ) -> Result<RealmAddRouteFromDictionaryResult, fidl::Error> {
1267        let _response = self.client.send_query::<
1268            RealmAddRouteFromDictionaryRequest,
1269            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
1270        >(
1271            (capabilities, from, from_dictionary, to,),
1272            0x21fac42c3e1d14d2,
1273            fidl::encoding::DynamicFlags::empty(),
1274            ___deadline,
1275        )?;
1276        Ok(_response.map(|x| x))
1277    }
1278
1279    /// Offers a directory capability to a component in this realm. The
1280    /// directory will be read-only (i.e. have `r*` rights), and will have the
1281    /// contents described in `directory_contents`.
1282    ///
1283    /// Errors:
1284    /// - `NO_SUCH_TARGET`: `offer-to` references a non-existent child.
1285    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1286    ///   for this realm, and thus this `Realm` channel can no longer be used.
1287    pub fn r#read_only_directory(
1288        &self,
1289        mut name: &str,
1290        mut to: &[fidl_fuchsia_component_decl::Ref],
1291        mut directory_contents: DirectoryContents,
1292        ___deadline: zx::MonotonicInstant,
1293    ) -> Result<RealmReadOnlyDirectoryResult, fidl::Error> {
1294        let _response =
1295            self.client.send_query::<RealmReadOnlyDirectoryRequest, fidl::encoding::ResultType<
1296                fidl::encoding::EmptyStruct,
1297                RealmBuilderError,
1298            >>(
1299                (name, to, &mut directory_contents),
1300                0x78a6d150a66e00dc,
1301                fidl::encoding::DynamicFlags::empty(),
1302                ___deadline,
1303            )?;
1304        Ok(_response.map(|x| x))
1305    }
1306
1307    /// Creates and routes a new storage capability to the provided targets.
1308    /// Optionally can connect the provided channel the the
1309    /// `fuchsia.sys2.StorageAdmin` protocol for this storage capability.
1310    pub fn r#add_storage(
1311        &self,
1312        mut name: &str,
1313        mut to: &[fidl_fuchsia_component_decl::Ref],
1314        mut storage_admin: Option<
1315            fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>,
1316        >,
1317        ___deadline: zx::MonotonicInstant,
1318    ) -> Result<RealmAddStorageResult, fidl::Error> {
1319        let _response =
1320            self.client.send_query::<RealmAddStorageRequest, fidl::encoding::ResultType<
1321                fidl::encoding::EmptyStruct,
1322                RealmBuilderError,
1323            >>(
1324                (name, to, storage_admin),
1325                0x4709da0c9576b7c1,
1326                fidl::encoding::DynamicFlags::empty(),
1327                ___deadline,
1328            )?;
1329        Ok(_response.map(|x| x))
1330    }
1331
1332    /// Load any packaged configuration for `name` before using values provided to
1333    /// the builder.
1334    ///
1335    /// Allows calling `SetConfigValue` to override packaged configuration.
1336    pub fn r#init_mutable_config_from_package(
1337        &self,
1338        mut name: &str,
1339        ___deadline: zx::MonotonicInstant,
1340    ) -> Result<RealmInitMutableConfigFromPackageResult, fidl::Error> {
1341        let _response = self.client.send_query::<
1342            RealmInitMutableConfigFromPackageRequest,
1343            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
1344        >(
1345            (name,),
1346            0x36a30c9837c64216,
1347            fidl::encoding::DynamicFlags::empty(),
1348            ___deadline,
1349        )?;
1350        Ok(_response.map(|x| x))
1351    }
1352
1353    /// Use only values provided to the builder for `name`'s configuration.
1354    ///
1355    /// Allows calling `SetConfigValue` to provide configuration.
1356    pub fn r#init_mutable_config_to_empty(
1357        &self,
1358        mut name: &str,
1359        ___deadline: zx::MonotonicInstant,
1360    ) -> Result<RealmInitMutableConfigToEmptyResult, fidl::Error> {
1361        let _response = self.client.send_query::<
1362            RealmInitMutableConfigToEmptyRequest,
1363            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
1364        >(
1365            (name,),
1366            0x772cb99e2e0dccc5,
1367            fidl::encoding::DynamicFlags::empty(),
1368            ___deadline,
1369        )?;
1370        Ok(_response.map(|x| x))
1371    }
1372
1373    /// Add a capability to the realm.
1374    pub fn r#add_capability(
1375        &self,
1376        mut capability: &fidl_fuchsia_component_decl::Capability,
1377        ___deadline: zx::MonotonicInstant,
1378    ) -> Result<RealmAddCapabilityResult, fidl::Error> {
1379        let _response =
1380            self.client.send_query::<RealmAddCapabilityRequest, fidl::encoding::ResultType<
1381                fidl::encoding::EmptyStruct,
1382                RealmBuilderError,
1383            >>(
1384                (capability,),
1385                0x23a6499eb6080249,
1386                fidl::encoding::DynamicFlags::empty(),
1387                ___deadline,
1388            )?;
1389        Ok(_response.map(|x| x))
1390    }
1391
1392    /// Adds a collection to the realm.
1393    pub fn r#add_collection(
1394        &self,
1395        mut collection: &fidl_fuchsia_component_decl::Collection,
1396        ___deadline: zx::MonotonicInstant,
1397    ) -> Result<RealmAddCollectionResult, fidl::Error> {
1398        let _response =
1399            self.client.send_query::<RealmAddCollectionRequest, fidl::encoding::ResultType<
1400                fidl::encoding::EmptyStruct,
1401                RealmBuilderError,
1402            >>(
1403                (collection,),
1404                0x56b75210a03a99b5,
1405                fidl::encoding::DynamicFlags::empty(),
1406                ___deadline,
1407            )?;
1408        Ok(_response.map(|x| x))
1409    }
1410
1411    /// Adds an environment to the realm.
1412    pub fn r#add_environment(
1413        &self,
1414        mut environment: &fidl_fuchsia_component_decl::Environment,
1415        ___deadline: zx::MonotonicInstant,
1416    ) -> Result<RealmAddEnvironmentResult, fidl::Error> {
1417        let _response =
1418            self.client.send_query::<RealmAddEnvironmentRequest, fidl::encoding::ResultType<
1419                fidl::encoding::EmptyStruct,
1420                RealmBuilderError,
1421            >>(
1422                (environment,),
1423                0x1cd7caefa2cce0e9,
1424                fidl::encoding::DynamicFlags::empty(),
1425                ___deadline,
1426            )?;
1427        Ok(_response.map(|x| x))
1428    }
1429
1430    /// Sets the configuration value for a field specified by `key`.
1431    /// The component specified must have a config schema with this field.
1432    /// The value must conform to all constraints as defined by the schema.
1433    ///
1434    /// This method must be called after either `InitMutableConfigFromPackage` or
1435    /// `InitMutableConfigToEmpty`.
1436    ///
1437    /// Errors:
1438    /// - `NO_CONFIG_SCHEMA`: component does not have a config schema
1439    /// - `NO_SUCH_CONFIG_FIELD`: `key` could not be found in component's config schema
1440    /// - `CONFIG_VALUE_INVALID`: `value` does not meet config schema constraints
1441    pub fn r#set_config_value(
1442        &self,
1443        mut name: &str,
1444        mut key: &str,
1445        mut value: &fidl_fuchsia_component_decl::ConfigValueSpec,
1446        ___deadline: zx::MonotonicInstant,
1447    ) -> Result<RealmSetConfigValueResult, fidl::Error> {
1448        let _response =
1449            self.client.send_query::<RealmSetConfigValueRequest, fidl::encoding::ResultType<
1450                fidl::encoding::EmptyStruct,
1451                RealmBuilderError,
1452            >>(
1453                (name, key, value),
1454                0x886450d291217f2,
1455                fidl::encoding::DynamicFlags::empty(),
1456                ___deadline,
1457            )?;
1458        Ok(_response.map(|x| x))
1459    }
1460}
1461
1462#[cfg(target_os = "fuchsia")]
1463impl From<RealmSynchronousProxy> for zx::NullableHandle {
1464    fn from(value: RealmSynchronousProxy) -> Self {
1465        value.into_channel().into()
1466    }
1467}
1468
1469#[cfg(target_os = "fuchsia")]
1470impl From<fidl::Channel> for RealmSynchronousProxy {
1471    fn from(value: fidl::Channel) -> Self {
1472        Self::new(value)
1473    }
1474}
1475
1476#[cfg(target_os = "fuchsia")]
1477impl fidl::endpoints::FromClient for RealmSynchronousProxy {
1478    type Protocol = RealmMarker;
1479
1480    fn from_client(value: fidl::endpoints::ClientEnd<RealmMarker>) -> Self {
1481        Self::new(value.into_channel())
1482    }
1483}
1484
1485#[derive(Debug, Clone)]
1486pub struct RealmProxy {
1487    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1488}
1489
1490impl fidl::endpoints::Proxy for RealmProxy {
1491    type Protocol = RealmMarker;
1492
1493    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1494        Self::new(inner)
1495    }
1496
1497    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1498        self.client.into_channel().map_err(|client| Self { client })
1499    }
1500
1501    fn as_channel(&self) -> &::fidl::AsyncChannel {
1502        self.client.as_channel()
1503    }
1504}
1505
1506impl RealmProxy {
1507    /// Create a new Proxy for fuchsia.component.test/Realm.
1508    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1509        let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1510        Self { client: fidl::client::Client::new(channel, protocol_name) }
1511    }
1512
1513    /// Get a Stream of events from the remote end of the protocol.
1514    ///
1515    /// # Panics
1516    ///
1517    /// Panics if the event stream was already taken.
1518    pub fn take_event_stream(&self) -> RealmEventStream {
1519        RealmEventStream { event_receiver: self.client.take_event_receiver() }
1520    }
1521
1522    /// Adds a component to the realm.
1523    ///
1524    /// The `url` can be in one of the following formats:
1525    ///
1526    /// - an absolute component URL (such as,
1527    ///   "fuchsia-pkg://fuchsia.com/some-package#meta/some-component.cm")
1528    /// - a relative path component URL to a subpackaged component (like,
1529    ///   "some-subpackage#meta/subpackaged-component.cm"); or
1530    /// - a relative fragment-only URL (like, `#meta/other-component.cm`;
1531    ///   see https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
1532    ///   indicating the path to a component manifest in the `pkg_dir` supplied
1533    ///   to `RealmBuilderFactory::Create*()`.
1534    ///
1535    /// The realm builder client typically passes a handle to its own `/pkg`
1536    /// directory, and bundles the `other-component` into the same package.
1537    ///
1538    /// Of the three URL types, _only_ component declarations added via the
1539    /// fragment-only URL can be modified, via
1540    /// `GetComponentDecl`/`ReplaceComponentDecl` because realm builder actually
1541    /// performs its own component resolution from the component's manifest and
1542    /// files bundled in the provided `pkg_dir` (typically from the package
1543    /// shared by the realm builder client component and the components added
1544    /// via fragment-only URL).
1545    ///
1546    /// Errors:
1547    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
1548    ///   given name.
1549    /// - `INVALID_MANIFEST_EXTENSION`: `url` does not end with `.cm`
1550    /// - `DECL_NOT_FOUND`: The test package does not contain the component
1551    ///   declaration referenced by a fragment-only component URL.
1552    /// - `DECL_READ_ERROR`: Encountered an I/O error when attempting to read a
1553    ///   component declaration referenced by a fragment-only component URL from
1554    ///   the test package.
1555    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1556    ///   for this realm, and thus this `Realm` channel can no longer be used.
1557    pub fn r#add_child(
1558        &self,
1559        mut name: &str,
1560        mut url: &str,
1561        mut options: &ChildOptions,
1562    ) -> fidl::client::QueryResponseFut<
1563        RealmAddChildResult,
1564        fidl::encoding::DefaultFuchsiaResourceDialect,
1565    > {
1566        RealmProxyInterface::r#add_child(self, name, url, options)
1567    }
1568
1569    /// Adds a component to this realm whose declaration is set to `decl`. When
1570    /// launched, the component will share the test package as its package
1571    /// directory, and may access any resources from it.
1572    ///
1573    /// Errors:
1574    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
1575    ///   given name.
1576    /// - `INVALID_COMPONENT_DECL`: `decl` failed validation.
1577    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1578    ///   for this realm, and thus this `Realm` channel can no longer be used.
1579    pub fn r#add_child_from_decl(
1580        &self,
1581        mut name: &str,
1582        mut decl: &fidl_fuchsia_component_decl::Component,
1583        mut options: &ChildOptions,
1584    ) -> fidl::client::QueryResponseFut<
1585        RealmAddChildFromDeclResult,
1586        fidl::encoding::DefaultFuchsiaResourceDialect,
1587    > {
1588        RealmProxyInterface::r#add_child_from_decl(self, name, decl, options)
1589    }
1590
1591    /// Adds a component to the realm whose implementation will be provided by
1592    /// the client. When this component should be started, the runner channel
1593    /// passed into `Build` will receive a start request for a component whose
1594    /// `ProgramDecl` contains the moniker from the root of the
1595    /// constructed realm for the child that is to be run under the `program`
1596    /// key `LOCAL_COMPONENT_NAME`.
1597    ///
1598    /// Errors:
1599    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
1600    ///   given name.
1601    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1602    ///   for this realm, and thus this `Realm` channel can no longer be used.
1603    pub fn r#add_local_child(
1604        &self,
1605        mut name: &str,
1606        mut options: &ChildOptions,
1607    ) -> fidl::client::QueryResponseFut<
1608        RealmAddLocalChildResult,
1609        fidl::encoding::DefaultFuchsiaResourceDialect,
1610    > {
1611        RealmProxyInterface::r#add_local_child(self, name, options)
1612    }
1613
1614    /// Adds a child realm which can be built with the client end of
1615    /// `child_realm`.
1616    ///
1617    /// Errors:
1618    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
1619    ///   given name.
1620    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1621    ///   for this realm, and thus this `Realm` channel can no longer be used.
1622    pub fn r#add_child_realm(
1623        &self,
1624        mut name: &str,
1625        mut options: &ChildOptions,
1626        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
1627    ) -> fidl::client::QueryResponseFut<
1628        RealmAddChildRealmResult,
1629        fidl::encoding::DefaultFuchsiaResourceDialect,
1630    > {
1631        RealmProxyInterface::r#add_child_realm(self, name, options, child_realm)
1632    }
1633
1634    /// Adds a child realm which can be built with the client end of
1635    /// `child_realm`, and whose contents are initialized from `relative_url`.
1636    /// `relative_url` must be a fragment-only URL.
1637    pub fn r#add_child_realm_from_relative_url(
1638        &self,
1639        mut name: &str,
1640        mut relative_url: &str,
1641        mut options: &ChildOptions,
1642        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
1643    ) -> fidl::client::QueryResponseFut<
1644        RealmAddChildRealmFromRelativeUrlResult,
1645        fidl::encoding::DefaultFuchsiaResourceDialect,
1646    > {
1647        RealmProxyInterface::r#add_child_realm_from_relative_url(
1648            self,
1649            name,
1650            relative_url,
1651            options,
1652            child_realm,
1653        )
1654    }
1655
1656    /// Adds a child realm which can be built with the client end of
1657    /// `child_realm`, and whose contents are initialized from `decl`.
1658    pub fn r#add_child_realm_from_decl(
1659        &self,
1660        mut name: &str,
1661        mut decl: &fidl_fuchsia_component_decl::Component,
1662        mut options: &ChildOptions,
1663        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
1664    ) -> fidl::client::QueryResponseFut<
1665        RealmAddChildRealmFromDeclResult,
1666        fidl::encoding::DefaultFuchsiaResourceDialect,
1667    > {
1668        RealmProxyInterface::r#add_child_realm_from_decl(self, name, decl, options, child_realm)
1669    }
1670
1671    /// Returns the component decl for the given component. `name` must refer to
1672    /// a component that is one of the following:
1673    ///
1674    /// - A component with a local implementation
1675    /// - A legacy component
1676    /// - A component added with a fragment-only URL (typically, components
1677    ///   bundled in the same package as the realm builder client, sharing the
1678    ///   same `/pkg` directory, for example, `#meta/other-component.cm`; see
1679    ///   https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
1680    /// - An automatically generated realm (ex: the root)
1681    ///
1682    /// Errors:
1683    /// - `NO_SUCH_CHILD`: This realm does not contain a child with the given
1684    ///   name.
1685    /// - `CHILD_DECL_NOT_VISIBLE`: The component decl cannot be fetched for
1686    ///   the referenced child, because the child was added to the realm using
1687    ///   a modern (not legacy) absolute URL or subpackaged component's relative
1688    ///   path URL.
1689    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1690    ///   for this realm, and thus this `Realm` channel can no longer be used.
1691    pub fn r#get_component_decl(
1692        &self,
1693        mut name: &str,
1694    ) -> fidl::client::QueryResponseFut<
1695        RealmGetComponentDeclResult,
1696        fidl::encoding::DefaultFuchsiaResourceDialect,
1697    > {
1698        RealmProxyInterface::r#get_component_decl(self, name)
1699    }
1700
1701    /// Replaces the component decl for the given component. `name` must
1702    /// refer to a component that is one of the following:
1703    ///
1704    /// - A component with a local implementation
1705    /// - A legacy component
1706    /// - A component added with a fragment-only URL (typically, components
1707    ///   bundled in the same package as the realm builder client, sharing the
1708    ///   same `/pkg` directory, for example, `#meta/other-component.cm`; see
1709    ///   https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
1710    /// - An automatically generated realm (ex: the root)
1711    ///
1712    /// Errors:
1713    /// - `NO_SUCH_CHILD`: This realm does not contain a child with the given
1714    ///   name.
1715    /// - `CHILD_ALREADY_EXISTS`: The component whose decl is being replaced has
1716    ///   had a child added to it through realm builder with the same name as an
1717    ///   element in `component_decl.children`.
1718    /// - `CHILD_DECL_NOT_VISIBLE`: The component decl cannot be manipulated for
1719    ///   the referenced child, because the child was added to the realm using
1720    ///   an absolute (not relative) and modern (not legacy) URL.
1721    /// - `INVALID_COMPONENT_DECL`: `component_decl` failed validation.
1722    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1723    ///   for this realm, and thus this `Realm` channel can no longer be used.
1724    pub fn r#replace_component_decl(
1725        &self,
1726        mut name: &str,
1727        mut component_decl: &fidl_fuchsia_component_decl::Component,
1728    ) -> fidl::client::QueryResponseFut<
1729        RealmReplaceComponentDeclResult,
1730        fidl::encoding::DefaultFuchsiaResourceDialect,
1731    > {
1732        RealmProxyInterface::r#replace_component_decl(self, name, component_decl)
1733    }
1734
1735    /// Returns the component decl for this realm.
1736    ///
1737    /// Errors:
1738    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1739    ///   for this realm, and thus this `Realm` channel can no longer be used.
1740    pub fn r#get_realm_decl(
1741        &self,
1742    ) -> fidl::client::QueryResponseFut<
1743        RealmGetRealmDeclResult,
1744        fidl::encoding::DefaultFuchsiaResourceDialect,
1745    > {
1746        RealmProxyInterface::r#get_realm_decl(self)
1747    }
1748
1749    /// Replaces the component decl for this realm.
1750    ///
1751    /// Errors:
1752    /// - `INVALID_COMPONENT_DECL`: `component_decl` failed validation.
1753    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1754    ///   for this realm, and thus this `Realm` channel can no longer be used.
1755    pub fn r#replace_realm_decl(
1756        &self,
1757        mut component_decl: &fidl_fuchsia_component_decl::Component,
1758    ) -> fidl::client::QueryResponseFut<
1759        RealmReplaceRealmDeclResult,
1760        fidl::encoding::DefaultFuchsiaResourceDialect,
1761    > {
1762        RealmProxyInterface::r#replace_realm_decl(self, component_decl)
1763    }
1764
1765    /// Inform the realm builder server that this realm is using a nested component manager. It's
1766    /// expected that the client library has already replaced the realm's declaration with a
1767    /// passthrough component manager declaration, with the exception of the root url.
1768    /// This method will arrange for [Builder.Build] to install the realm's generated url as the
1769    /// root url in this component manager.
1770    pub fn r#use_nested_component_manager(
1771        &self,
1772        mut component_manager_relative_url: &str,
1773    ) -> fidl::client::QueryResponseFut<
1774        RealmUseNestedComponentManagerResult,
1775        fidl::encoding::DefaultFuchsiaResourceDialect,
1776    > {
1777        RealmProxyInterface::r#use_nested_component_manager(self, component_manager_relative_url)
1778    }
1779
1780    /// Identical to `AddRouteFromDictionary`, except it does not accept `from_dictionary` which
1781    /// it always sets to ".".
1782    pub fn r#add_route(
1783        &self,
1784        mut capabilities: &[Capability],
1785        mut from: &fidl_fuchsia_component_decl::Ref,
1786        mut to: &[fidl_fuchsia_component_decl::Ref],
1787    ) -> fidl::client::QueryResponseFut<
1788        RealmAddRouteResult,
1789        fidl::encoding::DefaultFuchsiaResourceDialect,
1790    > {
1791        RealmProxyInterface::r#add_route(self, capabilities, from, to)
1792    }
1793
1794    /// Mutates component manifests in the realm such that every component in
1795    /// `to` will have a valid capability route for each item in `capabilities`
1796    /// provided by `from`.
1797    ///
1798    /// Errors:
1799    /// - `NO_SUCH_SOURCE`: `from` references a non-existent child.
1800    /// - `NO_SUCH_TARGET`: `to` references a non-existent child.
1801    /// - `CAPABILITIES_EMPTY`: `capabilities` is empty.
1802    /// - `TARGETS_EMPTY`: `to` is empty.
1803    /// - `SOURCE_AND_TARGET_MATCH`: `from` is equal to one of the elements in
1804    ///   `to`.
1805    /// - `INVALID_COMPONENT_DECL`: The requested route caused one of the
1806    ///   involved manifests to fail validation.
1807    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1808    ///   for this realm, and thus this `Realm` channel can no longer be used.
1809    pub fn r#add_route_from_dictionary(
1810        &self,
1811        mut capabilities: &[Capability],
1812        mut from: &fidl_fuchsia_component_decl::Ref,
1813        mut from_dictionary: &str,
1814        mut to: &[fidl_fuchsia_component_decl::Ref],
1815    ) -> fidl::client::QueryResponseFut<
1816        RealmAddRouteFromDictionaryResult,
1817        fidl::encoding::DefaultFuchsiaResourceDialect,
1818    > {
1819        RealmProxyInterface::r#add_route_from_dictionary(
1820            self,
1821            capabilities,
1822            from,
1823            from_dictionary,
1824            to,
1825        )
1826    }
1827
1828    /// Offers a directory capability to a component in this realm. The
1829    /// directory will be read-only (i.e. have `r*` rights), and will have the
1830    /// contents described in `directory_contents`.
1831    ///
1832    /// Errors:
1833    /// - `NO_SUCH_TARGET`: `offer-to` references a non-existent child.
1834    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
1835    ///   for this realm, and thus this `Realm` channel can no longer be used.
1836    pub fn r#read_only_directory(
1837        &self,
1838        mut name: &str,
1839        mut to: &[fidl_fuchsia_component_decl::Ref],
1840        mut directory_contents: DirectoryContents,
1841    ) -> fidl::client::QueryResponseFut<
1842        RealmReadOnlyDirectoryResult,
1843        fidl::encoding::DefaultFuchsiaResourceDialect,
1844    > {
1845        RealmProxyInterface::r#read_only_directory(self, name, to, directory_contents)
1846    }
1847
1848    /// Creates and routes a new storage capability to the provided targets.
1849    /// Optionally can connect the provided channel the the
1850    /// `fuchsia.sys2.StorageAdmin` protocol for this storage capability.
1851    pub fn r#add_storage(
1852        &self,
1853        mut name: &str,
1854        mut to: &[fidl_fuchsia_component_decl::Ref],
1855        mut storage_admin: Option<
1856            fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>,
1857        >,
1858    ) -> fidl::client::QueryResponseFut<
1859        RealmAddStorageResult,
1860        fidl::encoding::DefaultFuchsiaResourceDialect,
1861    > {
1862        RealmProxyInterface::r#add_storage(self, name, to, storage_admin)
1863    }
1864
1865    /// Load any packaged configuration for `name` before using values provided to
1866    /// the builder.
1867    ///
1868    /// Allows calling `SetConfigValue` to override packaged configuration.
1869    pub fn r#init_mutable_config_from_package(
1870        &self,
1871        mut name: &str,
1872    ) -> fidl::client::QueryResponseFut<
1873        RealmInitMutableConfigFromPackageResult,
1874        fidl::encoding::DefaultFuchsiaResourceDialect,
1875    > {
1876        RealmProxyInterface::r#init_mutable_config_from_package(self, name)
1877    }
1878
1879    /// Use only values provided to the builder for `name`'s configuration.
1880    ///
1881    /// Allows calling `SetConfigValue` to provide configuration.
1882    pub fn r#init_mutable_config_to_empty(
1883        &self,
1884        mut name: &str,
1885    ) -> fidl::client::QueryResponseFut<
1886        RealmInitMutableConfigToEmptyResult,
1887        fidl::encoding::DefaultFuchsiaResourceDialect,
1888    > {
1889        RealmProxyInterface::r#init_mutable_config_to_empty(self, name)
1890    }
1891
1892    /// Add a capability to the realm.
1893    pub fn r#add_capability(
1894        &self,
1895        mut capability: &fidl_fuchsia_component_decl::Capability,
1896    ) -> fidl::client::QueryResponseFut<
1897        RealmAddCapabilityResult,
1898        fidl::encoding::DefaultFuchsiaResourceDialect,
1899    > {
1900        RealmProxyInterface::r#add_capability(self, capability)
1901    }
1902
1903    /// Adds a collection to the realm.
1904    pub fn r#add_collection(
1905        &self,
1906        mut collection: &fidl_fuchsia_component_decl::Collection,
1907    ) -> fidl::client::QueryResponseFut<
1908        RealmAddCollectionResult,
1909        fidl::encoding::DefaultFuchsiaResourceDialect,
1910    > {
1911        RealmProxyInterface::r#add_collection(self, collection)
1912    }
1913
1914    /// Adds an environment to the realm.
1915    pub fn r#add_environment(
1916        &self,
1917        mut environment: &fidl_fuchsia_component_decl::Environment,
1918    ) -> fidl::client::QueryResponseFut<
1919        RealmAddEnvironmentResult,
1920        fidl::encoding::DefaultFuchsiaResourceDialect,
1921    > {
1922        RealmProxyInterface::r#add_environment(self, environment)
1923    }
1924
1925    /// Sets the configuration value for a field specified by `key`.
1926    /// The component specified must have a config schema with this field.
1927    /// The value must conform to all constraints as defined by the schema.
1928    ///
1929    /// This method must be called after either `InitMutableConfigFromPackage` or
1930    /// `InitMutableConfigToEmpty`.
1931    ///
1932    /// Errors:
1933    /// - `NO_CONFIG_SCHEMA`: component does not have a config schema
1934    /// - `NO_SUCH_CONFIG_FIELD`: `key` could not be found in component's config schema
1935    /// - `CONFIG_VALUE_INVALID`: `value` does not meet config schema constraints
1936    pub fn r#set_config_value(
1937        &self,
1938        mut name: &str,
1939        mut key: &str,
1940        mut value: &fidl_fuchsia_component_decl::ConfigValueSpec,
1941    ) -> fidl::client::QueryResponseFut<
1942        RealmSetConfigValueResult,
1943        fidl::encoding::DefaultFuchsiaResourceDialect,
1944    > {
1945        RealmProxyInterface::r#set_config_value(self, name, key, value)
1946    }
1947}
1948
1949impl RealmProxyInterface for RealmProxy {
1950    type AddChildResponseFut = fidl::client::QueryResponseFut<
1951        RealmAddChildResult,
1952        fidl::encoding::DefaultFuchsiaResourceDialect,
1953    >;
1954    fn r#add_child(
1955        &self,
1956        mut name: &str,
1957        mut url: &str,
1958        mut options: &ChildOptions,
1959    ) -> Self::AddChildResponseFut {
1960        fn _decode(
1961            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1962        ) -> Result<RealmAddChildResult, fidl::Error> {
1963            let _response = fidl::client::decode_transaction_body::<
1964                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
1965                fidl::encoding::DefaultFuchsiaResourceDialect,
1966                0x3f6c07627303d801,
1967            >(_buf?)?;
1968            Ok(_response.map(|x| x))
1969        }
1970        self.client.send_query_and_decode::<RealmAddChildRequest, RealmAddChildResult>(
1971            (name, url, options),
1972            0x3f6c07627303d801,
1973            fidl::encoding::DynamicFlags::empty(),
1974            _decode,
1975        )
1976    }
1977
1978    type AddChildFromDeclResponseFut = fidl::client::QueryResponseFut<
1979        RealmAddChildFromDeclResult,
1980        fidl::encoding::DefaultFuchsiaResourceDialect,
1981    >;
1982    fn r#add_child_from_decl(
1983        &self,
1984        mut name: &str,
1985        mut decl: &fidl_fuchsia_component_decl::Component,
1986        mut options: &ChildOptions,
1987    ) -> Self::AddChildFromDeclResponseFut {
1988        fn _decode(
1989            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1990        ) -> Result<RealmAddChildFromDeclResult, fidl::Error> {
1991            let _response = fidl::client::decode_transaction_body::<
1992                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
1993                fidl::encoding::DefaultFuchsiaResourceDialect,
1994                0x3950ad500258156d,
1995            >(_buf?)?;
1996            Ok(_response.map(|x| x))
1997        }
1998        self.client
1999            .send_query_and_decode::<RealmAddChildFromDeclRequest, RealmAddChildFromDeclResult>(
2000                (name, decl, options),
2001                0x3950ad500258156d,
2002                fidl::encoding::DynamicFlags::empty(),
2003                _decode,
2004            )
2005    }
2006
2007    type AddLocalChildResponseFut = fidl::client::QueryResponseFut<
2008        RealmAddLocalChildResult,
2009        fidl::encoding::DefaultFuchsiaResourceDialect,
2010    >;
2011    fn r#add_local_child(
2012        &self,
2013        mut name: &str,
2014        mut options: &ChildOptions,
2015    ) -> Self::AddLocalChildResponseFut {
2016        fn _decode(
2017            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2018        ) -> Result<RealmAddLocalChildResult, fidl::Error> {
2019            let _response = fidl::client::decode_transaction_body::<
2020                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2021                fidl::encoding::DefaultFuchsiaResourceDialect,
2022                0x3249817bae10abbb,
2023            >(_buf?)?;
2024            Ok(_response.map(|x| x))
2025        }
2026        self.client.send_query_and_decode::<RealmAddLocalChildRequest, RealmAddLocalChildResult>(
2027            (name, options),
2028            0x3249817bae10abbb,
2029            fidl::encoding::DynamicFlags::empty(),
2030            _decode,
2031        )
2032    }
2033
2034    type AddChildRealmResponseFut = fidl::client::QueryResponseFut<
2035        RealmAddChildRealmResult,
2036        fidl::encoding::DefaultFuchsiaResourceDialect,
2037    >;
2038    fn r#add_child_realm(
2039        &self,
2040        mut name: &str,
2041        mut options: &ChildOptions,
2042        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
2043    ) -> Self::AddChildRealmResponseFut {
2044        fn _decode(
2045            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2046        ) -> Result<RealmAddChildRealmResult, fidl::Error> {
2047            let _response = fidl::client::decode_transaction_body::<
2048                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2049                fidl::encoding::DefaultFuchsiaResourceDialect,
2050                0x3fdf98db373b9458,
2051            >(_buf?)?;
2052            Ok(_response.map(|x| x))
2053        }
2054        self.client.send_query_and_decode::<RealmAddChildRealmRequest, RealmAddChildRealmResult>(
2055            (name, options, child_realm),
2056            0x3fdf98db373b9458,
2057            fidl::encoding::DynamicFlags::empty(),
2058            _decode,
2059        )
2060    }
2061
2062    type AddChildRealmFromRelativeUrlResponseFut = fidl::client::QueryResponseFut<
2063        RealmAddChildRealmFromRelativeUrlResult,
2064        fidl::encoding::DefaultFuchsiaResourceDialect,
2065    >;
2066    fn r#add_child_realm_from_relative_url(
2067        &self,
2068        mut name: &str,
2069        mut relative_url: &str,
2070        mut options: &ChildOptions,
2071        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
2072    ) -> Self::AddChildRealmFromRelativeUrlResponseFut {
2073        fn _decode(
2074            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2075        ) -> Result<RealmAddChildRealmFromRelativeUrlResult, fidl::Error> {
2076            let _response = fidl::client::decode_transaction_body::<
2077                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2078                fidl::encoding::DefaultFuchsiaResourceDialect,
2079                0x44c34c8dcbe06abb,
2080            >(_buf?)?;
2081            Ok(_response.map(|x| x))
2082        }
2083        self.client.send_query_and_decode::<
2084            RealmAddChildRealmFromRelativeUrlRequest,
2085            RealmAddChildRealmFromRelativeUrlResult,
2086        >(
2087            (name, relative_url, options, child_realm,),
2088            0x44c34c8dcbe06abb,
2089            fidl::encoding::DynamicFlags::empty(),
2090            _decode,
2091        )
2092    }
2093
2094    type AddChildRealmFromDeclResponseFut = fidl::client::QueryResponseFut<
2095        RealmAddChildRealmFromDeclResult,
2096        fidl::encoding::DefaultFuchsiaResourceDialect,
2097    >;
2098    fn r#add_child_realm_from_decl(
2099        &self,
2100        mut name: &str,
2101        mut decl: &fidl_fuchsia_component_decl::Component,
2102        mut options: &ChildOptions,
2103        mut child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
2104    ) -> Self::AddChildRealmFromDeclResponseFut {
2105        fn _decode(
2106            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2107        ) -> Result<RealmAddChildRealmFromDeclResult, fidl::Error> {
2108            let _response = fidl::client::decode_transaction_body::<
2109                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2110                fidl::encoding::DefaultFuchsiaResourceDialect,
2111                0x142e5c326732862e,
2112            >(_buf?)?;
2113            Ok(_response.map(|x| x))
2114        }
2115        self.client.send_query_and_decode::<
2116            RealmAddChildRealmFromDeclRequest,
2117            RealmAddChildRealmFromDeclResult,
2118        >(
2119            (name, decl, options, child_realm,),
2120            0x142e5c326732862e,
2121            fidl::encoding::DynamicFlags::empty(),
2122            _decode,
2123        )
2124    }
2125
2126    type GetComponentDeclResponseFut = fidl::client::QueryResponseFut<
2127        RealmGetComponentDeclResult,
2128        fidl::encoding::DefaultFuchsiaResourceDialect,
2129    >;
2130    fn r#get_component_decl(&self, mut name: &str) -> Self::GetComponentDeclResponseFut {
2131        fn _decode(
2132            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2133        ) -> Result<RealmGetComponentDeclResult, fidl::Error> {
2134            let _response = fidl::client::decode_transaction_body::<
2135                fidl::encoding::ResultType<RealmGetComponentDeclResponse, RealmBuilderError>,
2136                fidl::encoding::DefaultFuchsiaResourceDialect,
2137                0x320832af6a4cbac6,
2138            >(_buf?)?;
2139            Ok(_response.map(|x| x.component_decl))
2140        }
2141        self.client
2142            .send_query_and_decode::<RealmGetComponentDeclRequest, RealmGetComponentDeclResult>(
2143                (name,),
2144                0x320832af6a4cbac6,
2145                fidl::encoding::DynamicFlags::empty(),
2146                _decode,
2147            )
2148    }
2149
2150    type ReplaceComponentDeclResponseFut = fidl::client::QueryResponseFut<
2151        RealmReplaceComponentDeclResult,
2152        fidl::encoding::DefaultFuchsiaResourceDialect,
2153    >;
2154    fn r#replace_component_decl(
2155        &self,
2156        mut name: &str,
2157        mut component_decl: &fidl_fuchsia_component_decl::Component,
2158    ) -> Self::ReplaceComponentDeclResponseFut {
2159        fn _decode(
2160            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2161        ) -> Result<RealmReplaceComponentDeclResult, fidl::Error> {
2162            let _response = fidl::client::decode_transaction_body::<
2163                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2164                fidl::encoding::DefaultFuchsiaResourceDialect,
2165                0x59cecf31b314cd5f,
2166            >(_buf?)?;
2167            Ok(_response.map(|x| x))
2168        }
2169        self.client.send_query_and_decode::<
2170            RealmReplaceComponentDeclRequest,
2171            RealmReplaceComponentDeclResult,
2172        >(
2173            (name, component_decl,),
2174            0x59cecf31b314cd5f,
2175            fidl::encoding::DynamicFlags::empty(),
2176            _decode,
2177        )
2178    }
2179
2180    type GetRealmDeclResponseFut = fidl::client::QueryResponseFut<
2181        RealmGetRealmDeclResult,
2182        fidl::encoding::DefaultFuchsiaResourceDialect,
2183    >;
2184    fn r#get_realm_decl(&self) -> Self::GetRealmDeclResponseFut {
2185        fn _decode(
2186            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2187        ) -> Result<RealmGetRealmDeclResult, fidl::Error> {
2188            let _response = fidl::client::decode_transaction_body::<
2189                fidl::encoding::ResultType<RealmGetRealmDeclResponse, RealmBuilderError>,
2190                fidl::encoding::DefaultFuchsiaResourceDialect,
2191                0x46fa05b17bd64269,
2192            >(_buf?)?;
2193            Ok(_response.map(|x| x.component_decl))
2194        }
2195        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, RealmGetRealmDeclResult>(
2196            (),
2197            0x46fa05b17bd64269,
2198            fidl::encoding::DynamicFlags::empty(),
2199            _decode,
2200        )
2201    }
2202
2203    type ReplaceRealmDeclResponseFut = fidl::client::QueryResponseFut<
2204        RealmReplaceRealmDeclResult,
2205        fidl::encoding::DefaultFuchsiaResourceDialect,
2206    >;
2207    fn r#replace_realm_decl(
2208        &self,
2209        mut component_decl: &fidl_fuchsia_component_decl::Component,
2210    ) -> Self::ReplaceRealmDeclResponseFut {
2211        fn _decode(
2212            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2213        ) -> Result<RealmReplaceRealmDeclResult, fidl::Error> {
2214            let _response = fidl::client::decode_transaction_body::<
2215                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2216                fidl::encoding::DefaultFuchsiaResourceDialect,
2217                0x48fcba4ac1338da9,
2218            >(_buf?)?;
2219            Ok(_response.map(|x| x))
2220        }
2221        self.client
2222            .send_query_and_decode::<RealmReplaceRealmDeclRequest, RealmReplaceRealmDeclResult>(
2223                (component_decl,),
2224                0x48fcba4ac1338da9,
2225                fidl::encoding::DynamicFlags::empty(),
2226                _decode,
2227            )
2228    }
2229
2230    type UseNestedComponentManagerResponseFut = fidl::client::QueryResponseFut<
2231        RealmUseNestedComponentManagerResult,
2232        fidl::encoding::DefaultFuchsiaResourceDialect,
2233    >;
2234    fn r#use_nested_component_manager(
2235        &self,
2236        mut component_manager_relative_url: &str,
2237    ) -> Self::UseNestedComponentManagerResponseFut {
2238        fn _decode(
2239            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2240        ) -> Result<RealmUseNestedComponentManagerResult, fidl::Error> {
2241            let _response = fidl::client::decode_transaction_body::<
2242                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2243                fidl::encoding::DefaultFuchsiaResourceDialect,
2244                0x64bd27482f3dcc,
2245            >(_buf?)?;
2246            Ok(_response.map(|x| x))
2247        }
2248        self.client.send_query_and_decode::<
2249            RealmUseNestedComponentManagerRequest,
2250            RealmUseNestedComponentManagerResult,
2251        >(
2252            (component_manager_relative_url,),
2253            0x64bd27482f3dcc,
2254            fidl::encoding::DynamicFlags::empty(),
2255            _decode,
2256        )
2257    }
2258
2259    type AddRouteResponseFut = fidl::client::QueryResponseFut<
2260        RealmAddRouteResult,
2261        fidl::encoding::DefaultFuchsiaResourceDialect,
2262    >;
2263    fn r#add_route(
2264        &self,
2265        mut capabilities: &[Capability],
2266        mut from: &fidl_fuchsia_component_decl::Ref,
2267        mut to: &[fidl_fuchsia_component_decl::Ref],
2268    ) -> Self::AddRouteResponseFut {
2269        fn _decode(
2270            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2271        ) -> Result<RealmAddRouteResult, fidl::Error> {
2272            let _response = fidl::client::decode_transaction_body::<
2273                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2274                fidl::encoding::DefaultFuchsiaResourceDialect,
2275                0x9d523295be53a0a,
2276            >(_buf?)?;
2277            Ok(_response.map(|x| x))
2278        }
2279        self.client.send_query_and_decode::<RealmAddRouteRequest, RealmAddRouteResult>(
2280            (capabilities, from, to),
2281            0x9d523295be53a0a,
2282            fidl::encoding::DynamicFlags::empty(),
2283            _decode,
2284        )
2285    }
2286
2287    type AddRouteFromDictionaryResponseFut = fidl::client::QueryResponseFut<
2288        RealmAddRouteFromDictionaryResult,
2289        fidl::encoding::DefaultFuchsiaResourceDialect,
2290    >;
2291    fn r#add_route_from_dictionary(
2292        &self,
2293        mut capabilities: &[Capability],
2294        mut from: &fidl_fuchsia_component_decl::Ref,
2295        mut from_dictionary: &str,
2296        mut to: &[fidl_fuchsia_component_decl::Ref],
2297    ) -> Self::AddRouteFromDictionaryResponseFut {
2298        fn _decode(
2299            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2300        ) -> Result<RealmAddRouteFromDictionaryResult, fidl::Error> {
2301            let _response = fidl::client::decode_transaction_body::<
2302                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2303                fidl::encoding::DefaultFuchsiaResourceDialect,
2304                0x21fac42c3e1d14d2,
2305            >(_buf?)?;
2306            Ok(_response.map(|x| x))
2307        }
2308        self.client.send_query_and_decode::<
2309            RealmAddRouteFromDictionaryRequest,
2310            RealmAddRouteFromDictionaryResult,
2311        >(
2312            (capabilities, from, from_dictionary, to,),
2313            0x21fac42c3e1d14d2,
2314            fidl::encoding::DynamicFlags::empty(),
2315            _decode,
2316        )
2317    }
2318
2319    type ReadOnlyDirectoryResponseFut = fidl::client::QueryResponseFut<
2320        RealmReadOnlyDirectoryResult,
2321        fidl::encoding::DefaultFuchsiaResourceDialect,
2322    >;
2323    fn r#read_only_directory(
2324        &self,
2325        mut name: &str,
2326        mut to: &[fidl_fuchsia_component_decl::Ref],
2327        mut directory_contents: DirectoryContents,
2328    ) -> Self::ReadOnlyDirectoryResponseFut {
2329        fn _decode(
2330            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2331        ) -> Result<RealmReadOnlyDirectoryResult, fidl::Error> {
2332            let _response = fidl::client::decode_transaction_body::<
2333                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2334                fidl::encoding::DefaultFuchsiaResourceDialect,
2335                0x78a6d150a66e00dc,
2336            >(_buf?)?;
2337            Ok(_response.map(|x| x))
2338        }
2339        self.client
2340            .send_query_and_decode::<RealmReadOnlyDirectoryRequest, RealmReadOnlyDirectoryResult>(
2341                (name, to, &mut directory_contents),
2342                0x78a6d150a66e00dc,
2343                fidl::encoding::DynamicFlags::empty(),
2344                _decode,
2345            )
2346    }
2347
2348    type AddStorageResponseFut = fidl::client::QueryResponseFut<
2349        RealmAddStorageResult,
2350        fidl::encoding::DefaultFuchsiaResourceDialect,
2351    >;
2352    fn r#add_storage(
2353        &self,
2354        mut name: &str,
2355        mut to: &[fidl_fuchsia_component_decl::Ref],
2356        mut storage_admin: Option<
2357            fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>,
2358        >,
2359    ) -> Self::AddStorageResponseFut {
2360        fn _decode(
2361            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2362        ) -> Result<RealmAddStorageResult, fidl::Error> {
2363            let _response = fidl::client::decode_transaction_body::<
2364                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2365                fidl::encoding::DefaultFuchsiaResourceDialect,
2366                0x4709da0c9576b7c1,
2367            >(_buf?)?;
2368            Ok(_response.map(|x| x))
2369        }
2370        self.client.send_query_and_decode::<RealmAddStorageRequest, RealmAddStorageResult>(
2371            (name, to, storage_admin),
2372            0x4709da0c9576b7c1,
2373            fidl::encoding::DynamicFlags::empty(),
2374            _decode,
2375        )
2376    }
2377
2378    type InitMutableConfigFromPackageResponseFut = fidl::client::QueryResponseFut<
2379        RealmInitMutableConfigFromPackageResult,
2380        fidl::encoding::DefaultFuchsiaResourceDialect,
2381    >;
2382    fn r#init_mutable_config_from_package(
2383        &self,
2384        mut name: &str,
2385    ) -> Self::InitMutableConfigFromPackageResponseFut {
2386        fn _decode(
2387            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2388        ) -> Result<RealmInitMutableConfigFromPackageResult, fidl::Error> {
2389            let _response = fidl::client::decode_transaction_body::<
2390                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2391                fidl::encoding::DefaultFuchsiaResourceDialect,
2392                0x36a30c9837c64216,
2393            >(_buf?)?;
2394            Ok(_response.map(|x| x))
2395        }
2396        self.client.send_query_and_decode::<
2397            RealmInitMutableConfigFromPackageRequest,
2398            RealmInitMutableConfigFromPackageResult,
2399        >(
2400            (name,),
2401            0x36a30c9837c64216,
2402            fidl::encoding::DynamicFlags::empty(),
2403            _decode,
2404        )
2405    }
2406
2407    type InitMutableConfigToEmptyResponseFut = fidl::client::QueryResponseFut<
2408        RealmInitMutableConfigToEmptyResult,
2409        fidl::encoding::DefaultFuchsiaResourceDialect,
2410    >;
2411    fn r#init_mutable_config_to_empty(
2412        &self,
2413        mut name: &str,
2414    ) -> Self::InitMutableConfigToEmptyResponseFut {
2415        fn _decode(
2416            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2417        ) -> Result<RealmInitMutableConfigToEmptyResult, fidl::Error> {
2418            let _response = fidl::client::decode_transaction_body::<
2419                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2420                fidl::encoding::DefaultFuchsiaResourceDialect,
2421                0x772cb99e2e0dccc5,
2422            >(_buf?)?;
2423            Ok(_response.map(|x| x))
2424        }
2425        self.client.send_query_and_decode::<
2426            RealmInitMutableConfigToEmptyRequest,
2427            RealmInitMutableConfigToEmptyResult,
2428        >(
2429            (name,),
2430            0x772cb99e2e0dccc5,
2431            fidl::encoding::DynamicFlags::empty(),
2432            _decode,
2433        )
2434    }
2435
2436    type AddCapabilityResponseFut = fidl::client::QueryResponseFut<
2437        RealmAddCapabilityResult,
2438        fidl::encoding::DefaultFuchsiaResourceDialect,
2439    >;
2440    fn r#add_capability(
2441        &self,
2442        mut capability: &fidl_fuchsia_component_decl::Capability,
2443    ) -> Self::AddCapabilityResponseFut {
2444        fn _decode(
2445            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2446        ) -> Result<RealmAddCapabilityResult, fidl::Error> {
2447            let _response = fidl::client::decode_transaction_body::<
2448                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2449                fidl::encoding::DefaultFuchsiaResourceDialect,
2450                0x23a6499eb6080249,
2451            >(_buf?)?;
2452            Ok(_response.map(|x| x))
2453        }
2454        self.client.send_query_and_decode::<RealmAddCapabilityRequest, RealmAddCapabilityResult>(
2455            (capability,),
2456            0x23a6499eb6080249,
2457            fidl::encoding::DynamicFlags::empty(),
2458            _decode,
2459        )
2460    }
2461
2462    type AddCollectionResponseFut = fidl::client::QueryResponseFut<
2463        RealmAddCollectionResult,
2464        fidl::encoding::DefaultFuchsiaResourceDialect,
2465    >;
2466    fn r#add_collection(
2467        &self,
2468        mut collection: &fidl_fuchsia_component_decl::Collection,
2469    ) -> Self::AddCollectionResponseFut {
2470        fn _decode(
2471            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2472        ) -> Result<RealmAddCollectionResult, fidl::Error> {
2473            let _response = fidl::client::decode_transaction_body::<
2474                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2475                fidl::encoding::DefaultFuchsiaResourceDialect,
2476                0x56b75210a03a99b5,
2477            >(_buf?)?;
2478            Ok(_response.map(|x| x))
2479        }
2480        self.client.send_query_and_decode::<RealmAddCollectionRequest, RealmAddCollectionResult>(
2481            (collection,),
2482            0x56b75210a03a99b5,
2483            fidl::encoding::DynamicFlags::empty(),
2484            _decode,
2485        )
2486    }
2487
2488    type AddEnvironmentResponseFut = fidl::client::QueryResponseFut<
2489        RealmAddEnvironmentResult,
2490        fidl::encoding::DefaultFuchsiaResourceDialect,
2491    >;
2492    fn r#add_environment(
2493        &self,
2494        mut environment: &fidl_fuchsia_component_decl::Environment,
2495    ) -> Self::AddEnvironmentResponseFut {
2496        fn _decode(
2497            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2498        ) -> Result<RealmAddEnvironmentResult, fidl::Error> {
2499            let _response = fidl::client::decode_transaction_body::<
2500                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2501                fidl::encoding::DefaultFuchsiaResourceDialect,
2502                0x1cd7caefa2cce0e9,
2503            >(_buf?)?;
2504            Ok(_response.map(|x| x))
2505        }
2506        self.client.send_query_and_decode::<RealmAddEnvironmentRequest, RealmAddEnvironmentResult>(
2507            (environment,),
2508            0x1cd7caefa2cce0e9,
2509            fidl::encoding::DynamicFlags::empty(),
2510            _decode,
2511        )
2512    }
2513
2514    type SetConfigValueResponseFut = fidl::client::QueryResponseFut<
2515        RealmSetConfigValueResult,
2516        fidl::encoding::DefaultFuchsiaResourceDialect,
2517    >;
2518    fn r#set_config_value(
2519        &self,
2520        mut name: &str,
2521        mut key: &str,
2522        mut value: &fidl_fuchsia_component_decl::ConfigValueSpec,
2523    ) -> Self::SetConfigValueResponseFut {
2524        fn _decode(
2525            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2526        ) -> Result<RealmSetConfigValueResult, fidl::Error> {
2527            let _response = fidl::client::decode_transaction_body::<
2528                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
2529                fidl::encoding::DefaultFuchsiaResourceDialect,
2530                0x886450d291217f2,
2531            >(_buf?)?;
2532            Ok(_response.map(|x| x))
2533        }
2534        self.client.send_query_and_decode::<RealmSetConfigValueRequest, RealmSetConfigValueResult>(
2535            (name, key, value),
2536            0x886450d291217f2,
2537            fidl::encoding::DynamicFlags::empty(),
2538            _decode,
2539        )
2540    }
2541}
2542
2543pub struct RealmEventStream {
2544    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2545}
2546
2547impl std::marker::Unpin for RealmEventStream {}
2548
2549impl futures::stream::FusedStream for RealmEventStream {
2550    fn is_terminated(&self) -> bool {
2551        self.event_receiver.is_terminated()
2552    }
2553}
2554
2555impl futures::Stream for RealmEventStream {
2556    type Item = Result<RealmEvent, fidl::Error>;
2557
2558    fn poll_next(
2559        mut self: std::pin::Pin<&mut Self>,
2560        cx: &mut std::task::Context<'_>,
2561    ) -> std::task::Poll<Option<Self::Item>> {
2562        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2563            &mut self.event_receiver,
2564            cx
2565        )?) {
2566            Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
2567            None => std::task::Poll::Ready(None),
2568        }
2569    }
2570}
2571
2572#[derive(Debug)]
2573pub enum RealmEvent {}
2574
2575impl RealmEvent {
2576    /// Decodes a message buffer as a [`RealmEvent`].
2577    fn decode(
2578        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2579    ) -> Result<RealmEvent, fidl::Error> {
2580        let (bytes, _handles) = buf.split_mut();
2581        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2582        debug_assert_eq!(tx_header.tx_id, 0);
2583        match tx_header.ordinal {
2584            _ => Err(fidl::Error::UnknownOrdinal {
2585                ordinal: tx_header.ordinal,
2586                protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2587            }),
2588        }
2589    }
2590}
2591
2592/// A Stream of incoming requests for fuchsia.component.test/Realm.
2593pub struct RealmRequestStream {
2594    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2595    is_terminated: bool,
2596}
2597
2598impl std::marker::Unpin for RealmRequestStream {}
2599
2600impl futures::stream::FusedStream for RealmRequestStream {
2601    fn is_terminated(&self) -> bool {
2602        self.is_terminated
2603    }
2604}
2605
2606impl fidl::endpoints::RequestStream for RealmRequestStream {
2607    type Protocol = RealmMarker;
2608    type ControlHandle = RealmControlHandle;
2609
2610    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2611        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2612    }
2613
2614    fn control_handle(&self) -> Self::ControlHandle {
2615        RealmControlHandle { inner: self.inner.clone() }
2616    }
2617
2618    fn into_inner(
2619        self,
2620    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2621    {
2622        (self.inner, self.is_terminated)
2623    }
2624
2625    fn from_inner(
2626        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2627        is_terminated: bool,
2628    ) -> Self {
2629        Self { inner, is_terminated }
2630    }
2631}
2632
2633impl futures::Stream for RealmRequestStream {
2634    type Item = Result<RealmRequest, fidl::Error>;
2635
2636    fn poll_next(
2637        mut self: std::pin::Pin<&mut Self>,
2638        cx: &mut std::task::Context<'_>,
2639    ) -> std::task::Poll<Option<Self::Item>> {
2640        let this = &mut *self;
2641        if this.inner.check_shutdown(cx) {
2642            this.is_terminated = true;
2643            return std::task::Poll::Ready(None);
2644        }
2645        if this.is_terminated {
2646            panic!("polled RealmRequestStream after completion");
2647        }
2648        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2649            |bytes, handles| {
2650                match this.inner.channel().read_etc(cx, bytes, handles) {
2651                    std::task::Poll::Ready(Ok(())) => {}
2652                    std::task::Poll::Pending => return std::task::Poll::Pending,
2653                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2654                        this.is_terminated = true;
2655                        return std::task::Poll::Ready(None);
2656                    }
2657                    std::task::Poll::Ready(Err(e)) => {
2658                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2659                            e.into(),
2660                        ))));
2661                    }
2662                }
2663
2664                // A message has been received from the channel
2665                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2666
2667                std::task::Poll::Ready(Some(match header.ordinal {
2668                    0x3f6c07627303d801 => {
2669                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2670                        let mut req = fidl::new_empty!(
2671                            RealmAddChildRequest,
2672                            fidl::encoding::DefaultFuchsiaResourceDialect
2673                        );
2674                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddChildRequest>(&header, _body_bytes, handles, &mut req)?;
2675                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2676                        Ok(RealmRequest::AddChild {
2677                            name: req.name,
2678                            url: req.url,
2679                            options: req.options,
2680
2681                            responder: RealmAddChildResponder {
2682                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2683                                tx_id: header.tx_id,
2684                            },
2685                        })
2686                    }
2687                    0x3950ad500258156d => {
2688                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2689                        let mut req = fidl::new_empty!(
2690                            RealmAddChildFromDeclRequest,
2691                            fidl::encoding::DefaultFuchsiaResourceDialect
2692                        );
2693                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddChildFromDeclRequest>(&header, _body_bytes, handles, &mut req)?;
2694                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2695                        Ok(RealmRequest::AddChildFromDecl {
2696                            name: req.name,
2697                            decl: req.decl,
2698                            options: req.options,
2699
2700                            responder: RealmAddChildFromDeclResponder {
2701                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2702                                tx_id: header.tx_id,
2703                            },
2704                        })
2705                    }
2706                    0x3249817bae10abbb => {
2707                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2708                        let mut req = fidl::new_empty!(
2709                            RealmAddLocalChildRequest,
2710                            fidl::encoding::DefaultFuchsiaResourceDialect
2711                        );
2712                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddLocalChildRequest>(&header, _body_bytes, handles, &mut req)?;
2713                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2714                        Ok(RealmRequest::AddLocalChild {
2715                            name: req.name,
2716                            options: req.options,
2717
2718                            responder: RealmAddLocalChildResponder {
2719                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2720                                tx_id: header.tx_id,
2721                            },
2722                        })
2723                    }
2724                    0x3fdf98db373b9458 => {
2725                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2726                        let mut req = fidl::new_empty!(
2727                            RealmAddChildRealmRequest,
2728                            fidl::encoding::DefaultFuchsiaResourceDialect
2729                        );
2730                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddChildRealmRequest>(&header, _body_bytes, handles, &mut req)?;
2731                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2732                        Ok(RealmRequest::AddChildRealm {
2733                            name: req.name,
2734                            options: req.options,
2735                            child_realm: req.child_realm,
2736
2737                            responder: RealmAddChildRealmResponder {
2738                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2739                                tx_id: header.tx_id,
2740                            },
2741                        })
2742                    }
2743                    0x44c34c8dcbe06abb => {
2744                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2745                        let mut req = fidl::new_empty!(
2746                            RealmAddChildRealmFromRelativeUrlRequest,
2747                            fidl::encoding::DefaultFuchsiaResourceDialect
2748                        );
2749                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddChildRealmFromRelativeUrlRequest>(&header, _body_bytes, handles, &mut req)?;
2750                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2751                        Ok(RealmRequest::AddChildRealmFromRelativeUrl {
2752                            name: req.name,
2753                            relative_url: req.relative_url,
2754                            options: req.options,
2755                            child_realm: req.child_realm,
2756
2757                            responder: RealmAddChildRealmFromRelativeUrlResponder {
2758                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2759                                tx_id: header.tx_id,
2760                            },
2761                        })
2762                    }
2763                    0x142e5c326732862e => {
2764                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2765                        let mut req = fidl::new_empty!(
2766                            RealmAddChildRealmFromDeclRequest,
2767                            fidl::encoding::DefaultFuchsiaResourceDialect
2768                        );
2769                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddChildRealmFromDeclRequest>(&header, _body_bytes, handles, &mut req)?;
2770                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2771                        Ok(RealmRequest::AddChildRealmFromDecl {
2772                            name: req.name,
2773                            decl: req.decl,
2774                            options: req.options,
2775                            child_realm: req.child_realm,
2776
2777                            responder: RealmAddChildRealmFromDeclResponder {
2778                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2779                                tx_id: header.tx_id,
2780                            },
2781                        })
2782                    }
2783                    0x320832af6a4cbac6 => {
2784                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2785                        let mut req = fidl::new_empty!(
2786                            RealmGetComponentDeclRequest,
2787                            fidl::encoding::DefaultFuchsiaResourceDialect
2788                        );
2789                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmGetComponentDeclRequest>(&header, _body_bytes, handles, &mut req)?;
2790                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2791                        Ok(RealmRequest::GetComponentDecl {
2792                            name: req.name,
2793
2794                            responder: RealmGetComponentDeclResponder {
2795                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2796                                tx_id: header.tx_id,
2797                            },
2798                        })
2799                    }
2800                    0x59cecf31b314cd5f => {
2801                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2802                        let mut req = fidl::new_empty!(
2803                            RealmReplaceComponentDeclRequest,
2804                            fidl::encoding::DefaultFuchsiaResourceDialect
2805                        );
2806                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmReplaceComponentDeclRequest>(&header, _body_bytes, handles, &mut req)?;
2807                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2808                        Ok(RealmRequest::ReplaceComponentDecl {
2809                            name: req.name,
2810                            component_decl: req.component_decl,
2811
2812                            responder: RealmReplaceComponentDeclResponder {
2813                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2814                                tx_id: header.tx_id,
2815                            },
2816                        })
2817                    }
2818                    0x46fa05b17bd64269 => {
2819                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2820                        let mut req = fidl::new_empty!(
2821                            fidl::encoding::EmptyPayload,
2822                            fidl::encoding::DefaultFuchsiaResourceDialect
2823                        );
2824                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2825                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2826                        Ok(RealmRequest::GetRealmDecl {
2827                            responder: RealmGetRealmDeclResponder {
2828                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2829                                tx_id: header.tx_id,
2830                            },
2831                        })
2832                    }
2833                    0x48fcba4ac1338da9 => {
2834                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2835                        let mut req = fidl::new_empty!(
2836                            RealmReplaceRealmDeclRequest,
2837                            fidl::encoding::DefaultFuchsiaResourceDialect
2838                        );
2839                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmReplaceRealmDeclRequest>(&header, _body_bytes, handles, &mut req)?;
2840                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2841                        Ok(RealmRequest::ReplaceRealmDecl {
2842                            component_decl: req.component_decl,
2843
2844                            responder: RealmReplaceRealmDeclResponder {
2845                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2846                                tx_id: header.tx_id,
2847                            },
2848                        })
2849                    }
2850                    0x64bd27482f3dcc => {
2851                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2852                        let mut req = fidl::new_empty!(
2853                            RealmUseNestedComponentManagerRequest,
2854                            fidl::encoding::DefaultFuchsiaResourceDialect
2855                        );
2856                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmUseNestedComponentManagerRequest>(&header, _body_bytes, handles, &mut req)?;
2857                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2858                        Ok(RealmRequest::UseNestedComponentManager {
2859                            component_manager_relative_url: req.component_manager_relative_url,
2860
2861                            responder: RealmUseNestedComponentManagerResponder {
2862                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2863                                tx_id: header.tx_id,
2864                            },
2865                        })
2866                    }
2867                    0x9d523295be53a0a => {
2868                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2869                        let mut req = fidl::new_empty!(
2870                            RealmAddRouteRequest,
2871                            fidl::encoding::DefaultFuchsiaResourceDialect
2872                        );
2873                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2874                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2875                        Ok(RealmRequest::AddRoute {
2876                            capabilities: req.capabilities,
2877                            from: req.from,
2878                            to: req.to,
2879
2880                            responder: RealmAddRouteResponder {
2881                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2882                                tx_id: header.tx_id,
2883                            },
2884                        })
2885                    }
2886                    0x21fac42c3e1d14d2 => {
2887                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2888                        let mut req = fidl::new_empty!(
2889                            RealmAddRouteFromDictionaryRequest,
2890                            fidl::encoding::DefaultFuchsiaResourceDialect
2891                        );
2892                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddRouteFromDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
2893                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2894                        Ok(RealmRequest::AddRouteFromDictionary {
2895                            capabilities: req.capabilities,
2896                            from: req.from,
2897                            from_dictionary: req.from_dictionary,
2898                            to: req.to,
2899
2900                            responder: RealmAddRouteFromDictionaryResponder {
2901                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2902                                tx_id: header.tx_id,
2903                            },
2904                        })
2905                    }
2906                    0x78a6d150a66e00dc => {
2907                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2908                        let mut req = fidl::new_empty!(
2909                            RealmReadOnlyDirectoryRequest,
2910                            fidl::encoding::DefaultFuchsiaResourceDialect
2911                        );
2912                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmReadOnlyDirectoryRequest>(&header, _body_bytes, handles, &mut req)?;
2913                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2914                        Ok(RealmRequest::ReadOnlyDirectory {
2915                            name: req.name,
2916                            to: req.to,
2917                            directory_contents: req.directory_contents,
2918
2919                            responder: RealmReadOnlyDirectoryResponder {
2920                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2921                                tx_id: header.tx_id,
2922                            },
2923                        })
2924                    }
2925                    0x4709da0c9576b7c1 => {
2926                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2927                        let mut req = fidl::new_empty!(
2928                            RealmAddStorageRequest,
2929                            fidl::encoding::DefaultFuchsiaResourceDialect
2930                        );
2931                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddStorageRequest>(&header, _body_bytes, handles, &mut req)?;
2932                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2933                        Ok(RealmRequest::AddStorage {
2934                            name: req.name,
2935                            to: req.to,
2936                            storage_admin: req.storage_admin,
2937
2938                            responder: RealmAddStorageResponder {
2939                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2940                                tx_id: header.tx_id,
2941                            },
2942                        })
2943                    }
2944                    0x36a30c9837c64216 => {
2945                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2946                        let mut req = fidl::new_empty!(
2947                            RealmInitMutableConfigFromPackageRequest,
2948                            fidl::encoding::DefaultFuchsiaResourceDialect
2949                        );
2950                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmInitMutableConfigFromPackageRequest>(&header, _body_bytes, handles, &mut req)?;
2951                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2952                        Ok(RealmRequest::InitMutableConfigFromPackage {
2953                            name: req.name,
2954
2955                            responder: RealmInitMutableConfigFromPackageResponder {
2956                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2957                                tx_id: header.tx_id,
2958                            },
2959                        })
2960                    }
2961                    0x772cb99e2e0dccc5 => {
2962                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2963                        let mut req = fidl::new_empty!(
2964                            RealmInitMutableConfigToEmptyRequest,
2965                            fidl::encoding::DefaultFuchsiaResourceDialect
2966                        );
2967                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmInitMutableConfigToEmptyRequest>(&header, _body_bytes, handles, &mut req)?;
2968                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2969                        Ok(RealmRequest::InitMutableConfigToEmpty {
2970                            name: req.name,
2971
2972                            responder: RealmInitMutableConfigToEmptyResponder {
2973                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2974                                tx_id: header.tx_id,
2975                            },
2976                        })
2977                    }
2978                    0x23a6499eb6080249 => {
2979                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2980                        let mut req = fidl::new_empty!(
2981                            RealmAddCapabilityRequest,
2982                            fidl::encoding::DefaultFuchsiaResourceDialect
2983                        );
2984                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddCapabilityRequest>(&header, _body_bytes, handles, &mut req)?;
2985                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
2986                        Ok(RealmRequest::AddCapability {
2987                            capability: req.capability,
2988
2989                            responder: RealmAddCapabilityResponder {
2990                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2991                                tx_id: header.tx_id,
2992                            },
2993                        })
2994                    }
2995                    0x56b75210a03a99b5 => {
2996                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2997                        let mut req = fidl::new_empty!(
2998                            RealmAddCollectionRequest,
2999                            fidl::encoding::DefaultFuchsiaResourceDialect
3000                        );
3001                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
3002                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
3003                        Ok(RealmRequest::AddCollection {
3004                            collection: req.collection,
3005
3006                            responder: RealmAddCollectionResponder {
3007                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3008                                tx_id: header.tx_id,
3009                            },
3010                        })
3011                    }
3012                    0x1cd7caefa2cce0e9 => {
3013                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3014                        let mut req = fidl::new_empty!(
3015                            RealmAddEnvironmentRequest,
3016                            fidl::encoding::DefaultFuchsiaResourceDialect
3017                        );
3018                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmAddEnvironmentRequest>(&header, _body_bytes, handles, &mut req)?;
3019                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
3020                        Ok(RealmRequest::AddEnvironment {
3021                            environment: req.environment,
3022
3023                            responder: RealmAddEnvironmentResponder {
3024                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3025                                tx_id: header.tx_id,
3026                            },
3027                        })
3028                    }
3029                    0x886450d291217f2 => {
3030                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3031                        let mut req = fidl::new_empty!(
3032                            RealmSetConfigValueRequest,
3033                            fidl::encoding::DefaultFuchsiaResourceDialect
3034                        );
3035                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmSetConfigValueRequest>(&header, _body_bytes, handles, &mut req)?;
3036                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
3037                        Ok(RealmRequest::SetConfigValue {
3038                            name: req.name,
3039                            key: req.key,
3040                            value: req.value,
3041
3042                            responder: RealmSetConfigValueResponder {
3043                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3044                                tx_id: header.tx_id,
3045                            },
3046                        })
3047                    }
3048                    _ => Err(fidl::Error::UnknownOrdinal {
3049                        ordinal: header.ordinal,
3050                        protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3051                    }),
3052                }))
3053            },
3054        )
3055    }
3056}
3057
3058#[derive(Debug)]
3059pub enum RealmRequest {
3060    /// Adds a component to the realm.
3061    ///
3062    /// The `url` can be in one of the following formats:
3063    ///
3064    /// - an absolute component URL (such as,
3065    ///   "fuchsia-pkg://fuchsia.com/some-package#meta/some-component.cm")
3066    /// - a relative path component URL to a subpackaged component (like,
3067    ///   "some-subpackage#meta/subpackaged-component.cm"); or
3068    /// - a relative fragment-only URL (like, `#meta/other-component.cm`;
3069    ///   see https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
3070    ///   indicating the path to a component manifest in the `pkg_dir` supplied
3071    ///   to `RealmBuilderFactory::Create*()`.
3072    ///
3073    /// The realm builder client typically passes a handle to its own `/pkg`
3074    /// directory, and bundles the `other-component` into the same package.
3075    ///
3076    /// Of the three URL types, _only_ component declarations added via the
3077    /// fragment-only URL can be modified, via
3078    /// `GetComponentDecl`/`ReplaceComponentDecl` because realm builder actually
3079    /// performs its own component resolution from the component's manifest and
3080    /// files bundled in the provided `pkg_dir` (typically from the package
3081    /// shared by the realm builder client component and the components added
3082    /// via fragment-only URL).
3083    ///
3084    /// Errors:
3085    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
3086    ///   given name.
3087    /// - `INVALID_MANIFEST_EXTENSION`: `url` does not end with `.cm`
3088    /// - `DECL_NOT_FOUND`: The test package does not contain the component
3089    ///   declaration referenced by a fragment-only component URL.
3090    /// - `DECL_READ_ERROR`: Encountered an I/O error when attempting to read a
3091    ///   component declaration referenced by a fragment-only component URL from
3092    ///   the test package.
3093    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3094    ///   for this realm, and thus this `Realm` channel can no longer be used.
3095    AddChild { name: String, url: String, options: ChildOptions, responder: RealmAddChildResponder },
3096    /// Adds a component to this realm whose declaration is set to `decl`. When
3097    /// launched, the component will share the test package as its package
3098    /// directory, and may access any resources from it.
3099    ///
3100    /// Errors:
3101    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
3102    ///   given name.
3103    /// - `INVALID_COMPONENT_DECL`: `decl` failed validation.
3104    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3105    ///   for this realm, and thus this `Realm` channel can no longer be used.
3106    AddChildFromDecl {
3107        name: String,
3108        decl: fidl_fuchsia_component_decl::Component,
3109        options: ChildOptions,
3110        responder: RealmAddChildFromDeclResponder,
3111    },
3112    /// Adds a component to the realm whose implementation will be provided by
3113    /// the client. When this component should be started, the runner channel
3114    /// passed into `Build` will receive a start request for a component whose
3115    /// `ProgramDecl` contains the moniker from the root of the
3116    /// constructed realm for the child that is to be run under the `program`
3117    /// key `LOCAL_COMPONENT_NAME`.
3118    ///
3119    /// Errors:
3120    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
3121    ///   given name.
3122    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3123    ///   for this realm, and thus this `Realm` channel can no longer be used.
3124    AddLocalChild { name: String, options: ChildOptions, responder: RealmAddLocalChildResponder },
3125    /// Adds a child realm which can be built with the client end of
3126    /// `child_realm`.
3127    ///
3128    /// Errors:
3129    /// - `CHILD_ALREADY_EXISTS`: this realm already contains a child with the
3130    ///   given name.
3131    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3132    ///   for this realm, and thus this `Realm` channel can no longer be used.
3133    AddChildRealm {
3134        name: String,
3135        options: ChildOptions,
3136        child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
3137        responder: RealmAddChildRealmResponder,
3138    },
3139    /// Adds a child realm which can be built with the client end of
3140    /// `child_realm`, and whose contents are initialized from `relative_url`.
3141    /// `relative_url` must be a fragment-only URL.
3142    AddChildRealmFromRelativeUrl {
3143        name: String,
3144        relative_url: String,
3145        options: ChildOptions,
3146        child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
3147        responder: RealmAddChildRealmFromRelativeUrlResponder,
3148    },
3149    /// Adds a child realm which can be built with the client end of
3150    /// `child_realm`, and whose contents are initialized from `decl`.
3151    AddChildRealmFromDecl {
3152        name: String,
3153        decl: fidl_fuchsia_component_decl::Component,
3154        options: ChildOptions,
3155        child_realm: fidl::endpoints::ServerEnd<RealmMarker>,
3156        responder: RealmAddChildRealmFromDeclResponder,
3157    },
3158    /// Returns the component decl for the given component. `name` must refer to
3159    /// a component that is one of the following:
3160    ///
3161    /// - A component with a local implementation
3162    /// - A legacy component
3163    /// - A component added with a fragment-only URL (typically, components
3164    ///   bundled in the same package as the realm builder client, sharing the
3165    ///   same `/pkg` directory, for example, `#meta/other-component.cm`; see
3166    ///   https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
3167    /// - An automatically generated realm (ex: the root)
3168    ///
3169    /// Errors:
3170    /// - `NO_SUCH_CHILD`: This realm does not contain a child with the given
3171    ///   name.
3172    /// - `CHILD_DECL_NOT_VISIBLE`: The component decl cannot be fetched for
3173    ///   the referenced child, because the child was added to the realm using
3174    ///   a modern (not legacy) absolute URL or subpackaged component's relative
3175    ///   path URL.
3176    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3177    ///   for this realm, and thus this `Realm` channel can no longer be used.
3178    GetComponentDecl { name: String, responder: RealmGetComponentDeclResponder },
3179    /// Replaces the component decl for the given component. `name` must
3180    /// refer to a component that is one of the following:
3181    ///
3182    /// - A component with a local implementation
3183    /// - A legacy component
3184    /// - A component added with a fragment-only URL (typically, components
3185    ///   bundled in the same package as the realm builder client, sharing the
3186    ///   same `/pkg` directory, for example, `#meta/other-component.cm`; see
3187    ///   https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only)
3188    /// - An automatically generated realm (ex: the root)
3189    ///
3190    /// Errors:
3191    /// - `NO_SUCH_CHILD`: This realm does not contain a child with the given
3192    ///   name.
3193    /// - `CHILD_ALREADY_EXISTS`: The component whose decl is being replaced has
3194    ///   had a child added to it through realm builder with the same name as an
3195    ///   element in `component_decl.children`.
3196    /// - `CHILD_DECL_NOT_VISIBLE`: The component decl cannot be manipulated for
3197    ///   the referenced child, because the child was added to the realm using
3198    ///   an absolute (not relative) and modern (not legacy) URL.
3199    /// - `INVALID_COMPONENT_DECL`: `component_decl` failed validation.
3200    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3201    ///   for this realm, and thus this `Realm` channel can no longer be used.
3202    ReplaceComponentDecl {
3203        name: String,
3204        component_decl: fidl_fuchsia_component_decl::Component,
3205        responder: RealmReplaceComponentDeclResponder,
3206    },
3207    /// Returns the component decl for this realm.
3208    ///
3209    /// Errors:
3210    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3211    ///   for this realm, and thus this `Realm` channel can no longer be used.
3212    GetRealmDecl { responder: RealmGetRealmDeclResponder },
3213    /// Replaces the component decl for this realm.
3214    ///
3215    /// Errors:
3216    /// - `INVALID_COMPONENT_DECL`: `component_decl` failed validation.
3217    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3218    ///   for this realm, and thus this `Realm` channel can no longer be used.
3219    ReplaceRealmDecl {
3220        component_decl: fidl_fuchsia_component_decl::Component,
3221        responder: RealmReplaceRealmDeclResponder,
3222    },
3223    /// Inform the realm builder server that this realm is using a nested component manager. It's
3224    /// expected that the client library has already replaced the realm's declaration with a
3225    /// passthrough component manager declaration, with the exception of the root url.
3226    /// This method will arrange for [Builder.Build] to install the realm's generated url as the
3227    /// root url in this component manager.
3228    UseNestedComponentManager {
3229        component_manager_relative_url: String,
3230        responder: RealmUseNestedComponentManagerResponder,
3231    },
3232    /// Identical to `AddRouteFromDictionary`, except it does not accept `from_dictionary` which
3233    /// it always sets to ".".
3234    AddRoute {
3235        capabilities: Vec<Capability>,
3236        from: fidl_fuchsia_component_decl::Ref,
3237        to: Vec<fidl_fuchsia_component_decl::Ref>,
3238        responder: RealmAddRouteResponder,
3239    },
3240    /// Mutates component manifests in the realm such that every component in
3241    /// `to` will have a valid capability route for each item in `capabilities`
3242    /// provided by `from`.
3243    ///
3244    /// Errors:
3245    /// - `NO_SUCH_SOURCE`: `from` references a non-existent child.
3246    /// - `NO_SUCH_TARGET`: `to` references a non-existent child.
3247    /// - `CAPABILITIES_EMPTY`: `capabilities` is empty.
3248    /// - `TARGETS_EMPTY`: `to` is empty.
3249    /// - `SOURCE_AND_TARGET_MATCH`: `from` is equal to one of the elements in
3250    ///   `to`.
3251    /// - `INVALID_COMPONENT_DECL`: The requested route caused one of the
3252    ///   involved manifests to fail validation.
3253    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3254    ///   for this realm, and thus this `Realm` channel can no longer be used.
3255    AddRouteFromDictionary {
3256        capabilities: Vec<Capability>,
3257        from: fidl_fuchsia_component_decl::Ref,
3258        from_dictionary: String,
3259        to: Vec<fidl_fuchsia_component_decl::Ref>,
3260        responder: RealmAddRouteFromDictionaryResponder,
3261    },
3262    /// Offers a directory capability to a component in this realm. The
3263    /// directory will be read-only (i.e. have `r*` rights), and will have the
3264    /// contents described in `directory_contents`.
3265    ///
3266    /// Errors:
3267    /// - `NO_SUCH_TARGET`: `offer-to` references a non-existent child.
3268    /// - `BUILD_ALREADY_CALLED`: The `Builder.Build` function has been called
3269    ///   for this realm, and thus this `Realm` channel can no longer be used.
3270    ReadOnlyDirectory {
3271        name: String,
3272        to: Vec<fidl_fuchsia_component_decl::Ref>,
3273        directory_contents: DirectoryContents,
3274        responder: RealmReadOnlyDirectoryResponder,
3275    },
3276    /// Creates and routes a new storage capability to the provided targets.
3277    /// Optionally can connect the provided channel the the
3278    /// `fuchsia.sys2.StorageAdmin` protocol for this storage capability.
3279    AddStorage {
3280        name: String,
3281        to: Vec<fidl_fuchsia_component_decl::Ref>,
3282        storage_admin:
3283            Option<fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>>,
3284        responder: RealmAddStorageResponder,
3285    },
3286    /// Load any packaged configuration for `name` before using values provided to
3287    /// the builder.
3288    ///
3289    /// Allows calling `SetConfigValue` to override packaged configuration.
3290    InitMutableConfigFromPackage {
3291        name: String,
3292        responder: RealmInitMutableConfigFromPackageResponder,
3293    },
3294    /// Use only values provided to the builder for `name`'s configuration.
3295    ///
3296    /// Allows calling `SetConfigValue` to provide configuration.
3297    InitMutableConfigToEmpty { name: String, responder: RealmInitMutableConfigToEmptyResponder },
3298    /// Add a capability to the realm.
3299    AddCapability {
3300        capability: fidl_fuchsia_component_decl::Capability,
3301        responder: RealmAddCapabilityResponder,
3302    },
3303    /// Adds a collection to the realm.
3304    AddCollection {
3305        collection: fidl_fuchsia_component_decl::Collection,
3306        responder: RealmAddCollectionResponder,
3307    },
3308    /// Adds an environment to the realm.
3309    AddEnvironment {
3310        environment: fidl_fuchsia_component_decl::Environment,
3311        responder: RealmAddEnvironmentResponder,
3312    },
3313    /// Sets the configuration value for a field specified by `key`.
3314    /// The component specified must have a config schema with this field.
3315    /// The value must conform to all constraints as defined by the schema.
3316    ///
3317    /// This method must be called after either `InitMutableConfigFromPackage` or
3318    /// `InitMutableConfigToEmpty`.
3319    ///
3320    /// Errors:
3321    /// - `NO_CONFIG_SCHEMA`: component does not have a config schema
3322    /// - `NO_SUCH_CONFIG_FIELD`: `key` could not be found in component's config schema
3323    /// - `CONFIG_VALUE_INVALID`: `value` does not meet config schema constraints
3324    SetConfigValue {
3325        name: String,
3326        key: String,
3327        value: fidl_fuchsia_component_decl::ConfigValueSpec,
3328        responder: RealmSetConfigValueResponder,
3329    },
3330}
3331
3332impl RealmRequest {
3333    #[allow(irrefutable_let_patterns)]
3334    pub fn into_add_child(self) -> Option<(String, String, ChildOptions, RealmAddChildResponder)> {
3335        if let RealmRequest::AddChild { name, url, options, responder } = self {
3336            Some((name, url, options, responder))
3337        } else {
3338            None
3339        }
3340    }
3341
3342    #[allow(irrefutable_let_patterns)]
3343    pub fn into_add_child_from_decl(
3344        self,
3345    ) -> Option<(
3346        String,
3347        fidl_fuchsia_component_decl::Component,
3348        ChildOptions,
3349        RealmAddChildFromDeclResponder,
3350    )> {
3351        if let RealmRequest::AddChildFromDecl { name, decl, options, responder } = self {
3352            Some((name, decl, options, responder))
3353        } else {
3354            None
3355        }
3356    }
3357
3358    #[allow(irrefutable_let_patterns)]
3359    pub fn into_add_local_child(
3360        self,
3361    ) -> Option<(String, ChildOptions, RealmAddLocalChildResponder)> {
3362        if let RealmRequest::AddLocalChild { name, options, responder } = self {
3363            Some((name, options, responder))
3364        } else {
3365            None
3366        }
3367    }
3368
3369    #[allow(irrefutable_let_patterns)]
3370    pub fn into_add_child_realm(
3371        self,
3372    ) -> Option<(
3373        String,
3374        ChildOptions,
3375        fidl::endpoints::ServerEnd<RealmMarker>,
3376        RealmAddChildRealmResponder,
3377    )> {
3378        if let RealmRequest::AddChildRealm { name, options, child_realm, responder } = self {
3379            Some((name, options, child_realm, responder))
3380        } else {
3381            None
3382        }
3383    }
3384
3385    #[allow(irrefutable_let_patterns)]
3386    pub fn into_add_child_realm_from_relative_url(
3387        self,
3388    ) -> Option<(
3389        String,
3390        String,
3391        ChildOptions,
3392        fidl::endpoints::ServerEnd<RealmMarker>,
3393        RealmAddChildRealmFromRelativeUrlResponder,
3394    )> {
3395        if let RealmRequest::AddChildRealmFromRelativeUrl {
3396            name,
3397            relative_url,
3398            options,
3399            child_realm,
3400            responder,
3401        } = self
3402        {
3403            Some((name, relative_url, options, child_realm, responder))
3404        } else {
3405            None
3406        }
3407    }
3408
3409    #[allow(irrefutable_let_patterns)]
3410    pub fn into_add_child_realm_from_decl(
3411        self,
3412    ) -> Option<(
3413        String,
3414        fidl_fuchsia_component_decl::Component,
3415        ChildOptions,
3416        fidl::endpoints::ServerEnd<RealmMarker>,
3417        RealmAddChildRealmFromDeclResponder,
3418    )> {
3419        if let RealmRequest::AddChildRealmFromDecl { name, decl, options, child_realm, responder } =
3420            self
3421        {
3422            Some((name, decl, options, child_realm, responder))
3423        } else {
3424            None
3425        }
3426    }
3427
3428    #[allow(irrefutable_let_patterns)]
3429    pub fn into_get_component_decl(self) -> Option<(String, RealmGetComponentDeclResponder)> {
3430        if let RealmRequest::GetComponentDecl { name, responder } = self {
3431            Some((name, responder))
3432        } else {
3433            None
3434        }
3435    }
3436
3437    #[allow(irrefutable_let_patterns)]
3438    pub fn into_replace_component_decl(
3439        self,
3440    ) -> Option<(String, fidl_fuchsia_component_decl::Component, RealmReplaceComponentDeclResponder)>
3441    {
3442        if let RealmRequest::ReplaceComponentDecl { name, component_decl, responder } = self {
3443            Some((name, component_decl, responder))
3444        } else {
3445            None
3446        }
3447    }
3448
3449    #[allow(irrefutable_let_patterns)]
3450    pub fn into_get_realm_decl(self) -> Option<(RealmGetRealmDeclResponder)> {
3451        if let RealmRequest::GetRealmDecl { responder } = self { Some((responder)) } else { None }
3452    }
3453
3454    #[allow(irrefutable_let_patterns)]
3455    pub fn into_replace_realm_decl(
3456        self,
3457    ) -> Option<(fidl_fuchsia_component_decl::Component, RealmReplaceRealmDeclResponder)> {
3458        if let RealmRequest::ReplaceRealmDecl { component_decl, responder } = self {
3459            Some((component_decl, responder))
3460        } else {
3461            None
3462        }
3463    }
3464
3465    #[allow(irrefutable_let_patterns)]
3466    pub fn into_use_nested_component_manager(
3467        self,
3468    ) -> Option<(String, RealmUseNestedComponentManagerResponder)> {
3469        if let RealmRequest::UseNestedComponentManager {
3470            component_manager_relative_url,
3471            responder,
3472        } = self
3473        {
3474            Some((component_manager_relative_url, responder))
3475        } else {
3476            None
3477        }
3478    }
3479
3480    #[allow(irrefutable_let_patterns)]
3481    pub fn into_add_route(
3482        self,
3483    ) -> Option<(
3484        Vec<Capability>,
3485        fidl_fuchsia_component_decl::Ref,
3486        Vec<fidl_fuchsia_component_decl::Ref>,
3487        RealmAddRouteResponder,
3488    )> {
3489        if let RealmRequest::AddRoute { capabilities, from, to, responder } = self {
3490            Some((capabilities, from, to, responder))
3491        } else {
3492            None
3493        }
3494    }
3495
3496    #[allow(irrefutable_let_patterns)]
3497    pub fn into_add_route_from_dictionary(
3498        self,
3499    ) -> Option<(
3500        Vec<Capability>,
3501        fidl_fuchsia_component_decl::Ref,
3502        String,
3503        Vec<fidl_fuchsia_component_decl::Ref>,
3504        RealmAddRouteFromDictionaryResponder,
3505    )> {
3506        if let RealmRequest::AddRouteFromDictionary {
3507            capabilities,
3508            from,
3509            from_dictionary,
3510            to,
3511            responder,
3512        } = self
3513        {
3514            Some((capabilities, from, from_dictionary, to, responder))
3515        } else {
3516            None
3517        }
3518    }
3519
3520    #[allow(irrefutable_let_patterns)]
3521    pub fn into_read_only_directory(
3522        self,
3523    ) -> Option<(
3524        String,
3525        Vec<fidl_fuchsia_component_decl::Ref>,
3526        DirectoryContents,
3527        RealmReadOnlyDirectoryResponder,
3528    )> {
3529        if let RealmRequest::ReadOnlyDirectory { name, to, directory_contents, responder } = self {
3530            Some((name, to, directory_contents, responder))
3531        } else {
3532            None
3533        }
3534    }
3535
3536    #[allow(irrefutable_let_patterns)]
3537    pub fn into_add_storage(
3538        self,
3539    ) -> Option<(
3540        String,
3541        Vec<fidl_fuchsia_component_decl::Ref>,
3542        Option<fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>>,
3543        RealmAddStorageResponder,
3544    )> {
3545        if let RealmRequest::AddStorage { name, to, storage_admin, responder } = self {
3546            Some((name, to, storage_admin, responder))
3547        } else {
3548            None
3549        }
3550    }
3551
3552    #[allow(irrefutable_let_patterns)]
3553    pub fn into_init_mutable_config_from_package(
3554        self,
3555    ) -> Option<(String, RealmInitMutableConfigFromPackageResponder)> {
3556        if let RealmRequest::InitMutableConfigFromPackage { name, responder } = self {
3557            Some((name, responder))
3558        } else {
3559            None
3560        }
3561    }
3562
3563    #[allow(irrefutable_let_patterns)]
3564    pub fn into_init_mutable_config_to_empty(
3565        self,
3566    ) -> Option<(String, RealmInitMutableConfigToEmptyResponder)> {
3567        if let RealmRequest::InitMutableConfigToEmpty { name, responder } = self {
3568            Some((name, responder))
3569        } else {
3570            None
3571        }
3572    }
3573
3574    #[allow(irrefutable_let_patterns)]
3575    pub fn into_add_capability(
3576        self,
3577    ) -> Option<(fidl_fuchsia_component_decl::Capability, RealmAddCapabilityResponder)> {
3578        if let RealmRequest::AddCapability { capability, responder } = self {
3579            Some((capability, responder))
3580        } else {
3581            None
3582        }
3583    }
3584
3585    #[allow(irrefutable_let_patterns)]
3586    pub fn into_add_collection(
3587        self,
3588    ) -> Option<(fidl_fuchsia_component_decl::Collection, RealmAddCollectionResponder)> {
3589        if let RealmRequest::AddCollection { collection, responder } = self {
3590            Some((collection, responder))
3591        } else {
3592            None
3593        }
3594    }
3595
3596    #[allow(irrefutable_let_patterns)]
3597    pub fn into_add_environment(
3598        self,
3599    ) -> Option<(fidl_fuchsia_component_decl::Environment, RealmAddEnvironmentResponder)> {
3600        if let RealmRequest::AddEnvironment { environment, responder } = self {
3601            Some((environment, responder))
3602        } else {
3603            None
3604        }
3605    }
3606
3607    #[allow(irrefutable_let_patterns)]
3608    pub fn into_set_config_value(
3609        self,
3610    ) -> Option<(
3611        String,
3612        String,
3613        fidl_fuchsia_component_decl::ConfigValueSpec,
3614        RealmSetConfigValueResponder,
3615    )> {
3616        if let RealmRequest::SetConfigValue { name, key, value, responder } = self {
3617            Some((name, key, value, responder))
3618        } else {
3619            None
3620        }
3621    }
3622
3623    /// Name of the method defined in FIDL
3624    pub fn method_name(&self) -> &'static str {
3625        match *self {
3626            RealmRequest::AddChild { .. } => "add_child",
3627            RealmRequest::AddChildFromDecl { .. } => "add_child_from_decl",
3628            RealmRequest::AddLocalChild { .. } => "add_local_child",
3629            RealmRequest::AddChildRealm { .. } => "add_child_realm",
3630            RealmRequest::AddChildRealmFromRelativeUrl { .. } => {
3631                "add_child_realm_from_relative_url"
3632            }
3633            RealmRequest::AddChildRealmFromDecl { .. } => "add_child_realm_from_decl",
3634            RealmRequest::GetComponentDecl { .. } => "get_component_decl",
3635            RealmRequest::ReplaceComponentDecl { .. } => "replace_component_decl",
3636            RealmRequest::GetRealmDecl { .. } => "get_realm_decl",
3637            RealmRequest::ReplaceRealmDecl { .. } => "replace_realm_decl",
3638            RealmRequest::UseNestedComponentManager { .. } => "use_nested_component_manager",
3639            RealmRequest::AddRoute { .. } => "add_route",
3640            RealmRequest::AddRouteFromDictionary { .. } => "add_route_from_dictionary",
3641            RealmRequest::ReadOnlyDirectory { .. } => "read_only_directory",
3642            RealmRequest::AddStorage { .. } => "add_storage",
3643            RealmRequest::InitMutableConfigFromPackage { .. } => "init_mutable_config_from_package",
3644            RealmRequest::InitMutableConfigToEmpty { .. } => "init_mutable_config_to_empty",
3645            RealmRequest::AddCapability { .. } => "add_capability",
3646            RealmRequest::AddCollection { .. } => "add_collection",
3647            RealmRequest::AddEnvironment { .. } => "add_environment",
3648            RealmRequest::SetConfigValue { .. } => "set_config_value",
3649        }
3650    }
3651}
3652
3653#[derive(Debug, Clone)]
3654pub struct RealmControlHandle {
3655    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3656}
3657
3658impl fidl::endpoints::ControlHandle for RealmControlHandle {
3659    fn shutdown(&self) {
3660        self.inner.shutdown()
3661    }
3662
3663    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3664        self.inner.shutdown_with_epitaph(status)
3665    }
3666
3667    fn is_closed(&self) -> bool {
3668        self.inner.channel().is_closed()
3669    }
3670    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3671        self.inner.channel().on_closed()
3672    }
3673
3674    #[cfg(target_os = "fuchsia")]
3675    fn signal_peer(
3676        &self,
3677        clear_mask: zx::Signals,
3678        set_mask: zx::Signals,
3679    ) -> Result<(), zx_status::Status> {
3680        use fidl::Peered;
3681        self.inner.channel().signal_peer(clear_mask, set_mask)
3682    }
3683}
3684
3685impl RealmControlHandle {}
3686
3687#[must_use = "FIDL methods require a response to be sent"]
3688#[derive(Debug)]
3689pub struct RealmAddChildResponder {
3690    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
3691    tx_id: u32,
3692}
3693
3694/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
3695/// if the responder is dropped without sending a response, so that the client
3696/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3697impl std::ops::Drop for RealmAddChildResponder {
3698    fn drop(&mut self) {
3699        self.control_handle.shutdown();
3700        // Safety: drops once, never accessed again
3701        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3702    }
3703}
3704
3705impl fidl::endpoints::Responder for RealmAddChildResponder {
3706    type ControlHandle = RealmControlHandle;
3707
3708    fn control_handle(&self) -> &RealmControlHandle {
3709        &self.control_handle
3710    }
3711
3712    fn drop_without_shutdown(mut self) {
3713        // Safety: drops once, never accessed again due to mem::forget
3714        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3715        // Prevent Drop from running (which would shut down the channel)
3716        std::mem::forget(self);
3717    }
3718}
3719
3720impl RealmAddChildResponder {
3721    /// Sends a response to the FIDL transaction.
3722    ///
3723    /// Sets the channel to shutdown if an error occurs.
3724    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
3725        let _result = self.send_raw(result);
3726        if _result.is_err() {
3727            self.control_handle.shutdown();
3728        }
3729        self.drop_without_shutdown();
3730        _result
3731    }
3732
3733    /// Similar to "send" but does not shutdown the channel if an error occurs.
3734    pub fn send_no_shutdown_on_err(
3735        self,
3736        mut result: Result<(), RealmBuilderError>,
3737    ) -> Result<(), fidl::Error> {
3738        let _result = self.send_raw(result);
3739        self.drop_without_shutdown();
3740        _result
3741    }
3742
3743    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
3744        self.control_handle.inner.send::<fidl::encoding::ResultType<
3745            fidl::encoding::EmptyStruct,
3746            RealmBuilderError,
3747        >>(
3748            result,
3749            self.tx_id,
3750            0x3f6c07627303d801,
3751            fidl::encoding::DynamicFlags::empty(),
3752        )
3753    }
3754}
3755
3756#[must_use = "FIDL methods require a response to be sent"]
3757#[derive(Debug)]
3758pub struct RealmAddChildFromDeclResponder {
3759    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
3760    tx_id: u32,
3761}
3762
3763/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
3764/// if the responder is dropped without sending a response, so that the client
3765/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3766impl std::ops::Drop for RealmAddChildFromDeclResponder {
3767    fn drop(&mut self) {
3768        self.control_handle.shutdown();
3769        // Safety: drops once, never accessed again
3770        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3771    }
3772}
3773
3774impl fidl::endpoints::Responder for RealmAddChildFromDeclResponder {
3775    type ControlHandle = RealmControlHandle;
3776
3777    fn control_handle(&self) -> &RealmControlHandle {
3778        &self.control_handle
3779    }
3780
3781    fn drop_without_shutdown(mut self) {
3782        // Safety: drops once, never accessed again due to mem::forget
3783        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3784        // Prevent Drop from running (which would shut down the channel)
3785        std::mem::forget(self);
3786    }
3787}
3788
3789impl RealmAddChildFromDeclResponder {
3790    /// Sends a response to the FIDL transaction.
3791    ///
3792    /// Sets the channel to shutdown if an error occurs.
3793    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
3794        let _result = self.send_raw(result);
3795        if _result.is_err() {
3796            self.control_handle.shutdown();
3797        }
3798        self.drop_without_shutdown();
3799        _result
3800    }
3801
3802    /// Similar to "send" but does not shutdown the channel if an error occurs.
3803    pub fn send_no_shutdown_on_err(
3804        self,
3805        mut result: Result<(), RealmBuilderError>,
3806    ) -> Result<(), fidl::Error> {
3807        let _result = self.send_raw(result);
3808        self.drop_without_shutdown();
3809        _result
3810    }
3811
3812    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
3813        self.control_handle.inner.send::<fidl::encoding::ResultType<
3814            fidl::encoding::EmptyStruct,
3815            RealmBuilderError,
3816        >>(
3817            result,
3818            self.tx_id,
3819            0x3950ad500258156d,
3820            fidl::encoding::DynamicFlags::empty(),
3821        )
3822    }
3823}
3824
3825#[must_use = "FIDL methods require a response to be sent"]
3826#[derive(Debug)]
3827pub struct RealmAddLocalChildResponder {
3828    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
3829    tx_id: u32,
3830}
3831
3832/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
3833/// if the responder is dropped without sending a response, so that the client
3834/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3835impl std::ops::Drop for RealmAddLocalChildResponder {
3836    fn drop(&mut self) {
3837        self.control_handle.shutdown();
3838        // Safety: drops once, never accessed again
3839        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3840    }
3841}
3842
3843impl fidl::endpoints::Responder for RealmAddLocalChildResponder {
3844    type ControlHandle = RealmControlHandle;
3845
3846    fn control_handle(&self) -> &RealmControlHandle {
3847        &self.control_handle
3848    }
3849
3850    fn drop_without_shutdown(mut self) {
3851        // Safety: drops once, never accessed again due to mem::forget
3852        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3853        // Prevent Drop from running (which would shut down the channel)
3854        std::mem::forget(self);
3855    }
3856}
3857
3858impl RealmAddLocalChildResponder {
3859    /// Sends a response to the FIDL transaction.
3860    ///
3861    /// Sets the channel to shutdown if an error occurs.
3862    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
3863        let _result = self.send_raw(result);
3864        if _result.is_err() {
3865            self.control_handle.shutdown();
3866        }
3867        self.drop_without_shutdown();
3868        _result
3869    }
3870
3871    /// Similar to "send" but does not shutdown the channel if an error occurs.
3872    pub fn send_no_shutdown_on_err(
3873        self,
3874        mut result: Result<(), RealmBuilderError>,
3875    ) -> Result<(), fidl::Error> {
3876        let _result = self.send_raw(result);
3877        self.drop_without_shutdown();
3878        _result
3879    }
3880
3881    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
3882        self.control_handle.inner.send::<fidl::encoding::ResultType<
3883            fidl::encoding::EmptyStruct,
3884            RealmBuilderError,
3885        >>(
3886            result,
3887            self.tx_id,
3888            0x3249817bae10abbb,
3889            fidl::encoding::DynamicFlags::empty(),
3890        )
3891    }
3892}
3893
3894#[must_use = "FIDL methods require a response to be sent"]
3895#[derive(Debug)]
3896pub struct RealmAddChildRealmResponder {
3897    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
3898    tx_id: u32,
3899}
3900
3901/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
3902/// if the responder is dropped without sending a response, so that the client
3903/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3904impl std::ops::Drop for RealmAddChildRealmResponder {
3905    fn drop(&mut self) {
3906        self.control_handle.shutdown();
3907        // Safety: drops once, never accessed again
3908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3909    }
3910}
3911
3912impl fidl::endpoints::Responder for RealmAddChildRealmResponder {
3913    type ControlHandle = RealmControlHandle;
3914
3915    fn control_handle(&self) -> &RealmControlHandle {
3916        &self.control_handle
3917    }
3918
3919    fn drop_without_shutdown(mut self) {
3920        // Safety: drops once, never accessed again due to mem::forget
3921        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3922        // Prevent Drop from running (which would shut down the channel)
3923        std::mem::forget(self);
3924    }
3925}
3926
3927impl RealmAddChildRealmResponder {
3928    /// Sends a response to the FIDL transaction.
3929    ///
3930    /// Sets the channel to shutdown if an error occurs.
3931    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
3932        let _result = self.send_raw(result);
3933        if _result.is_err() {
3934            self.control_handle.shutdown();
3935        }
3936        self.drop_without_shutdown();
3937        _result
3938    }
3939
3940    /// Similar to "send" but does not shutdown the channel if an error occurs.
3941    pub fn send_no_shutdown_on_err(
3942        self,
3943        mut result: Result<(), RealmBuilderError>,
3944    ) -> Result<(), fidl::Error> {
3945        let _result = self.send_raw(result);
3946        self.drop_without_shutdown();
3947        _result
3948    }
3949
3950    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
3951        self.control_handle.inner.send::<fidl::encoding::ResultType<
3952            fidl::encoding::EmptyStruct,
3953            RealmBuilderError,
3954        >>(
3955            result,
3956            self.tx_id,
3957            0x3fdf98db373b9458,
3958            fidl::encoding::DynamicFlags::empty(),
3959        )
3960    }
3961}
3962
3963#[must_use = "FIDL methods require a response to be sent"]
3964#[derive(Debug)]
3965pub struct RealmAddChildRealmFromRelativeUrlResponder {
3966    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
3967    tx_id: u32,
3968}
3969
3970/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
3971/// if the responder is dropped without sending a response, so that the client
3972/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3973impl std::ops::Drop for RealmAddChildRealmFromRelativeUrlResponder {
3974    fn drop(&mut self) {
3975        self.control_handle.shutdown();
3976        // Safety: drops once, never accessed again
3977        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3978    }
3979}
3980
3981impl fidl::endpoints::Responder for RealmAddChildRealmFromRelativeUrlResponder {
3982    type ControlHandle = RealmControlHandle;
3983
3984    fn control_handle(&self) -> &RealmControlHandle {
3985        &self.control_handle
3986    }
3987
3988    fn drop_without_shutdown(mut self) {
3989        // Safety: drops once, never accessed again due to mem::forget
3990        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3991        // Prevent Drop from running (which would shut down the channel)
3992        std::mem::forget(self);
3993    }
3994}
3995
3996impl RealmAddChildRealmFromRelativeUrlResponder {
3997    /// Sends a response to the FIDL transaction.
3998    ///
3999    /// Sets the channel to shutdown if an error occurs.
4000    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4001        let _result = self.send_raw(result);
4002        if _result.is_err() {
4003            self.control_handle.shutdown();
4004        }
4005        self.drop_without_shutdown();
4006        _result
4007    }
4008
4009    /// Similar to "send" but does not shutdown the channel if an error occurs.
4010    pub fn send_no_shutdown_on_err(
4011        self,
4012        mut result: Result<(), RealmBuilderError>,
4013    ) -> Result<(), fidl::Error> {
4014        let _result = self.send_raw(result);
4015        self.drop_without_shutdown();
4016        _result
4017    }
4018
4019    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4020        self.control_handle.inner.send::<fidl::encoding::ResultType<
4021            fidl::encoding::EmptyStruct,
4022            RealmBuilderError,
4023        >>(
4024            result,
4025            self.tx_id,
4026            0x44c34c8dcbe06abb,
4027            fidl::encoding::DynamicFlags::empty(),
4028        )
4029    }
4030}
4031
4032#[must_use = "FIDL methods require a response to be sent"]
4033#[derive(Debug)]
4034pub struct RealmAddChildRealmFromDeclResponder {
4035    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4036    tx_id: u32,
4037}
4038
4039/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4040/// if the responder is dropped without sending a response, so that the client
4041/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4042impl std::ops::Drop for RealmAddChildRealmFromDeclResponder {
4043    fn drop(&mut self) {
4044        self.control_handle.shutdown();
4045        // Safety: drops once, never accessed again
4046        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4047    }
4048}
4049
4050impl fidl::endpoints::Responder for RealmAddChildRealmFromDeclResponder {
4051    type ControlHandle = RealmControlHandle;
4052
4053    fn control_handle(&self) -> &RealmControlHandle {
4054        &self.control_handle
4055    }
4056
4057    fn drop_without_shutdown(mut self) {
4058        // Safety: drops once, never accessed again due to mem::forget
4059        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4060        // Prevent Drop from running (which would shut down the channel)
4061        std::mem::forget(self);
4062    }
4063}
4064
4065impl RealmAddChildRealmFromDeclResponder {
4066    /// Sends a response to the FIDL transaction.
4067    ///
4068    /// Sets the channel to shutdown if an error occurs.
4069    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4070        let _result = self.send_raw(result);
4071        if _result.is_err() {
4072            self.control_handle.shutdown();
4073        }
4074        self.drop_without_shutdown();
4075        _result
4076    }
4077
4078    /// Similar to "send" but does not shutdown the channel if an error occurs.
4079    pub fn send_no_shutdown_on_err(
4080        self,
4081        mut result: Result<(), RealmBuilderError>,
4082    ) -> Result<(), fidl::Error> {
4083        let _result = self.send_raw(result);
4084        self.drop_without_shutdown();
4085        _result
4086    }
4087
4088    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4089        self.control_handle.inner.send::<fidl::encoding::ResultType<
4090            fidl::encoding::EmptyStruct,
4091            RealmBuilderError,
4092        >>(
4093            result,
4094            self.tx_id,
4095            0x142e5c326732862e,
4096            fidl::encoding::DynamicFlags::empty(),
4097        )
4098    }
4099}
4100
4101#[must_use = "FIDL methods require a response to be sent"]
4102#[derive(Debug)]
4103pub struct RealmGetComponentDeclResponder {
4104    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4105    tx_id: u32,
4106}
4107
4108/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4109/// if the responder is dropped without sending a response, so that the client
4110/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4111impl std::ops::Drop for RealmGetComponentDeclResponder {
4112    fn drop(&mut self) {
4113        self.control_handle.shutdown();
4114        // Safety: drops once, never accessed again
4115        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4116    }
4117}
4118
4119impl fidl::endpoints::Responder for RealmGetComponentDeclResponder {
4120    type ControlHandle = RealmControlHandle;
4121
4122    fn control_handle(&self) -> &RealmControlHandle {
4123        &self.control_handle
4124    }
4125
4126    fn drop_without_shutdown(mut self) {
4127        // Safety: drops once, never accessed again due to mem::forget
4128        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4129        // Prevent Drop from running (which would shut down the channel)
4130        std::mem::forget(self);
4131    }
4132}
4133
4134impl RealmGetComponentDeclResponder {
4135    /// Sends a response to the FIDL transaction.
4136    ///
4137    /// Sets the channel to shutdown if an error occurs.
4138    pub fn send(
4139        self,
4140        mut result: Result<&fidl_fuchsia_component_decl::Component, RealmBuilderError>,
4141    ) -> Result<(), fidl::Error> {
4142        let _result = self.send_raw(result);
4143        if _result.is_err() {
4144            self.control_handle.shutdown();
4145        }
4146        self.drop_without_shutdown();
4147        _result
4148    }
4149
4150    /// Similar to "send" but does not shutdown the channel if an error occurs.
4151    pub fn send_no_shutdown_on_err(
4152        self,
4153        mut result: Result<&fidl_fuchsia_component_decl::Component, RealmBuilderError>,
4154    ) -> Result<(), fidl::Error> {
4155        let _result = self.send_raw(result);
4156        self.drop_without_shutdown();
4157        _result
4158    }
4159
4160    fn send_raw(
4161        &self,
4162        mut result: Result<&fidl_fuchsia_component_decl::Component, RealmBuilderError>,
4163    ) -> Result<(), fidl::Error> {
4164        self.control_handle.inner.send::<fidl::encoding::ResultType<
4165            RealmGetComponentDeclResponse,
4166            RealmBuilderError,
4167        >>(
4168            result.map(|component_decl| (component_decl,)),
4169            self.tx_id,
4170            0x320832af6a4cbac6,
4171            fidl::encoding::DynamicFlags::empty(),
4172        )
4173    }
4174}
4175
4176#[must_use = "FIDL methods require a response to be sent"]
4177#[derive(Debug)]
4178pub struct RealmReplaceComponentDeclResponder {
4179    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4180    tx_id: u32,
4181}
4182
4183/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4184/// if the responder is dropped without sending a response, so that the client
4185/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4186impl std::ops::Drop for RealmReplaceComponentDeclResponder {
4187    fn drop(&mut self) {
4188        self.control_handle.shutdown();
4189        // Safety: drops once, never accessed again
4190        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4191    }
4192}
4193
4194impl fidl::endpoints::Responder for RealmReplaceComponentDeclResponder {
4195    type ControlHandle = RealmControlHandle;
4196
4197    fn control_handle(&self) -> &RealmControlHandle {
4198        &self.control_handle
4199    }
4200
4201    fn drop_without_shutdown(mut self) {
4202        // Safety: drops once, never accessed again due to mem::forget
4203        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4204        // Prevent Drop from running (which would shut down the channel)
4205        std::mem::forget(self);
4206    }
4207}
4208
4209impl RealmReplaceComponentDeclResponder {
4210    /// Sends a response to the FIDL transaction.
4211    ///
4212    /// Sets the channel to shutdown if an error occurs.
4213    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4214        let _result = self.send_raw(result);
4215        if _result.is_err() {
4216            self.control_handle.shutdown();
4217        }
4218        self.drop_without_shutdown();
4219        _result
4220    }
4221
4222    /// Similar to "send" but does not shutdown the channel if an error occurs.
4223    pub fn send_no_shutdown_on_err(
4224        self,
4225        mut result: Result<(), RealmBuilderError>,
4226    ) -> Result<(), fidl::Error> {
4227        let _result = self.send_raw(result);
4228        self.drop_without_shutdown();
4229        _result
4230    }
4231
4232    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4233        self.control_handle.inner.send::<fidl::encoding::ResultType<
4234            fidl::encoding::EmptyStruct,
4235            RealmBuilderError,
4236        >>(
4237            result,
4238            self.tx_id,
4239            0x59cecf31b314cd5f,
4240            fidl::encoding::DynamicFlags::empty(),
4241        )
4242    }
4243}
4244
4245#[must_use = "FIDL methods require a response to be sent"]
4246#[derive(Debug)]
4247pub struct RealmGetRealmDeclResponder {
4248    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4249    tx_id: u32,
4250}
4251
4252/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4253/// if the responder is dropped without sending a response, so that the client
4254/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4255impl std::ops::Drop for RealmGetRealmDeclResponder {
4256    fn drop(&mut self) {
4257        self.control_handle.shutdown();
4258        // Safety: drops once, never accessed again
4259        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4260    }
4261}
4262
4263impl fidl::endpoints::Responder for RealmGetRealmDeclResponder {
4264    type ControlHandle = RealmControlHandle;
4265
4266    fn control_handle(&self) -> &RealmControlHandle {
4267        &self.control_handle
4268    }
4269
4270    fn drop_without_shutdown(mut self) {
4271        // Safety: drops once, never accessed again due to mem::forget
4272        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4273        // Prevent Drop from running (which would shut down the channel)
4274        std::mem::forget(self);
4275    }
4276}
4277
4278impl RealmGetRealmDeclResponder {
4279    /// Sends a response to the FIDL transaction.
4280    ///
4281    /// Sets the channel to shutdown if an error occurs.
4282    pub fn send(
4283        self,
4284        mut result: Result<&fidl_fuchsia_component_decl::Component, RealmBuilderError>,
4285    ) -> Result<(), fidl::Error> {
4286        let _result = self.send_raw(result);
4287        if _result.is_err() {
4288            self.control_handle.shutdown();
4289        }
4290        self.drop_without_shutdown();
4291        _result
4292    }
4293
4294    /// Similar to "send" but does not shutdown the channel if an error occurs.
4295    pub fn send_no_shutdown_on_err(
4296        self,
4297        mut result: Result<&fidl_fuchsia_component_decl::Component, RealmBuilderError>,
4298    ) -> Result<(), fidl::Error> {
4299        let _result = self.send_raw(result);
4300        self.drop_without_shutdown();
4301        _result
4302    }
4303
4304    fn send_raw(
4305        &self,
4306        mut result: Result<&fidl_fuchsia_component_decl::Component, RealmBuilderError>,
4307    ) -> Result<(), fidl::Error> {
4308        self.control_handle.inner.send::<fidl::encoding::ResultType<
4309            RealmGetRealmDeclResponse,
4310            RealmBuilderError,
4311        >>(
4312            result.map(|component_decl| (component_decl,)),
4313            self.tx_id,
4314            0x46fa05b17bd64269,
4315            fidl::encoding::DynamicFlags::empty(),
4316        )
4317    }
4318}
4319
4320#[must_use = "FIDL methods require a response to be sent"]
4321#[derive(Debug)]
4322pub struct RealmReplaceRealmDeclResponder {
4323    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4324    tx_id: u32,
4325}
4326
4327/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4328/// if the responder is dropped without sending a response, so that the client
4329/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4330impl std::ops::Drop for RealmReplaceRealmDeclResponder {
4331    fn drop(&mut self) {
4332        self.control_handle.shutdown();
4333        // Safety: drops once, never accessed again
4334        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4335    }
4336}
4337
4338impl fidl::endpoints::Responder for RealmReplaceRealmDeclResponder {
4339    type ControlHandle = RealmControlHandle;
4340
4341    fn control_handle(&self) -> &RealmControlHandle {
4342        &self.control_handle
4343    }
4344
4345    fn drop_without_shutdown(mut self) {
4346        // Safety: drops once, never accessed again due to mem::forget
4347        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4348        // Prevent Drop from running (which would shut down the channel)
4349        std::mem::forget(self);
4350    }
4351}
4352
4353impl RealmReplaceRealmDeclResponder {
4354    /// Sends a response to the FIDL transaction.
4355    ///
4356    /// Sets the channel to shutdown if an error occurs.
4357    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4358        let _result = self.send_raw(result);
4359        if _result.is_err() {
4360            self.control_handle.shutdown();
4361        }
4362        self.drop_without_shutdown();
4363        _result
4364    }
4365
4366    /// Similar to "send" but does not shutdown the channel if an error occurs.
4367    pub fn send_no_shutdown_on_err(
4368        self,
4369        mut result: Result<(), RealmBuilderError>,
4370    ) -> Result<(), fidl::Error> {
4371        let _result = self.send_raw(result);
4372        self.drop_without_shutdown();
4373        _result
4374    }
4375
4376    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4377        self.control_handle.inner.send::<fidl::encoding::ResultType<
4378            fidl::encoding::EmptyStruct,
4379            RealmBuilderError,
4380        >>(
4381            result,
4382            self.tx_id,
4383            0x48fcba4ac1338da9,
4384            fidl::encoding::DynamicFlags::empty(),
4385        )
4386    }
4387}
4388
4389#[must_use = "FIDL methods require a response to be sent"]
4390#[derive(Debug)]
4391pub struct RealmUseNestedComponentManagerResponder {
4392    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4393    tx_id: u32,
4394}
4395
4396/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4397/// if the responder is dropped without sending a response, so that the client
4398/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4399impl std::ops::Drop for RealmUseNestedComponentManagerResponder {
4400    fn drop(&mut self) {
4401        self.control_handle.shutdown();
4402        // Safety: drops once, never accessed again
4403        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4404    }
4405}
4406
4407impl fidl::endpoints::Responder for RealmUseNestedComponentManagerResponder {
4408    type ControlHandle = RealmControlHandle;
4409
4410    fn control_handle(&self) -> &RealmControlHandle {
4411        &self.control_handle
4412    }
4413
4414    fn drop_without_shutdown(mut self) {
4415        // Safety: drops once, never accessed again due to mem::forget
4416        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4417        // Prevent Drop from running (which would shut down the channel)
4418        std::mem::forget(self);
4419    }
4420}
4421
4422impl RealmUseNestedComponentManagerResponder {
4423    /// Sends a response to the FIDL transaction.
4424    ///
4425    /// Sets the channel to shutdown if an error occurs.
4426    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4427        let _result = self.send_raw(result);
4428        if _result.is_err() {
4429            self.control_handle.shutdown();
4430        }
4431        self.drop_without_shutdown();
4432        _result
4433    }
4434
4435    /// Similar to "send" but does not shutdown the channel if an error occurs.
4436    pub fn send_no_shutdown_on_err(
4437        self,
4438        mut result: Result<(), RealmBuilderError>,
4439    ) -> Result<(), fidl::Error> {
4440        let _result = self.send_raw(result);
4441        self.drop_without_shutdown();
4442        _result
4443    }
4444
4445    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4446        self.control_handle.inner.send::<fidl::encoding::ResultType<
4447            fidl::encoding::EmptyStruct,
4448            RealmBuilderError,
4449        >>(
4450            result,
4451            self.tx_id,
4452            0x64bd27482f3dcc,
4453            fidl::encoding::DynamicFlags::empty(),
4454        )
4455    }
4456}
4457
4458#[must_use = "FIDL methods require a response to be sent"]
4459#[derive(Debug)]
4460pub struct RealmAddRouteResponder {
4461    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4462    tx_id: u32,
4463}
4464
4465/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4466/// if the responder is dropped without sending a response, so that the client
4467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4468impl std::ops::Drop for RealmAddRouteResponder {
4469    fn drop(&mut self) {
4470        self.control_handle.shutdown();
4471        // Safety: drops once, never accessed again
4472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4473    }
4474}
4475
4476impl fidl::endpoints::Responder for RealmAddRouteResponder {
4477    type ControlHandle = RealmControlHandle;
4478
4479    fn control_handle(&self) -> &RealmControlHandle {
4480        &self.control_handle
4481    }
4482
4483    fn drop_without_shutdown(mut self) {
4484        // Safety: drops once, never accessed again due to mem::forget
4485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4486        // Prevent Drop from running (which would shut down the channel)
4487        std::mem::forget(self);
4488    }
4489}
4490
4491impl RealmAddRouteResponder {
4492    /// Sends a response to the FIDL transaction.
4493    ///
4494    /// Sets the channel to shutdown if an error occurs.
4495    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4496        let _result = self.send_raw(result);
4497        if _result.is_err() {
4498            self.control_handle.shutdown();
4499        }
4500        self.drop_without_shutdown();
4501        _result
4502    }
4503
4504    /// Similar to "send" but does not shutdown the channel if an error occurs.
4505    pub fn send_no_shutdown_on_err(
4506        self,
4507        mut result: Result<(), RealmBuilderError>,
4508    ) -> Result<(), fidl::Error> {
4509        let _result = self.send_raw(result);
4510        self.drop_without_shutdown();
4511        _result
4512    }
4513
4514    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4515        self.control_handle.inner.send::<fidl::encoding::ResultType<
4516            fidl::encoding::EmptyStruct,
4517            RealmBuilderError,
4518        >>(
4519            result,
4520            self.tx_id,
4521            0x9d523295be53a0a,
4522            fidl::encoding::DynamicFlags::empty(),
4523        )
4524    }
4525}
4526
4527#[must_use = "FIDL methods require a response to be sent"]
4528#[derive(Debug)]
4529pub struct RealmAddRouteFromDictionaryResponder {
4530    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4531    tx_id: u32,
4532}
4533
4534/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4535/// if the responder is dropped without sending a response, so that the client
4536/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4537impl std::ops::Drop for RealmAddRouteFromDictionaryResponder {
4538    fn drop(&mut self) {
4539        self.control_handle.shutdown();
4540        // Safety: drops once, never accessed again
4541        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4542    }
4543}
4544
4545impl fidl::endpoints::Responder for RealmAddRouteFromDictionaryResponder {
4546    type ControlHandle = RealmControlHandle;
4547
4548    fn control_handle(&self) -> &RealmControlHandle {
4549        &self.control_handle
4550    }
4551
4552    fn drop_without_shutdown(mut self) {
4553        // Safety: drops once, never accessed again due to mem::forget
4554        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4555        // Prevent Drop from running (which would shut down the channel)
4556        std::mem::forget(self);
4557    }
4558}
4559
4560impl RealmAddRouteFromDictionaryResponder {
4561    /// Sends a response to the FIDL transaction.
4562    ///
4563    /// Sets the channel to shutdown if an error occurs.
4564    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4565        let _result = self.send_raw(result);
4566        if _result.is_err() {
4567            self.control_handle.shutdown();
4568        }
4569        self.drop_without_shutdown();
4570        _result
4571    }
4572
4573    /// Similar to "send" but does not shutdown the channel if an error occurs.
4574    pub fn send_no_shutdown_on_err(
4575        self,
4576        mut result: Result<(), RealmBuilderError>,
4577    ) -> Result<(), fidl::Error> {
4578        let _result = self.send_raw(result);
4579        self.drop_without_shutdown();
4580        _result
4581    }
4582
4583    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4584        self.control_handle.inner.send::<fidl::encoding::ResultType<
4585            fidl::encoding::EmptyStruct,
4586            RealmBuilderError,
4587        >>(
4588            result,
4589            self.tx_id,
4590            0x21fac42c3e1d14d2,
4591            fidl::encoding::DynamicFlags::empty(),
4592        )
4593    }
4594}
4595
4596#[must_use = "FIDL methods require a response to be sent"]
4597#[derive(Debug)]
4598pub struct RealmReadOnlyDirectoryResponder {
4599    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4600    tx_id: u32,
4601}
4602
4603/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4604/// if the responder is dropped without sending a response, so that the client
4605/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4606impl std::ops::Drop for RealmReadOnlyDirectoryResponder {
4607    fn drop(&mut self) {
4608        self.control_handle.shutdown();
4609        // Safety: drops once, never accessed again
4610        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4611    }
4612}
4613
4614impl fidl::endpoints::Responder for RealmReadOnlyDirectoryResponder {
4615    type ControlHandle = RealmControlHandle;
4616
4617    fn control_handle(&self) -> &RealmControlHandle {
4618        &self.control_handle
4619    }
4620
4621    fn drop_without_shutdown(mut self) {
4622        // Safety: drops once, never accessed again due to mem::forget
4623        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4624        // Prevent Drop from running (which would shut down the channel)
4625        std::mem::forget(self);
4626    }
4627}
4628
4629impl RealmReadOnlyDirectoryResponder {
4630    /// Sends a response to the FIDL transaction.
4631    ///
4632    /// Sets the channel to shutdown if an error occurs.
4633    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4634        let _result = self.send_raw(result);
4635        if _result.is_err() {
4636            self.control_handle.shutdown();
4637        }
4638        self.drop_without_shutdown();
4639        _result
4640    }
4641
4642    /// Similar to "send" but does not shutdown the channel if an error occurs.
4643    pub fn send_no_shutdown_on_err(
4644        self,
4645        mut result: Result<(), RealmBuilderError>,
4646    ) -> Result<(), fidl::Error> {
4647        let _result = self.send_raw(result);
4648        self.drop_without_shutdown();
4649        _result
4650    }
4651
4652    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4653        self.control_handle.inner.send::<fidl::encoding::ResultType<
4654            fidl::encoding::EmptyStruct,
4655            RealmBuilderError,
4656        >>(
4657            result,
4658            self.tx_id,
4659            0x78a6d150a66e00dc,
4660            fidl::encoding::DynamicFlags::empty(),
4661        )
4662    }
4663}
4664
4665#[must_use = "FIDL methods require a response to be sent"]
4666#[derive(Debug)]
4667pub struct RealmAddStorageResponder {
4668    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4669    tx_id: u32,
4670}
4671
4672/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4673/// if the responder is dropped without sending a response, so that the client
4674/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4675impl std::ops::Drop for RealmAddStorageResponder {
4676    fn drop(&mut self) {
4677        self.control_handle.shutdown();
4678        // Safety: drops once, never accessed again
4679        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4680    }
4681}
4682
4683impl fidl::endpoints::Responder for RealmAddStorageResponder {
4684    type ControlHandle = RealmControlHandle;
4685
4686    fn control_handle(&self) -> &RealmControlHandle {
4687        &self.control_handle
4688    }
4689
4690    fn drop_without_shutdown(mut self) {
4691        // Safety: drops once, never accessed again due to mem::forget
4692        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4693        // Prevent Drop from running (which would shut down the channel)
4694        std::mem::forget(self);
4695    }
4696}
4697
4698impl RealmAddStorageResponder {
4699    /// Sends a response to the FIDL transaction.
4700    ///
4701    /// Sets the channel to shutdown if an error occurs.
4702    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4703        let _result = self.send_raw(result);
4704        if _result.is_err() {
4705            self.control_handle.shutdown();
4706        }
4707        self.drop_without_shutdown();
4708        _result
4709    }
4710
4711    /// Similar to "send" but does not shutdown the channel if an error occurs.
4712    pub fn send_no_shutdown_on_err(
4713        self,
4714        mut result: Result<(), RealmBuilderError>,
4715    ) -> Result<(), fidl::Error> {
4716        let _result = self.send_raw(result);
4717        self.drop_without_shutdown();
4718        _result
4719    }
4720
4721    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4722        self.control_handle.inner.send::<fidl::encoding::ResultType<
4723            fidl::encoding::EmptyStruct,
4724            RealmBuilderError,
4725        >>(
4726            result,
4727            self.tx_id,
4728            0x4709da0c9576b7c1,
4729            fidl::encoding::DynamicFlags::empty(),
4730        )
4731    }
4732}
4733
4734#[must_use = "FIDL methods require a response to be sent"]
4735#[derive(Debug)]
4736pub struct RealmInitMutableConfigFromPackageResponder {
4737    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4738    tx_id: u32,
4739}
4740
4741/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4742/// if the responder is dropped without sending a response, so that the client
4743/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4744impl std::ops::Drop for RealmInitMutableConfigFromPackageResponder {
4745    fn drop(&mut self) {
4746        self.control_handle.shutdown();
4747        // Safety: drops once, never accessed again
4748        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4749    }
4750}
4751
4752impl fidl::endpoints::Responder for RealmInitMutableConfigFromPackageResponder {
4753    type ControlHandle = RealmControlHandle;
4754
4755    fn control_handle(&self) -> &RealmControlHandle {
4756        &self.control_handle
4757    }
4758
4759    fn drop_without_shutdown(mut self) {
4760        // Safety: drops once, never accessed again due to mem::forget
4761        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4762        // Prevent Drop from running (which would shut down the channel)
4763        std::mem::forget(self);
4764    }
4765}
4766
4767impl RealmInitMutableConfigFromPackageResponder {
4768    /// Sends a response to the FIDL transaction.
4769    ///
4770    /// Sets the channel to shutdown if an error occurs.
4771    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4772        let _result = self.send_raw(result);
4773        if _result.is_err() {
4774            self.control_handle.shutdown();
4775        }
4776        self.drop_without_shutdown();
4777        _result
4778    }
4779
4780    /// Similar to "send" but does not shutdown the channel if an error occurs.
4781    pub fn send_no_shutdown_on_err(
4782        self,
4783        mut result: Result<(), RealmBuilderError>,
4784    ) -> Result<(), fidl::Error> {
4785        let _result = self.send_raw(result);
4786        self.drop_without_shutdown();
4787        _result
4788    }
4789
4790    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4791        self.control_handle.inner.send::<fidl::encoding::ResultType<
4792            fidl::encoding::EmptyStruct,
4793            RealmBuilderError,
4794        >>(
4795            result,
4796            self.tx_id,
4797            0x36a30c9837c64216,
4798            fidl::encoding::DynamicFlags::empty(),
4799        )
4800    }
4801}
4802
4803#[must_use = "FIDL methods require a response to be sent"]
4804#[derive(Debug)]
4805pub struct RealmInitMutableConfigToEmptyResponder {
4806    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4807    tx_id: u32,
4808}
4809
4810/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4811/// if the responder is dropped without sending a response, so that the client
4812/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4813impl std::ops::Drop for RealmInitMutableConfigToEmptyResponder {
4814    fn drop(&mut self) {
4815        self.control_handle.shutdown();
4816        // Safety: drops once, never accessed again
4817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4818    }
4819}
4820
4821impl fidl::endpoints::Responder for RealmInitMutableConfigToEmptyResponder {
4822    type ControlHandle = RealmControlHandle;
4823
4824    fn control_handle(&self) -> &RealmControlHandle {
4825        &self.control_handle
4826    }
4827
4828    fn drop_without_shutdown(mut self) {
4829        // Safety: drops once, never accessed again due to mem::forget
4830        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4831        // Prevent Drop from running (which would shut down the channel)
4832        std::mem::forget(self);
4833    }
4834}
4835
4836impl RealmInitMutableConfigToEmptyResponder {
4837    /// Sends a response to the FIDL transaction.
4838    ///
4839    /// Sets the channel to shutdown if an error occurs.
4840    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4841        let _result = self.send_raw(result);
4842        if _result.is_err() {
4843            self.control_handle.shutdown();
4844        }
4845        self.drop_without_shutdown();
4846        _result
4847    }
4848
4849    /// Similar to "send" but does not shutdown the channel if an error occurs.
4850    pub fn send_no_shutdown_on_err(
4851        self,
4852        mut result: Result<(), RealmBuilderError>,
4853    ) -> Result<(), fidl::Error> {
4854        let _result = self.send_raw(result);
4855        self.drop_without_shutdown();
4856        _result
4857    }
4858
4859    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4860        self.control_handle.inner.send::<fidl::encoding::ResultType<
4861            fidl::encoding::EmptyStruct,
4862            RealmBuilderError,
4863        >>(
4864            result,
4865            self.tx_id,
4866            0x772cb99e2e0dccc5,
4867            fidl::encoding::DynamicFlags::empty(),
4868        )
4869    }
4870}
4871
4872#[must_use = "FIDL methods require a response to be sent"]
4873#[derive(Debug)]
4874pub struct RealmAddCapabilityResponder {
4875    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4876    tx_id: u32,
4877}
4878
4879/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4880/// if the responder is dropped without sending a response, so that the client
4881/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4882impl std::ops::Drop for RealmAddCapabilityResponder {
4883    fn drop(&mut self) {
4884        self.control_handle.shutdown();
4885        // Safety: drops once, never accessed again
4886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4887    }
4888}
4889
4890impl fidl::endpoints::Responder for RealmAddCapabilityResponder {
4891    type ControlHandle = RealmControlHandle;
4892
4893    fn control_handle(&self) -> &RealmControlHandle {
4894        &self.control_handle
4895    }
4896
4897    fn drop_without_shutdown(mut self) {
4898        // Safety: drops once, never accessed again due to mem::forget
4899        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4900        // Prevent Drop from running (which would shut down the channel)
4901        std::mem::forget(self);
4902    }
4903}
4904
4905impl RealmAddCapabilityResponder {
4906    /// Sends a response to the FIDL transaction.
4907    ///
4908    /// Sets the channel to shutdown if an error occurs.
4909    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4910        let _result = self.send_raw(result);
4911        if _result.is_err() {
4912            self.control_handle.shutdown();
4913        }
4914        self.drop_without_shutdown();
4915        _result
4916    }
4917
4918    /// Similar to "send" but does not shutdown the channel if an error occurs.
4919    pub fn send_no_shutdown_on_err(
4920        self,
4921        mut result: Result<(), RealmBuilderError>,
4922    ) -> Result<(), fidl::Error> {
4923        let _result = self.send_raw(result);
4924        self.drop_without_shutdown();
4925        _result
4926    }
4927
4928    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4929        self.control_handle.inner.send::<fidl::encoding::ResultType<
4930            fidl::encoding::EmptyStruct,
4931            RealmBuilderError,
4932        >>(
4933            result,
4934            self.tx_id,
4935            0x23a6499eb6080249,
4936            fidl::encoding::DynamicFlags::empty(),
4937        )
4938    }
4939}
4940
4941#[must_use = "FIDL methods require a response to be sent"]
4942#[derive(Debug)]
4943pub struct RealmAddCollectionResponder {
4944    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4945    tx_id: u32,
4946}
4947
4948/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4949/// if the responder is dropped without sending a response, so that the client
4950/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4951impl std::ops::Drop for RealmAddCollectionResponder {
4952    fn drop(&mut self) {
4953        self.control_handle.shutdown();
4954        // Safety: drops once, never accessed again
4955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4956    }
4957}
4958
4959impl fidl::endpoints::Responder for RealmAddCollectionResponder {
4960    type ControlHandle = RealmControlHandle;
4961
4962    fn control_handle(&self) -> &RealmControlHandle {
4963        &self.control_handle
4964    }
4965
4966    fn drop_without_shutdown(mut self) {
4967        // Safety: drops once, never accessed again due to mem::forget
4968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4969        // Prevent Drop from running (which would shut down the channel)
4970        std::mem::forget(self);
4971    }
4972}
4973
4974impl RealmAddCollectionResponder {
4975    /// Sends a response to the FIDL transaction.
4976    ///
4977    /// Sets the channel to shutdown if an error occurs.
4978    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4979        let _result = self.send_raw(result);
4980        if _result.is_err() {
4981            self.control_handle.shutdown();
4982        }
4983        self.drop_without_shutdown();
4984        _result
4985    }
4986
4987    /// Similar to "send" but does not shutdown the channel if an error occurs.
4988    pub fn send_no_shutdown_on_err(
4989        self,
4990        mut result: Result<(), RealmBuilderError>,
4991    ) -> Result<(), fidl::Error> {
4992        let _result = self.send_raw(result);
4993        self.drop_without_shutdown();
4994        _result
4995    }
4996
4997    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
4998        self.control_handle.inner.send::<fidl::encoding::ResultType<
4999            fidl::encoding::EmptyStruct,
5000            RealmBuilderError,
5001        >>(
5002            result,
5003            self.tx_id,
5004            0x56b75210a03a99b5,
5005            fidl::encoding::DynamicFlags::empty(),
5006        )
5007    }
5008}
5009
5010#[must_use = "FIDL methods require a response to be sent"]
5011#[derive(Debug)]
5012pub struct RealmAddEnvironmentResponder {
5013    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5014    tx_id: u32,
5015}
5016
5017/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5018/// if the responder is dropped without sending a response, so that the client
5019/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5020impl std::ops::Drop for RealmAddEnvironmentResponder {
5021    fn drop(&mut self) {
5022        self.control_handle.shutdown();
5023        // Safety: drops once, never accessed again
5024        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5025    }
5026}
5027
5028impl fidl::endpoints::Responder for RealmAddEnvironmentResponder {
5029    type ControlHandle = RealmControlHandle;
5030
5031    fn control_handle(&self) -> &RealmControlHandle {
5032        &self.control_handle
5033    }
5034
5035    fn drop_without_shutdown(mut self) {
5036        // Safety: drops once, never accessed again due to mem::forget
5037        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5038        // Prevent Drop from running (which would shut down the channel)
5039        std::mem::forget(self);
5040    }
5041}
5042
5043impl RealmAddEnvironmentResponder {
5044    /// Sends a response to the FIDL transaction.
5045    ///
5046    /// Sets the channel to shutdown if an error occurs.
5047    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
5048        let _result = self.send_raw(result);
5049        if _result.is_err() {
5050            self.control_handle.shutdown();
5051        }
5052        self.drop_without_shutdown();
5053        _result
5054    }
5055
5056    /// Similar to "send" but does not shutdown the channel if an error occurs.
5057    pub fn send_no_shutdown_on_err(
5058        self,
5059        mut result: Result<(), RealmBuilderError>,
5060    ) -> Result<(), fidl::Error> {
5061        let _result = self.send_raw(result);
5062        self.drop_without_shutdown();
5063        _result
5064    }
5065
5066    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
5067        self.control_handle.inner.send::<fidl::encoding::ResultType<
5068            fidl::encoding::EmptyStruct,
5069            RealmBuilderError,
5070        >>(
5071            result,
5072            self.tx_id,
5073            0x1cd7caefa2cce0e9,
5074            fidl::encoding::DynamicFlags::empty(),
5075        )
5076    }
5077}
5078
5079#[must_use = "FIDL methods require a response to be sent"]
5080#[derive(Debug)]
5081pub struct RealmSetConfigValueResponder {
5082    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5083    tx_id: u32,
5084}
5085
5086/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5087/// if the responder is dropped without sending a response, so that the client
5088/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5089impl std::ops::Drop for RealmSetConfigValueResponder {
5090    fn drop(&mut self) {
5091        self.control_handle.shutdown();
5092        // Safety: drops once, never accessed again
5093        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5094    }
5095}
5096
5097impl fidl::endpoints::Responder for RealmSetConfigValueResponder {
5098    type ControlHandle = RealmControlHandle;
5099
5100    fn control_handle(&self) -> &RealmControlHandle {
5101        &self.control_handle
5102    }
5103
5104    fn drop_without_shutdown(mut self) {
5105        // Safety: drops once, never accessed again due to mem::forget
5106        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5107        // Prevent Drop from running (which would shut down the channel)
5108        std::mem::forget(self);
5109    }
5110}
5111
5112impl RealmSetConfigValueResponder {
5113    /// Sends a response to the FIDL transaction.
5114    ///
5115    /// Sets the channel to shutdown if an error occurs.
5116    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
5117        let _result = self.send_raw(result);
5118        if _result.is_err() {
5119            self.control_handle.shutdown();
5120        }
5121        self.drop_without_shutdown();
5122        _result
5123    }
5124
5125    /// Similar to "send" but does not shutdown the channel if an error occurs.
5126    pub fn send_no_shutdown_on_err(
5127        self,
5128        mut result: Result<(), RealmBuilderError>,
5129    ) -> Result<(), fidl::Error> {
5130        let _result = self.send_raw(result);
5131        self.drop_without_shutdown();
5132        _result
5133    }
5134
5135    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
5136        self.control_handle.inner.send::<fidl::encoding::ResultType<
5137            fidl::encoding::EmptyStruct,
5138            RealmBuilderError,
5139        >>(
5140            result,
5141            self.tx_id,
5142            0x886450d291217f2,
5143            fidl::encoding::DynamicFlags::empty(),
5144        )
5145    }
5146}
5147
5148#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5149pub struct RealmBuilderFactoryMarker;
5150
5151impl fidl::endpoints::ProtocolMarker for RealmBuilderFactoryMarker {
5152    type Proxy = RealmBuilderFactoryProxy;
5153    type RequestStream = RealmBuilderFactoryRequestStream;
5154    #[cfg(target_os = "fuchsia")]
5155    type SynchronousProxy = RealmBuilderFactorySynchronousProxy;
5156
5157    const DEBUG_NAME: &'static str = "fuchsia.component.test.RealmBuilderFactory";
5158}
5159impl fidl::endpoints::DiscoverableProtocolMarker for RealmBuilderFactoryMarker {}
5160pub type RealmBuilderFactoryCreateResult = Result<(), RealmBuilderError>;
5161pub type RealmBuilderFactoryCreateFromRelativeUrlResult = Result<(), RealmBuilderError>;
5162
5163pub trait RealmBuilderFactoryProxyInterface: Send + Sync {
5164    type CreateResponseFut: std::future::Future<Output = Result<RealmBuilderFactoryCreateResult, fidl::Error>>
5165        + Send;
5166    fn r#create(
5167        &self,
5168        pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5169        realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5170        builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5171    ) -> Self::CreateResponseFut;
5172    type CreateFromRelativeUrlResponseFut: std::future::Future<
5173            Output = Result<RealmBuilderFactoryCreateFromRelativeUrlResult, fidl::Error>,
5174        > + Send;
5175    fn r#create_from_relative_url(
5176        &self,
5177        pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5178        relative_url: &str,
5179        realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5180        builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5181    ) -> Self::CreateFromRelativeUrlResponseFut;
5182}
5183#[derive(Debug)]
5184#[cfg(target_os = "fuchsia")]
5185pub struct RealmBuilderFactorySynchronousProxy {
5186    client: fidl::client::sync::Client,
5187}
5188
5189#[cfg(target_os = "fuchsia")]
5190impl fidl::endpoints::SynchronousProxy for RealmBuilderFactorySynchronousProxy {
5191    type Proxy = RealmBuilderFactoryProxy;
5192    type Protocol = RealmBuilderFactoryMarker;
5193
5194    fn from_channel(inner: fidl::Channel) -> Self {
5195        Self::new(inner)
5196    }
5197
5198    fn into_channel(self) -> fidl::Channel {
5199        self.client.into_channel()
5200    }
5201
5202    fn as_channel(&self) -> &fidl::Channel {
5203        self.client.as_channel()
5204    }
5205}
5206
5207#[cfg(target_os = "fuchsia")]
5208impl RealmBuilderFactorySynchronousProxy {
5209    pub fn new(channel: fidl::Channel) -> Self {
5210        let protocol_name =
5211            <RealmBuilderFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5212        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5213    }
5214
5215    pub fn into_channel(self) -> fidl::Channel {
5216        self.client.into_channel()
5217    }
5218
5219    /// Waits until an event arrives and returns it. It is safe for other
5220    /// threads to make concurrent requests while waiting for an event.
5221    pub fn wait_for_event(
5222        &self,
5223        deadline: zx::MonotonicInstant,
5224    ) -> Result<RealmBuilderFactoryEvent, fidl::Error> {
5225        RealmBuilderFactoryEvent::decode(self.client.wait_for_event(deadline)?)
5226    }
5227
5228    /// Creates a new RealmBuilder. The client end of `realm_server_end` can be
5229    /// used to mutate the realm that is being constructed, by doing things such
5230    /// as adding new children to the realm or adding capability routes between
5231    /// them. The client end of `builder_server_end` is used to finalize the
5232    /// realm, after which point it can be launched in a collection.
5233    ///
5234    /// `pkg_dir_handle` is a handle to the test package. The realm builder
5235    /// client typically passes a handle to its own `/pkg` directory, and
5236    /// bundles the `other-component` into the same package.
5237    pub fn r#create(
5238        &self,
5239        mut pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5240        mut realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5241        mut builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5242        ___deadline: zx::MonotonicInstant,
5243    ) -> Result<RealmBuilderFactoryCreateResult, fidl::Error> {
5244        let _response =
5245            self.client.send_query::<RealmBuilderFactoryCreateRequest, fidl::encoding::ResultType<
5246                fidl::encoding::EmptyStruct,
5247                RealmBuilderError,
5248            >>(
5249                (pkg_dir_handle, realm_server_end, builder_server_end),
5250                0x73528b1135cb01be,
5251                fidl::encoding::DynamicFlags::empty(),
5252                ___deadline,
5253            )?;
5254        Ok(_response.map(|x| x))
5255    }
5256
5257    /// Identical to `Create`, but instead of the realm being empty by default
5258    /// it contains the contents of the manifest located in the test package at
5259    /// the path indicated by `relative_url`, which must be a fragment-only URL
5260    /// (for example, `#meta/other-component.cm`; see
5261    /// https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only).
5262    pub fn r#create_from_relative_url(
5263        &self,
5264        mut pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5265        mut relative_url: &str,
5266        mut realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5267        mut builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5268        ___deadline: zx::MonotonicInstant,
5269    ) -> Result<RealmBuilderFactoryCreateFromRelativeUrlResult, fidl::Error> {
5270        let _response = self.client.send_query::<
5271            RealmBuilderFactoryCreateFromRelativeUrlRequest,
5272            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
5273        >(
5274            (pkg_dir_handle, relative_url, realm_server_end, builder_server_end,),
5275            0x1cafd9042c54a86b,
5276            fidl::encoding::DynamicFlags::empty(),
5277            ___deadline,
5278        )?;
5279        Ok(_response.map(|x| x))
5280    }
5281}
5282
5283#[cfg(target_os = "fuchsia")]
5284impl From<RealmBuilderFactorySynchronousProxy> for zx::NullableHandle {
5285    fn from(value: RealmBuilderFactorySynchronousProxy) -> Self {
5286        value.into_channel().into()
5287    }
5288}
5289
5290#[cfg(target_os = "fuchsia")]
5291impl From<fidl::Channel> for RealmBuilderFactorySynchronousProxy {
5292    fn from(value: fidl::Channel) -> Self {
5293        Self::new(value)
5294    }
5295}
5296
5297#[cfg(target_os = "fuchsia")]
5298impl fidl::endpoints::FromClient for RealmBuilderFactorySynchronousProxy {
5299    type Protocol = RealmBuilderFactoryMarker;
5300
5301    fn from_client(value: fidl::endpoints::ClientEnd<RealmBuilderFactoryMarker>) -> Self {
5302        Self::new(value.into_channel())
5303    }
5304}
5305
5306#[derive(Debug, Clone)]
5307pub struct RealmBuilderFactoryProxy {
5308    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5309}
5310
5311impl fidl::endpoints::Proxy for RealmBuilderFactoryProxy {
5312    type Protocol = RealmBuilderFactoryMarker;
5313
5314    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5315        Self::new(inner)
5316    }
5317
5318    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5319        self.client.into_channel().map_err(|client| Self { client })
5320    }
5321
5322    fn as_channel(&self) -> &::fidl::AsyncChannel {
5323        self.client.as_channel()
5324    }
5325}
5326
5327impl RealmBuilderFactoryProxy {
5328    /// Create a new Proxy for fuchsia.component.test/RealmBuilderFactory.
5329    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5330        let protocol_name =
5331            <RealmBuilderFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5332        Self { client: fidl::client::Client::new(channel, protocol_name) }
5333    }
5334
5335    /// Get a Stream of events from the remote end of the protocol.
5336    ///
5337    /// # Panics
5338    ///
5339    /// Panics if the event stream was already taken.
5340    pub fn take_event_stream(&self) -> RealmBuilderFactoryEventStream {
5341        RealmBuilderFactoryEventStream { event_receiver: self.client.take_event_receiver() }
5342    }
5343
5344    /// Creates a new RealmBuilder. The client end of `realm_server_end` can be
5345    /// used to mutate the realm that is being constructed, by doing things such
5346    /// as adding new children to the realm or adding capability routes between
5347    /// them. The client end of `builder_server_end` is used to finalize the
5348    /// realm, after which point it can be launched in a collection.
5349    ///
5350    /// `pkg_dir_handle` is a handle to the test package. The realm builder
5351    /// client typically passes a handle to its own `/pkg` directory, and
5352    /// bundles the `other-component` into the same package.
5353    pub fn r#create(
5354        &self,
5355        mut pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5356        mut realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5357        mut builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5358    ) -> fidl::client::QueryResponseFut<
5359        RealmBuilderFactoryCreateResult,
5360        fidl::encoding::DefaultFuchsiaResourceDialect,
5361    > {
5362        RealmBuilderFactoryProxyInterface::r#create(
5363            self,
5364            pkg_dir_handle,
5365            realm_server_end,
5366            builder_server_end,
5367        )
5368    }
5369
5370    /// Identical to `Create`, but instead of the realm being empty by default
5371    /// it contains the contents of the manifest located in the test package at
5372    /// the path indicated by `relative_url`, which must be a fragment-only URL
5373    /// (for example, `#meta/other-component.cm`; see
5374    /// https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only).
5375    pub fn r#create_from_relative_url(
5376        &self,
5377        mut pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5378        mut relative_url: &str,
5379        mut realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5380        mut builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5381    ) -> fidl::client::QueryResponseFut<
5382        RealmBuilderFactoryCreateFromRelativeUrlResult,
5383        fidl::encoding::DefaultFuchsiaResourceDialect,
5384    > {
5385        RealmBuilderFactoryProxyInterface::r#create_from_relative_url(
5386            self,
5387            pkg_dir_handle,
5388            relative_url,
5389            realm_server_end,
5390            builder_server_end,
5391        )
5392    }
5393}
5394
5395impl RealmBuilderFactoryProxyInterface for RealmBuilderFactoryProxy {
5396    type CreateResponseFut = fidl::client::QueryResponseFut<
5397        RealmBuilderFactoryCreateResult,
5398        fidl::encoding::DefaultFuchsiaResourceDialect,
5399    >;
5400    fn r#create(
5401        &self,
5402        mut pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5403        mut realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5404        mut builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5405    ) -> Self::CreateResponseFut {
5406        fn _decode(
5407            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5408        ) -> Result<RealmBuilderFactoryCreateResult, fidl::Error> {
5409            let _response = fidl::client::decode_transaction_body::<
5410                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
5411                fidl::encoding::DefaultFuchsiaResourceDialect,
5412                0x73528b1135cb01be,
5413            >(_buf?)?;
5414            Ok(_response.map(|x| x))
5415        }
5416        self.client.send_query_and_decode::<
5417            RealmBuilderFactoryCreateRequest,
5418            RealmBuilderFactoryCreateResult,
5419        >(
5420            (pkg_dir_handle, realm_server_end, builder_server_end,),
5421            0x73528b1135cb01be,
5422            fidl::encoding::DynamicFlags::empty(),
5423            _decode,
5424        )
5425    }
5426
5427    type CreateFromRelativeUrlResponseFut = fidl::client::QueryResponseFut<
5428        RealmBuilderFactoryCreateFromRelativeUrlResult,
5429        fidl::encoding::DefaultFuchsiaResourceDialect,
5430    >;
5431    fn r#create_from_relative_url(
5432        &self,
5433        mut pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5434        mut relative_url: &str,
5435        mut realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5436        mut builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5437    ) -> Self::CreateFromRelativeUrlResponseFut {
5438        fn _decode(
5439            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5440        ) -> Result<RealmBuilderFactoryCreateFromRelativeUrlResult, fidl::Error> {
5441            let _response = fidl::client::decode_transaction_body::<
5442                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RealmBuilderError>,
5443                fidl::encoding::DefaultFuchsiaResourceDialect,
5444                0x1cafd9042c54a86b,
5445            >(_buf?)?;
5446            Ok(_response.map(|x| x))
5447        }
5448        self.client.send_query_and_decode::<
5449            RealmBuilderFactoryCreateFromRelativeUrlRequest,
5450            RealmBuilderFactoryCreateFromRelativeUrlResult,
5451        >(
5452            (pkg_dir_handle, relative_url, realm_server_end, builder_server_end,),
5453            0x1cafd9042c54a86b,
5454            fidl::encoding::DynamicFlags::empty(),
5455            _decode,
5456        )
5457    }
5458}
5459
5460pub struct RealmBuilderFactoryEventStream {
5461    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5462}
5463
5464impl std::marker::Unpin for RealmBuilderFactoryEventStream {}
5465
5466impl futures::stream::FusedStream for RealmBuilderFactoryEventStream {
5467    fn is_terminated(&self) -> bool {
5468        self.event_receiver.is_terminated()
5469    }
5470}
5471
5472impl futures::Stream for RealmBuilderFactoryEventStream {
5473    type Item = Result<RealmBuilderFactoryEvent, fidl::Error>;
5474
5475    fn poll_next(
5476        mut self: std::pin::Pin<&mut Self>,
5477        cx: &mut std::task::Context<'_>,
5478    ) -> std::task::Poll<Option<Self::Item>> {
5479        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5480            &mut self.event_receiver,
5481            cx
5482        )?) {
5483            Some(buf) => std::task::Poll::Ready(Some(RealmBuilderFactoryEvent::decode(buf))),
5484            None => std::task::Poll::Ready(None),
5485        }
5486    }
5487}
5488
5489#[derive(Debug)]
5490pub enum RealmBuilderFactoryEvent {}
5491
5492impl RealmBuilderFactoryEvent {
5493    /// Decodes a message buffer as a [`RealmBuilderFactoryEvent`].
5494    fn decode(
5495        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5496    ) -> Result<RealmBuilderFactoryEvent, fidl::Error> {
5497        let (bytes, _handles) = buf.split_mut();
5498        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5499        debug_assert_eq!(tx_header.tx_id, 0);
5500        match tx_header.ordinal {
5501            _ => Err(fidl::Error::UnknownOrdinal {
5502                ordinal: tx_header.ordinal,
5503                protocol_name:
5504                    <RealmBuilderFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5505            }),
5506        }
5507    }
5508}
5509
5510/// A Stream of incoming requests for fuchsia.component.test/RealmBuilderFactory.
5511pub struct RealmBuilderFactoryRequestStream {
5512    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5513    is_terminated: bool,
5514}
5515
5516impl std::marker::Unpin for RealmBuilderFactoryRequestStream {}
5517
5518impl futures::stream::FusedStream for RealmBuilderFactoryRequestStream {
5519    fn is_terminated(&self) -> bool {
5520        self.is_terminated
5521    }
5522}
5523
5524impl fidl::endpoints::RequestStream for RealmBuilderFactoryRequestStream {
5525    type Protocol = RealmBuilderFactoryMarker;
5526    type ControlHandle = RealmBuilderFactoryControlHandle;
5527
5528    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5529        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5530    }
5531
5532    fn control_handle(&self) -> Self::ControlHandle {
5533        RealmBuilderFactoryControlHandle { inner: self.inner.clone() }
5534    }
5535
5536    fn into_inner(
5537        self,
5538    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5539    {
5540        (self.inner, self.is_terminated)
5541    }
5542
5543    fn from_inner(
5544        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5545        is_terminated: bool,
5546    ) -> Self {
5547        Self { inner, is_terminated }
5548    }
5549}
5550
5551impl futures::Stream for RealmBuilderFactoryRequestStream {
5552    type Item = Result<RealmBuilderFactoryRequest, fidl::Error>;
5553
5554    fn poll_next(
5555        mut self: std::pin::Pin<&mut Self>,
5556        cx: &mut std::task::Context<'_>,
5557    ) -> std::task::Poll<Option<Self::Item>> {
5558        let this = &mut *self;
5559        if this.inner.check_shutdown(cx) {
5560            this.is_terminated = true;
5561            return std::task::Poll::Ready(None);
5562        }
5563        if this.is_terminated {
5564            panic!("polled RealmBuilderFactoryRequestStream after completion");
5565        }
5566        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5567            |bytes, handles| {
5568                match this.inner.channel().read_etc(cx, bytes, handles) {
5569                    std::task::Poll::Ready(Ok(())) => {}
5570                    std::task::Poll::Pending => return std::task::Poll::Pending,
5571                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5572                        this.is_terminated = true;
5573                        return std::task::Poll::Ready(None);
5574                    }
5575                    std::task::Poll::Ready(Err(e)) => {
5576                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5577                            e.into(),
5578                        ))));
5579                    }
5580                }
5581
5582                // A message has been received from the channel
5583                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5584
5585                std::task::Poll::Ready(Some(match header.ordinal {
5586                0x73528b1135cb01be => {
5587                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5588                    let mut req = fidl::new_empty!(RealmBuilderFactoryCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5589                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmBuilderFactoryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
5590                    let control_handle = RealmBuilderFactoryControlHandle {
5591                        inner: this.inner.clone(),
5592                    };
5593                    Ok(RealmBuilderFactoryRequest::Create {pkg_dir_handle: req.pkg_dir_handle,
5594realm_server_end: req.realm_server_end,
5595builder_server_end: req.builder_server_end,
5596
5597                        responder: RealmBuilderFactoryCreateResponder {
5598                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5599                            tx_id: header.tx_id,
5600                        },
5601                    })
5602                }
5603                0x1cafd9042c54a86b => {
5604                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5605                    let mut req = fidl::new_empty!(RealmBuilderFactoryCreateFromRelativeUrlRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5606                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmBuilderFactoryCreateFromRelativeUrlRequest>(&header, _body_bytes, handles, &mut req)?;
5607                    let control_handle = RealmBuilderFactoryControlHandle {
5608                        inner: this.inner.clone(),
5609                    };
5610                    Ok(RealmBuilderFactoryRequest::CreateFromRelativeUrl {pkg_dir_handle: req.pkg_dir_handle,
5611relative_url: req.relative_url,
5612realm_server_end: req.realm_server_end,
5613builder_server_end: req.builder_server_end,
5614
5615                        responder: RealmBuilderFactoryCreateFromRelativeUrlResponder {
5616                            control_handle: std::mem::ManuallyDrop::new(control_handle),
5617                            tx_id: header.tx_id,
5618                        },
5619                    })
5620                }
5621                _ => Err(fidl::Error::UnknownOrdinal {
5622                    ordinal: header.ordinal,
5623                    protocol_name: <RealmBuilderFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5624                }),
5625            }))
5626            },
5627        )
5628    }
5629}
5630
5631/// This protocol can be used to instruct the Realm Builder Server to begin
5632/// creating a new realm.
5633#[derive(Debug)]
5634pub enum RealmBuilderFactoryRequest {
5635    /// Creates a new RealmBuilder. The client end of `realm_server_end` can be
5636    /// used to mutate the realm that is being constructed, by doing things such
5637    /// as adding new children to the realm or adding capability routes between
5638    /// them. The client end of `builder_server_end` is used to finalize the
5639    /// realm, after which point it can be launched in a collection.
5640    ///
5641    /// `pkg_dir_handle` is a handle to the test package. The realm builder
5642    /// client typically passes a handle to its own `/pkg` directory, and
5643    /// bundles the `other-component` into the same package.
5644    Create {
5645        pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5646        realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5647        builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5648        responder: RealmBuilderFactoryCreateResponder,
5649    },
5650    /// Identical to `Create`, but instead of the realm being empty by default
5651    /// it contains the contents of the manifest located in the test package at
5652    /// the path indicated by `relative_url`, which must be a fragment-only URL
5653    /// (for example, `#meta/other-component.cm`; see
5654    /// https://fuchsia.dev/fuchsia-src/reference/components/url#relative-fragment-only).
5655    CreateFromRelativeUrl {
5656        pkg_dir_handle: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5657        relative_url: String,
5658        realm_server_end: fidl::endpoints::ServerEnd<RealmMarker>,
5659        builder_server_end: fidl::endpoints::ServerEnd<BuilderMarker>,
5660        responder: RealmBuilderFactoryCreateFromRelativeUrlResponder,
5661    },
5662}
5663
5664impl RealmBuilderFactoryRequest {
5665    #[allow(irrefutable_let_patterns)]
5666    pub fn into_create(
5667        self,
5668    ) -> Option<(
5669        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5670        fidl::endpoints::ServerEnd<RealmMarker>,
5671        fidl::endpoints::ServerEnd<BuilderMarker>,
5672        RealmBuilderFactoryCreateResponder,
5673    )> {
5674        if let RealmBuilderFactoryRequest::Create {
5675            pkg_dir_handle,
5676            realm_server_end,
5677            builder_server_end,
5678            responder,
5679        } = self
5680        {
5681            Some((pkg_dir_handle, realm_server_end, builder_server_end, responder))
5682        } else {
5683            None
5684        }
5685    }
5686
5687    #[allow(irrefutable_let_patterns)]
5688    pub fn into_create_from_relative_url(
5689        self,
5690    ) -> Option<(
5691        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
5692        String,
5693        fidl::endpoints::ServerEnd<RealmMarker>,
5694        fidl::endpoints::ServerEnd<BuilderMarker>,
5695        RealmBuilderFactoryCreateFromRelativeUrlResponder,
5696    )> {
5697        if let RealmBuilderFactoryRequest::CreateFromRelativeUrl {
5698            pkg_dir_handle,
5699            relative_url,
5700            realm_server_end,
5701            builder_server_end,
5702            responder,
5703        } = self
5704        {
5705            Some((pkg_dir_handle, relative_url, realm_server_end, builder_server_end, responder))
5706        } else {
5707            None
5708        }
5709    }
5710
5711    /// Name of the method defined in FIDL
5712    pub fn method_name(&self) -> &'static str {
5713        match *self {
5714            RealmBuilderFactoryRequest::Create { .. } => "create",
5715            RealmBuilderFactoryRequest::CreateFromRelativeUrl { .. } => "create_from_relative_url",
5716        }
5717    }
5718}
5719
5720#[derive(Debug, Clone)]
5721pub struct RealmBuilderFactoryControlHandle {
5722    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5723}
5724
5725impl fidl::endpoints::ControlHandle for RealmBuilderFactoryControlHandle {
5726    fn shutdown(&self) {
5727        self.inner.shutdown()
5728    }
5729
5730    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5731        self.inner.shutdown_with_epitaph(status)
5732    }
5733
5734    fn is_closed(&self) -> bool {
5735        self.inner.channel().is_closed()
5736    }
5737    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5738        self.inner.channel().on_closed()
5739    }
5740
5741    #[cfg(target_os = "fuchsia")]
5742    fn signal_peer(
5743        &self,
5744        clear_mask: zx::Signals,
5745        set_mask: zx::Signals,
5746    ) -> Result<(), zx_status::Status> {
5747        use fidl::Peered;
5748        self.inner.channel().signal_peer(clear_mask, set_mask)
5749    }
5750}
5751
5752impl RealmBuilderFactoryControlHandle {}
5753
5754#[must_use = "FIDL methods require a response to be sent"]
5755#[derive(Debug)]
5756pub struct RealmBuilderFactoryCreateResponder {
5757    control_handle: std::mem::ManuallyDrop<RealmBuilderFactoryControlHandle>,
5758    tx_id: u32,
5759}
5760
5761/// Set the the channel to be shutdown (see [`RealmBuilderFactoryControlHandle::shutdown`])
5762/// if the responder is dropped without sending a response, so that the client
5763/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5764impl std::ops::Drop for RealmBuilderFactoryCreateResponder {
5765    fn drop(&mut self) {
5766        self.control_handle.shutdown();
5767        // Safety: drops once, never accessed again
5768        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5769    }
5770}
5771
5772impl fidl::endpoints::Responder for RealmBuilderFactoryCreateResponder {
5773    type ControlHandle = RealmBuilderFactoryControlHandle;
5774
5775    fn control_handle(&self) -> &RealmBuilderFactoryControlHandle {
5776        &self.control_handle
5777    }
5778
5779    fn drop_without_shutdown(mut self) {
5780        // Safety: drops once, never accessed again due to mem::forget
5781        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5782        // Prevent Drop from running (which would shut down the channel)
5783        std::mem::forget(self);
5784    }
5785}
5786
5787impl RealmBuilderFactoryCreateResponder {
5788    /// Sends a response to the FIDL transaction.
5789    ///
5790    /// Sets the channel to shutdown if an error occurs.
5791    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
5792        let _result = self.send_raw(result);
5793        if _result.is_err() {
5794            self.control_handle.shutdown();
5795        }
5796        self.drop_without_shutdown();
5797        _result
5798    }
5799
5800    /// Similar to "send" but does not shutdown the channel if an error occurs.
5801    pub fn send_no_shutdown_on_err(
5802        self,
5803        mut result: Result<(), RealmBuilderError>,
5804    ) -> Result<(), fidl::Error> {
5805        let _result = self.send_raw(result);
5806        self.drop_without_shutdown();
5807        _result
5808    }
5809
5810    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
5811        self.control_handle.inner.send::<fidl::encoding::ResultType<
5812            fidl::encoding::EmptyStruct,
5813            RealmBuilderError,
5814        >>(
5815            result,
5816            self.tx_id,
5817            0x73528b1135cb01be,
5818            fidl::encoding::DynamicFlags::empty(),
5819        )
5820    }
5821}
5822
5823#[must_use = "FIDL methods require a response to be sent"]
5824#[derive(Debug)]
5825pub struct RealmBuilderFactoryCreateFromRelativeUrlResponder {
5826    control_handle: std::mem::ManuallyDrop<RealmBuilderFactoryControlHandle>,
5827    tx_id: u32,
5828}
5829
5830/// Set the the channel to be shutdown (see [`RealmBuilderFactoryControlHandle::shutdown`])
5831/// if the responder is dropped without sending a response, so that the client
5832/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5833impl std::ops::Drop for RealmBuilderFactoryCreateFromRelativeUrlResponder {
5834    fn drop(&mut self) {
5835        self.control_handle.shutdown();
5836        // Safety: drops once, never accessed again
5837        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5838    }
5839}
5840
5841impl fidl::endpoints::Responder for RealmBuilderFactoryCreateFromRelativeUrlResponder {
5842    type ControlHandle = RealmBuilderFactoryControlHandle;
5843
5844    fn control_handle(&self) -> &RealmBuilderFactoryControlHandle {
5845        &self.control_handle
5846    }
5847
5848    fn drop_without_shutdown(mut self) {
5849        // Safety: drops once, never accessed again due to mem::forget
5850        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5851        // Prevent Drop from running (which would shut down the channel)
5852        std::mem::forget(self);
5853    }
5854}
5855
5856impl RealmBuilderFactoryCreateFromRelativeUrlResponder {
5857    /// Sends a response to the FIDL transaction.
5858    ///
5859    /// Sets the channel to shutdown if an error occurs.
5860    pub fn send(self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
5861        let _result = self.send_raw(result);
5862        if _result.is_err() {
5863            self.control_handle.shutdown();
5864        }
5865        self.drop_without_shutdown();
5866        _result
5867    }
5868
5869    /// Similar to "send" but does not shutdown the channel if an error occurs.
5870    pub fn send_no_shutdown_on_err(
5871        self,
5872        mut result: Result<(), RealmBuilderError>,
5873    ) -> Result<(), fidl::Error> {
5874        let _result = self.send_raw(result);
5875        self.drop_without_shutdown();
5876        _result
5877    }
5878
5879    fn send_raw(&self, mut result: Result<(), RealmBuilderError>) -> Result<(), fidl::Error> {
5880        self.control_handle.inner.send::<fidl::encoding::ResultType<
5881            fidl::encoding::EmptyStruct,
5882            RealmBuilderError,
5883        >>(
5884            result,
5885            self.tx_id,
5886            0x1cafd9042c54a86b,
5887            fidl::encoding::DynamicFlags::empty(),
5888        )
5889    }
5890}
5891
5892mod internal {
5893    use super::*;
5894
5895    impl fidl::encoding::ResourceTypeMarker for BuilderBuildRequest {
5896        type Borrowed<'a> = &'a mut Self;
5897        fn take_or_borrow<'a>(
5898            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5899        ) -> Self::Borrowed<'a> {
5900            value
5901        }
5902    }
5903
5904    unsafe impl fidl::encoding::TypeMarker for BuilderBuildRequest {
5905        type Owned = Self;
5906
5907        #[inline(always)]
5908        fn inline_align(_context: fidl::encoding::Context) -> usize {
5909            4
5910        }
5911
5912        #[inline(always)]
5913        fn inline_size(_context: fidl::encoding::Context) -> usize {
5914            4
5915        }
5916    }
5917
5918    unsafe impl
5919        fidl::encoding::Encode<BuilderBuildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
5920        for &mut BuilderBuildRequest
5921    {
5922        #[inline]
5923        unsafe fn encode(
5924            self,
5925            encoder: &mut fidl::encoding::Encoder<
5926                '_,
5927                fidl::encoding::DefaultFuchsiaResourceDialect,
5928            >,
5929            offset: usize,
5930            _depth: fidl::encoding::Depth,
5931        ) -> fidl::Result<()> {
5932            encoder.debug_check_bounds::<BuilderBuildRequest>(offset);
5933            // Delegate to tuple encoding.
5934            fidl::encoding::Encode::<
5935                BuilderBuildRequest,
5936                fidl::encoding::DefaultFuchsiaResourceDialect,
5937            >::encode(
5938                (<fidl::encoding::Endpoint<
5939                    fidl::endpoints::ClientEnd<
5940                        fidl_fuchsia_component_runner::ComponentRunnerMarker,
5941                    >,
5942                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5943                    &mut self.runner
5944                ),),
5945                encoder,
5946                offset,
5947                _depth,
5948            )
5949        }
5950    }
5951    unsafe impl<
5952        T0: fidl::encoding::Encode<
5953                fidl::encoding::Endpoint<
5954                    fidl::endpoints::ClientEnd<
5955                        fidl_fuchsia_component_runner::ComponentRunnerMarker,
5956                    >,
5957                >,
5958                fidl::encoding::DefaultFuchsiaResourceDialect,
5959            >,
5960    > fidl::encoding::Encode<BuilderBuildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
5961        for (T0,)
5962    {
5963        #[inline]
5964        unsafe fn encode(
5965            self,
5966            encoder: &mut fidl::encoding::Encoder<
5967                '_,
5968                fidl::encoding::DefaultFuchsiaResourceDialect,
5969            >,
5970            offset: usize,
5971            depth: fidl::encoding::Depth,
5972        ) -> fidl::Result<()> {
5973            encoder.debug_check_bounds::<BuilderBuildRequest>(offset);
5974            // Zero out padding regions. There's no need to apply masks
5975            // because the unmasked parts will be overwritten by fields.
5976            // Write the fields.
5977            self.0.encode(encoder, offset + 0, depth)?;
5978            Ok(())
5979        }
5980    }
5981
5982    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5983        for BuilderBuildRequest
5984    {
5985        #[inline(always)]
5986        fn new_empty() -> Self {
5987            Self {
5988                runner: fidl::new_empty!(
5989                    fidl::encoding::Endpoint<
5990                        fidl::endpoints::ClientEnd<
5991                            fidl_fuchsia_component_runner::ComponentRunnerMarker,
5992                        >,
5993                    >,
5994                    fidl::encoding::DefaultFuchsiaResourceDialect
5995                ),
5996            }
5997        }
5998
5999        #[inline]
6000        unsafe fn decode(
6001            &mut self,
6002            decoder: &mut fidl::encoding::Decoder<
6003                '_,
6004                fidl::encoding::DefaultFuchsiaResourceDialect,
6005            >,
6006            offset: usize,
6007            _depth: fidl::encoding::Depth,
6008        ) -> fidl::Result<()> {
6009            decoder.debug_check_bounds::<Self>(offset);
6010            // Verify that padding bytes are zero.
6011            fidl::decode!(
6012                fidl::encoding::Endpoint<
6013                    fidl::endpoints::ClientEnd<
6014                        fidl_fuchsia_component_runner::ComponentRunnerMarker,
6015                    >,
6016                >,
6017                fidl::encoding::DefaultFuchsiaResourceDialect,
6018                &mut self.runner,
6019                decoder,
6020                offset + 0,
6021                _depth
6022            )?;
6023            Ok(())
6024        }
6025    }
6026
6027    impl fidl::encoding::ResourceTypeMarker for DirectoryContents {
6028        type Borrowed<'a> = &'a mut Self;
6029        fn take_or_borrow<'a>(
6030            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6031        ) -> Self::Borrowed<'a> {
6032            value
6033        }
6034    }
6035
6036    unsafe impl fidl::encoding::TypeMarker for DirectoryContents {
6037        type Owned = Self;
6038
6039        #[inline(always)]
6040        fn inline_align(_context: fidl::encoding::Context) -> usize {
6041            8
6042        }
6043
6044        #[inline(always)]
6045        fn inline_size(_context: fidl::encoding::Context) -> usize {
6046            16
6047        }
6048    }
6049
6050    unsafe impl
6051        fidl::encoding::Encode<DirectoryContents, fidl::encoding::DefaultFuchsiaResourceDialect>
6052        for &mut DirectoryContents
6053    {
6054        #[inline]
6055        unsafe fn encode(
6056            self,
6057            encoder: &mut fidl::encoding::Encoder<
6058                '_,
6059                fidl::encoding::DefaultFuchsiaResourceDialect,
6060            >,
6061            offset: usize,
6062            _depth: fidl::encoding::Depth,
6063        ) -> fidl::Result<()> {
6064            encoder.debug_check_bounds::<DirectoryContents>(offset);
6065            // Delegate to tuple encoding.
6066            fidl::encoding::Encode::<DirectoryContents, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6067                (
6068                    <fidl::encoding::Vector<DirectoryEntry, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
6069                ),
6070                encoder, offset, _depth
6071            )
6072        }
6073    }
6074    unsafe impl<
6075        T0: fidl::encoding::Encode<
6076                fidl::encoding::Vector<DirectoryEntry, 1024>,
6077                fidl::encoding::DefaultFuchsiaResourceDialect,
6078            >,
6079    > fidl::encoding::Encode<DirectoryContents, fidl::encoding::DefaultFuchsiaResourceDialect>
6080        for (T0,)
6081    {
6082        #[inline]
6083        unsafe fn encode(
6084            self,
6085            encoder: &mut fidl::encoding::Encoder<
6086                '_,
6087                fidl::encoding::DefaultFuchsiaResourceDialect,
6088            >,
6089            offset: usize,
6090            depth: fidl::encoding::Depth,
6091        ) -> fidl::Result<()> {
6092            encoder.debug_check_bounds::<DirectoryContents>(offset);
6093            // Zero out padding regions. There's no need to apply masks
6094            // because the unmasked parts will be overwritten by fields.
6095            // Write the fields.
6096            self.0.encode(encoder, offset + 0, depth)?;
6097            Ok(())
6098        }
6099    }
6100
6101    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6102        for DirectoryContents
6103    {
6104        #[inline(always)]
6105        fn new_empty() -> Self {
6106            Self {
6107                entries: fidl::new_empty!(fidl::encoding::Vector<DirectoryEntry, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
6108            }
6109        }
6110
6111        #[inline]
6112        unsafe fn decode(
6113            &mut self,
6114            decoder: &mut fidl::encoding::Decoder<
6115                '_,
6116                fidl::encoding::DefaultFuchsiaResourceDialect,
6117            >,
6118            offset: usize,
6119            _depth: fidl::encoding::Depth,
6120        ) -> fidl::Result<()> {
6121            decoder.debug_check_bounds::<Self>(offset);
6122            // Verify that padding bytes are zero.
6123            fidl::decode!(fidl::encoding::Vector<DirectoryEntry, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.entries, decoder, offset + 0, _depth)?;
6124            Ok(())
6125        }
6126    }
6127
6128    impl fidl::encoding::ResourceTypeMarker for DirectoryEntry {
6129        type Borrowed<'a> = &'a mut Self;
6130        fn take_or_borrow<'a>(
6131            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6132        ) -> Self::Borrowed<'a> {
6133            value
6134        }
6135    }
6136
6137    unsafe impl fidl::encoding::TypeMarker for DirectoryEntry {
6138        type Owned = Self;
6139
6140        #[inline(always)]
6141        fn inline_align(_context: fidl::encoding::Context) -> usize {
6142            8
6143        }
6144
6145        #[inline(always)]
6146        fn inline_size(_context: fidl::encoding::Context) -> usize {
6147            32
6148        }
6149    }
6150
6151    unsafe impl
6152        fidl::encoding::Encode<DirectoryEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
6153        for &mut DirectoryEntry
6154    {
6155        #[inline]
6156        unsafe fn encode(
6157            self,
6158            encoder: &mut fidl::encoding::Encoder<
6159                '_,
6160                fidl::encoding::DefaultFuchsiaResourceDialect,
6161            >,
6162            offset: usize,
6163            _depth: fidl::encoding::Depth,
6164        ) -> fidl::Result<()> {
6165            encoder.debug_check_bounds::<DirectoryEntry>(offset);
6166            // Delegate to tuple encoding.
6167            fidl::encoding::Encode::<DirectoryEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6168                (
6169                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.file_path),
6170                    <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.file_contents),
6171                ),
6172                encoder, offset, _depth
6173            )
6174        }
6175    }
6176    unsafe impl<
6177        T0: fidl::encoding::Encode<
6178                fidl::encoding::BoundedString<255>,
6179                fidl::encoding::DefaultFuchsiaResourceDialect,
6180            >,
6181        T1: fidl::encoding::Encode<
6182                fidl_fuchsia_mem::Buffer,
6183                fidl::encoding::DefaultFuchsiaResourceDialect,
6184            >,
6185    > fidl::encoding::Encode<DirectoryEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
6186        for (T0, T1)
6187    {
6188        #[inline]
6189        unsafe fn encode(
6190            self,
6191            encoder: &mut fidl::encoding::Encoder<
6192                '_,
6193                fidl::encoding::DefaultFuchsiaResourceDialect,
6194            >,
6195            offset: usize,
6196            depth: fidl::encoding::Depth,
6197        ) -> fidl::Result<()> {
6198            encoder.debug_check_bounds::<DirectoryEntry>(offset);
6199            // Zero out padding regions. There's no need to apply masks
6200            // because the unmasked parts will be overwritten by fields.
6201            // Write the fields.
6202            self.0.encode(encoder, offset + 0, depth)?;
6203            self.1.encode(encoder, offset + 16, depth)?;
6204            Ok(())
6205        }
6206    }
6207
6208    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6209        for DirectoryEntry
6210    {
6211        #[inline(always)]
6212        fn new_empty() -> Self {
6213            Self {
6214                file_path: fidl::new_empty!(
6215                    fidl::encoding::BoundedString<255>,
6216                    fidl::encoding::DefaultFuchsiaResourceDialect
6217                ),
6218                file_contents: fidl::new_empty!(
6219                    fidl_fuchsia_mem::Buffer,
6220                    fidl::encoding::DefaultFuchsiaResourceDialect
6221                ),
6222            }
6223        }
6224
6225        #[inline]
6226        unsafe fn decode(
6227            &mut self,
6228            decoder: &mut fidl::encoding::Decoder<
6229                '_,
6230                fidl::encoding::DefaultFuchsiaResourceDialect,
6231            >,
6232            offset: usize,
6233            _depth: fidl::encoding::Depth,
6234        ) -> fidl::Result<()> {
6235            decoder.debug_check_bounds::<Self>(offset);
6236            // Verify that padding bytes are zero.
6237            fidl::decode!(
6238                fidl::encoding::BoundedString<255>,
6239                fidl::encoding::DefaultFuchsiaResourceDialect,
6240                &mut self.file_path,
6241                decoder,
6242                offset + 0,
6243                _depth
6244            )?;
6245            fidl::decode!(
6246                fidl_fuchsia_mem::Buffer,
6247                fidl::encoding::DefaultFuchsiaResourceDialect,
6248                &mut self.file_contents,
6249                decoder,
6250                offset + 16,
6251                _depth
6252            )?;
6253            Ok(())
6254        }
6255    }
6256
6257    impl fidl::encoding::ResourceTypeMarker for RealmAddChildRealmFromDeclRequest {
6258        type Borrowed<'a> = &'a mut Self;
6259        fn take_or_borrow<'a>(
6260            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6261        ) -> Self::Borrowed<'a> {
6262            value
6263        }
6264    }
6265
6266    unsafe impl fidl::encoding::TypeMarker for RealmAddChildRealmFromDeclRequest {
6267        type Owned = Self;
6268
6269        #[inline(always)]
6270        fn inline_align(_context: fidl::encoding::Context) -> usize {
6271            8
6272        }
6273
6274        #[inline(always)]
6275        fn inline_size(_context: fidl::encoding::Context) -> usize {
6276            56
6277        }
6278    }
6279
6280    unsafe impl
6281        fidl::encoding::Encode<
6282            RealmAddChildRealmFromDeclRequest,
6283            fidl::encoding::DefaultFuchsiaResourceDialect,
6284        > for &mut RealmAddChildRealmFromDeclRequest
6285    {
6286        #[inline]
6287        unsafe fn encode(
6288            self,
6289            encoder: &mut fidl::encoding::Encoder<
6290                '_,
6291                fidl::encoding::DefaultFuchsiaResourceDialect,
6292            >,
6293            offset: usize,
6294            _depth: fidl::encoding::Depth,
6295        ) -> fidl::Result<()> {
6296            encoder.debug_check_bounds::<RealmAddChildRealmFromDeclRequest>(offset);
6297            // Delegate to tuple encoding.
6298            fidl::encoding::Encode::<RealmAddChildRealmFromDeclRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6299                (
6300                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
6301                    <fidl_fuchsia_component_decl::Component as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
6302                    <ChildOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
6303                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.child_realm),
6304                ),
6305                encoder, offset, _depth
6306            )
6307        }
6308    }
6309    unsafe impl<
6310        T0: fidl::encoding::Encode<
6311                fidl::encoding::BoundedString<255>,
6312                fidl::encoding::DefaultFuchsiaResourceDialect,
6313            >,
6314        T1: fidl::encoding::Encode<
6315                fidl_fuchsia_component_decl::Component,
6316                fidl::encoding::DefaultFuchsiaResourceDialect,
6317            >,
6318        T2: fidl::encoding::Encode<ChildOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
6319        T3: fidl::encoding::Encode<
6320                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6321                fidl::encoding::DefaultFuchsiaResourceDialect,
6322            >,
6323    >
6324        fidl::encoding::Encode<
6325            RealmAddChildRealmFromDeclRequest,
6326            fidl::encoding::DefaultFuchsiaResourceDialect,
6327        > for (T0, T1, T2, T3)
6328    {
6329        #[inline]
6330        unsafe fn encode(
6331            self,
6332            encoder: &mut fidl::encoding::Encoder<
6333                '_,
6334                fidl::encoding::DefaultFuchsiaResourceDialect,
6335            >,
6336            offset: usize,
6337            depth: fidl::encoding::Depth,
6338        ) -> fidl::Result<()> {
6339            encoder.debug_check_bounds::<RealmAddChildRealmFromDeclRequest>(offset);
6340            // Zero out padding regions. There's no need to apply masks
6341            // because the unmasked parts will be overwritten by fields.
6342            unsafe {
6343                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
6344                (ptr as *mut u64).write_unaligned(0);
6345            }
6346            // Write the fields.
6347            self.0.encode(encoder, offset + 0, depth)?;
6348            self.1.encode(encoder, offset + 16, depth)?;
6349            self.2.encode(encoder, offset + 32, depth)?;
6350            self.3.encode(encoder, offset + 48, depth)?;
6351            Ok(())
6352        }
6353    }
6354
6355    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6356        for RealmAddChildRealmFromDeclRequest
6357    {
6358        #[inline(always)]
6359        fn new_empty() -> Self {
6360            Self {
6361                name: fidl::new_empty!(
6362                    fidl::encoding::BoundedString<255>,
6363                    fidl::encoding::DefaultFuchsiaResourceDialect
6364                ),
6365                decl: fidl::new_empty!(
6366                    fidl_fuchsia_component_decl::Component,
6367                    fidl::encoding::DefaultFuchsiaResourceDialect
6368                ),
6369                options: fidl::new_empty!(
6370                    ChildOptions,
6371                    fidl::encoding::DefaultFuchsiaResourceDialect
6372                ),
6373                child_realm: fidl::new_empty!(
6374                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6375                    fidl::encoding::DefaultFuchsiaResourceDialect
6376                ),
6377            }
6378        }
6379
6380        #[inline]
6381        unsafe fn decode(
6382            &mut self,
6383            decoder: &mut fidl::encoding::Decoder<
6384                '_,
6385                fidl::encoding::DefaultFuchsiaResourceDialect,
6386            >,
6387            offset: usize,
6388            _depth: fidl::encoding::Depth,
6389        ) -> fidl::Result<()> {
6390            decoder.debug_check_bounds::<Self>(offset);
6391            // Verify that padding bytes are zero.
6392            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
6393            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6394            let mask = 0xffffffff00000000u64;
6395            let maskedval = padval & mask;
6396            if maskedval != 0 {
6397                return Err(fidl::Error::NonZeroPadding {
6398                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
6399                });
6400            }
6401            fidl::decode!(
6402                fidl::encoding::BoundedString<255>,
6403                fidl::encoding::DefaultFuchsiaResourceDialect,
6404                &mut self.name,
6405                decoder,
6406                offset + 0,
6407                _depth
6408            )?;
6409            fidl::decode!(
6410                fidl_fuchsia_component_decl::Component,
6411                fidl::encoding::DefaultFuchsiaResourceDialect,
6412                &mut self.decl,
6413                decoder,
6414                offset + 16,
6415                _depth
6416            )?;
6417            fidl::decode!(
6418                ChildOptions,
6419                fidl::encoding::DefaultFuchsiaResourceDialect,
6420                &mut self.options,
6421                decoder,
6422                offset + 32,
6423                _depth
6424            )?;
6425            fidl::decode!(
6426                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6427                fidl::encoding::DefaultFuchsiaResourceDialect,
6428                &mut self.child_realm,
6429                decoder,
6430                offset + 48,
6431                _depth
6432            )?;
6433            Ok(())
6434        }
6435    }
6436
6437    impl fidl::encoding::ResourceTypeMarker for RealmAddChildRealmFromRelativeUrlRequest {
6438        type Borrowed<'a> = &'a mut Self;
6439        fn take_or_borrow<'a>(
6440            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6441        ) -> Self::Borrowed<'a> {
6442            value
6443        }
6444    }
6445
6446    unsafe impl fidl::encoding::TypeMarker for RealmAddChildRealmFromRelativeUrlRequest {
6447        type Owned = Self;
6448
6449        #[inline(always)]
6450        fn inline_align(_context: fidl::encoding::Context) -> usize {
6451            8
6452        }
6453
6454        #[inline(always)]
6455        fn inline_size(_context: fidl::encoding::Context) -> usize {
6456            56
6457        }
6458    }
6459
6460    unsafe impl
6461        fidl::encoding::Encode<
6462            RealmAddChildRealmFromRelativeUrlRequest,
6463            fidl::encoding::DefaultFuchsiaResourceDialect,
6464        > for &mut RealmAddChildRealmFromRelativeUrlRequest
6465    {
6466        #[inline]
6467        unsafe fn encode(
6468            self,
6469            encoder: &mut fidl::encoding::Encoder<
6470                '_,
6471                fidl::encoding::DefaultFuchsiaResourceDialect,
6472            >,
6473            offset: usize,
6474            _depth: fidl::encoding::Depth,
6475        ) -> fidl::Result<()> {
6476            encoder.debug_check_bounds::<RealmAddChildRealmFromRelativeUrlRequest>(offset);
6477            // Delegate to tuple encoding.
6478            fidl::encoding::Encode::<RealmAddChildRealmFromRelativeUrlRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6479                (
6480                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
6481                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_url),
6482                    <ChildOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
6483                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.child_realm),
6484                ),
6485                encoder, offset, _depth
6486            )
6487        }
6488    }
6489    unsafe impl<
6490        T0: fidl::encoding::Encode<
6491                fidl::encoding::BoundedString<255>,
6492                fidl::encoding::DefaultFuchsiaResourceDialect,
6493            >,
6494        T1: fidl::encoding::Encode<
6495                fidl::encoding::BoundedString<4096>,
6496                fidl::encoding::DefaultFuchsiaResourceDialect,
6497            >,
6498        T2: fidl::encoding::Encode<ChildOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
6499        T3: fidl::encoding::Encode<
6500                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6501                fidl::encoding::DefaultFuchsiaResourceDialect,
6502            >,
6503    >
6504        fidl::encoding::Encode<
6505            RealmAddChildRealmFromRelativeUrlRequest,
6506            fidl::encoding::DefaultFuchsiaResourceDialect,
6507        > for (T0, T1, T2, T3)
6508    {
6509        #[inline]
6510        unsafe fn encode(
6511            self,
6512            encoder: &mut fidl::encoding::Encoder<
6513                '_,
6514                fidl::encoding::DefaultFuchsiaResourceDialect,
6515            >,
6516            offset: usize,
6517            depth: fidl::encoding::Depth,
6518        ) -> fidl::Result<()> {
6519            encoder.debug_check_bounds::<RealmAddChildRealmFromRelativeUrlRequest>(offset);
6520            // Zero out padding regions. There's no need to apply masks
6521            // because the unmasked parts will be overwritten by fields.
6522            unsafe {
6523                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
6524                (ptr as *mut u64).write_unaligned(0);
6525            }
6526            // Write the fields.
6527            self.0.encode(encoder, offset + 0, depth)?;
6528            self.1.encode(encoder, offset + 16, depth)?;
6529            self.2.encode(encoder, offset + 32, depth)?;
6530            self.3.encode(encoder, offset + 48, depth)?;
6531            Ok(())
6532        }
6533    }
6534
6535    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6536        for RealmAddChildRealmFromRelativeUrlRequest
6537    {
6538        #[inline(always)]
6539        fn new_empty() -> Self {
6540            Self {
6541                name: fidl::new_empty!(
6542                    fidl::encoding::BoundedString<255>,
6543                    fidl::encoding::DefaultFuchsiaResourceDialect
6544                ),
6545                relative_url: fidl::new_empty!(
6546                    fidl::encoding::BoundedString<4096>,
6547                    fidl::encoding::DefaultFuchsiaResourceDialect
6548                ),
6549                options: fidl::new_empty!(
6550                    ChildOptions,
6551                    fidl::encoding::DefaultFuchsiaResourceDialect
6552                ),
6553                child_realm: fidl::new_empty!(
6554                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6555                    fidl::encoding::DefaultFuchsiaResourceDialect
6556                ),
6557            }
6558        }
6559
6560        #[inline]
6561        unsafe fn decode(
6562            &mut self,
6563            decoder: &mut fidl::encoding::Decoder<
6564                '_,
6565                fidl::encoding::DefaultFuchsiaResourceDialect,
6566            >,
6567            offset: usize,
6568            _depth: fidl::encoding::Depth,
6569        ) -> fidl::Result<()> {
6570            decoder.debug_check_bounds::<Self>(offset);
6571            // Verify that padding bytes are zero.
6572            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
6573            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6574            let mask = 0xffffffff00000000u64;
6575            let maskedval = padval & mask;
6576            if maskedval != 0 {
6577                return Err(fidl::Error::NonZeroPadding {
6578                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
6579                });
6580            }
6581            fidl::decode!(
6582                fidl::encoding::BoundedString<255>,
6583                fidl::encoding::DefaultFuchsiaResourceDialect,
6584                &mut self.name,
6585                decoder,
6586                offset + 0,
6587                _depth
6588            )?;
6589            fidl::decode!(
6590                fidl::encoding::BoundedString<4096>,
6591                fidl::encoding::DefaultFuchsiaResourceDialect,
6592                &mut self.relative_url,
6593                decoder,
6594                offset + 16,
6595                _depth
6596            )?;
6597            fidl::decode!(
6598                ChildOptions,
6599                fidl::encoding::DefaultFuchsiaResourceDialect,
6600                &mut self.options,
6601                decoder,
6602                offset + 32,
6603                _depth
6604            )?;
6605            fidl::decode!(
6606                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6607                fidl::encoding::DefaultFuchsiaResourceDialect,
6608                &mut self.child_realm,
6609                decoder,
6610                offset + 48,
6611                _depth
6612            )?;
6613            Ok(())
6614        }
6615    }
6616
6617    impl fidl::encoding::ResourceTypeMarker for RealmAddChildRealmRequest {
6618        type Borrowed<'a> = &'a mut Self;
6619        fn take_or_borrow<'a>(
6620            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6621        ) -> Self::Borrowed<'a> {
6622            value
6623        }
6624    }
6625
6626    unsafe impl fidl::encoding::TypeMarker for RealmAddChildRealmRequest {
6627        type Owned = Self;
6628
6629        #[inline(always)]
6630        fn inline_align(_context: fidl::encoding::Context) -> usize {
6631            8
6632        }
6633
6634        #[inline(always)]
6635        fn inline_size(_context: fidl::encoding::Context) -> usize {
6636            40
6637        }
6638    }
6639
6640    unsafe impl
6641        fidl::encoding::Encode<
6642            RealmAddChildRealmRequest,
6643            fidl::encoding::DefaultFuchsiaResourceDialect,
6644        > for &mut RealmAddChildRealmRequest
6645    {
6646        #[inline]
6647        unsafe fn encode(
6648            self,
6649            encoder: &mut fidl::encoding::Encoder<
6650                '_,
6651                fidl::encoding::DefaultFuchsiaResourceDialect,
6652            >,
6653            offset: usize,
6654            _depth: fidl::encoding::Depth,
6655        ) -> fidl::Result<()> {
6656            encoder.debug_check_bounds::<RealmAddChildRealmRequest>(offset);
6657            // Delegate to tuple encoding.
6658            fidl::encoding::Encode::<RealmAddChildRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6659                (
6660                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
6661                    <ChildOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
6662                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.child_realm),
6663                ),
6664                encoder, offset, _depth
6665            )
6666        }
6667    }
6668    unsafe impl<
6669        T0: fidl::encoding::Encode<
6670                fidl::encoding::BoundedString<255>,
6671                fidl::encoding::DefaultFuchsiaResourceDialect,
6672            >,
6673        T1: fidl::encoding::Encode<ChildOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
6674        T2: fidl::encoding::Encode<
6675                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6676                fidl::encoding::DefaultFuchsiaResourceDialect,
6677            >,
6678    >
6679        fidl::encoding::Encode<
6680            RealmAddChildRealmRequest,
6681            fidl::encoding::DefaultFuchsiaResourceDialect,
6682        > for (T0, T1, T2)
6683    {
6684        #[inline]
6685        unsafe fn encode(
6686            self,
6687            encoder: &mut fidl::encoding::Encoder<
6688                '_,
6689                fidl::encoding::DefaultFuchsiaResourceDialect,
6690            >,
6691            offset: usize,
6692            depth: fidl::encoding::Depth,
6693        ) -> fidl::Result<()> {
6694            encoder.debug_check_bounds::<RealmAddChildRealmRequest>(offset);
6695            // Zero out padding regions. There's no need to apply masks
6696            // because the unmasked parts will be overwritten by fields.
6697            unsafe {
6698                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
6699                (ptr as *mut u64).write_unaligned(0);
6700            }
6701            // Write the fields.
6702            self.0.encode(encoder, offset + 0, depth)?;
6703            self.1.encode(encoder, offset + 16, depth)?;
6704            self.2.encode(encoder, offset + 32, depth)?;
6705            Ok(())
6706        }
6707    }
6708
6709    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6710        for RealmAddChildRealmRequest
6711    {
6712        #[inline(always)]
6713        fn new_empty() -> Self {
6714            Self {
6715                name: fidl::new_empty!(
6716                    fidl::encoding::BoundedString<255>,
6717                    fidl::encoding::DefaultFuchsiaResourceDialect
6718                ),
6719                options: fidl::new_empty!(
6720                    ChildOptions,
6721                    fidl::encoding::DefaultFuchsiaResourceDialect
6722                ),
6723                child_realm: fidl::new_empty!(
6724                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6725                    fidl::encoding::DefaultFuchsiaResourceDialect
6726                ),
6727            }
6728        }
6729
6730        #[inline]
6731        unsafe fn decode(
6732            &mut self,
6733            decoder: &mut fidl::encoding::Decoder<
6734                '_,
6735                fidl::encoding::DefaultFuchsiaResourceDialect,
6736            >,
6737            offset: usize,
6738            _depth: fidl::encoding::Depth,
6739        ) -> fidl::Result<()> {
6740            decoder.debug_check_bounds::<Self>(offset);
6741            // Verify that padding bytes are zero.
6742            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
6743            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6744            let mask = 0xffffffff00000000u64;
6745            let maskedval = padval & mask;
6746            if maskedval != 0 {
6747                return Err(fidl::Error::NonZeroPadding {
6748                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
6749                });
6750            }
6751            fidl::decode!(
6752                fidl::encoding::BoundedString<255>,
6753                fidl::encoding::DefaultFuchsiaResourceDialect,
6754                &mut self.name,
6755                decoder,
6756                offset + 0,
6757                _depth
6758            )?;
6759            fidl::decode!(
6760                ChildOptions,
6761                fidl::encoding::DefaultFuchsiaResourceDialect,
6762                &mut self.options,
6763                decoder,
6764                offset + 16,
6765                _depth
6766            )?;
6767            fidl::decode!(
6768                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
6769                fidl::encoding::DefaultFuchsiaResourceDialect,
6770                &mut self.child_realm,
6771                decoder,
6772                offset + 32,
6773                _depth
6774            )?;
6775            Ok(())
6776        }
6777    }
6778
6779    impl fidl::encoding::ResourceTypeMarker for RealmAddStorageRequest {
6780        type Borrowed<'a> = &'a mut Self;
6781        fn take_or_borrow<'a>(
6782            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6783        ) -> Self::Borrowed<'a> {
6784            value
6785        }
6786    }
6787
6788    unsafe impl fidl::encoding::TypeMarker for RealmAddStorageRequest {
6789        type Owned = Self;
6790
6791        #[inline(always)]
6792        fn inline_align(_context: fidl::encoding::Context) -> usize {
6793            8
6794        }
6795
6796        #[inline(always)]
6797        fn inline_size(_context: fidl::encoding::Context) -> usize {
6798            40
6799        }
6800    }
6801
6802    unsafe impl
6803        fidl::encoding::Encode<
6804            RealmAddStorageRequest,
6805            fidl::encoding::DefaultFuchsiaResourceDialect,
6806        > for &mut RealmAddStorageRequest
6807    {
6808        #[inline]
6809        unsafe fn encode(
6810            self,
6811            encoder: &mut fidl::encoding::Encoder<
6812                '_,
6813                fidl::encoding::DefaultFuchsiaResourceDialect,
6814            >,
6815            offset: usize,
6816            _depth: fidl::encoding::Depth,
6817        ) -> fidl::Result<()> {
6818            encoder.debug_check_bounds::<RealmAddStorageRequest>(offset);
6819            // Delegate to tuple encoding.
6820            fidl::encoding::Encode::<RealmAddStorageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6821                (
6822                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
6823                    <fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Ref> as fidl::encoding::ValueTypeMarker>::borrow(&self.to),
6824                    <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.storage_admin),
6825                ),
6826                encoder, offset, _depth
6827            )
6828        }
6829    }
6830    unsafe impl<
6831        T0: fidl::encoding::Encode<
6832                fidl::encoding::BoundedString<255>,
6833                fidl::encoding::DefaultFuchsiaResourceDialect,
6834            >,
6835        T1: fidl::encoding::Encode<
6836                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Ref>,
6837                fidl::encoding::DefaultFuchsiaResourceDialect,
6838            >,
6839        T2: fidl::encoding::Encode<
6840                fidl::encoding::Optional<
6841                    fidl::encoding::Endpoint<
6842                        fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>,
6843                    >,
6844                >,
6845                fidl::encoding::DefaultFuchsiaResourceDialect,
6846            >,
6847    >
6848        fidl::encoding::Encode<
6849            RealmAddStorageRequest,
6850            fidl::encoding::DefaultFuchsiaResourceDialect,
6851        > for (T0, T1, T2)
6852    {
6853        #[inline]
6854        unsafe fn encode(
6855            self,
6856            encoder: &mut fidl::encoding::Encoder<
6857                '_,
6858                fidl::encoding::DefaultFuchsiaResourceDialect,
6859            >,
6860            offset: usize,
6861            depth: fidl::encoding::Depth,
6862        ) -> fidl::Result<()> {
6863            encoder.debug_check_bounds::<RealmAddStorageRequest>(offset);
6864            // Zero out padding regions. There's no need to apply masks
6865            // because the unmasked parts will be overwritten by fields.
6866            unsafe {
6867                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
6868                (ptr as *mut u64).write_unaligned(0);
6869            }
6870            // Write the fields.
6871            self.0.encode(encoder, offset + 0, depth)?;
6872            self.1.encode(encoder, offset + 16, depth)?;
6873            self.2.encode(encoder, offset + 32, depth)?;
6874            Ok(())
6875        }
6876    }
6877
6878    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6879        for RealmAddStorageRequest
6880    {
6881        #[inline(always)]
6882        fn new_empty() -> Self {
6883            Self {
6884                name: fidl::new_empty!(
6885                    fidl::encoding::BoundedString<255>,
6886                    fidl::encoding::DefaultFuchsiaResourceDialect
6887                ),
6888                to: fidl::new_empty!(
6889                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Ref>,
6890                    fidl::encoding::DefaultFuchsiaResourceDialect
6891                ),
6892                storage_admin: fidl::new_empty!(
6893                    fidl::encoding::Optional<
6894                        fidl::encoding::Endpoint<
6895                            fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>,
6896                        >,
6897                    >,
6898                    fidl::encoding::DefaultFuchsiaResourceDialect
6899                ),
6900            }
6901        }
6902
6903        #[inline]
6904        unsafe fn decode(
6905            &mut self,
6906            decoder: &mut fidl::encoding::Decoder<
6907                '_,
6908                fidl::encoding::DefaultFuchsiaResourceDialect,
6909            >,
6910            offset: usize,
6911            _depth: fidl::encoding::Depth,
6912        ) -> fidl::Result<()> {
6913            decoder.debug_check_bounds::<Self>(offset);
6914            // Verify that padding bytes are zero.
6915            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
6916            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6917            let mask = 0xffffffff00000000u64;
6918            let maskedval = padval & mask;
6919            if maskedval != 0 {
6920                return Err(fidl::Error::NonZeroPadding {
6921                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
6922                });
6923            }
6924            fidl::decode!(
6925                fidl::encoding::BoundedString<255>,
6926                fidl::encoding::DefaultFuchsiaResourceDialect,
6927                &mut self.name,
6928                decoder,
6929                offset + 0,
6930                _depth
6931            )?;
6932            fidl::decode!(
6933                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Ref>,
6934                fidl::encoding::DefaultFuchsiaResourceDialect,
6935                &mut self.to,
6936                decoder,
6937                offset + 16,
6938                _depth
6939            )?;
6940            fidl::decode!(
6941                fidl::encoding::Optional<
6942                    fidl::encoding::Endpoint<
6943                        fidl::endpoints::ServerEnd<fidl_fuchsia_component::StorageAdminMarker>,
6944                    >,
6945                >,
6946                fidl::encoding::DefaultFuchsiaResourceDialect,
6947                &mut self.storage_admin,
6948                decoder,
6949                offset + 32,
6950                _depth
6951            )?;
6952            Ok(())
6953        }
6954    }
6955
6956    impl fidl::encoding::ResourceTypeMarker for RealmBuilderFactoryCreateFromRelativeUrlRequest {
6957        type Borrowed<'a> = &'a mut Self;
6958        fn take_or_borrow<'a>(
6959            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6960        ) -> Self::Borrowed<'a> {
6961            value
6962        }
6963    }
6964
6965    unsafe impl fidl::encoding::TypeMarker for RealmBuilderFactoryCreateFromRelativeUrlRequest {
6966        type Owned = Self;
6967
6968        #[inline(always)]
6969        fn inline_align(_context: fidl::encoding::Context) -> usize {
6970            8
6971        }
6972
6973        #[inline(always)]
6974        fn inline_size(_context: fidl::encoding::Context) -> usize {
6975            32
6976        }
6977    }
6978
6979    unsafe impl
6980        fidl::encoding::Encode<
6981            RealmBuilderFactoryCreateFromRelativeUrlRequest,
6982            fidl::encoding::DefaultFuchsiaResourceDialect,
6983        > for &mut RealmBuilderFactoryCreateFromRelativeUrlRequest
6984    {
6985        #[inline]
6986        unsafe fn encode(
6987            self,
6988            encoder: &mut fidl::encoding::Encoder<
6989                '_,
6990                fidl::encoding::DefaultFuchsiaResourceDialect,
6991            >,
6992            offset: usize,
6993            _depth: fidl::encoding::Depth,
6994        ) -> fidl::Result<()> {
6995            encoder.debug_check_bounds::<RealmBuilderFactoryCreateFromRelativeUrlRequest>(offset);
6996            // Delegate to tuple encoding.
6997            fidl::encoding::Encode::<RealmBuilderFactoryCreateFromRelativeUrlRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6998                (
6999                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.pkg_dir_handle),
7000                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_url),
7001                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.realm_server_end),
7002                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BuilderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.builder_server_end),
7003                ),
7004                encoder, offset, _depth
7005            )
7006        }
7007    }
7008    unsafe impl<
7009        T0: fidl::encoding::Encode<
7010                fidl::encoding::Endpoint<
7011                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7012                >,
7013                fidl::encoding::DefaultFuchsiaResourceDialect,
7014            >,
7015        T1: fidl::encoding::Encode<
7016                fidl::encoding::BoundedString<4096>,
7017                fidl::encoding::DefaultFuchsiaResourceDialect,
7018            >,
7019        T2: fidl::encoding::Encode<
7020                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
7021                fidl::encoding::DefaultFuchsiaResourceDialect,
7022            >,
7023        T3: fidl::encoding::Encode<
7024                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BuilderMarker>>,
7025                fidl::encoding::DefaultFuchsiaResourceDialect,
7026            >,
7027    >
7028        fidl::encoding::Encode<
7029            RealmBuilderFactoryCreateFromRelativeUrlRequest,
7030            fidl::encoding::DefaultFuchsiaResourceDialect,
7031        > for (T0, T1, T2, T3)
7032    {
7033        #[inline]
7034        unsafe fn encode(
7035            self,
7036            encoder: &mut fidl::encoding::Encoder<
7037                '_,
7038                fidl::encoding::DefaultFuchsiaResourceDialect,
7039            >,
7040            offset: usize,
7041            depth: fidl::encoding::Depth,
7042        ) -> fidl::Result<()> {
7043            encoder.debug_check_bounds::<RealmBuilderFactoryCreateFromRelativeUrlRequest>(offset);
7044            // Zero out padding regions. There's no need to apply masks
7045            // because the unmasked parts will be overwritten by fields.
7046            unsafe {
7047                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7048                (ptr as *mut u64).write_unaligned(0);
7049            }
7050            // Write the fields.
7051            self.0.encode(encoder, offset + 0, depth)?;
7052            self.1.encode(encoder, offset + 8, depth)?;
7053            self.2.encode(encoder, offset + 24, depth)?;
7054            self.3.encode(encoder, offset + 28, depth)?;
7055            Ok(())
7056        }
7057    }
7058
7059    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7060        for RealmBuilderFactoryCreateFromRelativeUrlRequest
7061    {
7062        #[inline(always)]
7063        fn new_empty() -> Self {
7064            Self {
7065                pkg_dir_handle: fidl::new_empty!(
7066                    fidl::encoding::Endpoint<
7067                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7068                    >,
7069                    fidl::encoding::DefaultFuchsiaResourceDialect
7070                ),
7071                relative_url: fidl::new_empty!(
7072                    fidl::encoding::BoundedString<4096>,
7073                    fidl::encoding::DefaultFuchsiaResourceDialect
7074                ),
7075                realm_server_end: fidl::new_empty!(
7076                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
7077                    fidl::encoding::DefaultFuchsiaResourceDialect
7078                ),
7079                builder_server_end: fidl::new_empty!(
7080                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BuilderMarker>>,
7081                    fidl::encoding::DefaultFuchsiaResourceDialect
7082                ),
7083            }
7084        }
7085
7086        #[inline]
7087        unsafe fn decode(
7088            &mut self,
7089            decoder: &mut fidl::encoding::Decoder<
7090                '_,
7091                fidl::encoding::DefaultFuchsiaResourceDialect,
7092            >,
7093            offset: usize,
7094            _depth: fidl::encoding::Depth,
7095        ) -> fidl::Result<()> {
7096            decoder.debug_check_bounds::<Self>(offset);
7097            // Verify that padding bytes are zero.
7098            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7099            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7100            let mask = 0xffffffff00000000u64;
7101            let maskedval = padval & mask;
7102            if maskedval != 0 {
7103                return Err(fidl::Error::NonZeroPadding {
7104                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7105                });
7106            }
7107            fidl::decode!(
7108                fidl::encoding::Endpoint<
7109                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7110                >,
7111                fidl::encoding::DefaultFuchsiaResourceDialect,
7112                &mut self.pkg_dir_handle,
7113                decoder,
7114                offset + 0,
7115                _depth
7116            )?;
7117            fidl::decode!(
7118                fidl::encoding::BoundedString<4096>,
7119                fidl::encoding::DefaultFuchsiaResourceDialect,
7120                &mut self.relative_url,
7121                decoder,
7122                offset + 8,
7123                _depth
7124            )?;
7125            fidl::decode!(
7126                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
7127                fidl::encoding::DefaultFuchsiaResourceDialect,
7128                &mut self.realm_server_end,
7129                decoder,
7130                offset + 24,
7131                _depth
7132            )?;
7133            fidl::decode!(
7134                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BuilderMarker>>,
7135                fidl::encoding::DefaultFuchsiaResourceDialect,
7136                &mut self.builder_server_end,
7137                decoder,
7138                offset + 28,
7139                _depth
7140            )?;
7141            Ok(())
7142        }
7143    }
7144
7145    impl fidl::encoding::ResourceTypeMarker for RealmBuilderFactoryCreateRequest {
7146        type Borrowed<'a> = &'a mut Self;
7147        fn take_or_borrow<'a>(
7148            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7149        ) -> Self::Borrowed<'a> {
7150            value
7151        }
7152    }
7153
7154    unsafe impl fidl::encoding::TypeMarker for RealmBuilderFactoryCreateRequest {
7155        type Owned = Self;
7156
7157        #[inline(always)]
7158        fn inline_align(_context: fidl::encoding::Context) -> usize {
7159            4
7160        }
7161
7162        #[inline(always)]
7163        fn inline_size(_context: fidl::encoding::Context) -> usize {
7164            12
7165        }
7166    }
7167
7168    unsafe impl
7169        fidl::encoding::Encode<
7170            RealmBuilderFactoryCreateRequest,
7171            fidl::encoding::DefaultFuchsiaResourceDialect,
7172        > for &mut RealmBuilderFactoryCreateRequest
7173    {
7174        #[inline]
7175        unsafe fn encode(
7176            self,
7177            encoder: &mut fidl::encoding::Encoder<
7178                '_,
7179                fidl::encoding::DefaultFuchsiaResourceDialect,
7180            >,
7181            offset: usize,
7182            _depth: fidl::encoding::Depth,
7183        ) -> fidl::Result<()> {
7184            encoder.debug_check_bounds::<RealmBuilderFactoryCreateRequest>(offset);
7185            // Delegate to tuple encoding.
7186            fidl::encoding::Encode::<RealmBuilderFactoryCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7187                (
7188                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.pkg_dir_handle),
7189                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.realm_server_end),
7190                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BuilderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.builder_server_end),
7191                ),
7192                encoder, offset, _depth
7193            )
7194        }
7195    }
7196    unsafe impl<
7197        T0: fidl::encoding::Encode<
7198                fidl::encoding::Endpoint<
7199                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7200                >,
7201                fidl::encoding::DefaultFuchsiaResourceDialect,
7202            >,
7203        T1: fidl::encoding::Encode<
7204                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
7205                fidl::encoding::DefaultFuchsiaResourceDialect,
7206            >,
7207        T2: fidl::encoding::Encode<
7208                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BuilderMarker>>,
7209                fidl::encoding::DefaultFuchsiaResourceDialect,
7210            >,
7211    >
7212        fidl::encoding::Encode<
7213            RealmBuilderFactoryCreateRequest,
7214            fidl::encoding::DefaultFuchsiaResourceDialect,
7215        > for (T0, T1, T2)
7216    {
7217        #[inline]
7218        unsafe fn encode(
7219            self,
7220            encoder: &mut fidl::encoding::Encoder<
7221                '_,
7222                fidl::encoding::DefaultFuchsiaResourceDialect,
7223            >,
7224            offset: usize,
7225            depth: fidl::encoding::Depth,
7226        ) -> fidl::Result<()> {
7227            encoder.debug_check_bounds::<RealmBuilderFactoryCreateRequest>(offset);
7228            // Zero out padding regions. There's no need to apply masks
7229            // because the unmasked parts will be overwritten by fields.
7230            // Write the fields.
7231            self.0.encode(encoder, offset + 0, depth)?;
7232            self.1.encode(encoder, offset + 4, depth)?;
7233            self.2.encode(encoder, offset + 8, depth)?;
7234            Ok(())
7235        }
7236    }
7237
7238    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7239        for RealmBuilderFactoryCreateRequest
7240    {
7241        #[inline(always)]
7242        fn new_empty() -> Self {
7243            Self {
7244                pkg_dir_handle: fidl::new_empty!(
7245                    fidl::encoding::Endpoint<
7246                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7247                    >,
7248                    fidl::encoding::DefaultFuchsiaResourceDialect
7249                ),
7250                realm_server_end: fidl::new_empty!(
7251                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
7252                    fidl::encoding::DefaultFuchsiaResourceDialect
7253                ),
7254                builder_server_end: fidl::new_empty!(
7255                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BuilderMarker>>,
7256                    fidl::encoding::DefaultFuchsiaResourceDialect
7257                ),
7258            }
7259        }
7260
7261        #[inline]
7262        unsafe fn decode(
7263            &mut self,
7264            decoder: &mut fidl::encoding::Decoder<
7265                '_,
7266                fidl::encoding::DefaultFuchsiaResourceDialect,
7267            >,
7268            offset: usize,
7269            _depth: fidl::encoding::Depth,
7270        ) -> fidl::Result<()> {
7271            decoder.debug_check_bounds::<Self>(offset);
7272            // Verify that padding bytes are zero.
7273            fidl::decode!(
7274                fidl::encoding::Endpoint<
7275                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7276                >,
7277                fidl::encoding::DefaultFuchsiaResourceDialect,
7278                &mut self.pkg_dir_handle,
7279                decoder,
7280                offset + 0,
7281                _depth
7282            )?;
7283            fidl::decode!(
7284                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RealmMarker>>,
7285                fidl::encoding::DefaultFuchsiaResourceDialect,
7286                &mut self.realm_server_end,
7287                decoder,
7288                offset + 4,
7289                _depth
7290            )?;
7291            fidl::decode!(
7292                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BuilderMarker>>,
7293                fidl::encoding::DefaultFuchsiaResourceDialect,
7294                &mut self.builder_server_end,
7295                decoder,
7296                offset + 8,
7297                _depth
7298            )?;
7299            Ok(())
7300        }
7301    }
7302
7303    impl fidl::encoding::ResourceTypeMarker for RealmReadOnlyDirectoryRequest {
7304        type Borrowed<'a> = &'a mut Self;
7305        fn take_or_borrow<'a>(
7306            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7307        ) -> Self::Borrowed<'a> {
7308            value
7309        }
7310    }
7311
7312    unsafe impl fidl::encoding::TypeMarker for RealmReadOnlyDirectoryRequest {
7313        type Owned = Self;
7314
7315        #[inline(always)]
7316        fn inline_align(_context: fidl::encoding::Context) -> usize {
7317            8
7318        }
7319
7320        #[inline(always)]
7321        fn inline_size(_context: fidl::encoding::Context) -> usize {
7322            48
7323        }
7324    }
7325
7326    unsafe impl
7327        fidl::encoding::Encode<
7328            RealmReadOnlyDirectoryRequest,
7329            fidl::encoding::DefaultFuchsiaResourceDialect,
7330        > for &mut RealmReadOnlyDirectoryRequest
7331    {
7332        #[inline]
7333        unsafe fn encode(
7334            self,
7335            encoder: &mut fidl::encoding::Encoder<
7336                '_,
7337                fidl::encoding::DefaultFuchsiaResourceDialect,
7338            >,
7339            offset: usize,
7340            _depth: fidl::encoding::Depth,
7341        ) -> fidl::Result<()> {
7342            encoder.debug_check_bounds::<RealmReadOnlyDirectoryRequest>(offset);
7343            // Delegate to tuple encoding.
7344            fidl::encoding::Encode::<RealmReadOnlyDirectoryRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7345                (
7346                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
7347                    <fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Ref> as fidl::encoding::ValueTypeMarker>::borrow(&self.to),
7348                    <DirectoryContents as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.directory_contents),
7349                ),
7350                encoder, offset, _depth
7351            )
7352        }
7353    }
7354    unsafe impl<
7355        T0: fidl::encoding::Encode<
7356                fidl::encoding::BoundedString<255>,
7357                fidl::encoding::DefaultFuchsiaResourceDialect,
7358            >,
7359        T1: fidl::encoding::Encode<
7360                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Ref>,
7361                fidl::encoding::DefaultFuchsiaResourceDialect,
7362            >,
7363        T2: fidl::encoding::Encode<DirectoryContents, fidl::encoding::DefaultFuchsiaResourceDialect>,
7364    >
7365        fidl::encoding::Encode<
7366            RealmReadOnlyDirectoryRequest,
7367            fidl::encoding::DefaultFuchsiaResourceDialect,
7368        > for (T0, T1, T2)
7369    {
7370        #[inline]
7371        unsafe fn encode(
7372            self,
7373            encoder: &mut fidl::encoding::Encoder<
7374                '_,
7375                fidl::encoding::DefaultFuchsiaResourceDialect,
7376            >,
7377            offset: usize,
7378            depth: fidl::encoding::Depth,
7379        ) -> fidl::Result<()> {
7380            encoder.debug_check_bounds::<RealmReadOnlyDirectoryRequest>(offset);
7381            // Zero out padding regions. There's no need to apply masks
7382            // because the unmasked parts will be overwritten by fields.
7383            // Write the fields.
7384            self.0.encode(encoder, offset + 0, depth)?;
7385            self.1.encode(encoder, offset + 16, depth)?;
7386            self.2.encode(encoder, offset + 32, depth)?;
7387            Ok(())
7388        }
7389    }
7390
7391    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7392        for RealmReadOnlyDirectoryRequest
7393    {
7394        #[inline(always)]
7395        fn new_empty() -> Self {
7396            Self {
7397                name: fidl::new_empty!(
7398                    fidl::encoding::BoundedString<255>,
7399                    fidl::encoding::DefaultFuchsiaResourceDialect
7400                ),
7401                to: fidl::new_empty!(
7402                    fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Ref>,
7403                    fidl::encoding::DefaultFuchsiaResourceDialect
7404                ),
7405                directory_contents: fidl::new_empty!(
7406                    DirectoryContents,
7407                    fidl::encoding::DefaultFuchsiaResourceDialect
7408                ),
7409            }
7410        }
7411
7412        #[inline]
7413        unsafe fn decode(
7414            &mut self,
7415            decoder: &mut fidl::encoding::Decoder<
7416                '_,
7417                fidl::encoding::DefaultFuchsiaResourceDialect,
7418            >,
7419            offset: usize,
7420            _depth: fidl::encoding::Depth,
7421        ) -> fidl::Result<()> {
7422            decoder.debug_check_bounds::<Self>(offset);
7423            // Verify that padding bytes are zero.
7424            fidl::decode!(
7425                fidl::encoding::BoundedString<255>,
7426                fidl::encoding::DefaultFuchsiaResourceDialect,
7427                &mut self.name,
7428                decoder,
7429                offset + 0,
7430                _depth
7431            )?;
7432            fidl::decode!(
7433                fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Ref>,
7434                fidl::encoding::DefaultFuchsiaResourceDialect,
7435                &mut self.to,
7436                decoder,
7437                offset + 16,
7438                _depth
7439            )?;
7440            fidl::decode!(
7441                DirectoryContents,
7442                fidl::encoding::DefaultFuchsiaResourceDialect,
7443                &mut self.directory_contents,
7444                decoder,
7445                offset + 32,
7446                _depth
7447            )?;
7448            Ok(())
7449        }
7450    }
7451}