fidl_fuchsia_component_test/
fidl_fuchsia_component_test.rs

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