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