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_fuchsia_starnix_binder_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct BinderSetVmoRequest {
16 pub vmo: fidl::Vmo,
17 pub mapped_address: u64,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BinderSetVmoRequest {}
21
22#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
23pub struct ProcessAccessorWriteMemoryRequest {
24 pub address: u64,
25 pub content: fidl::Vmo,
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
29 for ProcessAccessorWriteMemoryRequest
30{
31}
32
33#[derive(Debug, Default, PartialEq)]
34pub struct ContainerPowerControllerRegisterWakeWatcherRequest {
35 pub watcher: Option<fidl::EventPair>,
36 #[doc(hidden)]
37 pub __source_breaking: fidl::marker::SourceBreaking,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41 for ContainerPowerControllerRegisterWakeWatcherRequest
42{
43}
44
45#[derive(Debug, Default, PartialEq)]
46pub struct ContainerPowerControllerWakeRequest {
47 pub power_baton: Option<fidl::Handle>,
51 pub wake_lock: Option<fidl::EventPair>,
57 #[doc(hidden)]
58 pub __source_breaking: fidl::marker::SourceBreaking,
59}
60
61impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
62 for ContainerPowerControllerWakeRequest
63{
64}
65
66#[derive(Debug, Default, PartialEq)]
67pub struct DevBinderCloseRequest {
68 pub binder: Option<fidl::endpoints::ClientEnd<BinderMarker>>,
70 #[doc(hidden)]
71 pub __source_breaking: fidl::marker::SourceBreaking,
72}
73
74impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DevBinderCloseRequest {}
75
76#[derive(Debug, Default, PartialEq)]
77pub struct DevBinderOpenRequest {
78 pub path: Option<Vec<u8>>,
81 pub process_accessor: Option<fidl::endpoints::ClientEnd<ProcessAccessorMarker>>,
83 pub process: Option<fidl::Process>,
87 pub binder: Option<fidl::endpoints::ServerEnd<BinderMarker>>,
90 #[doc(hidden)]
91 pub __source_breaking: fidl::marker::SourceBreaking,
92}
93
94impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DevBinderOpenRequest {}
95
96#[derive(Debug, Default, PartialEq)]
99pub struct FileHandle {
100 pub file: Option<fidl::Handle>,
104 pub flags: Option<FileFlags>,
106 #[doc(hidden)]
107 pub __source_breaking: fidl::marker::SourceBreaking,
108}
109
110impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileHandle {}
111
112#[derive(Debug, Default, PartialEq)]
113pub struct FileRequest {
114 pub close_requests: Option<Vec<i32>>,
116 pub get_requests: Option<Vec<i32>>,
119 pub add_requests: Option<Vec<FileHandle>>,
122 #[doc(hidden)]
123 pub __source_breaking: fidl::marker::SourceBreaking,
124}
125
126impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileRequest {}
127
128#[derive(Debug, Default, PartialEq)]
129pub struct FileResponse {
130 pub get_responses: Option<Vec<FileHandle>>,
132 pub add_responses: Option<Vec<i32>>,
134 #[doc(hidden)]
135 pub __source_breaking: fidl::marker::SourceBreaking,
136}
137
138impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileResponse {}
139
140#[derive(Debug, Default, PartialEq)]
141pub struct RemoteControllerStartRequest {
142 pub dev_binder: Option<fidl::endpoints::ClientEnd<DevBinderMarker>>,
143 pub lutex_controller: Option<fidl::endpoints::ClientEnd<LutexControllerMarker>>,
144 pub container_power_controller:
145 Option<fidl::endpoints::ClientEnd<ContainerPowerControllerMarker>>,
146 #[doc(hidden)]
147 pub __source_breaking: fidl::marker::SourceBreaking,
148}
149
150impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
151 for RemoteControllerStartRequest
152{
153}
154
155#[derive(Debug, Default, PartialEq)]
156pub struct UnixDomainSocketWriteRequest {
157 pub data: Option<Vec<u8>>,
158 pub handles: Option<Vec<fidl::Handle>>,
159 #[doc(hidden)]
160 pub __source_breaking: fidl::marker::SourceBreaking,
161}
162
163impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
164 for UnixDomainSocketWriteRequest
165{
166}
167
168#[derive(Debug, Default, PartialEq)]
169pub struct UnixDomainSocketGetEventResponse {
170 pub event: Option<fidl::EventPair>,
171 #[doc(hidden)]
172 pub __source_breaking: fidl::marker::SourceBreaking,
173}
174
175impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
176 for UnixDomainSocketGetEventResponse
177{
178}
179
180#[derive(Debug, Default, PartialEq)]
181pub struct UnixDomainSocketReadResponse {
182 pub data: Option<Vec<u8>>,
183 pub data_original_length: Option<u64>,
184 pub handles: Option<Vec<fidl::Handle>>,
185 #[doc(hidden)]
186 pub __source_breaking: fidl::marker::SourceBreaking,
187}
188
189impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
190 for UnixDomainSocketReadResponse
191{
192}
193
194#[derive(Debug, Default, PartialEq)]
195pub struct WaitBitsetRequest {
196 pub vmo: Option<fidl::Vmo>,
199 pub offset: Option<u64>,
202 pub value: Option<u32>,
205 pub mask: Option<u32>,
208 pub deadline: Option<i64>,
211 #[doc(hidden)]
212 pub __source_breaking: fidl::marker::SourceBreaking,
213}
214
215impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WaitBitsetRequest {}
216
217#[derive(Debug, Default, PartialEq)]
218pub struct WakeBitsetRequest {
219 pub vmo: Option<fidl::Vmo>,
222 pub offset: Option<u64>,
225 pub count: Option<u32>,
228 pub mask: Option<u32>,
231 #[doc(hidden)]
232 pub __source_breaking: fidl::marker::SourceBreaking,
233}
234
235impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WakeBitsetRequest {}
236
237#[derive(Debug, Default, PartialEq)]
238pub struct WakeResponse {
239 pub count: Option<u64>,
241 #[doc(hidden)]
242 pub __source_breaking: fidl::marker::SourceBreaking,
243}
244
245impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WakeResponse {}
246
247#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
248pub struct BinderMarker;
249
250impl fidl::endpoints::ProtocolMarker for BinderMarker {
251 type Proxy = BinderProxy;
252 type RequestStream = BinderRequestStream;
253 #[cfg(target_os = "fuchsia")]
254 type SynchronousProxy = BinderSynchronousProxy;
255
256 const DEBUG_NAME: &'static str = "(anonymous) Binder";
257}
258pub type BinderIoctlResult = Result<(), fidl_fuchsia_posix::Errno>;
259
260pub trait BinderProxyInterface: Send + Sync {
261 fn r#set_vmo(&self, vmo: fidl::Vmo, mapped_address: u64) -> Result<(), fidl::Error>;
262 type IoctlResponseFut: std::future::Future<Output = Result<BinderIoctlResult, fidl::Error>>
263 + Send;
264 fn r#ioctl(&self, tid: u64, request: u32, parameter: u64) -> Self::IoctlResponseFut;
265}
266#[derive(Debug)]
267#[cfg(target_os = "fuchsia")]
268pub struct BinderSynchronousProxy {
269 client: fidl::client::sync::Client,
270}
271
272#[cfg(target_os = "fuchsia")]
273impl fidl::endpoints::SynchronousProxy for BinderSynchronousProxy {
274 type Proxy = BinderProxy;
275 type Protocol = BinderMarker;
276
277 fn from_channel(inner: fidl::Channel) -> Self {
278 Self::new(inner)
279 }
280
281 fn into_channel(self) -> fidl::Channel {
282 self.client.into_channel()
283 }
284
285 fn as_channel(&self) -> &fidl::Channel {
286 self.client.as_channel()
287 }
288}
289
290#[cfg(target_os = "fuchsia")]
291impl BinderSynchronousProxy {
292 pub fn new(channel: fidl::Channel) -> Self {
293 let protocol_name = <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
294 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
295 }
296
297 pub fn into_channel(self) -> fidl::Channel {
298 self.client.into_channel()
299 }
300
301 pub fn wait_for_event(
304 &self,
305 deadline: zx::MonotonicInstant,
306 ) -> Result<BinderEvent, fidl::Error> {
307 BinderEvent::decode(self.client.wait_for_event(deadline)?)
308 }
309
310 pub fn r#set_vmo(
314 &self,
315 mut vmo: fidl::Vmo,
316 mut mapped_address: u64,
317 ) -> Result<(), fidl::Error> {
318 self.client.send::<BinderSetVmoRequest>(
319 (vmo, mapped_address),
320 0x43ee5d8f7d3acbf6,
321 fidl::encoding::DynamicFlags::FLEXIBLE,
322 )
323 }
324
325 pub fn r#ioctl(
326 &self,
327 mut tid: u64,
328 mut request: u32,
329 mut parameter: u64,
330 ___deadline: zx::MonotonicInstant,
331 ) -> Result<BinderIoctlResult, fidl::Error> {
332 let _response = self
333 .client
334 .send_query::<BinderIoctlRequest, fidl::encoding::FlexibleResultType<
335 fidl::encoding::EmptyStruct,
336 fidl_fuchsia_posix::Errno,
337 >>(
338 (tid, request, parameter),
339 0x1032021e21310000,
340 fidl::encoding::DynamicFlags::FLEXIBLE,
341 ___deadline,
342 )?
343 .into_result::<BinderMarker>("ioctl")?;
344 Ok(_response.map(|x| x))
345 }
346}
347
348#[derive(Debug, Clone)]
349pub struct BinderProxy {
350 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
351}
352
353impl fidl::endpoints::Proxy for BinderProxy {
354 type Protocol = BinderMarker;
355
356 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
357 Self::new(inner)
358 }
359
360 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
361 self.client.into_channel().map_err(|client| Self { client })
362 }
363
364 fn as_channel(&self) -> &::fidl::AsyncChannel {
365 self.client.as_channel()
366 }
367}
368
369impl BinderProxy {
370 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
372 let protocol_name = <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
373 Self { client: fidl::client::Client::new(channel, protocol_name) }
374 }
375
376 pub fn take_event_stream(&self) -> BinderEventStream {
382 BinderEventStream { event_receiver: self.client.take_event_receiver() }
383 }
384
385 pub fn r#set_vmo(
389 &self,
390 mut vmo: fidl::Vmo,
391 mut mapped_address: u64,
392 ) -> Result<(), fidl::Error> {
393 BinderProxyInterface::r#set_vmo(self, vmo, mapped_address)
394 }
395
396 pub fn r#ioctl(
397 &self,
398 mut tid: u64,
399 mut request: u32,
400 mut parameter: u64,
401 ) -> fidl::client::QueryResponseFut<
402 BinderIoctlResult,
403 fidl::encoding::DefaultFuchsiaResourceDialect,
404 > {
405 BinderProxyInterface::r#ioctl(self, tid, request, parameter)
406 }
407}
408
409impl BinderProxyInterface for BinderProxy {
410 fn r#set_vmo(&self, mut vmo: fidl::Vmo, mut mapped_address: u64) -> Result<(), fidl::Error> {
411 self.client.send::<BinderSetVmoRequest>(
412 (vmo, mapped_address),
413 0x43ee5d8f7d3acbf6,
414 fidl::encoding::DynamicFlags::FLEXIBLE,
415 )
416 }
417
418 type IoctlResponseFut = fidl::client::QueryResponseFut<
419 BinderIoctlResult,
420 fidl::encoding::DefaultFuchsiaResourceDialect,
421 >;
422 fn r#ioctl(
423 &self,
424 mut tid: u64,
425 mut request: u32,
426 mut parameter: u64,
427 ) -> Self::IoctlResponseFut {
428 fn _decode(
429 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
430 ) -> Result<BinderIoctlResult, fidl::Error> {
431 let _response = fidl::client::decode_transaction_body::<
432 fidl::encoding::FlexibleResultType<
433 fidl::encoding::EmptyStruct,
434 fidl_fuchsia_posix::Errno,
435 >,
436 fidl::encoding::DefaultFuchsiaResourceDialect,
437 0x1032021e21310000,
438 >(_buf?)?
439 .into_result::<BinderMarker>("ioctl")?;
440 Ok(_response.map(|x| x))
441 }
442 self.client.send_query_and_decode::<BinderIoctlRequest, BinderIoctlResult>(
443 (tid, request, parameter),
444 0x1032021e21310000,
445 fidl::encoding::DynamicFlags::FLEXIBLE,
446 _decode,
447 )
448 }
449}
450
451pub struct BinderEventStream {
452 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
453}
454
455impl std::marker::Unpin for BinderEventStream {}
456
457impl futures::stream::FusedStream for BinderEventStream {
458 fn is_terminated(&self) -> bool {
459 self.event_receiver.is_terminated()
460 }
461}
462
463impl futures::Stream for BinderEventStream {
464 type Item = Result<BinderEvent, fidl::Error>;
465
466 fn poll_next(
467 mut self: std::pin::Pin<&mut Self>,
468 cx: &mut std::task::Context<'_>,
469 ) -> std::task::Poll<Option<Self::Item>> {
470 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
471 &mut self.event_receiver,
472 cx
473 )?) {
474 Some(buf) => std::task::Poll::Ready(Some(BinderEvent::decode(buf))),
475 None => std::task::Poll::Ready(None),
476 }
477 }
478}
479
480#[derive(Debug)]
481pub enum BinderEvent {
482 #[non_exhaustive]
483 _UnknownEvent {
484 ordinal: u64,
486 },
487}
488
489impl BinderEvent {
490 fn decode(
492 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
493 ) -> Result<BinderEvent, fidl::Error> {
494 let (bytes, _handles) = buf.split_mut();
495 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
496 debug_assert_eq!(tx_header.tx_id, 0);
497 match tx_header.ordinal {
498 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
499 Ok(BinderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
500 }
501 _ => Err(fidl::Error::UnknownOrdinal {
502 ordinal: tx_header.ordinal,
503 protocol_name: <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
504 }),
505 }
506 }
507}
508
509pub struct BinderRequestStream {
511 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
512 is_terminated: bool,
513}
514
515impl std::marker::Unpin for BinderRequestStream {}
516
517impl futures::stream::FusedStream for BinderRequestStream {
518 fn is_terminated(&self) -> bool {
519 self.is_terminated
520 }
521}
522
523impl fidl::endpoints::RequestStream for BinderRequestStream {
524 type Protocol = BinderMarker;
525 type ControlHandle = BinderControlHandle;
526
527 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
528 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
529 }
530
531 fn control_handle(&self) -> Self::ControlHandle {
532 BinderControlHandle { inner: self.inner.clone() }
533 }
534
535 fn into_inner(
536 self,
537 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
538 {
539 (self.inner, self.is_terminated)
540 }
541
542 fn from_inner(
543 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
544 is_terminated: bool,
545 ) -> Self {
546 Self { inner, is_terminated }
547 }
548}
549
550impl futures::Stream for BinderRequestStream {
551 type Item = Result<BinderRequest, fidl::Error>;
552
553 fn poll_next(
554 mut self: std::pin::Pin<&mut Self>,
555 cx: &mut std::task::Context<'_>,
556 ) -> std::task::Poll<Option<Self::Item>> {
557 let this = &mut *self;
558 if this.inner.check_shutdown(cx) {
559 this.is_terminated = true;
560 return std::task::Poll::Ready(None);
561 }
562 if this.is_terminated {
563 panic!("polled BinderRequestStream after completion");
564 }
565 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
566 |bytes, handles| {
567 match this.inner.channel().read_etc(cx, bytes, handles) {
568 std::task::Poll::Ready(Ok(())) => {}
569 std::task::Poll::Pending => return std::task::Poll::Pending,
570 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
571 this.is_terminated = true;
572 return std::task::Poll::Ready(None);
573 }
574 std::task::Poll::Ready(Err(e)) => {
575 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
576 e.into(),
577 ))))
578 }
579 }
580
581 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
583
584 std::task::Poll::Ready(Some(match header.ordinal {
585 0x43ee5d8f7d3acbf6 => {
586 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
587 let mut req = fidl::new_empty!(
588 BinderSetVmoRequest,
589 fidl::encoding::DefaultFuchsiaResourceDialect
590 );
591 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BinderSetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
592 let control_handle = BinderControlHandle { inner: this.inner.clone() };
593 Ok(BinderRequest::SetVmo {
594 vmo: req.vmo,
595 mapped_address: req.mapped_address,
596
597 control_handle,
598 })
599 }
600 0x1032021e21310000 => {
601 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
602 let mut req = fidl::new_empty!(
603 BinderIoctlRequest,
604 fidl::encoding::DefaultFuchsiaResourceDialect
605 );
606 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BinderIoctlRequest>(&header, _body_bytes, handles, &mut req)?;
607 let control_handle = BinderControlHandle { inner: this.inner.clone() };
608 Ok(BinderRequest::Ioctl {
609 tid: req.tid,
610 request: req.request,
611 parameter: req.parameter,
612
613 responder: BinderIoctlResponder {
614 control_handle: std::mem::ManuallyDrop::new(control_handle),
615 tx_id: header.tx_id,
616 },
617 })
618 }
619 _ if header.tx_id == 0
620 && header
621 .dynamic_flags()
622 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
623 {
624 Ok(BinderRequest::_UnknownMethod {
625 ordinal: header.ordinal,
626 control_handle: BinderControlHandle { inner: this.inner.clone() },
627 method_type: fidl::MethodType::OneWay,
628 })
629 }
630 _ if header
631 .dynamic_flags()
632 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
633 {
634 this.inner.send_framework_err(
635 fidl::encoding::FrameworkErr::UnknownMethod,
636 header.tx_id,
637 header.ordinal,
638 header.dynamic_flags(),
639 (bytes, handles),
640 )?;
641 Ok(BinderRequest::_UnknownMethod {
642 ordinal: header.ordinal,
643 control_handle: BinderControlHandle { inner: this.inner.clone() },
644 method_type: fidl::MethodType::TwoWay,
645 })
646 }
647 _ => Err(fidl::Error::UnknownOrdinal {
648 ordinal: header.ordinal,
649 protocol_name:
650 <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
651 }),
652 }))
653 },
654 )
655 }
656}
657
658#[derive(Debug)]
660pub enum BinderRequest {
661 SetVmo {
665 vmo: fidl::Vmo,
666 mapped_address: u64,
667 control_handle: BinderControlHandle,
668 },
669 Ioctl {
670 tid: u64,
671 request: u32,
672 parameter: u64,
673 responder: BinderIoctlResponder,
674 },
675 #[non_exhaustive]
677 _UnknownMethod {
678 ordinal: u64,
680 control_handle: BinderControlHandle,
681 method_type: fidl::MethodType,
682 },
683}
684
685impl BinderRequest {
686 #[allow(irrefutable_let_patterns)]
687 pub fn into_set_vmo(self) -> Option<(fidl::Vmo, u64, BinderControlHandle)> {
688 if let BinderRequest::SetVmo { vmo, mapped_address, control_handle } = self {
689 Some((vmo, mapped_address, control_handle))
690 } else {
691 None
692 }
693 }
694
695 #[allow(irrefutable_let_patterns)]
696 pub fn into_ioctl(self) -> Option<(u64, u32, u64, BinderIoctlResponder)> {
697 if let BinderRequest::Ioctl { tid, request, parameter, responder } = self {
698 Some((tid, request, parameter, responder))
699 } else {
700 None
701 }
702 }
703
704 pub fn method_name(&self) -> &'static str {
706 match *self {
707 BinderRequest::SetVmo { .. } => "set_vmo",
708 BinderRequest::Ioctl { .. } => "ioctl",
709 BinderRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
710 "unknown one-way method"
711 }
712 BinderRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
713 "unknown two-way method"
714 }
715 }
716 }
717}
718
719#[derive(Debug, Clone)]
720pub struct BinderControlHandle {
721 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
722}
723
724impl fidl::endpoints::ControlHandle for BinderControlHandle {
725 fn shutdown(&self) {
726 self.inner.shutdown()
727 }
728 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
729 self.inner.shutdown_with_epitaph(status)
730 }
731
732 fn is_closed(&self) -> bool {
733 self.inner.channel().is_closed()
734 }
735 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
736 self.inner.channel().on_closed()
737 }
738
739 #[cfg(target_os = "fuchsia")]
740 fn signal_peer(
741 &self,
742 clear_mask: zx::Signals,
743 set_mask: zx::Signals,
744 ) -> Result<(), zx_status::Status> {
745 use fidl::Peered;
746 self.inner.channel().signal_peer(clear_mask, set_mask)
747 }
748}
749
750impl BinderControlHandle {}
751
752#[must_use = "FIDL methods require a response to be sent"]
753#[derive(Debug)]
754pub struct BinderIoctlResponder {
755 control_handle: std::mem::ManuallyDrop<BinderControlHandle>,
756 tx_id: u32,
757}
758
759impl std::ops::Drop for BinderIoctlResponder {
763 fn drop(&mut self) {
764 self.control_handle.shutdown();
765 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
767 }
768}
769
770impl fidl::endpoints::Responder for BinderIoctlResponder {
771 type ControlHandle = BinderControlHandle;
772
773 fn control_handle(&self) -> &BinderControlHandle {
774 &self.control_handle
775 }
776
777 fn drop_without_shutdown(mut self) {
778 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
780 std::mem::forget(self);
782 }
783}
784
785impl BinderIoctlResponder {
786 pub fn send(
790 self,
791 mut result: Result<(), fidl_fuchsia_posix::Errno>,
792 ) -> Result<(), fidl::Error> {
793 let _result = self.send_raw(result);
794 if _result.is_err() {
795 self.control_handle.shutdown();
796 }
797 self.drop_without_shutdown();
798 _result
799 }
800
801 pub fn send_no_shutdown_on_err(
803 self,
804 mut result: Result<(), fidl_fuchsia_posix::Errno>,
805 ) -> Result<(), fidl::Error> {
806 let _result = self.send_raw(result);
807 self.drop_without_shutdown();
808 _result
809 }
810
811 fn send_raw(
812 &self,
813 mut result: Result<(), fidl_fuchsia_posix::Errno>,
814 ) -> Result<(), fidl::Error> {
815 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
816 fidl::encoding::EmptyStruct,
817 fidl_fuchsia_posix::Errno,
818 >>(
819 fidl::encoding::FlexibleResult::new(result),
820 self.tx_id,
821 0x1032021e21310000,
822 fidl::encoding::DynamicFlags::FLEXIBLE,
823 )
824 }
825}
826
827#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
828pub struct ContainerPowerControllerMarker;
829
830impl fidl::endpoints::ProtocolMarker for ContainerPowerControllerMarker {
831 type Proxy = ContainerPowerControllerProxy;
832 type RequestStream = ContainerPowerControllerRequestStream;
833 #[cfg(target_os = "fuchsia")]
834 type SynchronousProxy = ContainerPowerControllerSynchronousProxy;
835
836 const DEBUG_NAME: &'static str = "fuchsia.starnix.binder.ContainerPowerController";
837}
838impl fidl::endpoints::DiscoverableProtocolMarker for ContainerPowerControllerMarker {}
839
840pub trait ContainerPowerControllerProxyInterface: Send + Sync {
841 fn r#wake(&self, payload: ContainerPowerControllerWakeRequest) -> Result<(), fidl::Error>;
842 type RegisterWakeWatcherResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
843 + Send;
844 fn r#register_wake_watcher(
845 &self,
846 payload: ContainerPowerControllerRegisterWakeWatcherRequest,
847 ) -> Self::RegisterWakeWatcherResponseFut;
848}
849#[derive(Debug)]
850#[cfg(target_os = "fuchsia")]
851pub struct ContainerPowerControllerSynchronousProxy {
852 client: fidl::client::sync::Client,
853}
854
855#[cfg(target_os = "fuchsia")]
856impl fidl::endpoints::SynchronousProxy for ContainerPowerControllerSynchronousProxy {
857 type Proxy = ContainerPowerControllerProxy;
858 type Protocol = ContainerPowerControllerMarker;
859
860 fn from_channel(inner: fidl::Channel) -> Self {
861 Self::new(inner)
862 }
863
864 fn into_channel(self) -> fidl::Channel {
865 self.client.into_channel()
866 }
867
868 fn as_channel(&self) -> &fidl::Channel {
869 self.client.as_channel()
870 }
871}
872
873#[cfg(target_os = "fuchsia")]
874impl ContainerPowerControllerSynchronousProxy {
875 pub fn new(channel: fidl::Channel) -> Self {
876 let protocol_name =
877 <ContainerPowerControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
878 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
879 }
880
881 pub fn into_channel(self) -> fidl::Channel {
882 self.client.into_channel()
883 }
884
885 pub fn wait_for_event(
888 &self,
889 deadline: zx::MonotonicInstant,
890 ) -> Result<ContainerPowerControllerEvent, fidl::Error> {
891 ContainerPowerControllerEvent::decode(self.client.wait_for_event(deadline)?)
892 }
893
894 pub fn r#wake(
896 &self,
897 mut payload: ContainerPowerControllerWakeRequest,
898 ) -> Result<(), fidl::Error> {
899 self.client.send::<ContainerPowerControllerWakeRequest>(
900 &mut payload,
901 0x31dc1b2d1e00a094,
902 fidl::encoding::DynamicFlags::FLEXIBLE,
903 )
904 }
905
906 pub fn r#register_wake_watcher(
911 &self,
912 mut payload: ContainerPowerControllerRegisterWakeWatcherRequest,
913 ___deadline: zx::MonotonicInstant,
914 ) -> Result<(), fidl::Error> {
915 let _response = self.client.send_query::<
916 ContainerPowerControllerRegisterWakeWatcherRequest,
917 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
918 >(
919 &mut payload,
920 0x5a08c36d7c9c5703,
921 fidl::encoding::DynamicFlags::FLEXIBLE,
922 ___deadline,
923 )?
924 .into_result::<ContainerPowerControllerMarker>("register_wake_watcher")?;
925 Ok(_response)
926 }
927}
928
929#[derive(Debug, Clone)]
930pub struct ContainerPowerControllerProxy {
931 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
932}
933
934impl fidl::endpoints::Proxy for ContainerPowerControllerProxy {
935 type Protocol = ContainerPowerControllerMarker;
936
937 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
938 Self::new(inner)
939 }
940
941 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
942 self.client.into_channel().map_err(|client| Self { client })
943 }
944
945 fn as_channel(&self) -> &::fidl::AsyncChannel {
946 self.client.as_channel()
947 }
948}
949
950impl ContainerPowerControllerProxy {
951 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
953 let protocol_name =
954 <ContainerPowerControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
955 Self { client: fidl::client::Client::new(channel, protocol_name) }
956 }
957
958 pub fn take_event_stream(&self) -> ContainerPowerControllerEventStream {
964 ContainerPowerControllerEventStream { event_receiver: self.client.take_event_receiver() }
965 }
966
967 pub fn r#wake(
969 &self,
970 mut payload: ContainerPowerControllerWakeRequest,
971 ) -> Result<(), fidl::Error> {
972 ContainerPowerControllerProxyInterface::r#wake(self, payload)
973 }
974
975 pub fn r#register_wake_watcher(
980 &self,
981 mut payload: ContainerPowerControllerRegisterWakeWatcherRequest,
982 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
983 ContainerPowerControllerProxyInterface::r#register_wake_watcher(self, payload)
984 }
985}
986
987impl ContainerPowerControllerProxyInterface for ContainerPowerControllerProxy {
988 fn r#wake(&self, mut payload: ContainerPowerControllerWakeRequest) -> Result<(), fidl::Error> {
989 self.client.send::<ContainerPowerControllerWakeRequest>(
990 &mut payload,
991 0x31dc1b2d1e00a094,
992 fidl::encoding::DynamicFlags::FLEXIBLE,
993 )
994 }
995
996 type RegisterWakeWatcherResponseFut =
997 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
998 fn r#register_wake_watcher(
999 &self,
1000 mut payload: ContainerPowerControllerRegisterWakeWatcherRequest,
1001 ) -> Self::RegisterWakeWatcherResponseFut {
1002 fn _decode(
1003 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1004 ) -> Result<(), fidl::Error> {
1005 let _response = fidl::client::decode_transaction_body::<
1006 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1007 fidl::encoding::DefaultFuchsiaResourceDialect,
1008 0x5a08c36d7c9c5703,
1009 >(_buf?)?
1010 .into_result::<ContainerPowerControllerMarker>("register_wake_watcher")?;
1011 Ok(_response)
1012 }
1013 self.client.send_query_and_decode::<ContainerPowerControllerRegisterWakeWatcherRequest, ()>(
1014 &mut payload,
1015 0x5a08c36d7c9c5703,
1016 fidl::encoding::DynamicFlags::FLEXIBLE,
1017 _decode,
1018 )
1019 }
1020}
1021
1022pub struct ContainerPowerControllerEventStream {
1023 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1024}
1025
1026impl std::marker::Unpin for ContainerPowerControllerEventStream {}
1027
1028impl futures::stream::FusedStream for ContainerPowerControllerEventStream {
1029 fn is_terminated(&self) -> bool {
1030 self.event_receiver.is_terminated()
1031 }
1032}
1033
1034impl futures::Stream for ContainerPowerControllerEventStream {
1035 type Item = Result<ContainerPowerControllerEvent, fidl::Error>;
1036
1037 fn poll_next(
1038 mut self: std::pin::Pin<&mut Self>,
1039 cx: &mut std::task::Context<'_>,
1040 ) -> std::task::Poll<Option<Self::Item>> {
1041 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1042 &mut self.event_receiver,
1043 cx
1044 )?) {
1045 Some(buf) => std::task::Poll::Ready(Some(ContainerPowerControllerEvent::decode(buf))),
1046 None => std::task::Poll::Ready(None),
1047 }
1048 }
1049}
1050
1051#[derive(Debug)]
1052pub enum ContainerPowerControllerEvent {
1053 #[non_exhaustive]
1054 _UnknownEvent {
1055 ordinal: u64,
1057 },
1058}
1059
1060impl ContainerPowerControllerEvent {
1061 fn decode(
1063 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1064 ) -> Result<ContainerPowerControllerEvent, fidl::Error> {
1065 let (bytes, _handles) = buf.split_mut();
1066 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1067 debug_assert_eq!(tx_header.tx_id, 0);
1068 match tx_header.ordinal {
1069 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1070 Ok(ContainerPowerControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1071 }
1072 _ => Err(fidl::Error::UnknownOrdinal {
1073 ordinal: tx_header.ordinal,
1074 protocol_name:
1075 <ContainerPowerControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1076 }),
1077 }
1078 }
1079}
1080
1081pub struct ContainerPowerControllerRequestStream {
1083 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1084 is_terminated: bool,
1085}
1086
1087impl std::marker::Unpin for ContainerPowerControllerRequestStream {}
1088
1089impl futures::stream::FusedStream for ContainerPowerControllerRequestStream {
1090 fn is_terminated(&self) -> bool {
1091 self.is_terminated
1092 }
1093}
1094
1095impl fidl::endpoints::RequestStream for ContainerPowerControllerRequestStream {
1096 type Protocol = ContainerPowerControllerMarker;
1097 type ControlHandle = ContainerPowerControllerControlHandle;
1098
1099 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1100 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1101 }
1102
1103 fn control_handle(&self) -> Self::ControlHandle {
1104 ContainerPowerControllerControlHandle { inner: self.inner.clone() }
1105 }
1106
1107 fn into_inner(
1108 self,
1109 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1110 {
1111 (self.inner, self.is_terminated)
1112 }
1113
1114 fn from_inner(
1115 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1116 is_terminated: bool,
1117 ) -> Self {
1118 Self { inner, is_terminated }
1119 }
1120}
1121
1122impl futures::Stream for ContainerPowerControllerRequestStream {
1123 type Item = Result<ContainerPowerControllerRequest, fidl::Error>;
1124
1125 fn poll_next(
1126 mut self: std::pin::Pin<&mut Self>,
1127 cx: &mut std::task::Context<'_>,
1128 ) -> std::task::Poll<Option<Self::Item>> {
1129 let this = &mut *self;
1130 if this.inner.check_shutdown(cx) {
1131 this.is_terminated = true;
1132 return std::task::Poll::Ready(None);
1133 }
1134 if this.is_terminated {
1135 panic!("polled ContainerPowerControllerRequestStream after completion");
1136 }
1137 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1138 |bytes, handles| {
1139 match this.inner.channel().read_etc(cx, bytes, handles) {
1140 std::task::Poll::Ready(Ok(())) => {}
1141 std::task::Poll::Pending => return std::task::Poll::Pending,
1142 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1143 this.is_terminated = true;
1144 return std::task::Poll::Ready(None);
1145 }
1146 std::task::Poll::Ready(Err(e)) => {
1147 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1148 e.into(),
1149 ))))
1150 }
1151 }
1152
1153 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1155
1156 std::task::Poll::Ready(Some(match header.ordinal {
1157 0x31dc1b2d1e00a094 => {
1158 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1159 let mut req = fidl::new_empty!(ContainerPowerControllerWakeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1160 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContainerPowerControllerWakeRequest>(&header, _body_bytes, handles, &mut req)?;
1161 let control_handle = ContainerPowerControllerControlHandle {
1162 inner: this.inner.clone(),
1163 };
1164 Ok(ContainerPowerControllerRequest::Wake {payload: req,
1165 control_handle,
1166 })
1167 }
1168 0x5a08c36d7c9c5703 => {
1169 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1170 let mut req = fidl::new_empty!(ContainerPowerControllerRegisterWakeWatcherRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1171 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContainerPowerControllerRegisterWakeWatcherRequest>(&header, _body_bytes, handles, &mut req)?;
1172 let control_handle = ContainerPowerControllerControlHandle {
1173 inner: this.inner.clone(),
1174 };
1175 Ok(ContainerPowerControllerRequest::RegisterWakeWatcher {payload: req,
1176 responder: ContainerPowerControllerRegisterWakeWatcherResponder {
1177 control_handle: std::mem::ManuallyDrop::new(control_handle),
1178 tx_id: header.tx_id,
1179 },
1180 })
1181 }
1182 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1183 Ok(ContainerPowerControllerRequest::_UnknownMethod {
1184 ordinal: header.ordinal,
1185 control_handle: ContainerPowerControllerControlHandle { inner: this.inner.clone() },
1186 method_type: fidl::MethodType::OneWay,
1187 })
1188 }
1189 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1190 this.inner.send_framework_err(
1191 fidl::encoding::FrameworkErr::UnknownMethod,
1192 header.tx_id,
1193 header.ordinal,
1194 header.dynamic_flags(),
1195 (bytes, handles),
1196 )?;
1197 Ok(ContainerPowerControllerRequest::_UnknownMethod {
1198 ordinal: header.ordinal,
1199 control_handle: ContainerPowerControllerControlHandle { inner: this.inner.clone() },
1200 method_type: fidl::MethodType::TwoWay,
1201 })
1202 }
1203 _ => Err(fidl::Error::UnknownOrdinal {
1204 ordinal: header.ordinal,
1205 protocol_name: <ContainerPowerControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1206 }),
1207 }))
1208 },
1209 )
1210 }
1211}
1212
1213#[derive(Debug)]
1215pub enum ContainerPowerControllerRequest {
1216 Wake {
1218 payload: ContainerPowerControllerWakeRequest,
1219 control_handle: ContainerPowerControllerControlHandle,
1220 },
1221 RegisterWakeWatcher {
1226 payload: ContainerPowerControllerRegisterWakeWatcherRequest,
1227 responder: ContainerPowerControllerRegisterWakeWatcherResponder,
1228 },
1229 #[non_exhaustive]
1231 _UnknownMethod {
1232 ordinal: u64,
1234 control_handle: ContainerPowerControllerControlHandle,
1235 method_type: fidl::MethodType,
1236 },
1237}
1238
1239impl ContainerPowerControllerRequest {
1240 #[allow(irrefutable_let_patterns)]
1241 pub fn into_wake(
1242 self,
1243 ) -> Option<(ContainerPowerControllerWakeRequest, ContainerPowerControllerControlHandle)> {
1244 if let ContainerPowerControllerRequest::Wake { payload, control_handle } = self {
1245 Some((payload, control_handle))
1246 } else {
1247 None
1248 }
1249 }
1250
1251 #[allow(irrefutable_let_patterns)]
1252 pub fn into_register_wake_watcher(
1253 self,
1254 ) -> Option<(
1255 ContainerPowerControllerRegisterWakeWatcherRequest,
1256 ContainerPowerControllerRegisterWakeWatcherResponder,
1257 )> {
1258 if let ContainerPowerControllerRequest::RegisterWakeWatcher { payload, responder } = self {
1259 Some((payload, responder))
1260 } else {
1261 None
1262 }
1263 }
1264
1265 pub fn method_name(&self) -> &'static str {
1267 match *self {
1268 ContainerPowerControllerRequest::Wake { .. } => "wake",
1269 ContainerPowerControllerRequest::RegisterWakeWatcher { .. } => "register_wake_watcher",
1270 ContainerPowerControllerRequest::_UnknownMethod {
1271 method_type: fidl::MethodType::OneWay,
1272 ..
1273 } => "unknown one-way method",
1274 ContainerPowerControllerRequest::_UnknownMethod {
1275 method_type: fidl::MethodType::TwoWay,
1276 ..
1277 } => "unknown two-way method",
1278 }
1279 }
1280}
1281
1282#[derive(Debug, Clone)]
1283pub struct ContainerPowerControllerControlHandle {
1284 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1285}
1286
1287impl fidl::endpoints::ControlHandle for ContainerPowerControllerControlHandle {
1288 fn shutdown(&self) {
1289 self.inner.shutdown()
1290 }
1291 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1292 self.inner.shutdown_with_epitaph(status)
1293 }
1294
1295 fn is_closed(&self) -> bool {
1296 self.inner.channel().is_closed()
1297 }
1298 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1299 self.inner.channel().on_closed()
1300 }
1301
1302 #[cfg(target_os = "fuchsia")]
1303 fn signal_peer(
1304 &self,
1305 clear_mask: zx::Signals,
1306 set_mask: zx::Signals,
1307 ) -> Result<(), zx_status::Status> {
1308 use fidl::Peered;
1309 self.inner.channel().signal_peer(clear_mask, set_mask)
1310 }
1311}
1312
1313impl ContainerPowerControllerControlHandle {}
1314
1315#[must_use = "FIDL methods require a response to be sent"]
1316#[derive(Debug)]
1317pub struct ContainerPowerControllerRegisterWakeWatcherResponder {
1318 control_handle: std::mem::ManuallyDrop<ContainerPowerControllerControlHandle>,
1319 tx_id: u32,
1320}
1321
1322impl std::ops::Drop for ContainerPowerControllerRegisterWakeWatcherResponder {
1326 fn drop(&mut self) {
1327 self.control_handle.shutdown();
1328 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1330 }
1331}
1332
1333impl fidl::endpoints::Responder for ContainerPowerControllerRegisterWakeWatcherResponder {
1334 type ControlHandle = ContainerPowerControllerControlHandle;
1335
1336 fn control_handle(&self) -> &ContainerPowerControllerControlHandle {
1337 &self.control_handle
1338 }
1339
1340 fn drop_without_shutdown(mut self) {
1341 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1343 std::mem::forget(self);
1345 }
1346}
1347
1348impl ContainerPowerControllerRegisterWakeWatcherResponder {
1349 pub fn send(self) -> Result<(), fidl::Error> {
1353 let _result = self.send_raw();
1354 if _result.is_err() {
1355 self.control_handle.shutdown();
1356 }
1357 self.drop_without_shutdown();
1358 _result
1359 }
1360
1361 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1363 let _result = self.send_raw();
1364 self.drop_without_shutdown();
1365 _result
1366 }
1367
1368 fn send_raw(&self) -> Result<(), fidl::Error> {
1369 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
1370 fidl::encoding::Flexible::new(()),
1371 self.tx_id,
1372 0x5a08c36d7c9c5703,
1373 fidl::encoding::DynamicFlags::FLEXIBLE,
1374 )
1375 }
1376}
1377
1378#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1379pub struct DevBinderMarker;
1380
1381impl fidl::endpoints::ProtocolMarker for DevBinderMarker {
1382 type Proxy = DevBinderProxy;
1383 type RequestStream = DevBinderRequestStream;
1384 #[cfg(target_os = "fuchsia")]
1385 type SynchronousProxy = DevBinderSynchronousProxy;
1386
1387 const DEBUG_NAME: &'static str = "fuchsia.starnix.binder.DevBinder";
1388}
1389impl fidl::endpoints::DiscoverableProtocolMarker for DevBinderMarker {}
1390
1391pub trait DevBinderProxyInterface: Send + Sync {
1392 fn r#open(&self, payload: DevBinderOpenRequest) -> Result<(), fidl::Error>;
1393 fn r#close(&self, payload: DevBinderCloseRequest) -> Result<(), fidl::Error>;
1394}
1395#[derive(Debug)]
1396#[cfg(target_os = "fuchsia")]
1397pub struct DevBinderSynchronousProxy {
1398 client: fidl::client::sync::Client,
1399}
1400
1401#[cfg(target_os = "fuchsia")]
1402impl fidl::endpoints::SynchronousProxy for DevBinderSynchronousProxy {
1403 type Proxy = DevBinderProxy;
1404 type Protocol = DevBinderMarker;
1405
1406 fn from_channel(inner: fidl::Channel) -> Self {
1407 Self::new(inner)
1408 }
1409
1410 fn into_channel(self) -> fidl::Channel {
1411 self.client.into_channel()
1412 }
1413
1414 fn as_channel(&self) -> &fidl::Channel {
1415 self.client.as_channel()
1416 }
1417}
1418
1419#[cfg(target_os = "fuchsia")]
1420impl DevBinderSynchronousProxy {
1421 pub fn new(channel: fidl::Channel) -> Self {
1422 let protocol_name = <DevBinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1423 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1424 }
1425
1426 pub fn into_channel(self) -> fidl::Channel {
1427 self.client.into_channel()
1428 }
1429
1430 pub fn wait_for_event(
1433 &self,
1434 deadline: zx::MonotonicInstant,
1435 ) -> Result<DevBinderEvent, fidl::Error> {
1436 DevBinderEvent::decode(self.client.wait_for_event(deadline)?)
1437 }
1438
1439 pub fn r#open(&self, mut payload: DevBinderOpenRequest) -> Result<(), fidl::Error> {
1441 self.client.send::<DevBinderOpenRequest>(
1442 &mut payload,
1443 0x250f5ee034977685,
1444 fidl::encoding::DynamicFlags::FLEXIBLE,
1445 )
1446 }
1447
1448 pub fn r#close(&self, mut payload: DevBinderCloseRequest) -> Result<(), fidl::Error> {
1452 self.client.send::<DevBinderCloseRequest>(
1453 &mut payload,
1454 0x50b39ce5c9bae3b1,
1455 fidl::encoding::DynamicFlags::FLEXIBLE,
1456 )
1457 }
1458}
1459
1460#[derive(Debug, Clone)]
1461pub struct DevBinderProxy {
1462 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1463}
1464
1465impl fidl::endpoints::Proxy for DevBinderProxy {
1466 type Protocol = DevBinderMarker;
1467
1468 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1469 Self::new(inner)
1470 }
1471
1472 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1473 self.client.into_channel().map_err(|client| Self { client })
1474 }
1475
1476 fn as_channel(&self) -> &::fidl::AsyncChannel {
1477 self.client.as_channel()
1478 }
1479}
1480
1481impl DevBinderProxy {
1482 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1484 let protocol_name = <DevBinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1485 Self { client: fidl::client::Client::new(channel, protocol_name) }
1486 }
1487
1488 pub fn take_event_stream(&self) -> DevBinderEventStream {
1494 DevBinderEventStream { event_receiver: self.client.take_event_receiver() }
1495 }
1496
1497 pub fn r#open(&self, mut payload: DevBinderOpenRequest) -> Result<(), fidl::Error> {
1499 DevBinderProxyInterface::r#open(self, payload)
1500 }
1501
1502 pub fn r#close(&self, mut payload: DevBinderCloseRequest) -> Result<(), fidl::Error> {
1506 DevBinderProxyInterface::r#close(self, payload)
1507 }
1508}
1509
1510impl DevBinderProxyInterface for DevBinderProxy {
1511 fn r#open(&self, mut payload: DevBinderOpenRequest) -> Result<(), fidl::Error> {
1512 self.client.send::<DevBinderOpenRequest>(
1513 &mut payload,
1514 0x250f5ee034977685,
1515 fidl::encoding::DynamicFlags::FLEXIBLE,
1516 )
1517 }
1518
1519 fn r#close(&self, mut payload: DevBinderCloseRequest) -> Result<(), fidl::Error> {
1520 self.client.send::<DevBinderCloseRequest>(
1521 &mut payload,
1522 0x50b39ce5c9bae3b1,
1523 fidl::encoding::DynamicFlags::FLEXIBLE,
1524 )
1525 }
1526}
1527
1528pub struct DevBinderEventStream {
1529 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1530}
1531
1532impl std::marker::Unpin for DevBinderEventStream {}
1533
1534impl futures::stream::FusedStream for DevBinderEventStream {
1535 fn is_terminated(&self) -> bool {
1536 self.event_receiver.is_terminated()
1537 }
1538}
1539
1540impl futures::Stream for DevBinderEventStream {
1541 type Item = Result<DevBinderEvent, fidl::Error>;
1542
1543 fn poll_next(
1544 mut self: std::pin::Pin<&mut Self>,
1545 cx: &mut std::task::Context<'_>,
1546 ) -> std::task::Poll<Option<Self::Item>> {
1547 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1548 &mut self.event_receiver,
1549 cx
1550 )?) {
1551 Some(buf) => std::task::Poll::Ready(Some(DevBinderEvent::decode(buf))),
1552 None => std::task::Poll::Ready(None),
1553 }
1554 }
1555}
1556
1557#[derive(Debug)]
1558pub enum DevBinderEvent {
1559 #[non_exhaustive]
1560 _UnknownEvent {
1561 ordinal: u64,
1563 },
1564}
1565
1566impl DevBinderEvent {
1567 fn decode(
1569 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1570 ) -> Result<DevBinderEvent, fidl::Error> {
1571 let (bytes, _handles) = buf.split_mut();
1572 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1573 debug_assert_eq!(tx_header.tx_id, 0);
1574 match tx_header.ordinal {
1575 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1576 Ok(DevBinderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1577 }
1578 _ => Err(fidl::Error::UnknownOrdinal {
1579 ordinal: tx_header.ordinal,
1580 protocol_name: <DevBinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1581 }),
1582 }
1583 }
1584}
1585
1586pub struct DevBinderRequestStream {
1588 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1589 is_terminated: bool,
1590}
1591
1592impl std::marker::Unpin for DevBinderRequestStream {}
1593
1594impl futures::stream::FusedStream for DevBinderRequestStream {
1595 fn is_terminated(&self) -> bool {
1596 self.is_terminated
1597 }
1598}
1599
1600impl fidl::endpoints::RequestStream for DevBinderRequestStream {
1601 type Protocol = DevBinderMarker;
1602 type ControlHandle = DevBinderControlHandle;
1603
1604 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1605 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1606 }
1607
1608 fn control_handle(&self) -> Self::ControlHandle {
1609 DevBinderControlHandle { inner: self.inner.clone() }
1610 }
1611
1612 fn into_inner(
1613 self,
1614 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1615 {
1616 (self.inner, self.is_terminated)
1617 }
1618
1619 fn from_inner(
1620 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1621 is_terminated: bool,
1622 ) -> Self {
1623 Self { inner, is_terminated }
1624 }
1625}
1626
1627impl futures::Stream for DevBinderRequestStream {
1628 type Item = Result<DevBinderRequest, fidl::Error>;
1629
1630 fn poll_next(
1631 mut self: std::pin::Pin<&mut Self>,
1632 cx: &mut std::task::Context<'_>,
1633 ) -> std::task::Poll<Option<Self::Item>> {
1634 let this = &mut *self;
1635 if this.inner.check_shutdown(cx) {
1636 this.is_terminated = true;
1637 return std::task::Poll::Ready(None);
1638 }
1639 if this.is_terminated {
1640 panic!("polled DevBinderRequestStream after completion");
1641 }
1642 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1643 |bytes, handles| {
1644 match this.inner.channel().read_etc(cx, bytes, handles) {
1645 std::task::Poll::Ready(Ok(())) => {}
1646 std::task::Poll::Pending => return std::task::Poll::Pending,
1647 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1648 this.is_terminated = true;
1649 return std::task::Poll::Ready(None);
1650 }
1651 std::task::Poll::Ready(Err(e)) => {
1652 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1653 e.into(),
1654 ))))
1655 }
1656 }
1657
1658 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1660
1661 std::task::Poll::Ready(Some(match header.ordinal {
1662 0x250f5ee034977685 => {
1663 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1664 let mut req = fidl::new_empty!(
1665 DevBinderOpenRequest,
1666 fidl::encoding::DefaultFuchsiaResourceDialect
1667 );
1668 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevBinderOpenRequest>(&header, _body_bytes, handles, &mut req)?;
1669 let control_handle = DevBinderControlHandle { inner: this.inner.clone() };
1670 Ok(DevBinderRequest::Open { payload: req, control_handle })
1671 }
1672 0x50b39ce5c9bae3b1 => {
1673 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1674 let mut req = fidl::new_empty!(
1675 DevBinderCloseRequest,
1676 fidl::encoding::DefaultFuchsiaResourceDialect
1677 );
1678 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevBinderCloseRequest>(&header, _body_bytes, handles, &mut req)?;
1679 let control_handle = DevBinderControlHandle { inner: this.inner.clone() };
1680 Ok(DevBinderRequest::Close { payload: req, control_handle })
1681 }
1682 _ if header.tx_id == 0
1683 && header
1684 .dynamic_flags()
1685 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1686 {
1687 Ok(DevBinderRequest::_UnknownMethod {
1688 ordinal: header.ordinal,
1689 control_handle: DevBinderControlHandle { inner: this.inner.clone() },
1690 method_type: fidl::MethodType::OneWay,
1691 })
1692 }
1693 _ if header
1694 .dynamic_flags()
1695 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1696 {
1697 this.inner.send_framework_err(
1698 fidl::encoding::FrameworkErr::UnknownMethod,
1699 header.tx_id,
1700 header.ordinal,
1701 header.dynamic_flags(),
1702 (bytes, handles),
1703 )?;
1704 Ok(DevBinderRequest::_UnknownMethod {
1705 ordinal: header.ordinal,
1706 control_handle: DevBinderControlHandle { inner: this.inner.clone() },
1707 method_type: fidl::MethodType::TwoWay,
1708 })
1709 }
1710 _ => Err(fidl::Error::UnknownOrdinal {
1711 ordinal: header.ordinal,
1712 protocol_name:
1713 <DevBinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1714 }),
1715 }))
1716 },
1717 )
1718 }
1719}
1720
1721#[derive(Debug)]
1723pub enum DevBinderRequest {
1724 Open { payload: DevBinderOpenRequest, control_handle: DevBinderControlHandle },
1726 Close { payload: DevBinderCloseRequest, control_handle: DevBinderControlHandle },
1730 #[non_exhaustive]
1732 _UnknownMethod {
1733 ordinal: u64,
1735 control_handle: DevBinderControlHandle,
1736 method_type: fidl::MethodType,
1737 },
1738}
1739
1740impl DevBinderRequest {
1741 #[allow(irrefutable_let_patterns)]
1742 pub fn into_open(self) -> Option<(DevBinderOpenRequest, DevBinderControlHandle)> {
1743 if let DevBinderRequest::Open { payload, control_handle } = self {
1744 Some((payload, control_handle))
1745 } else {
1746 None
1747 }
1748 }
1749
1750 #[allow(irrefutable_let_patterns)]
1751 pub fn into_close(self) -> Option<(DevBinderCloseRequest, DevBinderControlHandle)> {
1752 if let DevBinderRequest::Close { payload, control_handle } = self {
1753 Some((payload, control_handle))
1754 } else {
1755 None
1756 }
1757 }
1758
1759 pub fn method_name(&self) -> &'static str {
1761 match *self {
1762 DevBinderRequest::Open { .. } => "open",
1763 DevBinderRequest::Close { .. } => "close",
1764 DevBinderRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1765 "unknown one-way method"
1766 }
1767 DevBinderRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1768 "unknown two-way method"
1769 }
1770 }
1771 }
1772}
1773
1774#[derive(Debug, Clone)]
1775pub struct DevBinderControlHandle {
1776 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1777}
1778
1779impl fidl::endpoints::ControlHandle for DevBinderControlHandle {
1780 fn shutdown(&self) {
1781 self.inner.shutdown()
1782 }
1783 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1784 self.inner.shutdown_with_epitaph(status)
1785 }
1786
1787 fn is_closed(&self) -> bool {
1788 self.inner.channel().is_closed()
1789 }
1790 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1791 self.inner.channel().on_closed()
1792 }
1793
1794 #[cfg(target_os = "fuchsia")]
1795 fn signal_peer(
1796 &self,
1797 clear_mask: zx::Signals,
1798 set_mask: zx::Signals,
1799 ) -> Result<(), zx_status::Status> {
1800 use fidl::Peered;
1801 self.inner.channel().signal_peer(clear_mask, set_mask)
1802 }
1803}
1804
1805impl DevBinderControlHandle {}
1806
1807#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1808pub struct LutexControllerMarker;
1809
1810impl fidl::endpoints::ProtocolMarker for LutexControllerMarker {
1811 type Proxy = LutexControllerProxy;
1812 type RequestStream = LutexControllerRequestStream;
1813 #[cfg(target_os = "fuchsia")]
1814 type SynchronousProxy = LutexControllerSynchronousProxy;
1815
1816 const DEBUG_NAME: &'static str = "fuchsia.starnix.binder.LutexController";
1817}
1818impl fidl::endpoints::DiscoverableProtocolMarker for LutexControllerMarker {}
1819pub type LutexControllerWaitBitsetResult = Result<(), fidl_fuchsia_posix::Errno>;
1820pub type LutexControllerWakeBitsetResult = Result<WakeResponse, fidl_fuchsia_posix::Errno>;
1821
1822pub trait LutexControllerProxyInterface: Send + Sync {
1823 type WaitBitsetResponseFut: std::future::Future<Output = Result<LutexControllerWaitBitsetResult, fidl::Error>>
1824 + Send;
1825 fn r#wait_bitset(&self, payload: WaitBitsetRequest) -> Self::WaitBitsetResponseFut;
1826 type WakeBitsetResponseFut: std::future::Future<Output = Result<LutexControllerWakeBitsetResult, fidl::Error>>
1827 + Send;
1828 fn r#wake_bitset(&self, payload: WakeBitsetRequest) -> Self::WakeBitsetResponseFut;
1829}
1830#[derive(Debug)]
1831#[cfg(target_os = "fuchsia")]
1832pub struct LutexControllerSynchronousProxy {
1833 client: fidl::client::sync::Client,
1834}
1835
1836#[cfg(target_os = "fuchsia")]
1837impl fidl::endpoints::SynchronousProxy for LutexControllerSynchronousProxy {
1838 type Proxy = LutexControllerProxy;
1839 type Protocol = LutexControllerMarker;
1840
1841 fn from_channel(inner: fidl::Channel) -> Self {
1842 Self::new(inner)
1843 }
1844
1845 fn into_channel(self) -> fidl::Channel {
1846 self.client.into_channel()
1847 }
1848
1849 fn as_channel(&self) -> &fidl::Channel {
1850 self.client.as_channel()
1851 }
1852}
1853
1854#[cfg(target_os = "fuchsia")]
1855impl LutexControllerSynchronousProxy {
1856 pub fn new(channel: fidl::Channel) -> Self {
1857 let protocol_name = <LutexControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1858 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1859 }
1860
1861 pub fn into_channel(self) -> fidl::Channel {
1862 self.client.into_channel()
1863 }
1864
1865 pub fn wait_for_event(
1868 &self,
1869 deadline: zx::MonotonicInstant,
1870 ) -> Result<LutexControllerEvent, fidl::Error> {
1871 LutexControllerEvent::decode(self.client.wait_for_event(deadline)?)
1872 }
1873
1874 pub fn r#wait_bitset(
1876 &self,
1877 mut payload: WaitBitsetRequest,
1878 ___deadline: zx::MonotonicInstant,
1879 ) -> Result<LutexControllerWaitBitsetResult, fidl::Error> {
1880 let _response = self
1881 .client
1882 .send_query::<WaitBitsetRequest, fidl::encoding::FlexibleResultType<
1883 fidl::encoding::EmptyStruct,
1884 fidl_fuchsia_posix::Errno,
1885 >>(
1886 &mut payload,
1887 0x489feee6787d11b1,
1888 fidl::encoding::DynamicFlags::FLEXIBLE,
1889 ___deadline,
1890 )?
1891 .into_result::<LutexControllerMarker>("wait_bitset")?;
1892 Ok(_response.map(|x| x))
1893 }
1894
1895 pub fn r#wake_bitset(
1897 &self,
1898 mut payload: WakeBitsetRequest,
1899 ___deadline: zx::MonotonicInstant,
1900 ) -> Result<LutexControllerWakeBitsetResult, fidl::Error> {
1901 let _response = self.client.send_query::<
1902 WakeBitsetRequest,
1903 fidl::encoding::FlexibleResultType<WakeResponse, fidl_fuchsia_posix::Errno>,
1904 >(
1905 &mut payload,
1906 0x58309f6ebcb0d8eb,
1907 fidl::encoding::DynamicFlags::FLEXIBLE,
1908 ___deadline,
1909 )?
1910 .into_result::<LutexControllerMarker>("wake_bitset")?;
1911 Ok(_response.map(|x| x))
1912 }
1913}
1914
1915#[derive(Debug, Clone)]
1916pub struct LutexControllerProxy {
1917 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1918}
1919
1920impl fidl::endpoints::Proxy for LutexControllerProxy {
1921 type Protocol = LutexControllerMarker;
1922
1923 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1924 Self::new(inner)
1925 }
1926
1927 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1928 self.client.into_channel().map_err(|client| Self { client })
1929 }
1930
1931 fn as_channel(&self) -> &::fidl::AsyncChannel {
1932 self.client.as_channel()
1933 }
1934}
1935
1936impl LutexControllerProxy {
1937 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1939 let protocol_name = <LutexControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1940 Self { client: fidl::client::Client::new(channel, protocol_name) }
1941 }
1942
1943 pub fn take_event_stream(&self) -> LutexControllerEventStream {
1949 LutexControllerEventStream { event_receiver: self.client.take_event_receiver() }
1950 }
1951
1952 pub fn r#wait_bitset(
1954 &self,
1955 mut payload: WaitBitsetRequest,
1956 ) -> fidl::client::QueryResponseFut<
1957 LutexControllerWaitBitsetResult,
1958 fidl::encoding::DefaultFuchsiaResourceDialect,
1959 > {
1960 LutexControllerProxyInterface::r#wait_bitset(self, payload)
1961 }
1962
1963 pub fn r#wake_bitset(
1965 &self,
1966 mut payload: WakeBitsetRequest,
1967 ) -> fidl::client::QueryResponseFut<
1968 LutexControllerWakeBitsetResult,
1969 fidl::encoding::DefaultFuchsiaResourceDialect,
1970 > {
1971 LutexControllerProxyInterface::r#wake_bitset(self, payload)
1972 }
1973}
1974
1975impl LutexControllerProxyInterface for LutexControllerProxy {
1976 type WaitBitsetResponseFut = fidl::client::QueryResponseFut<
1977 LutexControllerWaitBitsetResult,
1978 fidl::encoding::DefaultFuchsiaResourceDialect,
1979 >;
1980 fn r#wait_bitset(&self, mut payload: WaitBitsetRequest) -> Self::WaitBitsetResponseFut {
1981 fn _decode(
1982 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1983 ) -> Result<LutexControllerWaitBitsetResult, fidl::Error> {
1984 let _response = fidl::client::decode_transaction_body::<
1985 fidl::encoding::FlexibleResultType<
1986 fidl::encoding::EmptyStruct,
1987 fidl_fuchsia_posix::Errno,
1988 >,
1989 fidl::encoding::DefaultFuchsiaResourceDialect,
1990 0x489feee6787d11b1,
1991 >(_buf?)?
1992 .into_result::<LutexControllerMarker>("wait_bitset")?;
1993 Ok(_response.map(|x| x))
1994 }
1995 self.client.send_query_and_decode::<WaitBitsetRequest, LutexControllerWaitBitsetResult>(
1996 &mut payload,
1997 0x489feee6787d11b1,
1998 fidl::encoding::DynamicFlags::FLEXIBLE,
1999 _decode,
2000 )
2001 }
2002
2003 type WakeBitsetResponseFut = fidl::client::QueryResponseFut<
2004 LutexControllerWakeBitsetResult,
2005 fidl::encoding::DefaultFuchsiaResourceDialect,
2006 >;
2007 fn r#wake_bitset(&self, mut payload: WakeBitsetRequest) -> Self::WakeBitsetResponseFut {
2008 fn _decode(
2009 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2010 ) -> Result<LutexControllerWakeBitsetResult, fidl::Error> {
2011 let _response = fidl::client::decode_transaction_body::<
2012 fidl::encoding::FlexibleResultType<WakeResponse, fidl_fuchsia_posix::Errno>,
2013 fidl::encoding::DefaultFuchsiaResourceDialect,
2014 0x58309f6ebcb0d8eb,
2015 >(_buf?)?
2016 .into_result::<LutexControllerMarker>("wake_bitset")?;
2017 Ok(_response.map(|x| x))
2018 }
2019 self.client.send_query_and_decode::<WakeBitsetRequest, LutexControllerWakeBitsetResult>(
2020 &mut payload,
2021 0x58309f6ebcb0d8eb,
2022 fidl::encoding::DynamicFlags::FLEXIBLE,
2023 _decode,
2024 )
2025 }
2026}
2027
2028pub struct LutexControllerEventStream {
2029 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2030}
2031
2032impl std::marker::Unpin for LutexControllerEventStream {}
2033
2034impl futures::stream::FusedStream for LutexControllerEventStream {
2035 fn is_terminated(&self) -> bool {
2036 self.event_receiver.is_terminated()
2037 }
2038}
2039
2040impl futures::Stream for LutexControllerEventStream {
2041 type Item = Result<LutexControllerEvent, fidl::Error>;
2042
2043 fn poll_next(
2044 mut self: std::pin::Pin<&mut Self>,
2045 cx: &mut std::task::Context<'_>,
2046 ) -> std::task::Poll<Option<Self::Item>> {
2047 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2048 &mut self.event_receiver,
2049 cx
2050 )?) {
2051 Some(buf) => std::task::Poll::Ready(Some(LutexControllerEvent::decode(buf))),
2052 None => std::task::Poll::Ready(None),
2053 }
2054 }
2055}
2056
2057#[derive(Debug)]
2058pub enum LutexControllerEvent {
2059 #[non_exhaustive]
2060 _UnknownEvent {
2061 ordinal: u64,
2063 },
2064}
2065
2066impl LutexControllerEvent {
2067 fn decode(
2069 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2070 ) -> Result<LutexControllerEvent, fidl::Error> {
2071 let (bytes, _handles) = buf.split_mut();
2072 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2073 debug_assert_eq!(tx_header.tx_id, 0);
2074 match tx_header.ordinal {
2075 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2076 Ok(LutexControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2077 }
2078 _ => Err(fidl::Error::UnknownOrdinal {
2079 ordinal: tx_header.ordinal,
2080 protocol_name:
2081 <LutexControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2082 }),
2083 }
2084 }
2085}
2086
2087pub struct LutexControllerRequestStream {
2089 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2090 is_terminated: bool,
2091}
2092
2093impl std::marker::Unpin for LutexControllerRequestStream {}
2094
2095impl futures::stream::FusedStream for LutexControllerRequestStream {
2096 fn is_terminated(&self) -> bool {
2097 self.is_terminated
2098 }
2099}
2100
2101impl fidl::endpoints::RequestStream for LutexControllerRequestStream {
2102 type Protocol = LutexControllerMarker;
2103 type ControlHandle = LutexControllerControlHandle;
2104
2105 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2106 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2107 }
2108
2109 fn control_handle(&self) -> Self::ControlHandle {
2110 LutexControllerControlHandle { inner: self.inner.clone() }
2111 }
2112
2113 fn into_inner(
2114 self,
2115 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2116 {
2117 (self.inner, self.is_terminated)
2118 }
2119
2120 fn from_inner(
2121 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2122 is_terminated: bool,
2123 ) -> Self {
2124 Self { inner, is_terminated }
2125 }
2126}
2127
2128impl futures::Stream for LutexControllerRequestStream {
2129 type Item = Result<LutexControllerRequest, fidl::Error>;
2130
2131 fn poll_next(
2132 mut self: std::pin::Pin<&mut Self>,
2133 cx: &mut std::task::Context<'_>,
2134 ) -> std::task::Poll<Option<Self::Item>> {
2135 let this = &mut *self;
2136 if this.inner.check_shutdown(cx) {
2137 this.is_terminated = true;
2138 return std::task::Poll::Ready(None);
2139 }
2140 if this.is_terminated {
2141 panic!("polled LutexControllerRequestStream after completion");
2142 }
2143 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2144 |bytes, handles| {
2145 match this.inner.channel().read_etc(cx, bytes, handles) {
2146 std::task::Poll::Ready(Ok(())) => {}
2147 std::task::Poll::Pending => return std::task::Poll::Pending,
2148 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2149 this.is_terminated = true;
2150 return std::task::Poll::Ready(None);
2151 }
2152 std::task::Poll::Ready(Err(e)) => {
2153 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2154 e.into(),
2155 ))))
2156 }
2157 }
2158
2159 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2161
2162 std::task::Poll::Ready(Some(match header.ordinal {
2163 0x489feee6787d11b1 => {
2164 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2165 let mut req = fidl::new_empty!(
2166 WaitBitsetRequest,
2167 fidl::encoding::DefaultFuchsiaResourceDialect
2168 );
2169 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WaitBitsetRequest>(&header, _body_bytes, handles, &mut req)?;
2170 let control_handle =
2171 LutexControllerControlHandle { inner: this.inner.clone() };
2172 Ok(LutexControllerRequest::WaitBitset {
2173 payload: req,
2174 responder: LutexControllerWaitBitsetResponder {
2175 control_handle: std::mem::ManuallyDrop::new(control_handle),
2176 tx_id: header.tx_id,
2177 },
2178 })
2179 }
2180 0x58309f6ebcb0d8eb => {
2181 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2182 let mut req = fidl::new_empty!(
2183 WakeBitsetRequest,
2184 fidl::encoding::DefaultFuchsiaResourceDialect
2185 );
2186 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WakeBitsetRequest>(&header, _body_bytes, handles, &mut req)?;
2187 let control_handle =
2188 LutexControllerControlHandle { inner: this.inner.clone() };
2189 Ok(LutexControllerRequest::WakeBitset {
2190 payload: req,
2191 responder: LutexControllerWakeBitsetResponder {
2192 control_handle: std::mem::ManuallyDrop::new(control_handle),
2193 tx_id: header.tx_id,
2194 },
2195 })
2196 }
2197 _ if header.tx_id == 0
2198 && header
2199 .dynamic_flags()
2200 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2201 {
2202 Ok(LutexControllerRequest::_UnknownMethod {
2203 ordinal: header.ordinal,
2204 control_handle: LutexControllerControlHandle {
2205 inner: this.inner.clone(),
2206 },
2207 method_type: fidl::MethodType::OneWay,
2208 })
2209 }
2210 _ if header
2211 .dynamic_flags()
2212 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2213 {
2214 this.inner.send_framework_err(
2215 fidl::encoding::FrameworkErr::UnknownMethod,
2216 header.tx_id,
2217 header.ordinal,
2218 header.dynamic_flags(),
2219 (bytes, handles),
2220 )?;
2221 Ok(LutexControllerRequest::_UnknownMethod {
2222 ordinal: header.ordinal,
2223 control_handle: LutexControllerControlHandle {
2224 inner: this.inner.clone(),
2225 },
2226 method_type: fidl::MethodType::TwoWay,
2227 })
2228 }
2229 _ => Err(fidl::Error::UnknownOrdinal {
2230 ordinal: header.ordinal,
2231 protocol_name:
2232 <LutexControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2233 }),
2234 }))
2235 },
2236 )
2237 }
2238}
2239
2240#[derive(Debug)]
2243pub enum LutexControllerRequest {
2244 WaitBitset { payload: WaitBitsetRequest, responder: LutexControllerWaitBitsetResponder },
2246 WakeBitset { payload: WakeBitsetRequest, responder: LutexControllerWakeBitsetResponder },
2248 #[non_exhaustive]
2250 _UnknownMethod {
2251 ordinal: u64,
2253 control_handle: LutexControllerControlHandle,
2254 method_type: fidl::MethodType,
2255 },
2256}
2257
2258impl LutexControllerRequest {
2259 #[allow(irrefutable_let_patterns)]
2260 pub fn into_wait_bitset(
2261 self,
2262 ) -> Option<(WaitBitsetRequest, LutexControllerWaitBitsetResponder)> {
2263 if let LutexControllerRequest::WaitBitset { payload, responder } = self {
2264 Some((payload, responder))
2265 } else {
2266 None
2267 }
2268 }
2269
2270 #[allow(irrefutable_let_patterns)]
2271 pub fn into_wake_bitset(
2272 self,
2273 ) -> Option<(WakeBitsetRequest, LutexControllerWakeBitsetResponder)> {
2274 if let LutexControllerRequest::WakeBitset { payload, responder } = self {
2275 Some((payload, responder))
2276 } else {
2277 None
2278 }
2279 }
2280
2281 pub fn method_name(&self) -> &'static str {
2283 match *self {
2284 LutexControllerRequest::WaitBitset { .. } => "wait_bitset",
2285 LutexControllerRequest::WakeBitset { .. } => "wake_bitset",
2286 LutexControllerRequest::_UnknownMethod {
2287 method_type: fidl::MethodType::OneWay,
2288 ..
2289 } => "unknown one-way method",
2290 LutexControllerRequest::_UnknownMethod {
2291 method_type: fidl::MethodType::TwoWay,
2292 ..
2293 } => "unknown two-way method",
2294 }
2295 }
2296}
2297
2298#[derive(Debug, Clone)]
2299pub struct LutexControllerControlHandle {
2300 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2301}
2302
2303impl fidl::endpoints::ControlHandle for LutexControllerControlHandle {
2304 fn shutdown(&self) {
2305 self.inner.shutdown()
2306 }
2307 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2308 self.inner.shutdown_with_epitaph(status)
2309 }
2310
2311 fn is_closed(&self) -> bool {
2312 self.inner.channel().is_closed()
2313 }
2314 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2315 self.inner.channel().on_closed()
2316 }
2317
2318 #[cfg(target_os = "fuchsia")]
2319 fn signal_peer(
2320 &self,
2321 clear_mask: zx::Signals,
2322 set_mask: zx::Signals,
2323 ) -> Result<(), zx_status::Status> {
2324 use fidl::Peered;
2325 self.inner.channel().signal_peer(clear_mask, set_mask)
2326 }
2327}
2328
2329impl LutexControllerControlHandle {}
2330
2331#[must_use = "FIDL methods require a response to be sent"]
2332#[derive(Debug)]
2333pub struct LutexControllerWaitBitsetResponder {
2334 control_handle: std::mem::ManuallyDrop<LutexControllerControlHandle>,
2335 tx_id: u32,
2336}
2337
2338impl std::ops::Drop for LutexControllerWaitBitsetResponder {
2342 fn drop(&mut self) {
2343 self.control_handle.shutdown();
2344 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2346 }
2347}
2348
2349impl fidl::endpoints::Responder for LutexControllerWaitBitsetResponder {
2350 type ControlHandle = LutexControllerControlHandle;
2351
2352 fn control_handle(&self) -> &LutexControllerControlHandle {
2353 &self.control_handle
2354 }
2355
2356 fn drop_without_shutdown(mut self) {
2357 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2359 std::mem::forget(self);
2361 }
2362}
2363
2364impl LutexControllerWaitBitsetResponder {
2365 pub fn send(
2369 self,
2370 mut result: Result<(), fidl_fuchsia_posix::Errno>,
2371 ) -> Result<(), fidl::Error> {
2372 let _result = self.send_raw(result);
2373 if _result.is_err() {
2374 self.control_handle.shutdown();
2375 }
2376 self.drop_without_shutdown();
2377 _result
2378 }
2379
2380 pub fn send_no_shutdown_on_err(
2382 self,
2383 mut result: Result<(), fidl_fuchsia_posix::Errno>,
2384 ) -> Result<(), fidl::Error> {
2385 let _result = self.send_raw(result);
2386 self.drop_without_shutdown();
2387 _result
2388 }
2389
2390 fn send_raw(
2391 &self,
2392 mut result: Result<(), fidl_fuchsia_posix::Errno>,
2393 ) -> Result<(), fidl::Error> {
2394 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2395 fidl::encoding::EmptyStruct,
2396 fidl_fuchsia_posix::Errno,
2397 >>(
2398 fidl::encoding::FlexibleResult::new(result),
2399 self.tx_id,
2400 0x489feee6787d11b1,
2401 fidl::encoding::DynamicFlags::FLEXIBLE,
2402 )
2403 }
2404}
2405
2406#[must_use = "FIDL methods require a response to be sent"]
2407#[derive(Debug)]
2408pub struct LutexControllerWakeBitsetResponder {
2409 control_handle: std::mem::ManuallyDrop<LutexControllerControlHandle>,
2410 tx_id: u32,
2411}
2412
2413impl std::ops::Drop for LutexControllerWakeBitsetResponder {
2417 fn drop(&mut self) {
2418 self.control_handle.shutdown();
2419 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2421 }
2422}
2423
2424impl fidl::endpoints::Responder for LutexControllerWakeBitsetResponder {
2425 type ControlHandle = LutexControllerControlHandle;
2426
2427 fn control_handle(&self) -> &LutexControllerControlHandle {
2428 &self.control_handle
2429 }
2430
2431 fn drop_without_shutdown(mut self) {
2432 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2434 std::mem::forget(self);
2436 }
2437}
2438
2439impl LutexControllerWakeBitsetResponder {
2440 pub fn send(
2444 self,
2445 mut result: Result<WakeResponse, fidl_fuchsia_posix::Errno>,
2446 ) -> Result<(), fidl::Error> {
2447 let _result = self.send_raw(result);
2448 if _result.is_err() {
2449 self.control_handle.shutdown();
2450 }
2451 self.drop_without_shutdown();
2452 _result
2453 }
2454
2455 pub fn send_no_shutdown_on_err(
2457 self,
2458 mut result: Result<WakeResponse, fidl_fuchsia_posix::Errno>,
2459 ) -> Result<(), fidl::Error> {
2460 let _result = self.send_raw(result);
2461 self.drop_without_shutdown();
2462 _result
2463 }
2464
2465 fn send_raw(
2466 &self,
2467 mut result: Result<WakeResponse, fidl_fuchsia_posix::Errno>,
2468 ) -> Result<(), fidl::Error> {
2469 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2470 WakeResponse,
2471 fidl_fuchsia_posix::Errno,
2472 >>(
2473 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
2474 self.tx_id,
2475 0x58309f6ebcb0d8eb,
2476 fidl::encoding::DynamicFlags::FLEXIBLE,
2477 )
2478 }
2479}
2480
2481#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2482pub struct ProcessAccessorMarker;
2483
2484impl fidl::endpoints::ProtocolMarker for ProcessAccessorMarker {
2485 type Proxy = ProcessAccessorProxy;
2486 type RequestStream = ProcessAccessorRequestStream;
2487 #[cfg(target_os = "fuchsia")]
2488 type SynchronousProxy = ProcessAccessorSynchronousProxy;
2489
2490 const DEBUG_NAME: &'static str = "(anonymous) ProcessAccessor";
2491}
2492pub type ProcessAccessorWriteMemoryResult = Result<(), fidl_fuchsia_posix::Errno>;
2493pub type ProcessAccessorFileRequestResult = Result<FileResponse, fidl_fuchsia_posix::Errno>;
2494
2495pub trait ProcessAccessorProxyInterface: Send + Sync {
2496 type WriteMemoryResponseFut: std::future::Future<Output = Result<ProcessAccessorWriteMemoryResult, fidl::Error>>
2497 + Send;
2498 fn r#write_memory(&self, address: u64, content: fidl::Vmo) -> Self::WriteMemoryResponseFut;
2499 type FileRequestResponseFut: std::future::Future<Output = Result<ProcessAccessorFileRequestResult, fidl::Error>>
2500 + Send;
2501 fn r#file_request(&self, payload: FileRequest) -> Self::FileRequestResponseFut;
2502}
2503#[derive(Debug)]
2504#[cfg(target_os = "fuchsia")]
2505pub struct ProcessAccessorSynchronousProxy {
2506 client: fidl::client::sync::Client,
2507}
2508
2509#[cfg(target_os = "fuchsia")]
2510impl fidl::endpoints::SynchronousProxy for ProcessAccessorSynchronousProxy {
2511 type Proxy = ProcessAccessorProxy;
2512 type Protocol = ProcessAccessorMarker;
2513
2514 fn from_channel(inner: fidl::Channel) -> Self {
2515 Self::new(inner)
2516 }
2517
2518 fn into_channel(self) -> fidl::Channel {
2519 self.client.into_channel()
2520 }
2521
2522 fn as_channel(&self) -> &fidl::Channel {
2523 self.client.as_channel()
2524 }
2525}
2526
2527#[cfg(target_os = "fuchsia")]
2528impl ProcessAccessorSynchronousProxy {
2529 pub fn new(channel: fidl::Channel) -> Self {
2530 let protocol_name = <ProcessAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2531 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2532 }
2533
2534 pub fn into_channel(self) -> fidl::Channel {
2535 self.client.into_channel()
2536 }
2537
2538 pub fn wait_for_event(
2541 &self,
2542 deadline: zx::MonotonicInstant,
2543 ) -> Result<ProcessAccessorEvent, fidl::Error> {
2544 ProcessAccessorEvent::decode(self.client.wait_for_event(deadline)?)
2545 }
2546
2547 pub fn r#write_memory(
2550 &self,
2551 mut address: u64,
2552 mut content: fidl::Vmo,
2553 ___deadline: zx::MonotonicInstant,
2554 ) -> Result<ProcessAccessorWriteMemoryResult, fidl::Error> {
2555 let _response = self
2556 .client
2557 .send_query::<ProcessAccessorWriteMemoryRequest, fidl::encoding::FlexibleResultType<
2558 fidl::encoding::EmptyStruct,
2559 fidl_fuchsia_posix::Errno,
2560 >>(
2561 (address, content),
2562 0x666cda7c6b6d4819,
2563 fidl::encoding::DynamicFlags::FLEXIBLE,
2564 ___deadline,
2565 )?
2566 .into_result::<ProcessAccessorMarker>("write_memory")?;
2567 Ok(_response.map(|x| x))
2568 }
2569
2570 pub fn r#file_request(
2576 &self,
2577 mut payload: FileRequest,
2578 ___deadline: zx::MonotonicInstant,
2579 ) -> Result<ProcessAccessorFileRequestResult, fidl::Error> {
2580 let _response = self.client.send_query::<
2581 FileRequest,
2582 fidl::encoding::FlexibleResultType<FileResponse, fidl_fuchsia_posix::Errno>,
2583 >(
2584 &mut payload,
2585 0xd42103a37c3f0a,
2586 fidl::encoding::DynamicFlags::FLEXIBLE,
2587 ___deadline,
2588 )?
2589 .into_result::<ProcessAccessorMarker>("file_request")?;
2590 Ok(_response.map(|x| x))
2591 }
2592}
2593
2594#[derive(Debug, Clone)]
2595pub struct ProcessAccessorProxy {
2596 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2597}
2598
2599impl fidl::endpoints::Proxy for ProcessAccessorProxy {
2600 type Protocol = ProcessAccessorMarker;
2601
2602 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2603 Self::new(inner)
2604 }
2605
2606 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2607 self.client.into_channel().map_err(|client| Self { client })
2608 }
2609
2610 fn as_channel(&self) -> &::fidl::AsyncChannel {
2611 self.client.as_channel()
2612 }
2613}
2614
2615impl ProcessAccessorProxy {
2616 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2618 let protocol_name = <ProcessAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2619 Self { client: fidl::client::Client::new(channel, protocol_name) }
2620 }
2621
2622 pub fn take_event_stream(&self) -> ProcessAccessorEventStream {
2628 ProcessAccessorEventStream { event_receiver: self.client.take_event_receiver() }
2629 }
2630
2631 pub fn r#write_memory(
2634 &self,
2635 mut address: u64,
2636 mut content: fidl::Vmo,
2637 ) -> fidl::client::QueryResponseFut<
2638 ProcessAccessorWriteMemoryResult,
2639 fidl::encoding::DefaultFuchsiaResourceDialect,
2640 > {
2641 ProcessAccessorProxyInterface::r#write_memory(self, address, content)
2642 }
2643
2644 pub fn r#file_request(
2650 &self,
2651 mut payload: FileRequest,
2652 ) -> fidl::client::QueryResponseFut<
2653 ProcessAccessorFileRequestResult,
2654 fidl::encoding::DefaultFuchsiaResourceDialect,
2655 > {
2656 ProcessAccessorProxyInterface::r#file_request(self, payload)
2657 }
2658}
2659
2660impl ProcessAccessorProxyInterface for ProcessAccessorProxy {
2661 type WriteMemoryResponseFut = fidl::client::QueryResponseFut<
2662 ProcessAccessorWriteMemoryResult,
2663 fidl::encoding::DefaultFuchsiaResourceDialect,
2664 >;
2665 fn r#write_memory(
2666 &self,
2667 mut address: u64,
2668 mut content: fidl::Vmo,
2669 ) -> Self::WriteMemoryResponseFut {
2670 fn _decode(
2671 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2672 ) -> Result<ProcessAccessorWriteMemoryResult, fidl::Error> {
2673 let _response = fidl::client::decode_transaction_body::<
2674 fidl::encoding::FlexibleResultType<
2675 fidl::encoding::EmptyStruct,
2676 fidl_fuchsia_posix::Errno,
2677 >,
2678 fidl::encoding::DefaultFuchsiaResourceDialect,
2679 0x666cda7c6b6d4819,
2680 >(_buf?)?
2681 .into_result::<ProcessAccessorMarker>("write_memory")?;
2682 Ok(_response.map(|x| x))
2683 }
2684 self.client.send_query_and_decode::<
2685 ProcessAccessorWriteMemoryRequest,
2686 ProcessAccessorWriteMemoryResult,
2687 >(
2688 (address, content,),
2689 0x666cda7c6b6d4819,
2690 fidl::encoding::DynamicFlags::FLEXIBLE,
2691 _decode,
2692 )
2693 }
2694
2695 type FileRequestResponseFut = fidl::client::QueryResponseFut<
2696 ProcessAccessorFileRequestResult,
2697 fidl::encoding::DefaultFuchsiaResourceDialect,
2698 >;
2699 fn r#file_request(&self, mut payload: FileRequest) -> Self::FileRequestResponseFut {
2700 fn _decode(
2701 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2702 ) -> Result<ProcessAccessorFileRequestResult, fidl::Error> {
2703 let _response = fidl::client::decode_transaction_body::<
2704 fidl::encoding::FlexibleResultType<FileResponse, fidl_fuchsia_posix::Errno>,
2705 fidl::encoding::DefaultFuchsiaResourceDialect,
2706 0xd42103a37c3f0a,
2707 >(_buf?)?
2708 .into_result::<ProcessAccessorMarker>("file_request")?;
2709 Ok(_response.map(|x| x))
2710 }
2711 self.client.send_query_and_decode::<FileRequest, ProcessAccessorFileRequestResult>(
2712 &mut payload,
2713 0xd42103a37c3f0a,
2714 fidl::encoding::DynamicFlags::FLEXIBLE,
2715 _decode,
2716 )
2717 }
2718}
2719
2720pub struct ProcessAccessorEventStream {
2721 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2722}
2723
2724impl std::marker::Unpin for ProcessAccessorEventStream {}
2725
2726impl futures::stream::FusedStream for ProcessAccessorEventStream {
2727 fn is_terminated(&self) -> bool {
2728 self.event_receiver.is_terminated()
2729 }
2730}
2731
2732impl futures::Stream for ProcessAccessorEventStream {
2733 type Item = Result<ProcessAccessorEvent, fidl::Error>;
2734
2735 fn poll_next(
2736 mut self: std::pin::Pin<&mut Self>,
2737 cx: &mut std::task::Context<'_>,
2738 ) -> std::task::Poll<Option<Self::Item>> {
2739 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2740 &mut self.event_receiver,
2741 cx
2742 )?) {
2743 Some(buf) => std::task::Poll::Ready(Some(ProcessAccessorEvent::decode(buf))),
2744 None => std::task::Poll::Ready(None),
2745 }
2746 }
2747}
2748
2749#[derive(Debug)]
2750pub enum ProcessAccessorEvent {
2751 #[non_exhaustive]
2752 _UnknownEvent {
2753 ordinal: u64,
2755 },
2756}
2757
2758impl ProcessAccessorEvent {
2759 fn decode(
2761 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2762 ) -> Result<ProcessAccessorEvent, fidl::Error> {
2763 let (bytes, _handles) = buf.split_mut();
2764 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2765 debug_assert_eq!(tx_header.tx_id, 0);
2766 match tx_header.ordinal {
2767 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2768 Ok(ProcessAccessorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2769 }
2770 _ => Err(fidl::Error::UnknownOrdinal {
2771 ordinal: tx_header.ordinal,
2772 protocol_name:
2773 <ProcessAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2774 }),
2775 }
2776 }
2777}
2778
2779pub struct ProcessAccessorRequestStream {
2781 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2782 is_terminated: bool,
2783}
2784
2785impl std::marker::Unpin for ProcessAccessorRequestStream {}
2786
2787impl futures::stream::FusedStream for ProcessAccessorRequestStream {
2788 fn is_terminated(&self) -> bool {
2789 self.is_terminated
2790 }
2791}
2792
2793impl fidl::endpoints::RequestStream for ProcessAccessorRequestStream {
2794 type Protocol = ProcessAccessorMarker;
2795 type ControlHandle = ProcessAccessorControlHandle;
2796
2797 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2798 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2799 }
2800
2801 fn control_handle(&self) -> Self::ControlHandle {
2802 ProcessAccessorControlHandle { inner: self.inner.clone() }
2803 }
2804
2805 fn into_inner(
2806 self,
2807 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2808 {
2809 (self.inner, self.is_terminated)
2810 }
2811
2812 fn from_inner(
2813 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2814 is_terminated: bool,
2815 ) -> Self {
2816 Self { inner, is_terminated }
2817 }
2818}
2819
2820impl futures::Stream for ProcessAccessorRequestStream {
2821 type Item = Result<ProcessAccessorRequest, fidl::Error>;
2822
2823 fn poll_next(
2824 mut self: std::pin::Pin<&mut Self>,
2825 cx: &mut std::task::Context<'_>,
2826 ) -> std::task::Poll<Option<Self::Item>> {
2827 let this = &mut *self;
2828 if this.inner.check_shutdown(cx) {
2829 this.is_terminated = true;
2830 return std::task::Poll::Ready(None);
2831 }
2832 if this.is_terminated {
2833 panic!("polled ProcessAccessorRequestStream after completion");
2834 }
2835 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2836 |bytes, handles| {
2837 match this.inner.channel().read_etc(cx, bytes, handles) {
2838 std::task::Poll::Ready(Ok(())) => {}
2839 std::task::Poll::Pending => return std::task::Poll::Pending,
2840 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2841 this.is_terminated = true;
2842 return std::task::Poll::Ready(None);
2843 }
2844 std::task::Poll::Ready(Err(e)) => {
2845 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2846 e.into(),
2847 ))))
2848 }
2849 }
2850
2851 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2853
2854 std::task::Poll::Ready(Some(match header.ordinal {
2855 0x666cda7c6b6d4819 => {
2856 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2857 let mut req = fidl::new_empty!(
2858 ProcessAccessorWriteMemoryRequest,
2859 fidl::encoding::DefaultFuchsiaResourceDialect
2860 );
2861 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProcessAccessorWriteMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
2862 let control_handle =
2863 ProcessAccessorControlHandle { inner: this.inner.clone() };
2864 Ok(ProcessAccessorRequest::WriteMemory {
2865 address: req.address,
2866 content: req.content,
2867
2868 responder: ProcessAccessorWriteMemoryResponder {
2869 control_handle: std::mem::ManuallyDrop::new(control_handle),
2870 tx_id: header.tx_id,
2871 },
2872 })
2873 }
2874 0xd42103a37c3f0a => {
2875 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2876 let mut req = fidl::new_empty!(
2877 FileRequest,
2878 fidl::encoding::DefaultFuchsiaResourceDialect
2879 );
2880 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileRequest>(&header, _body_bytes, handles, &mut req)?;
2881 let control_handle =
2882 ProcessAccessorControlHandle { inner: this.inner.clone() };
2883 Ok(ProcessAccessorRequest::FileRequest {
2884 payload: req,
2885 responder: ProcessAccessorFileRequestResponder {
2886 control_handle: std::mem::ManuallyDrop::new(control_handle),
2887 tx_id: header.tx_id,
2888 },
2889 })
2890 }
2891 _ if header.tx_id == 0
2892 && header
2893 .dynamic_flags()
2894 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2895 {
2896 Ok(ProcessAccessorRequest::_UnknownMethod {
2897 ordinal: header.ordinal,
2898 control_handle: ProcessAccessorControlHandle {
2899 inner: this.inner.clone(),
2900 },
2901 method_type: fidl::MethodType::OneWay,
2902 })
2903 }
2904 _ if header
2905 .dynamic_flags()
2906 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2907 {
2908 this.inner.send_framework_err(
2909 fidl::encoding::FrameworkErr::UnknownMethod,
2910 header.tx_id,
2911 header.ordinal,
2912 header.dynamic_flags(),
2913 (bytes, handles),
2914 )?;
2915 Ok(ProcessAccessorRequest::_UnknownMethod {
2916 ordinal: header.ordinal,
2917 control_handle: ProcessAccessorControlHandle {
2918 inner: this.inner.clone(),
2919 },
2920 method_type: fidl::MethodType::TwoWay,
2921 })
2922 }
2923 _ => Err(fidl::Error::UnknownOrdinal {
2924 ordinal: header.ordinal,
2925 protocol_name:
2926 <ProcessAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2927 }),
2928 }))
2929 },
2930 )
2931 }
2932}
2933
2934#[derive(Debug)]
2937pub enum ProcessAccessorRequest {
2938 WriteMemory { address: u64, content: fidl::Vmo, responder: ProcessAccessorWriteMemoryResponder },
2941 FileRequest { payload: FileRequest, responder: ProcessAccessorFileRequestResponder },
2947 #[non_exhaustive]
2949 _UnknownMethod {
2950 ordinal: u64,
2952 control_handle: ProcessAccessorControlHandle,
2953 method_type: fidl::MethodType,
2954 },
2955}
2956
2957impl ProcessAccessorRequest {
2958 #[allow(irrefutable_let_patterns)]
2959 pub fn into_write_memory(
2960 self,
2961 ) -> Option<(u64, fidl::Vmo, ProcessAccessorWriteMemoryResponder)> {
2962 if let ProcessAccessorRequest::WriteMemory { address, content, responder } = self {
2963 Some((address, content, responder))
2964 } else {
2965 None
2966 }
2967 }
2968
2969 #[allow(irrefutable_let_patterns)]
2970 pub fn into_file_request(self) -> Option<(FileRequest, ProcessAccessorFileRequestResponder)> {
2971 if let ProcessAccessorRequest::FileRequest { payload, responder } = self {
2972 Some((payload, responder))
2973 } else {
2974 None
2975 }
2976 }
2977
2978 pub fn method_name(&self) -> &'static str {
2980 match *self {
2981 ProcessAccessorRequest::WriteMemory { .. } => "write_memory",
2982 ProcessAccessorRequest::FileRequest { .. } => "file_request",
2983 ProcessAccessorRequest::_UnknownMethod {
2984 method_type: fidl::MethodType::OneWay,
2985 ..
2986 } => "unknown one-way method",
2987 ProcessAccessorRequest::_UnknownMethod {
2988 method_type: fidl::MethodType::TwoWay,
2989 ..
2990 } => "unknown two-way method",
2991 }
2992 }
2993}
2994
2995#[derive(Debug, Clone)]
2996pub struct ProcessAccessorControlHandle {
2997 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2998}
2999
3000impl fidl::endpoints::ControlHandle for ProcessAccessorControlHandle {
3001 fn shutdown(&self) {
3002 self.inner.shutdown()
3003 }
3004 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3005 self.inner.shutdown_with_epitaph(status)
3006 }
3007
3008 fn is_closed(&self) -> bool {
3009 self.inner.channel().is_closed()
3010 }
3011 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3012 self.inner.channel().on_closed()
3013 }
3014
3015 #[cfg(target_os = "fuchsia")]
3016 fn signal_peer(
3017 &self,
3018 clear_mask: zx::Signals,
3019 set_mask: zx::Signals,
3020 ) -> Result<(), zx_status::Status> {
3021 use fidl::Peered;
3022 self.inner.channel().signal_peer(clear_mask, set_mask)
3023 }
3024}
3025
3026impl ProcessAccessorControlHandle {}
3027
3028#[must_use = "FIDL methods require a response to be sent"]
3029#[derive(Debug)]
3030pub struct ProcessAccessorWriteMemoryResponder {
3031 control_handle: std::mem::ManuallyDrop<ProcessAccessorControlHandle>,
3032 tx_id: u32,
3033}
3034
3035impl std::ops::Drop for ProcessAccessorWriteMemoryResponder {
3039 fn drop(&mut self) {
3040 self.control_handle.shutdown();
3041 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3043 }
3044}
3045
3046impl fidl::endpoints::Responder for ProcessAccessorWriteMemoryResponder {
3047 type ControlHandle = ProcessAccessorControlHandle;
3048
3049 fn control_handle(&self) -> &ProcessAccessorControlHandle {
3050 &self.control_handle
3051 }
3052
3053 fn drop_without_shutdown(mut self) {
3054 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3056 std::mem::forget(self);
3058 }
3059}
3060
3061impl ProcessAccessorWriteMemoryResponder {
3062 pub fn send(
3066 self,
3067 mut result: Result<(), fidl_fuchsia_posix::Errno>,
3068 ) -> Result<(), fidl::Error> {
3069 let _result = self.send_raw(result);
3070 if _result.is_err() {
3071 self.control_handle.shutdown();
3072 }
3073 self.drop_without_shutdown();
3074 _result
3075 }
3076
3077 pub fn send_no_shutdown_on_err(
3079 self,
3080 mut result: Result<(), fidl_fuchsia_posix::Errno>,
3081 ) -> Result<(), fidl::Error> {
3082 let _result = self.send_raw(result);
3083 self.drop_without_shutdown();
3084 _result
3085 }
3086
3087 fn send_raw(
3088 &self,
3089 mut result: Result<(), fidl_fuchsia_posix::Errno>,
3090 ) -> Result<(), fidl::Error> {
3091 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3092 fidl::encoding::EmptyStruct,
3093 fidl_fuchsia_posix::Errno,
3094 >>(
3095 fidl::encoding::FlexibleResult::new(result),
3096 self.tx_id,
3097 0x666cda7c6b6d4819,
3098 fidl::encoding::DynamicFlags::FLEXIBLE,
3099 )
3100 }
3101}
3102
3103#[must_use = "FIDL methods require a response to be sent"]
3104#[derive(Debug)]
3105pub struct ProcessAccessorFileRequestResponder {
3106 control_handle: std::mem::ManuallyDrop<ProcessAccessorControlHandle>,
3107 tx_id: u32,
3108}
3109
3110impl std::ops::Drop for ProcessAccessorFileRequestResponder {
3114 fn drop(&mut self) {
3115 self.control_handle.shutdown();
3116 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3118 }
3119}
3120
3121impl fidl::endpoints::Responder for ProcessAccessorFileRequestResponder {
3122 type ControlHandle = ProcessAccessorControlHandle;
3123
3124 fn control_handle(&self) -> &ProcessAccessorControlHandle {
3125 &self.control_handle
3126 }
3127
3128 fn drop_without_shutdown(mut self) {
3129 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3131 std::mem::forget(self);
3133 }
3134}
3135
3136impl ProcessAccessorFileRequestResponder {
3137 pub fn send(
3141 self,
3142 mut result: Result<FileResponse, fidl_fuchsia_posix::Errno>,
3143 ) -> Result<(), fidl::Error> {
3144 let _result = self.send_raw(result);
3145 if _result.is_err() {
3146 self.control_handle.shutdown();
3147 }
3148 self.drop_without_shutdown();
3149 _result
3150 }
3151
3152 pub fn send_no_shutdown_on_err(
3154 self,
3155 mut result: Result<FileResponse, fidl_fuchsia_posix::Errno>,
3156 ) -> Result<(), fidl::Error> {
3157 let _result = self.send_raw(result);
3158 self.drop_without_shutdown();
3159 _result
3160 }
3161
3162 fn send_raw(
3163 &self,
3164 mut result: Result<FileResponse, fidl_fuchsia_posix::Errno>,
3165 ) -> Result<(), fidl::Error> {
3166 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3167 FileResponse,
3168 fidl_fuchsia_posix::Errno,
3169 >>(
3170 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
3171 self.tx_id,
3172 0xd42103a37c3f0a,
3173 fidl::encoding::DynamicFlags::FLEXIBLE,
3174 )
3175 }
3176}
3177
3178#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3179pub struct RemoteControllerMarker;
3180
3181impl fidl::endpoints::ProtocolMarker for RemoteControllerMarker {
3182 type Proxy = RemoteControllerProxy;
3183 type RequestStream = RemoteControllerRequestStream;
3184 #[cfg(target_os = "fuchsia")]
3185 type SynchronousProxy = RemoteControllerSynchronousProxy;
3186
3187 const DEBUG_NAME: &'static str = "fuchsia.starnix.binder.RemoteController";
3188}
3189impl fidl::endpoints::DiscoverableProtocolMarker for RemoteControllerMarker {}
3190
3191pub trait RemoteControllerProxyInterface: Send + Sync {
3192 fn r#start(&self, payload: RemoteControllerStartRequest) -> Result<(), fidl::Error>;
3193}
3194#[derive(Debug)]
3195#[cfg(target_os = "fuchsia")]
3196pub struct RemoteControllerSynchronousProxy {
3197 client: fidl::client::sync::Client,
3198}
3199
3200#[cfg(target_os = "fuchsia")]
3201impl fidl::endpoints::SynchronousProxy for RemoteControllerSynchronousProxy {
3202 type Proxy = RemoteControllerProxy;
3203 type Protocol = RemoteControllerMarker;
3204
3205 fn from_channel(inner: fidl::Channel) -> Self {
3206 Self::new(inner)
3207 }
3208
3209 fn into_channel(self) -> fidl::Channel {
3210 self.client.into_channel()
3211 }
3212
3213 fn as_channel(&self) -> &fidl::Channel {
3214 self.client.as_channel()
3215 }
3216}
3217
3218#[cfg(target_os = "fuchsia")]
3219impl RemoteControllerSynchronousProxy {
3220 pub fn new(channel: fidl::Channel) -> Self {
3221 let protocol_name = <RemoteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3222 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3223 }
3224
3225 pub fn into_channel(self) -> fidl::Channel {
3226 self.client.into_channel()
3227 }
3228
3229 pub fn wait_for_event(
3232 &self,
3233 deadline: zx::MonotonicInstant,
3234 ) -> Result<RemoteControllerEvent, fidl::Error> {
3235 RemoteControllerEvent::decode(self.client.wait_for_event(deadline)?)
3236 }
3237
3238 pub fn r#start(&self, mut payload: RemoteControllerStartRequest) -> Result<(), fidl::Error> {
3241 self.client.send::<RemoteControllerStartRequest>(
3242 &mut payload,
3243 0x72ecbe863c65f4cf,
3244 fidl::encoding::DynamicFlags::FLEXIBLE,
3245 )
3246 }
3247}
3248
3249#[derive(Debug, Clone)]
3250pub struct RemoteControllerProxy {
3251 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3252}
3253
3254impl fidl::endpoints::Proxy for RemoteControllerProxy {
3255 type Protocol = RemoteControllerMarker;
3256
3257 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3258 Self::new(inner)
3259 }
3260
3261 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3262 self.client.into_channel().map_err(|client| Self { client })
3263 }
3264
3265 fn as_channel(&self) -> &::fidl::AsyncChannel {
3266 self.client.as_channel()
3267 }
3268}
3269
3270impl RemoteControllerProxy {
3271 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3273 let protocol_name = <RemoteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3274 Self { client: fidl::client::Client::new(channel, protocol_name) }
3275 }
3276
3277 pub fn take_event_stream(&self) -> RemoteControllerEventStream {
3283 RemoteControllerEventStream { event_receiver: self.client.take_event_receiver() }
3284 }
3285
3286 pub fn r#start(&self, mut payload: RemoteControllerStartRequest) -> Result<(), fidl::Error> {
3289 RemoteControllerProxyInterface::r#start(self, payload)
3290 }
3291}
3292
3293impl RemoteControllerProxyInterface for RemoteControllerProxy {
3294 fn r#start(&self, mut payload: RemoteControllerStartRequest) -> Result<(), fidl::Error> {
3295 self.client.send::<RemoteControllerStartRequest>(
3296 &mut payload,
3297 0x72ecbe863c65f4cf,
3298 fidl::encoding::DynamicFlags::FLEXIBLE,
3299 )
3300 }
3301}
3302
3303pub struct RemoteControllerEventStream {
3304 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3305}
3306
3307impl std::marker::Unpin for RemoteControllerEventStream {}
3308
3309impl futures::stream::FusedStream for RemoteControllerEventStream {
3310 fn is_terminated(&self) -> bool {
3311 self.event_receiver.is_terminated()
3312 }
3313}
3314
3315impl futures::Stream for RemoteControllerEventStream {
3316 type Item = Result<RemoteControllerEvent, fidl::Error>;
3317
3318 fn poll_next(
3319 mut self: std::pin::Pin<&mut Self>,
3320 cx: &mut std::task::Context<'_>,
3321 ) -> std::task::Poll<Option<Self::Item>> {
3322 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3323 &mut self.event_receiver,
3324 cx
3325 )?) {
3326 Some(buf) => std::task::Poll::Ready(Some(RemoteControllerEvent::decode(buf))),
3327 None => std::task::Poll::Ready(None),
3328 }
3329 }
3330}
3331
3332#[derive(Debug)]
3333pub enum RemoteControllerEvent {
3334 #[non_exhaustive]
3335 _UnknownEvent {
3336 ordinal: u64,
3338 },
3339}
3340
3341impl RemoteControllerEvent {
3342 fn decode(
3344 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3345 ) -> Result<RemoteControllerEvent, fidl::Error> {
3346 let (bytes, _handles) = buf.split_mut();
3347 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3348 debug_assert_eq!(tx_header.tx_id, 0);
3349 match tx_header.ordinal {
3350 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3351 Ok(RemoteControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3352 }
3353 _ => Err(fidl::Error::UnknownOrdinal {
3354 ordinal: tx_header.ordinal,
3355 protocol_name:
3356 <RemoteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3357 }),
3358 }
3359 }
3360}
3361
3362pub struct RemoteControllerRequestStream {
3364 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3365 is_terminated: bool,
3366}
3367
3368impl std::marker::Unpin for RemoteControllerRequestStream {}
3369
3370impl futures::stream::FusedStream for RemoteControllerRequestStream {
3371 fn is_terminated(&self) -> bool {
3372 self.is_terminated
3373 }
3374}
3375
3376impl fidl::endpoints::RequestStream for RemoteControllerRequestStream {
3377 type Protocol = RemoteControllerMarker;
3378 type ControlHandle = RemoteControllerControlHandle;
3379
3380 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3381 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3382 }
3383
3384 fn control_handle(&self) -> Self::ControlHandle {
3385 RemoteControllerControlHandle { inner: self.inner.clone() }
3386 }
3387
3388 fn into_inner(
3389 self,
3390 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3391 {
3392 (self.inner, self.is_terminated)
3393 }
3394
3395 fn from_inner(
3396 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3397 is_terminated: bool,
3398 ) -> Self {
3399 Self { inner, is_terminated }
3400 }
3401}
3402
3403impl futures::Stream for RemoteControllerRequestStream {
3404 type Item = Result<RemoteControllerRequest, fidl::Error>;
3405
3406 fn poll_next(
3407 mut self: std::pin::Pin<&mut Self>,
3408 cx: &mut std::task::Context<'_>,
3409 ) -> std::task::Poll<Option<Self::Item>> {
3410 let this = &mut *self;
3411 if this.inner.check_shutdown(cx) {
3412 this.is_terminated = true;
3413 return std::task::Poll::Ready(None);
3414 }
3415 if this.is_terminated {
3416 panic!("polled RemoteControllerRequestStream after completion");
3417 }
3418 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3419 |bytes, handles| {
3420 match this.inner.channel().read_etc(cx, bytes, handles) {
3421 std::task::Poll::Ready(Ok(())) => {}
3422 std::task::Poll::Pending => return std::task::Poll::Pending,
3423 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3424 this.is_terminated = true;
3425 return std::task::Poll::Ready(None);
3426 }
3427 std::task::Poll::Ready(Err(e)) => {
3428 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3429 e.into(),
3430 ))))
3431 }
3432 }
3433
3434 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3436
3437 std::task::Poll::Ready(Some(match header.ordinal {
3438 0x72ecbe863c65f4cf => {
3439 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3440 let mut req = fidl::new_empty!(
3441 RemoteControllerStartRequest,
3442 fidl::encoding::DefaultFuchsiaResourceDialect
3443 );
3444 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControllerStartRequest>(&header, _body_bytes, handles, &mut req)?;
3445 let control_handle =
3446 RemoteControllerControlHandle { inner: this.inner.clone() };
3447 Ok(RemoteControllerRequest::Start { payload: req, control_handle })
3448 }
3449 _ if header.tx_id == 0
3450 && header
3451 .dynamic_flags()
3452 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3453 {
3454 Ok(RemoteControllerRequest::_UnknownMethod {
3455 ordinal: header.ordinal,
3456 control_handle: RemoteControllerControlHandle {
3457 inner: this.inner.clone(),
3458 },
3459 method_type: fidl::MethodType::OneWay,
3460 })
3461 }
3462 _ if header
3463 .dynamic_flags()
3464 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3465 {
3466 this.inner.send_framework_err(
3467 fidl::encoding::FrameworkErr::UnknownMethod,
3468 header.tx_id,
3469 header.ordinal,
3470 header.dynamic_flags(),
3471 (bytes, handles),
3472 )?;
3473 Ok(RemoteControllerRequest::_UnknownMethod {
3474 ordinal: header.ordinal,
3475 control_handle: RemoteControllerControlHandle {
3476 inner: this.inner.clone(),
3477 },
3478 method_type: fidl::MethodType::TwoWay,
3479 })
3480 }
3481 _ => Err(fidl::Error::UnknownOrdinal {
3482 ordinal: header.ordinal,
3483 protocol_name:
3484 <RemoteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3485 }),
3486 }))
3487 },
3488 )
3489 }
3490}
3491
3492#[derive(Debug)]
3495pub enum RemoteControllerRequest {
3496 Start { payload: RemoteControllerStartRequest, control_handle: RemoteControllerControlHandle },
3499 #[non_exhaustive]
3501 _UnknownMethod {
3502 ordinal: u64,
3504 control_handle: RemoteControllerControlHandle,
3505 method_type: fidl::MethodType,
3506 },
3507}
3508
3509impl RemoteControllerRequest {
3510 #[allow(irrefutable_let_patterns)]
3511 pub fn into_start(
3512 self,
3513 ) -> Option<(RemoteControllerStartRequest, RemoteControllerControlHandle)> {
3514 if let RemoteControllerRequest::Start { payload, control_handle } = self {
3515 Some((payload, control_handle))
3516 } else {
3517 None
3518 }
3519 }
3520
3521 pub fn method_name(&self) -> &'static str {
3523 match *self {
3524 RemoteControllerRequest::Start { .. } => "start",
3525 RemoteControllerRequest::_UnknownMethod {
3526 method_type: fidl::MethodType::OneWay,
3527 ..
3528 } => "unknown one-way method",
3529 RemoteControllerRequest::_UnknownMethod {
3530 method_type: fidl::MethodType::TwoWay,
3531 ..
3532 } => "unknown two-way method",
3533 }
3534 }
3535}
3536
3537#[derive(Debug, Clone)]
3538pub struct RemoteControllerControlHandle {
3539 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3540}
3541
3542impl fidl::endpoints::ControlHandle for RemoteControllerControlHandle {
3543 fn shutdown(&self) {
3544 self.inner.shutdown()
3545 }
3546 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3547 self.inner.shutdown_with_epitaph(status)
3548 }
3549
3550 fn is_closed(&self) -> bool {
3551 self.inner.channel().is_closed()
3552 }
3553 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3554 self.inner.channel().on_closed()
3555 }
3556
3557 #[cfg(target_os = "fuchsia")]
3558 fn signal_peer(
3559 &self,
3560 clear_mask: zx::Signals,
3561 set_mask: zx::Signals,
3562 ) -> Result<(), zx_status::Status> {
3563 use fidl::Peered;
3564 self.inner.channel().signal_peer(clear_mask, set_mask)
3565 }
3566}
3567
3568impl RemoteControllerControlHandle {}
3569
3570#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3571pub struct UnixDomainSocketMarker;
3572
3573impl fidl::endpoints::ProtocolMarker for UnixDomainSocketMarker {
3574 type Proxy = UnixDomainSocketProxy;
3575 type RequestStream = UnixDomainSocketRequestStream;
3576 #[cfg(target_os = "fuchsia")]
3577 type SynchronousProxy = UnixDomainSocketSynchronousProxy;
3578
3579 const DEBUG_NAME: &'static str = "(anonymous) UnixDomainSocket";
3580}
3581pub type UnixDomainSocketGetEventResult = Result<UnixDomainSocketGetEventResponse, i32>;
3582pub type UnixDomainSocketReadResult = Result<UnixDomainSocketReadResponse, i32>;
3583pub type UnixDomainSocketWriteResult = Result<UnixDomainSocketWriteResponse, i32>;
3584
3585pub trait UnixDomainSocketProxyInterface: Send + Sync {
3586 fn r#clone(
3587 &self,
3588 request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3589 ) -> Result<(), fidl::Error>;
3590 type CloseResponseFut: std::future::Future<
3591 Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
3592 > + Send;
3593 fn r#close(&self) -> Self::CloseResponseFut;
3594 type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
3595 fn r#query(&self) -> Self::QueryResponseFut;
3596 type GetEventResponseFut: std::future::Future<Output = Result<UnixDomainSocketGetEventResult, fidl::Error>>
3597 + Send;
3598 fn r#get_event(&self, payload: &UnixDomainSocketGetEventRequest) -> Self::GetEventResponseFut;
3599 type ReadResponseFut: std::future::Future<Output = Result<UnixDomainSocketReadResult, fidl::Error>>
3600 + Send;
3601 fn r#read(&self, payload: &UnixDomainSocketReadRequest) -> Self::ReadResponseFut;
3602 type WriteResponseFut: std::future::Future<Output = Result<UnixDomainSocketWriteResult, fidl::Error>>
3603 + Send;
3604 fn r#write(&self, payload: UnixDomainSocketWriteRequest) -> Self::WriteResponseFut;
3605}
3606#[derive(Debug)]
3607#[cfg(target_os = "fuchsia")]
3608pub struct UnixDomainSocketSynchronousProxy {
3609 client: fidl::client::sync::Client,
3610}
3611
3612#[cfg(target_os = "fuchsia")]
3613impl fidl::endpoints::SynchronousProxy for UnixDomainSocketSynchronousProxy {
3614 type Proxy = UnixDomainSocketProxy;
3615 type Protocol = UnixDomainSocketMarker;
3616
3617 fn from_channel(inner: fidl::Channel) -> Self {
3618 Self::new(inner)
3619 }
3620
3621 fn into_channel(self) -> fidl::Channel {
3622 self.client.into_channel()
3623 }
3624
3625 fn as_channel(&self) -> &fidl::Channel {
3626 self.client.as_channel()
3627 }
3628}
3629
3630#[cfg(target_os = "fuchsia")]
3631impl UnixDomainSocketSynchronousProxy {
3632 pub fn new(channel: fidl::Channel) -> Self {
3633 let protocol_name = <UnixDomainSocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3634 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3635 }
3636
3637 pub fn into_channel(self) -> fidl::Channel {
3638 self.client.into_channel()
3639 }
3640
3641 pub fn wait_for_event(
3644 &self,
3645 deadline: zx::MonotonicInstant,
3646 ) -> Result<UnixDomainSocketEvent, fidl::Error> {
3647 UnixDomainSocketEvent::decode(self.client.wait_for_event(deadline)?)
3648 }
3649
3650 pub fn r#clone(
3651 &self,
3652 mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3653 ) -> Result<(), fidl::Error> {
3654 self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
3655 (request,),
3656 0x20d8a7aba2168a79,
3657 fidl::encoding::DynamicFlags::empty(),
3658 )
3659 }
3660
3661 pub fn r#close(
3672 &self,
3673 ___deadline: zx::MonotonicInstant,
3674 ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
3675 let _response = self.client.send_query::<
3676 fidl::encoding::EmptyPayload,
3677 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3678 >(
3679 (),
3680 0x5ac5d459ad7f657e,
3681 fidl::encoding::DynamicFlags::empty(),
3682 ___deadline,
3683 )?;
3684 Ok(_response.map(|x| x))
3685 }
3686
3687 pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
3688 let _response = self.client.send_query::<
3689 fidl::encoding::EmptyPayload,
3690 fidl_fuchsia_unknown::QueryableQueryResponse,
3691 >(
3692 (),
3693 0x2658edee9decfc06,
3694 fidl::encoding::DynamicFlags::empty(),
3695 ___deadline,
3696 )?;
3697 Ok(_response.protocol)
3698 }
3699
3700 pub fn r#get_event(
3705 &self,
3706 mut payload: &UnixDomainSocketGetEventRequest,
3707 ___deadline: zx::MonotonicInstant,
3708 ) -> Result<UnixDomainSocketGetEventResult, fidl::Error> {
3709 let _response = self.client.send_query::<
3710 UnixDomainSocketGetEventRequest,
3711 fidl::encoding::FlexibleResultType<UnixDomainSocketGetEventResponse, i32>,
3712 >(
3713 payload,
3714 0x4d79eb8f83961b41,
3715 fidl::encoding::DynamicFlags::FLEXIBLE,
3716 ___deadline,
3717 )?
3718 .into_result::<UnixDomainSocketMarker>("get_event")?;
3719 Ok(_response.map(|x| x))
3720 }
3721
3722 pub fn r#read(
3724 &self,
3725 mut payload: &UnixDomainSocketReadRequest,
3726 ___deadline: zx::MonotonicInstant,
3727 ) -> Result<UnixDomainSocketReadResult, fidl::Error> {
3728 let _response = self.client.send_query::<
3729 UnixDomainSocketReadRequest,
3730 fidl::encoding::FlexibleResultType<UnixDomainSocketReadResponse, i32>,
3731 >(
3732 payload,
3733 0x65ece02b0a73a069,
3734 fidl::encoding::DynamicFlags::FLEXIBLE,
3735 ___deadline,
3736 )?
3737 .into_result::<UnixDomainSocketMarker>("read")?;
3738 Ok(_response.map(|x| x))
3739 }
3740
3741 pub fn r#write(
3743 &self,
3744 mut payload: UnixDomainSocketWriteRequest,
3745 ___deadline: zx::MonotonicInstant,
3746 ) -> Result<UnixDomainSocketWriteResult, fidl::Error> {
3747 let _response = self.client.send_query::<
3748 UnixDomainSocketWriteRequest,
3749 fidl::encoding::FlexibleResultType<UnixDomainSocketWriteResponse, i32>,
3750 >(
3751 &mut payload,
3752 0x2339b58d4b835aee,
3753 fidl::encoding::DynamicFlags::FLEXIBLE,
3754 ___deadline,
3755 )?
3756 .into_result::<UnixDomainSocketMarker>("write")?;
3757 Ok(_response.map(|x| x))
3758 }
3759}
3760
3761#[derive(Debug, Clone)]
3762pub struct UnixDomainSocketProxy {
3763 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3764}
3765
3766impl fidl::endpoints::Proxy for UnixDomainSocketProxy {
3767 type Protocol = UnixDomainSocketMarker;
3768
3769 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3770 Self::new(inner)
3771 }
3772
3773 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3774 self.client.into_channel().map_err(|client| Self { client })
3775 }
3776
3777 fn as_channel(&self) -> &::fidl::AsyncChannel {
3778 self.client.as_channel()
3779 }
3780}
3781
3782impl UnixDomainSocketProxy {
3783 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3785 let protocol_name = <UnixDomainSocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3786 Self { client: fidl::client::Client::new(channel, protocol_name) }
3787 }
3788
3789 pub fn take_event_stream(&self) -> UnixDomainSocketEventStream {
3795 UnixDomainSocketEventStream { event_receiver: self.client.take_event_receiver() }
3796 }
3797
3798 pub fn r#clone(
3799 &self,
3800 mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3801 ) -> Result<(), fidl::Error> {
3802 UnixDomainSocketProxyInterface::r#clone(self, request)
3803 }
3804
3805 pub fn r#close(
3816 &self,
3817 ) -> fidl::client::QueryResponseFut<
3818 fidl_fuchsia_unknown::CloseableCloseResult,
3819 fidl::encoding::DefaultFuchsiaResourceDialect,
3820 > {
3821 UnixDomainSocketProxyInterface::r#close(self)
3822 }
3823
3824 pub fn r#query(
3825 &self,
3826 ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
3827 {
3828 UnixDomainSocketProxyInterface::r#query(self)
3829 }
3830
3831 pub fn r#get_event(
3836 &self,
3837 mut payload: &UnixDomainSocketGetEventRequest,
3838 ) -> fidl::client::QueryResponseFut<
3839 UnixDomainSocketGetEventResult,
3840 fidl::encoding::DefaultFuchsiaResourceDialect,
3841 > {
3842 UnixDomainSocketProxyInterface::r#get_event(self, payload)
3843 }
3844
3845 pub fn r#read(
3847 &self,
3848 mut payload: &UnixDomainSocketReadRequest,
3849 ) -> fidl::client::QueryResponseFut<
3850 UnixDomainSocketReadResult,
3851 fidl::encoding::DefaultFuchsiaResourceDialect,
3852 > {
3853 UnixDomainSocketProxyInterface::r#read(self, payload)
3854 }
3855
3856 pub fn r#write(
3858 &self,
3859 mut payload: UnixDomainSocketWriteRequest,
3860 ) -> fidl::client::QueryResponseFut<
3861 UnixDomainSocketWriteResult,
3862 fidl::encoding::DefaultFuchsiaResourceDialect,
3863 > {
3864 UnixDomainSocketProxyInterface::r#write(self, payload)
3865 }
3866}
3867
3868impl UnixDomainSocketProxyInterface for UnixDomainSocketProxy {
3869 fn r#clone(
3870 &self,
3871 mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3872 ) -> Result<(), fidl::Error> {
3873 self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
3874 (request,),
3875 0x20d8a7aba2168a79,
3876 fidl::encoding::DynamicFlags::empty(),
3877 )
3878 }
3879
3880 type CloseResponseFut = fidl::client::QueryResponseFut<
3881 fidl_fuchsia_unknown::CloseableCloseResult,
3882 fidl::encoding::DefaultFuchsiaResourceDialect,
3883 >;
3884 fn r#close(&self) -> Self::CloseResponseFut {
3885 fn _decode(
3886 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3887 ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
3888 let _response = fidl::client::decode_transaction_body::<
3889 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3890 fidl::encoding::DefaultFuchsiaResourceDialect,
3891 0x5ac5d459ad7f657e,
3892 >(_buf?)?;
3893 Ok(_response.map(|x| x))
3894 }
3895 self.client.send_query_and_decode::<
3896 fidl::encoding::EmptyPayload,
3897 fidl_fuchsia_unknown::CloseableCloseResult,
3898 >(
3899 (),
3900 0x5ac5d459ad7f657e,
3901 fidl::encoding::DynamicFlags::empty(),
3902 _decode,
3903 )
3904 }
3905
3906 type QueryResponseFut =
3907 fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
3908 fn r#query(&self) -> Self::QueryResponseFut {
3909 fn _decode(
3910 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3911 ) -> Result<Vec<u8>, fidl::Error> {
3912 let _response = fidl::client::decode_transaction_body::<
3913 fidl_fuchsia_unknown::QueryableQueryResponse,
3914 fidl::encoding::DefaultFuchsiaResourceDialect,
3915 0x2658edee9decfc06,
3916 >(_buf?)?;
3917 Ok(_response.protocol)
3918 }
3919 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
3920 (),
3921 0x2658edee9decfc06,
3922 fidl::encoding::DynamicFlags::empty(),
3923 _decode,
3924 )
3925 }
3926
3927 type GetEventResponseFut = fidl::client::QueryResponseFut<
3928 UnixDomainSocketGetEventResult,
3929 fidl::encoding::DefaultFuchsiaResourceDialect,
3930 >;
3931 fn r#get_event(
3932 &self,
3933 mut payload: &UnixDomainSocketGetEventRequest,
3934 ) -> Self::GetEventResponseFut {
3935 fn _decode(
3936 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3937 ) -> Result<UnixDomainSocketGetEventResult, fidl::Error> {
3938 let _response = fidl::client::decode_transaction_body::<
3939 fidl::encoding::FlexibleResultType<UnixDomainSocketGetEventResponse, i32>,
3940 fidl::encoding::DefaultFuchsiaResourceDialect,
3941 0x4d79eb8f83961b41,
3942 >(_buf?)?
3943 .into_result::<UnixDomainSocketMarker>("get_event")?;
3944 Ok(_response.map(|x| x))
3945 }
3946 self.client.send_query_and_decode::<
3947 UnixDomainSocketGetEventRequest,
3948 UnixDomainSocketGetEventResult,
3949 >(
3950 payload,
3951 0x4d79eb8f83961b41,
3952 fidl::encoding::DynamicFlags::FLEXIBLE,
3953 _decode,
3954 )
3955 }
3956
3957 type ReadResponseFut = fidl::client::QueryResponseFut<
3958 UnixDomainSocketReadResult,
3959 fidl::encoding::DefaultFuchsiaResourceDialect,
3960 >;
3961 fn r#read(&self, mut payload: &UnixDomainSocketReadRequest) -> Self::ReadResponseFut {
3962 fn _decode(
3963 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3964 ) -> Result<UnixDomainSocketReadResult, fidl::Error> {
3965 let _response = fidl::client::decode_transaction_body::<
3966 fidl::encoding::FlexibleResultType<UnixDomainSocketReadResponse, i32>,
3967 fidl::encoding::DefaultFuchsiaResourceDialect,
3968 0x65ece02b0a73a069,
3969 >(_buf?)?
3970 .into_result::<UnixDomainSocketMarker>("read")?;
3971 Ok(_response.map(|x| x))
3972 }
3973 self.client
3974 .send_query_and_decode::<UnixDomainSocketReadRequest, UnixDomainSocketReadResult>(
3975 payload,
3976 0x65ece02b0a73a069,
3977 fidl::encoding::DynamicFlags::FLEXIBLE,
3978 _decode,
3979 )
3980 }
3981
3982 type WriteResponseFut = fidl::client::QueryResponseFut<
3983 UnixDomainSocketWriteResult,
3984 fidl::encoding::DefaultFuchsiaResourceDialect,
3985 >;
3986 fn r#write(&self, mut payload: UnixDomainSocketWriteRequest) -> Self::WriteResponseFut {
3987 fn _decode(
3988 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3989 ) -> Result<UnixDomainSocketWriteResult, fidl::Error> {
3990 let _response = fidl::client::decode_transaction_body::<
3991 fidl::encoding::FlexibleResultType<UnixDomainSocketWriteResponse, i32>,
3992 fidl::encoding::DefaultFuchsiaResourceDialect,
3993 0x2339b58d4b835aee,
3994 >(_buf?)?
3995 .into_result::<UnixDomainSocketMarker>("write")?;
3996 Ok(_response.map(|x| x))
3997 }
3998 self.client
3999 .send_query_and_decode::<UnixDomainSocketWriteRequest, UnixDomainSocketWriteResult>(
4000 &mut payload,
4001 0x2339b58d4b835aee,
4002 fidl::encoding::DynamicFlags::FLEXIBLE,
4003 _decode,
4004 )
4005 }
4006}
4007
4008pub struct UnixDomainSocketEventStream {
4009 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4010}
4011
4012impl std::marker::Unpin for UnixDomainSocketEventStream {}
4013
4014impl futures::stream::FusedStream for UnixDomainSocketEventStream {
4015 fn is_terminated(&self) -> bool {
4016 self.event_receiver.is_terminated()
4017 }
4018}
4019
4020impl futures::Stream for UnixDomainSocketEventStream {
4021 type Item = Result<UnixDomainSocketEvent, fidl::Error>;
4022
4023 fn poll_next(
4024 mut self: std::pin::Pin<&mut Self>,
4025 cx: &mut std::task::Context<'_>,
4026 ) -> std::task::Poll<Option<Self::Item>> {
4027 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4028 &mut self.event_receiver,
4029 cx
4030 )?) {
4031 Some(buf) => std::task::Poll::Ready(Some(UnixDomainSocketEvent::decode(buf))),
4032 None => std::task::Poll::Ready(None),
4033 }
4034 }
4035}
4036
4037#[derive(Debug)]
4038pub enum UnixDomainSocketEvent {
4039 #[non_exhaustive]
4040 _UnknownEvent {
4041 ordinal: u64,
4043 },
4044}
4045
4046impl UnixDomainSocketEvent {
4047 fn decode(
4049 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4050 ) -> Result<UnixDomainSocketEvent, fidl::Error> {
4051 let (bytes, _handles) = buf.split_mut();
4052 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4053 debug_assert_eq!(tx_header.tx_id, 0);
4054 match tx_header.ordinal {
4055 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4056 Ok(UnixDomainSocketEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4057 }
4058 _ => Err(fidl::Error::UnknownOrdinal {
4059 ordinal: tx_header.ordinal,
4060 protocol_name:
4061 <UnixDomainSocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4062 }),
4063 }
4064 }
4065}
4066
4067pub struct UnixDomainSocketRequestStream {
4069 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4070 is_terminated: bool,
4071}
4072
4073impl std::marker::Unpin for UnixDomainSocketRequestStream {}
4074
4075impl futures::stream::FusedStream for UnixDomainSocketRequestStream {
4076 fn is_terminated(&self) -> bool {
4077 self.is_terminated
4078 }
4079}
4080
4081impl fidl::endpoints::RequestStream for UnixDomainSocketRequestStream {
4082 type Protocol = UnixDomainSocketMarker;
4083 type ControlHandle = UnixDomainSocketControlHandle;
4084
4085 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4086 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4087 }
4088
4089 fn control_handle(&self) -> Self::ControlHandle {
4090 UnixDomainSocketControlHandle { inner: self.inner.clone() }
4091 }
4092
4093 fn into_inner(
4094 self,
4095 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4096 {
4097 (self.inner, self.is_terminated)
4098 }
4099
4100 fn from_inner(
4101 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4102 is_terminated: bool,
4103 ) -> Self {
4104 Self { inner, is_terminated }
4105 }
4106}
4107
4108impl futures::Stream for UnixDomainSocketRequestStream {
4109 type Item = Result<UnixDomainSocketRequest, fidl::Error>;
4110
4111 fn poll_next(
4112 mut self: std::pin::Pin<&mut Self>,
4113 cx: &mut std::task::Context<'_>,
4114 ) -> std::task::Poll<Option<Self::Item>> {
4115 let this = &mut *self;
4116 if this.inner.check_shutdown(cx) {
4117 this.is_terminated = true;
4118 return std::task::Poll::Ready(None);
4119 }
4120 if this.is_terminated {
4121 panic!("polled UnixDomainSocketRequestStream after completion");
4122 }
4123 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4124 |bytes, handles| {
4125 match this.inner.channel().read_etc(cx, bytes, handles) {
4126 std::task::Poll::Ready(Ok(())) => {}
4127 std::task::Poll::Pending => return std::task::Poll::Pending,
4128 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4129 this.is_terminated = true;
4130 return std::task::Poll::Ready(None);
4131 }
4132 std::task::Poll::Ready(Err(e)) => {
4133 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4134 e.into(),
4135 ))))
4136 }
4137 }
4138
4139 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4141
4142 std::task::Poll::Ready(Some(match header.ordinal {
4143 0x20d8a7aba2168a79 => {
4144 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4145 let mut req = fidl::new_empty!(
4146 fidl_fuchsia_unknown::CloneableCloneRequest,
4147 fidl::encoding::DefaultFuchsiaResourceDialect
4148 );
4149 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
4150 let control_handle =
4151 UnixDomainSocketControlHandle { inner: this.inner.clone() };
4152 Ok(UnixDomainSocketRequest::Clone { request: req.request, control_handle })
4153 }
4154 0x5ac5d459ad7f657e => {
4155 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4156 let mut req = fidl::new_empty!(
4157 fidl::encoding::EmptyPayload,
4158 fidl::encoding::DefaultFuchsiaResourceDialect
4159 );
4160 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4161 let control_handle =
4162 UnixDomainSocketControlHandle { inner: this.inner.clone() };
4163 Ok(UnixDomainSocketRequest::Close {
4164 responder: UnixDomainSocketCloseResponder {
4165 control_handle: std::mem::ManuallyDrop::new(control_handle),
4166 tx_id: header.tx_id,
4167 },
4168 })
4169 }
4170 0x2658edee9decfc06 => {
4171 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4172 let mut req = fidl::new_empty!(
4173 fidl::encoding::EmptyPayload,
4174 fidl::encoding::DefaultFuchsiaResourceDialect
4175 );
4176 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4177 let control_handle =
4178 UnixDomainSocketControlHandle { inner: this.inner.clone() };
4179 Ok(UnixDomainSocketRequest::Query {
4180 responder: UnixDomainSocketQueryResponder {
4181 control_handle: std::mem::ManuallyDrop::new(control_handle),
4182 tx_id: header.tx_id,
4183 },
4184 })
4185 }
4186 0x4d79eb8f83961b41 => {
4187 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4188 let mut req = fidl::new_empty!(
4189 UnixDomainSocketGetEventRequest,
4190 fidl::encoding::DefaultFuchsiaResourceDialect
4191 );
4192 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UnixDomainSocketGetEventRequest>(&header, _body_bytes, handles, &mut req)?;
4193 let control_handle =
4194 UnixDomainSocketControlHandle { inner: this.inner.clone() };
4195 Ok(UnixDomainSocketRequest::GetEvent {
4196 payload: req,
4197 responder: UnixDomainSocketGetEventResponder {
4198 control_handle: std::mem::ManuallyDrop::new(control_handle),
4199 tx_id: header.tx_id,
4200 },
4201 })
4202 }
4203 0x65ece02b0a73a069 => {
4204 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4205 let mut req = fidl::new_empty!(
4206 UnixDomainSocketReadRequest,
4207 fidl::encoding::DefaultFuchsiaResourceDialect
4208 );
4209 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UnixDomainSocketReadRequest>(&header, _body_bytes, handles, &mut req)?;
4210 let control_handle =
4211 UnixDomainSocketControlHandle { inner: this.inner.clone() };
4212 Ok(UnixDomainSocketRequest::Read {
4213 payload: req,
4214 responder: UnixDomainSocketReadResponder {
4215 control_handle: std::mem::ManuallyDrop::new(control_handle),
4216 tx_id: header.tx_id,
4217 },
4218 })
4219 }
4220 0x2339b58d4b835aee => {
4221 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4222 let mut req = fidl::new_empty!(
4223 UnixDomainSocketWriteRequest,
4224 fidl::encoding::DefaultFuchsiaResourceDialect
4225 );
4226 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UnixDomainSocketWriteRequest>(&header, _body_bytes, handles, &mut req)?;
4227 let control_handle =
4228 UnixDomainSocketControlHandle { inner: this.inner.clone() };
4229 Ok(UnixDomainSocketRequest::Write {
4230 payload: req,
4231 responder: UnixDomainSocketWriteResponder {
4232 control_handle: std::mem::ManuallyDrop::new(control_handle),
4233 tx_id: header.tx_id,
4234 },
4235 })
4236 }
4237 _ if header.tx_id == 0
4238 && header
4239 .dynamic_flags()
4240 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4241 {
4242 Ok(UnixDomainSocketRequest::_UnknownMethod {
4243 ordinal: header.ordinal,
4244 control_handle: UnixDomainSocketControlHandle {
4245 inner: this.inner.clone(),
4246 },
4247 method_type: fidl::MethodType::OneWay,
4248 })
4249 }
4250 _ if header
4251 .dynamic_flags()
4252 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4253 {
4254 this.inner.send_framework_err(
4255 fidl::encoding::FrameworkErr::UnknownMethod,
4256 header.tx_id,
4257 header.ordinal,
4258 header.dynamic_flags(),
4259 (bytes, handles),
4260 )?;
4261 Ok(UnixDomainSocketRequest::_UnknownMethod {
4262 ordinal: header.ordinal,
4263 control_handle: UnixDomainSocketControlHandle {
4264 inner: this.inner.clone(),
4265 },
4266 method_type: fidl::MethodType::TwoWay,
4267 })
4268 }
4269 _ => Err(fidl::Error::UnknownOrdinal {
4270 ordinal: header.ordinal,
4271 protocol_name:
4272 <UnixDomainSocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4273 }),
4274 }))
4275 },
4276 )
4277 }
4278}
4279
4280#[derive(Debug)]
4286pub enum UnixDomainSocketRequest {
4287 Clone {
4288 request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4289 control_handle: UnixDomainSocketControlHandle,
4290 },
4291 Close {
4302 responder: UnixDomainSocketCloseResponder,
4303 },
4304 Query {
4305 responder: UnixDomainSocketQueryResponder,
4306 },
4307 GetEvent {
4312 payload: UnixDomainSocketGetEventRequest,
4313 responder: UnixDomainSocketGetEventResponder,
4314 },
4315 Read {
4317 payload: UnixDomainSocketReadRequest,
4318 responder: UnixDomainSocketReadResponder,
4319 },
4320 Write {
4322 payload: UnixDomainSocketWriteRequest,
4323 responder: UnixDomainSocketWriteResponder,
4324 },
4325 #[non_exhaustive]
4327 _UnknownMethod {
4328 ordinal: u64,
4330 control_handle: UnixDomainSocketControlHandle,
4331 method_type: fidl::MethodType,
4332 },
4333}
4334
4335impl UnixDomainSocketRequest {
4336 #[allow(irrefutable_let_patterns)]
4337 pub fn into_clone(
4338 self,
4339 ) -> Option<(
4340 fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4341 UnixDomainSocketControlHandle,
4342 )> {
4343 if let UnixDomainSocketRequest::Clone { request, control_handle } = self {
4344 Some((request, control_handle))
4345 } else {
4346 None
4347 }
4348 }
4349
4350 #[allow(irrefutable_let_patterns)]
4351 pub fn into_close(self) -> Option<(UnixDomainSocketCloseResponder)> {
4352 if let UnixDomainSocketRequest::Close { responder } = self {
4353 Some((responder))
4354 } else {
4355 None
4356 }
4357 }
4358
4359 #[allow(irrefutable_let_patterns)]
4360 pub fn into_query(self) -> Option<(UnixDomainSocketQueryResponder)> {
4361 if let UnixDomainSocketRequest::Query { responder } = self {
4362 Some((responder))
4363 } else {
4364 None
4365 }
4366 }
4367
4368 #[allow(irrefutable_let_patterns)]
4369 pub fn into_get_event(
4370 self,
4371 ) -> Option<(UnixDomainSocketGetEventRequest, UnixDomainSocketGetEventResponder)> {
4372 if let UnixDomainSocketRequest::GetEvent { payload, responder } = self {
4373 Some((payload, responder))
4374 } else {
4375 None
4376 }
4377 }
4378
4379 #[allow(irrefutable_let_patterns)]
4380 pub fn into_read(self) -> Option<(UnixDomainSocketReadRequest, UnixDomainSocketReadResponder)> {
4381 if let UnixDomainSocketRequest::Read { payload, responder } = self {
4382 Some((payload, responder))
4383 } else {
4384 None
4385 }
4386 }
4387
4388 #[allow(irrefutable_let_patterns)]
4389 pub fn into_write(
4390 self,
4391 ) -> Option<(UnixDomainSocketWriteRequest, UnixDomainSocketWriteResponder)> {
4392 if let UnixDomainSocketRequest::Write { payload, responder } = self {
4393 Some((payload, responder))
4394 } else {
4395 None
4396 }
4397 }
4398
4399 pub fn method_name(&self) -> &'static str {
4401 match *self {
4402 UnixDomainSocketRequest::Clone { .. } => "clone",
4403 UnixDomainSocketRequest::Close { .. } => "close",
4404 UnixDomainSocketRequest::Query { .. } => "query",
4405 UnixDomainSocketRequest::GetEvent { .. } => "get_event",
4406 UnixDomainSocketRequest::Read { .. } => "read",
4407 UnixDomainSocketRequest::Write { .. } => "write",
4408 UnixDomainSocketRequest::_UnknownMethod {
4409 method_type: fidl::MethodType::OneWay,
4410 ..
4411 } => "unknown one-way method",
4412 UnixDomainSocketRequest::_UnknownMethod {
4413 method_type: fidl::MethodType::TwoWay,
4414 ..
4415 } => "unknown two-way method",
4416 }
4417 }
4418}
4419
4420#[derive(Debug, Clone)]
4421pub struct UnixDomainSocketControlHandle {
4422 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4423}
4424
4425impl fidl::endpoints::ControlHandle for UnixDomainSocketControlHandle {
4426 fn shutdown(&self) {
4427 self.inner.shutdown()
4428 }
4429 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4430 self.inner.shutdown_with_epitaph(status)
4431 }
4432
4433 fn is_closed(&self) -> bool {
4434 self.inner.channel().is_closed()
4435 }
4436 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4437 self.inner.channel().on_closed()
4438 }
4439
4440 #[cfg(target_os = "fuchsia")]
4441 fn signal_peer(
4442 &self,
4443 clear_mask: zx::Signals,
4444 set_mask: zx::Signals,
4445 ) -> Result<(), zx_status::Status> {
4446 use fidl::Peered;
4447 self.inner.channel().signal_peer(clear_mask, set_mask)
4448 }
4449}
4450
4451impl UnixDomainSocketControlHandle {}
4452
4453#[must_use = "FIDL methods require a response to be sent"]
4454#[derive(Debug)]
4455pub struct UnixDomainSocketCloseResponder {
4456 control_handle: std::mem::ManuallyDrop<UnixDomainSocketControlHandle>,
4457 tx_id: u32,
4458}
4459
4460impl std::ops::Drop for UnixDomainSocketCloseResponder {
4464 fn drop(&mut self) {
4465 self.control_handle.shutdown();
4466 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4468 }
4469}
4470
4471impl fidl::endpoints::Responder for UnixDomainSocketCloseResponder {
4472 type ControlHandle = UnixDomainSocketControlHandle;
4473
4474 fn control_handle(&self) -> &UnixDomainSocketControlHandle {
4475 &self.control_handle
4476 }
4477
4478 fn drop_without_shutdown(mut self) {
4479 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4481 std::mem::forget(self);
4483 }
4484}
4485
4486impl UnixDomainSocketCloseResponder {
4487 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4491 let _result = self.send_raw(result);
4492 if _result.is_err() {
4493 self.control_handle.shutdown();
4494 }
4495 self.drop_without_shutdown();
4496 _result
4497 }
4498
4499 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4501 let _result = self.send_raw(result);
4502 self.drop_without_shutdown();
4503 _result
4504 }
4505
4506 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4507 self.control_handle
4508 .inner
4509 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4510 result,
4511 self.tx_id,
4512 0x5ac5d459ad7f657e,
4513 fidl::encoding::DynamicFlags::empty(),
4514 )
4515 }
4516}
4517
4518#[must_use = "FIDL methods require a response to be sent"]
4519#[derive(Debug)]
4520pub struct UnixDomainSocketQueryResponder {
4521 control_handle: std::mem::ManuallyDrop<UnixDomainSocketControlHandle>,
4522 tx_id: u32,
4523}
4524
4525impl std::ops::Drop for UnixDomainSocketQueryResponder {
4529 fn drop(&mut self) {
4530 self.control_handle.shutdown();
4531 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4533 }
4534}
4535
4536impl fidl::endpoints::Responder for UnixDomainSocketQueryResponder {
4537 type ControlHandle = UnixDomainSocketControlHandle;
4538
4539 fn control_handle(&self) -> &UnixDomainSocketControlHandle {
4540 &self.control_handle
4541 }
4542
4543 fn drop_without_shutdown(mut self) {
4544 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4546 std::mem::forget(self);
4548 }
4549}
4550
4551impl UnixDomainSocketQueryResponder {
4552 pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4556 let _result = self.send_raw(protocol);
4557 if _result.is_err() {
4558 self.control_handle.shutdown();
4559 }
4560 self.drop_without_shutdown();
4561 _result
4562 }
4563
4564 pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4566 let _result = self.send_raw(protocol);
4567 self.drop_without_shutdown();
4568 _result
4569 }
4570
4571 fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4572 self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4573 (protocol,),
4574 self.tx_id,
4575 0x2658edee9decfc06,
4576 fidl::encoding::DynamicFlags::empty(),
4577 )
4578 }
4579}
4580
4581#[must_use = "FIDL methods require a response to be sent"]
4582#[derive(Debug)]
4583pub struct UnixDomainSocketGetEventResponder {
4584 control_handle: std::mem::ManuallyDrop<UnixDomainSocketControlHandle>,
4585 tx_id: u32,
4586}
4587
4588impl std::ops::Drop for UnixDomainSocketGetEventResponder {
4592 fn drop(&mut self) {
4593 self.control_handle.shutdown();
4594 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4596 }
4597}
4598
4599impl fidl::endpoints::Responder for UnixDomainSocketGetEventResponder {
4600 type ControlHandle = UnixDomainSocketControlHandle;
4601
4602 fn control_handle(&self) -> &UnixDomainSocketControlHandle {
4603 &self.control_handle
4604 }
4605
4606 fn drop_without_shutdown(mut self) {
4607 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4609 std::mem::forget(self);
4611 }
4612}
4613
4614impl UnixDomainSocketGetEventResponder {
4615 pub fn send(
4619 self,
4620 mut result: Result<UnixDomainSocketGetEventResponse, i32>,
4621 ) -> Result<(), fidl::Error> {
4622 let _result = self.send_raw(result);
4623 if _result.is_err() {
4624 self.control_handle.shutdown();
4625 }
4626 self.drop_without_shutdown();
4627 _result
4628 }
4629
4630 pub fn send_no_shutdown_on_err(
4632 self,
4633 mut result: Result<UnixDomainSocketGetEventResponse, i32>,
4634 ) -> Result<(), fidl::Error> {
4635 let _result = self.send_raw(result);
4636 self.drop_without_shutdown();
4637 _result
4638 }
4639
4640 fn send_raw(
4641 &self,
4642 mut result: Result<UnixDomainSocketGetEventResponse, i32>,
4643 ) -> Result<(), fidl::Error> {
4644 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4645 UnixDomainSocketGetEventResponse,
4646 i32,
4647 >>(
4648 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4649 self.tx_id,
4650 0x4d79eb8f83961b41,
4651 fidl::encoding::DynamicFlags::FLEXIBLE,
4652 )
4653 }
4654}
4655
4656#[must_use = "FIDL methods require a response to be sent"]
4657#[derive(Debug)]
4658pub struct UnixDomainSocketReadResponder {
4659 control_handle: std::mem::ManuallyDrop<UnixDomainSocketControlHandle>,
4660 tx_id: u32,
4661}
4662
4663impl std::ops::Drop for UnixDomainSocketReadResponder {
4667 fn drop(&mut self) {
4668 self.control_handle.shutdown();
4669 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4671 }
4672}
4673
4674impl fidl::endpoints::Responder for UnixDomainSocketReadResponder {
4675 type ControlHandle = UnixDomainSocketControlHandle;
4676
4677 fn control_handle(&self) -> &UnixDomainSocketControlHandle {
4678 &self.control_handle
4679 }
4680
4681 fn drop_without_shutdown(mut self) {
4682 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4684 std::mem::forget(self);
4686 }
4687}
4688
4689impl UnixDomainSocketReadResponder {
4690 pub fn send(
4694 self,
4695 mut result: Result<UnixDomainSocketReadResponse, i32>,
4696 ) -> Result<(), fidl::Error> {
4697 let _result = self.send_raw(result);
4698 if _result.is_err() {
4699 self.control_handle.shutdown();
4700 }
4701 self.drop_without_shutdown();
4702 _result
4703 }
4704
4705 pub fn send_no_shutdown_on_err(
4707 self,
4708 mut result: Result<UnixDomainSocketReadResponse, i32>,
4709 ) -> Result<(), fidl::Error> {
4710 let _result = self.send_raw(result);
4711 self.drop_without_shutdown();
4712 _result
4713 }
4714
4715 fn send_raw(
4716 &self,
4717 mut result: Result<UnixDomainSocketReadResponse, i32>,
4718 ) -> Result<(), fidl::Error> {
4719 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4720 UnixDomainSocketReadResponse,
4721 i32,
4722 >>(
4723 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4724 self.tx_id,
4725 0x65ece02b0a73a069,
4726 fidl::encoding::DynamicFlags::FLEXIBLE,
4727 )
4728 }
4729}
4730
4731#[must_use = "FIDL methods require a response to be sent"]
4732#[derive(Debug)]
4733pub struct UnixDomainSocketWriteResponder {
4734 control_handle: std::mem::ManuallyDrop<UnixDomainSocketControlHandle>,
4735 tx_id: u32,
4736}
4737
4738impl std::ops::Drop for UnixDomainSocketWriteResponder {
4742 fn drop(&mut self) {
4743 self.control_handle.shutdown();
4744 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4746 }
4747}
4748
4749impl fidl::endpoints::Responder for UnixDomainSocketWriteResponder {
4750 type ControlHandle = UnixDomainSocketControlHandle;
4751
4752 fn control_handle(&self) -> &UnixDomainSocketControlHandle {
4753 &self.control_handle
4754 }
4755
4756 fn drop_without_shutdown(mut self) {
4757 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4759 std::mem::forget(self);
4761 }
4762}
4763
4764impl UnixDomainSocketWriteResponder {
4765 pub fn send(
4769 self,
4770 mut result: Result<&UnixDomainSocketWriteResponse, i32>,
4771 ) -> Result<(), fidl::Error> {
4772 let _result = self.send_raw(result);
4773 if _result.is_err() {
4774 self.control_handle.shutdown();
4775 }
4776 self.drop_without_shutdown();
4777 _result
4778 }
4779
4780 pub fn send_no_shutdown_on_err(
4782 self,
4783 mut result: Result<&UnixDomainSocketWriteResponse, i32>,
4784 ) -> Result<(), fidl::Error> {
4785 let _result = self.send_raw(result);
4786 self.drop_without_shutdown();
4787 _result
4788 }
4789
4790 fn send_raw(
4791 &self,
4792 mut result: Result<&UnixDomainSocketWriteResponse, i32>,
4793 ) -> Result<(), fidl::Error> {
4794 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4795 UnixDomainSocketWriteResponse,
4796 i32,
4797 >>(
4798 fidl::encoding::FlexibleResult::new(result),
4799 self.tx_id,
4800 0x2339b58d4b835aee,
4801 fidl::encoding::DynamicFlags::FLEXIBLE,
4802 )
4803 }
4804}
4805
4806mod internal {
4807 use super::*;
4808
4809 impl fidl::encoding::ResourceTypeMarker for BinderSetVmoRequest {
4810 type Borrowed<'a> = &'a mut Self;
4811 fn take_or_borrow<'a>(
4812 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4813 ) -> Self::Borrowed<'a> {
4814 value
4815 }
4816 }
4817
4818 unsafe impl fidl::encoding::TypeMarker for BinderSetVmoRequest {
4819 type Owned = Self;
4820
4821 #[inline(always)]
4822 fn inline_align(_context: fidl::encoding::Context) -> usize {
4823 8
4824 }
4825
4826 #[inline(always)]
4827 fn inline_size(_context: fidl::encoding::Context) -> usize {
4828 16
4829 }
4830 }
4831
4832 unsafe impl
4833 fidl::encoding::Encode<BinderSetVmoRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4834 for &mut BinderSetVmoRequest
4835 {
4836 #[inline]
4837 unsafe fn encode(
4838 self,
4839 encoder: &mut fidl::encoding::Encoder<
4840 '_,
4841 fidl::encoding::DefaultFuchsiaResourceDialect,
4842 >,
4843 offset: usize,
4844 _depth: fidl::encoding::Depth,
4845 ) -> fidl::Result<()> {
4846 encoder.debug_check_bounds::<BinderSetVmoRequest>(offset);
4847 fidl::encoding::Encode::<
4849 BinderSetVmoRequest,
4850 fidl::encoding::DefaultFuchsiaResourceDialect,
4851 >::encode(
4852 (
4853 <fidl::encoding::HandleType<
4854 fidl::Vmo,
4855 { fidl::ObjectType::VMO.into_raw() },
4856 2147483648,
4857 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4858 &mut self.vmo
4859 ),
4860 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.mapped_address),
4861 ),
4862 encoder,
4863 offset,
4864 _depth,
4865 )
4866 }
4867 }
4868 unsafe impl<
4869 T0: fidl::encoding::Encode<
4870 fidl::encoding::HandleType<
4871 fidl::Vmo,
4872 { fidl::ObjectType::VMO.into_raw() },
4873 2147483648,
4874 >,
4875 fidl::encoding::DefaultFuchsiaResourceDialect,
4876 >,
4877 T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4878 >
4879 fidl::encoding::Encode<BinderSetVmoRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4880 for (T0, T1)
4881 {
4882 #[inline]
4883 unsafe fn encode(
4884 self,
4885 encoder: &mut fidl::encoding::Encoder<
4886 '_,
4887 fidl::encoding::DefaultFuchsiaResourceDialect,
4888 >,
4889 offset: usize,
4890 depth: fidl::encoding::Depth,
4891 ) -> fidl::Result<()> {
4892 encoder.debug_check_bounds::<BinderSetVmoRequest>(offset);
4893 unsafe {
4896 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4897 (ptr as *mut u64).write_unaligned(0);
4898 }
4899 self.0.encode(encoder, offset + 0, depth)?;
4901 self.1.encode(encoder, offset + 8, depth)?;
4902 Ok(())
4903 }
4904 }
4905
4906 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4907 for BinderSetVmoRequest
4908 {
4909 #[inline(always)]
4910 fn new_empty() -> Self {
4911 Self {
4912 vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4913 mapped_address: fidl::new_empty!(
4914 u64,
4915 fidl::encoding::DefaultFuchsiaResourceDialect
4916 ),
4917 }
4918 }
4919
4920 #[inline]
4921 unsafe fn decode(
4922 &mut self,
4923 decoder: &mut fidl::encoding::Decoder<
4924 '_,
4925 fidl::encoding::DefaultFuchsiaResourceDialect,
4926 >,
4927 offset: usize,
4928 _depth: fidl::encoding::Depth,
4929 ) -> fidl::Result<()> {
4930 decoder.debug_check_bounds::<Self>(offset);
4931 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4933 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4934 let mask = 0xffffffff00000000u64;
4935 let maskedval = padval & mask;
4936 if maskedval != 0 {
4937 return Err(fidl::Error::NonZeroPadding {
4938 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4939 });
4940 }
4941 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
4942 fidl::decode!(
4943 u64,
4944 fidl::encoding::DefaultFuchsiaResourceDialect,
4945 &mut self.mapped_address,
4946 decoder,
4947 offset + 8,
4948 _depth
4949 )?;
4950 Ok(())
4951 }
4952 }
4953
4954 impl fidl::encoding::ResourceTypeMarker for ProcessAccessorWriteMemoryRequest {
4955 type Borrowed<'a> = &'a mut Self;
4956 fn take_or_borrow<'a>(
4957 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4958 ) -> Self::Borrowed<'a> {
4959 value
4960 }
4961 }
4962
4963 unsafe impl fidl::encoding::TypeMarker for ProcessAccessorWriteMemoryRequest {
4964 type Owned = Self;
4965
4966 #[inline(always)]
4967 fn inline_align(_context: fidl::encoding::Context) -> usize {
4968 8
4969 }
4970
4971 #[inline(always)]
4972 fn inline_size(_context: fidl::encoding::Context) -> usize {
4973 16
4974 }
4975 }
4976
4977 unsafe impl
4978 fidl::encoding::Encode<
4979 ProcessAccessorWriteMemoryRequest,
4980 fidl::encoding::DefaultFuchsiaResourceDialect,
4981 > for &mut ProcessAccessorWriteMemoryRequest
4982 {
4983 #[inline]
4984 unsafe fn encode(
4985 self,
4986 encoder: &mut fidl::encoding::Encoder<
4987 '_,
4988 fidl::encoding::DefaultFuchsiaResourceDialect,
4989 >,
4990 offset: usize,
4991 _depth: fidl::encoding::Depth,
4992 ) -> fidl::Result<()> {
4993 encoder.debug_check_bounds::<ProcessAccessorWriteMemoryRequest>(offset);
4994 fidl::encoding::Encode::<
4996 ProcessAccessorWriteMemoryRequest,
4997 fidl::encoding::DefaultFuchsiaResourceDialect,
4998 >::encode(
4999 (
5000 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.address),
5001 <fidl::encoding::HandleType<
5002 fidl::Vmo,
5003 { fidl::ObjectType::VMO.into_raw() },
5004 2147483648,
5005 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5006 &mut self.content
5007 ),
5008 ),
5009 encoder,
5010 offset,
5011 _depth,
5012 )
5013 }
5014 }
5015 unsafe impl<
5016 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
5017 T1: fidl::encoding::Encode<
5018 fidl::encoding::HandleType<
5019 fidl::Vmo,
5020 { fidl::ObjectType::VMO.into_raw() },
5021 2147483648,
5022 >,
5023 fidl::encoding::DefaultFuchsiaResourceDialect,
5024 >,
5025 >
5026 fidl::encoding::Encode<
5027 ProcessAccessorWriteMemoryRequest,
5028 fidl::encoding::DefaultFuchsiaResourceDialect,
5029 > for (T0, T1)
5030 {
5031 #[inline]
5032 unsafe fn encode(
5033 self,
5034 encoder: &mut fidl::encoding::Encoder<
5035 '_,
5036 fidl::encoding::DefaultFuchsiaResourceDialect,
5037 >,
5038 offset: usize,
5039 depth: fidl::encoding::Depth,
5040 ) -> fidl::Result<()> {
5041 encoder.debug_check_bounds::<ProcessAccessorWriteMemoryRequest>(offset);
5042 unsafe {
5045 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
5046 (ptr as *mut u64).write_unaligned(0);
5047 }
5048 self.0.encode(encoder, offset + 0, depth)?;
5050 self.1.encode(encoder, offset + 8, depth)?;
5051 Ok(())
5052 }
5053 }
5054
5055 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5056 for ProcessAccessorWriteMemoryRequest
5057 {
5058 #[inline(always)]
5059 fn new_empty() -> Self {
5060 Self {
5061 address: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
5062 content: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5063 }
5064 }
5065
5066 #[inline]
5067 unsafe fn decode(
5068 &mut self,
5069 decoder: &mut fidl::encoding::Decoder<
5070 '_,
5071 fidl::encoding::DefaultFuchsiaResourceDialect,
5072 >,
5073 offset: usize,
5074 _depth: fidl::encoding::Depth,
5075 ) -> fidl::Result<()> {
5076 decoder.debug_check_bounds::<Self>(offset);
5077 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
5079 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5080 let mask = 0xffffffff00000000u64;
5081 let maskedval = padval & mask;
5082 if maskedval != 0 {
5083 return Err(fidl::Error::NonZeroPadding {
5084 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5085 });
5086 }
5087 fidl::decode!(
5088 u64,
5089 fidl::encoding::DefaultFuchsiaResourceDialect,
5090 &mut self.address,
5091 decoder,
5092 offset + 0,
5093 _depth
5094 )?;
5095 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.content, decoder, offset + 8, _depth)?;
5096 Ok(())
5097 }
5098 }
5099
5100 impl ContainerPowerControllerRegisterWakeWatcherRequest {
5101 #[inline(always)]
5102 fn max_ordinal_present(&self) -> u64 {
5103 if let Some(_) = self.watcher {
5104 return 1;
5105 }
5106 0
5107 }
5108 }
5109
5110 impl fidl::encoding::ResourceTypeMarker for ContainerPowerControllerRegisterWakeWatcherRequest {
5111 type Borrowed<'a> = &'a mut Self;
5112 fn take_or_borrow<'a>(
5113 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5114 ) -> Self::Borrowed<'a> {
5115 value
5116 }
5117 }
5118
5119 unsafe impl fidl::encoding::TypeMarker for ContainerPowerControllerRegisterWakeWatcherRequest {
5120 type Owned = Self;
5121
5122 #[inline(always)]
5123 fn inline_align(_context: fidl::encoding::Context) -> usize {
5124 8
5125 }
5126
5127 #[inline(always)]
5128 fn inline_size(_context: fidl::encoding::Context) -> usize {
5129 16
5130 }
5131 }
5132
5133 unsafe impl
5134 fidl::encoding::Encode<
5135 ContainerPowerControllerRegisterWakeWatcherRequest,
5136 fidl::encoding::DefaultFuchsiaResourceDialect,
5137 > for &mut ContainerPowerControllerRegisterWakeWatcherRequest
5138 {
5139 unsafe fn encode(
5140 self,
5141 encoder: &mut fidl::encoding::Encoder<
5142 '_,
5143 fidl::encoding::DefaultFuchsiaResourceDialect,
5144 >,
5145 offset: usize,
5146 mut depth: fidl::encoding::Depth,
5147 ) -> fidl::Result<()> {
5148 encoder
5149 .debug_check_bounds::<ContainerPowerControllerRegisterWakeWatcherRequest>(offset);
5150 let max_ordinal: u64 = self.max_ordinal_present();
5152 encoder.write_num(max_ordinal, offset);
5153 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5154 if max_ordinal == 0 {
5156 return Ok(());
5157 }
5158 depth.increment()?;
5159 let envelope_size = 8;
5160 let bytes_len = max_ordinal as usize * envelope_size;
5161 #[allow(unused_variables)]
5162 let offset = encoder.out_of_line_offset(bytes_len);
5163 let mut _prev_end_offset: usize = 0;
5164 if 1 > max_ordinal {
5165 return Ok(());
5166 }
5167
5168 let cur_offset: usize = (1 - 1) * envelope_size;
5171
5172 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5174
5175 fidl::encoding::encode_in_envelope_optional::<
5180 fidl::encoding::HandleType<
5181 fidl::EventPair,
5182 { fidl::ObjectType::EVENTPAIR.into_raw() },
5183 2147483648,
5184 >,
5185 fidl::encoding::DefaultFuchsiaResourceDialect,
5186 >(
5187 self.watcher.as_mut().map(
5188 <fidl::encoding::HandleType<
5189 fidl::EventPair,
5190 { fidl::ObjectType::EVENTPAIR.into_raw() },
5191 2147483648,
5192 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5193 ),
5194 encoder,
5195 offset + cur_offset,
5196 depth,
5197 )?;
5198
5199 _prev_end_offset = cur_offset + envelope_size;
5200
5201 Ok(())
5202 }
5203 }
5204
5205 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5206 for ContainerPowerControllerRegisterWakeWatcherRequest
5207 {
5208 #[inline(always)]
5209 fn new_empty() -> Self {
5210 Self::default()
5211 }
5212
5213 unsafe fn decode(
5214 &mut self,
5215 decoder: &mut fidl::encoding::Decoder<
5216 '_,
5217 fidl::encoding::DefaultFuchsiaResourceDialect,
5218 >,
5219 offset: usize,
5220 mut depth: fidl::encoding::Depth,
5221 ) -> fidl::Result<()> {
5222 decoder.debug_check_bounds::<Self>(offset);
5223 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5224 None => return Err(fidl::Error::NotNullable),
5225 Some(len) => len,
5226 };
5227 if len == 0 {
5229 return Ok(());
5230 };
5231 depth.increment()?;
5232 let envelope_size = 8;
5233 let bytes_len = len * envelope_size;
5234 let offset = decoder.out_of_line_offset(bytes_len)?;
5235 let mut _next_ordinal_to_read = 0;
5237 let mut next_offset = offset;
5238 let end_offset = offset + bytes_len;
5239 _next_ordinal_to_read += 1;
5240 if next_offset >= end_offset {
5241 return Ok(());
5242 }
5243
5244 while _next_ordinal_to_read < 1 {
5246 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5247 _next_ordinal_to_read += 1;
5248 next_offset += envelope_size;
5249 }
5250
5251 let next_out_of_line = decoder.next_out_of_line();
5252 let handles_before = decoder.remaining_handles();
5253 if let Some((inlined, num_bytes, num_handles)) =
5254 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5255 {
5256 let member_inline_size = <fidl::encoding::HandleType<
5257 fidl::EventPair,
5258 { fidl::ObjectType::EVENTPAIR.into_raw() },
5259 2147483648,
5260 > as fidl::encoding::TypeMarker>::inline_size(
5261 decoder.context
5262 );
5263 if inlined != (member_inline_size <= 4) {
5264 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5265 }
5266 let inner_offset;
5267 let mut inner_depth = depth.clone();
5268 if inlined {
5269 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5270 inner_offset = next_offset;
5271 } else {
5272 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5273 inner_depth.increment()?;
5274 }
5275 let val_ref =
5276 self.watcher.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
5277 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5278 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5279 {
5280 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5281 }
5282 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5283 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5284 }
5285 }
5286
5287 next_offset += envelope_size;
5288
5289 while next_offset < end_offset {
5291 _next_ordinal_to_read += 1;
5292 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5293 next_offset += envelope_size;
5294 }
5295
5296 Ok(())
5297 }
5298 }
5299
5300 impl ContainerPowerControllerWakeRequest {
5301 #[inline(always)]
5302 fn max_ordinal_present(&self) -> u64 {
5303 if let Some(_) = self.wake_lock {
5304 return 2;
5305 }
5306 if let Some(_) = self.power_baton {
5307 return 1;
5308 }
5309 0
5310 }
5311 }
5312
5313 impl fidl::encoding::ResourceTypeMarker for ContainerPowerControllerWakeRequest {
5314 type Borrowed<'a> = &'a mut Self;
5315 fn take_or_borrow<'a>(
5316 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5317 ) -> Self::Borrowed<'a> {
5318 value
5319 }
5320 }
5321
5322 unsafe impl fidl::encoding::TypeMarker for ContainerPowerControllerWakeRequest {
5323 type Owned = Self;
5324
5325 #[inline(always)]
5326 fn inline_align(_context: fidl::encoding::Context) -> usize {
5327 8
5328 }
5329
5330 #[inline(always)]
5331 fn inline_size(_context: fidl::encoding::Context) -> usize {
5332 16
5333 }
5334 }
5335
5336 unsafe impl
5337 fidl::encoding::Encode<
5338 ContainerPowerControllerWakeRequest,
5339 fidl::encoding::DefaultFuchsiaResourceDialect,
5340 > for &mut ContainerPowerControllerWakeRequest
5341 {
5342 unsafe fn encode(
5343 self,
5344 encoder: &mut fidl::encoding::Encoder<
5345 '_,
5346 fidl::encoding::DefaultFuchsiaResourceDialect,
5347 >,
5348 offset: usize,
5349 mut depth: fidl::encoding::Depth,
5350 ) -> fidl::Result<()> {
5351 encoder.debug_check_bounds::<ContainerPowerControllerWakeRequest>(offset);
5352 let max_ordinal: u64 = self.max_ordinal_present();
5354 encoder.write_num(max_ordinal, offset);
5355 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5356 if max_ordinal == 0 {
5358 return Ok(());
5359 }
5360 depth.increment()?;
5361 let envelope_size = 8;
5362 let bytes_len = max_ordinal as usize * envelope_size;
5363 #[allow(unused_variables)]
5364 let offset = encoder.out_of_line_offset(bytes_len);
5365 let mut _prev_end_offset: usize = 0;
5366 if 1 > max_ordinal {
5367 return Ok(());
5368 }
5369
5370 let cur_offset: usize = (1 - 1) * envelope_size;
5373
5374 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5376
5377 fidl::encoding::encode_in_envelope_optional::<
5382 fidl::encoding::HandleType<
5383 fidl::Handle,
5384 { fidl::ObjectType::NONE.into_raw() },
5385 2147483648,
5386 >,
5387 fidl::encoding::DefaultFuchsiaResourceDialect,
5388 >(
5389 self.power_baton.as_mut().map(
5390 <fidl::encoding::HandleType<
5391 fidl::Handle,
5392 { fidl::ObjectType::NONE.into_raw() },
5393 2147483648,
5394 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5395 ),
5396 encoder,
5397 offset + cur_offset,
5398 depth,
5399 )?;
5400
5401 _prev_end_offset = cur_offset + envelope_size;
5402 if 2 > max_ordinal {
5403 return Ok(());
5404 }
5405
5406 let cur_offset: usize = (2 - 1) * envelope_size;
5409
5410 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5412
5413 fidl::encoding::encode_in_envelope_optional::<
5418 fidl::encoding::HandleType<
5419 fidl::EventPair,
5420 { fidl::ObjectType::EVENTPAIR.into_raw() },
5421 2147483648,
5422 >,
5423 fidl::encoding::DefaultFuchsiaResourceDialect,
5424 >(
5425 self.wake_lock.as_mut().map(
5426 <fidl::encoding::HandleType<
5427 fidl::EventPair,
5428 { fidl::ObjectType::EVENTPAIR.into_raw() },
5429 2147483648,
5430 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5431 ),
5432 encoder,
5433 offset + cur_offset,
5434 depth,
5435 )?;
5436
5437 _prev_end_offset = cur_offset + envelope_size;
5438
5439 Ok(())
5440 }
5441 }
5442
5443 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5444 for ContainerPowerControllerWakeRequest
5445 {
5446 #[inline(always)]
5447 fn new_empty() -> Self {
5448 Self::default()
5449 }
5450
5451 unsafe fn decode(
5452 &mut self,
5453 decoder: &mut fidl::encoding::Decoder<
5454 '_,
5455 fidl::encoding::DefaultFuchsiaResourceDialect,
5456 >,
5457 offset: usize,
5458 mut depth: fidl::encoding::Depth,
5459 ) -> fidl::Result<()> {
5460 decoder.debug_check_bounds::<Self>(offset);
5461 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5462 None => return Err(fidl::Error::NotNullable),
5463 Some(len) => len,
5464 };
5465 if len == 0 {
5467 return Ok(());
5468 };
5469 depth.increment()?;
5470 let envelope_size = 8;
5471 let bytes_len = len * envelope_size;
5472 let offset = decoder.out_of_line_offset(bytes_len)?;
5473 let mut _next_ordinal_to_read = 0;
5475 let mut next_offset = offset;
5476 let end_offset = offset + bytes_len;
5477 _next_ordinal_to_read += 1;
5478 if next_offset >= end_offset {
5479 return Ok(());
5480 }
5481
5482 while _next_ordinal_to_read < 1 {
5484 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5485 _next_ordinal_to_read += 1;
5486 next_offset += envelope_size;
5487 }
5488
5489 let next_out_of_line = decoder.next_out_of_line();
5490 let handles_before = decoder.remaining_handles();
5491 if let Some((inlined, num_bytes, num_handles)) =
5492 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5493 {
5494 let member_inline_size = <fidl::encoding::HandleType<
5495 fidl::Handle,
5496 { fidl::ObjectType::NONE.into_raw() },
5497 2147483648,
5498 > as fidl::encoding::TypeMarker>::inline_size(
5499 decoder.context
5500 );
5501 if inlined != (member_inline_size <= 4) {
5502 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5503 }
5504 let inner_offset;
5505 let mut inner_depth = depth.clone();
5506 if inlined {
5507 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5508 inner_offset = next_offset;
5509 } else {
5510 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5511 inner_depth.increment()?;
5512 }
5513 let val_ref =
5514 self.power_baton.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
5515 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5516 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5517 {
5518 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5519 }
5520 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5521 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5522 }
5523 }
5524
5525 next_offset += envelope_size;
5526 _next_ordinal_to_read += 1;
5527 if next_offset >= end_offset {
5528 return Ok(());
5529 }
5530
5531 while _next_ordinal_to_read < 2 {
5533 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5534 _next_ordinal_to_read += 1;
5535 next_offset += envelope_size;
5536 }
5537
5538 let next_out_of_line = decoder.next_out_of_line();
5539 let handles_before = decoder.remaining_handles();
5540 if let Some((inlined, num_bytes, num_handles)) =
5541 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5542 {
5543 let member_inline_size = <fidl::encoding::HandleType<
5544 fidl::EventPair,
5545 { fidl::ObjectType::EVENTPAIR.into_raw() },
5546 2147483648,
5547 > as fidl::encoding::TypeMarker>::inline_size(
5548 decoder.context
5549 );
5550 if inlined != (member_inline_size <= 4) {
5551 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5552 }
5553 let inner_offset;
5554 let mut inner_depth = depth.clone();
5555 if inlined {
5556 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5557 inner_offset = next_offset;
5558 } else {
5559 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5560 inner_depth.increment()?;
5561 }
5562 let val_ref =
5563 self.wake_lock.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
5564 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5565 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5566 {
5567 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5568 }
5569 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5570 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5571 }
5572 }
5573
5574 next_offset += envelope_size;
5575
5576 while next_offset < end_offset {
5578 _next_ordinal_to_read += 1;
5579 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5580 next_offset += envelope_size;
5581 }
5582
5583 Ok(())
5584 }
5585 }
5586
5587 impl DevBinderCloseRequest {
5588 #[inline(always)]
5589 fn max_ordinal_present(&self) -> u64 {
5590 if let Some(_) = self.binder {
5591 return 1;
5592 }
5593 0
5594 }
5595 }
5596
5597 impl fidl::encoding::ResourceTypeMarker for DevBinderCloseRequest {
5598 type Borrowed<'a> = &'a mut Self;
5599 fn take_or_borrow<'a>(
5600 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5601 ) -> Self::Borrowed<'a> {
5602 value
5603 }
5604 }
5605
5606 unsafe impl fidl::encoding::TypeMarker for DevBinderCloseRequest {
5607 type Owned = Self;
5608
5609 #[inline(always)]
5610 fn inline_align(_context: fidl::encoding::Context) -> usize {
5611 8
5612 }
5613
5614 #[inline(always)]
5615 fn inline_size(_context: fidl::encoding::Context) -> usize {
5616 16
5617 }
5618 }
5619
5620 unsafe impl
5621 fidl::encoding::Encode<DevBinderCloseRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
5622 for &mut DevBinderCloseRequest
5623 {
5624 unsafe fn encode(
5625 self,
5626 encoder: &mut fidl::encoding::Encoder<
5627 '_,
5628 fidl::encoding::DefaultFuchsiaResourceDialect,
5629 >,
5630 offset: usize,
5631 mut depth: fidl::encoding::Depth,
5632 ) -> fidl::Result<()> {
5633 encoder.debug_check_bounds::<DevBinderCloseRequest>(offset);
5634 let max_ordinal: u64 = self.max_ordinal_present();
5636 encoder.write_num(max_ordinal, offset);
5637 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5638 if max_ordinal == 0 {
5640 return Ok(());
5641 }
5642 depth.increment()?;
5643 let envelope_size = 8;
5644 let bytes_len = max_ordinal as usize * envelope_size;
5645 #[allow(unused_variables)]
5646 let offset = encoder.out_of_line_offset(bytes_len);
5647 let mut _prev_end_offset: usize = 0;
5648 if 1 > max_ordinal {
5649 return Ok(());
5650 }
5651
5652 let cur_offset: usize = (1 - 1) * envelope_size;
5655
5656 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5658
5659 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BinderMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5664 self.binder.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BinderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5665 encoder, offset + cur_offset, depth
5666 )?;
5667
5668 _prev_end_offset = cur_offset + envelope_size;
5669
5670 Ok(())
5671 }
5672 }
5673
5674 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5675 for DevBinderCloseRequest
5676 {
5677 #[inline(always)]
5678 fn new_empty() -> Self {
5679 Self::default()
5680 }
5681
5682 unsafe fn decode(
5683 &mut self,
5684 decoder: &mut fidl::encoding::Decoder<
5685 '_,
5686 fidl::encoding::DefaultFuchsiaResourceDialect,
5687 >,
5688 offset: usize,
5689 mut depth: fidl::encoding::Depth,
5690 ) -> fidl::Result<()> {
5691 decoder.debug_check_bounds::<Self>(offset);
5692 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5693 None => return Err(fidl::Error::NotNullable),
5694 Some(len) => len,
5695 };
5696 if len == 0 {
5698 return Ok(());
5699 };
5700 depth.increment()?;
5701 let envelope_size = 8;
5702 let bytes_len = len * envelope_size;
5703 let offset = decoder.out_of_line_offset(bytes_len)?;
5704 let mut _next_ordinal_to_read = 0;
5706 let mut next_offset = offset;
5707 let end_offset = offset + bytes_len;
5708 _next_ordinal_to_read += 1;
5709 if next_offset >= end_offset {
5710 return Ok(());
5711 }
5712
5713 while _next_ordinal_to_read < 1 {
5715 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5716 _next_ordinal_to_read += 1;
5717 next_offset += envelope_size;
5718 }
5719
5720 let next_out_of_line = decoder.next_out_of_line();
5721 let handles_before = decoder.remaining_handles();
5722 if let Some((inlined, num_bytes, num_handles)) =
5723 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5724 {
5725 let member_inline_size = <fidl::encoding::Endpoint<
5726 fidl::endpoints::ClientEnd<BinderMarker>,
5727 > as fidl::encoding::TypeMarker>::inline_size(
5728 decoder.context
5729 );
5730 if inlined != (member_inline_size <= 4) {
5731 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5732 }
5733 let inner_offset;
5734 let mut inner_depth = depth.clone();
5735 if inlined {
5736 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5737 inner_offset = next_offset;
5738 } else {
5739 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5740 inner_depth.increment()?;
5741 }
5742 let val_ref = self.binder.get_or_insert_with(|| {
5743 fidl::new_empty!(
5744 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BinderMarker>>,
5745 fidl::encoding::DefaultFuchsiaResourceDialect
5746 )
5747 });
5748 fidl::decode!(
5749 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BinderMarker>>,
5750 fidl::encoding::DefaultFuchsiaResourceDialect,
5751 val_ref,
5752 decoder,
5753 inner_offset,
5754 inner_depth
5755 )?;
5756 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5757 {
5758 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5759 }
5760 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5761 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5762 }
5763 }
5764
5765 next_offset += envelope_size;
5766
5767 while next_offset < end_offset {
5769 _next_ordinal_to_read += 1;
5770 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5771 next_offset += envelope_size;
5772 }
5773
5774 Ok(())
5775 }
5776 }
5777
5778 impl DevBinderOpenRequest {
5779 #[inline(always)]
5780 fn max_ordinal_present(&self) -> u64 {
5781 if let Some(_) = self.binder {
5782 return 4;
5783 }
5784 if let Some(_) = self.process {
5785 return 3;
5786 }
5787 if let Some(_) = self.process_accessor {
5788 return 2;
5789 }
5790 if let Some(_) = self.path {
5791 return 1;
5792 }
5793 0
5794 }
5795 }
5796
5797 impl fidl::encoding::ResourceTypeMarker for DevBinderOpenRequest {
5798 type Borrowed<'a> = &'a mut Self;
5799 fn take_or_borrow<'a>(
5800 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5801 ) -> Self::Borrowed<'a> {
5802 value
5803 }
5804 }
5805
5806 unsafe impl fidl::encoding::TypeMarker for DevBinderOpenRequest {
5807 type Owned = Self;
5808
5809 #[inline(always)]
5810 fn inline_align(_context: fidl::encoding::Context) -> usize {
5811 8
5812 }
5813
5814 #[inline(always)]
5815 fn inline_size(_context: fidl::encoding::Context) -> usize {
5816 16
5817 }
5818 }
5819
5820 unsafe impl
5821 fidl::encoding::Encode<DevBinderOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
5822 for &mut DevBinderOpenRequest
5823 {
5824 unsafe fn encode(
5825 self,
5826 encoder: &mut fidl::encoding::Encoder<
5827 '_,
5828 fidl::encoding::DefaultFuchsiaResourceDialect,
5829 >,
5830 offset: usize,
5831 mut depth: fidl::encoding::Depth,
5832 ) -> fidl::Result<()> {
5833 encoder.debug_check_bounds::<DevBinderOpenRequest>(offset);
5834 let max_ordinal: u64 = self.max_ordinal_present();
5836 encoder.write_num(max_ordinal, offset);
5837 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5838 if max_ordinal == 0 {
5840 return Ok(());
5841 }
5842 depth.increment()?;
5843 let envelope_size = 8;
5844 let bytes_len = max_ordinal as usize * envelope_size;
5845 #[allow(unused_variables)]
5846 let offset = encoder.out_of_line_offset(bytes_len);
5847 let mut _prev_end_offset: usize = 0;
5848 if 1 > max_ordinal {
5849 return Ok(());
5850 }
5851
5852 let cur_offset: usize = (1 - 1) * envelope_size;
5855
5856 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5858
5859 fidl::encoding::encode_in_envelope_optional::<
5864 fidl::encoding::Vector<u8, 4095>,
5865 fidl::encoding::DefaultFuchsiaResourceDialect,
5866 >(
5867 self.path.as_ref().map(
5868 <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow,
5869 ),
5870 encoder,
5871 offset + cur_offset,
5872 depth,
5873 )?;
5874
5875 _prev_end_offset = cur_offset + envelope_size;
5876 if 2 > max_ordinal {
5877 return Ok(());
5878 }
5879
5880 let cur_offset: usize = (2 - 1) * envelope_size;
5883
5884 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5886
5887 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProcessAccessorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5892 self.process_accessor.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProcessAccessorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5893 encoder, offset + cur_offset, depth
5894 )?;
5895
5896 _prev_end_offset = cur_offset + envelope_size;
5897 if 3 > max_ordinal {
5898 return Ok(());
5899 }
5900
5901 let cur_offset: usize = (3 - 1) * envelope_size;
5904
5905 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5907
5908 fidl::encoding::encode_in_envelope_optional::<
5913 fidl::encoding::HandleType<
5914 fidl::Process,
5915 { fidl::ObjectType::PROCESS.into_raw() },
5916 2147483648,
5917 >,
5918 fidl::encoding::DefaultFuchsiaResourceDialect,
5919 >(
5920 self.process.as_mut().map(
5921 <fidl::encoding::HandleType<
5922 fidl::Process,
5923 { fidl::ObjectType::PROCESS.into_raw() },
5924 2147483648,
5925 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5926 ),
5927 encoder,
5928 offset + cur_offset,
5929 depth,
5930 )?;
5931
5932 _prev_end_offset = cur_offset + envelope_size;
5933 if 4 > max_ordinal {
5934 return Ok(());
5935 }
5936
5937 let cur_offset: usize = (4 - 1) * envelope_size;
5940
5941 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5943
5944 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BinderMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5949 self.binder.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BinderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5950 encoder, offset + cur_offset, depth
5951 )?;
5952
5953 _prev_end_offset = cur_offset + envelope_size;
5954
5955 Ok(())
5956 }
5957 }
5958
5959 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5960 for DevBinderOpenRequest
5961 {
5962 #[inline(always)]
5963 fn new_empty() -> Self {
5964 Self::default()
5965 }
5966
5967 unsafe fn decode(
5968 &mut self,
5969 decoder: &mut fidl::encoding::Decoder<
5970 '_,
5971 fidl::encoding::DefaultFuchsiaResourceDialect,
5972 >,
5973 offset: usize,
5974 mut depth: fidl::encoding::Depth,
5975 ) -> fidl::Result<()> {
5976 decoder.debug_check_bounds::<Self>(offset);
5977 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5978 None => return Err(fidl::Error::NotNullable),
5979 Some(len) => len,
5980 };
5981 if len == 0 {
5983 return Ok(());
5984 };
5985 depth.increment()?;
5986 let envelope_size = 8;
5987 let bytes_len = len * envelope_size;
5988 let offset = decoder.out_of_line_offset(bytes_len)?;
5989 let mut _next_ordinal_to_read = 0;
5991 let mut next_offset = offset;
5992 let end_offset = offset + bytes_len;
5993 _next_ordinal_to_read += 1;
5994 if next_offset >= end_offset {
5995 return Ok(());
5996 }
5997
5998 while _next_ordinal_to_read < 1 {
6000 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6001 _next_ordinal_to_read += 1;
6002 next_offset += envelope_size;
6003 }
6004
6005 let next_out_of_line = decoder.next_out_of_line();
6006 let handles_before = decoder.remaining_handles();
6007 if let Some((inlined, num_bytes, num_handles)) =
6008 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6009 {
6010 let member_inline_size =
6011 <fidl::encoding::Vector<u8, 4095> as fidl::encoding::TypeMarker>::inline_size(
6012 decoder.context,
6013 );
6014 if inlined != (member_inline_size <= 4) {
6015 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6016 }
6017 let inner_offset;
6018 let mut inner_depth = depth.clone();
6019 if inlined {
6020 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6021 inner_offset = next_offset;
6022 } else {
6023 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6024 inner_depth.increment()?;
6025 }
6026 let val_ref =
6027 self.path.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect));
6028 fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6029 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6030 {
6031 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6032 }
6033 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6034 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6035 }
6036 }
6037
6038 next_offset += envelope_size;
6039 _next_ordinal_to_read += 1;
6040 if next_offset >= end_offset {
6041 return Ok(());
6042 }
6043
6044 while _next_ordinal_to_read < 2 {
6046 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6047 _next_ordinal_to_read += 1;
6048 next_offset += envelope_size;
6049 }
6050
6051 let next_out_of_line = decoder.next_out_of_line();
6052 let handles_before = decoder.remaining_handles();
6053 if let Some((inlined, num_bytes, num_handles)) =
6054 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6055 {
6056 let member_inline_size = <fidl::encoding::Endpoint<
6057 fidl::endpoints::ClientEnd<ProcessAccessorMarker>,
6058 > as fidl::encoding::TypeMarker>::inline_size(
6059 decoder.context
6060 );
6061 if inlined != (member_inline_size <= 4) {
6062 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6063 }
6064 let inner_offset;
6065 let mut inner_depth = depth.clone();
6066 if inlined {
6067 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6068 inner_offset = next_offset;
6069 } else {
6070 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6071 inner_depth.increment()?;
6072 }
6073 let val_ref = self.process_accessor.get_or_insert_with(|| {
6074 fidl::new_empty!(
6075 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProcessAccessorMarker>>,
6076 fidl::encoding::DefaultFuchsiaResourceDialect
6077 )
6078 });
6079 fidl::decode!(
6080 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProcessAccessorMarker>>,
6081 fidl::encoding::DefaultFuchsiaResourceDialect,
6082 val_ref,
6083 decoder,
6084 inner_offset,
6085 inner_depth
6086 )?;
6087 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6088 {
6089 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6090 }
6091 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6092 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6093 }
6094 }
6095
6096 next_offset += envelope_size;
6097 _next_ordinal_to_read += 1;
6098 if next_offset >= end_offset {
6099 return Ok(());
6100 }
6101
6102 while _next_ordinal_to_read < 3 {
6104 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6105 _next_ordinal_to_read += 1;
6106 next_offset += envelope_size;
6107 }
6108
6109 let next_out_of_line = decoder.next_out_of_line();
6110 let handles_before = decoder.remaining_handles();
6111 if let Some((inlined, num_bytes, num_handles)) =
6112 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6113 {
6114 let member_inline_size = <fidl::encoding::HandleType<
6115 fidl::Process,
6116 { fidl::ObjectType::PROCESS.into_raw() },
6117 2147483648,
6118 > as fidl::encoding::TypeMarker>::inline_size(
6119 decoder.context
6120 );
6121 if inlined != (member_inline_size <= 4) {
6122 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6123 }
6124 let inner_offset;
6125 let mut inner_depth = depth.clone();
6126 if inlined {
6127 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6128 inner_offset = next_offset;
6129 } else {
6130 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6131 inner_depth.increment()?;
6132 }
6133 let val_ref =
6134 self.process.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
6135 fidl::decode!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6136 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6137 {
6138 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6139 }
6140 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6141 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6142 }
6143 }
6144
6145 next_offset += envelope_size;
6146 _next_ordinal_to_read += 1;
6147 if next_offset >= end_offset {
6148 return Ok(());
6149 }
6150
6151 while _next_ordinal_to_read < 4 {
6153 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6154 _next_ordinal_to_read += 1;
6155 next_offset += envelope_size;
6156 }
6157
6158 let next_out_of_line = decoder.next_out_of_line();
6159 let handles_before = decoder.remaining_handles();
6160 if let Some((inlined, num_bytes, num_handles)) =
6161 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6162 {
6163 let member_inline_size = <fidl::encoding::Endpoint<
6164 fidl::endpoints::ServerEnd<BinderMarker>,
6165 > as fidl::encoding::TypeMarker>::inline_size(
6166 decoder.context
6167 );
6168 if inlined != (member_inline_size <= 4) {
6169 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6170 }
6171 let inner_offset;
6172 let mut inner_depth = depth.clone();
6173 if inlined {
6174 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6175 inner_offset = next_offset;
6176 } else {
6177 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6178 inner_depth.increment()?;
6179 }
6180 let val_ref = self.binder.get_or_insert_with(|| {
6181 fidl::new_empty!(
6182 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BinderMarker>>,
6183 fidl::encoding::DefaultFuchsiaResourceDialect
6184 )
6185 });
6186 fidl::decode!(
6187 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BinderMarker>>,
6188 fidl::encoding::DefaultFuchsiaResourceDialect,
6189 val_ref,
6190 decoder,
6191 inner_offset,
6192 inner_depth
6193 )?;
6194 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6195 {
6196 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6197 }
6198 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6199 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6200 }
6201 }
6202
6203 next_offset += envelope_size;
6204
6205 while next_offset < end_offset {
6207 _next_ordinal_to_read += 1;
6208 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6209 next_offset += envelope_size;
6210 }
6211
6212 Ok(())
6213 }
6214 }
6215
6216 impl FileHandle {
6217 #[inline(always)]
6218 fn max_ordinal_present(&self) -> u64 {
6219 if let Some(_) = self.flags {
6220 return 3;
6221 }
6222 if let Some(_) = self.file {
6223 return 1;
6224 }
6225 0
6226 }
6227 }
6228
6229 impl fidl::encoding::ResourceTypeMarker for FileHandle {
6230 type Borrowed<'a> = &'a mut Self;
6231 fn take_or_borrow<'a>(
6232 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6233 ) -> Self::Borrowed<'a> {
6234 value
6235 }
6236 }
6237
6238 unsafe impl fidl::encoding::TypeMarker for FileHandle {
6239 type Owned = Self;
6240
6241 #[inline(always)]
6242 fn inline_align(_context: fidl::encoding::Context) -> usize {
6243 8
6244 }
6245
6246 #[inline(always)]
6247 fn inline_size(_context: fidl::encoding::Context) -> usize {
6248 16
6249 }
6250 }
6251
6252 unsafe impl fidl::encoding::Encode<FileHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
6253 for &mut FileHandle
6254 {
6255 unsafe fn encode(
6256 self,
6257 encoder: &mut fidl::encoding::Encoder<
6258 '_,
6259 fidl::encoding::DefaultFuchsiaResourceDialect,
6260 >,
6261 offset: usize,
6262 mut depth: fidl::encoding::Depth,
6263 ) -> fidl::Result<()> {
6264 encoder.debug_check_bounds::<FileHandle>(offset);
6265 let max_ordinal: u64 = self.max_ordinal_present();
6267 encoder.write_num(max_ordinal, offset);
6268 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6269 if max_ordinal == 0 {
6271 return Ok(());
6272 }
6273 depth.increment()?;
6274 let envelope_size = 8;
6275 let bytes_len = max_ordinal as usize * envelope_size;
6276 #[allow(unused_variables)]
6277 let offset = encoder.out_of_line_offset(bytes_len);
6278 let mut _prev_end_offset: usize = 0;
6279 if 1 > max_ordinal {
6280 return Ok(());
6281 }
6282
6283 let cur_offset: usize = (1 - 1) * envelope_size;
6286
6287 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6289
6290 fidl::encoding::encode_in_envelope_optional::<
6295 fidl::encoding::HandleType<
6296 fidl::Handle,
6297 { fidl::ObjectType::NONE.into_raw() },
6298 2147483648,
6299 >,
6300 fidl::encoding::DefaultFuchsiaResourceDialect,
6301 >(
6302 self.file.as_mut().map(
6303 <fidl::encoding::HandleType<
6304 fidl::Handle,
6305 { fidl::ObjectType::NONE.into_raw() },
6306 2147483648,
6307 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
6308 ),
6309 encoder,
6310 offset + cur_offset,
6311 depth,
6312 )?;
6313
6314 _prev_end_offset = cur_offset + envelope_size;
6315 if 3 > max_ordinal {
6316 return Ok(());
6317 }
6318
6319 let cur_offset: usize = (3 - 1) * envelope_size;
6322
6323 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6325
6326 fidl::encoding::encode_in_envelope_optional::<
6331 FileFlags,
6332 fidl::encoding::DefaultFuchsiaResourceDialect,
6333 >(
6334 self.flags.as_ref().map(<FileFlags as fidl::encoding::ValueTypeMarker>::borrow),
6335 encoder,
6336 offset + cur_offset,
6337 depth,
6338 )?;
6339
6340 _prev_end_offset = cur_offset + envelope_size;
6341
6342 Ok(())
6343 }
6344 }
6345
6346 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileHandle {
6347 #[inline(always)]
6348 fn new_empty() -> Self {
6349 Self::default()
6350 }
6351
6352 unsafe fn decode(
6353 &mut self,
6354 decoder: &mut fidl::encoding::Decoder<
6355 '_,
6356 fidl::encoding::DefaultFuchsiaResourceDialect,
6357 >,
6358 offset: usize,
6359 mut depth: fidl::encoding::Depth,
6360 ) -> fidl::Result<()> {
6361 decoder.debug_check_bounds::<Self>(offset);
6362 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6363 None => return Err(fidl::Error::NotNullable),
6364 Some(len) => len,
6365 };
6366 if len == 0 {
6368 return Ok(());
6369 };
6370 depth.increment()?;
6371 let envelope_size = 8;
6372 let bytes_len = len * envelope_size;
6373 let offset = decoder.out_of_line_offset(bytes_len)?;
6374 let mut _next_ordinal_to_read = 0;
6376 let mut next_offset = offset;
6377 let end_offset = offset + bytes_len;
6378 _next_ordinal_to_read += 1;
6379 if next_offset >= end_offset {
6380 return Ok(());
6381 }
6382
6383 while _next_ordinal_to_read < 1 {
6385 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6386 _next_ordinal_to_read += 1;
6387 next_offset += envelope_size;
6388 }
6389
6390 let next_out_of_line = decoder.next_out_of_line();
6391 let handles_before = decoder.remaining_handles();
6392 if let Some((inlined, num_bytes, num_handles)) =
6393 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6394 {
6395 let member_inline_size = <fidl::encoding::HandleType<
6396 fidl::Handle,
6397 { fidl::ObjectType::NONE.into_raw() },
6398 2147483648,
6399 > as fidl::encoding::TypeMarker>::inline_size(
6400 decoder.context
6401 );
6402 if inlined != (member_inline_size <= 4) {
6403 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6404 }
6405 let inner_offset;
6406 let mut inner_depth = depth.clone();
6407 if inlined {
6408 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6409 inner_offset = next_offset;
6410 } else {
6411 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6412 inner_depth.increment()?;
6413 }
6414 let val_ref =
6415 self.file.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
6416 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6417 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6418 {
6419 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6420 }
6421 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6422 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6423 }
6424 }
6425
6426 next_offset += envelope_size;
6427 _next_ordinal_to_read += 1;
6428 if next_offset >= end_offset {
6429 return Ok(());
6430 }
6431
6432 while _next_ordinal_to_read < 3 {
6434 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6435 _next_ordinal_to_read += 1;
6436 next_offset += envelope_size;
6437 }
6438
6439 let next_out_of_line = decoder.next_out_of_line();
6440 let handles_before = decoder.remaining_handles();
6441 if let Some((inlined, num_bytes, num_handles)) =
6442 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6443 {
6444 let member_inline_size =
6445 <FileFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6446 if inlined != (member_inline_size <= 4) {
6447 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6448 }
6449 let inner_offset;
6450 let mut inner_depth = depth.clone();
6451 if inlined {
6452 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6453 inner_offset = next_offset;
6454 } else {
6455 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6456 inner_depth.increment()?;
6457 }
6458 let val_ref = self.flags.get_or_insert_with(|| {
6459 fidl::new_empty!(FileFlags, fidl::encoding::DefaultFuchsiaResourceDialect)
6460 });
6461 fidl::decode!(
6462 FileFlags,
6463 fidl::encoding::DefaultFuchsiaResourceDialect,
6464 val_ref,
6465 decoder,
6466 inner_offset,
6467 inner_depth
6468 )?;
6469 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6470 {
6471 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6472 }
6473 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6474 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6475 }
6476 }
6477
6478 next_offset += envelope_size;
6479
6480 while next_offset < end_offset {
6482 _next_ordinal_to_read += 1;
6483 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6484 next_offset += envelope_size;
6485 }
6486
6487 Ok(())
6488 }
6489 }
6490
6491 impl FileRequest {
6492 #[inline(always)]
6493 fn max_ordinal_present(&self) -> u64 {
6494 if let Some(_) = self.add_requests {
6495 return 3;
6496 }
6497 if let Some(_) = self.get_requests {
6498 return 2;
6499 }
6500 if let Some(_) = self.close_requests {
6501 return 1;
6502 }
6503 0
6504 }
6505 }
6506
6507 impl fidl::encoding::ResourceTypeMarker for FileRequest {
6508 type Borrowed<'a> = &'a mut Self;
6509 fn take_or_borrow<'a>(
6510 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6511 ) -> Self::Borrowed<'a> {
6512 value
6513 }
6514 }
6515
6516 unsafe impl fidl::encoding::TypeMarker for FileRequest {
6517 type Owned = Self;
6518
6519 #[inline(always)]
6520 fn inline_align(_context: fidl::encoding::Context) -> usize {
6521 8
6522 }
6523
6524 #[inline(always)]
6525 fn inline_size(_context: fidl::encoding::Context) -> usize {
6526 16
6527 }
6528 }
6529
6530 unsafe impl fidl::encoding::Encode<FileRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
6531 for &mut FileRequest
6532 {
6533 unsafe fn encode(
6534 self,
6535 encoder: &mut fidl::encoding::Encoder<
6536 '_,
6537 fidl::encoding::DefaultFuchsiaResourceDialect,
6538 >,
6539 offset: usize,
6540 mut depth: fidl::encoding::Depth,
6541 ) -> fidl::Result<()> {
6542 encoder.debug_check_bounds::<FileRequest>(offset);
6543 let max_ordinal: u64 = self.max_ordinal_present();
6545 encoder.write_num(max_ordinal, offset);
6546 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6547 if max_ordinal == 0 {
6549 return Ok(());
6550 }
6551 depth.increment()?;
6552 let envelope_size = 8;
6553 let bytes_len = max_ordinal as usize * envelope_size;
6554 #[allow(unused_variables)]
6555 let offset = encoder.out_of_line_offset(bytes_len);
6556 let mut _prev_end_offset: usize = 0;
6557 if 1 > max_ordinal {
6558 return Ok(());
6559 }
6560
6561 let cur_offset: usize = (1 - 1) * envelope_size;
6564
6565 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6567
6568 fidl::encoding::encode_in_envelope_optional::<
6573 fidl::encoding::Vector<i32, 16>,
6574 fidl::encoding::DefaultFuchsiaResourceDialect,
6575 >(
6576 self.close_requests.as_ref().map(
6577 <fidl::encoding::Vector<i32, 16> as fidl::encoding::ValueTypeMarker>::borrow,
6578 ),
6579 encoder,
6580 offset + cur_offset,
6581 depth,
6582 )?;
6583
6584 _prev_end_offset = cur_offset + envelope_size;
6585 if 2 > max_ordinal {
6586 return Ok(());
6587 }
6588
6589 let cur_offset: usize = (2 - 1) * envelope_size;
6592
6593 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6595
6596 fidl::encoding::encode_in_envelope_optional::<
6601 fidl::encoding::Vector<i32, 16>,
6602 fidl::encoding::DefaultFuchsiaResourceDialect,
6603 >(
6604 self.get_requests.as_ref().map(
6605 <fidl::encoding::Vector<i32, 16> as fidl::encoding::ValueTypeMarker>::borrow,
6606 ),
6607 encoder,
6608 offset + cur_offset,
6609 depth,
6610 )?;
6611
6612 _prev_end_offset = cur_offset + envelope_size;
6613 if 3 > max_ordinal {
6614 return Ok(());
6615 }
6616
6617 let cur_offset: usize = (3 - 1) * envelope_size;
6620
6621 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6623
6624 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<FileHandle, 16>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6629 self.add_requests.as_mut().map(<fidl::encoding::Vector<FileHandle, 16> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6630 encoder, offset + cur_offset, depth
6631 )?;
6632
6633 _prev_end_offset = cur_offset + envelope_size;
6634
6635 Ok(())
6636 }
6637 }
6638
6639 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileRequest {
6640 #[inline(always)]
6641 fn new_empty() -> Self {
6642 Self::default()
6643 }
6644
6645 unsafe fn decode(
6646 &mut self,
6647 decoder: &mut fidl::encoding::Decoder<
6648 '_,
6649 fidl::encoding::DefaultFuchsiaResourceDialect,
6650 >,
6651 offset: usize,
6652 mut depth: fidl::encoding::Depth,
6653 ) -> fidl::Result<()> {
6654 decoder.debug_check_bounds::<Self>(offset);
6655 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6656 None => return Err(fidl::Error::NotNullable),
6657 Some(len) => len,
6658 };
6659 if len == 0 {
6661 return Ok(());
6662 };
6663 depth.increment()?;
6664 let envelope_size = 8;
6665 let bytes_len = len * envelope_size;
6666 let offset = decoder.out_of_line_offset(bytes_len)?;
6667 let mut _next_ordinal_to_read = 0;
6669 let mut next_offset = offset;
6670 let end_offset = offset + bytes_len;
6671 _next_ordinal_to_read += 1;
6672 if next_offset >= end_offset {
6673 return Ok(());
6674 }
6675
6676 while _next_ordinal_to_read < 1 {
6678 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6679 _next_ordinal_to_read += 1;
6680 next_offset += envelope_size;
6681 }
6682
6683 let next_out_of_line = decoder.next_out_of_line();
6684 let handles_before = decoder.remaining_handles();
6685 if let Some((inlined, num_bytes, num_handles)) =
6686 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6687 {
6688 let member_inline_size =
6689 <fidl::encoding::Vector<i32, 16> as fidl::encoding::TypeMarker>::inline_size(
6690 decoder.context,
6691 );
6692 if inlined != (member_inline_size <= 4) {
6693 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6694 }
6695 let inner_offset;
6696 let mut inner_depth = depth.clone();
6697 if inlined {
6698 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6699 inner_offset = next_offset;
6700 } else {
6701 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6702 inner_depth.increment()?;
6703 }
6704 let val_ref =
6705 self.close_requests.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<i32, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
6706 fidl::decode!(fidl::encoding::Vector<i32, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6707 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6708 {
6709 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6710 }
6711 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6712 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6713 }
6714 }
6715
6716 next_offset += envelope_size;
6717 _next_ordinal_to_read += 1;
6718 if next_offset >= end_offset {
6719 return Ok(());
6720 }
6721
6722 while _next_ordinal_to_read < 2 {
6724 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6725 _next_ordinal_to_read += 1;
6726 next_offset += envelope_size;
6727 }
6728
6729 let next_out_of_line = decoder.next_out_of_line();
6730 let handles_before = decoder.remaining_handles();
6731 if let Some((inlined, num_bytes, num_handles)) =
6732 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6733 {
6734 let member_inline_size =
6735 <fidl::encoding::Vector<i32, 16> as fidl::encoding::TypeMarker>::inline_size(
6736 decoder.context,
6737 );
6738 if inlined != (member_inline_size <= 4) {
6739 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6740 }
6741 let inner_offset;
6742 let mut inner_depth = depth.clone();
6743 if inlined {
6744 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6745 inner_offset = next_offset;
6746 } else {
6747 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6748 inner_depth.increment()?;
6749 }
6750 let val_ref =
6751 self.get_requests.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<i32, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
6752 fidl::decode!(fidl::encoding::Vector<i32, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6753 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6754 {
6755 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6756 }
6757 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6758 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6759 }
6760 }
6761
6762 next_offset += envelope_size;
6763 _next_ordinal_to_read += 1;
6764 if next_offset >= end_offset {
6765 return Ok(());
6766 }
6767
6768 while _next_ordinal_to_read < 3 {
6770 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6771 _next_ordinal_to_read += 1;
6772 next_offset += envelope_size;
6773 }
6774
6775 let next_out_of_line = decoder.next_out_of_line();
6776 let handles_before = decoder.remaining_handles();
6777 if let Some((inlined, num_bytes, num_handles)) =
6778 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6779 {
6780 let member_inline_size = <fidl::encoding::Vector<FileHandle, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6781 if inlined != (member_inline_size <= 4) {
6782 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6783 }
6784 let inner_offset;
6785 let mut inner_depth = depth.clone();
6786 if inlined {
6787 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6788 inner_offset = next_offset;
6789 } else {
6790 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6791 inner_depth.increment()?;
6792 }
6793 let val_ref =
6794 self.add_requests.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<FileHandle, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
6795 fidl::decode!(fidl::encoding::Vector<FileHandle, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6796 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6797 {
6798 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6799 }
6800 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6801 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6802 }
6803 }
6804
6805 next_offset += envelope_size;
6806
6807 while next_offset < end_offset {
6809 _next_ordinal_to_read += 1;
6810 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6811 next_offset += envelope_size;
6812 }
6813
6814 Ok(())
6815 }
6816 }
6817
6818 impl FileResponse {
6819 #[inline(always)]
6820 fn max_ordinal_present(&self) -> u64 {
6821 if let Some(_) = self.add_responses {
6822 return 3;
6823 }
6824 if let Some(_) = self.get_responses {
6825 return 2;
6826 }
6827 0
6828 }
6829 }
6830
6831 impl fidl::encoding::ResourceTypeMarker for FileResponse {
6832 type Borrowed<'a> = &'a mut Self;
6833 fn take_or_borrow<'a>(
6834 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6835 ) -> Self::Borrowed<'a> {
6836 value
6837 }
6838 }
6839
6840 unsafe impl fidl::encoding::TypeMarker for FileResponse {
6841 type Owned = Self;
6842
6843 #[inline(always)]
6844 fn inline_align(_context: fidl::encoding::Context) -> usize {
6845 8
6846 }
6847
6848 #[inline(always)]
6849 fn inline_size(_context: fidl::encoding::Context) -> usize {
6850 16
6851 }
6852 }
6853
6854 unsafe impl fidl::encoding::Encode<FileResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
6855 for &mut FileResponse
6856 {
6857 unsafe fn encode(
6858 self,
6859 encoder: &mut fidl::encoding::Encoder<
6860 '_,
6861 fidl::encoding::DefaultFuchsiaResourceDialect,
6862 >,
6863 offset: usize,
6864 mut depth: fidl::encoding::Depth,
6865 ) -> fidl::Result<()> {
6866 encoder.debug_check_bounds::<FileResponse>(offset);
6867 let max_ordinal: u64 = self.max_ordinal_present();
6869 encoder.write_num(max_ordinal, offset);
6870 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6871 if max_ordinal == 0 {
6873 return Ok(());
6874 }
6875 depth.increment()?;
6876 let envelope_size = 8;
6877 let bytes_len = max_ordinal as usize * envelope_size;
6878 #[allow(unused_variables)]
6879 let offset = encoder.out_of_line_offset(bytes_len);
6880 let mut _prev_end_offset: usize = 0;
6881 if 2 > max_ordinal {
6882 return Ok(());
6883 }
6884
6885 let cur_offset: usize = (2 - 1) * envelope_size;
6888
6889 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6891
6892 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<FileHandle, 16>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6897 self.get_responses.as_mut().map(<fidl::encoding::Vector<FileHandle, 16> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6898 encoder, offset + cur_offset, depth
6899 )?;
6900
6901 _prev_end_offset = cur_offset + envelope_size;
6902 if 3 > max_ordinal {
6903 return Ok(());
6904 }
6905
6906 let cur_offset: usize = (3 - 1) * envelope_size;
6909
6910 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6912
6913 fidl::encoding::encode_in_envelope_optional::<
6918 fidl::encoding::Vector<i32, 16>,
6919 fidl::encoding::DefaultFuchsiaResourceDialect,
6920 >(
6921 self.add_responses.as_ref().map(
6922 <fidl::encoding::Vector<i32, 16> as fidl::encoding::ValueTypeMarker>::borrow,
6923 ),
6924 encoder,
6925 offset + cur_offset,
6926 depth,
6927 )?;
6928
6929 _prev_end_offset = cur_offset + envelope_size;
6930
6931 Ok(())
6932 }
6933 }
6934
6935 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileResponse {
6936 #[inline(always)]
6937 fn new_empty() -> Self {
6938 Self::default()
6939 }
6940
6941 unsafe fn decode(
6942 &mut self,
6943 decoder: &mut fidl::encoding::Decoder<
6944 '_,
6945 fidl::encoding::DefaultFuchsiaResourceDialect,
6946 >,
6947 offset: usize,
6948 mut depth: fidl::encoding::Depth,
6949 ) -> fidl::Result<()> {
6950 decoder.debug_check_bounds::<Self>(offset);
6951 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6952 None => return Err(fidl::Error::NotNullable),
6953 Some(len) => len,
6954 };
6955 if len == 0 {
6957 return Ok(());
6958 };
6959 depth.increment()?;
6960 let envelope_size = 8;
6961 let bytes_len = len * envelope_size;
6962 let offset = decoder.out_of_line_offset(bytes_len)?;
6963 let mut _next_ordinal_to_read = 0;
6965 let mut next_offset = offset;
6966 let end_offset = offset + bytes_len;
6967 _next_ordinal_to_read += 1;
6968 if next_offset >= end_offset {
6969 return Ok(());
6970 }
6971
6972 while _next_ordinal_to_read < 2 {
6974 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6975 _next_ordinal_to_read += 1;
6976 next_offset += envelope_size;
6977 }
6978
6979 let next_out_of_line = decoder.next_out_of_line();
6980 let handles_before = decoder.remaining_handles();
6981 if let Some((inlined, num_bytes, num_handles)) =
6982 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6983 {
6984 let member_inline_size = <fidl::encoding::Vector<FileHandle, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6985 if inlined != (member_inline_size <= 4) {
6986 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6987 }
6988 let inner_offset;
6989 let mut inner_depth = depth.clone();
6990 if inlined {
6991 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6992 inner_offset = next_offset;
6993 } else {
6994 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6995 inner_depth.increment()?;
6996 }
6997 let val_ref =
6998 self.get_responses.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<FileHandle, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
6999 fidl::decode!(fidl::encoding::Vector<FileHandle, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7000 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7001 {
7002 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7003 }
7004 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7005 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7006 }
7007 }
7008
7009 next_offset += envelope_size;
7010 _next_ordinal_to_read += 1;
7011 if next_offset >= end_offset {
7012 return Ok(());
7013 }
7014
7015 while _next_ordinal_to_read < 3 {
7017 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7018 _next_ordinal_to_read += 1;
7019 next_offset += envelope_size;
7020 }
7021
7022 let next_out_of_line = decoder.next_out_of_line();
7023 let handles_before = decoder.remaining_handles();
7024 if let Some((inlined, num_bytes, num_handles)) =
7025 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7026 {
7027 let member_inline_size =
7028 <fidl::encoding::Vector<i32, 16> as fidl::encoding::TypeMarker>::inline_size(
7029 decoder.context,
7030 );
7031 if inlined != (member_inline_size <= 4) {
7032 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7033 }
7034 let inner_offset;
7035 let mut inner_depth = depth.clone();
7036 if inlined {
7037 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7038 inner_offset = next_offset;
7039 } else {
7040 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7041 inner_depth.increment()?;
7042 }
7043 let val_ref =
7044 self.add_responses.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<i32, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
7045 fidl::decode!(fidl::encoding::Vector<i32, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7046 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7047 {
7048 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7049 }
7050 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7051 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7052 }
7053 }
7054
7055 next_offset += envelope_size;
7056
7057 while next_offset < end_offset {
7059 _next_ordinal_to_read += 1;
7060 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7061 next_offset += envelope_size;
7062 }
7063
7064 Ok(())
7065 }
7066 }
7067
7068 impl RemoteControllerStartRequest {
7069 #[inline(always)]
7070 fn max_ordinal_present(&self) -> u64 {
7071 if let Some(_) = self.container_power_controller {
7072 return 3;
7073 }
7074 if let Some(_) = self.lutex_controller {
7075 return 2;
7076 }
7077 if let Some(_) = self.dev_binder {
7078 return 1;
7079 }
7080 0
7081 }
7082 }
7083
7084 impl fidl::encoding::ResourceTypeMarker for RemoteControllerStartRequest {
7085 type Borrowed<'a> = &'a mut Self;
7086 fn take_or_borrow<'a>(
7087 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7088 ) -> Self::Borrowed<'a> {
7089 value
7090 }
7091 }
7092
7093 unsafe impl fidl::encoding::TypeMarker for RemoteControllerStartRequest {
7094 type Owned = Self;
7095
7096 #[inline(always)]
7097 fn inline_align(_context: fidl::encoding::Context) -> usize {
7098 8
7099 }
7100
7101 #[inline(always)]
7102 fn inline_size(_context: fidl::encoding::Context) -> usize {
7103 16
7104 }
7105 }
7106
7107 unsafe impl
7108 fidl::encoding::Encode<
7109 RemoteControllerStartRequest,
7110 fidl::encoding::DefaultFuchsiaResourceDialect,
7111 > for &mut RemoteControllerStartRequest
7112 {
7113 unsafe fn encode(
7114 self,
7115 encoder: &mut fidl::encoding::Encoder<
7116 '_,
7117 fidl::encoding::DefaultFuchsiaResourceDialect,
7118 >,
7119 offset: usize,
7120 mut depth: fidl::encoding::Depth,
7121 ) -> fidl::Result<()> {
7122 encoder.debug_check_bounds::<RemoteControllerStartRequest>(offset);
7123 let max_ordinal: u64 = self.max_ordinal_present();
7125 encoder.write_num(max_ordinal, offset);
7126 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7127 if max_ordinal == 0 {
7129 return Ok(());
7130 }
7131 depth.increment()?;
7132 let envelope_size = 8;
7133 let bytes_len = max_ordinal as usize * envelope_size;
7134 #[allow(unused_variables)]
7135 let offset = encoder.out_of_line_offset(bytes_len);
7136 let mut _prev_end_offset: usize = 0;
7137 if 1 > max_ordinal {
7138 return Ok(());
7139 }
7140
7141 let cur_offset: usize = (1 - 1) * envelope_size;
7144
7145 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7147
7148 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevBinderMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
7153 self.dev_binder.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevBinderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7154 encoder, offset + cur_offset, depth
7155 )?;
7156
7157 _prev_end_offset = cur_offset + envelope_size;
7158 if 2 > max_ordinal {
7159 return Ok(());
7160 }
7161
7162 let cur_offset: usize = (2 - 1) * envelope_size;
7165
7166 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7168
7169 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LutexControllerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
7174 self.lutex_controller.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LutexControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7175 encoder, offset + cur_offset, depth
7176 )?;
7177
7178 _prev_end_offset = cur_offset + envelope_size;
7179 if 3 > max_ordinal {
7180 return Ok(());
7181 }
7182
7183 let cur_offset: usize = (3 - 1) * envelope_size;
7186
7187 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7189
7190 fidl::encoding::encode_in_envelope_optional::<
7195 fidl::encoding::Endpoint<
7196 fidl::endpoints::ClientEnd<ContainerPowerControllerMarker>,
7197 >,
7198 fidl::encoding::DefaultFuchsiaResourceDialect,
7199 >(
7200 self.container_power_controller.as_mut().map(
7201 <fidl::encoding::Endpoint<
7202 fidl::endpoints::ClientEnd<ContainerPowerControllerMarker>,
7203 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7204 ),
7205 encoder,
7206 offset + cur_offset,
7207 depth,
7208 )?;
7209
7210 _prev_end_offset = cur_offset + envelope_size;
7211
7212 Ok(())
7213 }
7214 }
7215
7216 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7217 for RemoteControllerStartRequest
7218 {
7219 #[inline(always)]
7220 fn new_empty() -> Self {
7221 Self::default()
7222 }
7223
7224 unsafe fn decode(
7225 &mut self,
7226 decoder: &mut fidl::encoding::Decoder<
7227 '_,
7228 fidl::encoding::DefaultFuchsiaResourceDialect,
7229 >,
7230 offset: usize,
7231 mut depth: fidl::encoding::Depth,
7232 ) -> fidl::Result<()> {
7233 decoder.debug_check_bounds::<Self>(offset);
7234 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7235 None => return Err(fidl::Error::NotNullable),
7236 Some(len) => len,
7237 };
7238 if len == 0 {
7240 return Ok(());
7241 };
7242 depth.increment()?;
7243 let envelope_size = 8;
7244 let bytes_len = len * envelope_size;
7245 let offset = decoder.out_of_line_offset(bytes_len)?;
7246 let mut _next_ordinal_to_read = 0;
7248 let mut next_offset = offset;
7249 let end_offset = offset + bytes_len;
7250 _next_ordinal_to_read += 1;
7251 if next_offset >= end_offset {
7252 return Ok(());
7253 }
7254
7255 while _next_ordinal_to_read < 1 {
7257 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7258 _next_ordinal_to_read += 1;
7259 next_offset += envelope_size;
7260 }
7261
7262 let next_out_of_line = decoder.next_out_of_line();
7263 let handles_before = decoder.remaining_handles();
7264 if let Some((inlined, num_bytes, num_handles)) =
7265 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7266 {
7267 let member_inline_size = <fidl::encoding::Endpoint<
7268 fidl::endpoints::ClientEnd<DevBinderMarker>,
7269 > as fidl::encoding::TypeMarker>::inline_size(
7270 decoder.context
7271 );
7272 if inlined != (member_inline_size <= 4) {
7273 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7274 }
7275 let inner_offset;
7276 let mut inner_depth = depth.clone();
7277 if inlined {
7278 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7279 inner_offset = next_offset;
7280 } else {
7281 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7282 inner_depth.increment()?;
7283 }
7284 let val_ref = self.dev_binder.get_or_insert_with(|| {
7285 fidl::new_empty!(
7286 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevBinderMarker>>,
7287 fidl::encoding::DefaultFuchsiaResourceDialect
7288 )
7289 });
7290 fidl::decode!(
7291 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevBinderMarker>>,
7292 fidl::encoding::DefaultFuchsiaResourceDialect,
7293 val_ref,
7294 decoder,
7295 inner_offset,
7296 inner_depth
7297 )?;
7298 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7299 {
7300 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7301 }
7302 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7303 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7304 }
7305 }
7306
7307 next_offset += envelope_size;
7308 _next_ordinal_to_read += 1;
7309 if next_offset >= end_offset {
7310 return Ok(());
7311 }
7312
7313 while _next_ordinal_to_read < 2 {
7315 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7316 _next_ordinal_to_read += 1;
7317 next_offset += envelope_size;
7318 }
7319
7320 let next_out_of_line = decoder.next_out_of_line();
7321 let handles_before = decoder.remaining_handles();
7322 if let Some((inlined, num_bytes, num_handles)) =
7323 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7324 {
7325 let member_inline_size = <fidl::encoding::Endpoint<
7326 fidl::endpoints::ClientEnd<LutexControllerMarker>,
7327 > as fidl::encoding::TypeMarker>::inline_size(
7328 decoder.context
7329 );
7330 if inlined != (member_inline_size <= 4) {
7331 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7332 }
7333 let inner_offset;
7334 let mut inner_depth = depth.clone();
7335 if inlined {
7336 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7337 inner_offset = next_offset;
7338 } else {
7339 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7340 inner_depth.increment()?;
7341 }
7342 let val_ref = self.lutex_controller.get_or_insert_with(|| {
7343 fidl::new_empty!(
7344 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LutexControllerMarker>>,
7345 fidl::encoding::DefaultFuchsiaResourceDialect
7346 )
7347 });
7348 fidl::decode!(
7349 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LutexControllerMarker>>,
7350 fidl::encoding::DefaultFuchsiaResourceDialect,
7351 val_ref,
7352 decoder,
7353 inner_offset,
7354 inner_depth
7355 )?;
7356 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7357 {
7358 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7359 }
7360 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7361 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7362 }
7363 }
7364
7365 next_offset += envelope_size;
7366 _next_ordinal_to_read += 1;
7367 if next_offset >= end_offset {
7368 return Ok(());
7369 }
7370
7371 while _next_ordinal_to_read < 3 {
7373 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7374 _next_ordinal_to_read += 1;
7375 next_offset += envelope_size;
7376 }
7377
7378 let next_out_of_line = decoder.next_out_of_line();
7379 let handles_before = decoder.remaining_handles();
7380 if let Some((inlined, num_bytes, num_handles)) =
7381 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7382 {
7383 let member_inline_size = <fidl::encoding::Endpoint<
7384 fidl::endpoints::ClientEnd<ContainerPowerControllerMarker>,
7385 > as fidl::encoding::TypeMarker>::inline_size(
7386 decoder.context
7387 );
7388 if inlined != (member_inline_size <= 4) {
7389 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7390 }
7391 let inner_offset;
7392 let mut inner_depth = depth.clone();
7393 if inlined {
7394 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7395 inner_offset = next_offset;
7396 } else {
7397 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7398 inner_depth.increment()?;
7399 }
7400 let val_ref = self.container_power_controller.get_or_insert_with(|| {
7401 fidl::new_empty!(
7402 fidl::encoding::Endpoint<
7403 fidl::endpoints::ClientEnd<ContainerPowerControllerMarker>,
7404 >,
7405 fidl::encoding::DefaultFuchsiaResourceDialect
7406 )
7407 });
7408 fidl::decode!(
7409 fidl::encoding::Endpoint<
7410 fidl::endpoints::ClientEnd<ContainerPowerControllerMarker>,
7411 >,
7412 fidl::encoding::DefaultFuchsiaResourceDialect,
7413 val_ref,
7414 decoder,
7415 inner_offset,
7416 inner_depth
7417 )?;
7418 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7419 {
7420 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7421 }
7422 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7423 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7424 }
7425 }
7426
7427 next_offset += envelope_size;
7428
7429 while next_offset < end_offset {
7431 _next_ordinal_to_read += 1;
7432 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7433 next_offset += envelope_size;
7434 }
7435
7436 Ok(())
7437 }
7438 }
7439
7440 impl UnixDomainSocketWriteRequest {
7441 #[inline(always)]
7442 fn max_ordinal_present(&self) -> u64 {
7443 if let Some(_) = self.handles {
7444 return 2;
7445 }
7446 if let Some(_) = self.data {
7447 return 1;
7448 }
7449 0
7450 }
7451 }
7452
7453 impl fidl::encoding::ResourceTypeMarker for UnixDomainSocketWriteRequest {
7454 type Borrowed<'a> = &'a mut Self;
7455 fn take_or_borrow<'a>(
7456 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7457 ) -> Self::Borrowed<'a> {
7458 value
7459 }
7460 }
7461
7462 unsafe impl fidl::encoding::TypeMarker for UnixDomainSocketWriteRequest {
7463 type Owned = Self;
7464
7465 #[inline(always)]
7466 fn inline_align(_context: fidl::encoding::Context) -> usize {
7467 8
7468 }
7469
7470 #[inline(always)]
7471 fn inline_size(_context: fidl::encoding::Context) -> usize {
7472 16
7473 }
7474 }
7475
7476 unsafe impl
7477 fidl::encoding::Encode<
7478 UnixDomainSocketWriteRequest,
7479 fidl::encoding::DefaultFuchsiaResourceDialect,
7480 > for &mut UnixDomainSocketWriteRequest
7481 {
7482 unsafe fn encode(
7483 self,
7484 encoder: &mut fidl::encoding::Encoder<
7485 '_,
7486 fidl::encoding::DefaultFuchsiaResourceDialect,
7487 >,
7488 offset: usize,
7489 mut depth: fidl::encoding::Depth,
7490 ) -> fidl::Result<()> {
7491 encoder.debug_check_bounds::<UnixDomainSocketWriteRequest>(offset);
7492 let max_ordinal: u64 = self.max_ordinal_present();
7494 encoder.write_num(max_ordinal, offset);
7495 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7496 if max_ordinal == 0 {
7498 return Ok(());
7499 }
7500 depth.increment()?;
7501 let envelope_size = 8;
7502 let bytes_len = max_ordinal as usize * envelope_size;
7503 #[allow(unused_variables)]
7504 let offset = encoder.out_of_line_offset(bytes_len);
7505 let mut _prev_end_offset: usize = 0;
7506 if 1 > max_ordinal {
7507 return Ok(());
7508 }
7509
7510 let cur_offset: usize = (1 - 1) * envelope_size;
7513
7514 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7516
7517 fidl::encoding::encode_in_envelope_optional::<
7522 fidl::encoding::Vector<u8, 8192>,
7523 fidl::encoding::DefaultFuchsiaResourceDialect,
7524 >(
7525 self.data.as_ref().map(
7526 <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow,
7527 ),
7528 encoder,
7529 offset + cur_offset,
7530 depth,
7531 )?;
7532
7533 _prev_end_offset = cur_offset + envelope_size;
7534 if 2 > max_ordinal {
7535 return Ok(());
7536 }
7537
7538 let cur_offset: usize = (2 - 1) * envelope_size;
7541
7542 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7544
7545 fidl::encoding::encode_in_envelope_optional::<
7550 fidl::encoding::Vector<
7551 fidl::encoding::HandleType<
7552 fidl::Handle,
7553 { fidl::ObjectType::NONE.into_raw() },
7554 2147483648,
7555 >,
7556 8,
7557 >,
7558 fidl::encoding::DefaultFuchsiaResourceDialect,
7559 >(
7560 self.handles.as_mut().map(
7561 <fidl::encoding::Vector<
7562 fidl::encoding::HandleType<
7563 fidl::Handle,
7564 { fidl::ObjectType::NONE.into_raw() },
7565 2147483648,
7566 >,
7567 8,
7568 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7569 ),
7570 encoder,
7571 offset + cur_offset,
7572 depth,
7573 )?;
7574
7575 _prev_end_offset = cur_offset + envelope_size;
7576
7577 Ok(())
7578 }
7579 }
7580
7581 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7582 for UnixDomainSocketWriteRequest
7583 {
7584 #[inline(always)]
7585 fn new_empty() -> Self {
7586 Self::default()
7587 }
7588
7589 unsafe fn decode(
7590 &mut self,
7591 decoder: &mut fidl::encoding::Decoder<
7592 '_,
7593 fidl::encoding::DefaultFuchsiaResourceDialect,
7594 >,
7595 offset: usize,
7596 mut depth: fidl::encoding::Depth,
7597 ) -> fidl::Result<()> {
7598 decoder.debug_check_bounds::<Self>(offset);
7599 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7600 None => return Err(fidl::Error::NotNullable),
7601 Some(len) => len,
7602 };
7603 if len == 0 {
7605 return Ok(());
7606 };
7607 depth.increment()?;
7608 let envelope_size = 8;
7609 let bytes_len = len * envelope_size;
7610 let offset = decoder.out_of_line_offset(bytes_len)?;
7611 let mut _next_ordinal_to_read = 0;
7613 let mut next_offset = offset;
7614 let end_offset = offset + bytes_len;
7615 _next_ordinal_to_read += 1;
7616 if next_offset >= end_offset {
7617 return Ok(());
7618 }
7619
7620 while _next_ordinal_to_read < 1 {
7622 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7623 _next_ordinal_to_read += 1;
7624 next_offset += envelope_size;
7625 }
7626
7627 let next_out_of_line = decoder.next_out_of_line();
7628 let handles_before = decoder.remaining_handles();
7629 if let Some((inlined, num_bytes, num_handles)) =
7630 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7631 {
7632 let member_inline_size =
7633 <fidl::encoding::Vector<u8, 8192> as fidl::encoding::TypeMarker>::inline_size(
7634 decoder.context,
7635 );
7636 if inlined != (member_inline_size <= 4) {
7637 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7638 }
7639 let inner_offset;
7640 let mut inner_depth = depth.clone();
7641 if inlined {
7642 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7643 inner_offset = next_offset;
7644 } else {
7645 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7646 inner_depth.increment()?;
7647 }
7648 let val_ref =
7649 self.data.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, fidl::encoding::DefaultFuchsiaResourceDialect));
7650 fidl::decode!(fidl::encoding::Vector<u8, 8192>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7651 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7652 {
7653 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7654 }
7655 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7656 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7657 }
7658 }
7659
7660 next_offset += envelope_size;
7661 _next_ordinal_to_read += 1;
7662 if next_offset >= end_offset {
7663 return Ok(());
7664 }
7665
7666 while _next_ordinal_to_read < 2 {
7668 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7669 _next_ordinal_to_read += 1;
7670 next_offset += envelope_size;
7671 }
7672
7673 let next_out_of_line = decoder.next_out_of_line();
7674 let handles_before = decoder.remaining_handles();
7675 if let Some((inlined, num_bytes, num_handles)) =
7676 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7677 {
7678 let member_inline_size = <fidl::encoding::Vector<
7679 fidl::encoding::HandleType<
7680 fidl::Handle,
7681 { fidl::ObjectType::NONE.into_raw() },
7682 2147483648,
7683 >,
7684 8,
7685 > as fidl::encoding::TypeMarker>::inline_size(
7686 decoder.context
7687 );
7688 if inlined != (member_inline_size <= 4) {
7689 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7690 }
7691 let inner_offset;
7692 let mut inner_depth = depth.clone();
7693 if inlined {
7694 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7695 inner_offset = next_offset;
7696 } else {
7697 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7698 inner_depth.increment()?;
7699 }
7700 let val_ref = self.handles.get_or_insert_with(|| {
7701 fidl::new_empty!(
7702 fidl::encoding::Vector<
7703 fidl::encoding::HandleType<
7704 fidl::Handle,
7705 { fidl::ObjectType::NONE.into_raw() },
7706 2147483648,
7707 >,
7708 8,
7709 >,
7710 fidl::encoding::DefaultFuchsiaResourceDialect
7711 )
7712 });
7713 fidl::decode!(
7714 fidl::encoding::Vector<
7715 fidl::encoding::HandleType<
7716 fidl::Handle,
7717 { fidl::ObjectType::NONE.into_raw() },
7718 2147483648,
7719 >,
7720 8,
7721 >,
7722 fidl::encoding::DefaultFuchsiaResourceDialect,
7723 val_ref,
7724 decoder,
7725 inner_offset,
7726 inner_depth
7727 )?;
7728 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7729 {
7730 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7731 }
7732 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7733 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7734 }
7735 }
7736
7737 next_offset += envelope_size;
7738
7739 while next_offset < end_offset {
7741 _next_ordinal_to_read += 1;
7742 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7743 next_offset += envelope_size;
7744 }
7745
7746 Ok(())
7747 }
7748 }
7749
7750 impl UnixDomainSocketGetEventResponse {
7751 #[inline(always)]
7752 fn max_ordinal_present(&self) -> u64 {
7753 if let Some(_) = self.event {
7754 return 1;
7755 }
7756 0
7757 }
7758 }
7759
7760 impl fidl::encoding::ResourceTypeMarker for UnixDomainSocketGetEventResponse {
7761 type Borrowed<'a> = &'a mut Self;
7762 fn take_or_borrow<'a>(
7763 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7764 ) -> Self::Borrowed<'a> {
7765 value
7766 }
7767 }
7768
7769 unsafe impl fidl::encoding::TypeMarker for UnixDomainSocketGetEventResponse {
7770 type Owned = Self;
7771
7772 #[inline(always)]
7773 fn inline_align(_context: fidl::encoding::Context) -> usize {
7774 8
7775 }
7776
7777 #[inline(always)]
7778 fn inline_size(_context: fidl::encoding::Context) -> usize {
7779 16
7780 }
7781 }
7782
7783 unsafe impl
7784 fidl::encoding::Encode<
7785 UnixDomainSocketGetEventResponse,
7786 fidl::encoding::DefaultFuchsiaResourceDialect,
7787 > for &mut UnixDomainSocketGetEventResponse
7788 {
7789 unsafe fn encode(
7790 self,
7791 encoder: &mut fidl::encoding::Encoder<
7792 '_,
7793 fidl::encoding::DefaultFuchsiaResourceDialect,
7794 >,
7795 offset: usize,
7796 mut depth: fidl::encoding::Depth,
7797 ) -> fidl::Result<()> {
7798 encoder.debug_check_bounds::<UnixDomainSocketGetEventResponse>(offset);
7799 let max_ordinal: u64 = self.max_ordinal_present();
7801 encoder.write_num(max_ordinal, offset);
7802 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7803 if max_ordinal == 0 {
7805 return Ok(());
7806 }
7807 depth.increment()?;
7808 let envelope_size = 8;
7809 let bytes_len = max_ordinal as usize * envelope_size;
7810 #[allow(unused_variables)]
7811 let offset = encoder.out_of_line_offset(bytes_len);
7812 let mut _prev_end_offset: usize = 0;
7813 if 1 > max_ordinal {
7814 return Ok(());
7815 }
7816
7817 let cur_offset: usize = (1 - 1) * envelope_size;
7820
7821 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7823
7824 fidl::encoding::encode_in_envelope_optional::<
7829 fidl::encoding::HandleType<
7830 fidl::EventPair,
7831 { fidl::ObjectType::EVENTPAIR.into_raw() },
7832 20482,
7833 >,
7834 fidl::encoding::DefaultFuchsiaResourceDialect,
7835 >(
7836 self.event.as_mut().map(
7837 <fidl::encoding::HandleType<
7838 fidl::EventPair,
7839 { fidl::ObjectType::EVENTPAIR.into_raw() },
7840 20482,
7841 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7842 ),
7843 encoder,
7844 offset + cur_offset,
7845 depth,
7846 )?;
7847
7848 _prev_end_offset = cur_offset + envelope_size;
7849
7850 Ok(())
7851 }
7852 }
7853
7854 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7855 for UnixDomainSocketGetEventResponse
7856 {
7857 #[inline(always)]
7858 fn new_empty() -> Self {
7859 Self::default()
7860 }
7861
7862 unsafe fn decode(
7863 &mut self,
7864 decoder: &mut fidl::encoding::Decoder<
7865 '_,
7866 fidl::encoding::DefaultFuchsiaResourceDialect,
7867 >,
7868 offset: usize,
7869 mut depth: fidl::encoding::Depth,
7870 ) -> fidl::Result<()> {
7871 decoder.debug_check_bounds::<Self>(offset);
7872 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7873 None => return Err(fidl::Error::NotNullable),
7874 Some(len) => len,
7875 };
7876 if len == 0 {
7878 return Ok(());
7879 };
7880 depth.increment()?;
7881 let envelope_size = 8;
7882 let bytes_len = len * envelope_size;
7883 let offset = decoder.out_of_line_offset(bytes_len)?;
7884 let mut _next_ordinal_to_read = 0;
7886 let mut next_offset = offset;
7887 let end_offset = offset + bytes_len;
7888 _next_ordinal_to_read += 1;
7889 if next_offset >= end_offset {
7890 return Ok(());
7891 }
7892
7893 while _next_ordinal_to_read < 1 {
7895 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7896 _next_ordinal_to_read += 1;
7897 next_offset += envelope_size;
7898 }
7899
7900 let next_out_of_line = decoder.next_out_of_line();
7901 let handles_before = decoder.remaining_handles();
7902 if let Some((inlined, num_bytes, num_handles)) =
7903 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7904 {
7905 let member_inline_size = <fidl::encoding::HandleType<
7906 fidl::EventPair,
7907 { fidl::ObjectType::EVENTPAIR.into_raw() },
7908 20482,
7909 > as fidl::encoding::TypeMarker>::inline_size(
7910 decoder.context
7911 );
7912 if inlined != (member_inline_size <= 4) {
7913 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7914 }
7915 let inner_offset;
7916 let mut inner_depth = depth.clone();
7917 if inlined {
7918 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7919 inner_offset = next_offset;
7920 } else {
7921 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7922 inner_depth.increment()?;
7923 }
7924 let val_ref =
7925 self.event.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 20482>, fidl::encoding::DefaultFuchsiaResourceDialect));
7926 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 20482>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7927 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7928 {
7929 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7930 }
7931 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7932 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7933 }
7934 }
7935
7936 next_offset += envelope_size;
7937
7938 while next_offset < end_offset {
7940 _next_ordinal_to_read += 1;
7941 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7942 next_offset += envelope_size;
7943 }
7944
7945 Ok(())
7946 }
7947 }
7948
7949 impl UnixDomainSocketReadResponse {
7950 #[inline(always)]
7951 fn max_ordinal_present(&self) -> u64 {
7952 if let Some(_) = self.handles {
7953 return 3;
7954 }
7955 if let Some(_) = self.data_original_length {
7956 return 2;
7957 }
7958 if let Some(_) = self.data {
7959 return 1;
7960 }
7961 0
7962 }
7963 }
7964
7965 impl fidl::encoding::ResourceTypeMarker for UnixDomainSocketReadResponse {
7966 type Borrowed<'a> = &'a mut Self;
7967 fn take_or_borrow<'a>(
7968 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7969 ) -> Self::Borrowed<'a> {
7970 value
7971 }
7972 }
7973
7974 unsafe impl fidl::encoding::TypeMarker for UnixDomainSocketReadResponse {
7975 type Owned = Self;
7976
7977 #[inline(always)]
7978 fn inline_align(_context: fidl::encoding::Context) -> usize {
7979 8
7980 }
7981
7982 #[inline(always)]
7983 fn inline_size(_context: fidl::encoding::Context) -> usize {
7984 16
7985 }
7986 }
7987
7988 unsafe impl
7989 fidl::encoding::Encode<
7990 UnixDomainSocketReadResponse,
7991 fidl::encoding::DefaultFuchsiaResourceDialect,
7992 > for &mut UnixDomainSocketReadResponse
7993 {
7994 unsafe fn encode(
7995 self,
7996 encoder: &mut fidl::encoding::Encoder<
7997 '_,
7998 fidl::encoding::DefaultFuchsiaResourceDialect,
7999 >,
8000 offset: usize,
8001 mut depth: fidl::encoding::Depth,
8002 ) -> fidl::Result<()> {
8003 encoder.debug_check_bounds::<UnixDomainSocketReadResponse>(offset);
8004 let max_ordinal: u64 = self.max_ordinal_present();
8006 encoder.write_num(max_ordinal, offset);
8007 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8008 if max_ordinal == 0 {
8010 return Ok(());
8011 }
8012 depth.increment()?;
8013 let envelope_size = 8;
8014 let bytes_len = max_ordinal as usize * envelope_size;
8015 #[allow(unused_variables)]
8016 let offset = encoder.out_of_line_offset(bytes_len);
8017 let mut _prev_end_offset: usize = 0;
8018 if 1 > max_ordinal {
8019 return Ok(());
8020 }
8021
8022 let cur_offset: usize = (1 - 1) * envelope_size;
8025
8026 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8028
8029 fidl::encoding::encode_in_envelope_optional::<
8034 fidl::encoding::Vector<u8, 8192>,
8035 fidl::encoding::DefaultFuchsiaResourceDialect,
8036 >(
8037 self.data.as_ref().map(
8038 <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow,
8039 ),
8040 encoder,
8041 offset + cur_offset,
8042 depth,
8043 )?;
8044
8045 _prev_end_offset = cur_offset + envelope_size;
8046 if 2 > max_ordinal {
8047 return Ok(());
8048 }
8049
8050 let cur_offset: usize = (2 - 1) * envelope_size;
8053
8054 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8056
8057 fidl::encoding::encode_in_envelope_optional::<
8062 u64,
8063 fidl::encoding::DefaultFuchsiaResourceDialect,
8064 >(
8065 self.data_original_length
8066 .as_ref()
8067 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8068 encoder,
8069 offset + cur_offset,
8070 depth,
8071 )?;
8072
8073 _prev_end_offset = cur_offset + envelope_size;
8074 if 3 > max_ordinal {
8075 return Ok(());
8076 }
8077
8078 let cur_offset: usize = (3 - 1) * envelope_size;
8081
8082 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8084
8085 fidl::encoding::encode_in_envelope_optional::<
8090 fidl::encoding::Vector<
8091 fidl::encoding::HandleType<
8092 fidl::Handle,
8093 { fidl::ObjectType::NONE.into_raw() },
8094 2147483648,
8095 >,
8096 8,
8097 >,
8098 fidl::encoding::DefaultFuchsiaResourceDialect,
8099 >(
8100 self.handles.as_mut().map(
8101 <fidl::encoding::Vector<
8102 fidl::encoding::HandleType<
8103 fidl::Handle,
8104 { fidl::ObjectType::NONE.into_raw() },
8105 2147483648,
8106 >,
8107 8,
8108 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8109 ),
8110 encoder,
8111 offset + cur_offset,
8112 depth,
8113 )?;
8114
8115 _prev_end_offset = cur_offset + envelope_size;
8116
8117 Ok(())
8118 }
8119 }
8120
8121 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8122 for UnixDomainSocketReadResponse
8123 {
8124 #[inline(always)]
8125 fn new_empty() -> Self {
8126 Self::default()
8127 }
8128
8129 unsafe fn decode(
8130 &mut self,
8131 decoder: &mut fidl::encoding::Decoder<
8132 '_,
8133 fidl::encoding::DefaultFuchsiaResourceDialect,
8134 >,
8135 offset: usize,
8136 mut depth: fidl::encoding::Depth,
8137 ) -> fidl::Result<()> {
8138 decoder.debug_check_bounds::<Self>(offset);
8139 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8140 None => return Err(fidl::Error::NotNullable),
8141 Some(len) => len,
8142 };
8143 if len == 0 {
8145 return Ok(());
8146 };
8147 depth.increment()?;
8148 let envelope_size = 8;
8149 let bytes_len = len * envelope_size;
8150 let offset = decoder.out_of_line_offset(bytes_len)?;
8151 let mut _next_ordinal_to_read = 0;
8153 let mut next_offset = offset;
8154 let end_offset = offset + bytes_len;
8155 _next_ordinal_to_read += 1;
8156 if next_offset >= end_offset {
8157 return Ok(());
8158 }
8159
8160 while _next_ordinal_to_read < 1 {
8162 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8163 _next_ordinal_to_read += 1;
8164 next_offset += envelope_size;
8165 }
8166
8167 let next_out_of_line = decoder.next_out_of_line();
8168 let handles_before = decoder.remaining_handles();
8169 if let Some((inlined, num_bytes, num_handles)) =
8170 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8171 {
8172 let member_inline_size =
8173 <fidl::encoding::Vector<u8, 8192> as fidl::encoding::TypeMarker>::inline_size(
8174 decoder.context,
8175 );
8176 if inlined != (member_inline_size <= 4) {
8177 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8178 }
8179 let inner_offset;
8180 let mut inner_depth = depth.clone();
8181 if inlined {
8182 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8183 inner_offset = next_offset;
8184 } else {
8185 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8186 inner_depth.increment()?;
8187 }
8188 let val_ref =
8189 self.data.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, fidl::encoding::DefaultFuchsiaResourceDialect));
8190 fidl::decode!(fidl::encoding::Vector<u8, 8192>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
8191 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8192 {
8193 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8194 }
8195 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8196 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8197 }
8198 }
8199
8200 next_offset += envelope_size;
8201 _next_ordinal_to_read += 1;
8202 if next_offset >= end_offset {
8203 return Ok(());
8204 }
8205
8206 while _next_ordinal_to_read < 2 {
8208 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8209 _next_ordinal_to_read += 1;
8210 next_offset += envelope_size;
8211 }
8212
8213 let next_out_of_line = decoder.next_out_of_line();
8214 let handles_before = decoder.remaining_handles();
8215 if let Some((inlined, num_bytes, num_handles)) =
8216 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8217 {
8218 let member_inline_size =
8219 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8220 if inlined != (member_inline_size <= 4) {
8221 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8222 }
8223 let inner_offset;
8224 let mut inner_depth = depth.clone();
8225 if inlined {
8226 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8227 inner_offset = next_offset;
8228 } else {
8229 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8230 inner_depth.increment()?;
8231 }
8232 let val_ref = self.data_original_length.get_or_insert_with(|| {
8233 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
8234 });
8235 fidl::decode!(
8236 u64,
8237 fidl::encoding::DefaultFuchsiaResourceDialect,
8238 val_ref,
8239 decoder,
8240 inner_offset,
8241 inner_depth
8242 )?;
8243 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8244 {
8245 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8246 }
8247 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8248 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8249 }
8250 }
8251
8252 next_offset += envelope_size;
8253 _next_ordinal_to_read += 1;
8254 if next_offset >= end_offset {
8255 return Ok(());
8256 }
8257
8258 while _next_ordinal_to_read < 3 {
8260 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8261 _next_ordinal_to_read += 1;
8262 next_offset += envelope_size;
8263 }
8264
8265 let next_out_of_line = decoder.next_out_of_line();
8266 let handles_before = decoder.remaining_handles();
8267 if let Some((inlined, num_bytes, num_handles)) =
8268 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8269 {
8270 let member_inline_size = <fidl::encoding::Vector<
8271 fidl::encoding::HandleType<
8272 fidl::Handle,
8273 { fidl::ObjectType::NONE.into_raw() },
8274 2147483648,
8275 >,
8276 8,
8277 > as fidl::encoding::TypeMarker>::inline_size(
8278 decoder.context
8279 );
8280 if inlined != (member_inline_size <= 4) {
8281 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8282 }
8283 let inner_offset;
8284 let mut inner_depth = depth.clone();
8285 if inlined {
8286 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8287 inner_offset = next_offset;
8288 } else {
8289 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8290 inner_depth.increment()?;
8291 }
8292 let val_ref = self.handles.get_or_insert_with(|| {
8293 fidl::new_empty!(
8294 fidl::encoding::Vector<
8295 fidl::encoding::HandleType<
8296 fidl::Handle,
8297 { fidl::ObjectType::NONE.into_raw() },
8298 2147483648,
8299 >,
8300 8,
8301 >,
8302 fidl::encoding::DefaultFuchsiaResourceDialect
8303 )
8304 });
8305 fidl::decode!(
8306 fidl::encoding::Vector<
8307 fidl::encoding::HandleType<
8308 fidl::Handle,
8309 { fidl::ObjectType::NONE.into_raw() },
8310 2147483648,
8311 >,
8312 8,
8313 >,
8314 fidl::encoding::DefaultFuchsiaResourceDialect,
8315 val_ref,
8316 decoder,
8317 inner_offset,
8318 inner_depth
8319 )?;
8320 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8321 {
8322 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8323 }
8324 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8325 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8326 }
8327 }
8328
8329 next_offset += envelope_size;
8330
8331 while next_offset < end_offset {
8333 _next_ordinal_to_read += 1;
8334 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8335 next_offset += envelope_size;
8336 }
8337
8338 Ok(())
8339 }
8340 }
8341
8342 impl WaitBitsetRequest {
8343 #[inline(always)]
8344 fn max_ordinal_present(&self) -> u64 {
8345 if let Some(_) = self.deadline {
8346 return 5;
8347 }
8348 if let Some(_) = self.mask {
8349 return 4;
8350 }
8351 if let Some(_) = self.value {
8352 return 3;
8353 }
8354 if let Some(_) = self.offset {
8355 return 2;
8356 }
8357 if let Some(_) = self.vmo {
8358 return 1;
8359 }
8360 0
8361 }
8362 }
8363
8364 impl fidl::encoding::ResourceTypeMarker for WaitBitsetRequest {
8365 type Borrowed<'a> = &'a mut Self;
8366 fn take_or_borrow<'a>(
8367 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8368 ) -> Self::Borrowed<'a> {
8369 value
8370 }
8371 }
8372
8373 unsafe impl fidl::encoding::TypeMarker for WaitBitsetRequest {
8374 type Owned = Self;
8375
8376 #[inline(always)]
8377 fn inline_align(_context: fidl::encoding::Context) -> usize {
8378 8
8379 }
8380
8381 #[inline(always)]
8382 fn inline_size(_context: fidl::encoding::Context) -> usize {
8383 16
8384 }
8385 }
8386
8387 unsafe impl
8388 fidl::encoding::Encode<WaitBitsetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8389 for &mut WaitBitsetRequest
8390 {
8391 unsafe fn encode(
8392 self,
8393 encoder: &mut fidl::encoding::Encoder<
8394 '_,
8395 fidl::encoding::DefaultFuchsiaResourceDialect,
8396 >,
8397 offset: usize,
8398 mut depth: fidl::encoding::Depth,
8399 ) -> fidl::Result<()> {
8400 encoder.debug_check_bounds::<WaitBitsetRequest>(offset);
8401 let max_ordinal: u64 = self.max_ordinal_present();
8403 encoder.write_num(max_ordinal, offset);
8404 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8405 if max_ordinal == 0 {
8407 return Ok(());
8408 }
8409 depth.increment()?;
8410 let envelope_size = 8;
8411 let bytes_len = max_ordinal as usize * envelope_size;
8412 #[allow(unused_variables)]
8413 let offset = encoder.out_of_line_offset(bytes_len);
8414 let mut _prev_end_offset: usize = 0;
8415 if 1 > max_ordinal {
8416 return Ok(());
8417 }
8418
8419 let cur_offset: usize = (1 - 1) * envelope_size;
8422
8423 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8425
8426 fidl::encoding::encode_in_envelope_optional::<
8431 fidl::encoding::HandleType<
8432 fidl::Vmo,
8433 { fidl::ObjectType::VMO.into_raw() },
8434 2147483648,
8435 >,
8436 fidl::encoding::DefaultFuchsiaResourceDialect,
8437 >(
8438 self.vmo.as_mut().map(
8439 <fidl::encoding::HandleType<
8440 fidl::Vmo,
8441 { fidl::ObjectType::VMO.into_raw() },
8442 2147483648,
8443 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8444 ),
8445 encoder,
8446 offset + cur_offset,
8447 depth,
8448 )?;
8449
8450 _prev_end_offset = cur_offset + envelope_size;
8451 if 2 > max_ordinal {
8452 return Ok(());
8453 }
8454
8455 let cur_offset: usize = (2 - 1) * envelope_size;
8458
8459 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8461
8462 fidl::encoding::encode_in_envelope_optional::<
8467 u64,
8468 fidl::encoding::DefaultFuchsiaResourceDialect,
8469 >(
8470 self.offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8471 encoder,
8472 offset + cur_offset,
8473 depth,
8474 )?;
8475
8476 _prev_end_offset = cur_offset + envelope_size;
8477 if 3 > max_ordinal {
8478 return Ok(());
8479 }
8480
8481 let cur_offset: usize = (3 - 1) * envelope_size;
8484
8485 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8487
8488 fidl::encoding::encode_in_envelope_optional::<
8493 u32,
8494 fidl::encoding::DefaultFuchsiaResourceDialect,
8495 >(
8496 self.value.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8497 encoder,
8498 offset + cur_offset,
8499 depth,
8500 )?;
8501
8502 _prev_end_offset = cur_offset + envelope_size;
8503 if 4 > max_ordinal {
8504 return Ok(());
8505 }
8506
8507 let cur_offset: usize = (4 - 1) * envelope_size;
8510
8511 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8513
8514 fidl::encoding::encode_in_envelope_optional::<
8519 u32,
8520 fidl::encoding::DefaultFuchsiaResourceDialect,
8521 >(
8522 self.mask.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8523 encoder,
8524 offset + cur_offset,
8525 depth,
8526 )?;
8527
8528 _prev_end_offset = cur_offset + envelope_size;
8529 if 5 > max_ordinal {
8530 return Ok(());
8531 }
8532
8533 let cur_offset: usize = (5 - 1) * envelope_size;
8536
8537 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8539
8540 fidl::encoding::encode_in_envelope_optional::<
8545 i64,
8546 fidl::encoding::DefaultFuchsiaResourceDialect,
8547 >(
8548 self.deadline.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8549 encoder,
8550 offset + cur_offset,
8551 depth,
8552 )?;
8553
8554 _prev_end_offset = cur_offset + envelope_size;
8555
8556 Ok(())
8557 }
8558 }
8559
8560 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8561 for WaitBitsetRequest
8562 {
8563 #[inline(always)]
8564 fn new_empty() -> Self {
8565 Self::default()
8566 }
8567
8568 unsafe fn decode(
8569 &mut self,
8570 decoder: &mut fidl::encoding::Decoder<
8571 '_,
8572 fidl::encoding::DefaultFuchsiaResourceDialect,
8573 >,
8574 offset: usize,
8575 mut depth: fidl::encoding::Depth,
8576 ) -> fidl::Result<()> {
8577 decoder.debug_check_bounds::<Self>(offset);
8578 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8579 None => return Err(fidl::Error::NotNullable),
8580 Some(len) => len,
8581 };
8582 if len == 0 {
8584 return Ok(());
8585 };
8586 depth.increment()?;
8587 let envelope_size = 8;
8588 let bytes_len = len * envelope_size;
8589 let offset = decoder.out_of_line_offset(bytes_len)?;
8590 let mut _next_ordinal_to_read = 0;
8592 let mut next_offset = offset;
8593 let end_offset = offset + bytes_len;
8594 _next_ordinal_to_read += 1;
8595 if next_offset >= end_offset {
8596 return Ok(());
8597 }
8598
8599 while _next_ordinal_to_read < 1 {
8601 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8602 _next_ordinal_to_read += 1;
8603 next_offset += envelope_size;
8604 }
8605
8606 let next_out_of_line = decoder.next_out_of_line();
8607 let handles_before = decoder.remaining_handles();
8608 if let Some((inlined, num_bytes, num_handles)) =
8609 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8610 {
8611 let member_inline_size = <fidl::encoding::HandleType<
8612 fidl::Vmo,
8613 { fidl::ObjectType::VMO.into_raw() },
8614 2147483648,
8615 > as fidl::encoding::TypeMarker>::inline_size(
8616 decoder.context
8617 );
8618 if inlined != (member_inline_size <= 4) {
8619 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8620 }
8621 let inner_offset;
8622 let mut inner_depth = depth.clone();
8623 if inlined {
8624 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8625 inner_offset = next_offset;
8626 } else {
8627 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8628 inner_depth.increment()?;
8629 }
8630 let val_ref =
8631 self.vmo.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
8632 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
8633 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8634 {
8635 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8636 }
8637 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8638 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8639 }
8640 }
8641
8642 next_offset += envelope_size;
8643 _next_ordinal_to_read += 1;
8644 if next_offset >= end_offset {
8645 return Ok(());
8646 }
8647
8648 while _next_ordinal_to_read < 2 {
8650 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8651 _next_ordinal_to_read += 1;
8652 next_offset += envelope_size;
8653 }
8654
8655 let next_out_of_line = decoder.next_out_of_line();
8656 let handles_before = decoder.remaining_handles();
8657 if let Some((inlined, num_bytes, num_handles)) =
8658 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8659 {
8660 let member_inline_size =
8661 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8662 if inlined != (member_inline_size <= 4) {
8663 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8664 }
8665 let inner_offset;
8666 let mut inner_depth = depth.clone();
8667 if inlined {
8668 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8669 inner_offset = next_offset;
8670 } else {
8671 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8672 inner_depth.increment()?;
8673 }
8674 let val_ref = self.offset.get_or_insert_with(|| {
8675 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
8676 });
8677 fidl::decode!(
8678 u64,
8679 fidl::encoding::DefaultFuchsiaResourceDialect,
8680 val_ref,
8681 decoder,
8682 inner_offset,
8683 inner_depth
8684 )?;
8685 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8686 {
8687 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8688 }
8689 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8690 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8691 }
8692 }
8693
8694 next_offset += envelope_size;
8695 _next_ordinal_to_read += 1;
8696 if next_offset >= end_offset {
8697 return Ok(());
8698 }
8699
8700 while _next_ordinal_to_read < 3 {
8702 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8703 _next_ordinal_to_read += 1;
8704 next_offset += envelope_size;
8705 }
8706
8707 let next_out_of_line = decoder.next_out_of_line();
8708 let handles_before = decoder.remaining_handles();
8709 if let Some((inlined, num_bytes, num_handles)) =
8710 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8711 {
8712 let member_inline_size =
8713 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8714 if inlined != (member_inline_size <= 4) {
8715 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8716 }
8717 let inner_offset;
8718 let mut inner_depth = depth.clone();
8719 if inlined {
8720 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8721 inner_offset = next_offset;
8722 } else {
8723 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8724 inner_depth.increment()?;
8725 }
8726 let val_ref = self.value.get_or_insert_with(|| {
8727 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
8728 });
8729 fidl::decode!(
8730 u32,
8731 fidl::encoding::DefaultFuchsiaResourceDialect,
8732 val_ref,
8733 decoder,
8734 inner_offset,
8735 inner_depth
8736 )?;
8737 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8738 {
8739 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8740 }
8741 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8742 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8743 }
8744 }
8745
8746 next_offset += envelope_size;
8747 _next_ordinal_to_read += 1;
8748 if next_offset >= end_offset {
8749 return Ok(());
8750 }
8751
8752 while _next_ordinal_to_read < 4 {
8754 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8755 _next_ordinal_to_read += 1;
8756 next_offset += envelope_size;
8757 }
8758
8759 let next_out_of_line = decoder.next_out_of_line();
8760 let handles_before = decoder.remaining_handles();
8761 if let Some((inlined, num_bytes, num_handles)) =
8762 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8763 {
8764 let member_inline_size =
8765 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8766 if inlined != (member_inline_size <= 4) {
8767 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8768 }
8769 let inner_offset;
8770 let mut inner_depth = depth.clone();
8771 if inlined {
8772 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8773 inner_offset = next_offset;
8774 } else {
8775 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8776 inner_depth.increment()?;
8777 }
8778 let val_ref = self.mask.get_or_insert_with(|| {
8779 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
8780 });
8781 fidl::decode!(
8782 u32,
8783 fidl::encoding::DefaultFuchsiaResourceDialect,
8784 val_ref,
8785 decoder,
8786 inner_offset,
8787 inner_depth
8788 )?;
8789 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8790 {
8791 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8792 }
8793 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8794 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8795 }
8796 }
8797
8798 next_offset += envelope_size;
8799 _next_ordinal_to_read += 1;
8800 if next_offset >= end_offset {
8801 return Ok(());
8802 }
8803
8804 while _next_ordinal_to_read < 5 {
8806 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8807 _next_ordinal_to_read += 1;
8808 next_offset += envelope_size;
8809 }
8810
8811 let next_out_of_line = decoder.next_out_of_line();
8812 let handles_before = decoder.remaining_handles();
8813 if let Some((inlined, num_bytes, num_handles)) =
8814 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8815 {
8816 let member_inline_size =
8817 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8818 if inlined != (member_inline_size <= 4) {
8819 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8820 }
8821 let inner_offset;
8822 let mut inner_depth = depth.clone();
8823 if inlined {
8824 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8825 inner_offset = next_offset;
8826 } else {
8827 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8828 inner_depth.increment()?;
8829 }
8830 let val_ref = self.deadline.get_or_insert_with(|| {
8831 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
8832 });
8833 fidl::decode!(
8834 i64,
8835 fidl::encoding::DefaultFuchsiaResourceDialect,
8836 val_ref,
8837 decoder,
8838 inner_offset,
8839 inner_depth
8840 )?;
8841 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8842 {
8843 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8844 }
8845 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8846 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8847 }
8848 }
8849
8850 next_offset += envelope_size;
8851
8852 while next_offset < end_offset {
8854 _next_ordinal_to_read += 1;
8855 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8856 next_offset += envelope_size;
8857 }
8858
8859 Ok(())
8860 }
8861 }
8862
8863 impl WakeBitsetRequest {
8864 #[inline(always)]
8865 fn max_ordinal_present(&self) -> u64 {
8866 if let Some(_) = self.mask {
8867 return 4;
8868 }
8869 if let Some(_) = self.count {
8870 return 3;
8871 }
8872 if let Some(_) = self.offset {
8873 return 2;
8874 }
8875 if let Some(_) = self.vmo {
8876 return 1;
8877 }
8878 0
8879 }
8880 }
8881
8882 impl fidl::encoding::ResourceTypeMarker for WakeBitsetRequest {
8883 type Borrowed<'a> = &'a mut Self;
8884 fn take_or_borrow<'a>(
8885 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8886 ) -> Self::Borrowed<'a> {
8887 value
8888 }
8889 }
8890
8891 unsafe impl fidl::encoding::TypeMarker for WakeBitsetRequest {
8892 type Owned = Self;
8893
8894 #[inline(always)]
8895 fn inline_align(_context: fidl::encoding::Context) -> usize {
8896 8
8897 }
8898
8899 #[inline(always)]
8900 fn inline_size(_context: fidl::encoding::Context) -> usize {
8901 16
8902 }
8903 }
8904
8905 unsafe impl
8906 fidl::encoding::Encode<WakeBitsetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8907 for &mut WakeBitsetRequest
8908 {
8909 unsafe fn encode(
8910 self,
8911 encoder: &mut fidl::encoding::Encoder<
8912 '_,
8913 fidl::encoding::DefaultFuchsiaResourceDialect,
8914 >,
8915 offset: usize,
8916 mut depth: fidl::encoding::Depth,
8917 ) -> fidl::Result<()> {
8918 encoder.debug_check_bounds::<WakeBitsetRequest>(offset);
8919 let max_ordinal: u64 = self.max_ordinal_present();
8921 encoder.write_num(max_ordinal, offset);
8922 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8923 if max_ordinal == 0 {
8925 return Ok(());
8926 }
8927 depth.increment()?;
8928 let envelope_size = 8;
8929 let bytes_len = max_ordinal as usize * envelope_size;
8930 #[allow(unused_variables)]
8931 let offset = encoder.out_of_line_offset(bytes_len);
8932 let mut _prev_end_offset: usize = 0;
8933 if 1 > max_ordinal {
8934 return Ok(());
8935 }
8936
8937 let cur_offset: usize = (1 - 1) * envelope_size;
8940
8941 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8943
8944 fidl::encoding::encode_in_envelope_optional::<
8949 fidl::encoding::HandleType<
8950 fidl::Vmo,
8951 { fidl::ObjectType::VMO.into_raw() },
8952 2147483648,
8953 >,
8954 fidl::encoding::DefaultFuchsiaResourceDialect,
8955 >(
8956 self.vmo.as_mut().map(
8957 <fidl::encoding::HandleType<
8958 fidl::Vmo,
8959 { fidl::ObjectType::VMO.into_raw() },
8960 2147483648,
8961 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8962 ),
8963 encoder,
8964 offset + cur_offset,
8965 depth,
8966 )?;
8967
8968 _prev_end_offset = cur_offset + envelope_size;
8969 if 2 > max_ordinal {
8970 return Ok(());
8971 }
8972
8973 let cur_offset: usize = (2 - 1) * envelope_size;
8976
8977 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8979
8980 fidl::encoding::encode_in_envelope_optional::<
8985 u64,
8986 fidl::encoding::DefaultFuchsiaResourceDialect,
8987 >(
8988 self.offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8989 encoder,
8990 offset + cur_offset,
8991 depth,
8992 )?;
8993
8994 _prev_end_offset = cur_offset + envelope_size;
8995 if 3 > max_ordinal {
8996 return Ok(());
8997 }
8998
8999 let cur_offset: usize = (3 - 1) * envelope_size;
9002
9003 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9005
9006 fidl::encoding::encode_in_envelope_optional::<
9011 u32,
9012 fidl::encoding::DefaultFuchsiaResourceDialect,
9013 >(
9014 self.count.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9015 encoder,
9016 offset + cur_offset,
9017 depth,
9018 )?;
9019
9020 _prev_end_offset = cur_offset + envelope_size;
9021 if 4 > max_ordinal {
9022 return Ok(());
9023 }
9024
9025 let cur_offset: usize = (4 - 1) * envelope_size;
9028
9029 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9031
9032 fidl::encoding::encode_in_envelope_optional::<
9037 u32,
9038 fidl::encoding::DefaultFuchsiaResourceDialect,
9039 >(
9040 self.mask.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9041 encoder,
9042 offset + cur_offset,
9043 depth,
9044 )?;
9045
9046 _prev_end_offset = cur_offset + envelope_size;
9047
9048 Ok(())
9049 }
9050 }
9051
9052 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9053 for WakeBitsetRequest
9054 {
9055 #[inline(always)]
9056 fn new_empty() -> Self {
9057 Self::default()
9058 }
9059
9060 unsafe fn decode(
9061 &mut self,
9062 decoder: &mut fidl::encoding::Decoder<
9063 '_,
9064 fidl::encoding::DefaultFuchsiaResourceDialect,
9065 >,
9066 offset: usize,
9067 mut depth: fidl::encoding::Depth,
9068 ) -> fidl::Result<()> {
9069 decoder.debug_check_bounds::<Self>(offset);
9070 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9071 None => return Err(fidl::Error::NotNullable),
9072 Some(len) => len,
9073 };
9074 if len == 0 {
9076 return Ok(());
9077 };
9078 depth.increment()?;
9079 let envelope_size = 8;
9080 let bytes_len = len * envelope_size;
9081 let offset = decoder.out_of_line_offset(bytes_len)?;
9082 let mut _next_ordinal_to_read = 0;
9084 let mut next_offset = offset;
9085 let end_offset = offset + bytes_len;
9086 _next_ordinal_to_read += 1;
9087 if next_offset >= end_offset {
9088 return Ok(());
9089 }
9090
9091 while _next_ordinal_to_read < 1 {
9093 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9094 _next_ordinal_to_read += 1;
9095 next_offset += envelope_size;
9096 }
9097
9098 let next_out_of_line = decoder.next_out_of_line();
9099 let handles_before = decoder.remaining_handles();
9100 if let Some((inlined, num_bytes, num_handles)) =
9101 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9102 {
9103 let member_inline_size = <fidl::encoding::HandleType<
9104 fidl::Vmo,
9105 { fidl::ObjectType::VMO.into_raw() },
9106 2147483648,
9107 > as fidl::encoding::TypeMarker>::inline_size(
9108 decoder.context
9109 );
9110 if inlined != (member_inline_size <= 4) {
9111 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9112 }
9113 let inner_offset;
9114 let mut inner_depth = depth.clone();
9115 if inlined {
9116 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9117 inner_offset = next_offset;
9118 } else {
9119 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9120 inner_depth.increment()?;
9121 }
9122 let val_ref =
9123 self.vmo.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
9124 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9125 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9126 {
9127 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9128 }
9129 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9130 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9131 }
9132 }
9133
9134 next_offset += envelope_size;
9135 _next_ordinal_to_read += 1;
9136 if next_offset >= end_offset {
9137 return Ok(());
9138 }
9139
9140 while _next_ordinal_to_read < 2 {
9142 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9143 _next_ordinal_to_read += 1;
9144 next_offset += envelope_size;
9145 }
9146
9147 let next_out_of_line = decoder.next_out_of_line();
9148 let handles_before = decoder.remaining_handles();
9149 if let Some((inlined, num_bytes, num_handles)) =
9150 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9151 {
9152 let member_inline_size =
9153 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9154 if inlined != (member_inline_size <= 4) {
9155 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9156 }
9157 let inner_offset;
9158 let mut inner_depth = depth.clone();
9159 if inlined {
9160 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9161 inner_offset = next_offset;
9162 } else {
9163 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9164 inner_depth.increment()?;
9165 }
9166 let val_ref = self.offset.get_or_insert_with(|| {
9167 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
9168 });
9169 fidl::decode!(
9170 u64,
9171 fidl::encoding::DefaultFuchsiaResourceDialect,
9172 val_ref,
9173 decoder,
9174 inner_offset,
9175 inner_depth
9176 )?;
9177 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9178 {
9179 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9180 }
9181 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9182 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9183 }
9184 }
9185
9186 next_offset += envelope_size;
9187 _next_ordinal_to_read += 1;
9188 if next_offset >= end_offset {
9189 return Ok(());
9190 }
9191
9192 while _next_ordinal_to_read < 3 {
9194 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9195 _next_ordinal_to_read += 1;
9196 next_offset += envelope_size;
9197 }
9198
9199 let next_out_of_line = decoder.next_out_of_line();
9200 let handles_before = decoder.remaining_handles();
9201 if let Some((inlined, num_bytes, num_handles)) =
9202 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9203 {
9204 let member_inline_size =
9205 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9206 if inlined != (member_inline_size <= 4) {
9207 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9208 }
9209 let inner_offset;
9210 let mut inner_depth = depth.clone();
9211 if inlined {
9212 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9213 inner_offset = next_offset;
9214 } else {
9215 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9216 inner_depth.increment()?;
9217 }
9218 let val_ref = self.count.get_or_insert_with(|| {
9219 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
9220 });
9221 fidl::decode!(
9222 u32,
9223 fidl::encoding::DefaultFuchsiaResourceDialect,
9224 val_ref,
9225 decoder,
9226 inner_offset,
9227 inner_depth
9228 )?;
9229 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9230 {
9231 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9232 }
9233 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9234 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9235 }
9236 }
9237
9238 next_offset += envelope_size;
9239 _next_ordinal_to_read += 1;
9240 if next_offset >= end_offset {
9241 return Ok(());
9242 }
9243
9244 while _next_ordinal_to_read < 4 {
9246 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9247 _next_ordinal_to_read += 1;
9248 next_offset += envelope_size;
9249 }
9250
9251 let next_out_of_line = decoder.next_out_of_line();
9252 let handles_before = decoder.remaining_handles();
9253 if let Some((inlined, num_bytes, num_handles)) =
9254 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9255 {
9256 let member_inline_size =
9257 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9258 if inlined != (member_inline_size <= 4) {
9259 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9260 }
9261 let inner_offset;
9262 let mut inner_depth = depth.clone();
9263 if inlined {
9264 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9265 inner_offset = next_offset;
9266 } else {
9267 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9268 inner_depth.increment()?;
9269 }
9270 let val_ref = self.mask.get_or_insert_with(|| {
9271 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
9272 });
9273 fidl::decode!(
9274 u32,
9275 fidl::encoding::DefaultFuchsiaResourceDialect,
9276 val_ref,
9277 decoder,
9278 inner_offset,
9279 inner_depth
9280 )?;
9281 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9282 {
9283 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9284 }
9285 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9286 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9287 }
9288 }
9289
9290 next_offset += envelope_size;
9291
9292 while next_offset < end_offset {
9294 _next_ordinal_to_read += 1;
9295 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9296 next_offset += envelope_size;
9297 }
9298
9299 Ok(())
9300 }
9301 }
9302
9303 impl WakeResponse {
9304 #[inline(always)]
9305 fn max_ordinal_present(&self) -> u64 {
9306 if let Some(_) = self.count {
9307 return 1;
9308 }
9309 0
9310 }
9311 }
9312
9313 impl fidl::encoding::ResourceTypeMarker for WakeResponse {
9314 type Borrowed<'a> = &'a mut Self;
9315 fn take_or_borrow<'a>(
9316 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9317 ) -> Self::Borrowed<'a> {
9318 value
9319 }
9320 }
9321
9322 unsafe impl fidl::encoding::TypeMarker for WakeResponse {
9323 type Owned = Self;
9324
9325 #[inline(always)]
9326 fn inline_align(_context: fidl::encoding::Context) -> usize {
9327 8
9328 }
9329
9330 #[inline(always)]
9331 fn inline_size(_context: fidl::encoding::Context) -> usize {
9332 16
9333 }
9334 }
9335
9336 unsafe impl fidl::encoding::Encode<WakeResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
9337 for &mut WakeResponse
9338 {
9339 unsafe fn encode(
9340 self,
9341 encoder: &mut fidl::encoding::Encoder<
9342 '_,
9343 fidl::encoding::DefaultFuchsiaResourceDialect,
9344 >,
9345 offset: usize,
9346 mut depth: fidl::encoding::Depth,
9347 ) -> fidl::Result<()> {
9348 encoder.debug_check_bounds::<WakeResponse>(offset);
9349 let max_ordinal: u64 = self.max_ordinal_present();
9351 encoder.write_num(max_ordinal, offset);
9352 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9353 if max_ordinal == 0 {
9355 return Ok(());
9356 }
9357 depth.increment()?;
9358 let envelope_size = 8;
9359 let bytes_len = max_ordinal as usize * envelope_size;
9360 #[allow(unused_variables)]
9361 let offset = encoder.out_of_line_offset(bytes_len);
9362 let mut _prev_end_offset: usize = 0;
9363 if 1 > max_ordinal {
9364 return Ok(());
9365 }
9366
9367 let cur_offset: usize = (1 - 1) * envelope_size;
9370
9371 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9373
9374 fidl::encoding::encode_in_envelope_optional::<
9379 u64,
9380 fidl::encoding::DefaultFuchsiaResourceDialect,
9381 >(
9382 self.count.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9383 encoder,
9384 offset + cur_offset,
9385 depth,
9386 )?;
9387
9388 _prev_end_offset = cur_offset + envelope_size;
9389
9390 Ok(())
9391 }
9392 }
9393
9394 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for WakeResponse {
9395 #[inline(always)]
9396 fn new_empty() -> Self {
9397 Self::default()
9398 }
9399
9400 unsafe fn decode(
9401 &mut self,
9402 decoder: &mut fidl::encoding::Decoder<
9403 '_,
9404 fidl::encoding::DefaultFuchsiaResourceDialect,
9405 >,
9406 offset: usize,
9407 mut depth: fidl::encoding::Depth,
9408 ) -> fidl::Result<()> {
9409 decoder.debug_check_bounds::<Self>(offset);
9410 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9411 None => return Err(fidl::Error::NotNullable),
9412 Some(len) => len,
9413 };
9414 if len == 0 {
9416 return Ok(());
9417 };
9418 depth.increment()?;
9419 let envelope_size = 8;
9420 let bytes_len = len * envelope_size;
9421 let offset = decoder.out_of_line_offset(bytes_len)?;
9422 let mut _next_ordinal_to_read = 0;
9424 let mut next_offset = offset;
9425 let end_offset = offset + bytes_len;
9426 _next_ordinal_to_read += 1;
9427 if next_offset >= end_offset {
9428 return Ok(());
9429 }
9430
9431 while _next_ordinal_to_read < 1 {
9433 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9434 _next_ordinal_to_read += 1;
9435 next_offset += envelope_size;
9436 }
9437
9438 let next_out_of_line = decoder.next_out_of_line();
9439 let handles_before = decoder.remaining_handles();
9440 if let Some((inlined, num_bytes, num_handles)) =
9441 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9442 {
9443 let member_inline_size =
9444 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9445 if inlined != (member_inline_size <= 4) {
9446 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9447 }
9448 let inner_offset;
9449 let mut inner_depth = depth.clone();
9450 if inlined {
9451 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9452 inner_offset = next_offset;
9453 } else {
9454 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9455 inner_depth.increment()?;
9456 }
9457 let val_ref = self.count.get_or_insert_with(|| {
9458 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
9459 });
9460 fidl::decode!(
9461 u64,
9462 fidl::encoding::DefaultFuchsiaResourceDialect,
9463 val_ref,
9464 decoder,
9465 inner_offset,
9466 inner_depth
9467 )?;
9468 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9469 {
9470 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9471 }
9472 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9473 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9474 }
9475 }
9476
9477 next_offset += envelope_size;
9478
9479 while next_offset < end_offset {
9481 _next_ordinal_to_read += 1;
9482 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9483 next_offset += envelope_size;
9484 }
9485
9486 Ok(())
9487 }
9488 }
9489}