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 _};
10pub use fidl_fuchsia_developer_remotecontrol__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct RemoteControlConnectCapabilityRequest {
16    pub moniker: String,
17    pub capability_set: fidl_fuchsia_sys2::OpenDirType,
18    pub capability_name: String,
19    pub server_channel: fidl::Channel,
20}
21
22impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
23    for RemoteControlConnectCapabilityRequest
24{
25}
26
27#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28pub struct RemoteControlDeprecatedOpenCapabilityRequest {
29    pub moniker: String,
30    pub capability_set: fidl_fuchsia_sys2::OpenDirType,
31    pub capability_name: String,
32    pub server_channel: fidl::Channel,
33    pub flags: fidl_fuchsia_io::OpenFlags,
34}
35
36impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
37    for RemoteControlDeprecatedOpenCapabilityRequest
38{
39}
40
41#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
42pub struct RemoteControlMarker;
43
44impl fidl::endpoints::ProtocolMarker for RemoteControlMarker {
45    type Proxy = RemoteControlProxy;
46    type RequestStream = RemoteControlRequestStream;
47    #[cfg(target_os = "fuchsia")]
48    type SynchronousProxy = RemoteControlSynchronousProxy;
49
50    const DEBUG_NAME: &'static str = "fuchsia.developer.remotecontrol.RemoteControl";
51}
52impl fidl::endpoints::DiscoverableProtocolMarker for RemoteControlMarker {}
53pub type RemoteControlIdentifyHostResult = Result<IdentifyHostResponse, IdentifyHostError>;
54pub type RemoteControlConnectCapabilityResult = Result<(), ConnectCapabilityError>;
55pub type RemoteControlDeprecatedOpenCapabilityResult = Result<(), ConnectCapabilityError>;
56
57pub trait RemoteControlProxyInterface: Send + Sync {
58    type EchoStringResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
59    fn r#echo_string(&self, value: &str) -> Self::EchoStringResponseFut;
60    type LogMessageResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
61    fn r#log_message(
62        &self,
63        tag: &str,
64        message: &str,
65        severity: fidl_fuchsia_diagnostics_types::Severity,
66    ) -> Self::LogMessageResponseFut;
67    type IdentifyHostResponseFut: std::future::Future<Output = Result<RemoteControlIdentifyHostResult, fidl::Error>>
68        + Send;
69    fn r#identify_host(&self) -> Self::IdentifyHostResponseFut;
70    type ConnectCapabilityResponseFut: std::future::Future<Output = Result<RemoteControlConnectCapabilityResult, fidl::Error>>
71        + Send;
72    fn r#connect_capability(
73        &self,
74        moniker: &str,
75        capability_set: fidl_fuchsia_sys2::OpenDirType,
76        capability_name: &str,
77        server_channel: fidl::Channel,
78    ) -> Self::ConnectCapabilityResponseFut;
79    type GetTimeResponseFut: std::future::Future<Output = Result<fidl::MonotonicInstant, fidl::Error>>
80        + Send;
81    fn r#get_time(&self) -> Self::GetTimeResponseFut;
82    type GetBootTimeResponseFut: std::future::Future<Output = Result<fidl::BootInstant, fidl::Error>>
83        + Send;
84    fn r#get_boot_time(&self) -> Self::GetBootTimeResponseFut;
85    type DeprecatedOpenCapabilityResponseFut: std::future::Future<
86            Output = Result<RemoteControlDeprecatedOpenCapabilityResult, fidl::Error>,
87        > + Send;
88    fn r#deprecated_open_capability(
89        &self,
90        moniker: &str,
91        capability_set: fidl_fuchsia_sys2::OpenDirType,
92        capability_name: &str,
93        server_channel: fidl::Channel,
94        flags: fidl_fuchsia_io::OpenFlags,
95    ) -> Self::DeprecatedOpenCapabilityResponseFut;
96}
97#[derive(Debug)]
98#[cfg(target_os = "fuchsia")]
99pub struct RemoteControlSynchronousProxy {
100    client: fidl::client::sync::Client,
101}
102
103#[cfg(target_os = "fuchsia")]
104impl fidl::endpoints::SynchronousProxy for RemoteControlSynchronousProxy {
105    type Proxy = RemoteControlProxy;
106    type Protocol = RemoteControlMarker;
107
108    fn from_channel(inner: fidl::Channel) -> Self {
109        Self::new(inner)
110    }
111
112    fn into_channel(self) -> fidl::Channel {
113        self.client.into_channel()
114    }
115
116    fn as_channel(&self) -> &fidl::Channel {
117        self.client.as_channel()
118    }
119}
120
121#[cfg(target_os = "fuchsia")]
122impl RemoteControlSynchronousProxy {
123    pub fn new(channel: fidl::Channel) -> Self {
124        let protocol_name = <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
125        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
126    }
127
128    pub fn into_channel(self) -> fidl::Channel {
129        self.client.into_channel()
130    }
131
132    /// Waits until an event arrives and returns it. It is safe for other
133    /// threads to make concurrent requests while waiting for an event.
134    pub fn wait_for_event(
135        &self,
136        deadline: zx::MonotonicInstant,
137    ) -> Result<RemoteControlEvent, fidl::Error> {
138        RemoteControlEvent::decode(self.client.wait_for_event(deadline)?)
139    }
140
141    /// Returns the input.
142    pub fn r#echo_string(
143        &self,
144        mut value: &str,
145        ___deadline: zx::MonotonicInstant,
146    ) -> Result<String, fidl::Error> {
147        let _response = self
148            .client
149            .send_query::<RemoteControlEchoStringRequest, RemoteControlEchoStringResponse>(
150                (value,),
151                0x2bbec7ca8a72e82b,
152                fidl::encoding::DynamicFlags::empty(),
153                ___deadline,
154            )?;
155        Ok(_response.response)
156    }
157
158    /// Writes a string to the syslog on the device.
159    pub fn r#log_message(
160        &self,
161        mut tag: &str,
162        mut message: &str,
163        mut severity: fidl_fuchsia_diagnostics_types::Severity,
164        ___deadline: zx::MonotonicInstant,
165    ) -> Result<(), fidl::Error> {
166        let _response = self
167            .client
168            .send_query::<RemoteControlLogMessageRequest, fidl::encoding::EmptyPayload>(
169                (tag, message, severity),
170                0x3da84acd5bbf3926,
171                fidl::encoding::DynamicFlags::empty(),
172                ___deadline,
173            )?;
174        Ok(_response)
175    }
176
177    pub fn r#identify_host(
178        &self,
179        ___deadline: zx::MonotonicInstant,
180    ) -> Result<RemoteControlIdentifyHostResult, fidl::Error> {
181        let _response = self
182            .client
183            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
184                RemoteControlIdentifyHostResponse,
185                IdentifyHostError,
186            >>(
187                (), 0x6035e1ab368deee1, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
188            )?
189            .into_result::<RemoteControlMarker>("identify_host")?;
190        Ok(_response.map(|x| x.response))
191    }
192
193    /// Connects a channel to a service, given a moniker and a channel iff the component identified
194    /// by the given moniker exposes a capability of the requested name.
195    pub fn r#connect_capability(
196        &self,
197        mut moniker: &str,
198        mut capability_set: fidl_fuchsia_sys2::OpenDirType,
199        mut capability_name: &str,
200        mut server_channel: fidl::Channel,
201        ___deadline: zx::MonotonicInstant,
202    ) -> Result<RemoteControlConnectCapabilityResult, fidl::Error> {
203        let _response = self.client.send_query::<
204            RemoteControlConnectCapabilityRequest,
205            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConnectCapabilityError>,
206        >(
207            (moniker, capability_set, capability_name, server_channel,),
208            0x3ae7a7c874dceceb,
209            fidl::encoding::DynamicFlags::FLEXIBLE,
210            ___deadline,
211        )?
212        .into_result::<RemoteControlMarker>("connect_capability")?;
213        Ok(_response.map(|x| x))
214    }
215
216    pub fn r#get_time(
217        &self,
218        ___deadline: zx::MonotonicInstant,
219    ) -> Result<fidl::MonotonicInstant, fidl::Error> {
220        let _response =
221            self.client.send_query::<fidl::encoding::EmptyPayload, RemoteControlGetTimeResponse>(
222                (),
223                0x3588f31e9067748d,
224                fidl::encoding::DynamicFlags::empty(),
225                ___deadline,
226            )?;
227        Ok(_response.time)
228    }
229
230    pub fn r#get_boot_time(
231        &self,
232        ___deadline: zx::MonotonicInstant,
233    ) -> Result<fidl::BootInstant, fidl::Error> {
234        let _response = self
235            .client
236            .send_query::<fidl::encoding::EmptyPayload, RemoteControlGetBootTimeResponse>(
237                (),
238                0x55706f013cd79ebd,
239                fidl::encoding::DynamicFlags::empty(),
240                ___deadline,
241            )?;
242        Ok(_response.time)
243    }
244
245    /// [DEPRECATED - Use ConnectCapability instead.]
246    ///
247    /// Connects a channel to a service, given a moniker and a channel iff the component identified
248    /// by the given moniker exposes a capability of the requested name.
249    pub fn r#deprecated_open_capability(
250        &self,
251        mut moniker: &str,
252        mut capability_set: fidl_fuchsia_sys2::OpenDirType,
253        mut capability_name: &str,
254        mut server_channel: fidl::Channel,
255        mut flags: fidl_fuchsia_io::OpenFlags,
256        ___deadline: zx::MonotonicInstant,
257    ) -> Result<RemoteControlDeprecatedOpenCapabilityResult, fidl::Error> {
258        let _response = self.client.send_query::<
259            RemoteControlDeprecatedOpenCapabilityRequest,
260            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConnectCapabilityError>,
261        >(
262            (moniker, capability_set, capability_name, server_channel, flags,),
263            0x51b5801f3e27e431,
264            fidl::encoding::DynamicFlags::FLEXIBLE,
265            ___deadline,
266        )?
267        .into_result::<RemoteControlMarker>("deprecated_open_capability")?;
268        Ok(_response.map(|x| x))
269    }
270}
271
272#[cfg(target_os = "fuchsia")]
273impl From<RemoteControlSynchronousProxy> for zx::Handle {
274    fn from(value: RemoteControlSynchronousProxy) -> Self {
275        value.into_channel().into()
276    }
277}
278
279#[cfg(target_os = "fuchsia")]
280impl From<fidl::Channel> for RemoteControlSynchronousProxy {
281    fn from(value: fidl::Channel) -> Self {
282        Self::new(value)
283    }
284}
285
286#[cfg(target_os = "fuchsia")]
287impl fidl::endpoints::FromClient for RemoteControlSynchronousProxy {
288    type Protocol = RemoteControlMarker;
289
290    fn from_client(value: fidl::endpoints::ClientEnd<RemoteControlMarker>) -> Self {
291        Self::new(value.into_channel())
292    }
293}
294
295#[derive(Debug, Clone)]
296pub struct RemoteControlProxy {
297    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
298}
299
300impl fidl::endpoints::Proxy for RemoteControlProxy {
301    type Protocol = RemoteControlMarker;
302
303    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
304        Self::new(inner)
305    }
306
307    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
308        self.client.into_channel().map_err(|client| Self { client })
309    }
310
311    fn as_channel(&self) -> &::fidl::AsyncChannel {
312        self.client.as_channel()
313    }
314}
315
316impl RemoteControlProxy {
317    /// Create a new Proxy for fuchsia.developer.remotecontrol/RemoteControl.
318    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
319        let protocol_name = <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
320        Self { client: fidl::client::Client::new(channel, protocol_name) }
321    }
322
323    /// Get a Stream of events from the remote end of the protocol.
324    ///
325    /// # Panics
326    ///
327    /// Panics if the event stream was already taken.
328    pub fn take_event_stream(&self) -> RemoteControlEventStream {
329        RemoteControlEventStream { event_receiver: self.client.take_event_receiver() }
330    }
331
332    /// Returns the input.
333    pub fn r#echo_string(
334        &self,
335        mut value: &str,
336    ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
337        RemoteControlProxyInterface::r#echo_string(self, value)
338    }
339
340    /// Writes a string to the syslog on the device.
341    pub fn r#log_message(
342        &self,
343        mut tag: &str,
344        mut message: &str,
345        mut severity: fidl_fuchsia_diagnostics_types::Severity,
346    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
347        RemoteControlProxyInterface::r#log_message(self, tag, message, severity)
348    }
349
350    pub fn r#identify_host(
351        &self,
352    ) -> fidl::client::QueryResponseFut<
353        RemoteControlIdentifyHostResult,
354        fidl::encoding::DefaultFuchsiaResourceDialect,
355    > {
356        RemoteControlProxyInterface::r#identify_host(self)
357    }
358
359    /// Connects a channel to a service, given a moniker and a channel iff the component identified
360    /// by the given moniker exposes a capability of the requested name.
361    pub fn r#connect_capability(
362        &self,
363        mut moniker: &str,
364        mut capability_set: fidl_fuchsia_sys2::OpenDirType,
365        mut capability_name: &str,
366        mut server_channel: fidl::Channel,
367    ) -> fidl::client::QueryResponseFut<
368        RemoteControlConnectCapabilityResult,
369        fidl::encoding::DefaultFuchsiaResourceDialect,
370    > {
371        RemoteControlProxyInterface::r#connect_capability(
372            self,
373            moniker,
374            capability_set,
375            capability_name,
376            server_channel,
377        )
378    }
379
380    pub fn r#get_time(
381        &self,
382    ) -> fidl::client::QueryResponseFut<
383        fidl::MonotonicInstant,
384        fidl::encoding::DefaultFuchsiaResourceDialect,
385    > {
386        RemoteControlProxyInterface::r#get_time(self)
387    }
388
389    pub fn r#get_boot_time(
390        &self,
391    ) -> fidl::client::QueryResponseFut<
392        fidl::BootInstant,
393        fidl::encoding::DefaultFuchsiaResourceDialect,
394    > {
395        RemoteControlProxyInterface::r#get_boot_time(self)
396    }
397
398    /// [DEPRECATED - Use ConnectCapability instead.]
399    ///
400    /// Connects a channel to a service, given a moniker and a channel iff the component identified
401    /// by the given moniker exposes a capability of the requested name.
402    pub fn r#deprecated_open_capability(
403        &self,
404        mut moniker: &str,
405        mut capability_set: fidl_fuchsia_sys2::OpenDirType,
406        mut capability_name: &str,
407        mut server_channel: fidl::Channel,
408        mut flags: fidl_fuchsia_io::OpenFlags,
409    ) -> fidl::client::QueryResponseFut<
410        RemoteControlDeprecatedOpenCapabilityResult,
411        fidl::encoding::DefaultFuchsiaResourceDialect,
412    > {
413        RemoteControlProxyInterface::r#deprecated_open_capability(
414            self,
415            moniker,
416            capability_set,
417            capability_name,
418            server_channel,
419            flags,
420        )
421    }
422}
423
424impl RemoteControlProxyInterface for RemoteControlProxy {
425    type EchoStringResponseFut =
426        fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
427    fn r#echo_string(&self, mut value: &str) -> Self::EchoStringResponseFut {
428        fn _decode(
429            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
430        ) -> Result<String, fidl::Error> {
431            let _response = fidl::client::decode_transaction_body::<
432                RemoteControlEchoStringResponse,
433                fidl::encoding::DefaultFuchsiaResourceDialect,
434                0x2bbec7ca8a72e82b,
435            >(_buf?)?;
436            Ok(_response.response)
437        }
438        self.client.send_query_and_decode::<RemoteControlEchoStringRequest, String>(
439            (value,),
440            0x2bbec7ca8a72e82b,
441            fidl::encoding::DynamicFlags::empty(),
442            _decode,
443        )
444    }
445
446    type LogMessageResponseFut =
447        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
448    fn r#log_message(
449        &self,
450        mut tag: &str,
451        mut message: &str,
452        mut severity: fidl_fuchsia_diagnostics_types::Severity,
453    ) -> Self::LogMessageResponseFut {
454        fn _decode(
455            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
456        ) -> Result<(), fidl::Error> {
457            let _response = fidl::client::decode_transaction_body::<
458                fidl::encoding::EmptyPayload,
459                fidl::encoding::DefaultFuchsiaResourceDialect,
460                0x3da84acd5bbf3926,
461            >(_buf?)?;
462            Ok(_response)
463        }
464        self.client.send_query_and_decode::<RemoteControlLogMessageRequest, ()>(
465            (tag, message, severity),
466            0x3da84acd5bbf3926,
467            fidl::encoding::DynamicFlags::empty(),
468            _decode,
469        )
470    }
471
472    type IdentifyHostResponseFut = fidl::client::QueryResponseFut<
473        RemoteControlIdentifyHostResult,
474        fidl::encoding::DefaultFuchsiaResourceDialect,
475    >;
476    fn r#identify_host(&self) -> Self::IdentifyHostResponseFut {
477        fn _decode(
478            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
479        ) -> Result<RemoteControlIdentifyHostResult, fidl::Error> {
480            let _response = fidl::client::decode_transaction_body::<
481                fidl::encoding::FlexibleResultType<
482                    RemoteControlIdentifyHostResponse,
483                    IdentifyHostError,
484                >,
485                fidl::encoding::DefaultFuchsiaResourceDialect,
486                0x6035e1ab368deee1,
487            >(_buf?)?
488            .into_result::<RemoteControlMarker>("identify_host")?;
489            Ok(_response.map(|x| x.response))
490        }
491        self.client
492            .send_query_and_decode::<fidl::encoding::EmptyPayload, RemoteControlIdentifyHostResult>(
493                (),
494                0x6035e1ab368deee1,
495                fidl::encoding::DynamicFlags::FLEXIBLE,
496                _decode,
497            )
498    }
499
500    type ConnectCapabilityResponseFut = fidl::client::QueryResponseFut<
501        RemoteControlConnectCapabilityResult,
502        fidl::encoding::DefaultFuchsiaResourceDialect,
503    >;
504    fn r#connect_capability(
505        &self,
506        mut moniker: &str,
507        mut capability_set: fidl_fuchsia_sys2::OpenDirType,
508        mut capability_name: &str,
509        mut server_channel: fidl::Channel,
510    ) -> Self::ConnectCapabilityResponseFut {
511        fn _decode(
512            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
513        ) -> Result<RemoteControlConnectCapabilityResult, fidl::Error> {
514            let _response = fidl::client::decode_transaction_body::<
515                fidl::encoding::FlexibleResultType<
516                    fidl::encoding::EmptyStruct,
517                    ConnectCapabilityError,
518                >,
519                fidl::encoding::DefaultFuchsiaResourceDialect,
520                0x3ae7a7c874dceceb,
521            >(_buf?)?
522            .into_result::<RemoteControlMarker>("connect_capability")?;
523            Ok(_response.map(|x| x))
524        }
525        self.client.send_query_and_decode::<
526            RemoteControlConnectCapabilityRequest,
527            RemoteControlConnectCapabilityResult,
528        >(
529            (moniker, capability_set, capability_name, server_channel,),
530            0x3ae7a7c874dceceb,
531            fidl::encoding::DynamicFlags::FLEXIBLE,
532            _decode,
533        )
534    }
535
536    type GetTimeResponseFut = fidl::client::QueryResponseFut<
537        fidl::MonotonicInstant,
538        fidl::encoding::DefaultFuchsiaResourceDialect,
539    >;
540    fn r#get_time(&self) -> Self::GetTimeResponseFut {
541        fn _decode(
542            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
543        ) -> Result<fidl::MonotonicInstant, fidl::Error> {
544            let _response = fidl::client::decode_transaction_body::<
545                RemoteControlGetTimeResponse,
546                fidl::encoding::DefaultFuchsiaResourceDialect,
547                0x3588f31e9067748d,
548            >(_buf?)?;
549            Ok(_response.time)
550        }
551        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::MonotonicInstant>(
552            (),
553            0x3588f31e9067748d,
554            fidl::encoding::DynamicFlags::empty(),
555            _decode,
556        )
557    }
558
559    type GetBootTimeResponseFut = fidl::client::QueryResponseFut<
560        fidl::BootInstant,
561        fidl::encoding::DefaultFuchsiaResourceDialect,
562    >;
563    fn r#get_boot_time(&self) -> Self::GetBootTimeResponseFut {
564        fn _decode(
565            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
566        ) -> Result<fidl::BootInstant, fidl::Error> {
567            let _response = fidl::client::decode_transaction_body::<
568                RemoteControlGetBootTimeResponse,
569                fidl::encoding::DefaultFuchsiaResourceDialect,
570                0x55706f013cd79ebd,
571            >(_buf?)?;
572            Ok(_response.time)
573        }
574        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::BootInstant>(
575            (),
576            0x55706f013cd79ebd,
577            fidl::encoding::DynamicFlags::empty(),
578            _decode,
579        )
580    }
581
582    type DeprecatedOpenCapabilityResponseFut = fidl::client::QueryResponseFut<
583        RemoteControlDeprecatedOpenCapabilityResult,
584        fidl::encoding::DefaultFuchsiaResourceDialect,
585    >;
586    fn r#deprecated_open_capability(
587        &self,
588        mut moniker: &str,
589        mut capability_set: fidl_fuchsia_sys2::OpenDirType,
590        mut capability_name: &str,
591        mut server_channel: fidl::Channel,
592        mut flags: fidl_fuchsia_io::OpenFlags,
593    ) -> Self::DeprecatedOpenCapabilityResponseFut {
594        fn _decode(
595            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
596        ) -> Result<RemoteControlDeprecatedOpenCapabilityResult, fidl::Error> {
597            let _response = fidl::client::decode_transaction_body::<
598                fidl::encoding::FlexibleResultType<
599                    fidl::encoding::EmptyStruct,
600                    ConnectCapabilityError,
601                >,
602                fidl::encoding::DefaultFuchsiaResourceDialect,
603                0x51b5801f3e27e431,
604            >(_buf?)?
605            .into_result::<RemoteControlMarker>("deprecated_open_capability")?;
606            Ok(_response.map(|x| x))
607        }
608        self.client.send_query_and_decode::<
609            RemoteControlDeprecatedOpenCapabilityRequest,
610            RemoteControlDeprecatedOpenCapabilityResult,
611        >(
612            (moniker, capability_set, capability_name, server_channel, flags,),
613            0x51b5801f3e27e431,
614            fidl::encoding::DynamicFlags::FLEXIBLE,
615            _decode,
616        )
617    }
618}
619
620pub struct RemoteControlEventStream {
621    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
622}
623
624impl std::marker::Unpin for RemoteControlEventStream {}
625
626impl futures::stream::FusedStream for RemoteControlEventStream {
627    fn is_terminated(&self) -> bool {
628        self.event_receiver.is_terminated()
629    }
630}
631
632impl futures::Stream for RemoteControlEventStream {
633    type Item = Result<RemoteControlEvent, fidl::Error>;
634
635    fn poll_next(
636        mut self: std::pin::Pin<&mut Self>,
637        cx: &mut std::task::Context<'_>,
638    ) -> std::task::Poll<Option<Self::Item>> {
639        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
640            &mut self.event_receiver,
641            cx
642        )?) {
643            Some(buf) => std::task::Poll::Ready(Some(RemoteControlEvent::decode(buf))),
644            None => std::task::Poll::Ready(None),
645        }
646    }
647}
648
649#[derive(Debug)]
650pub enum RemoteControlEvent {
651    #[non_exhaustive]
652    _UnknownEvent {
653        /// Ordinal of the event that was sent.
654        ordinal: u64,
655    },
656}
657
658impl RemoteControlEvent {
659    /// Decodes a message buffer as a [`RemoteControlEvent`].
660    fn decode(
661        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
662    ) -> Result<RemoteControlEvent, fidl::Error> {
663        let (bytes, _handles) = buf.split_mut();
664        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
665        debug_assert_eq!(tx_header.tx_id, 0);
666        match tx_header.ordinal {
667            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
668                Ok(RemoteControlEvent::_UnknownEvent { ordinal: tx_header.ordinal })
669            }
670            _ => Err(fidl::Error::UnknownOrdinal {
671                ordinal: tx_header.ordinal,
672                protocol_name: <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
673            }),
674        }
675    }
676}
677
678/// A Stream of incoming requests for fuchsia.developer.remotecontrol/RemoteControl.
679pub struct RemoteControlRequestStream {
680    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
681    is_terminated: bool,
682}
683
684impl std::marker::Unpin for RemoteControlRequestStream {}
685
686impl futures::stream::FusedStream for RemoteControlRequestStream {
687    fn is_terminated(&self) -> bool {
688        self.is_terminated
689    }
690}
691
692impl fidl::endpoints::RequestStream for RemoteControlRequestStream {
693    type Protocol = RemoteControlMarker;
694    type ControlHandle = RemoteControlControlHandle;
695
696    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
697        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
698    }
699
700    fn control_handle(&self) -> Self::ControlHandle {
701        RemoteControlControlHandle { inner: self.inner.clone() }
702    }
703
704    fn into_inner(
705        self,
706    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
707    {
708        (self.inner, self.is_terminated)
709    }
710
711    fn from_inner(
712        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
713        is_terminated: bool,
714    ) -> Self {
715        Self { inner, is_terminated }
716    }
717}
718
719impl futures::Stream for RemoteControlRequestStream {
720    type Item = Result<RemoteControlRequest, fidl::Error>;
721
722    fn poll_next(
723        mut self: std::pin::Pin<&mut Self>,
724        cx: &mut std::task::Context<'_>,
725    ) -> std::task::Poll<Option<Self::Item>> {
726        let this = &mut *self;
727        if this.inner.check_shutdown(cx) {
728            this.is_terminated = true;
729            return std::task::Poll::Ready(None);
730        }
731        if this.is_terminated {
732            panic!("polled RemoteControlRequestStream after completion");
733        }
734        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
735            |bytes, handles| {
736                match this.inner.channel().read_etc(cx, bytes, handles) {
737                    std::task::Poll::Ready(Ok(())) => {}
738                    std::task::Poll::Pending => return std::task::Poll::Pending,
739                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
740                        this.is_terminated = true;
741                        return std::task::Poll::Ready(None);
742                    }
743                    std::task::Poll::Ready(Err(e)) => {
744                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
745                            e.into(),
746                        ))))
747                    }
748                }
749
750                // A message has been received from the channel
751                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
752
753                std::task::Poll::Ready(Some(match header.ordinal {
754                    0x2bbec7ca8a72e82b => {
755                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
756                        let mut req = fidl::new_empty!(
757                            RemoteControlEchoStringRequest,
758                            fidl::encoding::DefaultFuchsiaResourceDialect
759                        );
760                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlEchoStringRequest>(&header, _body_bytes, handles, &mut req)?;
761                        let control_handle =
762                            RemoteControlControlHandle { inner: this.inner.clone() };
763                        Ok(RemoteControlRequest::EchoString {
764                            value: req.value,
765
766                            responder: RemoteControlEchoStringResponder {
767                                control_handle: std::mem::ManuallyDrop::new(control_handle),
768                                tx_id: header.tx_id,
769                            },
770                        })
771                    }
772                    0x3da84acd5bbf3926 => {
773                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
774                        let mut req = fidl::new_empty!(
775                            RemoteControlLogMessageRequest,
776                            fidl::encoding::DefaultFuchsiaResourceDialect
777                        );
778                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlLogMessageRequest>(&header, _body_bytes, handles, &mut req)?;
779                        let control_handle =
780                            RemoteControlControlHandle { inner: this.inner.clone() };
781                        Ok(RemoteControlRequest::LogMessage {
782                            tag: req.tag,
783                            message: req.message,
784                            severity: req.severity,
785
786                            responder: RemoteControlLogMessageResponder {
787                                control_handle: std::mem::ManuallyDrop::new(control_handle),
788                                tx_id: header.tx_id,
789                            },
790                        })
791                    }
792                    0x6035e1ab368deee1 => {
793                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
794                        let mut req = fidl::new_empty!(
795                            fidl::encoding::EmptyPayload,
796                            fidl::encoding::DefaultFuchsiaResourceDialect
797                        );
798                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
799                        let control_handle =
800                            RemoteControlControlHandle { inner: this.inner.clone() };
801                        Ok(RemoteControlRequest::IdentifyHost {
802                            responder: RemoteControlIdentifyHostResponder {
803                                control_handle: std::mem::ManuallyDrop::new(control_handle),
804                                tx_id: header.tx_id,
805                            },
806                        })
807                    }
808                    0x3ae7a7c874dceceb => {
809                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
810                        let mut req = fidl::new_empty!(
811                            RemoteControlConnectCapabilityRequest,
812                            fidl::encoding::DefaultFuchsiaResourceDialect
813                        );
814                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlConnectCapabilityRequest>(&header, _body_bytes, handles, &mut req)?;
815                        let control_handle =
816                            RemoteControlControlHandle { inner: this.inner.clone() };
817                        Ok(RemoteControlRequest::ConnectCapability {
818                            moniker: req.moniker,
819                            capability_set: req.capability_set,
820                            capability_name: req.capability_name,
821                            server_channel: req.server_channel,
822
823                            responder: RemoteControlConnectCapabilityResponder {
824                                control_handle: std::mem::ManuallyDrop::new(control_handle),
825                                tx_id: header.tx_id,
826                            },
827                        })
828                    }
829                    0x3588f31e9067748d => {
830                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
831                        let mut req = fidl::new_empty!(
832                            fidl::encoding::EmptyPayload,
833                            fidl::encoding::DefaultFuchsiaResourceDialect
834                        );
835                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
836                        let control_handle =
837                            RemoteControlControlHandle { inner: this.inner.clone() };
838                        Ok(RemoteControlRequest::GetTime {
839                            responder: RemoteControlGetTimeResponder {
840                                control_handle: std::mem::ManuallyDrop::new(control_handle),
841                                tx_id: header.tx_id,
842                            },
843                        })
844                    }
845                    0x55706f013cd79ebd => {
846                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
847                        let mut req = fidl::new_empty!(
848                            fidl::encoding::EmptyPayload,
849                            fidl::encoding::DefaultFuchsiaResourceDialect
850                        );
851                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
852                        let control_handle =
853                            RemoteControlControlHandle { inner: this.inner.clone() };
854                        Ok(RemoteControlRequest::GetBootTime {
855                            responder: RemoteControlGetBootTimeResponder {
856                                control_handle: std::mem::ManuallyDrop::new(control_handle),
857                                tx_id: header.tx_id,
858                            },
859                        })
860                    }
861                    0x51b5801f3e27e431 => {
862                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
863                        let mut req = fidl::new_empty!(
864                            RemoteControlDeprecatedOpenCapabilityRequest,
865                            fidl::encoding::DefaultFuchsiaResourceDialect
866                        );
867                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlDeprecatedOpenCapabilityRequest>(&header, _body_bytes, handles, &mut req)?;
868                        let control_handle =
869                            RemoteControlControlHandle { inner: this.inner.clone() };
870                        Ok(RemoteControlRequest::DeprecatedOpenCapability {
871                            moniker: req.moniker,
872                            capability_set: req.capability_set,
873                            capability_name: req.capability_name,
874                            server_channel: req.server_channel,
875                            flags: req.flags,
876
877                            responder: RemoteControlDeprecatedOpenCapabilityResponder {
878                                control_handle: std::mem::ManuallyDrop::new(control_handle),
879                                tx_id: header.tx_id,
880                            },
881                        })
882                    }
883                    _ if header.tx_id == 0
884                        && header
885                            .dynamic_flags()
886                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
887                    {
888                        Ok(RemoteControlRequest::_UnknownMethod {
889                            ordinal: header.ordinal,
890                            control_handle: RemoteControlControlHandle {
891                                inner: this.inner.clone(),
892                            },
893                            method_type: fidl::MethodType::OneWay,
894                        })
895                    }
896                    _ if header
897                        .dynamic_flags()
898                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
899                    {
900                        this.inner.send_framework_err(
901                            fidl::encoding::FrameworkErr::UnknownMethod,
902                            header.tx_id,
903                            header.ordinal,
904                            header.dynamic_flags(),
905                            (bytes, handles),
906                        )?;
907                        Ok(RemoteControlRequest::_UnknownMethod {
908                            ordinal: header.ordinal,
909                            control_handle: RemoteControlControlHandle {
910                                inner: this.inner.clone(),
911                            },
912                            method_type: fidl::MethodType::TwoWay,
913                        })
914                    }
915                    _ => Err(fidl::Error::UnknownOrdinal {
916                        ordinal: header.ordinal,
917                        protocol_name:
918                            <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
919                    }),
920                }))
921            },
922        )
923    }
924}
925
926#[derive(Debug)]
927pub enum RemoteControlRequest {
928    /// Returns the input.
929    EchoString {
930        value: String,
931        responder: RemoteControlEchoStringResponder,
932    },
933    /// Writes a string to the syslog on the device.
934    LogMessage {
935        tag: String,
936        message: String,
937        severity: fidl_fuchsia_diagnostics_types::Severity,
938        responder: RemoteControlLogMessageResponder,
939    },
940    IdentifyHost {
941        responder: RemoteControlIdentifyHostResponder,
942    },
943    /// Connects a channel to a service, given a moniker and a channel iff the component identified
944    /// by the given moniker exposes a capability of the requested name.
945    ConnectCapability {
946        moniker: String,
947        capability_set: fidl_fuchsia_sys2::OpenDirType,
948        capability_name: String,
949        server_channel: fidl::Channel,
950        responder: RemoteControlConnectCapabilityResponder,
951    },
952    GetTime {
953        responder: RemoteControlGetTimeResponder,
954    },
955    GetBootTime {
956        responder: RemoteControlGetBootTimeResponder,
957    },
958    /// [DEPRECATED - Use ConnectCapability instead.]
959    ///
960    /// Connects a channel to a service, given a moniker and a channel iff the component identified
961    /// by the given moniker exposes a capability of the requested name.
962    DeprecatedOpenCapability {
963        moniker: String,
964        capability_set: fidl_fuchsia_sys2::OpenDirType,
965        capability_name: String,
966        server_channel: fidl::Channel,
967        flags: fidl_fuchsia_io::OpenFlags,
968        responder: RemoteControlDeprecatedOpenCapabilityResponder,
969    },
970    /// An interaction was received which does not match any known method.
971    #[non_exhaustive]
972    _UnknownMethod {
973        /// Ordinal of the method that was called.
974        ordinal: u64,
975        control_handle: RemoteControlControlHandle,
976        method_type: fidl::MethodType,
977    },
978}
979
980impl RemoteControlRequest {
981    #[allow(irrefutable_let_patterns)]
982    pub fn into_echo_string(self) -> Option<(String, RemoteControlEchoStringResponder)> {
983        if let RemoteControlRequest::EchoString { value, responder } = self {
984            Some((value, responder))
985        } else {
986            None
987        }
988    }
989
990    #[allow(irrefutable_let_patterns)]
991    pub fn into_log_message(
992        self,
993    ) -> Option<(
994        String,
995        String,
996        fidl_fuchsia_diagnostics_types::Severity,
997        RemoteControlLogMessageResponder,
998    )> {
999        if let RemoteControlRequest::LogMessage { tag, message, severity, responder } = self {
1000            Some((tag, message, severity, responder))
1001        } else {
1002            None
1003        }
1004    }
1005
1006    #[allow(irrefutable_let_patterns)]
1007    pub fn into_identify_host(self) -> Option<(RemoteControlIdentifyHostResponder)> {
1008        if let RemoteControlRequest::IdentifyHost { responder } = self {
1009            Some((responder))
1010        } else {
1011            None
1012        }
1013    }
1014
1015    #[allow(irrefutable_let_patterns)]
1016    pub fn into_connect_capability(
1017        self,
1018    ) -> Option<(
1019        String,
1020        fidl_fuchsia_sys2::OpenDirType,
1021        String,
1022        fidl::Channel,
1023        RemoteControlConnectCapabilityResponder,
1024    )> {
1025        if let RemoteControlRequest::ConnectCapability {
1026            moniker,
1027            capability_set,
1028            capability_name,
1029            server_channel,
1030            responder,
1031        } = self
1032        {
1033            Some((moniker, capability_set, capability_name, server_channel, responder))
1034        } else {
1035            None
1036        }
1037    }
1038
1039    #[allow(irrefutable_let_patterns)]
1040    pub fn into_get_time(self) -> Option<(RemoteControlGetTimeResponder)> {
1041        if let RemoteControlRequest::GetTime { responder } = self {
1042            Some((responder))
1043        } else {
1044            None
1045        }
1046    }
1047
1048    #[allow(irrefutable_let_patterns)]
1049    pub fn into_get_boot_time(self) -> Option<(RemoteControlGetBootTimeResponder)> {
1050        if let RemoteControlRequest::GetBootTime { responder } = self {
1051            Some((responder))
1052        } else {
1053            None
1054        }
1055    }
1056
1057    #[allow(irrefutable_let_patterns)]
1058    pub fn into_deprecated_open_capability(
1059        self,
1060    ) -> Option<(
1061        String,
1062        fidl_fuchsia_sys2::OpenDirType,
1063        String,
1064        fidl::Channel,
1065        fidl_fuchsia_io::OpenFlags,
1066        RemoteControlDeprecatedOpenCapabilityResponder,
1067    )> {
1068        if let RemoteControlRequest::DeprecatedOpenCapability {
1069            moniker,
1070            capability_set,
1071            capability_name,
1072            server_channel,
1073            flags,
1074            responder,
1075        } = self
1076        {
1077            Some((moniker, capability_set, capability_name, server_channel, flags, responder))
1078        } else {
1079            None
1080        }
1081    }
1082
1083    /// Name of the method defined in FIDL
1084    pub fn method_name(&self) -> &'static str {
1085        match *self {
1086            RemoteControlRequest::EchoString { .. } => "echo_string",
1087            RemoteControlRequest::LogMessage { .. } => "log_message",
1088            RemoteControlRequest::IdentifyHost { .. } => "identify_host",
1089            RemoteControlRequest::ConnectCapability { .. } => "connect_capability",
1090            RemoteControlRequest::GetTime { .. } => "get_time",
1091            RemoteControlRequest::GetBootTime { .. } => "get_boot_time",
1092            RemoteControlRequest::DeprecatedOpenCapability { .. } => "deprecated_open_capability",
1093            RemoteControlRequest::_UnknownMethod {
1094                method_type: fidl::MethodType::OneWay, ..
1095            } => "unknown one-way method",
1096            RemoteControlRequest::_UnknownMethod {
1097                method_type: fidl::MethodType::TwoWay, ..
1098            } => "unknown two-way method",
1099        }
1100    }
1101}
1102
1103#[derive(Debug, Clone)]
1104pub struct RemoteControlControlHandle {
1105    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1106}
1107
1108impl fidl::endpoints::ControlHandle for RemoteControlControlHandle {
1109    fn shutdown(&self) {
1110        self.inner.shutdown()
1111    }
1112    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1113        self.inner.shutdown_with_epitaph(status)
1114    }
1115
1116    fn is_closed(&self) -> bool {
1117        self.inner.channel().is_closed()
1118    }
1119    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1120        self.inner.channel().on_closed()
1121    }
1122
1123    #[cfg(target_os = "fuchsia")]
1124    fn signal_peer(
1125        &self,
1126        clear_mask: zx::Signals,
1127        set_mask: zx::Signals,
1128    ) -> Result<(), zx_status::Status> {
1129        use fidl::Peered;
1130        self.inner.channel().signal_peer(clear_mask, set_mask)
1131    }
1132}
1133
1134impl RemoteControlControlHandle {}
1135
1136#[must_use = "FIDL methods require a response to be sent"]
1137#[derive(Debug)]
1138pub struct RemoteControlEchoStringResponder {
1139    control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1140    tx_id: u32,
1141}
1142
1143/// Set the the channel to be shutdown (see [`RemoteControlControlHandle::shutdown`])
1144/// if the responder is dropped without sending a response, so that the client
1145/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1146impl std::ops::Drop for RemoteControlEchoStringResponder {
1147    fn drop(&mut self) {
1148        self.control_handle.shutdown();
1149        // Safety: drops once, never accessed again
1150        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1151    }
1152}
1153
1154impl fidl::endpoints::Responder for RemoteControlEchoStringResponder {
1155    type ControlHandle = RemoteControlControlHandle;
1156
1157    fn control_handle(&self) -> &RemoteControlControlHandle {
1158        &self.control_handle
1159    }
1160
1161    fn drop_without_shutdown(mut self) {
1162        // Safety: drops once, never accessed again due to mem::forget
1163        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1164        // Prevent Drop from running (which would shut down the channel)
1165        std::mem::forget(self);
1166    }
1167}
1168
1169impl RemoteControlEchoStringResponder {
1170    /// Sends a response to the FIDL transaction.
1171    ///
1172    /// Sets the channel to shutdown if an error occurs.
1173    pub fn send(self, mut response: &str) -> Result<(), fidl::Error> {
1174        let _result = self.send_raw(response);
1175        if _result.is_err() {
1176            self.control_handle.shutdown();
1177        }
1178        self.drop_without_shutdown();
1179        _result
1180    }
1181
1182    /// Similar to "send" but does not shutdown the channel if an error occurs.
1183    pub fn send_no_shutdown_on_err(self, mut response: &str) -> Result<(), fidl::Error> {
1184        let _result = self.send_raw(response);
1185        self.drop_without_shutdown();
1186        _result
1187    }
1188
1189    fn send_raw(&self, mut response: &str) -> Result<(), fidl::Error> {
1190        self.control_handle.inner.send::<RemoteControlEchoStringResponse>(
1191            (response,),
1192            self.tx_id,
1193            0x2bbec7ca8a72e82b,
1194            fidl::encoding::DynamicFlags::empty(),
1195        )
1196    }
1197}
1198
1199#[must_use = "FIDL methods require a response to be sent"]
1200#[derive(Debug)]
1201pub struct RemoteControlLogMessageResponder {
1202    control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1203    tx_id: u32,
1204}
1205
1206/// Set the the channel to be shutdown (see [`RemoteControlControlHandle::shutdown`])
1207/// if the responder is dropped without sending a response, so that the client
1208/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1209impl std::ops::Drop for RemoteControlLogMessageResponder {
1210    fn drop(&mut self) {
1211        self.control_handle.shutdown();
1212        // Safety: drops once, never accessed again
1213        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1214    }
1215}
1216
1217impl fidl::endpoints::Responder for RemoteControlLogMessageResponder {
1218    type ControlHandle = RemoteControlControlHandle;
1219
1220    fn control_handle(&self) -> &RemoteControlControlHandle {
1221        &self.control_handle
1222    }
1223
1224    fn drop_without_shutdown(mut self) {
1225        // Safety: drops once, never accessed again due to mem::forget
1226        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1227        // Prevent Drop from running (which would shut down the channel)
1228        std::mem::forget(self);
1229    }
1230}
1231
1232impl RemoteControlLogMessageResponder {
1233    /// Sends a response to the FIDL transaction.
1234    ///
1235    /// Sets the channel to shutdown if an error occurs.
1236    pub fn send(self) -> Result<(), fidl::Error> {
1237        let _result = self.send_raw();
1238        if _result.is_err() {
1239            self.control_handle.shutdown();
1240        }
1241        self.drop_without_shutdown();
1242        _result
1243    }
1244
1245    /// Similar to "send" but does not shutdown the channel if an error occurs.
1246    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1247        let _result = self.send_raw();
1248        self.drop_without_shutdown();
1249        _result
1250    }
1251
1252    fn send_raw(&self) -> Result<(), fidl::Error> {
1253        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1254            (),
1255            self.tx_id,
1256            0x3da84acd5bbf3926,
1257            fidl::encoding::DynamicFlags::empty(),
1258        )
1259    }
1260}
1261
1262#[must_use = "FIDL methods require a response to be sent"]
1263#[derive(Debug)]
1264pub struct RemoteControlIdentifyHostResponder {
1265    control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1266    tx_id: u32,
1267}
1268
1269/// Set the the channel to be shutdown (see [`RemoteControlControlHandle::shutdown`])
1270/// if the responder is dropped without sending a response, so that the client
1271/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1272impl std::ops::Drop for RemoteControlIdentifyHostResponder {
1273    fn drop(&mut self) {
1274        self.control_handle.shutdown();
1275        // Safety: drops once, never accessed again
1276        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1277    }
1278}
1279
1280impl fidl::endpoints::Responder for RemoteControlIdentifyHostResponder {
1281    type ControlHandle = RemoteControlControlHandle;
1282
1283    fn control_handle(&self) -> &RemoteControlControlHandle {
1284        &self.control_handle
1285    }
1286
1287    fn drop_without_shutdown(mut self) {
1288        // Safety: drops once, never accessed again due to mem::forget
1289        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1290        // Prevent Drop from running (which would shut down the channel)
1291        std::mem::forget(self);
1292    }
1293}
1294
1295impl RemoteControlIdentifyHostResponder {
1296    /// Sends a response to the FIDL transaction.
1297    ///
1298    /// Sets the channel to shutdown if an error occurs.
1299    pub fn send(
1300        self,
1301        mut result: Result<&IdentifyHostResponse, IdentifyHostError>,
1302    ) -> Result<(), fidl::Error> {
1303        let _result = self.send_raw(result);
1304        if _result.is_err() {
1305            self.control_handle.shutdown();
1306        }
1307        self.drop_without_shutdown();
1308        _result
1309    }
1310
1311    /// Similar to "send" but does not shutdown the channel if an error occurs.
1312    pub fn send_no_shutdown_on_err(
1313        self,
1314        mut result: Result<&IdentifyHostResponse, IdentifyHostError>,
1315    ) -> Result<(), fidl::Error> {
1316        let _result = self.send_raw(result);
1317        self.drop_without_shutdown();
1318        _result
1319    }
1320
1321    fn send_raw(
1322        &self,
1323        mut result: Result<&IdentifyHostResponse, IdentifyHostError>,
1324    ) -> Result<(), fidl::Error> {
1325        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1326            RemoteControlIdentifyHostResponse,
1327            IdentifyHostError,
1328        >>(
1329            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
1330            self.tx_id,
1331            0x6035e1ab368deee1,
1332            fidl::encoding::DynamicFlags::FLEXIBLE,
1333        )
1334    }
1335}
1336
1337#[must_use = "FIDL methods require a response to be sent"]
1338#[derive(Debug)]
1339pub struct RemoteControlConnectCapabilityResponder {
1340    control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1341    tx_id: u32,
1342}
1343
1344/// Set the the channel to be shutdown (see [`RemoteControlControlHandle::shutdown`])
1345/// if the responder is dropped without sending a response, so that the client
1346/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1347impl std::ops::Drop for RemoteControlConnectCapabilityResponder {
1348    fn drop(&mut self) {
1349        self.control_handle.shutdown();
1350        // Safety: drops once, never accessed again
1351        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1352    }
1353}
1354
1355impl fidl::endpoints::Responder for RemoteControlConnectCapabilityResponder {
1356    type ControlHandle = RemoteControlControlHandle;
1357
1358    fn control_handle(&self) -> &RemoteControlControlHandle {
1359        &self.control_handle
1360    }
1361
1362    fn drop_without_shutdown(mut self) {
1363        // Safety: drops once, never accessed again due to mem::forget
1364        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1365        // Prevent Drop from running (which would shut down the channel)
1366        std::mem::forget(self);
1367    }
1368}
1369
1370impl RemoteControlConnectCapabilityResponder {
1371    /// Sends a response to the FIDL transaction.
1372    ///
1373    /// Sets the channel to shutdown if an error occurs.
1374    pub fn send(self, mut result: Result<(), ConnectCapabilityError>) -> Result<(), fidl::Error> {
1375        let _result = self.send_raw(result);
1376        if _result.is_err() {
1377            self.control_handle.shutdown();
1378        }
1379        self.drop_without_shutdown();
1380        _result
1381    }
1382
1383    /// Similar to "send" but does not shutdown the channel if an error occurs.
1384    pub fn send_no_shutdown_on_err(
1385        self,
1386        mut result: Result<(), ConnectCapabilityError>,
1387    ) -> Result<(), fidl::Error> {
1388        let _result = self.send_raw(result);
1389        self.drop_without_shutdown();
1390        _result
1391    }
1392
1393    fn send_raw(&self, mut result: Result<(), ConnectCapabilityError>) -> Result<(), fidl::Error> {
1394        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1395            fidl::encoding::EmptyStruct,
1396            ConnectCapabilityError,
1397        >>(
1398            fidl::encoding::FlexibleResult::new(result),
1399            self.tx_id,
1400            0x3ae7a7c874dceceb,
1401            fidl::encoding::DynamicFlags::FLEXIBLE,
1402        )
1403    }
1404}
1405
1406#[must_use = "FIDL methods require a response to be sent"]
1407#[derive(Debug)]
1408pub struct RemoteControlGetTimeResponder {
1409    control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1410    tx_id: u32,
1411}
1412
1413/// Set the the channel to be shutdown (see [`RemoteControlControlHandle::shutdown`])
1414/// if the responder is dropped without sending a response, so that the client
1415/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1416impl std::ops::Drop for RemoteControlGetTimeResponder {
1417    fn drop(&mut self) {
1418        self.control_handle.shutdown();
1419        // Safety: drops once, never accessed again
1420        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1421    }
1422}
1423
1424impl fidl::endpoints::Responder for RemoteControlGetTimeResponder {
1425    type ControlHandle = RemoteControlControlHandle;
1426
1427    fn control_handle(&self) -> &RemoteControlControlHandle {
1428        &self.control_handle
1429    }
1430
1431    fn drop_without_shutdown(mut self) {
1432        // Safety: drops once, never accessed again due to mem::forget
1433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1434        // Prevent Drop from running (which would shut down the channel)
1435        std::mem::forget(self);
1436    }
1437}
1438
1439impl RemoteControlGetTimeResponder {
1440    /// Sends a response to the FIDL transaction.
1441    ///
1442    /// Sets the channel to shutdown if an error occurs.
1443    pub fn send(self, mut time: fidl::MonotonicInstant) -> Result<(), fidl::Error> {
1444        let _result = self.send_raw(time);
1445        if _result.is_err() {
1446            self.control_handle.shutdown();
1447        }
1448        self.drop_without_shutdown();
1449        _result
1450    }
1451
1452    /// Similar to "send" but does not shutdown the channel if an error occurs.
1453    pub fn send_no_shutdown_on_err(
1454        self,
1455        mut time: fidl::MonotonicInstant,
1456    ) -> Result<(), fidl::Error> {
1457        let _result = self.send_raw(time);
1458        self.drop_without_shutdown();
1459        _result
1460    }
1461
1462    fn send_raw(&self, mut time: fidl::MonotonicInstant) -> Result<(), fidl::Error> {
1463        self.control_handle.inner.send::<RemoteControlGetTimeResponse>(
1464            (time,),
1465            self.tx_id,
1466            0x3588f31e9067748d,
1467            fidl::encoding::DynamicFlags::empty(),
1468        )
1469    }
1470}
1471
1472#[must_use = "FIDL methods require a response to be sent"]
1473#[derive(Debug)]
1474pub struct RemoteControlGetBootTimeResponder {
1475    control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1476    tx_id: u32,
1477}
1478
1479/// Set the the channel to be shutdown (see [`RemoteControlControlHandle::shutdown`])
1480/// if the responder is dropped without sending a response, so that the client
1481/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1482impl std::ops::Drop for RemoteControlGetBootTimeResponder {
1483    fn drop(&mut self) {
1484        self.control_handle.shutdown();
1485        // Safety: drops once, never accessed again
1486        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1487    }
1488}
1489
1490impl fidl::endpoints::Responder for RemoteControlGetBootTimeResponder {
1491    type ControlHandle = RemoteControlControlHandle;
1492
1493    fn control_handle(&self) -> &RemoteControlControlHandle {
1494        &self.control_handle
1495    }
1496
1497    fn drop_without_shutdown(mut self) {
1498        // Safety: drops once, never accessed again due to mem::forget
1499        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1500        // Prevent Drop from running (which would shut down the channel)
1501        std::mem::forget(self);
1502    }
1503}
1504
1505impl RemoteControlGetBootTimeResponder {
1506    /// Sends a response to the FIDL transaction.
1507    ///
1508    /// Sets the channel to shutdown if an error occurs.
1509    pub fn send(self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
1510        let _result = self.send_raw(time);
1511        if _result.is_err() {
1512            self.control_handle.shutdown();
1513        }
1514        self.drop_without_shutdown();
1515        _result
1516    }
1517
1518    /// Similar to "send" but does not shutdown the channel if an error occurs.
1519    pub fn send_no_shutdown_on_err(self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
1520        let _result = self.send_raw(time);
1521        self.drop_without_shutdown();
1522        _result
1523    }
1524
1525    fn send_raw(&self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
1526        self.control_handle.inner.send::<RemoteControlGetBootTimeResponse>(
1527            (time,),
1528            self.tx_id,
1529            0x55706f013cd79ebd,
1530            fidl::encoding::DynamicFlags::empty(),
1531        )
1532    }
1533}
1534
1535#[must_use = "FIDL methods require a response to be sent"]
1536#[derive(Debug)]
1537pub struct RemoteControlDeprecatedOpenCapabilityResponder {
1538    control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1539    tx_id: u32,
1540}
1541
1542/// Set the the channel to be shutdown (see [`RemoteControlControlHandle::shutdown`])
1543/// if the responder is dropped without sending a response, so that the client
1544/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1545impl std::ops::Drop for RemoteControlDeprecatedOpenCapabilityResponder {
1546    fn drop(&mut self) {
1547        self.control_handle.shutdown();
1548        // Safety: drops once, never accessed again
1549        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1550    }
1551}
1552
1553impl fidl::endpoints::Responder for RemoteControlDeprecatedOpenCapabilityResponder {
1554    type ControlHandle = RemoteControlControlHandle;
1555
1556    fn control_handle(&self) -> &RemoteControlControlHandle {
1557        &self.control_handle
1558    }
1559
1560    fn drop_without_shutdown(mut self) {
1561        // Safety: drops once, never accessed again due to mem::forget
1562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1563        // Prevent Drop from running (which would shut down the channel)
1564        std::mem::forget(self);
1565    }
1566}
1567
1568impl RemoteControlDeprecatedOpenCapabilityResponder {
1569    /// Sends a response to the FIDL transaction.
1570    ///
1571    /// Sets the channel to shutdown if an error occurs.
1572    pub fn send(self, mut result: Result<(), ConnectCapabilityError>) -> Result<(), fidl::Error> {
1573        let _result = self.send_raw(result);
1574        if _result.is_err() {
1575            self.control_handle.shutdown();
1576        }
1577        self.drop_without_shutdown();
1578        _result
1579    }
1580
1581    /// Similar to "send" but does not shutdown the channel if an error occurs.
1582    pub fn send_no_shutdown_on_err(
1583        self,
1584        mut result: Result<(), ConnectCapabilityError>,
1585    ) -> Result<(), fidl::Error> {
1586        let _result = self.send_raw(result);
1587        self.drop_without_shutdown();
1588        _result
1589    }
1590
1591    fn send_raw(&self, mut result: Result<(), ConnectCapabilityError>) -> Result<(), fidl::Error> {
1592        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1593            fidl::encoding::EmptyStruct,
1594            ConnectCapabilityError,
1595        >>(
1596            fidl::encoding::FlexibleResult::new(result),
1597            self.tx_id,
1598            0x51b5801f3e27e431,
1599            fidl::encoding::DynamicFlags::FLEXIBLE,
1600        )
1601    }
1602}
1603
1604mod internal {
1605    use super::*;
1606
1607    impl fidl::encoding::ResourceTypeMarker for RemoteControlConnectCapabilityRequest {
1608        type Borrowed<'a> = &'a mut Self;
1609        fn take_or_borrow<'a>(
1610            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1611        ) -> Self::Borrowed<'a> {
1612            value
1613        }
1614    }
1615
1616    unsafe impl fidl::encoding::TypeMarker for RemoteControlConnectCapabilityRequest {
1617        type Owned = Self;
1618
1619        #[inline(always)]
1620        fn inline_align(_context: fidl::encoding::Context) -> usize {
1621            8
1622        }
1623
1624        #[inline(always)]
1625        fn inline_size(_context: fidl::encoding::Context) -> usize {
1626            48
1627        }
1628    }
1629
1630    unsafe impl
1631        fidl::encoding::Encode<
1632            RemoteControlConnectCapabilityRequest,
1633            fidl::encoding::DefaultFuchsiaResourceDialect,
1634        > for &mut RemoteControlConnectCapabilityRequest
1635    {
1636        #[inline]
1637        unsafe fn encode(
1638            self,
1639            encoder: &mut fidl::encoding::Encoder<
1640                '_,
1641                fidl::encoding::DefaultFuchsiaResourceDialect,
1642            >,
1643            offset: usize,
1644            _depth: fidl::encoding::Depth,
1645        ) -> fidl::Result<()> {
1646            encoder.debug_check_bounds::<RemoteControlConnectCapabilityRequest>(offset);
1647            // Delegate to tuple encoding.
1648            fidl::encoding::Encode::<RemoteControlConnectCapabilityRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1649                (
1650                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1651                    <fidl_fuchsia_sys2::OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_set),
1652                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_name),
1653                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_channel),
1654                ),
1655                encoder, offset, _depth
1656            )
1657        }
1658    }
1659    unsafe impl<
1660            T0: fidl::encoding::Encode<
1661                fidl::encoding::BoundedString<4096>,
1662                fidl::encoding::DefaultFuchsiaResourceDialect,
1663            >,
1664            T1: fidl::encoding::Encode<
1665                fidl_fuchsia_sys2::OpenDirType,
1666                fidl::encoding::DefaultFuchsiaResourceDialect,
1667            >,
1668            T2: fidl::encoding::Encode<
1669                fidl::encoding::BoundedString<255>,
1670                fidl::encoding::DefaultFuchsiaResourceDialect,
1671            >,
1672            T3: fidl::encoding::Encode<
1673                fidl::encoding::HandleType<
1674                    fidl::Channel,
1675                    { fidl::ObjectType::CHANNEL.into_raw() },
1676                    2147483648,
1677                >,
1678                fidl::encoding::DefaultFuchsiaResourceDialect,
1679            >,
1680        >
1681        fidl::encoding::Encode<
1682            RemoteControlConnectCapabilityRequest,
1683            fidl::encoding::DefaultFuchsiaResourceDialect,
1684        > for (T0, T1, T2, T3)
1685    {
1686        #[inline]
1687        unsafe fn encode(
1688            self,
1689            encoder: &mut fidl::encoding::Encoder<
1690                '_,
1691                fidl::encoding::DefaultFuchsiaResourceDialect,
1692            >,
1693            offset: usize,
1694            depth: fidl::encoding::Depth,
1695        ) -> fidl::Result<()> {
1696            encoder.debug_check_bounds::<RemoteControlConnectCapabilityRequest>(offset);
1697            // Zero out padding regions. There's no need to apply masks
1698            // because the unmasked parts will be overwritten by fields.
1699            unsafe {
1700                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1701                (ptr as *mut u64).write_unaligned(0);
1702            }
1703            unsafe {
1704                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
1705                (ptr as *mut u64).write_unaligned(0);
1706            }
1707            // Write the fields.
1708            self.0.encode(encoder, offset + 0, depth)?;
1709            self.1.encode(encoder, offset + 16, depth)?;
1710            self.2.encode(encoder, offset + 24, depth)?;
1711            self.3.encode(encoder, offset + 40, depth)?;
1712            Ok(())
1713        }
1714    }
1715
1716    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1717        for RemoteControlConnectCapabilityRequest
1718    {
1719        #[inline(always)]
1720        fn new_empty() -> Self {
1721            Self {
1722                moniker: fidl::new_empty!(
1723                    fidl::encoding::BoundedString<4096>,
1724                    fidl::encoding::DefaultFuchsiaResourceDialect
1725                ),
1726                capability_set: fidl::new_empty!(
1727                    fidl_fuchsia_sys2::OpenDirType,
1728                    fidl::encoding::DefaultFuchsiaResourceDialect
1729                ),
1730                capability_name: fidl::new_empty!(
1731                    fidl::encoding::BoundedString<255>,
1732                    fidl::encoding::DefaultFuchsiaResourceDialect
1733                ),
1734                server_channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1735            }
1736        }
1737
1738        #[inline]
1739        unsafe fn decode(
1740            &mut self,
1741            decoder: &mut fidl::encoding::Decoder<
1742                '_,
1743                fidl::encoding::DefaultFuchsiaResourceDialect,
1744            >,
1745            offset: usize,
1746            _depth: fidl::encoding::Depth,
1747        ) -> fidl::Result<()> {
1748            decoder.debug_check_bounds::<Self>(offset);
1749            // Verify that padding bytes are zero.
1750            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1751            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1752            let mask = 0xffffffff00000000u64;
1753            let maskedval = padval & mask;
1754            if maskedval != 0 {
1755                return Err(fidl::Error::NonZeroPadding {
1756                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1757                });
1758            }
1759            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
1760            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1761            let mask = 0xffffffff00000000u64;
1762            let maskedval = padval & mask;
1763            if maskedval != 0 {
1764                return Err(fidl::Error::NonZeroPadding {
1765                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
1766                });
1767            }
1768            fidl::decode!(
1769                fidl::encoding::BoundedString<4096>,
1770                fidl::encoding::DefaultFuchsiaResourceDialect,
1771                &mut self.moniker,
1772                decoder,
1773                offset + 0,
1774                _depth
1775            )?;
1776            fidl::decode!(
1777                fidl_fuchsia_sys2::OpenDirType,
1778                fidl::encoding::DefaultFuchsiaResourceDialect,
1779                &mut self.capability_set,
1780                decoder,
1781                offset + 16,
1782                _depth
1783            )?;
1784            fidl::decode!(
1785                fidl::encoding::BoundedString<255>,
1786                fidl::encoding::DefaultFuchsiaResourceDialect,
1787                &mut self.capability_name,
1788                decoder,
1789                offset + 24,
1790                _depth
1791            )?;
1792            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_channel, decoder, offset + 40, _depth)?;
1793            Ok(())
1794        }
1795    }
1796
1797    impl fidl::encoding::ResourceTypeMarker for RemoteControlDeprecatedOpenCapabilityRequest {
1798        type Borrowed<'a> = &'a mut Self;
1799        fn take_or_borrow<'a>(
1800            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1801        ) -> Self::Borrowed<'a> {
1802            value
1803        }
1804    }
1805
1806    unsafe impl fidl::encoding::TypeMarker for RemoteControlDeprecatedOpenCapabilityRequest {
1807        type Owned = Self;
1808
1809        #[inline(always)]
1810        fn inline_align(_context: fidl::encoding::Context) -> usize {
1811            8
1812        }
1813
1814        #[inline(always)]
1815        fn inline_size(_context: fidl::encoding::Context) -> usize {
1816            48
1817        }
1818    }
1819
1820    unsafe impl
1821        fidl::encoding::Encode<
1822            RemoteControlDeprecatedOpenCapabilityRequest,
1823            fidl::encoding::DefaultFuchsiaResourceDialect,
1824        > for &mut RemoteControlDeprecatedOpenCapabilityRequest
1825    {
1826        #[inline]
1827        unsafe fn encode(
1828            self,
1829            encoder: &mut fidl::encoding::Encoder<
1830                '_,
1831                fidl::encoding::DefaultFuchsiaResourceDialect,
1832            >,
1833            offset: usize,
1834            _depth: fidl::encoding::Depth,
1835        ) -> fidl::Result<()> {
1836            encoder.debug_check_bounds::<RemoteControlDeprecatedOpenCapabilityRequest>(offset);
1837            // Delegate to tuple encoding.
1838            fidl::encoding::Encode::<RemoteControlDeprecatedOpenCapabilityRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1839                (
1840                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1841                    <fidl_fuchsia_sys2::OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_set),
1842                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_name),
1843                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_channel),
1844                    <fidl_fuchsia_io::OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
1845                ),
1846                encoder, offset, _depth
1847            )
1848        }
1849    }
1850    unsafe impl<
1851            T0: fidl::encoding::Encode<
1852                fidl::encoding::BoundedString<4096>,
1853                fidl::encoding::DefaultFuchsiaResourceDialect,
1854            >,
1855            T1: fidl::encoding::Encode<
1856                fidl_fuchsia_sys2::OpenDirType,
1857                fidl::encoding::DefaultFuchsiaResourceDialect,
1858            >,
1859            T2: fidl::encoding::Encode<
1860                fidl::encoding::BoundedString<255>,
1861                fidl::encoding::DefaultFuchsiaResourceDialect,
1862            >,
1863            T3: fidl::encoding::Encode<
1864                fidl::encoding::HandleType<
1865                    fidl::Channel,
1866                    { fidl::ObjectType::CHANNEL.into_raw() },
1867                    2147483648,
1868                >,
1869                fidl::encoding::DefaultFuchsiaResourceDialect,
1870            >,
1871            T4: fidl::encoding::Encode<
1872                fidl_fuchsia_io::OpenFlags,
1873                fidl::encoding::DefaultFuchsiaResourceDialect,
1874            >,
1875        >
1876        fidl::encoding::Encode<
1877            RemoteControlDeprecatedOpenCapabilityRequest,
1878            fidl::encoding::DefaultFuchsiaResourceDialect,
1879        > for (T0, T1, T2, T3, T4)
1880    {
1881        #[inline]
1882        unsafe fn encode(
1883            self,
1884            encoder: &mut fidl::encoding::Encoder<
1885                '_,
1886                fidl::encoding::DefaultFuchsiaResourceDialect,
1887            >,
1888            offset: usize,
1889            depth: fidl::encoding::Depth,
1890        ) -> fidl::Result<()> {
1891            encoder.debug_check_bounds::<RemoteControlDeprecatedOpenCapabilityRequest>(offset);
1892            // Zero out padding regions. There's no need to apply masks
1893            // because the unmasked parts will be overwritten by fields.
1894            unsafe {
1895                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1896                (ptr as *mut u64).write_unaligned(0);
1897            }
1898            // Write the fields.
1899            self.0.encode(encoder, offset + 0, depth)?;
1900            self.1.encode(encoder, offset + 16, depth)?;
1901            self.2.encode(encoder, offset + 24, depth)?;
1902            self.3.encode(encoder, offset + 40, depth)?;
1903            self.4.encode(encoder, offset + 44, depth)?;
1904            Ok(())
1905        }
1906    }
1907
1908    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1909        for RemoteControlDeprecatedOpenCapabilityRequest
1910    {
1911        #[inline(always)]
1912        fn new_empty() -> Self {
1913            Self {
1914                moniker: fidl::new_empty!(
1915                    fidl::encoding::BoundedString<4096>,
1916                    fidl::encoding::DefaultFuchsiaResourceDialect
1917                ),
1918                capability_set: fidl::new_empty!(
1919                    fidl_fuchsia_sys2::OpenDirType,
1920                    fidl::encoding::DefaultFuchsiaResourceDialect
1921                ),
1922                capability_name: fidl::new_empty!(
1923                    fidl::encoding::BoundedString<255>,
1924                    fidl::encoding::DefaultFuchsiaResourceDialect
1925                ),
1926                server_channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1927                flags: fidl::new_empty!(
1928                    fidl_fuchsia_io::OpenFlags,
1929                    fidl::encoding::DefaultFuchsiaResourceDialect
1930                ),
1931            }
1932        }
1933
1934        #[inline]
1935        unsafe fn decode(
1936            &mut self,
1937            decoder: &mut fidl::encoding::Decoder<
1938                '_,
1939                fidl::encoding::DefaultFuchsiaResourceDialect,
1940            >,
1941            offset: usize,
1942            _depth: fidl::encoding::Depth,
1943        ) -> fidl::Result<()> {
1944            decoder.debug_check_bounds::<Self>(offset);
1945            // Verify that padding bytes are zero.
1946            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1947            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1948            let mask = 0xffffffff00000000u64;
1949            let maskedval = padval & mask;
1950            if maskedval != 0 {
1951                return Err(fidl::Error::NonZeroPadding {
1952                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1953                });
1954            }
1955            fidl::decode!(
1956                fidl::encoding::BoundedString<4096>,
1957                fidl::encoding::DefaultFuchsiaResourceDialect,
1958                &mut self.moniker,
1959                decoder,
1960                offset + 0,
1961                _depth
1962            )?;
1963            fidl::decode!(
1964                fidl_fuchsia_sys2::OpenDirType,
1965                fidl::encoding::DefaultFuchsiaResourceDialect,
1966                &mut self.capability_set,
1967                decoder,
1968                offset + 16,
1969                _depth
1970            )?;
1971            fidl::decode!(
1972                fidl::encoding::BoundedString<255>,
1973                fidl::encoding::DefaultFuchsiaResourceDialect,
1974                &mut self.capability_name,
1975                decoder,
1976                offset + 24,
1977                _depth
1978            )?;
1979            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_channel, decoder, offset + 40, _depth)?;
1980            fidl::decode!(
1981                fidl_fuchsia_io::OpenFlags,
1982                fidl::encoding::DefaultFuchsiaResourceDialect,
1983                &mut self.flags,
1984                decoder,
1985                offset + 44,
1986                _depth
1987            )?;
1988            Ok(())
1989        }
1990    }
1991}