Skip to main content

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