fidl_test_external/
fidl_test_external.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_test_external_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct EchoHandleProtocolEchoHandleRequestReducedRightsRequest {
16    pub h: fidl::Event,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20    for EchoHandleProtocolEchoHandleRequestReducedRightsRequest
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct EchoHandleProtocolEchoHandleRequestReducedRightsResponse {
26    pub h: fidl::Event,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30    for EchoHandleProtocolEchoHandleRequestReducedRightsResponse
31{
32}
33
34#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35pub struct EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest {
36    pub h: fidl::Event,
37}
38
39impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
40    for EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest
41{
42}
43
44#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
45pub struct EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse {
46    pub h: fidl::Event,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
50    for EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse
51{
52}
53
54#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
55pub struct EchoHandleProtocolEchoHandleRequestSameRightsRequest {
56    pub h: fidl::Event,
57}
58
59impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
60    for EchoHandleProtocolEchoHandleRequestSameRightsRequest
61{
62}
63
64#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
65pub struct EchoHandleProtocolEchoHandleRequestSameRightsResponse {
66    pub h: fidl::Event,
67}
68
69impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
70    for EchoHandleProtocolEchoHandleRequestSameRightsResponse
71{
72}
73
74#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
75pub struct EchoHandleProtocolEchoHandleResponseReducedRightsRequest {
76    pub h: fidl::Event,
77}
78
79impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
80    for EchoHandleProtocolEchoHandleResponseReducedRightsRequest
81{
82}
83
84#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct EchoHandleProtocolEchoHandleResponseReducedRightsResponse {
86    pub h: fidl::Event,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
90    for EchoHandleProtocolEchoHandleResponseReducedRightsResponse
91{
92}
93
94#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95pub struct EchoHandleProtocolEchoHandleResponseSameRightsRequest {
96    pub h: fidl::Event,
97}
98
99impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
100    for EchoHandleProtocolEchoHandleResponseSameRightsRequest
101{
102}
103
104#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105pub struct EchoHandleProtocolEchoHandleResponseSameRightsResponse {
106    pub h: fidl::Event,
107}
108
109impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
110    for EchoHandleProtocolEchoHandleResponseSameRightsResponse
111{
112}
113
114#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
115pub struct ErrorSyntaxProtocolTestErrorSyntaxResponse {
116    pub h: fidl::Event,
117}
118
119impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
120    for ErrorSyntaxProtocolTestErrorSyntaxResponse
121{
122}
123
124#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
125pub struct PushEventProtocolPushEventReducedRightsRequest {
126    pub h: fidl::Event,
127}
128
129impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
130    for PushEventProtocolPushEventReducedRightsRequest
131{
132}
133
134#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135pub struct PushEventProtocolPushEventSameRightsRequest {
136    pub h: fidl::Event,
137}
138
139impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
140    for PushEventProtocolPushEventSameRightsRequest
141{
142}
143
144#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145pub struct SendHandleProtocolSendHandleReducedRightsRequest {
146    pub h: fidl::Event,
147}
148
149impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
150    for SendHandleProtocolSendHandleReducedRightsRequest
151{
152}
153
154#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155pub struct SendHandleProtocolSendHandleSameRightsRequest {
156    pub h: fidl::Event,
157}
158
159impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
160    for SendHandleProtocolSendHandleSameRightsRequest
161{
162}
163
164#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
165pub struct StructWithHandles {
166    pub v: Vec<fidl::Channel>,
167}
168
169impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StructWithHandles {}
170
171#[derive(Debug, Default, PartialEq)]
172pub struct ResourceRecord {
173    pub name: Option<String>,
174    pub age: Option<u8>,
175    #[doc(hidden)]
176    pub __source_breaking: fidl::marker::SourceBreaking,
177}
178
179impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ResourceRecord {}
180
181#[derive(Debug)]
182pub enum FlexibleResourceThing {
183    Number(u32),
184    Name(String),
185    #[doc(hidden)]
186    __SourceBreaking {
187        unknown_ordinal: u64,
188    },
189}
190
191/// Pattern that matches an unknown `FlexibleResourceThing` member.
192#[macro_export]
193macro_rules! FlexibleResourceThingUnknown {
194    () => {
195        _
196    };
197}
198
199// Custom PartialEq so that unknown variants are not equal to themselves.
200impl PartialEq for FlexibleResourceThing {
201    fn eq(&self, other: &Self) -> bool {
202        match (self, other) {
203            (Self::Number(x), Self::Number(y)) => *x == *y,
204            (Self::Name(x), Self::Name(y)) => *x == *y,
205            _ => false,
206        }
207    }
208}
209
210impl FlexibleResourceThing {
211    #[inline]
212    pub fn ordinal(&self) -> u64 {
213        match *self {
214            Self::Number(_) => 1,
215            Self::Name(_) => 2,
216            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
217        }
218    }
219
220    #[inline]
221    pub fn unknown_variant_for_testing() -> Self {
222        Self::__SourceBreaking { unknown_ordinal: 0 }
223    }
224
225    #[inline]
226    pub fn is_unknown(&self) -> bool {
227        match self {
228            Self::__SourceBreaking { .. } => true,
229            _ => false,
230        }
231    }
232}
233
234impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FlexibleResourceThing {}
235
236#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
237pub enum StrictResourceThing {
238    Number(u32),
239    Name(String),
240}
241
242impl StrictResourceThing {
243    #[inline]
244    pub fn ordinal(&self) -> u64 {
245        match *self {
246            Self::Number(_) => 1,
247            Self::Name(_) => 2,
248        }
249    }
250
251    #[deprecated = "Strict unions should not use `is_unknown`"]
252    #[inline]
253    pub fn is_unknown(&self) -> bool {
254        false
255    }
256}
257
258impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StrictResourceThing {}
259
260#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
261pub struct EchoHandleProtocolMarker;
262
263impl fidl::endpoints::ProtocolMarker for EchoHandleProtocolMarker {
264    type Proxy = EchoHandleProtocolProxy;
265    type RequestStream = EchoHandleProtocolRequestStream;
266    #[cfg(target_os = "fuchsia")]
267    type SynchronousProxy = EchoHandleProtocolSynchronousProxy;
268
269    const DEBUG_NAME: &'static str = "(anonymous) EchoHandleProtocol";
270}
271
272pub trait EchoHandleProtocolProxyInterface: Send + Sync {
273    type EchoHandleRequestResponseReducedRightsResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
274        + Send;
275    fn r#echo_handle_request_response_reduced_rights(
276        &self,
277        h: fidl::Event,
278    ) -> Self::EchoHandleRequestResponseReducedRightsResponseFut;
279    type EchoHandleRequestReducedRightsResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
280        + Send;
281    fn r#echo_handle_request_reduced_rights(
282        &self,
283        h: fidl::Event,
284    ) -> Self::EchoHandleRequestReducedRightsResponseFut;
285    type EchoHandleRequestSameRightsResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
286        + Send;
287    fn r#echo_handle_request_same_rights(
288        &self,
289        h: fidl::Event,
290    ) -> Self::EchoHandleRequestSameRightsResponseFut;
291    type EchoHandleResponseReducedRightsResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
292        + Send;
293    fn r#echo_handle_response_reduced_rights(
294        &self,
295        h: fidl::Event,
296    ) -> Self::EchoHandleResponseReducedRightsResponseFut;
297    type EchoHandleResponseSameRightsResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
298        + Send;
299    fn r#echo_handle_response_same_rights(
300        &self,
301        h: fidl::Event,
302    ) -> Self::EchoHandleResponseSameRightsResponseFut;
303}
304#[derive(Debug)]
305#[cfg(target_os = "fuchsia")]
306pub struct EchoHandleProtocolSynchronousProxy {
307    client: fidl::client::sync::Client,
308}
309
310#[cfg(target_os = "fuchsia")]
311impl fidl::endpoints::SynchronousProxy for EchoHandleProtocolSynchronousProxy {
312    type Proxy = EchoHandleProtocolProxy;
313    type Protocol = EchoHandleProtocolMarker;
314
315    fn from_channel(inner: fidl::Channel) -> Self {
316        Self::new(inner)
317    }
318
319    fn into_channel(self) -> fidl::Channel {
320        self.client.into_channel()
321    }
322
323    fn as_channel(&self) -> &fidl::Channel {
324        self.client.as_channel()
325    }
326}
327
328#[cfg(target_os = "fuchsia")]
329impl EchoHandleProtocolSynchronousProxy {
330    pub fn new(channel: fidl::Channel) -> Self {
331        let protocol_name =
332            <EchoHandleProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
333        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
334    }
335
336    pub fn into_channel(self) -> fidl::Channel {
337        self.client.into_channel()
338    }
339
340    /// Waits until an event arrives and returns it. It is safe for other
341    /// threads to make concurrent requests while waiting for an event.
342    pub fn wait_for_event(
343        &self,
344        deadline: zx::MonotonicInstant,
345    ) -> Result<EchoHandleProtocolEvent, fidl::Error> {
346        EchoHandleProtocolEvent::decode(self.client.wait_for_event(deadline)?)
347    }
348
349    pub fn r#echo_handle_request_response_reduced_rights(
350        &self,
351        mut h: fidl::Event,
352        ___deadline: zx::MonotonicInstant,
353    ) -> Result<fidl::Event, fidl::Error> {
354        let _response = self.client.send_query::<
355            EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest,
356            EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse,
357        >(
358            (h,),
359            0x5c6c0f3032f3bcc6,
360            fidl::encoding::DynamicFlags::empty(),
361            ___deadline,
362        )?;
363        Ok(_response.h)
364    }
365
366    pub fn r#echo_handle_request_reduced_rights(
367        &self,
368        mut h: fidl::Event,
369        ___deadline: zx::MonotonicInstant,
370    ) -> Result<fidl::Event, fidl::Error> {
371        let _response = self.client.send_query::<
372            EchoHandleProtocolEchoHandleRequestReducedRightsRequest,
373            EchoHandleProtocolEchoHandleRequestReducedRightsResponse,
374        >(
375            (h,),
376            0x6f73455d31eb2f42,
377            fidl::encoding::DynamicFlags::empty(),
378            ___deadline,
379        )?;
380        Ok(_response.h)
381    }
382
383    pub fn r#echo_handle_request_same_rights(
384        &self,
385        mut h: fidl::Event,
386        ___deadline: zx::MonotonicInstant,
387    ) -> Result<fidl::Event, fidl::Error> {
388        let _response = self.client.send_query::<
389            EchoHandleProtocolEchoHandleRequestSameRightsRequest,
390            EchoHandleProtocolEchoHandleRequestSameRightsResponse,
391        >(
392            (h,),
393            0x7bd6b869de1eb0b7,
394            fidl::encoding::DynamicFlags::empty(),
395            ___deadline,
396        )?;
397        Ok(_response.h)
398    }
399
400    pub fn r#echo_handle_response_reduced_rights(
401        &self,
402        mut h: fidl::Event,
403        ___deadline: zx::MonotonicInstant,
404    ) -> Result<fidl::Event, fidl::Error> {
405        let _response = self.client.send_query::<
406            EchoHandleProtocolEchoHandleResponseReducedRightsRequest,
407            EchoHandleProtocolEchoHandleResponseReducedRightsResponse,
408        >(
409            (h,),
410            0x458d1c6d39e34f1e,
411            fidl::encoding::DynamicFlags::empty(),
412            ___deadline,
413        )?;
414        Ok(_response.h)
415    }
416
417    pub fn r#echo_handle_response_same_rights(
418        &self,
419        mut h: fidl::Event,
420        ___deadline: zx::MonotonicInstant,
421    ) -> Result<fidl::Event, fidl::Error> {
422        let _response = self.client.send_query::<
423            EchoHandleProtocolEchoHandleResponseSameRightsRequest,
424            EchoHandleProtocolEchoHandleResponseSameRightsResponse,
425        >(
426            (h,),
427            0x57334c827816fe5,
428            fidl::encoding::DynamicFlags::empty(),
429            ___deadline,
430        )?;
431        Ok(_response.h)
432    }
433}
434
435#[derive(Debug, Clone)]
436pub struct EchoHandleProtocolProxy {
437    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
438}
439
440impl fidl::endpoints::Proxy for EchoHandleProtocolProxy {
441    type Protocol = EchoHandleProtocolMarker;
442
443    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
444        Self::new(inner)
445    }
446
447    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
448        self.client.into_channel().map_err(|client| Self { client })
449    }
450
451    fn as_channel(&self) -> &::fidl::AsyncChannel {
452        self.client.as_channel()
453    }
454}
455
456impl EchoHandleProtocolProxy {
457    /// Create a new Proxy for test.external/EchoHandleProtocol.
458    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
459        let protocol_name =
460            <EchoHandleProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
461        Self { client: fidl::client::Client::new(channel, protocol_name) }
462    }
463
464    /// Get a Stream of events from the remote end of the protocol.
465    ///
466    /// # Panics
467    ///
468    /// Panics if the event stream was already taken.
469    pub fn take_event_stream(&self) -> EchoHandleProtocolEventStream {
470        EchoHandleProtocolEventStream { event_receiver: self.client.take_event_receiver() }
471    }
472
473    pub fn r#echo_handle_request_response_reduced_rights(
474        &self,
475        mut h: fidl::Event,
476    ) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
477    {
478        EchoHandleProtocolProxyInterface::r#echo_handle_request_response_reduced_rights(self, h)
479    }
480
481    pub fn r#echo_handle_request_reduced_rights(
482        &self,
483        mut h: fidl::Event,
484    ) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
485    {
486        EchoHandleProtocolProxyInterface::r#echo_handle_request_reduced_rights(self, h)
487    }
488
489    pub fn r#echo_handle_request_same_rights(
490        &self,
491        mut h: fidl::Event,
492    ) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
493    {
494        EchoHandleProtocolProxyInterface::r#echo_handle_request_same_rights(self, h)
495    }
496
497    pub fn r#echo_handle_response_reduced_rights(
498        &self,
499        mut h: fidl::Event,
500    ) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
501    {
502        EchoHandleProtocolProxyInterface::r#echo_handle_response_reduced_rights(self, h)
503    }
504
505    pub fn r#echo_handle_response_same_rights(
506        &self,
507        mut h: fidl::Event,
508    ) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
509    {
510        EchoHandleProtocolProxyInterface::r#echo_handle_response_same_rights(self, h)
511    }
512}
513
514impl EchoHandleProtocolProxyInterface for EchoHandleProtocolProxy {
515    type EchoHandleRequestResponseReducedRightsResponseFut =
516        fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
517    fn r#echo_handle_request_response_reduced_rights(
518        &self,
519        mut h: fidl::Event,
520    ) -> Self::EchoHandleRequestResponseReducedRightsResponseFut {
521        fn _decode(
522            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
523        ) -> Result<fidl::Event, fidl::Error> {
524            let _response = fidl::client::decode_transaction_body::<
525                EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse,
526                fidl::encoding::DefaultFuchsiaResourceDialect,
527                0x5c6c0f3032f3bcc6,
528            >(_buf?)?;
529            Ok(_response.h)
530        }
531        self.client.send_query_and_decode::<
532            EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest,
533            fidl::Event,
534        >(
535            (h,),
536            0x5c6c0f3032f3bcc6,
537            fidl::encoding::DynamicFlags::empty(),
538            _decode,
539        )
540    }
541
542    type EchoHandleRequestReducedRightsResponseFut =
543        fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
544    fn r#echo_handle_request_reduced_rights(
545        &self,
546        mut h: fidl::Event,
547    ) -> Self::EchoHandleRequestReducedRightsResponseFut {
548        fn _decode(
549            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
550        ) -> Result<fidl::Event, fidl::Error> {
551            let _response = fidl::client::decode_transaction_body::<
552                EchoHandleProtocolEchoHandleRequestReducedRightsResponse,
553                fidl::encoding::DefaultFuchsiaResourceDialect,
554                0x6f73455d31eb2f42,
555            >(_buf?)?;
556            Ok(_response.h)
557        }
558        self.client.send_query_and_decode::<
559            EchoHandleProtocolEchoHandleRequestReducedRightsRequest,
560            fidl::Event,
561        >(
562            (h,),
563            0x6f73455d31eb2f42,
564            fidl::encoding::DynamicFlags::empty(),
565            _decode,
566        )
567    }
568
569    type EchoHandleRequestSameRightsResponseFut =
570        fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
571    fn r#echo_handle_request_same_rights(
572        &self,
573        mut h: fidl::Event,
574    ) -> Self::EchoHandleRequestSameRightsResponseFut {
575        fn _decode(
576            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
577        ) -> Result<fidl::Event, fidl::Error> {
578            let _response = fidl::client::decode_transaction_body::<
579                EchoHandleProtocolEchoHandleRequestSameRightsResponse,
580                fidl::encoding::DefaultFuchsiaResourceDialect,
581                0x7bd6b869de1eb0b7,
582            >(_buf?)?;
583            Ok(_response.h)
584        }
585        self.client.send_query_and_decode::<
586            EchoHandleProtocolEchoHandleRequestSameRightsRequest,
587            fidl::Event,
588        >(
589            (h,),
590            0x7bd6b869de1eb0b7,
591            fidl::encoding::DynamicFlags::empty(),
592            _decode,
593        )
594    }
595
596    type EchoHandleResponseReducedRightsResponseFut =
597        fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
598    fn r#echo_handle_response_reduced_rights(
599        &self,
600        mut h: fidl::Event,
601    ) -> Self::EchoHandleResponseReducedRightsResponseFut {
602        fn _decode(
603            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
604        ) -> Result<fidl::Event, fidl::Error> {
605            let _response = fidl::client::decode_transaction_body::<
606                EchoHandleProtocolEchoHandleResponseReducedRightsResponse,
607                fidl::encoding::DefaultFuchsiaResourceDialect,
608                0x458d1c6d39e34f1e,
609            >(_buf?)?;
610            Ok(_response.h)
611        }
612        self.client.send_query_and_decode::<
613            EchoHandleProtocolEchoHandleResponseReducedRightsRequest,
614            fidl::Event,
615        >(
616            (h,),
617            0x458d1c6d39e34f1e,
618            fidl::encoding::DynamicFlags::empty(),
619            _decode,
620        )
621    }
622
623    type EchoHandleResponseSameRightsResponseFut =
624        fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
625    fn r#echo_handle_response_same_rights(
626        &self,
627        mut h: fidl::Event,
628    ) -> Self::EchoHandleResponseSameRightsResponseFut {
629        fn _decode(
630            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
631        ) -> Result<fidl::Event, fidl::Error> {
632            let _response = fidl::client::decode_transaction_body::<
633                EchoHandleProtocolEchoHandleResponseSameRightsResponse,
634                fidl::encoding::DefaultFuchsiaResourceDialect,
635                0x57334c827816fe5,
636            >(_buf?)?;
637            Ok(_response.h)
638        }
639        self.client.send_query_and_decode::<
640            EchoHandleProtocolEchoHandleResponseSameRightsRequest,
641            fidl::Event,
642        >(
643            (h,),
644            0x57334c827816fe5,
645            fidl::encoding::DynamicFlags::empty(),
646            _decode,
647        )
648    }
649}
650
651pub struct EchoHandleProtocolEventStream {
652    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
653}
654
655impl std::marker::Unpin for EchoHandleProtocolEventStream {}
656
657impl futures::stream::FusedStream for EchoHandleProtocolEventStream {
658    fn is_terminated(&self) -> bool {
659        self.event_receiver.is_terminated()
660    }
661}
662
663impl futures::Stream for EchoHandleProtocolEventStream {
664    type Item = Result<EchoHandleProtocolEvent, fidl::Error>;
665
666    fn poll_next(
667        mut self: std::pin::Pin<&mut Self>,
668        cx: &mut std::task::Context<'_>,
669    ) -> std::task::Poll<Option<Self::Item>> {
670        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
671            &mut self.event_receiver,
672            cx
673        )?) {
674            Some(buf) => std::task::Poll::Ready(Some(EchoHandleProtocolEvent::decode(buf))),
675            None => std::task::Poll::Ready(None),
676        }
677    }
678}
679
680#[derive(Debug)]
681pub enum EchoHandleProtocolEvent {}
682
683impl EchoHandleProtocolEvent {
684    /// Decodes a message buffer as a [`EchoHandleProtocolEvent`].
685    fn decode(
686        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
687    ) -> Result<EchoHandleProtocolEvent, fidl::Error> {
688        let (bytes, _handles) = buf.split_mut();
689        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
690        debug_assert_eq!(tx_header.tx_id, 0);
691        match tx_header.ordinal {
692            _ => Err(fidl::Error::UnknownOrdinal {
693                ordinal: tx_header.ordinal,
694                protocol_name:
695                    <EchoHandleProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
696            }),
697        }
698    }
699}
700
701/// A Stream of incoming requests for test.external/EchoHandleProtocol.
702pub struct EchoHandleProtocolRequestStream {
703    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
704    is_terminated: bool,
705}
706
707impl std::marker::Unpin for EchoHandleProtocolRequestStream {}
708
709impl futures::stream::FusedStream for EchoHandleProtocolRequestStream {
710    fn is_terminated(&self) -> bool {
711        self.is_terminated
712    }
713}
714
715impl fidl::endpoints::RequestStream for EchoHandleProtocolRequestStream {
716    type Protocol = EchoHandleProtocolMarker;
717    type ControlHandle = EchoHandleProtocolControlHandle;
718
719    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
720        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
721    }
722
723    fn control_handle(&self) -> Self::ControlHandle {
724        EchoHandleProtocolControlHandle { inner: self.inner.clone() }
725    }
726
727    fn into_inner(
728        self,
729    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
730    {
731        (self.inner, self.is_terminated)
732    }
733
734    fn from_inner(
735        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
736        is_terminated: bool,
737    ) -> Self {
738        Self { inner, is_terminated }
739    }
740}
741
742impl futures::Stream for EchoHandleProtocolRequestStream {
743    type Item = Result<EchoHandleProtocolRequest, fidl::Error>;
744
745    fn poll_next(
746        mut self: std::pin::Pin<&mut Self>,
747        cx: &mut std::task::Context<'_>,
748    ) -> std::task::Poll<Option<Self::Item>> {
749        let this = &mut *self;
750        if this.inner.check_shutdown(cx) {
751            this.is_terminated = true;
752            return std::task::Poll::Ready(None);
753        }
754        if this.is_terminated {
755            panic!("polled EchoHandleProtocolRequestStream after completion");
756        }
757        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
758            |bytes, handles| {
759                match this.inner.channel().read_etc(cx, bytes, handles) {
760                    std::task::Poll::Ready(Ok(())) => {}
761                    std::task::Poll::Pending => return std::task::Poll::Pending,
762                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
763                        this.is_terminated = true;
764                        return std::task::Poll::Ready(None);
765                    }
766                    std::task::Poll::Ready(Err(e)) => {
767                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
768                            e.into(),
769                        ))))
770                    }
771                }
772
773                // A message has been received from the channel
774                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
775
776                std::task::Poll::Ready(Some(match header.ordinal {
777                0x5c6c0f3032f3bcc6 => {
778                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
779                    let mut req = fidl::new_empty!(EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
780                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest>(&header, _body_bytes, handles, &mut req)?;
781                    let control_handle = EchoHandleProtocolControlHandle {
782                        inner: this.inner.clone(),
783                    };
784                    Ok(EchoHandleProtocolRequest::EchoHandleRequestResponseReducedRights {h: req.h,
785
786                        responder: EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponder {
787                            control_handle: std::mem::ManuallyDrop::new(control_handle),
788                            tx_id: header.tx_id,
789                        },
790                    })
791                }
792                0x6f73455d31eb2f42 => {
793                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
794                    let mut req = fidl::new_empty!(EchoHandleProtocolEchoHandleRequestReducedRightsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
795                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EchoHandleProtocolEchoHandleRequestReducedRightsRequest>(&header, _body_bytes, handles, &mut req)?;
796                    let control_handle = EchoHandleProtocolControlHandle {
797                        inner: this.inner.clone(),
798                    };
799                    Ok(EchoHandleProtocolRequest::EchoHandleRequestReducedRights {h: req.h,
800
801                        responder: EchoHandleProtocolEchoHandleRequestReducedRightsResponder {
802                            control_handle: std::mem::ManuallyDrop::new(control_handle),
803                            tx_id: header.tx_id,
804                        },
805                    })
806                }
807                0x7bd6b869de1eb0b7 => {
808                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
809                    let mut req = fidl::new_empty!(EchoHandleProtocolEchoHandleRequestSameRightsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
810                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EchoHandleProtocolEchoHandleRequestSameRightsRequest>(&header, _body_bytes, handles, &mut req)?;
811                    let control_handle = EchoHandleProtocolControlHandle {
812                        inner: this.inner.clone(),
813                    };
814                    Ok(EchoHandleProtocolRequest::EchoHandleRequestSameRights {h: req.h,
815
816                        responder: EchoHandleProtocolEchoHandleRequestSameRightsResponder {
817                            control_handle: std::mem::ManuallyDrop::new(control_handle),
818                            tx_id: header.tx_id,
819                        },
820                    })
821                }
822                0x458d1c6d39e34f1e => {
823                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
824                    let mut req = fidl::new_empty!(EchoHandleProtocolEchoHandleResponseReducedRightsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
825                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EchoHandleProtocolEchoHandleResponseReducedRightsRequest>(&header, _body_bytes, handles, &mut req)?;
826                    let control_handle = EchoHandleProtocolControlHandle {
827                        inner: this.inner.clone(),
828                    };
829                    Ok(EchoHandleProtocolRequest::EchoHandleResponseReducedRights {h: req.h,
830
831                        responder: EchoHandleProtocolEchoHandleResponseReducedRightsResponder {
832                            control_handle: std::mem::ManuallyDrop::new(control_handle),
833                            tx_id: header.tx_id,
834                        },
835                    })
836                }
837                0x57334c827816fe5 => {
838                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
839                    let mut req = fidl::new_empty!(EchoHandleProtocolEchoHandleResponseSameRightsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
840                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EchoHandleProtocolEchoHandleResponseSameRightsRequest>(&header, _body_bytes, handles, &mut req)?;
841                    let control_handle = EchoHandleProtocolControlHandle {
842                        inner: this.inner.clone(),
843                    };
844                    Ok(EchoHandleProtocolRequest::EchoHandleResponseSameRights {h: req.h,
845
846                        responder: EchoHandleProtocolEchoHandleResponseSameRightsResponder {
847                            control_handle: std::mem::ManuallyDrop::new(control_handle),
848                            tx_id: header.tx_id,
849                        },
850                    })
851                }
852                _ => Err(fidl::Error::UnknownOrdinal {
853                    ordinal: header.ordinal,
854                    protocol_name: <EchoHandleProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
855                }),
856            }))
857            },
858        )
859    }
860}
861
862#[derive(Debug)]
863pub enum EchoHandleProtocolRequest {
864    EchoHandleRequestResponseReducedRights {
865        h: fidl::Event,
866        responder: EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponder,
867    },
868    EchoHandleRequestReducedRights {
869        h: fidl::Event,
870        responder: EchoHandleProtocolEchoHandleRequestReducedRightsResponder,
871    },
872    EchoHandleRequestSameRights {
873        h: fidl::Event,
874        responder: EchoHandleProtocolEchoHandleRequestSameRightsResponder,
875    },
876    EchoHandleResponseReducedRights {
877        h: fidl::Event,
878        responder: EchoHandleProtocolEchoHandleResponseReducedRightsResponder,
879    },
880    EchoHandleResponseSameRights {
881        h: fidl::Event,
882        responder: EchoHandleProtocolEchoHandleResponseSameRightsResponder,
883    },
884}
885
886impl EchoHandleProtocolRequest {
887    #[allow(irrefutable_let_patterns)]
888    pub fn into_echo_handle_request_response_reduced_rights(
889        self,
890    ) -> Option<(fidl::Event, EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponder)>
891    {
892        if let EchoHandleProtocolRequest::EchoHandleRequestResponseReducedRights { h, responder } =
893            self
894        {
895            Some((h, responder))
896        } else {
897            None
898        }
899    }
900
901    #[allow(irrefutable_let_patterns)]
902    pub fn into_echo_handle_request_reduced_rights(
903        self,
904    ) -> Option<(fidl::Event, EchoHandleProtocolEchoHandleRequestReducedRightsResponder)> {
905        if let EchoHandleProtocolRequest::EchoHandleRequestReducedRights { h, responder } = self {
906            Some((h, responder))
907        } else {
908            None
909        }
910    }
911
912    #[allow(irrefutable_let_patterns)]
913    pub fn into_echo_handle_request_same_rights(
914        self,
915    ) -> Option<(fidl::Event, EchoHandleProtocolEchoHandleRequestSameRightsResponder)> {
916        if let EchoHandleProtocolRequest::EchoHandleRequestSameRights { h, responder } = self {
917            Some((h, responder))
918        } else {
919            None
920        }
921    }
922
923    #[allow(irrefutable_let_patterns)]
924    pub fn into_echo_handle_response_reduced_rights(
925        self,
926    ) -> Option<(fidl::Event, EchoHandleProtocolEchoHandleResponseReducedRightsResponder)> {
927        if let EchoHandleProtocolRequest::EchoHandleResponseReducedRights { h, responder } = self {
928            Some((h, responder))
929        } else {
930            None
931        }
932    }
933
934    #[allow(irrefutable_let_patterns)]
935    pub fn into_echo_handle_response_same_rights(
936        self,
937    ) -> Option<(fidl::Event, EchoHandleProtocolEchoHandleResponseSameRightsResponder)> {
938        if let EchoHandleProtocolRequest::EchoHandleResponseSameRights { h, responder } = self {
939            Some((h, responder))
940        } else {
941            None
942        }
943    }
944
945    /// Name of the method defined in FIDL
946    pub fn method_name(&self) -> &'static str {
947        match *self {
948            EchoHandleProtocolRequest::EchoHandleRequestResponseReducedRights { .. } => {
949                "echo_handle_request_response_reduced_rights"
950            }
951            EchoHandleProtocolRequest::EchoHandleRequestReducedRights { .. } => {
952                "echo_handle_request_reduced_rights"
953            }
954            EchoHandleProtocolRequest::EchoHandleRequestSameRights { .. } => {
955                "echo_handle_request_same_rights"
956            }
957            EchoHandleProtocolRequest::EchoHandleResponseReducedRights { .. } => {
958                "echo_handle_response_reduced_rights"
959            }
960            EchoHandleProtocolRequest::EchoHandleResponseSameRights { .. } => {
961                "echo_handle_response_same_rights"
962            }
963        }
964    }
965}
966
967#[derive(Debug, Clone)]
968pub struct EchoHandleProtocolControlHandle {
969    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
970}
971
972impl fidl::endpoints::ControlHandle for EchoHandleProtocolControlHandle {
973    fn shutdown(&self) {
974        self.inner.shutdown()
975    }
976    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
977        self.inner.shutdown_with_epitaph(status)
978    }
979
980    fn is_closed(&self) -> bool {
981        self.inner.channel().is_closed()
982    }
983    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
984        self.inner.channel().on_closed()
985    }
986
987    #[cfg(target_os = "fuchsia")]
988    fn signal_peer(
989        &self,
990        clear_mask: zx::Signals,
991        set_mask: zx::Signals,
992    ) -> Result<(), zx_status::Status> {
993        use fidl::Peered;
994        self.inner.channel().signal_peer(clear_mask, set_mask)
995    }
996}
997
998impl EchoHandleProtocolControlHandle {}
999
1000#[must_use = "FIDL methods require a response to be sent"]
1001#[derive(Debug)]
1002pub struct EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponder {
1003    control_handle: std::mem::ManuallyDrop<EchoHandleProtocolControlHandle>,
1004    tx_id: u32,
1005}
1006
1007/// Set the the channel to be shutdown (see [`EchoHandleProtocolControlHandle::shutdown`])
1008/// if the responder is dropped without sending a response, so that the client
1009/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1010impl std::ops::Drop for EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponder {
1011    fn drop(&mut self) {
1012        self.control_handle.shutdown();
1013        // Safety: drops once, never accessed again
1014        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1015    }
1016}
1017
1018impl fidl::endpoints::Responder
1019    for EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponder
1020{
1021    type ControlHandle = EchoHandleProtocolControlHandle;
1022
1023    fn control_handle(&self) -> &EchoHandleProtocolControlHandle {
1024        &self.control_handle
1025    }
1026
1027    fn drop_without_shutdown(mut self) {
1028        // Safety: drops once, never accessed again due to mem::forget
1029        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1030        // Prevent Drop from running (which would shut down the channel)
1031        std::mem::forget(self);
1032    }
1033}
1034
1035impl EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponder {
1036    /// Sends a response to the FIDL transaction.
1037    ///
1038    /// Sets the channel to shutdown if an error occurs.
1039    pub fn send(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1040        let _result = self.send_raw(h);
1041        if _result.is_err() {
1042            self.control_handle.shutdown();
1043        }
1044        self.drop_without_shutdown();
1045        _result
1046    }
1047
1048    /// Similar to "send" but does not shutdown the channel if an error occurs.
1049    pub fn send_no_shutdown_on_err(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1050        let _result = self.send_raw(h);
1051        self.drop_without_shutdown();
1052        _result
1053    }
1054
1055    fn send_raw(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1056        self.control_handle
1057            .inner
1058            .send::<EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse>(
1059                (h,),
1060                self.tx_id,
1061                0x5c6c0f3032f3bcc6,
1062                fidl::encoding::DynamicFlags::empty(),
1063            )
1064    }
1065}
1066
1067#[must_use = "FIDL methods require a response to be sent"]
1068#[derive(Debug)]
1069pub struct EchoHandleProtocolEchoHandleRequestReducedRightsResponder {
1070    control_handle: std::mem::ManuallyDrop<EchoHandleProtocolControlHandle>,
1071    tx_id: u32,
1072}
1073
1074/// Set the the channel to be shutdown (see [`EchoHandleProtocolControlHandle::shutdown`])
1075/// if the responder is dropped without sending a response, so that the client
1076/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1077impl std::ops::Drop for EchoHandleProtocolEchoHandleRequestReducedRightsResponder {
1078    fn drop(&mut self) {
1079        self.control_handle.shutdown();
1080        // Safety: drops once, never accessed again
1081        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1082    }
1083}
1084
1085impl fidl::endpoints::Responder for EchoHandleProtocolEchoHandleRequestReducedRightsResponder {
1086    type ControlHandle = EchoHandleProtocolControlHandle;
1087
1088    fn control_handle(&self) -> &EchoHandleProtocolControlHandle {
1089        &self.control_handle
1090    }
1091
1092    fn drop_without_shutdown(mut self) {
1093        // Safety: drops once, never accessed again due to mem::forget
1094        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1095        // Prevent Drop from running (which would shut down the channel)
1096        std::mem::forget(self);
1097    }
1098}
1099
1100impl EchoHandleProtocolEchoHandleRequestReducedRightsResponder {
1101    /// Sends a response to the FIDL transaction.
1102    ///
1103    /// Sets the channel to shutdown if an error occurs.
1104    pub fn send(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1105        let _result = self.send_raw(h);
1106        if _result.is_err() {
1107            self.control_handle.shutdown();
1108        }
1109        self.drop_without_shutdown();
1110        _result
1111    }
1112
1113    /// Similar to "send" but does not shutdown the channel if an error occurs.
1114    pub fn send_no_shutdown_on_err(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1115        let _result = self.send_raw(h);
1116        self.drop_without_shutdown();
1117        _result
1118    }
1119
1120    fn send_raw(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1121        self.control_handle.inner.send::<EchoHandleProtocolEchoHandleRequestReducedRightsResponse>(
1122            (h,),
1123            self.tx_id,
1124            0x6f73455d31eb2f42,
1125            fidl::encoding::DynamicFlags::empty(),
1126        )
1127    }
1128}
1129
1130#[must_use = "FIDL methods require a response to be sent"]
1131#[derive(Debug)]
1132pub struct EchoHandleProtocolEchoHandleRequestSameRightsResponder {
1133    control_handle: std::mem::ManuallyDrop<EchoHandleProtocolControlHandle>,
1134    tx_id: u32,
1135}
1136
1137/// Set the the channel to be shutdown (see [`EchoHandleProtocolControlHandle::shutdown`])
1138/// if the responder is dropped without sending a response, so that the client
1139/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1140impl std::ops::Drop for EchoHandleProtocolEchoHandleRequestSameRightsResponder {
1141    fn drop(&mut self) {
1142        self.control_handle.shutdown();
1143        // Safety: drops once, never accessed again
1144        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1145    }
1146}
1147
1148impl fidl::endpoints::Responder for EchoHandleProtocolEchoHandleRequestSameRightsResponder {
1149    type ControlHandle = EchoHandleProtocolControlHandle;
1150
1151    fn control_handle(&self) -> &EchoHandleProtocolControlHandle {
1152        &self.control_handle
1153    }
1154
1155    fn drop_without_shutdown(mut self) {
1156        // Safety: drops once, never accessed again due to mem::forget
1157        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1158        // Prevent Drop from running (which would shut down the channel)
1159        std::mem::forget(self);
1160    }
1161}
1162
1163impl EchoHandleProtocolEchoHandleRequestSameRightsResponder {
1164    /// Sends a response to the FIDL transaction.
1165    ///
1166    /// Sets the channel to shutdown if an error occurs.
1167    pub fn send(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1168        let _result = self.send_raw(h);
1169        if _result.is_err() {
1170            self.control_handle.shutdown();
1171        }
1172        self.drop_without_shutdown();
1173        _result
1174    }
1175
1176    /// Similar to "send" but does not shutdown the channel if an error occurs.
1177    pub fn send_no_shutdown_on_err(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1178        let _result = self.send_raw(h);
1179        self.drop_without_shutdown();
1180        _result
1181    }
1182
1183    fn send_raw(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1184        self.control_handle.inner.send::<EchoHandleProtocolEchoHandleRequestSameRightsResponse>(
1185            (h,),
1186            self.tx_id,
1187            0x7bd6b869de1eb0b7,
1188            fidl::encoding::DynamicFlags::empty(),
1189        )
1190    }
1191}
1192
1193#[must_use = "FIDL methods require a response to be sent"]
1194#[derive(Debug)]
1195pub struct EchoHandleProtocolEchoHandleResponseReducedRightsResponder {
1196    control_handle: std::mem::ManuallyDrop<EchoHandleProtocolControlHandle>,
1197    tx_id: u32,
1198}
1199
1200/// Set the the channel to be shutdown (see [`EchoHandleProtocolControlHandle::shutdown`])
1201/// if the responder is dropped without sending a response, so that the client
1202/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1203impl std::ops::Drop for EchoHandleProtocolEchoHandleResponseReducedRightsResponder {
1204    fn drop(&mut self) {
1205        self.control_handle.shutdown();
1206        // Safety: drops once, never accessed again
1207        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1208    }
1209}
1210
1211impl fidl::endpoints::Responder for EchoHandleProtocolEchoHandleResponseReducedRightsResponder {
1212    type ControlHandle = EchoHandleProtocolControlHandle;
1213
1214    fn control_handle(&self) -> &EchoHandleProtocolControlHandle {
1215        &self.control_handle
1216    }
1217
1218    fn drop_without_shutdown(mut self) {
1219        // Safety: drops once, never accessed again due to mem::forget
1220        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1221        // Prevent Drop from running (which would shut down the channel)
1222        std::mem::forget(self);
1223    }
1224}
1225
1226impl EchoHandleProtocolEchoHandleResponseReducedRightsResponder {
1227    /// Sends a response to the FIDL transaction.
1228    ///
1229    /// Sets the channel to shutdown if an error occurs.
1230    pub fn send(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1231        let _result = self.send_raw(h);
1232        if _result.is_err() {
1233            self.control_handle.shutdown();
1234        }
1235        self.drop_without_shutdown();
1236        _result
1237    }
1238
1239    /// Similar to "send" but does not shutdown the channel if an error occurs.
1240    pub fn send_no_shutdown_on_err(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1241        let _result = self.send_raw(h);
1242        self.drop_without_shutdown();
1243        _result
1244    }
1245
1246    fn send_raw(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1247        self.control_handle.inner.send::<EchoHandleProtocolEchoHandleResponseReducedRightsResponse>(
1248            (h,),
1249            self.tx_id,
1250            0x458d1c6d39e34f1e,
1251            fidl::encoding::DynamicFlags::empty(),
1252        )
1253    }
1254}
1255
1256#[must_use = "FIDL methods require a response to be sent"]
1257#[derive(Debug)]
1258pub struct EchoHandleProtocolEchoHandleResponseSameRightsResponder {
1259    control_handle: std::mem::ManuallyDrop<EchoHandleProtocolControlHandle>,
1260    tx_id: u32,
1261}
1262
1263/// Set the the channel to be shutdown (see [`EchoHandleProtocolControlHandle::shutdown`])
1264/// if the responder is dropped without sending a response, so that the client
1265/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1266impl std::ops::Drop for EchoHandleProtocolEchoHandleResponseSameRightsResponder {
1267    fn drop(&mut self) {
1268        self.control_handle.shutdown();
1269        // Safety: drops once, never accessed again
1270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1271    }
1272}
1273
1274impl fidl::endpoints::Responder for EchoHandleProtocolEchoHandleResponseSameRightsResponder {
1275    type ControlHandle = EchoHandleProtocolControlHandle;
1276
1277    fn control_handle(&self) -> &EchoHandleProtocolControlHandle {
1278        &self.control_handle
1279    }
1280
1281    fn drop_without_shutdown(mut self) {
1282        // Safety: drops once, never accessed again due to mem::forget
1283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1284        // Prevent Drop from running (which would shut down the channel)
1285        std::mem::forget(self);
1286    }
1287}
1288
1289impl EchoHandleProtocolEchoHandleResponseSameRightsResponder {
1290    /// Sends a response to the FIDL transaction.
1291    ///
1292    /// Sets the channel to shutdown if an error occurs.
1293    pub fn send(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1294        let _result = self.send_raw(h);
1295        if _result.is_err() {
1296            self.control_handle.shutdown();
1297        }
1298        self.drop_without_shutdown();
1299        _result
1300    }
1301
1302    /// Similar to "send" but does not shutdown the channel if an error occurs.
1303    pub fn send_no_shutdown_on_err(self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1304        let _result = self.send_raw(h);
1305        self.drop_without_shutdown();
1306        _result
1307    }
1308
1309    fn send_raw(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
1310        self.control_handle.inner.send::<EchoHandleProtocolEchoHandleResponseSameRightsResponse>(
1311            (h,),
1312            self.tx_id,
1313            0x57334c827816fe5,
1314            fidl::encoding::DynamicFlags::empty(),
1315        )
1316    }
1317}
1318
1319#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1320pub struct ErrorSyntaxProtocolMarker;
1321
1322impl fidl::endpoints::ProtocolMarker for ErrorSyntaxProtocolMarker {
1323    type Proxy = ErrorSyntaxProtocolProxy;
1324    type RequestStream = ErrorSyntaxProtocolRequestStream;
1325    #[cfg(target_os = "fuchsia")]
1326    type SynchronousProxy = ErrorSyntaxProtocolSynchronousProxy;
1327
1328    const DEBUG_NAME: &'static str = "(anonymous) ErrorSyntaxProtocol";
1329}
1330pub type ErrorSyntaxProtocolTestErrorSyntaxResult = Result<fidl::Event, u32>;
1331
1332pub trait ErrorSyntaxProtocolProxyInterface: Send + Sync {
1333    type TestErrorSyntaxResponseFut: std::future::Future<Output = Result<ErrorSyntaxProtocolTestErrorSyntaxResult, fidl::Error>>
1334        + Send;
1335    fn r#test_error_syntax(&self) -> Self::TestErrorSyntaxResponseFut;
1336}
1337#[derive(Debug)]
1338#[cfg(target_os = "fuchsia")]
1339pub struct ErrorSyntaxProtocolSynchronousProxy {
1340    client: fidl::client::sync::Client,
1341}
1342
1343#[cfg(target_os = "fuchsia")]
1344impl fidl::endpoints::SynchronousProxy for ErrorSyntaxProtocolSynchronousProxy {
1345    type Proxy = ErrorSyntaxProtocolProxy;
1346    type Protocol = ErrorSyntaxProtocolMarker;
1347
1348    fn from_channel(inner: fidl::Channel) -> Self {
1349        Self::new(inner)
1350    }
1351
1352    fn into_channel(self) -> fidl::Channel {
1353        self.client.into_channel()
1354    }
1355
1356    fn as_channel(&self) -> &fidl::Channel {
1357        self.client.as_channel()
1358    }
1359}
1360
1361#[cfg(target_os = "fuchsia")]
1362impl ErrorSyntaxProtocolSynchronousProxy {
1363    pub fn new(channel: fidl::Channel) -> Self {
1364        let protocol_name =
1365            <ErrorSyntaxProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1366        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1367    }
1368
1369    pub fn into_channel(self) -> fidl::Channel {
1370        self.client.into_channel()
1371    }
1372
1373    /// Waits until an event arrives and returns it. It is safe for other
1374    /// threads to make concurrent requests while waiting for an event.
1375    pub fn wait_for_event(
1376        &self,
1377        deadline: zx::MonotonicInstant,
1378    ) -> Result<ErrorSyntaxProtocolEvent, fidl::Error> {
1379        ErrorSyntaxProtocolEvent::decode(self.client.wait_for_event(deadline)?)
1380    }
1381
1382    pub fn r#test_error_syntax(
1383        &self,
1384        ___deadline: zx::MonotonicInstant,
1385    ) -> Result<ErrorSyntaxProtocolTestErrorSyntaxResult, fidl::Error> {
1386        let _response =
1387            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1388                ErrorSyntaxProtocolTestErrorSyntaxResponse,
1389                u32,
1390            >>(
1391                (),
1392                0x3fcbffd51b21cd91,
1393                fidl::encoding::DynamicFlags::empty(),
1394                ___deadline,
1395            )?;
1396        Ok(_response.map(|x| x.h))
1397    }
1398}
1399
1400#[derive(Debug, Clone)]
1401pub struct ErrorSyntaxProtocolProxy {
1402    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1403}
1404
1405impl fidl::endpoints::Proxy for ErrorSyntaxProtocolProxy {
1406    type Protocol = ErrorSyntaxProtocolMarker;
1407
1408    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1409        Self::new(inner)
1410    }
1411
1412    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1413        self.client.into_channel().map_err(|client| Self { client })
1414    }
1415
1416    fn as_channel(&self) -> &::fidl::AsyncChannel {
1417        self.client.as_channel()
1418    }
1419}
1420
1421impl ErrorSyntaxProtocolProxy {
1422    /// Create a new Proxy for test.external/ErrorSyntaxProtocol.
1423    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1424        let protocol_name =
1425            <ErrorSyntaxProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1426        Self { client: fidl::client::Client::new(channel, protocol_name) }
1427    }
1428
1429    /// Get a Stream of events from the remote end of the protocol.
1430    ///
1431    /// # Panics
1432    ///
1433    /// Panics if the event stream was already taken.
1434    pub fn take_event_stream(&self) -> ErrorSyntaxProtocolEventStream {
1435        ErrorSyntaxProtocolEventStream { event_receiver: self.client.take_event_receiver() }
1436    }
1437
1438    pub fn r#test_error_syntax(
1439        &self,
1440    ) -> fidl::client::QueryResponseFut<
1441        ErrorSyntaxProtocolTestErrorSyntaxResult,
1442        fidl::encoding::DefaultFuchsiaResourceDialect,
1443    > {
1444        ErrorSyntaxProtocolProxyInterface::r#test_error_syntax(self)
1445    }
1446}
1447
1448impl ErrorSyntaxProtocolProxyInterface for ErrorSyntaxProtocolProxy {
1449    type TestErrorSyntaxResponseFut = fidl::client::QueryResponseFut<
1450        ErrorSyntaxProtocolTestErrorSyntaxResult,
1451        fidl::encoding::DefaultFuchsiaResourceDialect,
1452    >;
1453    fn r#test_error_syntax(&self) -> Self::TestErrorSyntaxResponseFut {
1454        fn _decode(
1455            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1456        ) -> Result<ErrorSyntaxProtocolTestErrorSyntaxResult, fidl::Error> {
1457            let _response = fidl::client::decode_transaction_body::<
1458                fidl::encoding::ResultType<ErrorSyntaxProtocolTestErrorSyntaxResponse, u32>,
1459                fidl::encoding::DefaultFuchsiaResourceDialect,
1460                0x3fcbffd51b21cd91,
1461            >(_buf?)?;
1462            Ok(_response.map(|x| x.h))
1463        }
1464        self.client.send_query_and_decode::<
1465            fidl::encoding::EmptyPayload,
1466            ErrorSyntaxProtocolTestErrorSyntaxResult,
1467        >(
1468            (),
1469            0x3fcbffd51b21cd91,
1470            fidl::encoding::DynamicFlags::empty(),
1471            _decode,
1472        )
1473    }
1474}
1475
1476pub struct ErrorSyntaxProtocolEventStream {
1477    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1478}
1479
1480impl std::marker::Unpin for ErrorSyntaxProtocolEventStream {}
1481
1482impl futures::stream::FusedStream for ErrorSyntaxProtocolEventStream {
1483    fn is_terminated(&self) -> bool {
1484        self.event_receiver.is_terminated()
1485    }
1486}
1487
1488impl futures::Stream for ErrorSyntaxProtocolEventStream {
1489    type Item = Result<ErrorSyntaxProtocolEvent, fidl::Error>;
1490
1491    fn poll_next(
1492        mut self: std::pin::Pin<&mut Self>,
1493        cx: &mut std::task::Context<'_>,
1494    ) -> std::task::Poll<Option<Self::Item>> {
1495        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1496            &mut self.event_receiver,
1497            cx
1498        )?) {
1499            Some(buf) => std::task::Poll::Ready(Some(ErrorSyntaxProtocolEvent::decode(buf))),
1500            None => std::task::Poll::Ready(None),
1501        }
1502    }
1503}
1504
1505#[derive(Debug)]
1506pub enum ErrorSyntaxProtocolEvent {}
1507
1508impl ErrorSyntaxProtocolEvent {
1509    /// Decodes a message buffer as a [`ErrorSyntaxProtocolEvent`].
1510    fn decode(
1511        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1512    ) -> Result<ErrorSyntaxProtocolEvent, fidl::Error> {
1513        let (bytes, _handles) = buf.split_mut();
1514        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1515        debug_assert_eq!(tx_header.tx_id, 0);
1516        match tx_header.ordinal {
1517            _ => Err(fidl::Error::UnknownOrdinal {
1518                ordinal: tx_header.ordinal,
1519                protocol_name:
1520                    <ErrorSyntaxProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1521            }),
1522        }
1523    }
1524}
1525
1526/// A Stream of incoming requests for test.external/ErrorSyntaxProtocol.
1527pub struct ErrorSyntaxProtocolRequestStream {
1528    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1529    is_terminated: bool,
1530}
1531
1532impl std::marker::Unpin for ErrorSyntaxProtocolRequestStream {}
1533
1534impl futures::stream::FusedStream for ErrorSyntaxProtocolRequestStream {
1535    fn is_terminated(&self) -> bool {
1536        self.is_terminated
1537    }
1538}
1539
1540impl fidl::endpoints::RequestStream for ErrorSyntaxProtocolRequestStream {
1541    type Protocol = ErrorSyntaxProtocolMarker;
1542    type ControlHandle = ErrorSyntaxProtocolControlHandle;
1543
1544    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1545        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1546    }
1547
1548    fn control_handle(&self) -> Self::ControlHandle {
1549        ErrorSyntaxProtocolControlHandle { inner: self.inner.clone() }
1550    }
1551
1552    fn into_inner(
1553        self,
1554    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1555    {
1556        (self.inner, self.is_terminated)
1557    }
1558
1559    fn from_inner(
1560        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1561        is_terminated: bool,
1562    ) -> Self {
1563        Self { inner, is_terminated }
1564    }
1565}
1566
1567impl futures::Stream for ErrorSyntaxProtocolRequestStream {
1568    type Item = Result<ErrorSyntaxProtocolRequest, fidl::Error>;
1569
1570    fn poll_next(
1571        mut self: std::pin::Pin<&mut Self>,
1572        cx: &mut std::task::Context<'_>,
1573    ) -> std::task::Poll<Option<Self::Item>> {
1574        let this = &mut *self;
1575        if this.inner.check_shutdown(cx) {
1576            this.is_terminated = true;
1577            return std::task::Poll::Ready(None);
1578        }
1579        if this.is_terminated {
1580            panic!("polled ErrorSyntaxProtocolRequestStream after completion");
1581        }
1582        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1583            |bytes, handles| {
1584                match this.inner.channel().read_etc(cx, bytes, handles) {
1585                    std::task::Poll::Ready(Ok(())) => {}
1586                    std::task::Poll::Pending => return std::task::Poll::Pending,
1587                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1588                        this.is_terminated = true;
1589                        return std::task::Poll::Ready(None);
1590                    }
1591                    std::task::Poll::Ready(Err(e)) => {
1592                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1593                            e.into(),
1594                        ))))
1595                    }
1596                }
1597
1598                // A message has been received from the channel
1599                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1600
1601                std::task::Poll::Ready(Some(match header.ordinal {
1602                0x3fcbffd51b21cd91 => {
1603                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1604                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1605                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1606                    let control_handle = ErrorSyntaxProtocolControlHandle {
1607                        inner: this.inner.clone(),
1608                    };
1609                    Ok(ErrorSyntaxProtocolRequest::TestErrorSyntax {
1610                        responder: ErrorSyntaxProtocolTestErrorSyntaxResponder {
1611                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1612                            tx_id: header.tx_id,
1613                        },
1614                    })
1615                }
1616                _ => Err(fidl::Error::UnknownOrdinal {
1617                    ordinal: header.ordinal,
1618                    protocol_name: <ErrorSyntaxProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1619                }),
1620            }))
1621            },
1622        )
1623    }
1624}
1625
1626#[derive(Debug)]
1627pub enum ErrorSyntaxProtocolRequest {
1628    TestErrorSyntax { responder: ErrorSyntaxProtocolTestErrorSyntaxResponder },
1629}
1630
1631impl ErrorSyntaxProtocolRequest {
1632    #[allow(irrefutable_let_patterns)]
1633    pub fn into_test_error_syntax(self) -> Option<(ErrorSyntaxProtocolTestErrorSyntaxResponder)> {
1634        if let ErrorSyntaxProtocolRequest::TestErrorSyntax { responder } = self {
1635            Some((responder))
1636        } else {
1637            None
1638        }
1639    }
1640
1641    /// Name of the method defined in FIDL
1642    pub fn method_name(&self) -> &'static str {
1643        match *self {
1644            ErrorSyntaxProtocolRequest::TestErrorSyntax { .. } => "test_error_syntax",
1645        }
1646    }
1647}
1648
1649#[derive(Debug, Clone)]
1650pub struct ErrorSyntaxProtocolControlHandle {
1651    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1652}
1653
1654impl fidl::endpoints::ControlHandle for ErrorSyntaxProtocolControlHandle {
1655    fn shutdown(&self) {
1656        self.inner.shutdown()
1657    }
1658    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1659        self.inner.shutdown_with_epitaph(status)
1660    }
1661
1662    fn is_closed(&self) -> bool {
1663        self.inner.channel().is_closed()
1664    }
1665    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1666        self.inner.channel().on_closed()
1667    }
1668
1669    #[cfg(target_os = "fuchsia")]
1670    fn signal_peer(
1671        &self,
1672        clear_mask: zx::Signals,
1673        set_mask: zx::Signals,
1674    ) -> Result<(), zx_status::Status> {
1675        use fidl::Peered;
1676        self.inner.channel().signal_peer(clear_mask, set_mask)
1677    }
1678}
1679
1680impl ErrorSyntaxProtocolControlHandle {}
1681
1682#[must_use = "FIDL methods require a response to be sent"]
1683#[derive(Debug)]
1684pub struct ErrorSyntaxProtocolTestErrorSyntaxResponder {
1685    control_handle: std::mem::ManuallyDrop<ErrorSyntaxProtocolControlHandle>,
1686    tx_id: u32,
1687}
1688
1689/// Set the the channel to be shutdown (see [`ErrorSyntaxProtocolControlHandle::shutdown`])
1690/// if the responder is dropped without sending a response, so that the client
1691/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1692impl std::ops::Drop for ErrorSyntaxProtocolTestErrorSyntaxResponder {
1693    fn drop(&mut self) {
1694        self.control_handle.shutdown();
1695        // Safety: drops once, never accessed again
1696        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1697    }
1698}
1699
1700impl fidl::endpoints::Responder for ErrorSyntaxProtocolTestErrorSyntaxResponder {
1701    type ControlHandle = ErrorSyntaxProtocolControlHandle;
1702
1703    fn control_handle(&self) -> &ErrorSyntaxProtocolControlHandle {
1704        &self.control_handle
1705    }
1706
1707    fn drop_without_shutdown(mut self) {
1708        // Safety: drops once, never accessed again due to mem::forget
1709        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1710        // Prevent Drop from running (which would shut down the channel)
1711        std::mem::forget(self);
1712    }
1713}
1714
1715impl ErrorSyntaxProtocolTestErrorSyntaxResponder {
1716    /// Sends a response to the FIDL transaction.
1717    ///
1718    /// Sets the channel to shutdown if an error occurs.
1719    pub fn send(self, mut result: Result<fidl::Event, u32>) -> Result<(), fidl::Error> {
1720        let _result = self.send_raw(result);
1721        if _result.is_err() {
1722            self.control_handle.shutdown();
1723        }
1724        self.drop_without_shutdown();
1725        _result
1726    }
1727
1728    /// Similar to "send" but does not shutdown the channel if an error occurs.
1729    pub fn send_no_shutdown_on_err(
1730        self,
1731        mut result: Result<fidl::Event, u32>,
1732    ) -> Result<(), fidl::Error> {
1733        let _result = self.send_raw(result);
1734        self.drop_without_shutdown();
1735        _result
1736    }
1737
1738    fn send_raw(&self, mut result: Result<fidl::Event, u32>) -> Result<(), fidl::Error> {
1739        self.control_handle.inner.send::<fidl::encoding::ResultType<
1740            ErrorSyntaxProtocolTestErrorSyntaxResponse,
1741            u32,
1742        >>(
1743            result.map(|h| (h,)),
1744            self.tx_id,
1745            0x3fcbffd51b21cd91,
1746            fidl::encoding::DynamicFlags::empty(),
1747        )
1748    }
1749}
1750
1751#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1752pub struct PushEventProtocolMarker;
1753
1754impl fidl::endpoints::ProtocolMarker for PushEventProtocolMarker {
1755    type Proxy = PushEventProtocolProxy;
1756    type RequestStream = PushEventProtocolRequestStream;
1757    #[cfg(target_os = "fuchsia")]
1758    type SynchronousProxy = PushEventProtocolSynchronousProxy;
1759
1760    const DEBUG_NAME: &'static str = "(anonymous) PushEventProtocol";
1761}
1762
1763pub trait PushEventProtocolProxyInterface: Send + Sync {}
1764#[derive(Debug)]
1765#[cfg(target_os = "fuchsia")]
1766pub struct PushEventProtocolSynchronousProxy {
1767    client: fidl::client::sync::Client,
1768}
1769
1770#[cfg(target_os = "fuchsia")]
1771impl fidl::endpoints::SynchronousProxy for PushEventProtocolSynchronousProxy {
1772    type Proxy = PushEventProtocolProxy;
1773    type Protocol = PushEventProtocolMarker;
1774
1775    fn from_channel(inner: fidl::Channel) -> Self {
1776        Self::new(inner)
1777    }
1778
1779    fn into_channel(self) -> fidl::Channel {
1780        self.client.into_channel()
1781    }
1782
1783    fn as_channel(&self) -> &fidl::Channel {
1784        self.client.as_channel()
1785    }
1786}
1787
1788#[cfg(target_os = "fuchsia")]
1789impl PushEventProtocolSynchronousProxy {
1790    pub fn new(channel: fidl::Channel) -> Self {
1791        let protocol_name =
1792            <PushEventProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1793        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1794    }
1795
1796    pub fn into_channel(self) -> fidl::Channel {
1797        self.client.into_channel()
1798    }
1799
1800    /// Waits until an event arrives and returns it. It is safe for other
1801    /// threads to make concurrent requests while waiting for an event.
1802    pub fn wait_for_event(
1803        &self,
1804        deadline: zx::MonotonicInstant,
1805    ) -> Result<PushEventProtocolEvent, fidl::Error> {
1806        PushEventProtocolEvent::decode(self.client.wait_for_event(deadline)?)
1807    }
1808}
1809
1810#[derive(Debug, Clone)]
1811pub struct PushEventProtocolProxy {
1812    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1813}
1814
1815impl fidl::endpoints::Proxy for PushEventProtocolProxy {
1816    type Protocol = PushEventProtocolMarker;
1817
1818    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1819        Self::new(inner)
1820    }
1821
1822    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1823        self.client.into_channel().map_err(|client| Self { client })
1824    }
1825
1826    fn as_channel(&self) -> &::fidl::AsyncChannel {
1827        self.client.as_channel()
1828    }
1829}
1830
1831impl PushEventProtocolProxy {
1832    /// Create a new Proxy for test.external/PushEventProtocol.
1833    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1834        let protocol_name =
1835            <PushEventProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1836        Self { client: fidl::client::Client::new(channel, protocol_name) }
1837    }
1838
1839    /// Get a Stream of events from the remote end of the protocol.
1840    ///
1841    /// # Panics
1842    ///
1843    /// Panics if the event stream was already taken.
1844    pub fn take_event_stream(&self) -> PushEventProtocolEventStream {
1845        PushEventProtocolEventStream { event_receiver: self.client.take_event_receiver() }
1846    }
1847}
1848
1849impl PushEventProtocolProxyInterface for PushEventProtocolProxy {}
1850
1851pub struct PushEventProtocolEventStream {
1852    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1853}
1854
1855impl std::marker::Unpin for PushEventProtocolEventStream {}
1856
1857impl futures::stream::FusedStream for PushEventProtocolEventStream {
1858    fn is_terminated(&self) -> bool {
1859        self.event_receiver.is_terminated()
1860    }
1861}
1862
1863impl futures::Stream for PushEventProtocolEventStream {
1864    type Item = Result<PushEventProtocolEvent, fidl::Error>;
1865
1866    fn poll_next(
1867        mut self: std::pin::Pin<&mut Self>,
1868        cx: &mut std::task::Context<'_>,
1869    ) -> std::task::Poll<Option<Self::Item>> {
1870        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1871            &mut self.event_receiver,
1872            cx
1873        )?) {
1874            Some(buf) => std::task::Poll::Ready(Some(PushEventProtocolEvent::decode(buf))),
1875            None => std::task::Poll::Ready(None),
1876        }
1877    }
1878}
1879
1880#[derive(Debug)]
1881pub enum PushEventProtocolEvent {
1882    PushEventReducedRights { h: fidl::Event },
1883    PushEventSameRights { h: fidl::Event },
1884}
1885
1886impl PushEventProtocolEvent {
1887    #[allow(irrefutable_let_patterns)]
1888    pub fn into_push_event_reduced_rights(self) -> Option<fidl::Event> {
1889        if let PushEventProtocolEvent::PushEventReducedRights { h } = self {
1890            Some((h))
1891        } else {
1892            None
1893        }
1894    }
1895    #[allow(irrefutable_let_patterns)]
1896    pub fn into_push_event_same_rights(self) -> Option<fidl::Event> {
1897        if let PushEventProtocolEvent::PushEventSameRights { h } = self {
1898            Some((h))
1899        } else {
1900            None
1901        }
1902    }
1903
1904    /// Decodes a message buffer as a [`PushEventProtocolEvent`].
1905    fn decode(
1906        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1907    ) -> Result<PushEventProtocolEvent, fidl::Error> {
1908        let (bytes, _handles) = buf.split_mut();
1909        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1910        debug_assert_eq!(tx_header.tx_id, 0);
1911        match tx_header.ordinal {
1912            0x6f5a2e2e57c07079 => {
1913                let mut out = fidl::new_empty!(
1914                    PushEventProtocolPushEventReducedRightsRequest,
1915                    fidl::encoding::DefaultFuchsiaResourceDialect
1916                );
1917                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PushEventProtocolPushEventReducedRightsRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1918                Ok((PushEventProtocolEvent::PushEventReducedRights { h: out.h }))
1919            }
1920            0x4fca4ce8755a1967 => {
1921                let mut out = fidl::new_empty!(
1922                    PushEventProtocolPushEventSameRightsRequest,
1923                    fidl::encoding::DefaultFuchsiaResourceDialect
1924                );
1925                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PushEventProtocolPushEventSameRightsRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1926                Ok((PushEventProtocolEvent::PushEventSameRights { h: out.h }))
1927            }
1928            _ => Err(fidl::Error::UnknownOrdinal {
1929                ordinal: tx_header.ordinal,
1930                protocol_name:
1931                    <PushEventProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1932            }),
1933        }
1934    }
1935}
1936
1937/// A Stream of incoming requests for test.external/PushEventProtocol.
1938pub struct PushEventProtocolRequestStream {
1939    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1940    is_terminated: bool,
1941}
1942
1943impl std::marker::Unpin for PushEventProtocolRequestStream {}
1944
1945impl futures::stream::FusedStream for PushEventProtocolRequestStream {
1946    fn is_terminated(&self) -> bool {
1947        self.is_terminated
1948    }
1949}
1950
1951impl fidl::endpoints::RequestStream for PushEventProtocolRequestStream {
1952    type Protocol = PushEventProtocolMarker;
1953    type ControlHandle = PushEventProtocolControlHandle;
1954
1955    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1956        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1957    }
1958
1959    fn control_handle(&self) -> Self::ControlHandle {
1960        PushEventProtocolControlHandle { inner: self.inner.clone() }
1961    }
1962
1963    fn into_inner(
1964        self,
1965    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1966    {
1967        (self.inner, self.is_terminated)
1968    }
1969
1970    fn from_inner(
1971        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1972        is_terminated: bool,
1973    ) -> Self {
1974        Self { inner, is_terminated }
1975    }
1976}
1977
1978impl futures::Stream for PushEventProtocolRequestStream {
1979    type Item = Result<PushEventProtocolRequest, fidl::Error>;
1980
1981    fn poll_next(
1982        mut self: std::pin::Pin<&mut Self>,
1983        cx: &mut std::task::Context<'_>,
1984    ) -> std::task::Poll<Option<Self::Item>> {
1985        let this = &mut *self;
1986        if this.inner.check_shutdown(cx) {
1987            this.is_terminated = true;
1988            return std::task::Poll::Ready(None);
1989        }
1990        if this.is_terminated {
1991            panic!("polled PushEventProtocolRequestStream after completion");
1992        }
1993        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1994            |bytes, handles| {
1995                match this.inner.channel().read_etc(cx, bytes, handles) {
1996                    std::task::Poll::Ready(Ok(())) => {}
1997                    std::task::Poll::Pending => return std::task::Poll::Pending,
1998                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1999                        this.is_terminated = true;
2000                        return std::task::Poll::Ready(None);
2001                    }
2002                    std::task::Poll::Ready(Err(e)) => {
2003                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2004                            e.into(),
2005                        ))))
2006                    }
2007                }
2008
2009                // A message has been received from the channel
2010                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2011
2012                std::task::Poll::Ready(Some(match header.ordinal {
2013                    _ => Err(fidl::Error::UnknownOrdinal {
2014                        ordinal: header.ordinal,
2015                        protocol_name:
2016                            <PushEventProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2017                    }),
2018                }))
2019            },
2020        )
2021    }
2022}
2023
2024#[derive(Debug)]
2025pub enum PushEventProtocolRequest {}
2026
2027impl PushEventProtocolRequest {
2028    /// Name of the method defined in FIDL
2029    pub fn method_name(&self) -> &'static str {
2030        match *self {}
2031    }
2032}
2033
2034#[derive(Debug, Clone)]
2035pub struct PushEventProtocolControlHandle {
2036    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2037}
2038
2039impl fidl::endpoints::ControlHandle for PushEventProtocolControlHandle {
2040    fn shutdown(&self) {
2041        self.inner.shutdown()
2042    }
2043    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2044        self.inner.shutdown_with_epitaph(status)
2045    }
2046
2047    fn is_closed(&self) -> bool {
2048        self.inner.channel().is_closed()
2049    }
2050    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2051        self.inner.channel().on_closed()
2052    }
2053
2054    #[cfg(target_os = "fuchsia")]
2055    fn signal_peer(
2056        &self,
2057        clear_mask: zx::Signals,
2058        set_mask: zx::Signals,
2059    ) -> Result<(), zx_status::Status> {
2060        use fidl::Peered;
2061        self.inner.channel().signal_peer(clear_mask, set_mask)
2062    }
2063}
2064
2065impl PushEventProtocolControlHandle {
2066    pub fn send_push_event_reduced_rights(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
2067        self.inner.send::<PushEventProtocolPushEventReducedRightsRequest>(
2068            (h,),
2069            0,
2070            0x6f5a2e2e57c07079,
2071            fidl::encoding::DynamicFlags::empty(),
2072        )
2073    }
2074
2075    pub fn send_push_event_same_rights(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
2076        self.inner.send::<PushEventProtocolPushEventSameRightsRequest>(
2077            (h,),
2078            0,
2079            0x4fca4ce8755a1967,
2080            fidl::encoding::DynamicFlags::empty(),
2081        )
2082    }
2083}
2084
2085#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2086pub struct SendHandleProtocolMarker;
2087
2088impl fidl::endpoints::ProtocolMarker for SendHandleProtocolMarker {
2089    type Proxy = SendHandleProtocolProxy;
2090    type RequestStream = SendHandleProtocolRequestStream;
2091    #[cfg(target_os = "fuchsia")]
2092    type SynchronousProxy = SendHandleProtocolSynchronousProxy;
2093
2094    const DEBUG_NAME: &'static str = "(anonymous) SendHandleProtocol";
2095}
2096
2097pub trait SendHandleProtocolProxyInterface: Send + Sync {
2098    fn r#send_handle_reduced_rights(&self, h: fidl::Event) -> Result<(), fidl::Error>;
2099    fn r#send_handle_same_rights(&self, h: fidl::Event) -> Result<(), fidl::Error>;
2100}
2101#[derive(Debug)]
2102#[cfg(target_os = "fuchsia")]
2103pub struct SendHandleProtocolSynchronousProxy {
2104    client: fidl::client::sync::Client,
2105}
2106
2107#[cfg(target_os = "fuchsia")]
2108impl fidl::endpoints::SynchronousProxy for SendHandleProtocolSynchronousProxy {
2109    type Proxy = SendHandleProtocolProxy;
2110    type Protocol = SendHandleProtocolMarker;
2111
2112    fn from_channel(inner: fidl::Channel) -> Self {
2113        Self::new(inner)
2114    }
2115
2116    fn into_channel(self) -> fidl::Channel {
2117        self.client.into_channel()
2118    }
2119
2120    fn as_channel(&self) -> &fidl::Channel {
2121        self.client.as_channel()
2122    }
2123}
2124
2125#[cfg(target_os = "fuchsia")]
2126impl SendHandleProtocolSynchronousProxy {
2127    pub fn new(channel: fidl::Channel) -> Self {
2128        let protocol_name =
2129            <SendHandleProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2130        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2131    }
2132
2133    pub fn into_channel(self) -> fidl::Channel {
2134        self.client.into_channel()
2135    }
2136
2137    /// Waits until an event arrives and returns it. It is safe for other
2138    /// threads to make concurrent requests while waiting for an event.
2139    pub fn wait_for_event(
2140        &self,
2141        deadline: zx::MonotonicInstant,
2142    ) -> Result<SendHandleProtocolEvent, fidl::Error> {
2143        SendHandleProtocolEvent::decode(self.client.wait_for_event(deadline)?)
2144    }
2145
2146    pub fn r#send_handle_reduced_rights(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
2147        self.client.send::<SendHandleProtocolSendHandleReducedRightsRequest>(
2148            (h,),
2149            0x7675407e0eb5f825,
2150            fidl::encoding::DynamicFlags::empty(),
2151        )
2152    }
2153
2154    pub fn r#send_handle_same_rights(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
2155        self.client.send::<SendHandleProtocolSendHandleSameRightsRequest>(
2156            (h,),
2157            0x1d43414e5560333a,
2158            fidl::encoding::DynamicFlags::empty(),
2159        )
2160    }
2161}
2162
2163#[derive(Debug, Clone)]
2164pub struct SendHandleProtocolProxy {
2165    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2166}
2167
2168impl fidl::endpoints::Proxy for SendHandleProtocolProxy {
2169    type Protocol = SendHandleProtocolMarker;
2170
2171    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2172        Self::new(inner)
2173    }
2174
2175    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2176        self.client.into_channel().map_err(|client| Self { client })
2177    }
2178
2179    fn as_channel(&self) -> &::fidl::AsyncChannel {
2180        self.client.as_channel()
2181    }
2182}
2183
2184impl SendHandleProtocolProxy {
2185    /// Create a new Proxy for test.external/SendHandleProtocol.
2186    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2187        let protocol_name =
2188            <SendHandleProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2189        Self { client: fidl::client::Client::new(channel, protocol_name) }
2190    }
2191
2192    /// Get a Stream of events from the remote end of the protocol.
2193    ///
2194    /// # Panics
2195    ///
2196    /// Panics if the event stream was already taken.
2197    pub fn take_event_stream(&self) -> SendHandleProtocolEventStream {
2198        SendHandleProtocolEventStream { event_receiver: self.client.take_event_receiver() }
2199    }
2200
2201    pub fn r#send_handle_reduced_rights(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
2202        SendHandleProtocolProxyInterface::r#send_handle_reduced_rights(self, h)
2203    }
2204
2205    pub fn r#send_handle_same_rights(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
2206        SendHandleProtocolProxyInterface::r#send_handle_same_rights(self, h)
2207    }
2208}
2209
2210impl SendHandleProtocolProxyInterface for SendHandleProtocolProxy {
2211    fn r#send_handle_reduced_rights(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
2212        self.client.send::<SendHandleProtocolSendHandleReducedRightsRequest>(
2213            (h,),
2214            0x7675407e0eb5f825,
2215            fidl::encoding::DynamicFlags::empty(),
2216        )
2217    }
2218
2219    fn r#send_handle_same_rights(&self, mut h: fidl::Event) -> Result<(), fidl::Error> {
2220        self.client.send::<SendHandleProtocolSendHandleSameRightsRequest>(
2221            (h,),
2222            0x1d43414e5560333a,
2223            fidl::encoding::DynamicFlags::empty(),
2224        )
2225    }
2226}
2227
2228pub struct SendHandleProtocolEventStream {
2229    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2230}
2231
2232impl std::marker::Unpin for SendHandleProtocolEventStream {}
2233
2234impl futures::stream::FusedStream for SendHandleProtocolEventStream {
2235    fn is_terminated(&self) -> bool {
2236        self.event_receiver.is_terminated()
2237    }
2238}
2239
2240impl futures::Stream for SendHandleProtocolEventStream {
2241    type Item = Result<SendHandleProtocolEvent, fidl::Error>;
2242
2243    fn poll_next(
2244        mut self: std::pin::Pin<&mut Self>,
2245        cx: &mut std::task::Context<'_>,
2246    ) -> std::task::Poll<Option<Self::Item>> {
2247        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2248            &mut self.event_receiver,
2249            cx
2250        )?) {
2251            Some(buf) => std::task::Poll::Ready(Some(SendHandleProtocolEvent::decode(buf))),
2252            None => std::task::Poll::Ready(None),
2253        }
2254    }
2255}
2256
2257#[derive(Debug)]
2258pub enum SendHandleProtocolEvent {}
2259
2260impl SendHandleProtocolEvent {
2261    /// Decodes a message buffer as a [`SendHandleProtocolEvent`].
2262    fn decode(
2263        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2264    ) -> Result<SendHandleProtocolEvent, fidl::Error> {
2265        let (bytes, _handles) = buf.split_mut();
2266        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2267        debug_assert_eq!(tx_header.tx_id, 0);
2268        match tx_header.ordinal {
2269            _ => Err(fidl::Error::UnknownOrdinal {
2270                ordinal: tx_header.ordinal,
2271                protocol_name:
2272                    <SendHandleProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2273            }),
2274        }
2275    }
2276}
2277
2278/// A Stream of incoming requests for test.external/SendHandleProtocol.
2279pub struct SendHandleProtocolRequestStream {
2280    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2281    is_terminated: bool,
2282}
2283
2284impl std::marker::Unpin for SendHandleProtocolRequestStream {}
2285
2286impl futures::stream::FusedStream for SendHandleProtocolRequestStream {
2287    fn is_terminated(&self) -> bool {
2288        self.is_terminated
2289    }
2290}
2291
2292impl fidl::endpoints::RequestStream for SendHandleProtocolRequestStream {
2293    type Protocol = SendHandleProtocolMarker;
2294    type ControlHandle = SendHandleProtocolControlHandle;
2295
2296    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2297        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2298    }
2299
2300    fn control_handle(&self) -> Self::ControlHandle {
2301        SendHandleProtocolControlHandle { inner: self.inner.clone() }
2302    }
2303
2304    fn into_inner(
2305        self,
2306    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2307    {
2308        (self.inner, self.is_terminated)
2309    }
2310
2311    fn from_inner(
2312        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2313        is_terminated: bool,
2314    ) -> Self {
2315        Self { inner, is_terminated }
2316    }
2317}
2318
2319impl futures::Stream for SendHandleProtocolRequestStream {
2320    type Item = Result<SendHandleProtocolRequest, fidl::Error>;
2321
2322    fn poll_next(
2323        mut self: std::pin::Pin<&mut Self>,
2324        cx: &mut std::task::Context<'_>,
2325    ) -> std::task::Poll<Option<Self::Item>> {
2326        let this = &mut *self;
2327        if this.inner.check_shutdown(cx) {
2328            this.is_terminated = true;
2329            return std::task::Poll::Ready(None);
2330        }
2331        if this.is_terminated {
2332            panic!("polled SendHandleProtocolRequestStream after completion");
2333        }
2334        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2335            |bytes, handles| {
2336                match this.inner.channel().read_etc(cx, bytes, handles) {
2337                    std::task::Poll::Ready(Ok(())) => {}
2338                    std::task::Poll::Pending => return std::task::Poll::Pending,
2339                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2340                        this.is_terminated = true;
2341                        return std::task::Poll::Ready(None);
2342                    }
2343                    std::task::Poll::Ready(Err(e)) => {
2344                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2345                            e.into(),
2346                        ))))
2347                    }
2348                }
2349
2350                // A message has been received from the channel
2351                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2352
2353                std::task::Poll::Ready(Some(match header.ordinal {
2354                0x7675407e0eb5f825 => {
2355                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2356                    let mut req = fidl::new_empty!(SendHandleProtocolSendHandleReducedRightsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2357                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SendHandleProtocolSendHandleReducedRightsRequest>(&header, _body_bytes, handles, &mut req)?;
2358                    let control_handle = SendHandleProtocolControlHandle {
2359                        inner: this.inner.clone(),
2360                    };
2361                    Ok(SendHandleProtocolRequest::SendHandleReducedRights {h: req.h,
2362
2363                        control_handle,
2364                    })
2365                }
2366                0x1d43414e5560333a => {
2367                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2368                    let mut req = fidl::new_empty!(SendHandleProtocolSendHandleSameRightsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2369                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SendHandleProtocolSendHandleSameRightsRequest>(&header, _body_bytes, handles, &mut req)?;
2370                    let control_handle = SendHandleProtocolControlHandle {
2371                        inner: this.inner.clone(),
2372                    };
2373                    Ok(SendHandleProtocolRequest::SendHandleSameRights {h: req.h,
2374
2375                        control_handle,
2376                    })
2377                }
2378                _ => Err(fidl::Error::UnknownOrdinal {
2379                    ordinal: header.ordinal,
2380                    protocol_name: <SendHandleProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2381                }),
2382            }))
2383            },
2384        )
2385    }
2386}
2387
2388#[derive(Debug)]
2389pub enum SendHandleProtocolRequest {
2390    SendHandleReducedRights { h: fidl::Event, control_handle: SendHandleProtocolControlHandle },
2391    SendHandleSameRights { h: fidl::Event, control_handle: SendHandleProtocolControlHandle },
2392}
2393
2394impl SendHandleProtocolRequest {
2395    #[allow(irrefutable_let_patterns)]
2396    pub fn into_send_handle_reduced_rights(
2397        self,
2398    ) -> Option<(fidl::Event, SendHandleProtocolControlHandle)> {
2399        if let SendHandleProtocolRequest::SendHandleReducedRights { h, control_handle } = self {
2400            Some((h, control_handle))
2401        } else {
2402            None
2403        }
2404    }
2405
2406    #[allow(irrefutable_let_patterns)]
2407    pub fn into_send_handle_same_rights(
2408        self,
2409    ) -> Option<(fidl::Event, SendHandleProtocolControlHandle)> {
2410        if let SendHandleProtocolRequest::SendHandleSameRights { h, control_handle } = self {
2411            Some((h, control_handle))
2412        } else {
2413            None
2414        }
2415    }
2416
2417    /// Name of the method defined in FIDL
2418    pub fn method_name(&self) -> &'static str {
2419        match *self {
2420            SendHandleProtocolRequest::SendHandleReducedRights { .. } => {
2421                "send_handle_reduced_rights"
2422            }
2423            SendHandleProtocolRequest::SendHandleSameRights { .. } => "send_handle_same_rights",
2424        }
2425    }
2426}
2427
2428#[derive(Debug, Clone)]
2429pub struct SendHandleProtocolControlHandle {
2430    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2431}
2432
2433impl fidl::endpoints::ControlHandle for SendHandleProtocolControlHandle {
2434    fn shutdown(&self) {
2435        self.inner.shutdown()
2436    }
2437    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2438        self.inner.shutdown_with_epitaph(status)
2439    }
2440
2441    fn is_closed(&self) -> bool {
2442        self.inner.channel().is_closed()
2443    }
2444    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2445        self.inner.channel().on_closed()
2446    }
2447
2448    #[cfg(target_os = "fuchsia")]
2449    fn signal_peer(
2450        &self,
2451        clear_mask: zx::Signals,
2452        set_mask: zx::Signals,
2453    ) -> Result<(), zx_status::Status> {
2454        use fidl::Peered;
2455        self.inner.channel().signal_peer(clear_mask, set_mask)
2456    }
2457}
2458
2459impl SendHandleProtocolControlHandle {}
2460
2461mod internal {
2462    use super::*;
2463
2464    impl fidl::encoding::ResourceTypeMarker
2465        for EchoHandleProtocolEchoHandleRequestReducedRightsRequest
2466    {
2467        type Borrowed<'a> = &'a mut Self;
2468        fn take_or_borrow<'a>(
2469            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2470        ) -> Self::Borrowed<'a> {
2471            value
2472        }
2473    }
2474
2475    unsafe impl fidl::encoding::TypeMarker for EchoHandleProtocolEchoHandleRequestReducedRightsRequest {
2476        type Owned = Self;
2477
2478        #[inline(always)]
2479        fn inline_align(_context: fidl::encoding::Context) -> usize {
2480            4
2481        }
2482
2483        #[inline(always)]
2484        fn inline_size(_context: fidl::encoding::Context) -> usize {
2485            4
2486        }
2487    }
2488
2489    unsafe impl
2490        fidl::encoding::Encode<
2491            EchoHandleProtocolEchoHandleRequestReducedRightsRequest,
2492            fidl::encoding::DefaultFuchsiaResourceDialect,
2493        > for &mut EchoHandleProtocolEchoHandleRequestReducedRightsRequest
2494    {
2495        #[inline]
2496        unsafe fn encode(
2497            self,
2498            encoder: &mut fidl::encoding::Encoder<
2499                '_,
2500                fidl::encoding::DefaultFuchsiaResourceDialect,
2501            >,
2502            offset: usize,
2503            _depth: fidl::encoding::Depth,
2504        ) -> fidl::Result<()> {
2505            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestReducedRightsRequest>(
2506                offset,
2507            );
2508            // Delegate to tuple encoding.
2509            fidl::encoding::Encode::<
2510                EchoHandleProtocolEchoHandleRequestReducedRightsRequest,
2511                fidl::encoding::DefaultFuchsiaResourceDialect,
2512            >::encode(
2513                (<fidl::encoding::HandleType<
2514                    fidl::Event,
2515                    { fidl::ObjectType::EVENT.into_raw() },
2516                    2,
2517                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2518                    &mut self.h
2519                ),),
2520                encoder,
2521                offset,
2522                _depth,
2523            )
2524        }
2525    }
2526    unsafe impl<
2527            T0: fidl::encoding::Encode<
2528                fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>,
2529                fidl::encoding::DefaultFuchsiaResourceDialect,
2530            >,
2531        >
2532        fidl::encoding::Encode<
2533            EchoHandleProtocolEchoHandleRequestReducedRightsRequest,
2534            fidl::encoding::DefaultFuchsiaResourceDialect,
2535        > for (T0,)
2536    {
2537        #[inline]
2538        unsafe fn encode(
2539            self,
2540            encoder: &mut fidl::encoding::Encoder<
2541                '_,
2542                fidl::encoding::DefaultFuchsiaResourceDialect,
2543            >,
2544            offset: usize,
2545            depth: fidl::encoding::Depth,
2546        ) -> fidl::Result<()> {
2547            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestReducedRightsRequest>(
2548                offset,
2549            );
2550            // Zero out padding regions. There's no need to apply masks
2551            // because the unmasked parts will be overwritten by fields.
2552            // Write the fields.
2553            self.0.encode(encoder, offset + 0, depth)?;
2554            Ok(())
2555        }
2556    }
2557
2558    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2559        for EchoHandleProtocolEchoHandleRequestReducedRightsRequest
2560    {
2561        #[inline(always)]
2562        fn new_empty() -> Self {
2563            Self {
2564                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
2565            }
2566        }
2567
2568        #[inline]
2569        unsafe fn decode(
2570            &mut self,
2571            decoder: &mut fidl::encoding::Decoder<
2572                '_,
2573                fidl::encoding::DefaultFuchsiaResourceDialect,
2574            >,
2575            offset: usize,
2576            _depth: fidl::encoding::Depth,
2577        ) -> fidl::Result<()> {
2578            decoder.debug_check_bounds::<Self>(offset);
2579            // Verify that padding bytes are zero.
2580            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
2581            Ok(())
2582        }
2583    }
2584
2585    impl fidl::encoding::ResourceTypeMarker
2586        for EchoHandleProtocolEchoHandleRequestReducedRightsResponse
2587    {
2588        type Borrowed<'a> = &'a mut Self;
2589        fn take_or_borrow<'a>(
2590            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2591        ) -> Self::Borrowed<'a> {
2592            value
2593        }
2594    }
2595
2596    unsafe impl fidl::encoding::TypeMarker
2597        for EchoHandleProtocolEchoHandleRequestReducedRightsResponse
2598    {
2599        type Owned = Self;
2600
2601        #[inline(always)]
2602        fn inline_align(_context: fidl::encoding::Context) -> usize {
2603            4
2604        }
2605
2606        #[inline(always)]
2607        fn inline_size(_context: fidl::encoding::Context) -> usize {
2608            4
2609        }
2610    }
2611
2612    unsafe impl
2613        fidl::encoding::Encode<
2614            EchoHandleProtocolEchoHandleRequestReducedRightsResponse,
2615            fidl::encoding::DefaultFuchsiaResourceDialect,
2616        > for &mut EchoHandleProtocolEchoHandleRequestReducedRightsResponse
2617    {
2618        #[inline]
2619        unsafe fn encode(
2620            self,
2621            encoder: &mut fidl::encoding::Encoder<
2622                '_,
2623                fidl::encoding::DefaultFuchsiaResourceDialect,
2624            >,
2625            offset: usize,
2626            _depth: fidl::encoding::Depth,
2627        ) -> fidl::Result<()> {
2628            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestReducedRightsResponse>(
2629                offset,
2630            );
2631            // Delegate to tuple encoding.
2632            fidl::encoding::Encode::<
2633                EchoHandleProtocolEchoHandleRequestReducedRightsResponse,
2634                fidl::encoding::DefaultFuchsiaResourceDialect,
2635            >::encode(
2636                (<fidl::encoding::HandleType<
2637                    fidl::Event,
2638                    { fidl::ObjectType::EVENT.into_raw() },
2639                    2147483648,
2640                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2641                    &mut self.h
2642                ),),
2643                encoder,
2644                offset,
2645                _depth,
2646            )
2647        }
2648    }
2649    unsafe impl<
2650            T0: fidl::encoding::Encode<
2651                fidl::encoding::HandleType<
2652                    fidl::Event,
2653                    { fidl::ObjectType::EVENT.into_raw() },
2654                    2147483648,
2655                >,
2656                fidl::encoding::DefaultFuchsiaResourceDialect,
2657            >,
2658        >
2659        fidl::encoding::Encode<
2660            EchoHandleProtocolEchoHandleRequestReducedRightsResponse,
2661            fidl::encoding::DefaultFuchsiaResourceDialect,
2662        > for (T0,)
2663    {
2664        #[inline]
2665        unsafe fn encode(
2666            self,
2667            encoder: &mut fidl::encoding::Encoder<
2668                '_,
2669                fidl::encoding::DefaultFuchsiaResourceDialect,
2670            >,
2671            offset: usize,
2672            depth: fidl::encoding::Depth,
2673        ) -> fidl::Result<()> {
2674            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestReducedRightsResponse>(
2675                offset,
2676            );
2677            // Zero out padding regions. There's no need to apply masks
2678            // because the unmasked parts will be overwritten by fields.
2679            // Write the fields.
2680            self.0.encode(encoder, offset + 0, depth)?;
2681            Ok(())
2682        }
2683    }
2684
2685    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2686        for EchoHandleProtocolEchoHandleRequestReducedRightsResponse
2687    {
2688        #[inline(always)]
2689        fn new_empty() -> Self {
2690            Self {
2691                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2692            }
2693        }
2694
2695        #[inline]
2696        unsafe fn decode(
2697            &mut self,
2698            decoder: &mut fidl::encoding::Decoder<
2699                '_,
2700                fidl::encoding::DefaultFuchsiaResourceDialect,
2701            >,
2702            offset: usize,
2703            _depth: fidl::encoding::Depth,
2704        ) -> fidl::Result<()> {
2705            decoder.debug_check_bounds::<Self>(offset);
2706            // Verify that padding bytes are zero.
2707            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
2708            Ok(())
2709        }
2710    }
2711
2712    impl fidl::encoding::ResourceTypeMarker
2713        for EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest
2714    {
2715        type Borrowed<'a> = &'a mut Self;
2716        fn take_or_borrow<'a>(
2717            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2718        ) -> Self::Borrowed<'a> {
2719            value
2720        }
2721    }
2722
2723    unsafe impl fidl::encoding::TypeMarker
2724        for EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest
2725    {
2726        type Owned = Self;
2727
2728        #[inline(always)]
2729        fn inline_align(_context: fidl::encoding::Context) -> usize {
2730            4
2731        }
2732
2733        #[inline(always)]
2734        fn inline_size(_context: fidl::encoding::Context) -> usize {
2735            4
2736        }
2737    }
2738
2739    unsafe impl
2740        fidl::encoding::Encode<
2741            EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest,
2742            fidl::encoding::DefaultFuchsiaResourceDialect,
2743        > for &mut EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest
2744    {
2745        #[inline]
2746        unsafe fn encode(
2747            self,
2748            encoder: &mut fidl::encoding::Encoder<
2749                '_,
2750                fidl::encoding::DefaultFuchsiaResourceDialect,
2751            >,
2752            offset: usize,
2753            _depth: fidl::encoding::Depth,
2754        ) -> fidl::Result<()> {
2755            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest>(offset);
2756            // Delegate to tuple encoding.
2757            fidl::encoding::Encode::<
2758                EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest,
2759                fidl::encoding::DefaultFuchsiaResourceDialect,
2760            >::encode(
2761                (<fidl::encoding::HandleType<
2762                    fidl::Event,
2763                    { fidl::ObjectType::EVENT.into_raw() },
2764                    3,
2765                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2766                    &mut self.h
2767                ),),
2768                encoder,
2769                offset,
2770                _depth,
2771            )
2772        }
2773    }
2774    unsafe impl<
2775            T0: fidl::encoding::Encode<
2776                fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>,
2777                fidl::encoding::DefaultFuchsiaResourceDialect,
2778            >,
2779        >
2780        fidl::encoding::Encode<
2781            EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest,
2782            fidl::encoding::DefaultFuchsiaResourceDialect,
2783        > for (T0,)
2784    {
2785        #[inline]
2786        unsafe fn encode(
2787            self,
2788            encoder: &mut fidl::encoding::Encoder<
2789                '_,
2790                fidl::encoding::DefaultFuchsiaResourceDialect,
2791            >,
2792            offset: usize,
2793            depth: fidl::encoding::Depth,
2794        ) -> fidl::Result<()> {
2795            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest>(offset);
2796            // Zero out padding regions. There's no need to apply masks
2797            // because the unmasked parts will be overwritten by fields.
2798            // Write the fields.
2799            self.0.encode(encoder, offset + 0, depth)?;
2800            Ok(())
2801        }
2802    }
2803
2804    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2805        for EchoHandleProtocolEchoHandleRequestResponseReducedRightsRequest
2806    {
2807        #[inline(always)]
2808        fn new_empty() -> Self {
2809            Self {
2810                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>, fidl::encoding::DefaultFuchsiaResourceDialect),
2811            }
2812        }
2813
2814        #[inline]
2815        unsafe fn decode(
2816            &mut self,
2817            decoder: &mut fidl::encoding::Decoder<
2818                '_,
2819                fidl::encoding::DefaultFuchsiaResourceDialect,
2820            >,
2821            offset: usize,
2822            _depth: fidl::encoding::Depth,
2823        ) -> fidl::Result<()> {
2824            decoder.debug_check_bounds::<Self>(offset);
2825            // Verify that padding bytes are zero.
2826            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
2827            Ok(())
2828        }
2829    }
2830
2831    impl fidl::encoding::ResourceTypeMarker
2832        for EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse
2833    {
2834        type Borrowed<'a> = &'a mut Self;
2835        fn take_or_borrow<'a>(
2836            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2837        ) -> Self::Borrowed<'a> {
2838            value
2839        }
2840    }
2841
2842    unsafe impl fidl::encoding::TypeMarker
2843        for EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse
2844    {
2845        type Owned = Self;
2846
2847        #[inline(always)]
2848        fn inline_align(_context: fidl::encoding::Context) -> usize {
2849            4
2850        }
2851
2852        #[inline(always)]
2853        fn inline_size(_context: fidl::encoding::Context) -> usize {
2854            4
2855        }
2856    }
2857
2858    unsafe impl
2859        fidl::encoding::Encode<
2860            EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse,
2861            fidl::encoding::DefaultFuchsiaResourceDialect,
2862        > for &mut EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse
2863    {
2864        #[inline]
2865        unsafe fn encode(
2866            self,
2867            encoder: &mut fidl::encoding::Encoder<
2868                '_,
2869                fidl::encoding::DefaultFuchsiaResourceDialect,
2870            >,
2871            offset: usize,
2872            _depth: fidl::encoding::Depth,
2873        ) -> fidl::Result<()> {
2874            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse>(offset);
2875            // Delegate to tuple encoding.
2876            fidl::encoding::Encode::<
2877                EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse,
2878                fidl::encoding::DefaultFuchsiaResourceDialect,
2879            >::encode(
2880                (<fidl::encoding::HandleType<
2881                    fidl::Event,
2882                    { fidl::ObjectType::EVENT.into_raw() },
2883                    2,
2884                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2885                    &mut self.h
2886                ),),
2887                encoder,
2888                offset,
2889                _depth,
2890            )
2891        }
2892    }
2893    unsafe impl<
2894            T0: fidl::encoding::Encode<
2895                fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>,
2896                fidl::encoding::DefaultFuchsiaResourceDialect,
2897            >,
2898        >
2899        fidl::encoding::Encode<
2900            EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse,
2901            fidl::encoding::DefaultFuchsiaResourceDialect,
2902        > for (T0,)
2903    {
2904        #[inline]
2905        unsafe fn encode(
2906            self,
2907            encoder: &mut fidl::encoding::Encoder<
2908                '_,
2909                fidl::encoding::DefaultFuchsiaResourceDialect,
2910            >,
2911            offset: usize,
2912            depth: fidl::encoding::Depth,
2913        ) -> fidl::Result<()> {
2914            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse>(offset);
2915            // Zero out padding regions. There's no need to apply masks
2916            // because the unmasked parts will be overwritten by fields.
2917            // Write the fields.
2918            self.0.encode(encoder, offset + 0, depth)?;
2919            Ok(())
2920        }
2921    }
2922
2923    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2924        for EchoHandleProtocolEchoHandleRequestResponseReducedRightsResponse
2925    {
2926        #[inline(always)]
2927        fn new_empty() -> Self {
2928            Self {
2929                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
2930            }
2931        }
2932
2933        #[inline]
2934        unsafe fn decode(
2935            &mut self,
2936            decoder: &mut fidl::encoding::Decoder<
2937                '_,
2938                fidl::encoding::DefaultFuchsiaResourceDialect,
2939            >,
2940            offset: usize,
2941            _depth: fidl::encoding::Depth,
2942        ) -> fidl::Result<()> {
2943            decoder.debug_check_bounds::<Self>(offset);
2944            // Verify that padding bytes are zero.
2945            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
2946            Ok(())
2947        }
2948    }
2949
2950    impl fidl::encoding::ResourceTypeMarker for EchoHandleProtocolEchoHandleRequestSameRightsRequest {
2951        type Borrowed<'a> = &'a mut Self;
2952        fn take_or_borrow<'a>(
2953            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2954        ) -> Self::Borrowed<'a> {
2955            value
2956        }
2957    }
2958
2959    unsafe impl fidl::encoding::TypeMarker for EchoHandleProtocolEchoHandleRequestSameRightsRequest {
2960        type Owned = Self;
2961
2962        #[inline(always)]
2963        fn inline_align(_context: fidl::encoding::Context) -> usize {
2964            4
2965        }
2966
2967        #[inline(always)]
2968        fn inline_size(_context: fidl::encoding::Context) -> usize {
2969            4
2970        }
2971    }
2972
2973    unsafe impl
2974        fidl::encoding::Encode<
2975            EchoHandleProtocolEchoHandleRequestSameRightsRequest,
2976            fidl::encoding::DefaultFuchsiaResourceDialect,
2977        > for &mut EchoHandleProtocolEchoHandleRequestSameRightsRequest
2978    {
2979        #[inline]
2980        unsafe fn encode(
2981            self,
2982            encoder: &mut fidl::encoding::Encoder<
2983                '_,
2984                fidl::encoding::DefaultFuchsiaResourceDialect,
2985            >,
2986            offset: usize,
2987            _depth: fidl::encoding::Depth,
2988        ) -> fidl::Result<()> {
2989            encoder
2990                .debug_check_bounds::<EchoHandleProtocolEchoHandleRequestSameRightsRequest>(offset);
2991            // Delegate to tuple encoding.
2992            fidl::encoding::Encode::<
2993                EchoHandleProtocolEchoHandleRequestSameRightsRequest,
2994                fidl::encoding::DefaultFuchsiaResourceDialect,
2995            >::encode(
2996                (<fidl::encoding::HandleType<
2997                    fidl::Event,
2998                    { fidl::ObjectType::EVENT.into_raw() },
2999                    2147483648,
3000                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3001                    &mut self.h
3002                ),),
3003                encoder,
3004                offset,
3005                _depth,
3006            )
3007        }
3008    }
3009    unsafe impl<
3010            T0: fidl::encoding::Encode<
3011                fidl::encoding::HandleType<
3012                    fidl::Event,
3013                    { fidl::ObjectType::EVENT.into_raw() },
3014                    2147483648,
3015                >,
3016                fidl::encoding::DefaultFuchsiaResourceDialect,
3017            >,
3018        >
3019        fidl::encoding::Encode<
3020            EchoHandleProtocolEchoHandleRequestSameRightsRequest,
3021            fidl::encoding::DefaultFuchsiaResourceDialect,
3022        > for (T0,)
3023    {
3024        #[inline]
3025        unsafe fn encode(
3026            self,
3027            encoder: &mut fidl::encoding::Encoder<
3028                '_,
3029                fidl::encoding::DefaultFuchsiaResourceDialect,
3030            >,
3031            offset: usize,
3032            depth: fidl::encoding::Depth,
3033        ) -> fidl::Result<()> {
3034            encoder
3035                .debug_check_bounds::<EchoHandleProtocolEchoHandleRequestSameRightsRequest>(offset);
3036            // Zero out padding regions. There's no need to apply masks
3037            // because the unmasked parts will be overwritten by fields.
3038            // Write the fields.
3039            self.0.encode(encoder, offset + 0, depth)?;
3040            Ok(())
3041        }
3042    }
3043
3044    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3045        for EchoHandleProtocolEchoHandleRequestSameRightsRequest
3046    {
3047        #[inline(always)]
3048        fn new_empty() -> Self {
3049            Self {
3050                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3051            }
3052        }
3053
3054        #[inline]
3055        unsafe fn decode(
3056            &mut self,
3057            decoder: &mut fidl::encoding::Decoder<
3058                '_,
3059                fidl::encoding::DefaultFuchsiaResourceDialect,
3060            >,
3061            offset: usize,
3062            _depth: fidl::encoding::Depth,
3063        ) -> fidl::Result<()> {
3064            decoder.debug_check_bounds::<Self>(offset);
3065            // Verify that padding bytes are zero.
3066            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
3067            Ok(())
3068        }
3069    }
3070
3071    impl fidl::encoding::ResourceTypeMarker for EchoHandleProtocolEchoHandleRequestSameRightsResponse {
3072        type Borrowed<'a> = &'a mut Self;
3073        fn take_or_borrow<'a>(
3074            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3075        ) -> Self::Borrowed<'a> {
3076            value
3077        }
3078    }
3079
3080    unsafe impl fidl::encoding::TypeMarker for EchoHandleProtocolEchoHandleRequestSameRightsResponse {
3081        type Owned = Self;
3082
3083        #[inline(always)]
3084        fn inline_align(_context: fidl::encoding::Context) -> usize {
3085            4
3086        }
3087
3088        #[inline(always)]
3089        fn inline_size(_context: fidl::encoding::Context) -> usize {
3090            4
3091        }
3092    }
3093
3094    unsafe impl
3095        fidl::encoding::Encode<
3096            EchoHandleProtocolEchoHandleRequestSameRightsResponse,
3097            fidl::encoding::DefaultFuchsiaResourceDialect,
3098        > for &mut EchoHandleProtocolEchoHandleRequestSameRightsResponse
3099    {
3100        #[inline]
3101        unsafe fn encode(
3102            self,
3103            encoder: &mut fidl::encoding::Encoder<
3104                '_,
3105                fidl::encoding::DefaultFuchsiaResourceDialect,
3106            >,
3107            offset: usize,
3108            _depth: fidl::encoding::Depth,
3109        ) -> fidl::Result<()> {
3110            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestSameRightsResponse>(
3111                offset,
3112            );
3113            // Delegate to tuple encoding.
3114            fidl::encoding::Encode::<
3115                EchoHandleProtocolEchoHandleRequestSameRightsResponse,
3116                fidl::encoding::DefaultFuchsiaResourceDialect,
3117            >::encode(
3118                (<fidl::encoding::HandleType<
3119                    fidl::Event,
3120                    { fidl::ObjectType::EVENT.into_raw() },
3121                    2147483648,
3122                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3123                    &mut self.h
3124                ),),
3125                encoder,
3126                offset,
3127                _depth,
3128            )
3129        }
3130    }
3131    unsafe impl<
3132            T0: fidl::encoding::Encode<
3133                fidl::encoding::HandleType<
3134                    fidl::Event,
3135                    { fidl::ObjectType::EVENT.into_raw() },
3136                    2147483648,
3137                >,
3138                fidl::encoding::DefaultFuchsiaResourceDialect,
3139            >,
3140        >
3141        fidl::encoding::Encode<
3142            EchoHandleProtocolEchoHandleRequestSameRightsResponse,
3143            fidl::encoding::DefaultFuchsiaResourceDialect,
3144        > for (T0,)
3145    {
3146        #[inline]
3147        unsafe fn encode(
3148            self,
3149            encoder: &mut fidl::encoding::Encoder<
3150                '_,
3151                fidl::encoding::DefaultFuchsiaResourceDialect,
3152            >,
3153            offset: usize,
3154            depth: fidl::encoding::Depth,
3155        ) -> fidl::Result<()> {
3156            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleRequestSameRightsResponse>(
3157                offset,
3158            );
3159            // Zero out padding regions. There's no need to apply masks
3160            // because the unmasked parts will be overwritten by fields.
3161            // Write the fields.
3162            self.0.encode(encoder, offset + 0, depth)?;
3163            Ok(())
3164        }
3165    }
3166
3167    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3168        for EchoHandleProtocolEchoHandleRequestSameRightsResponse
3169    {
3170        #[inline(always)]
3171        fn new_empty() -> Self {
3172            Self {
3173                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3174            }
3175        }
3176
3177        #[inline]
3178        unsafe fn decode(
3179            &mut self,
3180            decoder: &mut fidl::encoding::Decoder<
3181                '_,
3182                fidl::encoding::DefaultFuchsiaResourceDialect,
3183            >,
3184            offset: usize,
3185            _depth: fidl::encoding::Depth,
3186        ) -> fidl::Result<()> {
3187            decoder.debug_check_bounds::<Self>(offset);
3188            // Verify that padding bytes are zero.
3189            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
3190            Ok(())
3191        }
3192    }
3193
3194    impl fidl::encoding::ResourceTypeMarker
3195        for EchoHandleProtocolEchoHandleResponseReducedRightsRequest
3196    {
3197        type Borrowed<'a> = &'a mut Self;
3198        fn take_or_borrow<'a>(
3199            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3200        ) -> Self::Borrowed<'a> {
3201            value
3202        }
3203    }
3204
3205    unsafe impl fidl::encoding::TypeMarker
3206        for EchoHandleProtocolEchoHandleResponseReducedRightsRequest
3207    {
3208        type Owned = Self;
3209
3210        #[inline(always)]
3211        fn inline_align(_context: fidl::encoding::Context) -> usize {
3212            4
3213        }
3214
3215        #[inline(always)]
3216        fn inline_size(_context: fidl::encoding::Context) -> usize {
3217            4
3218        }
3219    }
3220
3221    unsafe impl
3222        fidl::encoding::Encode<
3223            EchoHandleProtocolEchoHandleResponseReducedRightsRequest,
3224            fidl::encoding::DefaultFuchsiaResourceDialect,
3225        > for &mut EchoHandleProtocolEchoHandleResponseReducedRightsRequest
3226    {
3227        #[inline]
3228        unsafe fn encode(
3229            self,
3230            encoder: &mut fidl::encoding::Encoder<
3231                '_,
3232                fidl::encoding::DefaultFuchsiaResourceDialect,
3233            >,
3234            offset: usize,
3235            _depth: fidl::encoding::Depth,
3236        ) -> fidl::Result<()> {
3237            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleResponseReducedRightsRequest>(
3238                offset,
3239            );
3240            // Delegate to tuple encoding.
3241            fidl::encoding::Encode::<
3242                EchoHandleProtocolEchoHandleResponseReducedRightsRequest,
3243                fidl::encoding::DefaultFuchsiaResourceDialect,
3244            >::encode(
3245                (<fidl::encoding::HandleType<
3246                    fidl::Event,
3247                    { fidl::ObjectType::EVENT.into_raw() },
3248                    2147483648,
3249                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3250                    &mut self.h
3251                ),),
3252                encoder,
3253                offset,
3254                _depth,
3255            )
3256        }
3257    }
3258    unsafe impl<
3259            T0: fidl::encoding::Encode<
3260                fidl::encoding::HandleType<
3261                    fidl::Event,
3262                    { fidl::ObjectType::EVENT.into_raw() },
3263                    2147483648,
3264                >,
3265                fidl::encoding::DefaultFuchsiaResourceDialect,
3266            >,
3267        >
3268        fidl::encoding::Encode<
3269            EchoHandleProtocolEchoHandleResponseReducedRightsRequest,
3270            fidl::encoding::DefaultFuchsiaResourceDialect,
3271        > for (T0,)
3272    {
3273        #[inline]
3274        unsafe fn encode(
3275            self,
3276            encoder: &mut fidl::encoding::Encoder<
3277                '_,
3278                fidl::encoding::DefaultFuchsiaResourceDialect,
3279            >,
3280            offset: usize,
3281            depth: fidl::encoding::Depth,
3282        ) -> fidl::Result<()> {
3283            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleResponseReducedRightsRequest>(
3284                offset,
3285            );
3286            // Zero out padding regions. There's no need to apply masks
3287            // because the unmasked parts will be overwritten by fields.
3288            // Write the fields.
3289            self.0.encode(encoder, offset + 0, depth)?;
3290            Ok(())
3291        }
3292    }
3293
3294    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3295        for EchoHandleProtocolEchoHandleResponseReducedRightsRequest
3296    {
3297        #[inline(always)]
3298        fn new_empty() -> Self {
3299            Self {
3300                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3301            }
3302        }
3303
3304        #[inline]
3305        unsafe fn decode(
3306            &mut self,
3307            decoder: &mut fidl::encoding::Decoder<
3308                '_,
3309                fidl::encoding::DefaultFuchsiaResourceDialect,
3310            >,
3311            offset: usize,
3312            _depth: fidl::encoding::Depth,
3313        ) -> fidl::Result<()> {
3314            decoder.debug_check_bounds::<Self>(offset);
3315            // Verify that padding bytes are zero.
3316            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
3317            Ok(())
3318        }
3319    }
3320
3321    impl fidl::encoding::ResourceTypeMarker
3322        for EchoHandleProtocolEchoHandleResponseReducedRightsResponse
3323    {
3324        type Borrowed<'a> = &'a mut Self;
3325        fn take_or_borrow<'a>(
3326            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3327        ) -> Self::Borrowed<'a> {
3328            value
3329        }
3330    }
3331
3332    unsafe impl fidl::encoding::TypeMarker
3333        for EchoHandleProtocolEchoHandleResponseReducedRightsResponse
3334    {
3335        type Owned = Self;
3336
3337        #[inline(always)]
3338        fn inline_align(_context: fidl::encoding::Context) -> usize {
3339            4
3340        }
3341
3342        #[inline(always)]
3343        fn inline_size(_context: fidl::encoding::Context) -> usize {
3344            4
3345        }
3346    }
3347
3348    unsafe impl
3349        fidl::encoding::Encode<
3350            EchoHandleProtocolEchoHandleResponseReducedRightsResponse,
3351            fidl::encoding::DefaultFuchsiaResourceDialect,
3352        > for &mut EchoHandleProtocolEchoHandleResponseReducedRightsResponse
3353    {
3354        #[inline]
3355        unsafe fn encode(
3356            self,
3357            encoder: &mut fidl::encoding::Encoder<
3358                '_,
3359                fidl::encoding::DefaultFuchsiaResourceDialect,
3360            >,
3361            offset: usize,
3362            _depth: fidl::encoding::Depth,
3363        ) -> fidl::Result<()> {
3364            encoder
3365                .debug_check_bounds::<EchoHandleProtocolEchoHandleResponseReducedRightsResponse>(
3366                    offset,
3367                );
3368            // Delegate to tuple encoding.
3369            fidl::encoding::Encode::<
3370                EchoHandleProtocolEchoHandleResponseReducedRightsResponse,
3371                fidl::encoding::DefaultFuchsiaResourceDialect,
3372            >::encode(
3373                (<fidl::encoding::HandleType<
3374                    fidl::Event,
3375                    { fidl::ObjectType::EVENT.into_raw() },
3376                    2,
3377                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3378                    &mut self.h
3379                ),),
3380                encoder,
3381                offset,
3382                _depth,
3383            )
3384        }
3385    }
3386    unsafe impl<
3387            T0: fidl::encoding::Encode<
3388                fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>,
3389                fidl::encoding::DefaultFuchsiaResourceDialect,
3390            >,
3391        >
3392        fidl::encoding::Encode<
3393            EchoHandleProtocolEchoHandleResponseReducedRightsResponse,
3394            fidl::encoding::DefaultFuchsiaResourceDialect,
3395        > for (T0,)
3396    {
3397        #[inline]
3398        unsafe fn encode(
3399            self,
3400            encoder: &mut fidl::encoding::Encoder<
3401                '_,
3402                fidl::encoding::DefaultFuchsiaResourceDialect,
3403            >,
3404            offset: usize,
3405            depth: fidl::encoding::Depth,
3406        ) -> fidl::Result<()> {
3407            encoder
3408                .debug_check_bounds::<EchoHandleProtocolEchoHandleResponseReducedRightsResponse>(
3409                    offset,
3410                );
3411            // Zero out padding regions. There's no need to apply masks
3412            // because the unmasked parts will be overwritten by fields.
3413            // Write the fields.
3414            self.0.encode(encoder, offset + 0, depth)?;
3415            Ok(())
3416        }
3417    }
3418
3419    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3420        for EchoHandleProtocolEchoHandleResponseReducedRightsResponse
3421    {
3422        #[inline(always)]
3423        fn new_empty() -> Self {
3424            Self {
3425                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
3426            }
3427        }
3428
3429        #[inline]
3430        unsafe fn decode(
3431            &mut self,
3432            decoder: &mut fidl::encoding::Decoder<
3433                '_,
3434                fidl::encoding::DefaultFuchsiaResourceDialect,
3435            >,
3436            offset: usize,
3437            _depth: fidl::encoding::Depth,
3438        ) -> fidl::Result<()> {
3439            decoder.debug_check_bounds::<Self>(offset);
3440            // Verify that padding bytes are zero.
3441            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
3442            Ok(())
3443        }
3444    }
3445
3446    impl fidl::encoding::ResourceTypeMarker for EchoHandleProtocolEchoHandleResponseSameRightsRequest {
3447        type Borrowed<'a> = &'a mut Self;
3448        fn take_or_borrow<'a>(
3449            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3450        ) -> Self::Borrowed<'a> {
3451            value
3452        }
3453    }
3454
3455    unsafe impl fidl::encoding::TypeMarker for EchoHandleProtocolEchoHandleResponseSameRightsRequest {
3456        type Owned = Self;
3457
3458        #[inline(always)]
3459        fn inline_align(_context: fidl::encoding::Context) -> usize {
3460            4
3461        }
3462
3463        #[inline(always)]
3464        fn inline_size(_context: fidl::encoding::Context) -> usize {
3465            4
3466        }
3467    }
3468
3469    unsafe impl
3470        fidl::encoding::Encode<
3471            EchoHandleProtocolEchoHandleResponseSameRightsRequest,
3472            fidl::encoding::DefaultFuchsiaResourceDialect,
3473        > for &mut EchoHandleProtocolEchoHandleResponseSameRightsRequest
3474    {
3475        #[inline]
3476        unsafe fn encode(
3477            self,
3478            encoder: &mut fidl::encoding::Encoder<
3479                '_,
3480                fidl::encoding::DefaultFuchsiaResourceDialect,
3481            >,
3482            offset: usize,
3483            _depth: fidl::encoding::Depth,
3484        ) -> fidl::Result<()> {
3485            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleResponseSameRightsRequest>(
3486                offset,
3487            );
3488            // Delegate to tuple encoding.
3489            fidl::encoding::Encode::<
3490                EchoHandleProtocolEchoHandleResponseSameRightsRequest,
3491                fidl::encoding::DefaultFuchsiaResourceDialect,
3492            >::encode(
3493                (<fidl::encoding::HandleType<
3494                    fidl::Event,
3495                    { fidl::ObjectType::EVENT.into_raw() },
3496                    2147483648,
3497                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3498                    &mut self.h
3499                ),),
3500                encoder,
3501                offset,
3502                _depth,
3503            )
3504        }
3505    }
3506    unsafe impl<
3507            T0: fidl::encoding::Encode<
3508                fidl::encoding::HandleType<
3509                    fidl::Event,
3510                    { fidl::ObjectType::EVENT.into_raw() },
3511                    2147483648,
3512                >,
3513                fidl::encoding::DefaultFuchsiaResourceDialect,
3514            >,
3515        >
3516        fidl::encoding::Encode<
3517            EchoHandleProtocolEchoHandleResponseSameRightsRequest,
3518            fidl::encoding::DefaultFuchsiaResourceDialect,
3519        > for (T0,)
3520    {
3521        #[inline]
3522        unsafe fn encode(
3523            self,
3524            encoder: &mut fidl::encoding::Encoder<
3525                '_,
3526                fidl::encoding::DefaultFuchsiaResourceDialect,
3527            >,
3528            offset: usize,
3529            depth: fidl::encoding::Depth,
3530        ) -> fidl::Result<()> {
3531            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleResponseSameRightsRequest>(
3532                offset,
3533            );
3534            // Zero out padding regions. There's no need to apply masks
3535            // because the unmasked parts will be overwritten by fields.
3536            // Write the fields.
3537            self.0.encode(encoder, offset + 0, depth)?;
3538            Ok(())
3539        }
3540    }
3541
3542    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3543        for EchoHandleProtocolEchoHandleResponseSameRightsRequest
3544    {
3545        #[inline(always)]
3546        fn new_empty() -> Self {
3547            Self {
3548                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3549            }
3550        }
3551
3552        #[inline]
3553        unsafe fn decode(
3554            &mut self,
3555            decoder: &mut fidl::encoding::Decoder<
3556                '_,
3557                fidl::encoding::DefaultFuchsiaResourceDialect,
3558            >,
3559            offset: usize,
3560            _depth: fidl::encoding::Depth,
3561        ) -> fidl::Result<()> {
3562            decoder.debug_check_bounds::<Self>(offset);
3563            // Verify that padding bytes are zero.
3564            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
3565            Ok(())
3566        }
3567    }
3568
3569    impl fidl::encoding::ResourceTypeMarker for EchoHandleProtocolEchoHandleResponseSameRightsResponse {
3570        type Borrowed<'a> = &'a mut Self;
3571        fn take_or_borrow<'a>(
3572            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3573        ) -> Self::Borrowed<'a> {
3574            value
3575        }
3576    }
3577
3578    unsafe impl fidl::encoding::TypeMarker for EchoHandleProtocolEchoHandleResponseSameRightsResponse {
3579        type Owned = Self;
3580
3581        #[inline(always)]
3582        fn inline_align(_context: fidl::encoding::Context) -> usize {
3583            4
3584        }
3585
3586        #[inline(always)]
3587        fn inline_size(_context: fidl::encoding::Context) -> usize {
3588            4
3589        }
3590    }
3591
3592    unsafe impl
3593        fidl::encoding::Encode<
3594            EchoHandleProtocolEchoHandleResponseSameRightsResponse,
3595            fidl::encoding::DefaultFuchsiaResourceDialect,
3596        > for &mut EchoHandleProtocolEchoHandleResponseSameRightsResponse
3597    {
3598        #[inline]
3599        unsafe fn encode(
3600            self,
3601            encoder: &mut fidl::encoding::Encoder<
3602                '_,
3603                fidl::encoding::DefaultFuchsiaResourceDialect,
3604            >,
3605            offset: usize,
3606            _depth: fidl::encoding::Depth,
3607        ) -> fidl::Result<()> {
3608            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleResponseSameRightsResponse>(
3609                offset,
3610            );
3611            // Delegate to tuple encoding.
3612            fidl::encoding::Encode::<
3613                EchoHandleProtocolEchoHandleResponseSameRightsResponse,
3614                fidl::encoding::DefaultFuchsiaResourceDialect,
3615            >::encode(
3616                (<fidl::encoding::HandleType<
3617                    fidl::Event,
3618                    { fidl::ObjectType::EVENT.into_raw() },
3619                    2147483648,
3620                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3621                    &mut self.h
3622                ),),
3623                encoder,
3624                offset,
3625                _depth,
3626            )
3627        }
3628    }
3629    unsafe impl<
3630            T0: fidl::encoding::Encode<
3631                fidl::encoding::HandleType<
3632                    fidl::Event,
3633                    { fidl::ObjectType::EVENT.into_raw() },
3634                    2147483648,
3635                >,
3636                fidl::encoding::DefaultFuchsiaResourceDialect,
3637            >,
3638        >
3639        fidl::encoding::Encode<
3640            EchoHandleProtocolEchoHandleResponseSameRightsResponse,
3641            fidl::encoding::DefaultFuchsiaResourceDialect,
3642        > for (T0,)
3643    {
3644        #[inline]
3645        unsafe fn encode(
3646            self,
3647            encoder: &mut fidl::encoding::Encoder<
3648                '_,
3649                fidl::encoding::DefaultFuchsiaResourceDialect,
3650            >,
3651            offset: usize,
3652            depth: fidl::encoding::Depth,
3653        ) -> fidl::Result<()> {
3654            encoder.debug_check_bounds::<EchoHandleProtocolEchoHandleResponseSameRightsResponse>(
3655                offset,
3656            );
3657            // Zero out padding regions. There's no need to apply masks
3658            // because the unmasked parts will be overwritten by fields.
3659            // Write the fields.
3660            self.0.encode(encoder, offset + 0, depth)?;
3661            Ok(())
3662        }
3663    }
3664
3665    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3666        for EchoHandleProtocolEchoHandleResponseSameRightsResponse
3667    {
3668        #[inline(always)]
3669        fn new_empty() -> Self {
3670            Self {
3671                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3672            }
3673        }
3674
3675        #[inline]
3676        unsafe fn decode(
3677            &mut self,
3678            decoder: &mut fidl::encoding::Decoder<
3679                '_,
3680                fidl::encoding::DefaultFuchsiaResourceDialect,
3681            >,
3682            offset: usize,
3683            _depth: fidl::encoding::Depth,
3684        ) -> fidl::Result<()> {
3685            decoder.debug_check_bounds::<Self>(offset);
3686            // Verify that padding bytes are zero.
3687            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
3688            Ok(())
3689        }
3690    }
3691
3692    impl fidl::encoding::ResourceTypeMarker for ErrorSyntaxProtocolTestErrorSyntaxResponse {
3693        type Borrowed<'a> = &'a mut Self;
3694        fn take_or_borrow<'a>(
3695            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3696        ) -> Self::Borrowed<'a> {
3697            value
3698        }
3699    }
3700
3701    unsafe impl fidl::encoding::TypeMarker for ErrorSyntaxProtocolTestErrorSyntaxResponse {
3702        type Owned = Self;
3703
3704        #[inline(always)]
3705        fn inline_align(_context: fidl::encoding::Context) -> usize {
3706            4
3707        }
3708
3709        #[inline(always)]
3710        fn inline_size(_context: fidl::encoding::Context) -> usize {
3711            4
3712        }
3713    }
3714
3715    unsafe impl
3716        fidl::encoding::Encode<
3717            ErrorSyntaxProtocolTestErrorSyntaxResponse,
3718            fidl::encoding::DefaultFuchsiaResourceDialect,
3719        > for &mut ErrorSyntaxProtocolTestErrorSyntaxResponse
3720    {
3721        #[inline]
3722        unsafe fn encode(
3723            self,
3724            encoder: &mut fidl::encoding::Encoder<
3725                '_,
3726                fidl::encoding::DefaultFuchsiaResourceDialect,
3727            >,
3728            offset: usize,
3729            _depth: fidl::encoding::Depth,
3730        ) -> fidl::Result<()> {
3731            encoder.debug_check_bounds::<ErrorSyntaxProtocolTestErrorSyntaxResponse>(offset);
3732            // Delegate to tuple encoding.
3733            fidl::encoding::Encode::<
3734                ErrorSyntaxProtocolTestErrorSyntaxResponse,
3735                fidl::encoding::DefaultFuchsiaResourceDialect,
3736            >::encode(
3737                (<fidl::encoding::HandleType<
3738                    fidl::Event,
3739                    { fidl::ObjectType::EVENT.into_raw() },
3740                    2,
3741                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3742                    &mut self.h
3743                ),),
3744                encoder,
3745                offset,
3746                _depth,
3747            )
3748        }
3749    }
3750    unsafe impl<
3751            T0: fidl::encoding::Encode<
3752                fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>,
3753                fidl::encoding::DefaultFuchsiaResourceDialect,
3754            >,
3755        >
3756        fidl::encoding::Encode<
3757            ErrorSyntaxProtocolTestErrorSyntaxResponse,
3758            fidl::encoding::DefaultFuchsiaResourceDialect,
3759        > for (T0,)
3760    {
3761        #[inline]
3762        unsafe fn encode(
3763            self,
3764            encoder: &mut fidl::encoding::Encoder<
3765                '_,
3766                fidl::encoding::DefaultFuchsiaResourceDialect,
3767            >,
3768            offset: usize,
3769            depth: fidl::encoding::Depth,
3770        ) -> fidl::Result<()> {
3771            encoder.debug_check_bounds::<ErrorSyntaxProtocolTestErrorSyntaxResponse>(offset);
3772            // Zero out padding regions. There's no need to apply masks
3773            // because the unmasked parts will be overwritten by fields.
3774            // Write the fields.
3775            self.0.encode(encoder, offset + 0, depth)?;
3776            Ok(())
3777        }
3778    }
3779
3780    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3781        for ErrorSyntaxProtocolTestErrorSyntaxResponse
3782    {
3783        #[inline(always)]
3784        fn new_empty() -> Self {
3785            Self {
3786                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
3787            }
3788        }
3789
3790        #[inline]
3791        unsafe fn decode(
3792            &mut self,
3793            decoder: &mut fidl::encoding::Decoder<
3794                '_,
3795                fidl::encoding::DefaultFuchsiaResourceDialect,
3796            >,
3797            offset: usize,
3798            _depth: fidl::encoding::Depth,
3799        ) -> fidl::Result<()> {
3800            decoder.debug_check_bounds::<Self>(offset);
3801            // Verify that padding bytes are zero.
3802            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
3803            Ok(())
3804        }
3805    }
3806
3807    impl fidl::encoding::ResourceTypeMarker for PushEventProtocolPushEventReducedRightsRequest {
3808        type Borrowed<'a> = &'a mut Self;
3809        fn take_or_borrow<'a>(
3810            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3811        ) -> Self::Borrowed<'a> {
3812            value
3813        }
3814    }
3815
3816    unsafe impl fidl::encoding::TypeMarker for PushEventProtocolPushEventReducedRightsRequest {
3817        type Owned = Self;
3818
3819        #[inline(always)]
3820        fn inline_align(_context: fidl::encoding::Context) -> usize {
3821            4
3822        }
3823
3824        #[inline(always)]
3825        fn inline_size(_context: fidl::encoding::Context) -> usize {
3826            4
3827        }
3828    }
3829
3830    unsafe impl
3831        fidl::encoding::Encode<
3832            PushEventProtocolPushEventReducedRightsRequest,
3833            fidl::encoding::DefaultFuchsiaResourceDialect,
3834        > for &mut PushEventProtocolPushEventReducedRightsRequest
3835    {
3836        #[inline]
3837        unsafe fn encode(
3838            self,
3839            encoder: &mut fidl::encoding::Encoder<
3840                '_,
3841                fidl::encoding::DefaultFuchsiaResourceDialect,
3842            >,
3843            offset: usize,
3844            _depth: fidl::encoding::Depth,
3845        ) -> fidl::Result<()> {
3846            encoder.debug_check_bounds::<PushEventProtocolPushEventReducedRightsRequest>(offset);
3847            // Delegate to tuple encoding.
3848            fidl::encoding::Encode::<
3849                PushEventProtocolPushEventReducedRightsRequest,
3850                fidl::encoding::DefaultFuchsiaResourceDialect,
3851            >::encode(
3852                (<fidl::encoding::HandleType<
3853                    fidl::Event,
3854                    { fidl::ObjectType::EVENT.into_raw() },
3855                    2,
3856                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3857                    &mut self.h
3858                ),),
3859                encoder,
3860                offset,
3861                _depth,
3862            )
3863        }
3864    }
3865    unsafe impl<
3866            T0: fidl::encoding::Encode<
3867                fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>,
3868                fidl::encoding::DefaultFuchsiaResourceDialect,
3869            >,
3870        >
3871        fidl::encoding::Encode<
3872            PushEventProtocolPushEventReducedRightsRequest,
3873            fidl::encoding::DefaultFuchsiaResourceDialect,
3874        > for (T0,)
3875    {
3876        #[inline]
3877        unsafe fn encode(
3878            self,
3879            encoder: &mut fidl::encoding::Encoder<
3880                '_,
3881                fidl::encoding::DefaultFuchsiaResourceDialect,
3882            >,
3883            offset: usize,
3884            depth: fidl::encoding::Depth,
3885        ) -> fidl::Result<()> {
3886            encoder.debug_check_bounds::<PushEventProtocolPushEventReducedRightsRequest>(offset);
3887            // Zero out padding regions. There's no need to apply masks
3888            // because the unmasked parts will be overwritten by fields.
3889            // Write the fields.
3890            self.0.encode(encoder, offset + 0, depth)?;
3891            Ok(())
3892        }
3893    }
3894
3895    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3896        for PushEventProtocolPushEventReducedRightsRequest
3897    {
3898        #[inline(always)]
3899        fn new_empty() -> Self {
3900            Self {
3901                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
3902            }
3903        }
3904
3905        #[inline]
3906        unsafe fn decode(
3907            &mut self,
3908            decoder: &mut fidl::encoding::Decoder<
3909                '_,
3910                fidl::encoding::DefaultFuchsiaResourceDialect,
3911            >,
3912            offset: usize,
3913            _depth: fidl::encoding::Depth,
3914        ) -> fidl::Result<()> {
3915            decoder.debug_check_bounds::<Self>(offset);
3916            // Verify that padding bytes are zero.
3917            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
3918            Ok(())
3919        }
3920    }
3921
3922    impl fidl::encoding::ResourceTypeMarker for PushEventProtocolPushEventSameRightsRequest {
3923        type Borrowed<'a> = &'a mut Self;
3924        fn take_or_borrow<'a>(
3925            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3926        ) -> Self::Borrowed<'a> {
3927            value
3928        }
3929    }
3930
3931    unsafe impl fidl::encoding::TypeMarker for PushEventProtocolPushEventSameRightsRequest {
3932        type Owned = Self;
3933
3934        #[inline(always)]
3935        fn inline_align(_context: fidl::encoding::Context) -> usize {
3936            4
3937        }
3938
3939        #[inline(always)]
3940        fn inline_size(_context: fidl::encoding::Context) -> usize {
3941            4
3942        }
3943    }
3944
3945    unsafe impl
3946        fidl::encoding::Encode<
3947            PushEventProtocolPushEventSameRightsRequest,
3948            fidl::encoding::DefaultFuchsiaResourceDialect,
3949        > for &mut PushEventProtocolPushEventSameRightsRequest
3950    {
3951        #[inline]
3952        unsafe fn encode(
3953            self,
3954            encoder: &mut fidl::encoding::Encoder<
3955                '_,
3956                fidl::encoding::DefaultFuchsiaResourceDialect,
3957            >,
3958            offset: usize,
3959            _depth: fidl::encoding::Depth,
3960        ) -> fidl::Result<()> {
3961            encoder.debug_check_bounds::<PushEventProtocolPushEventSameRightsRequest>(offset);
3962            // Delegate to tuple encoding.
3963            fidl::encoding::Encode::<
3964                PushEventProtocolPushEventSameRightsRequest,
3965                fidl::encoding::DefaultFuchsiaResourceDialect,
3966            >::encode(
3967                (<fidl::encoding::HandleType<
3968                    fidl::Event,
3969                    { fidl::ObjectType::EVENT.into_raw() },
3970                    2147483648,
3971                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3972                    &mut self.h
3973                ),),
3974                encoder,
3975                offset,
3976                _depth,
3977            )
3978        }
3979    }
3980    unsafe impl<
3981            T0: fidl::encoding::Encode<
3982                fidl::encoding::HandleType<
3983                    fidl::Event,
3984                    { fidl::ObjectType::EVENT.into_raw() },
3985                    2147483648,
3986                >,
3987                fidl::encoding::DefaultFuchsiaResourceDialect,
3988            >,
3989        >
3990        fidl::encoding::Encode<
3991            PushEventProtocolPushEventSameRightsRequest,
3992            fidl::encoding::DefaultFuchsiaResourceDialect,
3993        > for (T0,)
3994    {
3995        #[inline]
3996        unsafe fn encode(
3997            self,
3998            encoder: &mut fidl::encoding::Encoder<
3999                '_,
4000                fidl::encoding::DefaultFuchsiaResourceDialect,
4001            >,
4002            offset: usize,
4003            depth: fidl::encoding::Depth,
4004        ) -> fidl::Result<()> {
4005            encoder.debug_check_bounds::<PushEventProtocolPushEventSameRightsRequest>(offset);
4006            // Zero out padding regions. There's no need to apply masks
4007            // because the unmasked parts will be overwritten by fields.
4008            // Write the fields.
4009            self.0.encode(encoder, offset + 0, depth)?;
4010            Ok(())
4011        }
4012    }
4013
4014    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4015        for PushEventProtocolPushEventSameRightsRequest
4016    {
4017        #[inline(always)]
4018        fn new_empty() -> Self {
4019            Self {
4020                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4021            }
4022        }
4023
4024        #[inline]
4025        unsafe fn decode(
4026            &mut self,
4027            decoder: &mut fidl::encoding::Decoder<
4028                '_,
4029                fidl::encoding::DefaultFuchsiaResourceDialect,
4030            >,
4031            offset: usize,
4032            _depth: fidl::encoding::Depth,
4033        ) -> fidl::Result<()> {
4034            decoder.debug_check_bounds::<Self>(offset);
4035            // Verify that padding bytes are zero.
4036            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
4037            Ok(())
4038        }
4039    }
4040
4041    impl fidl::encoding::ResourceTypeMarker for SendHandleProtocolSendHandleReducedRightsRequest {
4042        type Borrowed<'a> = &'a mut Self;
4043        fn take_or_borrow<'a>(
4044            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4045        ) -> Self::Borrowed<'a> {
4046            value
4047        }
4048    }
4049
4050    unsafe impl fidl::encoding::TypeMarker for SendHandleProtocolSendHandleReducedRightsRequest {
4051        type Owned = Self;
4052
4053        #[inline(always)]
4054        fn inline_align(_context: fidl::encoding::Context) -> usize {
4055            4
4056        }
4057
4058        #[inline(always)]
4059        fn inline_size(_context: fidl::encoding::Context) -> usize {
4060            4
4061        }
4062    }
4063
4064    unsafe impl
4065        fidl::encoding::Encode<
4066            SendHandleProtocolSendHandleReducedRightsRequest,
4067            fidl::encoding::DefaultFuchsiaResourceDialect,
4068        > for &mut SendHandleProtocolSendHandleReducedRightsRequest
4069    {
4070        #[inline]
4071        unsafe fn encode(
4072            self,
4073            encoder: &mut fidl::encoding::Encoder<
4074                '_,
4075                fidl::encoding::DefaultFuchsiaResourceDialect,
4076            >,
4077            offset: usize,
4078            _depth: fidl::encoding::Depth,
4079        ) -> fidl::Result<()> {
4080            encoder.debug_check_bounds::<SendHandleProtocolSendHandleReducedRightsRequest>(offset);
4081            // Delegate to tuple encoding.
4082            fidl::encoding::Encode::<
4083                SendHandleProtocolSendHandleReducedRightsRequest,
4084                fidl::encoding::DefaultFuchsiaResourceDialect,
4085            >::encode(
4086                (<fidl::encoding::HandleType<
4087                    fidl::Event,
4088                    { fidl::ObjectType::EVENT.into_raw() },
4089                    2,
4090                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4091                    &mut self.h
4092                ),),
4093                encoder,
4094                offset,
4095                _depth,
4096            )
4097        }
4098    }
4099    unsafe impl<
4100            T0: fidl::encoding::Encode<
4101                fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>,
4102                fidl::encoding::DefaultFuchsiaResourceDialect,
4103            >,
4104        >
4105        fidl::encoding::Encode<
4106            SendHandleProtocolSendHandleReducedRightsRequest,
4107            fidl::encoding::DefaultFuchsiaResourceDialect,
4108        > for (T0,)
4109    {
4110        #[inline]
4111        unsafe fn encode(
4112            self,
4113            encoder: &mut fidl::encoding::Encoder<
4114                '_,
4115                fidl::encoding::DefaultFuchsiaResourceDialect,
4116            >,
4117            offset: usize,
4118            depth: fidl::encoding::Depth,
4119        ) -> fidl::Result<()> {
4120            encoder.debug_check_bounds::<SendHandleProtocolSendHandleReducedRightsRequest>(offset);
4121            // Zero out padding regions. There's no need to apply masks
4122            // because the unmasked parts will be overwritten by fields.
4123            // Write the fields.
4124            self.0.encode(encoder, offset + 0, depth)?;
4125            Ok(())
4126        }
4127    }
4128
4129    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4130        for SendHandleProtocolSendHandleReducedRightsRequest
4131    {
4132        #[inline(always)]
4133        fn new_empty() -> Self {
4134            Self {
4135                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
4136            }
4137        }
4138
4139        #[inline]
4140        unsafe fn decode(
4141            &mut self,
4142            decoder: &mut fidl::encoding::Decoder<
4143                '_,
4144                fidl::encoding::DefaultFuchsiaResourceDialect,
4145            >,
4146            offset: usize,
4147            _depth: fidl::encoding::Depth,
4148        ) -> fidl::Result<()> {
4149            decoder.debug_check_bounds::<Self>(offset);
4150            // Verify that padding bytes are zero.
4151            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
4152            Ok(())
4153        }
4154    }
4155
4156    impl fidl::encoding::ResourceTypeMarker for SendHandleProtocolSendHandleSameRightsRequest {
4157        type Borrowed<'a> = &'a mut Self;
4158        fn take_or_borrow<'a>(
4159            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4160        ) -> Self::Borrowed<'a> {
4161            value
4162        }
4163    }
4164
4165    unsafe impl fidl::encoding::TypeMarker for SendHandleProtocolSendHandleSameRightsRequest {
4166        type Owned = Self;
4167
4168        #[inline(always)]
4169        fn inline_align(_context: fidl::encoding::Context) -> usize {
4170            4
4171        }
4172
4173        #[inline(always)]
4174        fn inline_size(_context: fidl::encoding::Context) -> usize {
4175            4
4176        }
4177    }
4178
4179    unsafe impl
4180        fidl::encoding::Encode<
4181            SendHandleProtocolSendHandleSameRightsRequest,
4182            fidl::encoding::DefaultFuchsiaResourceDialect,
4183        > for &mut SendHandleProtocolSendHandleSameRightsRequest
4184    {
4185        #[inline]
4186        unsafe fn encode(
4187            self,
4188            encoder: &mut fidl::encoding::Encoder<
4189                '_,
4190                fidl::encoding::DefaultFuchsiaResourceDialect,
4191            >,
4192            offset: usize,
4193            _depth: fidl::encoding::Depth,
4194        ) -> fidl::Result<()> {
4195            encoder.debug_check_bounds::<SendHandleProtocolSendHandleSameRightsRequest>(offset);
4196            // Delegate to tuple encoding.
4197            fidl::encoding::Encode::<
4198                SendHandleProtocolSendHandleSameRightsRequest,
4199                fidl::encoding::DefaultFuchsiaResourceDialect,
4200            >::encode(
4201                (<fidl::encoding::HandleType<
4202                    fidl::Event,
4203                    { fidl::ObjectType::EVENT.into_raw() },
4204                    2147483648,
4205                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4206                    &mut self.h
4207                ),),
4208                encoder,
4209                offset,
4210                _depth,
4211            )
4212        }
4213    }
4214    unsafe impl<
4215            T0: fidl::encoding::Encode<
4216                fidl::encoding::HandleType<
4217                    fidl::Event,
4218                    { fidl::ObjectType::EVENT.into_raw() },
4219                    2147483648,
4220                >,
4221                fidl::encoding::DefaultFuchsiaResourceDialect,
4222            >,
4223        >
4224        fidl::encoding::Encode<
4225            SendHandleProtocolSendHandleSameRightsRequest,
4226            fidl::encoding::DefaultFuchsiaResourceDialect,
4227        > for (T0,)
4228    {
4229        #[inline]
4230        unsafe fn encode(
4231            self,
4232            encoder: &mut fidl::encoding::Encoder<
4233                '_,
4234                fidl::encoding::DefaultFuchsiaResourceDialect,
4235            >,
4236            offset: usize,
4237            depth: fidl::encoding::Depth,
4238        ) -> fidl::Result<()> {
4239            encoder.debug_check_bounds::<SendHandleProtocolSendHandleSameRightsRequest>(offset);
4240            // Zero out padding regions. There's no need to apply masks
4241            // because the unmasked parts will be overwritten by fields.
4242            // Write the fields.
4243            self.0.encode(encoder, offset + 0, depth)?;
4244            Ok(())
4245        }
4246    }
4247
4248    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4249        for SendHandleProtocolSendHandleSameRightsRequest
4250    {
4251        #[inline(always)]
4252        fn new_empty() -> Self {
4253            Self {
4254                h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4255            }
4256        }
4257
4258        #[inline]
4259        unsafe fn decode(
4260            &mut self,
4261            decoder: &mut fidl::encoding::Decoder<
4262                '_,
4263                fidl::encoding::DefaultFuchsiaResourceDialect,
4264            >,
4265            offset: usize,
4266            _depth: fidl::encoding::Depth,
4267        ) -> fidl::Result<()> {
4268            decoder.debug_check_bounds::<Self>(offset);
4269            // Verify that padding bytes are zero.
4270            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
4271            Ok(())
4272        }
4273    }
4274
4275    impl fidl::encoding::ResourceTypeMarker for StructWithHandles {
4276        type Borrowed<'a> = &'a mut Self;
4277        fn take_or_borrow<'a>(
4278            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4279        ) -> Self::Borrowed<'a> {
4280            value
4281        }
4282    }
4283
4284    unsafe impl fidl::encoding::TypeMarker for StructWithHandles {
4285        type Owned = Self;
4286
4287        #[inline(always)]
4288        fn inline_align(_context: fidl::encoding::Context) -> usize {
4289            8
4290        }
4291
4292        #[inline(always)]
4293        fn inline_size(_context: fidl::encoding::Context) -> usize {
4294            16
4295        }
4296    }
4297
4298    unsafe impl
4299        fidl::encoding::Encode<StructWithHandles, fidl::encoding::DefaultFuchsiaResourceDialect>
4300        for &mut StructWithHandles
4301    {
4302        #[inline]
4303        unsafe fn encode(
4304            self,
4305            encoder: &mut fidl::encoding::Encoder<
4306                '_,
4307                fidl::encoding::DefaultFuchsiaResourceDialect,
4308            >,
4309            offset: usize,
4310            _depth: fidl::encoding::Depth,
4311        ) -> fidl::Result<()> {
4312            encoder.debug_check_bounds::<StructWithHandles>(offset);
4313            // Delegate to tuple encoding.
4314            fidl::encoding::Encode::<StructWithHandles, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4315                (
4316                    <fidl::encoding::UnboundedVector<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.v),
4317                ),
4318                encoder, offset, _depth
4319            )
4320        }
4321    }
4322    unsafe impl<
4323            T0: fidl::encoding::Encode<
4324                fidl::encoding::UnboundedVector<
4325                    fidl::encoding::HandleType<
4326                        fidl::Channel,
4327                        { fidl::ObjectType::CHANNEL.into_raw() },
4328                        2147483648,
4329                    >,
4330                >,
4331                fidl::encoding::DefaultFuchsiaResourceDialect,
4332            >,
4333        >
4334        fidl::encoding::Encode<StructWithHandles, fidl::encoding::DefaultFuchsiaResourceDialect>
4335        for (T0,)
4336    {
4337        #[inline]
4338        unsafe fn encode(
4339            self,
4340            encoder: &mut fidl::encoding::Encoder<
4341                '_,
4342                fidl::encoding::DefaultFuchsiaResourceDialect,
4343            >,
4344            offset: usize,
4345            depth: fidl::encoding::Depth,
4346        ) -> fidl::Result<()> {
4347            encoder.debug_check_bounds::<StructWithHandles>(offset);
4348            // Zero out padding regions. There's no need to apply masks
4349            // because the unmasked parts will be overwritten by fields.
4350            // Write the fields.
4351            self.0.encode(encoder, offset + 0, depth)?;
4352            Ok(())
4353        }
4354    }
4355
4356    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4357        for StructWithHandles
4358    {
4359        #[inline(always)]
4360        fn new_empty() -> Self {
4361            Self {
4362                v: fidl::new_empty!(
4363                    fidl::encoding::UnboundedVector<
4364                        fidl::encoding::HandleType<
4365                            fidl::Channel,
4366                            { fidl::ObjectType::CHANNEL.into_raw() },
4367                            2147483648,
4368                        >,
4369                    >,
4370                    fidl::encoding::DefaultFuchsiaResourceDialect
4371                ),
4372            }
4373        }
4374
4375        #[inline]
4376        unsafe fn decode(
4377            &mut self,
4378            decoder: &mut fidl::encoding::Decoder<
4379                '_,
4380                fidl::encoding::DefaultFuchsiaResourceDialect,
4381            >,
4382            offset: usize,
4383            _depth: fidl::encoding::Depth,
4384        ) -> fidl::Result<()> {
4385            decoder.debug_check_bounds::<Self>(offset);
4386            // Verify that padding bytes are zero.
4387            fidl::decode!(
4388                fidl::encoding::UnboundedVector<
4389                    fidl::encoding::HandleType<
4390                        fidl::Channel,
4391                        { fidl::ObjectType::CHANNEL.into_raw() },
4392                        2147483648,
4393                    >,
4394                >,
4395                fidl::encoding::DefaultFuchsiaResourceDialect,
4396                &mut self.v,
4397                decoder,
4398                offset + 0,
4399                _depth
4400            )?;
4401            Ok(())
4402        }
4403    }
4404
4405    impl ResourceRecord {
4406        #[inline(always)]
4407        fn max_ordinal_present(&self) -> u64 {
4408            if let Some(_) = self.age {
4409                return 2;
4410            }
4411            if let Some(_) = self.name {
4412                return 1;
4413            }
4414            0
4415        }
4416    }
4417
4418    impl fidl::encoding::ResourceTypeMarker for ResourceRecord {
4419        type Borrowed<'a> = &'a mut Self;
4420        fn take_or_borrow<'a>(
4421            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4422        ) -> Self::Borrowed<'a> {
4423            value
4424        }
4425    }
4426
4427    unsafe impl fidl::encoding::TypeMarker for ResourceRecord {
4428        type Owned = Self;
4429
4430        #[inline(always)]
4431        fn inline_align(_context: fidl::encoding::Context) -> usize {
4432            8
4433        }
4434
4435        #[inline(always)]
4436        fn inline_size(_context: fidl::encoding::Context) -> usize {
4437            16
4438        }
4439    }
4440
4441    unsafe impl
4442        fidl::encoding::Encode<ResourceRecord, fidl::encoding::DefaultFuchsiaResourceDialect>
4443        for &mut ResourceRecord
4444    {
4445        unsafe fn encode(
4446            self,
4447            encoder: &mut fidl::encoding::Encoder<
4448                '_,
4449                fidl::encoding::DefaultFuchsiaResourceDialect,
4450            >,
4451            offset: usize,
4452            mut depth: fidl::encoding::Depth,
4453        ) -> fidl::Result<()> {
4454            encoder.debug_check_bounds::<ResourceRecord>(offset);
4455            // Vector header
4456            let max_ordinal: u64 = self.max_ordinal_present();
4457            encoder.write_num(max_ordinal, offset);
4458            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4459            // Calling encoder.out_of_line_offset(0) is not allowed.
4460            if max_ordinal == 0 {
4461                return Ok(());
4462            }
4463            depth.increment()?;
4464            let envelope_size = 8;
4465            let bytes_len = max_ordinal as usize * envelope_size;
4466            #[allow(unused_variables)]
4467            let offset = encoder.out_of_line_offset(bytes_len);
4468            let mut _prev_end_offset: usize = 0;
4469            if 1 > max_ordinal {
4470                return Ok(());
4471            }
4472
4473            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4474            // are envelope_size bytes.
4475            let cur_offset: usize = (1 - 1) * envelope_size;
4476
4477            // Zero reserved fields.
4478            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4479
4480            // Safety:
4481            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4482            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4483            //   envelope_size bytes, there is always sufficient room.
4484            fidl::encoding::encode_in_envelope_optional::<
4485                fidl::encoding::UnboundedString,
4486                fidl::encoding::DefaultFuchsiaResourceDialect,
4487            >(
4488                self.name.as_ref().map(
4489                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4490                ),
4491                encoder,
4492                offset + cur_offset,
4493                depth,
4494            )?;
4495
4496            _prev_end_offset = cur_offset + envelope_size;
4497            if 2 > max_ordinal {
4498                return Ok(());
4499            }
4500
4501            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4502            // are envelope_size bytes.
4503            let cur_offset: usize = (2 - 1) * envelope_size;
4504
4505            // Zero reserved fields.
4506            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4507
4508            // Safety:
4509            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4510            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4511            //   envelope_size bytes, there is always sufficient room.
4512            fidl::encoding::encode_in_envelope_optional::<
4513                u8,
4514                fidl::encoding::DefaultFuchsiaResourceDialect,
4515            >(
4516                self.age.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4517                encoder,
4518                offset + cur_offset,
4519                depth,
4520            )?;
4521
4522            _prev_end_offset = cur_offset + envelope_size;
4523
4524            Ok(())
4525        }
4526    }
4527
4528    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4529        for ResourceRecord
4530    {
4531        #[inline(always)]
4532        fn new_empty() -> Self {
4533            Self::default()
4534        }
4535
4536        unsafe fn decode(
4537            &mut self,
4538            decoder: &mut fidl::encoding::Decoder<
4539                '_,
4540                fidl::encoding::DefaultFuchsiaResourceDialect,
4541            >,
4542            offset: usize,
4543            mut depth: fidl::encoding::Depth,
4544        ) -> fidl::Result<()> {
4545            decoder.debug_check_bounds::<Self>(offset);
4546            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4547                None => return Err(fidl::Error::NotNullable),
4548                Some(len) => len,
4549            };
4550            // Calling decoder.out_of_line_offset(0) is not allowed.
4551            if len == 0 {
4552                return Ok(());
4553            };
4554            depth.increment()?;
4555            let envelope_size = 8;
4556            let bytes_len = len * envelope_size;
4557            let offset = decoder.out_of_line_offset(bytes_len)?;
4558            // Decode the envelope for each type.
4559            let mut _next_ordinal_to_read = 0;
4560            let mut next_offset = offset;
4561            let end_offset = offset + bytes_len;
4562            _next_ordinal_to_read += 1;
4563            if next_offset >= end_offset {
4564                return Ok(());
4565            }
4566
4567            // Decode unknown envelopes for gaps in ordinals.
4568            while _next_ordinal_to_read < 1 {
4569                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4570                _next_ordinal_to_read += 1;
4571                next_offset += envelope_size;
4572            }
4573
4574            let next_out_of_line = decoder.next_out_of_line();
4575            let handles_before = decoder.remaining_handles();
4576            if let Some((inlined, num_bytes, num_handles)) =
4577                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4578            {
4579                let member_inline_size =
4580                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4581                        decoder.context,
4582                    );
4583                if inlined != (member_inline_size <= 4) {
4584                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4585                }
4586                let inner_offset;
4587                let mut inner_depth = depth.clone();
4588                if inlined {
4589                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4590                    inner_offset = next_offset;
4591                } else {
4592                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4593                    inner_depth.increment()?;
4594                }
4595                let val_ref = self.name.get_or_insert_with(|| {
4596                    fidl::new_empty!(
4597                        fidl::encoding::UnboundedString,
4598                        fidl::encoding::DefaultFuchsiaResourceDialect
4599                    )
4600                });
4601                fidl::decode!(
4602                    fidl::encoding::UnboundedString,
4603                    fidl::encoding::DefaultFuchsiaResourceDialect,
4604                    val_ref,
4605                    decoder,
4606                    inner_offset,
4607                    inner_depth
4608                )?;
4609                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4610                {
4611                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4612                }
4613                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4614                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4615                }
4616            }
4617
4618            next_offset += envelope_size;
4619            _next_ordinal_to_read += 1;
4620            if next_offset >= end_offset {
4621                return Ok(());
4622            }
4623
4624            // Decode unknown envelopes for gaps in ordinals.
4625            while _next_ordinal_to_read < 2 {
4626                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4627                _next_ordinal_to_read += 1;
4628                next_offset += envelope_size;
4629            }
4630
4631            let next_out_of_line = decoder.next_out_of_line();
4632            let handles_before = decoder.remaining_handles();
4633            if let Some((inlined, num_bytes, num_handles)) =
4634                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4635            {
4636                let member_inline_size =
4637                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4638                if inlined != (member_inline_size <= 4) {
4639                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4640                }
4641                let inner_offset;
4642                let mut inner_depth = depth.clone();
4643                if inlined {
4644                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4645                    inner_offset = next_offset;
4646                } else {
4647                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4648                    inner_depth.increment()?;
4649                }
4650                let val_ref = self.age.get_or_insert_with(|| {
4651                    fidl::new_empty!(u8, fidl::encoding::DefaultFuchsiaResourceDialect)
4652                });
4653                fidl::decode!(
4654                    u8,
4655                    fidl::encoding::DefaultFuchsiaResourceDialect,
4656                    val_ref,
4657                    decoder,
4658                    inner_offset,
4659                    inner_depth
4660                )?;
4661                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4662                {
4663                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4664                }
4665                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4666                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4667                }
4668            }
4669
4670            next_offset += envelope_size;
4671
4672            // Decode the remaining unknown envelopes.
4673            while next_offset < end_offset {
4674                _next_ordinal_to_read += 1;
4675                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4676                next_offset += envelope_size;
4677            }
4678
4679            Ok(())
4680        }
4681    }
4682
4683    impl fidl::encoding::ResourceTypeMarker for FlexibleResourceThing {
4684        type Borrowed<'a> = &'a mut Self;
4685        fn take_or_borrow<'a>(
4686            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4687        ) -> Self::Borrowed<'a> {
4688            value
4689        }
4690    }
4691
4692    unsafe impl fidl::encoding::TypeMarker for FlexibleResourceThing {
4693        type Owned = Self;
4694
4695        #[inline(always)]
4696        fn inline_align(_context: fidl::encoding::Context) -> usize {
4697            8
4698        }
4699
4700        #[inline(always)]
4701        fn inline_size(_context: fidl::encoding::Context) -> usize {
4702            16
4703        }
4704    }
4705
4706    unsafe impl
4707        fidl::encoding::Encode<FlexibleResourceThing, fidl::encoding::DefaultFuchsiaResourceDialect>
4708        for &mut FlexibleResourceThing
4709    {
4710        #[inline]
4711        unsafe fn encode(
4712            self,
4713            encoder: &mut fidl::encoding::Encoder<
4714                '_,
4715                fidl::encoding::DefaultFuchsiaResourceDialect,
4716            >,
4717            offset: usize,
4718            _depth: fidl::encoding::Depth,
4719        ) -> fidl::Result<()> {
4720            encoder.debug_check_bounds::<FlexibleResourceThing>(offset);
4721            encoder.write_num::<u64>(self.ordinal(), offset);
4722            match self {
4723                FlexibleResourceThing::Number(ref val) => fidl::encoding::encode_in_envelope::<
4724                    u32,
4725                    fidl::encoding::DefaultFuchsiaResourceDialect,
4726                >(
4727                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
4728                    encoder,
4729                    offset + 8,
4730                    _depth,
4731                ),
4732                FlexibleResourceThing::Name(ref val) => fidl::encoding::encode_in_envelope::<
4733                    fidl::encoding::UnboundedString,
4734                    fidl::encoding::DefaultFuchsiaResourceDialect,
4735                >(
4736                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
4737                        val,
4738                    ),
4739                    encoder,
4740                    offset + 8,
4741                    _depth,
4742                ),
4743                FlexibleResourceThing::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
4744            }
4745        }
4746    }
4747
4748    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4749        for FlexibleResourceThing
4750    {
4751        #[inline(always)]
4752        fn new_empty() -> Self {
4753            Self::__SourceBreaking { unknown_ordinal: 0 }
4754        }
4755
4756        #[inline]
4757        unsafe fn decode(
4758            &mut self,
4759            decoder: &mut fidl::encoding::Decoder<
4760                '_,
4761                fidl::encoding::DefaultFuchsiaResourceDialect,
4762            >,
4763            offset: usize,
4764            mut depth: fidl::encoding::Depth,
4765        ) -> fidl::Result<()> {
4766            decoder.debug_check_bounds::<Self>(offset);
4767            #[allow(unused_variables)]
4768            let next_out_of_line = decoder.next_out_of_line();
4769            let handles_before = decoder.remaining_handles();
4770            let (ordinal, inlined, num_bytes, num_handles) =
4771                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4772
4773            let member_inline_size = match ordinal {
4774                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4775                2 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4776                    decoder.context,
4777                ),
4778                0 => return Err(fidl::Error::UnknownUnionTag),
4779                _ => num_bytes as usize,
4780            };
4781
4782            if inlined != (member_inline_size <= 4) {
4783                return Err(fidl::Error::InvalidInlineBitInEnvelope);
4784            }
4785            let _inner_offset;
4786            if inlined {
4787                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4788                _inner_offset = offset + 8;
4789            } else {
4790                depth.increment()?;
4791                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4792            }
4793            match ordinal {
4794                1 => {
4795                    #[allow(irrefutable_let_patterns)]
4796                    if let FlexibleResourceThing::Number(_) = self {
4797                        // Do nothing, read the value into the object
4798                    } else {
4799                        // Initialize `self` to the right variant
4800                        *self = FlexibleResourceThing::Number(fidl::new_empty!(
4801                            u32,
4802                            fidl::encoding::DefaultFuchsiaResourceDialect
4803                        ));
4804                    }
4805                    #[allow(irrefutable_let_patterns)]
4806                    if let FlexibleResourceThing::Number(ref mut val) = self {
4807                        fidl::decode!(
4808                            u32,
4809                            fidl::encoding::DefaultFuchsiaResourceDialect,
4810                            val,
4811                            decoder,
4812                            _inner_offset,
4813                            depth
4814                        )?;
4815                    } else {
4816                        unreachable!()
4817                    }
4818                }
4819                2 => {
4820                    #[allow(irrefutable_let_patterns)]
4821                    if let FlexibleResourceThing::Name(_) = self {
4822                        // Do nothing, read the value into the object
4823                    } else {
4824                        // Initialize `self` to the right variant
4825                        *self = FlexibleResourceThing::Name(fidl::new_empty!(
4826                            fidl::encoding::UnboundedString,
4827                            fidl::encoding::DefaultFuchsiaResourceDialect
4828                        ));
4829                    }
4830                    #[allow(irrefutable_let_patterns)]
4831                    if let FlexibleResourceThing::Name(ref mut val) = self {
4832                        fidl::decode!(
4833                            fidl::encoding::UnboundedString,
4834                            fidl::encoding::DefaultFuchsiaResourceDialect,
4835                            val,
4836                            decoder,
4837                            _inner_offset,
4838                            depth
4839                        )?;
4840                    } else {
4841                        unreachable!()
4842                    }
4843                }
4844                #[allow(deprecated)]
4845                ordinal => {
4846                    for _ in 0..num_handles {
4847                        decoder.drop_next_handle()?;
4848                    }
4849                    *self = FlexibleResourceThing::__SourceBreaking { unknown_ordinal: ordinal };
4850                }
4851            }
4852            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4853                return Err(fidl::Error::InvalidNumBytesInEnvelope);
4854            }
4855            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4856                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4857            }
4858            Ok(())
4859        }
4860    }
4861
4862    impl fidl::encoding::ResourceTypeMarker for StrictResourceThing {
4863        type Borrowed<'a> = &'a mut Self;
4864        fn take_or_borrow<'a>(
4865            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4866        ) -> Self::Borrowed<'a> {
4867            value
4868        }
4869    }
4870
4871    unsafe impl fidl::encoding::TypeMarker for StrictResourceThing {
4872        type Owned = Self;
4873
4874        #[inline(always)]
4875        fn inline_align(_context: fidl::encoding::Context) -> usize {
4876            8
4877        }
4878
4879        #[inline(always)]
4880        fn inline_size(_context: fidl::encoding::Context) -> usize {
4881            16
4882        }
4883    }
4884
4885    unsafe impl
4886        fidl::encoding::Encode<StrictResourceThing, fidl::encoding::DefaultFuchsiaResourceDialect>
4887        for &mut StrictResourceThing
4888    {
4889        #[inline]
4890        unsafe fn encode(
4891            self,
4892            encoder: &mut fidl::encoding::Encoder<
4893                '_,
4894                fidl::encoding::DefaultFuchsiaResourceDialect,
4895            >,
4896            offset: usize,
4897            _depth: fidl::encoding::Depth,
4898        ) -> fidl::Result<()> {
4899            encoder.debug_check_bounds::<StrictResourceThing>(offset);
4900            encoder.write_num::<u64>(self.ordinal(), offset);
4901            match self {
4902                StrictResourceThing::Number(ref val) => fidl::encoding::encode_in_envelope::<
4903                    u32,
4904                    fidl::encoding::DefaultFuchsiaResourceDialect,
4905                >(
4906                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
4907                    encoder,
4908                    offset + 8,
4909                    _depth,
4910                ),
4911                StrictResourceThing::Name(ref val) => fidl::encoding::encode_in_envelope::<
4912                    fidl::encoding::UnboundedString,
4913                    fidl::encoding::DefaultFuchsiaResourceDialect,
4914                >(
4915                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
4916                        val,
4917                    ),
4918                    encoder,
4919                    offset + 8,
4920                    _depth,
4921                ),
4922            }
4923        }
4924    }
4925
4926    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4927        for StrictResourceThing
4928    {
4929        #[inline(always)]
4930        fn new_empty() -> Self {
4931            Self::Number(fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect))
4932        }
4933
4934        #[inline]
4935        unsafe fn decode(
4936            &mut self,
4937            decoder: &mut fidl::encoding::Decoder<
4938                '_,
4939                fidl::encoding::DefaultFuchsiaResourceDialect,
4940            >,
4941            offset: usize,
4942            mut depth: fidl::encoding::Depth,
4943        ) -> fidl::Result<()> {
4944            decoder.debug_check_bounds::<Self>(offset);
4945            #[allow(unused_variables)]
4946            let next_out_of_line = decoder.next_out_of_line();
4947            let handles_before = decoder.remaining_handles();
4948            let (ordinal, inlined, num_bytes, num_handles) =
4949                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4950
4951            let member_inline_size = match ordinal {
4952                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4953                2 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4954                    decoder.context,
4955                ),
4956                _ => return Err(fidl::Error::UnknownUnionTag),
4957            };
4958
4959            if inlined != (member_inline_size <= 4) {
4960                return Err(fidl::Error::InvalidInlineBitInEnvelope);
4961            }
4962            let _inner_offset;
4963            if inlined {
4964                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4965                _inner_offset = offset + 8;
4966            } else {
4967                depth.increment()?;
4968                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4969            }
4970            match ordinal {
4971                1 => {
4972                    #[allow(irrefutable_let_patterns)]
4973                    if let StrictResourceThing::Number(_) = self {
4974                        // Do nothing, read the value into the object
4975                    } else {
4976                        // Initialize `self` to the right variant
4977                        *self = StrictResourceThing::Number(fidl::new_empty!(
4978                            u32,
4979                            fidl::encoding::DefaultFuchsiaResourceDialect
4980                        ));
4981                    }
4982                    #[allow(irrefutable_let_patterns)]
4983                    if let StrictResourceThing::Number(ref mut val) = self {
4984                        fidl::decode!(
4985                            u32,
4986                            fidl::encoding::DefaultFuchsiaResourceDialect,
4987                            val,
4988                            decoder,
4989                            _inner_offset,
4990                            depth
4991                        )?;
4992                    } else {
4993                        unreachable!()
4994                    }
4995                }
4996                2 => {
4997                    #[allow(irrefutable_let_patterns)]
4998                    if let StrictResourceThing::Name(_) = self {
4999                        // Do nothing, read the value into the object
5000                    } else {
5001                        // Initialize `self` to the right variant
5002                        *self = StrictResourceThing::Name(fidl::new_empty!(
5003                            fidl::encoding::UnboundedString,
5004                            fidl::encoding::DefaultFuchsiaResourceDialect
5005                        ));
5006                    }
5007                    #[allow(irrefutable_let_patterns)]
5008                    if let StrictResourceThing::Name(ref mut val) = self {
5009                        fidl::decode!(
5010                            fidl::encoding::UnboundedString,
5011                            fidl::encoding::DefaultFuchsiaResourceDialect,
5012                            val,
5013                            decoder,
5014                            _inner_offset,
5015                            depth
5016                        )?;
5017                    } else {
5018                        unreachable!()
5019                    }
5020                }
5021                ordinal => panic!("unexpected ordinal {:?}", ordinal),
5022            }
5023            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5024                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5025            }
5026            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5027                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5028            }
5029            Ok(())
5030        }
5031    }
5032}