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