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_hardware_adb_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DeviceStartAdbRequest {
16 pub interface: fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DeviceStartAdbRequest {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct ProviderConnectToServiceRequest {
23 pub socket: fidl::Socket,
24 pub args: Option<String>,
25}
26
27impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
28 for ProviderConnectToServiceRequest
29{
30}
31
32#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
33pub struct DeviceMarker;
34
35impl fidl::endpoints::ProtocolMarker for DeviceMarker {
36 type Proxy = DeviceProxy;
37 type RequestStream = DeviceRequestStream;
38 #[cfg(target_os = "fuchsia")]
39 type SynchronousProxy = DeviceSynchronousProxy;
40
41 const DEBUG_NAME: &'static str = "fuchsia.hardware.adb.Device";
42}
43impl fidl::endpoints::DiscoverableProtocolMarker for DeviceMarker {}
44pub type DeviceStartAdbResult = Result<(), i32>;
45pub type DeviceStopAdbResult = Result<(), i32>;
46
47pub trait DeviceProxyInterface: Send + Sync {
48 type StartAdbResponseFut: std::future::Future<Output = Result<DeviceStartAdbResult, fidl::Error>>
49 + Send;
50 fn r#start_adb(
51 &self,
52 interface: fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>,
53 ) -> Self::StartAdbResponseFut;
54 type StopAdbResponseFut: std::future::Future<Output = Result<DeviceStopAdbResult, fidl::Error>>
55 + Send;
56 fn r#stop_adb(&self) -> Self::StopAdbResponseFut;
57}
58#[derive(Debug)]
59#[cfg(target_os = "fuchsia")]
60pub struct DeviceSynchronousProxy {
61 client: fidl::client::sync::Client,
62}
63
64#[cfg(target_os = "fuchsia")]
65impl fidl::endpoints::SynchronousProxy for DeviceSynchronousProxy {
66 type Proxy = DeviceProxy;
67 type Protocol = DeviceMarker;
68
69 fn from_channel(inner: fidl::Channel) -> Self {
70 Self::new(inner)
71 }
72
73 fn into_channel(self) -> fidl::Channel {
74 self.client.into_channel()
75 }
76
77 fn as_channel(&self) -> &fidl::Channel {
78 self.client.as_channel()
79 }
80}
81
82#[cfg(target_os = "fuchsia")]
83impl DeviceSynchronousProxy {
84 pub fn new(channel: fidl::Channel) -> Self {
85 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
86 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
87 }
88
89 pub fn into_channel(self) -> fidl::Channel {
90 self.client.into_channel()
91 }
92
93 pub fn wait_for_event(
96 &self,
97 deadline: zx::MonotonicInstant,
98 ) -> Result<DeviceEvent, fidl::Error> {
99 DeviceEvent::decode(self.client.wait_for_event(deadline)?)
100 }
101
102 pub fn r#start_adb(
104 &self,
105 mut interface: fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>,
106 ___deadline: zx::MonotonicInstant,
107 ) -> Result<DeviceStartAdbResult, fidl::Error> {
108 let _response = self.client.send_query::<
109 DeviceStartAdbRequest,
110 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
111 >(
112 (interface,),
113 0x286c2e31de2159a5,
114 fidl::encoding::DynamicFlags::empty(),
115 ___deadline,
116 )?;
117 Ok(_response.map(|x| x))
118 }
119
120 pub fn r#stop_adb(
122 &self,
123 ___deadline: zx::MonotonicInstant,
124 ) -> Result<DeviceStopAdbResult, fidl::Error> {
125 let _response = self.client.send_query::<
126 fidl::encoding::EmptyPayload,
127 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
128 >(
129 (),
130 0x6d7d1816750fd3d0,
131 fidl::encoding::DynamicFlags::empty(),
132 ___deadline,
133 )?;
134 Ok(_response.map(|x| x))
135 }
136}
137
138#[cfg(target_os = "fuchsia")]
139impl From<DeviceSynchronousProxy> for zx::Handle {
140 fn from(value: DeviceSynchronousProxy) -> Self {
141 value.into_channel().into()
142 }
143}
144
145#[cfg(target_os = "fuchsia")]
146impl From<fidl::Channel> for DeviceSynchronousProxy {
147 fn from(value: fidl::Channel) -> Self {
148 Self::new(value)
149 }
150}
151
152#[derive(Debug, Clone)]
153pub struct DeviceProxy {
154 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
155}
156
157impl fidl::endpoints::Proxy for DeviceProxy {
158 type Protocol = DeviceMarker;
159
160 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
161 Self::new(inner)
162 }
163
164 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
165 self.client.into_channel().map_err(|client| Self { client })
166 }
167
168 fn as_channel(&self) -> &::fidl::AsyncChannel {
169 self.client.as_channel()
170 }
171}
172
173impl DeviceProxy {
174 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
176 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
177 Self { client: fidl::client::Client::new(channel, protocol_name) }
178 }
179
180 pub fn take_event_stream(&self) -> DeviceEventStream {
186 DeviceEventStream { event_receiver: self.client.take_event_receiver() }
187 }
188
189 pub fn r#start_adb(
191 &self,
192 mut interface: fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>,
193 ) -> fidl::client::QueryResponseFut<
194 DeviceStartAdbResult,
195 fidl::encoding::DefaultFuchsiaResourceDialect,
196 > {
197 DeviceProxyInterface::r#start_adb(self, interface)
198 }
199
200 pub fn r#stop_adb(
202 &self,
203 ) -> fidl::client::QueryResponseFut<
204 DeviceStopAdbResult,
205 fidl::encoding::DefaultFuchsiaResourceDialect,
206 > {
207 DeviceProxyInterface::r#stop_adb(self)
208 }
209}
210
211impl DeviceProxyInterface for DeviceProxy {
212 type StartAdbResponseFut = fidl::client::QueryResponseFut<
213 DeviceStartAdbResult,
214 fidl::encoding::DefaultFuchsiaResourceDialect,
215 >;
216 fn r#start_adb(
217 &self,
218 mut interface: fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>,
219 ) -> Self::StartAdbResponseFut {
220 fn _decode(
221 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
222 ) -> Result<DeviceStartAdbResult, fidl::Error> {
223 let _response = fidl::client::decode_transaction_body::<
224 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
225 fidl::encoding::DefaultFuchsiaResourceDialect,
226 0x286c2e31de2159a5,
227 >(_buf?)?;
228 Ok(_response.map(|x| x))
229 }
230 self.client.send_query_and_decode::<DeviceStartAdbRequest, DeviceStartAdbResult>(
231 (interface,),
232 0x286c2e31de2159a5,
233 fidl::encoding::DynamicFlags::empty(),
234 _decode,
235 )
236 }
237
238 type StopAdbResponseFut = fidl::client::QueryResponseFut<
239 DeviceStopAdbResult,
240 fidl::encoding::DefaultFuchsiaResourceDialect,
241 >;
242 fn r#stop_adb(&self) -> Self::StopAdbResponseFut {
243 fn _decode(
244 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
245 ) -> Result<DeviceStopAdbResult, fidl::Error> {
246 let _response = fidl::client::decode_transaction_body::<
247 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
248 fidl::encoding::DefaultFuchsiaResourceDialect,
249 0x6d7d1816750fd3d0,
250 >(_buf?)?;
251 Ok(_response.map(|x| x))
252 }
253 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DeviceStopAdbResult>(
254 (),
255 0x6d7d1816750fd3d0,
256 fidl::encoding::DynamicFlags::empty(),
257 _decode,
258 )
259 }
260}
261
262pub struct DeviceEventStream {
263 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
264}
265
266impl std::marker::Unpin for DeviceEventStream {}
267
268impl futures::stream::FusedStream for DeviceEventStream {
269 fn is_terminated(&self) -> bool {
270 self.event_receiver.is_terminated()
271 }
272}
273
274impl futures::Stream for DeviceEventStream {
275 type Item = Result<DeviceEvent, fidl::Error>;
276
277 fn poll_next(
278 mut self: std::pin::Pin<&mut Self>,
279 cx: &mut std::task::Context<'_>,
280 ) -> std::task::Poll<Option<Self::Item>> {
281 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
282 &mut self.event_receiver,
283 cx
284 )?) {
285 Some(buf) => std::task::Poll::Ready(Some(DeviceEvent::decode(buf))),
286 None => std::task::Poll::Ready(None),
287 }
288 }
289}
290
291#[derive(Debug)]
292pub enum DeviceEvent {}
293
294impl DeviceEvent {
295 fn decode(
297 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
298 ) -> Result<DeviceEvent, fidl::Error> {
299 let (bytes, _handles) = buf.split_mut();
300 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
301 debug_assert_eq!(tx_header.tx_id, 0);
302 match tx_header.ordinal {
303 _ => Err(fidl::Error::UnknownOrdinal {
304 ordinal: tx_header.ordinal,
305 protocol_name: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
306 }),
307 }
308 }
309}
310
311pub struct DeviceRequestStream {
313 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
314 is_terminated: bool,
315}
316
317impl std::marker::Unpin for DeviceRequestStream {}
318
319impl futures::stream::FusedStream for DeviceRequestStream {
320 fn is_terminated(&self) -> bool {
321 self.is_terminated
322 }
323}
324
325impl fidl::endpoints::RequestStream for DeviceRequestStream {
326 type Protocol = DeviceMarker;
327 type ControlHandle = DeviceControlHandle;
328
329 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
330 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
331 }
332
333 fn control_handle(&self) -> Self::ControlHandle {
334 DeviceControlHandle { inner: self.inner.clone() }
335 }
336
337 fn into_inner(
338 self,
339 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
340 {
341 (self.inner, self.is_terminated)
342 }
343
344 fn from_inner(
345 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
346 is_terminated: bool,
347 ) -> Self {
348 Self { inner, is_terminated }
349 }
350}
351
352impl futures::Stream for DeviceRequestStream {
353 type Item = Result<DeviceRequest, fidl::Error>;
354
355 fn poll_next(
356 mut self: std::pin::Pin<&mut Self>,
357 cx: &mut std::task::Context<'_>,
358 ) -> std::task::Poll<Option<Self::Item>> {
359 let this = &mut *self;
360 if this.inner.check_shutdown(cx) {
361 this.is_terminated = true;
362 return std::task::Poll::Ready(None);
363 }
364 if this.is_terminated {
365 panic!("polled DeviceRequestStream after completion");
366 }
367 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
368 |bytes, handles| {
369 match this.inner.channel().read_etc(cx, bytes, handles) {
370 std::task::Poll::Ready(Ok(())) => {}
371 std::task::Poll::Pending => return std::task::Poll::Pending,
372 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
373 this.is_terminated = true;
374 return std::task::Poll::Ready(None);
375 }
376 std::task::Poll::Ready(Err(e)) => {
377 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
378 e.into(),
379 ))))
380 }
381 }
382
383 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
385
386 std::task::Poll::Ready(Some(match header.ordinal {
387 0x286c2e31de2159a5 => {
388 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
389 let mut req = fidl::new_empty!(
390 DeviceStartAdbRequest,
391 fidl::encoding::DefaultFuchsiaResourceDialect
392 );
393 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceStartAdbRequest>(&header, _body_bytes, handles, &mut req)?;
394 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
395 Ok(DeviceRequest::StartAdb {
396 interface: req.interface,
397
398 responder: DeviceStartAdbResponder {
399 control_handle: std::mem::ManuallyDrop::new(control_handle),
400 tx_id: header.tx_id,
401 },
402 })
403 }
404 0x6d7d1816750fd3d0 => {
405 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
406 let mut req = fidl::new_empty!(
407 fidl::encoding::EmptyPayload,
408 fidl::encoding::DefaultFuchsiaResourceDialect
409 );
410 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
411 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
412 Ok(DeviceRequest::StopAdb {
413 responder: DeviceStopAdbResponder {
414 control_handle: std::mem::ManuallyDrop::new(control_handle),
415 tx_id: header.tx_id,
416 },
417 })
418 }
419 _ => Err(fidl::Error::UnknownOrdinal {
420 ordinal: header.ordinal,
421 protocol_name:
422 <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
423 }),
424 }))
425 },
426 )
427 }
428}
429
430#[derive(Debug)]
432pub enum DeviceRequest {
433 StartAdb {
435 interface: fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>,
436 responder: DeviceStartAdbResponder,
437 },
438 StopAdb { responder: DeviceStopAdbResponder },
440}
441
442impl DeviceRequest {
443 #[allow(irrefutable_let_patterns)]
444 pub fn into_start_adb(
445 self,
446 ) -> Option<(fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>, DeviceStartAdbResponder)> {
447 if let DeviceRequest::StartAdb { interface, responder } = self {
448 Some((interface, responder))
449 } else {
450 None
451 }
452 }
453
454 #[allow(irrefutable_let_patterns)]
455 pub fn into_stop_adb(self) -> Option<(DeviceStopAdbResponder)> {
456 if let DeviceRequest::StopAdb { responder } = self {
457 Some((responder))
458 } else {
459 None
460 }
461 }
462
463 pub fn method_name(&self) -> &'static str {
465 match *self {
466 DeviceRequest::StartAdb { .. } => "start_adb",
467 DeviceRequest::StopAdb { .. } => "stop_adb",
468 }
469 }
470}
471
472#[derive(Debug, Clone)]
473pub struct DeviceControlHandle {
474 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
475}
476
477impl fidl::endpoints::ControlHandle for DeviceControlHandle {
478 fn shutdown(&self) {
479 self.inner.shutdown()
480 }
481 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
482 self.inner.shutdown_with_epitaph(status)
483 }
484
485 fn is_closed(&self) -> bool {
486 self.inner.channel().is_closed()
487 }
488 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
489 self.inner.channel().on_closed()
490 }
491
492 #[cfg(target_os = "fuchsia")]
493 fn signal_peer(
494 &self,
495 clear_mask: zx::Signals,
496 set_mask: zx::Signals,
497 ) -> Result<(), zx_status::Status> {
498 use fidl::Peered;
499 self.inner.channel().signal_peer(clear_mask, set_mask)
500 }
501}
502
503impl DeviceControlHandle {}
504
505#[must_use = "FIDL methods require a response to be sent"]
506#[derive(Debug)]
507pub struct DeviceStartAdbResponder {
508 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
509 tx_id: u32,
510}
511
512impl std::ops::Drop for DeviceStartAdbResponder {
516 fn drop(&mut self) {
517 self.control_handle.shutdown();
518 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
520 }
521}
522
523impl fidl::endpoints::Responder for DeviceStartAdbResponder {
524 type ControlHandle = DeviceControlHandle;
525
526 fn control_handle(&self) -> &DeviceControlHandle {
527 &self.control_handle
528 }
529
530 fn drop_without_shutdown(mut self) {
531 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
533 std::mem::forget(self);
535 }
536}
537
538impl DeviceStartAdbResponder {
539 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
543 let _result = self.send_raw(result);
544 if _result.is_err() {
545 self.control_handle.shutdown();
546 }
547 self.drop_without_shutdown();
548 _result
549 }
550
551 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
553 let _result = self.send_raw(result);
554 self.drop_without_shutdown();
555 _result
556 }
557
558 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
559 self.control_handle
560 .inner
561 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
562 result,
563 self.tx_id,
564 0x286c2e31de2159a5,
565 fidl::encoding::DynamicFlags::empty(),
566 )
567 }
568}
569
570#[must_use = "FIDL methods require a response to be sent"]
571#[derive(Debug)]
572pub struct DeviceStopAdbResponder {
573 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
574 tx_id: u32,
575}
576
577impl std::ops::Drop for DeviceStopAdbResponder {
581 fn drop(&mut self) {
582 self.control_handle.shutdown();
583 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
585 }
586}
587
588impl fidl::endpoints::Responder for DeviceStopAdbResponder {
589 type ControlHandle = DeviceControlHandle;
590
591 fn control_handle(&self) -> &DeviceControlHandle {
592 &self.control_handle
593 }
594
595 fn drop_without_shutdown(mut self) {
596 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
598 std::mem::forget(self);
600 }
601}
602
603impl DeviceStopAdbResponder {
604 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
608 let _result = self.send_raw(result);
609 if _result.is_err() {
610 self.control_handle.shutdown();
611 }
612 self.drop_without_shutdown();
613 _result
614 }
615
616 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
618 let _result = self.send_raw(result);
619 self.drop_without_shutdown();
620 _result
621 }
622
623 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
624 self.control_handle
625 .inner
626 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
627 result,
628 self.tx_id,
629 0x6d7d1816750fd3d0,
630 fidl::encoding::DynamicFlags::empty(),
631 )
632 }
633}
634
635#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
636pub struct ProviderMarker;
637
638impl fidl::endpoints::ProtocolMarker for ProviderMarker {
639 type Proxy = ProviderProxy;
640 type RequestStream = ProviderRequestStream;
641 #[cfg(target_os = "fuchsia")]
642 type SynchronousProxy = ProviderSynchronousProxy;
643
644 const DEBUG_NAME: &'static str = "fuchsia.hardware.adb.Provider";
645}
646impl fidl::endpoints::DiscoverableProtocolMarker for ProviderMarker {}
647pub type ProviderConnectToServiceResult = Result<(), i32>;
648
649pub trait ProviderProxyInterface: Send + Sync {
650 type ConnectToServiceResponseFut: std::future::Future<Output = Result<ProviderConnectToServiceResult, fidl::Error>>
651 + Send;
652 fn r#connect_to_service(
653 &self,
654 socket: fidl::Socket,
655 args: Option<&str>,
656 ) -> Self::ConnectToServiceResponseFut;
657}
658#[derive(Debug)]
659#[cfg(target_os = "fuchsia")]
660pub struct ProviderSynchronousProxy {
661 client: fidl::client::sync::Client,
662}
663
664#[cfg(target_os = "fuchsia")]
665impl fidl::endpoints::SynchronousProxy for ProviderSynchronousProxy {
666 type Proxy = ProviderProxy;
667 type Protocol = ProviderMarker;
668
669 fn from_channel(inner: fidl::Channel) -> Self {
670 Self::new(inner)
671 }
672
673 fn into_channel(self) -> fidl::Channel {
674 self.client.into_channel()
675 }
676
677 fn as_channel(&self) -> &fidl::Channel {
678 self.client.as_channel()
679 }
680}
681
682#[cfg(target_os = "fuchsia")]
683impl ProviderSynchronousProxy {
684 pub fn new(channel: fidl::Channel) -> Self {
685 let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
686 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
687 }
688
689 pub fn into_channel(self) -> fidl::Channel {
690 self.client.into_channel()
691 }
692
693 pub fn wait_for_event(
696 &self,
697 deadline: zx::MonotonicInstant,
698 ) -> Result<ProviderEvent, fidl::Error> {
699 ProviderEvent::decode(self.client.wait_for_event(deadline)?)
700 }
701
702 pub fn r#connect_to_service(
705 &self,
706 mut socket: fidl::Socket,
707 mut args: Option<&str>,
708 ___deadline: zx::MonotonicInstant,
709 ) -> Result<ProviderConnectToServiceResult, fidl::Error> {
710 let _response = self.client.send_query::<
711 ProviderConnectToServiceRequest,
712 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
713 >(
714 (socket, args,),
715 0x303e4a312d85292b,
716 fidl::encoding::DynamicFlags::empty(),
717 ___deadline,
718 )?;
719 Ok(_response.map(|x| x))
720 }
721}
722
723#[cfg(target_os = "fuchsia")]
724impl From<ProviderSynchronousProxy> for zx::Handle {
725 fn from(value: ProviderSynchronousProxy) -> Self {
726 value.into_channel().into()
727 }
728}
729
730#[cfg(target_os = "fuchsia")]
731impl From<fidl::Channel> for ProviderSynchronousProxy {
732 fn from(value: fidl::Channel) -> Self {
733 Self::new(value)
734 }
735}
736
737#[derive(Debug, Clone)]
738pub struct ProviderProxy {
739 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
740}
741
742impl fidl::endpoints::Proxy for ProviderProxy {
743 type Protocol = ProviderMarker;
744
745 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
746 Self::new(inner)
747 }
748
749 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
750 self.client.into_channel().map_err(|client| Self { client })
751 }
752
753 fn as_channel(&self) -> &::fidl::AsyncChannel {
754 self.client.as_channel()
755 }
756}
757
758impl ProviderProxy {
759 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
761 let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
762 Self { client: fidl::client::Client::new(channel, protocol_name) }
763 }
764
765 pub fn take_event_stream(&self) -> ProviderEventStream {
771 ProviderEventStream { event_receiver: self.client.take_event_receiver() }
772 }
773
774 pub fn r#connect_to_service(
777 &self,
778 mut socket: fidl::Socket,
779 mut args: Option<&str>,
780 ) -> fidl::client::QueryResponseFut<
781 ProviderConnectToServiceResult,
782 fidl::encoding::DefaultFuchsiaResourceDialect,
783 > {
784 ProviderProxyInterface::r#connect_to_service(self, socket, args)
785 }
786}
787
788impl ProviderProxyInterface for ProviderProxy {
789 type ConnectToServiceResponseFut = fidl::client::QueryResponseFut<
790 ProviderConnectToServiceResult,
791 fidl::encoding::DefaultFuchsiaResourceDialect,
792 >;
793 fn r#connect_to_service(
794 &self,
795 mut socket: fidl::Socket,
796 mut args: Option<&str>,
797 ) -> Self::ConnectToServiceResponseFut {
798 fn _decode(
799 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
800 ) -> Result<ProviderConnectToServiceResult, fidl::Error> {
801 let _response = fidl::client::decode_transaction_body::<
802 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
803 fidl::encoding::DefaultFuchsiaResourceDialect,
804 0x303e4a312d85292b,
805 >(_buf?)?;
806 Ok(_response.map(|x| x))
807 }
808 self.client.send_query_and_decode::<
809 ProviderConnectToServiceRequest,
810 ProviderConnectToServiceResult,
811 >(
812 (socket, args,),
813 0x303e4a312d85292b,
814 fidl::encoding::DynamicFlags::empty(),
815 _decode,
816 )
817 }
818}
819
820pub struct ProviderEventStream {
821 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
822}
823
824impl std::marker::Unpin for ProviderEventStream {}
825
826impl futures::stream::FusedStream for ProviderEventStream {
827 fn is_terminated(&self) -> bool {
828 self.event_receiver.is_terminated()
829 }
830}
831
832impl futures::Stream for ProviderEventStream {
833 type Item = Result<ProviderEvent, fidl::Error>;
834
835 fn poll_next(
836 mut self: std::pin::Pin<&mut Self>,
837 cx: &mut std::task::Context<'_>,
838 ) -> std::task::Poll<Option<Self::Item>> {
839 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
840 &mut self.event_receiver,
841 cx
842 )?) {
843 Some(buf) => std::task::Poll::Ready(Some(ProviderEvent::decode(buf))),
844 None => std::task::Poll::Ready(None),
845 }
846 }
847}
848
849#[derive(Debug)]
850pub enum ProviderEvent {}
851
852impl ProviderEvent {
853 fn decode(
855 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
856 ) -> Result<ProviderEvent, fidl::Error> {
857 let (bytes, _handles) = buf.split_mut();
858 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
859 debug_assert_eq!(tx_header.tx_id, 0);
860 match tx_header.ordinal {
861 _ => Err(fidl::Error::UnknownOrdinal {
862 ordinal: tx_header.ordinal,
863 protocol_name: <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
864 }),
865 }
866 }
867}
868
869pub struct ProviderRequestStream {
871 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
872 is_terminated: bool,
873}
874
875impl std::marker::Unpin for ProviderRequestStream {}
876
877impl futures::stream::FusedStream for ProviderRequestStream {
878 fn is_terminated(&self) -> bool {
879 self.is_terminated
880 }
881}
882
883impl fidl::endpoints::RequestStream for ProviderRequestStream {
884 type Protocol = ProviderMarker;
885 type ControlHandle = ProviderControlHandle;
886
887 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
888 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
889 }
890
891 fn control_handle(&self) -> Self::ControlHandle {
892 ProviderControlHandle { inner: self.inner.clone() }
893 }
894
895 fn into_inner(
896 self,
897 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
898 {
899 (self.inner, self.is_terminated)
900 }
901
902 fn from_inner(
903 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
904 is_terminated: bool,
905 ) -> Self {
906 Self { inner, is_terminated }
907 }
908}
909
910impl futures::Stream for ProviderRequestStream {
911 type Item = Result<ProviderRequest, fidl::Error>;
912
913 fn poll_next(
914 mut self: std::pin::Pin<&mut Self>,
915 cx: &mut std::task::Context<'_>,
916 ) -> std::task::Poll<Option<Self::Item>> {
917 let this = &mut *self;
918 if this.inner.check_shutdown(cx) {
919 this.is_terminated = true;
920 return std::task::Poll::Ready(None);
921 }
922 if this.is_terminated {
923 panic!("polled ProviderRequestStream after completion");
924 }
925 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
926 |bytes, handles| {
927 match this.inner.channel().read_etc(cx, bytes, handles) {
928 std::task::Poll::Ready(Ok(())) => {}
929 std::task::Poll::Pending => return std::task::Poll::Pending,
930 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
931 this.is_terminated = true;
932 return std::task::Poll::Ready(None);
933 }
934 std::task::Poll::Ready(Err(e)) => {
935 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
936 e.into(),
937 ))))
938 }
939 }
940
941 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
943
944 std::task::Poll::Ready(Some(match header.ordinal {
945 0x303e4a312d85292b => {
946 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
947 let mut req = fidl::new_empty!(
948 ProviderConnectToServiceRequest,
949 fidl::encoding::DefaultFuchsiaResourceDialect
950 );
951 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderConnectToServiceRequest>(&header, _body_bytes, handles, &mut req)?;
952 let control_handle = ProviderControlHandle { inner: this.inner.clone() };
953 Ok(ProviderRequest::ConnectToService {
954 socket: req.socket,
955 args: req.args,
956
957 responder: ProviderConnectToServiceResponder {
958 control_handle: std::mem::ManuallyDrop::new(control_handle),
959 tx_id: header.tx_id,
960 },
961 })
962 }
963 _ => Err(fidl::Error::UnknownOrdinal {
964 ordinal: header.ordinal,
965 protocol_name:
966 <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
967 }),
968 }))
969 },
970 )
971 }
972}
973
974#[derive(Debug)]
987pub enum ProviderRequest {
988 ConnectToService {
991 socket: fidl::Socket,
992 args: Option<String>,
993 responder: ProviderConnectToServiceResponder,
994 },
995}
996
997impl ProviderRequest {
998 #[allow(irrefutable_let_patterns)]
999 pub fn into_connect_to_service(
1000 self,
1001 ) -> Option<(fidl::Socket, Option<String>, ProviderConnectToServiceResponder)> {
1002 if let ProviderRequest::ConnectToService { socket, args, responder } = self {
1003 Some((socket, args, responder))
1004 } else {
1005 None
1006 }
1007 }
1008
1009 pub fn method_name(&self) -> &'static str {
1011 match *self {
1012 ProviderRequest::ConnectToService { .. } => "connect_to_service",
1013 }
1014 }
1015}
1016
1017#[derive(Debug, Clone)]
1018pub struct ProviderControlHandle {
1019 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1020}
1021
1022impl fidl::endpoints::ControlHandle for ProviderControlHandle {
1023 fn shutdown(&self) {
1024 self.inner.shutdown()
1025 }
1026 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1027 self.inner.shutdown_with_epitaph(status)
1028 }
1029
1030 fn is_closed(&self) -> bool {
1031 self.inner.channel().is_closed()
1032 }
1033 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1034 self.inner.channel().on_closed()
1035 }
1036
1037 #[cfg(target_os = "fuchsia")]
1038 fn signal_peer(
1039 &self,
1040 clear_mask: zx::Signals,
1041 set_mask: zx::Signals,
1042 ) -> Result<(), zx_status::Status> {
1043 use fidl::Peered;
1044 self.inner.channel().signal_peer(clear_mask, set_mask)
1045 }
1046}
1047
1048impl ProviderControlHandle {}
1049
1050#[must_use = "FIDL methods require a response to be sent"]
1051#[derive(Debug)]
1052pub struct ProviderConnectToServiceResponder {
1053 control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
1054 tx_id: u32,
1055}
1056
1057impl std::ops::Drop for ProviderConnectToServiceResponder {
1061 fn drop(&mut self) {
1062 self.control_handle.shutdown();
1063 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1065 }
1066}
1067
1068impl fidl::endpoints::Responder for ProviderConnectToServiceResponder {
1069 type ControlHandle = ProviderControlHandle;
1070
1071 fn control_handle(&self) -> &ProviderControlHandle {
1072 &self.control_handle
1073 }
1074
1075 fn drop_without_shutdown(mut self) {
1076 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1078 std::mem::forget(self);
1080 }
1081}
1082
1083impl ProviderConnectToServiceResponder {
1084 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1088 let _result = self.send_raw(result);
1089 if _result.is_err() {
1090 self.control_handle.shutdown();
1091 }
1092 self.drop_without_shutdown();
1093 _result
1094 }
1095
1096 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1098 let _result = self.send_raw(result);
1099 self.drop_without_shutdown();
1100 _result
1101 }
1102
1103 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1104 self.control_handle
1105 .inner
1106 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1107 result,
1108 self.tx_id,
1109 0x303e4a312d85292b,
1110 fidl::encoding::DynamicFlags::empty(),
1111 )
1112 }
1113}
1114
1115#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1116pub struct UsbAdbImpl_Marker;
1117
1118impl fidl::endpoints::ProtocolMarker for UsbAdbImpl_Marker {
1119 type Proxy = UsbAdbImpl_Proxy;
1120 type RequestStream = UsbAdbImpl_RequestStream;
1121 #[cfg(target_os = "fuchsia")]
1122 type SynchronousProxy = UsbAdbImpl_SynchronousProxy;
1123
1124 const DEBUG_NAME: &'static str = "(anonymous) UsbAdbImpl_";
1125}
1126pub type UsbAdbImplQueueTxResult = Result<(), i32>;
1127pub type UsbAdbImplReceiveResult = Result<Vec<u8>, i32>;
1128
1129pub trait UsbAdbImpl_ProxyInterface: Send + Sync {
1130 type QueueTxResponseFut: std::future::Future<Output = Result<UsbAdbImplQueueTxResult, fidl::Error>>
1131 + Send;
1132 fn r#queue_tx(&self, data: &[u8]) -> Self::QueueTxResponseFut;
1133 type ReceiveResponseFut: std::future::Future<Output = Result<UsbAdbImplReceiveResult, fidl::Error>>
1134 + Send;
1135 fn r#receive(&self) -> Self::ReceiveResponseFut;
1136}
1137#[derive(Debug)]
1138#[cfg(target_os = "fuchsia")]
1139pub struct UsbAdbImpl_SynchronousProxy {
1140 client: fidl::client::sync::Client,
1141}
1142
1143#[cfg(target_os = "fuchsia")]
1144impl fidl::endpoints::SynchronousProxy for UsbAdbImpl_SynchronousProxy {
1145 type Proxy = UsbAdbImpl_Proxy;
1146 type Protocol = UsbAdbImpl_Marker;
1147
1148 fn from_channel(inner: fidl::Channel) -> Self {
1149 Self::new(inner)
1150 }
1151
1152 fn into_channel(self) -> fidl::Channel {
1153 self.client.into_channel()
1154 }
1155
1156 fn as_channel(&self) -> &fidl::Channel {
1157 self.client.as_channel()
1158 }
1159}
1160
1161#[cfg(target_os = "fuchsia")]
1162impl UsbAdbImpl_SynchronousProxy {
1163 pub fn new(channel: fidl::Channel) -> Self {
1164 let protocol_name = <UsbAdbImpl_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1165 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1166 }
1167
1168 pub fn into_channel(self) -> fidl::Channel {
1169 self.client.into_channel()
1170 }
1171
1172 pub fn wait_for_event(
1175 &self,
1176 deadline: zx::MonotonicInstant,
1177 ) -> Result<UsbAdbImpl_Event, fidl::Error> {
1178 UsbAdbImpl_Event::decode(self.client.wait_for_event(deadline)?)
1179 }
1180
1181 pub fn r#queue_tx(
1189 &self,
1190 mut data: &[u8],
1191 ___deadline: zx::MonotonicInstant,
1192 ) -> Result<UsbAdbImplQueueTxResult, fidl::Error> {
1193 let _response = self.client.send_query::<
1194 UsbAdbImplQueueTxRequest,
1195 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1196 >(
1197 (data,),
1198 0x4c0af0efa9701dc9,
1199 fidl::encoding::DynamicFlags::empty(),
1200 ___deadline,
1201 )?;
1202 Ok(_response.map(|x| x))
1203 }
1204
1205 pub fn r#receive(
1215 &self,
1216 ___deadline: zx::MonotonicInstant,
1217 ) -> Result<UsbAdbImplReceiveResult, fidl::Error> {
1218 let _response = self.client.send_query::<
1219 fidl::encoding::EmptyPayload,
1220 fidl::encoding::ResultType<UsbAdbImplReceiveResponse, i32>,
1221 >(
1222 (),
1223 0x68382fff953be5c4,
1224 fidl::encoding::DynamicFlags::empty(),
1225 ___deadline,
1226 )?;
1227 Ok(_response.map(|x| x.data))
1228 }
1229}
1230
1231#[cfg(target_os = "fuchsia")]
1232impl From<UsbAdbImpl_SynchronousProxy> for zx::Handle {
1233 fn from(value: UsbAdbImpl_SynchronousProxy) -> Self {
1234 value.into_channel().into()
1235 }
1236}
1237
1238#[cfg(target_os = "fuchsia")]
1239impl From<fidl::Channel> for UsbAdbImpl_SynchronousProxy {
1240 fn from(value: fidl::Channel) -> Self {
1241 Self::new(value)
1242 }
1243}
1244
1245#[derive(Debug, Clone)]
1246pub struct UsbAdbImpl_Proxy {
1247 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1248}
1249
1250impl fidl::endpoints::Proxy for UsbAdbImpl_Proxy {
1251 type Protocol = UsbAdbImpl_Marker;
1252
1253 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1254 Self::new(inner)
1255 }
1256
1257 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1258 self.client.into_channel().map_err(|client| Self { client })
1259 }
1260
1261 fn as_channel(&self) -> &::fidl::AsyncChannel {
1262 self.client.as_channel()
1263 }
1264}
1265
1266impl UsbAdbImpl_Proxy {
1267 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1269 let protocol_name = <UsbAdbImpl_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1270 Self { client: fidl::client::Client::new(channel, protocol_name) }
1271 }
1272
1273 pub fn take_event_stream(&self) -> UsbAdbImpl_EventStream {
1279 UsbAdbImpl_EventStream { event_receiver: self.client.take_event_receiver() }
1280 }
1281
1282 pub fn r#queue_tx(
1290 &self,
1291 mut data: &[u8],
1292 ) -> fidl::client::QueryResponseFut<
1293 UsbAdbImplQueueTxResult,
1294 fidl::encoding::DefaultFuchsiaResourceDialect,
1295 > {
1296 UsbAdbImpl_ProxyInterface::r#queue_tx(self, data)
1297 }
1298
1299 pub fn r#receive(
1309 &self,
1310 ) -> fidl::client::QueryResponseFut<
1311 UsbAdbImplReceiveResult,
1312 fidl::encoding::DefaultFuchsiaResourceDialect,
1313 > {
1314 UsbAdbImpl_ProxyInterface::r#receive(self)
1315 }
1316}
1317
1318impl UsbAdbImpl_ProxyInterface for UsbAdbImpl_Proxy {
1319 type QueueTxResponseFut = fidl::client::QueryResponseFut<
1320 UsbAdbImplQueueTxResult,
1321 fidl::encoding::DefaultFuchsiaResourceDialect,
1322 >;
1323 fn r#queue_tx(&self, mut data: &[u8]) -> Self::QueueTxResponseFut {
1324 fn _decode(
1325 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1326 ) -> Result<UsbAdbImplQueueTxResult, fidl::Error> {
1327 let _response = fidl::client::decode_transaction_body::<
1328 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1329 fidl::encoding::DefaultFuchsiaResourceDialect,
1330 0x4c0af0efa9701dc9,
1331 >(_buf?)?;
1332 Ok(_response.map(|x| x))
1333 }
1334 self.client.send_query_and_decode::<UsbAdbImplQueueTxRequest, UsbAdbImplQueueTxResult>(
1335 (data,),
1336 0x4c0af0efa9701dc9,
1337 fidl::encoding::DynamicFlags::empty(),
1338 _decode,
1339 )
1340 }
1341
1342 type ReceiveResponseFut = fidl::client::QueryResponseFut<
1343 UsbAdbImplReceiveResult,
1344 fidl::encoding::DefaultFuchsiaResourceDialect,
1345 >;
1346 fn r#receive(&self) -> Self::ReceiveResponseFut {
1347 fn _decode(
1348 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1349 ) -> Result<UsbAdbImplReceiveResult, fidl::Error> {
1350 let _response = fidl::client::decode_transaction_body::<
1351 fidl::encoding::ResultType<UsbAdbImplReceiveResponse, i32>,
1352 fidl::encoding::DefaultFuchsiaResourceDialect,
1353 0x68382fff953be5c4,
1354 >(_buf?)?;
1355 Ok(_response.map(|x| x.data))
1356 }
1357 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, UsbAdbImplReceiveResult>(
1358 (),
1359 0x68382fff953be5c4,
1360 fidl::encoding::DynamicFlags::empty(),
1361 _decode,
1362 )
1363 }
1364}
1365
1366pub struct UsbAdbImpl_EventStream {
1367 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1368}
1369
1370impl std::marker::Unpin for UsbAdbImpl_EventStream {}
1371
1372impl futures::stream::FusedStream for UsbAdbImpl_EventStream {
1373 fn is_terminated(&self) -> bool {
1374 self.event_receiver.is_terminated()
1375 }
1376}
1377
1378impl futures::Stream for UsbAdbImpl_EventStream {
1379 type Item = Result<UsbAdbImpl_Event, fidl::Error>;
1380
1381 fn poll_next(
1382 mut self: std::pin::Pin<&mut Self>,
1383 cx: &mut std::task::Context<'_>,
1384 ) -> std::task::Poll<Option<Self::Item>> {
1385 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1386 &mut self.event_receiver,
1387 cx
1388 )?) {
1389 Some(buf) => std::task::Poll::Ready(Some(UsbAdbImpl_Event::decode(buf))),
1390 None => std::task::Poll::Ready(None),
1391 }
1392 }
1393}
1394
1395#[derive(Debug)]
1396pub enum UsbAdbImpl_Event {
1397 OnStatusChanged { status: StatusFlags },
1398}
1399
1400impl UsbAdbImpl_Event {
1401 #[allow(irrefutable_let_patterns)]
1402 pub fn into_on_status_changed(self) -> Option<StatusFlags> {
1403 if let UsbAdbImpl_Event::OnStatusChanged { status } = self {
1404 Some((status))
1405 } else {
1406 None
1407 }
1408 }
1409
1410 fn decode(
1412 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1413 ) -> Result<UsbAdbImpl_Event, fidl::Error> {
1414 let (bytes, _handles) = buf.split_mut();
1415 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1416 debug_assert_eq!(tx_header.tx_id, 0);
1417 match tx_header.ordinal {
1418 0x2f2926086c0a5b6e => {
1419 let mut out = fidl::new_empty!(
1420 UsbAdbImplOnStatusChangedRequest,
1421 fidl::encoding::DefaultFuchsiaResourceDialect
1422 );
1423 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UsbAdbImplOnStatusChangedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1424 Ok((UsbAdbImpl_Event::OnStatusChanged { status: out.status }))
1425 }
1426 _ => Err(fidl::Error::UnknownOrdinal {
1427 ordinal: tx_header.ordinal,
1428 protocol_name: <UsbAdbImpl_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1429 }),
1430 }
1431 }
1432}
1433
1434pub struct UsbAdbImpl_RequestStream {
1436 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1437 is_terminated: bool,
1438}
1439
1440impl std::marker::Unpin for UsbAdbImpl_RequestStream {}
1441
1442impl futures::stream::FusedStream for UsbAdbImpl_RequestStream {
1443 fn is_terminated(&self) -> bool {
1444 self.is_terminated
1445 }
1446}
1447
1448impl fidl::endpoints::RequestStream for UsbAdbImpl_RequestStream {
1449 type Protocol = UsbAdbImpl_Marker;
1450 type ControlHandle = UsbAdbImpl_ControlHandle;
1451
1452 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1453 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1454 }
1455
1456 fn control_handle(&self) -> Self::ControlHandle {
1457 UsbAdbImpl_ControlHandle { inner: self.inner.clone() }
1458 }
1459
1460 fn into_inner(
1461 self,
1462 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1463 {
1464 (self.inner, self.is_terminated)
1465 }
1466
1467 fn from_inner(
1468 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1469 is_terminated: bool,
1470 ) -> Self {
1471 Self { inner, is_terminated }
1472 }
1473}
1474
1475impl futures::Stream for UsbAdbImpl_RequestStream {
1476 type Item = Result<UsbAdbImpl_Request, fidl::Error>;
1477
1478 fn poll_next(
1479 mut self: std::pin::Pin<&mut Self>,
1480 cx: &mut std::task::Context<'_>,
1481 ) -> std::task::Poll<Option<Self::Item>> {
1482 let this = &mut *self;
1483 if this.inner.check_shutdown(cx) {
1484 this.is_terminated = true;
1485 return std::task::Poll::Ready(None);
1486 }
1487 if this.is_terminated {
1488 panic!("polled UsbAdbImpl_RequestStream after completion");
1489 }
1490 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1491 |bytes, handles| {
1492 match this.inner.channel().read_etc(cx, bytes, handles) {
1493 std::task::Poll::Ready(Ok(())) => {}
1494 std::task::Poll::Pending => return std::task::Poll::Pending,
1495 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1496 this.is_terminated = true;
1497 return std::task::Poll::Ready(None);
1498 }
1499 std::task::Poll::Ready(Err(e)) => {
1500 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1501 e.into(),
1502 ))))
1503 }
1504 }
1505
1506 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1508
1509 std::task::Poll::Ready(Some(match header.ordinal {
1510 0x4c0af0efa9701dc9 => {
1511 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1512 let mut req = fidl::new_empty!(
1513 UsbAdbImplQueueTxRequest,
1514 fidl::encoding::DefaultFuchsiaResourceDialect
1515 );
1516 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UsbAdbImplQueueTxRequest>(&header, _body_bytes, handles, &mut req)?;
1517 let control_handle = UsbAdbImpl_ControlHandle { inner: this.inner.clone() };
1518 Ok(UsbAdbImpl_Request::QueueTx {
1519 data: req.data,
1520
1521 responder: UsbAdbImpl_QueueTxResponder {
1522 control_handle: std::mem::ManuallyDrop::new(control_handle),
1523 tx_id: header.tx_id,
1524 },
1525 })
1526 }
1527 0x68382fff953be5c4 => {
1528 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1529 let mut req = fidl::new_empty!(
1530 fidl::encoding::EmptyPayload,
1531 fidl::encoding::DefaultFuchsiaResourceDialect
1532 );
1533 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1534 let control_handle = UsbAdbImpl_ControlHandle { inner: this.inner.clone() };
1535 Ok(UsbAdbImpl_Request::Receive {
1536 responder: UsbAdbImpl_ReceiveResponder {
1537 control_handle: std::mem::ManuallyDrop::new(control_handle),
1538 tx_id: header.tx_id,
1539 },
1540 })
1541 }
1542 _ => Err(fidl::Error::UnknownOrdinal {
1543 ordinal: header.ordinal,
1544 protocol_name:
1545 <UsbAdbImpl_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1546 }),
1547 }))
1548 },
1549 )
1550 }
1551}
1552
1553#[derive(Debug)]
1556pub enum UsbAdbImpl_Request {
1557 QueueTx { data: Vec<u8>, responder: UsbAdbImpl_QueueTxResponder },
1565 Receive { responder: UsbAdbImpl_ReceiveResponder },
1575}
1576
1577impl UsbAdbImpl_Request {
1578 #[allow(irrefutable_let_patterns)]
1579 pub fn into_queue_tx(self) -> Option<(Vec<u8>, UsbAdbImpl_QueueTxResponder)> {
1580 if let UsbAdbImpl_Request::QueueTx { data, responder } = self {
1581 Some((data, responder))
1582 } else {
1583 None
1584 }
1585 }
1586
1587 #[allow(irrefutable_let_patterns)]
1588 pub fn into_receive(self) -> Option<(UsbAdbImpl_ReceiveResponder)> {
1589 if let UsbAdbImpl_Request::Receive { responder } = self {
1590 Some((responder))
1591 } else {
1592 None
1593 }
1594 }
1595
1596 pub fn method_name(&self) -> &'static str {
1598 match *self {
1599 UsbAdbImpl_Request::QueueTx { .. } => "queue_tx",
1600 UsbAdbImpl_Request::Receive { .. } => "receive",
1601 }
1602 }
1603}
1604
1605#[derive(Debug, Clone)]
1606pub struct UsbAdbImpl_ControlHandle {
1607 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1608}
1609
1610impl fidl::endpoints::ControlHandle for UsbAdbImpl_ControlHandle {
1611 fn shutdown(&self) {
1612 self.inner.shutdown()
1613 }
1614 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1615 self.inner.shutdown_with_epitaph(status)
1616 }
1617
1618 fn is_closed(&self) -> bool {
1619 self.inner.channel().is_closed()
1620 }
1621 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1622 self.inner.channel().on_closed()
1623 }
1624
1625 #[cfg(target_os = "fuchsia")]
1626 fn signal_peer(
1627 &self,
1628 clear_mask: zx::Signals,
1629 set_mask: zx::Signals,
1630 ) -> Result<(), zx_status::Status> {
1631 use fidl::Peered;
1632 self.inner.channel().signal_peer(clear_mask, set_mask)
1633 }
1634}
1635
1636impl UsbAdbImpl_ControlHandle {
1637 pub fn send_on_status_changed(&self, mut status: StatusFlags) -> Result<(), fidl::Error> {
1638 self.inner.send::<UsbAdbImplOnStatusChangedRequest>(
1639 (status,),
1640 0,
1641 0x2f2926086c0a5b6e,
1642 fidl::encoding::DynamicFlags::empty(),
1643 )
1644 }
1645}
1646
1647#[must_use = "FIDL methods require a response to be sent"]
1648#[derive(Debug)]
1649pub struct UsbAdbImpl_QueueTxResponder {
1650 control_handle: std::mem::ManuallyDrop<UsbAdbImpl_ControlHandle>,
1651 tx_id: u32,
1652}
1653
1654impl std::ops::Drop for UsbAdbImpl_QueueTxResponder {
1658 fn drop(&mut self) {
1659 self.control_handle.shutdown();
1660 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1662 }
1663}
1664
1665impl fidl::endpoints::Responder for UsbAdbImpl_QueueTxResponder {
1666 type ControlHandle = UsbAdbImpl_ControlHandle;
1667
1668 fn control_handle(&self) -> &UsbAdbImpl_ControlHandle {
1669 &self.control_handle
1670 }
1671
1672 fn drop_without_shutdown(mut self) {
1673 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1675 std::mem::forget(self);
1677 }
1678}
1679
1680impl UsbAdbImpl_QueueTxResponder {
1681 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1685 let _result = self.send_raw(result);
1686 if _result.is_err() {
1687 self.control_handle.shutdown();
1688 }
1689 self.drop_without_shutdown();
1690 _result
1691 }
1692
1693 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1695 let _result = self.send_raw(result);
1696 self.drop_without_shutdown();
1697 _result
1698 }
1699
1700 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1701 self.control_handle
1702 .inner
1703 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1704 result,
1705 self.tx_id,
1706 0x4c0af0efa9701dc9,
1707 fidl::encoding::DynamicFlags::empty(),
1708 )
1709 }
1710}
1711
1712#[must_use = "FIDL methods require a response to be sent"]
1713#[derive(Debug)]
1714pub struct UsbAdbImpl_ReceiveResponder {
1715 control_handle: std::mem::ManuallyDrop<UsbAdbImpl_ControlHandle>,
1716 tx_id: u32,
1717}
1718
1719impl std::ops::Drop for UsbAdbImpl_ReceiveResponder {
1723 fn drop(&mut self) {
1724 self.control_handle.shutdown();
1725 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1727 }
1728}
1729
1730impl fidl::endpoints::Responder for UsbAdbImpl_ReceiveResponder {
1731 type ControlHandle = UsbAdbImpl_ControlHandle;
1732
1733 fn control_handle(&self) -> &UsbAdbImpl_ControlHandle {
1734 &self.control_handle
1735 }
1736
1737 fn drop_without_shutdown(mut self) {
1738 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1740 std::mem::forget(self);
1742 }
1743}
1744
1745impl UsbAdbImpl_ReceiveResponder {
1746 pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
1750 let _result = self.send_raw(result);
1751 if _result.is_err() {
1752 self.control_handle.shutdown();
1753 }
1754 self.drop_without_shutdown();
1755 _result
1756 }
1757
1758 pub fn send_no_shutdown_on_err(
1760 self,
1761 mut result: Result<&[u8], i32>,
1762 ) -> Result<(), fidl::Error> {
1763 let _result = self.send_raw(result);
1764 self.drop_without_shutdown();
1765 _result
1766 }
1767
1768 fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
1769 self.control_handle
1770 .inner
1771 .send::<fidl::encoding::ResultType<UsbAdbImplReceiveResponse, i32>>(
1772 result.map(|data| (data,)),
1773 self.tx_id,
1774 0x68382fff953be5c4,
1775 fidl::encoding::DynamicFlags::empty(),
1776 )
1777 }
1778}
1779
1780#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1781pub struct ServiceMarker;
1782
1783#[cfg(target_os = "fuchsia")]
1784impl fidl::endpoints::ServiceMarker for ServiceMarker {
1785 type Proxy = ServiceProxy;
1786 type Request = ServiceRequest;
1787 const SERVICE_NAME: &'static str = "fuchsia.hardware.adb.Service";
1788}
1789
1790#[cfg(target_os = "fuchsia")]
1793pub enum ServiceRequest {
1794 Adb(DeviceRequestStream),
1795}
1796
1797#[cfg(target_os = "fuchsia")]
1798impl fidl::endpoints::ServiceRequest for ServiceRequest {
1799 type Service = ServiceMarker;
1800
1801 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
1802 match name {
1803 "adb" => Self::Adb(
1804 <DeviceRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
1805 ),
1806 _ => panic!("no such member protocol name for service Service"),
1807 }
1808 }
1809
1810 fn member_names() -> &'static [&'static str] {
1811 &["adb"]
1812 }
1813}
1814#[cfg(target_os = "fuchsia")]
1815pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
1816
1817#[cfg(target_os = "fuchsia")]
1818impl fidl::endpoints::ServiceProxy for ServiceProxy {
1819 type Service = ServiceMarker;
1820
1821 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
1822 Self(opener)
1823 }
1824}
1825
1826#[cfg(target_os = "fuchsia")]
1827impl ServiceProxy {
1828 pub fn connect_to_adb(&self) -> Result<DeviceProxy, fidl::Error> {
1829 let (proxy, server_end) = fidl::endpoints::create_proxy::<DeviceMarker>();
1830 self.connect_channel_to_adb(server_end)?;
1831 Ok(proxy)
1832 }
1833
1834 pub fn connect_to_adb_sync(&self) -> Result<DeviceSynchronousProxy, fidl::Error> {
1837 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DeviceMarker>();
1838 self.connect_channel_to_adb(server_end)?;
1839 Ok(proxy)
1840 }
1841
1842 pub fn connect_channel_to_adb(
1845 &self,
1846 server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1847 ) -> Result<(), fidl::Error> {
1848 self.0.open_member("adb", server_end.into_channel())
1849 }
1850
1851 pub fn instance_name(&self) -> &str {
1852 self.0.instance_name()
1853 }
1854}
1855
1856mod internal {
1857 use super::*;
1858
1859 impl fidl::encoding::ResourceTypeMarker for DeviceStartAdbRequest {
1860 type Borrowed<'a> = &'a mut Self;
1861 fn take_or_borrow<'a>(
1862 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1863 ) -> Self::Borrowed<'a> {
1864 value
1865 }
1866 }
1867
1868 unsafe impl fidl::encoding::TypeMarker for DeviceStartAdbRequest {
1869 type Owned = Self;
1870
1871 #[inline(always)]
1872 fn inline_align(_context: fidl::encoding::Context) -> usize {
1873 4
1874 }
1875
1876 #[inline(always)]
1877 fn inline_size(_context: fidl::encoding::Context) -> usize {
1878 4
1879 }
1880 }
1881
1882 unsafe impl
1883 fidl::encoding::Encode<DeviceStartAdbRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
1884 for &mut DeviceStartAdbRequest
1885 {
1886 #[inline]
1887 unsafe fn encode(
1888 self,
1889 encoder: &mut fidl::encoding::Encoder<
1890 '_,
1891 fidl::encoding::DefaultFuchsiaResourceDialect,
1892 >,
1893 offset: usize,
1894 _depth: fidl::encoding::Depth,
1895 ) -> fidl::Result<()> {
1896 encoder.debug_check_bounds::<DeviceStartAdbRequest>(offset);
1897 fidl::encoding::Encode::<DeviceStartAdbRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1899 (
1900 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.interface),
1901 ),
1902 encoder, offset, _depth
1903 )
1904 }
1905 }
1906 unsafe impl<
1907 T0: fidl::encoding::Encode<
1908 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>>,
1909 fidl::encoding::DefaultFuchsiaResourceDialect,
1910 >,
1911 >
1912 fidl::encoding::Encode<DeviceStartAdbRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
1913 for (T0,)
1914 {
1915 #[inline]
1916 unsafe fn encode(
1917 self,
1918 encoder: &mut fidl::encoding::Encoder<
1919 '_,
1920 fidl::encoding::DefaultFuchsiaResourceDialect,
1921 >,
1922 offset: usize,
1923 depth: fidl::encoding::Depth,
1924 ) -> fidl::Result<()> {
1925 encoder.debug_check_bounds::<DeviceStartAdbRequest>(offset);
1926 self.0.encode(encoder, offset + 0, depth)?;
1930 Ok(())
1931 }
1932 }
1933
1934 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1935 for DeviceStartAdbRequest
1936 {
1937 #[inline(always)]
1938 fn new_empty() -> Self {
1939 Self {
1940 interface: fidl::new_empty!(
1941 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>>,
1942 fidl::encoding::DefaultFuchsiaResourceDialect
1943 ),
1944 }
1945 }
1946
1947 #[inline]
1948 unsafe fn decode(
1949 &mut self,
1950 decoder: &mut fidl::encoding::Decoder<
1951 '_,
1952 fidl::encoding::DefaultFuchsiaResourceDialect,
1953 >,
1954 offset: usize,
1955 _depth: fidl::encoding::Depth,
1956 ) -> fidl::Result<()> {
1957 decoder.debug_check_bounds::<Self>(offset);
1958 fidl::decode!(
1960 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<UsbAdbImpl_Marker>>,
1961 fidl::encoding::DefaultFuchsiaResourceDialect,
1962 &mut self.interface,
1963 decoder,
1964 offset + 0,
1965 _depth
1966 )?;
1967 Ok(())
1968 }
1969 }
1970
1971 impl fidl::encoding::ResourceTypeMarker for ProviderConnectToServiceRequest {
1972 type Borrowed<'a> = &'a mut Self;
1973 fn take_or_borrow<'a>(
1974 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1975 ) -> Self::Borrowed<'a> {
1976 value
1977 }
1978 }
1979
1980 unsafe impl fidl::encoding::TypeMarker for ProviderConnectToServiceRequest {
1981 type Owned = Self;
1982
1983 #[inline(always)]
1984 fn inline_align(_context: fidl::encoding::Context) -> usize {
1985 8
1986 }
1987
1988 #[inline(always)]
1989 fn inline_size(_context: fidl::encoding::Context) -> usize {
1990 24
1991 }
1992 }
1993
1994 unsafe impl
1995 fidl::encoding::Encode<
1996 ProviderConnectToServiceRequest,
1997 fidl::encoding::DefaultFuchsiaResourceDialect,
1998 > for &mut ProviderConnectToServiceRequest
1999 {
2000 #[inline]
2001 unsafe fn encode(
2002 self,
2003 encoder: &mut fidl::encoding::Encoder<
2004 '_,
2005 fidl::encoding::DefaultFuchsiaResourceDialect,
2006 >,
2007 offset: usize,
2008 _depth: fidl::encoding::Depth,
2009 ) -> fidl::Result<()> {
2010 encoder.debug_check_bounds::<ProviderConnectToServiceRequest>(offset);
2011 fidl::encoding::Encode::<ProviderConnectToServiceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2013 (
2014 <fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
2015 <fidl::encoding::Optional<fidl::encoding::BoundedString<1024>> as fidl::encoding::ValueTypeMarker>::borrow(&self.args),
2016 ),
2017 encoder, offset, _depth
2018 )
2019 }
2020 }
2021 unsafe impl<
2022 T0: fidl::encoding::Encode<
2023 fidl::encoding::HandleType<
2024 fidl::Socket,
2025 { fidl::ObjectType::SOCKET.into_raw() },
2026 2147483648,
2027 >,
2028 fidl::encoding::DefaultFuchsiaResourceDialect,
2029 >,
2030 T1: fidl::encoding::Encode<
2031 fidl::encoding::Optional<fidl::encoding::BoundedString<1024>>,
2032 fidl::encoding::DefaultFuchsiaResourceDialect,
2033 >,
2034 >
2035 fidl::encoding::Encode<
2036 ProviderConnectToServiceRequest,
2037 fidl::encoding::DefaultFuchsiaResourceDialect,
2038 > for (T0, T1)
2039 {
2040 #[inline]
2041 unsafe fn encode(
2042 self,
2043 encoder: &mut fidl::encoding::Encoder<
2044 '_,
2045 fidl::encoding::DefaultFuchsiaResourceDialect,
2046 >,
2047 offset: usize,
2048 depth: fidl::encoding::Depth,
2049 ) -> fidl::Result<()> {
2050 encoder.debug_check_bounds::<ProviderConnectToServiceRequest>(offset);
2051 unsafe {
2054 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2055 (ptr as *mut u64).write_unaligned(0);
2056 }
2057 self.0.encode(encoder, offset + 0, depth)?;
2059 self.1.encode(encoder, offset + 8, depth)?;
2060 Ok(())
2061 }
2062 }
2063
2064 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2065 for ProviderConnectToServiceRequest
2066 {
2067 #[inline(always)]
2068 fn new_empty() -> Self {
2069 Self {
2070 socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2071 args: fidl::new_empty!(
2072 fidl::encoding::Optional<fidl::encoding::BoundedString<1024>>,
2073 fidl::encoding::DefaultFuchsiaResourceDialect
2074 ),
2075 }
2076 }
2077
2078 #[inline]
2079 unsafe fn decode(
2080 &mut self,
2081 decoder: &mut fidl::encoding::Decoder<
2082 '_,
2083 fidl::encoding::DefaultFuchsiaResourceDialect,
2084 >,
2085 offset: usize,
2086 _depth: fidl::encoding::Depth,
2087 ) -> fidl::Result<()> {
2088 decoder.debug_check_bounds::<Self>(offset);
2089 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2091 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2092 let mask = 0xffffffff00000000u64;
2093 let maskedval = padval & mask;
2094 if maskedval != 0 {
2095 return Err(fidl::Error::NonZeroPadding {
2096 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2097 });
2098 }
2099 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
2100 fidl::decode!(
2101 fidl::encoding::Optional<fidl::encoding::BoundedString<1024>>,
2102 fidl::encoding::DefaultFuchsiaResourceDialect,
2103 &mut self.args,
2104 decoder,
2105 offset + 8,
2106 _depth
2107 )?;
2108 Ok(())
2109 }
2110 }
2111}