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_ui_pointer_augment__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ErrorForLocalHit {
16    pub error_reason: ErrorReason,
18    pub original: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
20}
21
22impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ErrorForLocalHit {}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct LocalHitUpgradeRequest {
26    pub original: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LocalHitUpgradeRequest {}
30
31#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
32pub struct LocalHitUpgradeResponse {
33    pub augmented: Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
34    pub error: Option<Box<ErrorForLocalHit>>,
35}
36
37impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LocalHitUpgradeResponse {}
38
39#[derive(Debug, PartialEq)]
40pub struct TouchEventWithLocalHit {
41    pub touch_event: fidl_fuchsia_ui_pointer::TouchEvent,
43    pub local_viewref_koid: u64,
46    pub local_point: [f32; 2],
49}
50
51impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for TouchEventWithLocalHit {}
52
53#[derive(Debug, PartialEq)]
54pub struct TouchSourceWithLocalHitWatchResponse {
55    pub events: Vec<TouchEventWithLocalHit>,
56}
57
58impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
59    for TouchSourceWithLocalHitWatchResponse
60{
61}
62
63#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
64pub struct LocalHitMarker;
65
66impl fidl::endpoints::ProtocolMarker for LocalHitMarker {
67    type Proxy = LocalHitProxy;
68    type RequestStream = LocalHitRequestStream;
69    #[cfg(target_os = "fuchsia")]
70    type SynchronousProxy = LocalHitSynchronousProxy;
71
72    const DEBUG_NAME: &'static str = "fuchsia.ui.pointer.augment.LocalHit";
73}
74impl fidl::endpoints::DiscoverableProtocolMarker for LocalHitMarker {}
75
76pub trait LocalHitProxyInterface: Send + Sync {
77    type UpgradeResponseFut: std::future::Future<
78            Output = Result<
79                (
80                    Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
81                    Option<Box<ErrorForLocalHit>>,
82                ),
83                fidl::Error,
84            >,
85        > + Send;
86    fn r#upgrade(
87        &self,
88        original: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
89    ) -> Self::UpgradeResponseFut;
90}
91#[derive(Debug)]
92#[cfg(target_os = "fuchsia")]
93pub struct LocalHitSynchronousProxy {
94    client: fidl::client::sync::Client,
95}
96
97#[cfg(target_os = "fuchsia")]
98impl fidl::endpoints::SynchronousProxy for LocalHitSynchronousProxy {
99    type Proxy = LocalHitProxy;
100    type Protocol = LocalHitMarker;
101
102    fn from_channel(inner: fidl::Channel) -> Self {
103        Self::new(inner)
104    }
105
106    fn into_channel(self) -> fidl::Channel {
107        self.client.into_channel()
108    }
109
110    fn as_channel(&self) -> &fidl::Channel {
111        self.client.as_channel()
112    }
113}
114
115#[cfg(target_os = "fuchsia")]
116impl LocalHitSynchronousProxy {
117    pub fn new(channel: fidl::Channel) -> Self {
118        let protocol_name = <LocalHitMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
119        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
120    }
121
122    pub fn into_channel(self) -> fidl::Channel {
123        self.client.into_channel()
124    }
125
126    pub fn wait_for_event(
129        &self,
130        deadline: zx::MonotonicInstant,
131    ) -> Result<LocalHitEvent, fidl::Error> {
132        LocalHitEvent::decode(self.client.wait_for_event(deadline)?)
133    }
134
135    pub fn r#upgrade(
141        &self,
142        mut original: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
143        ___deadline: zx::MonotonicInstant,
144    ) -> Result<
145        (
146            Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
147            Option<Box<ErrorForLocalHit>>,
148        ),
149        fidl::Error,
150    > {
151        let _response = self.client.send_query::<LocalHitUpgradeRequest, LocalHitUpgradeResponse>(
152            (original,),
153            0x1ec0c985bbfe4e8c,
154            fidl::encoding::DynamicFlags::empty(),
155            ___deadline,
156        )?;
157        Ok((_response.augmented, _response.error))
158    }
159}
160
161#[cfg(target_os = "fuchsia")]
162impl From<LocalHitSynchronousProxy> for zx::Handle {
163    fn from(value: LocalHitSynchronousProxy) -> Self {
164        value.into_channel().into()
165    }
166}
167
168#[cfg(target_os = "fuchsia")]
169impl From<fidl::Channel> for LocalHitSynchronousProxy {
170    fn from(value: fidl::Channel) -> Self {
171        Self::new(value)
172    }
173}
174
175#[cfg(target_os = "fuchsia")]
176impl fidl::endpoints::FromClient for LocalHitSynchronousProxy {
177    type Protocol = LocalHitMarker;
178
179    fn from_client(value: fidl::endpoints::ClientEnd<LocalHitMarker>) -> Self {
180        Self::new(value.into_channel())
181    }
182}
183
184#[derive(Debug, Clone)]
185pub struct LocalHitProxy {
186    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
187}
188
189impl fidl::endpoints::Proxy for LocalHitProxy {
190    type Protocol = LocalHitMarker;
191
192    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
193        Self::new(inner)
194    }
195
196    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
197        self.client.into_channel().map_err(|client| Self { client })
198    }
199
200    fn as_channel(&self) -> &::fidl::AsyncChannel {
201        self.client.as_channel()
202    }
203}
204
205impl LocalHitProxy {
206    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
208        let protocol_name = <LocalHitMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
209        Self { client: fidl::client::Client::new(channel, protocol_name) }
210    }
211
212    pub fn take_event_stream(&self) -> LocalHitEventStream {
218        LocalHitEventStream { event_receiver: self.client.take_event_receiver() }
219    }
220
221    pub fn r#upgrade(
227        &self,
228        mut original: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
229    ) -> fidl::client::QueryResponseFut<
230        (
231            Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
232            Option<Box<ErrorForLocalHit>>,
233        ),
234        fidl::encoding::DefaultFuchsiaResourceDialect,
235    > {
236        LocalHitProxyInterface::r#upgrade(self, original)
237    }
238}
239
240impl LocalHitProxyInterface for LocalHitProxy {
241    type UpgradeResponseFut = fidl::client::QueryResponseFut<
242        (
243            Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
244            Option<Box<ErrorForLocalHit>>,
245        ),
246        fidl::encoding::DefaultFuchsiaResourceDialect,
247    >;
248    fn r#upgrade(
249        &self,
250        mut original: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
251    ) -> Self::UpgradeResponseFut {
252        fn _decode(
253            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
254        ) -> Result<
255            (
256                Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
257                Option<Box<ErrorForLocalHit>>,
258            ),
259            fidl::Error,
260        > {
261            let _response = fidl::client::decode_transaction_body::<
262                LocalHitUpgradeResponse,
263                fidl::encoding::DefaultFuchsiaResourceDialect,
264                0x1ec0c985bbfe4e8c,
265            >(_buf?)?;
266            Ok((_response.augmented, _response.error))
267        }
268        self.client.send_query_and_decode::<LocalHitUpgradeRequest, (
269            Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
270            Option<Box<ErrorForLocalHit>>,
271        )>(
272            (original,), 0x1ec0c985bbfe4e8c, fidl::encoding::DynamicFlags::empty(), _decode
273        )
274    }
275}
276
277pub struct LocalHitEventStream {
278    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
279}
280
281impl std::marker::Unpin for LocalHitEventStream {}
282
283impl futures::stream::FusedStream for LocalHitEventStream {
284    fn is_terminated(&self) -> bool {
285        self.event_receiver.is_terminated()
286    }
287}
288
289impl futures::Stream for LocalHitEventStream {
290    type Item = Result<LocalHitEvent, fidl::Error>;
291
292    fn poll_next(
293        mut self: std::pin::Pin<&mut Self>,
294        cx: &mut std::task::Context<'_>,
295    ) -> std::task::Poll<Option<Self::Item>> {
296        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
297            &mut self.event_receiver,
298            cx
299        )?) {
300            Some(buf) => std::task::Poll::Ready(Some(LocalHitEvent::decode(buf))),
301            None => std::task::Poll::Ready(None),
302        }
303    }
304}
305
306#[derive(Debug)]
307pub enum LocalHitEvent {}
308
309impl LocalHitEvent {
310    fn decode(
312        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
313    ) -> Result<LocalHitEvent, fidl::Error> {
314        let (bytes, _handles) = buf.split_mut();
315        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
316        debug_assert_eq!(tx_header.tx_id, 0);
317        match tx_header.ordinal {
318            _ => Err(fidl::Error::UnknownOrdinal {
319                ordinal: tx_header.ordinal,
320                protocol_name: <LocalHitMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
321            }),
322        }
323    }
324}
325
326pub struct LocalHitRequestStream {
328    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
329    is_terminated: bool,
330}
331
332impl std::marker::Unpin for LocalHitRequestStream {}
333
334impl futures::stream::FusedStream for LocalHitRequestStream {
335    fn is_terminated(&self) -> bool {
336        self.is_terminated
337    }
338}
339
340impl fidl::endpoints::RequestStream for LocalHitRequestStream {
341    type Protocol = LocalHitMarker;
342    type ControlHandle = LocalHitControlHandle;
343
344    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
345        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
346    }
347
348    fn control_handle(&self) -> Self::ControlHandle {
349        LocalHitControlHandle { inner: self.inner.clone() }
350    }
351
352    fn into_inner(
353        self,
354    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
355    {
356        (self.inner, self.is_terminated)
357    }
358
359    fn from_inner(
360        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
361        is_terminated: bool,
362    ) -> Self {
363        Self { inner, is_terminated }
364    }
365}
366
367impl futures::Stream for LocalHitRequestStream {
368    type Item = Result<LocalHitRequest, fidl::Error>;
369
370    fn poll_next(
371        mut self: std::pin::Pin<&mut Self>,
372        cx: &mut std::task::Context<'_>,
373    ) -> std::task::Poll<Option<Self::Item>> {
374        let this = &mut *self;
375        if this.inner.check_shutdown(cx) {
376            this.is_terminated = true;
377            return std::task::Poll::Ready(None);
378        }
379        if this.is_terminated {
380            panic!("polled LocalHitRequestStream after completion");
381        }
382        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
383            |bytes, handles| {
384                match this.inner.channel().read_etc(cx, bytes, handles) {
385                    std::task::Poll::Ready(Ok(())) => {}
386                    std::task::Poll::Pending => return std::task::Poll::Pending,
387                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
388                        this.is_terminated = true;
389                        return std::task::Poll::Ready(None);
390                    }
391                    std::task::Poll::Ready(Err(e)) => {
392                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
393                            e.into(),
394                        ))));
395                    }
396                }
397
398                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
400
401                std::task::Poll::Ready(Some(match header.ordinal {
402                    0x1ec0c985bbfe4e8c => {
403                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
404                        let mut req = fidl::new_empty!(
405                            LocalHitUpgradeRequest,
406                            fidl::encoding::DefaultFuchsiaResourceDialect
407                        );
408                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LocalHitUpgradeRequest>(&header, _body_bytes, handles, &mut req)?;
409                        let control_handle = LocalHitControlHandle { inner: this.inner.clone() };
410                        Ok(LocalHitRequest::Upgrade {
411                            original: req.original,
412
413                            responder: LocalHitUpgradeResponder {
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                            <LocalHitMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
423                    }),
424                }))
425            },
426        )
427    }
428}
429
430#[derive(Debug)]
433pub enum LocalHitRequest {
434    Upgrade {
440        original: fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
441        responder: LocalHitUpgradeResponder,
442    },
443}
444
445impl LocalHitRequest {
446    #[allow(irrefutable_let_patterns)]
447    pub fn into_upgrade(
448        self,
449    ) -> Option<(
450        fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
451        LocalHitUpgradeResponder,
452    )> {
453        if let LocalHitRequest::Upgrade { original, responder } = self {
454            Some((original, responder))
455        } else {
456            None
457        }
458    }
459
460    pub fn method_name(&self) -> &'static str {
462        match *self {
463            LocalHitRequest::Upgrade { .. } => "upgrade",
464        }
465    }
466}
467
468#[derive(Debug, Clone)]
469pub struct LocalHitControlHandle {
470    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
471}
472
473impl fidl::endpoints::ControlHandle for LocalHitControlHandle {
474    fn shutdown(&self) {
475        self.inner.shutdown()
476    }
477    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
478        self.inner.shutdown_with_epitaph(status)
479    }
480
481    fn is_closed(&self) -> bool {
482        self.inner.channel().is_closed()
483    }
484    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
485        self.inner.channel().on_closed()
486    }
487
488    #[cfg(target_os = "fuchsia")]
489    fn signal_peer(
490        &self,
491        clear_mask: zx::Signals,
492        set_mask: zx::Signals,
493    ) -> Result<(), zx_status::Status> {
494        use fidl::Peered;
495        self.inner.channel().signal_peer(clear_mask, set_mask)
496    }
497}
498
499impl LocalHitControlHandle {}
500
501#[must_use = "FIDL methods require a response to be sent"]
502#[derive(Debug)]
503pub struct LocalHitUpgradeResponder {
504    control_handle: std::mem::ManuallyDrop<LocalHitControlHandle>,
505    tx_id: u32,
506}
507
508impl std::ops::Drop for LocalHitUpgradeResponder {
512    fn drop(&mut self) {
513        self.control_handle.shutdown();
514        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
516    }
517}
518
519impl fidl::endpoints::Responder for LocalHitUpgradeResponder {
520    type ControlHandle = LocalHitControlHandle;
521
522    fn control_handle(&self) -> &LocalHitControlHandle {
523        &self.control_handle
524    }
525
526    fn drop_without_shutdown(mut self) {
527        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
529        std::mem::forget(self);
531    }
532}
533
534impl LocalHitUpgradeResponder {
535    pub fn send(
539        self,
540        mut augmented: Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
541        mut error: Option<ErrorForLocalHit>,
542    ) -> Result<(), fidl::Error> {
543        let _result = self.send_raw(augmented, error);
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(
553        self,
554        mut augmented: Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
555        mut error: Option<ErrorForLocalHit>,
556    ) -> Result<(), fidl::Error> {
557        let _result = self.send_raw(augmented, error);
558        self.drop_without_shutdown();
559        _result
560    }
561
562    fn send_raw(
563        &self,
564        mut augmented: Option<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>,
565        mut error: Option<ErrorForLocalHit>,
566    ) -> Result<(), fidl::Error> {
567        self.control_handle.inner.send::<LocalHitUpgradeResponse>(
568            (augmented, error.as_mut()),
569            self.tx_id,
570            0x1ec0c985bbfe4e8c,
571            fidl::encoding::DynamicFlags::empty(),
572        )
573    }
574}
575
576#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
577pub struct TouchSourceWithLocalHitMarker;
578
579impl fidl::endpoints::ProtocolMarker for TouchSourceWithLocalHitMarker {
580    type Proxy = TouchSourceWithLocalHitProxy;
581    type RequestStream = TouchSourceWithLocalHitRequestStream;
582    #[cfg(target_os = "fuchsia")]
583    type SynchronousProxy = TouchSourceWithLocalHitSynchronousProxy;
584
585    const DEBUG_NAME: &'static str = "(anonymous) TouchSourceWithLocalHit";
586}
587
588pub trait TouchSourceWithLocalHitProxyInterface: Send + Sync {
589    type WatchResponseFut: std::future::Future<Output = Result<Vec<TouchEventWithLocalHit>, fidl::Error>>
590        + Send;
591    fn r#watch(
592        &self,
593        responses: &[fidl_fuchsia_ui_pointer::TouchResponse],
594    ) -> Self::WatchResponseFut;
595    type UpdateResponseResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
596    fn r#update_response(
597        &self,
598        interaction: &fidl_fuchsia_ui_pointer::TouchInteractionId,
599        response: &fidl_fuchsia_ui_pointer::TouchResponse,
600    ) -> Self::UpdateResponseResponseFut;
601}
602#[derive(Debug)]
603#[cfg(target_os = "fuchsia")]
604pub struct TouchSourceWithLocalHitSynchronousProxy {
605    client: fidl::client::sync::Client,
606}
607
608#[cfg(target_os = "fuchsia")]
609impl fidl::endpoints::SynchronousProxy for TouchSourceWithLocalHitSynchronousProxy {
610    type Proxy = TouchSourceWithLocalHitProxy;
611    type Protocol = TouchSourceWithLocalHitMarker;
612
613    fn from_channel(inner: fidl::Channel) -> Self {
614        Self::new(inner)
615    }
616
617    fn into_channel(self) -> fidl::Channel {
618        self.client.into_channel()
619    }
620
621    fn as_channel(&self) -> &fidl::Channel {
622        self.client.as_channel()
623    }
624}
625
626#[cfg(target_os = "fuchsia")]
627impl TouchSourceWithLocalHitSynchronousProxy {
628    pub fn new(channel: fidl::Channel) -> Self {
629        let protocol_name =
630            <TouchSourceWithLocalHitMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
631        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
632    }
633
634    pub fn into_channel(self) -> fidl::Channel {
635        self.client.into_channel()
636    }
637
638    pub fn wait_for_event(
641        &self,
642        deadline: zx::MonotonicInstant,
643    ) -> Result<TouchSourceWithLocalHitEvent, fidl::Error> {
644        TouchSourceWithLocalHitEvent::decode(self.client.wait_for_event(deadline)?)
645    }
646
647    pub fn r#watch(
650        &self,
651        mut responses: &[fidl_fuchsia_ui_pointer::TouchResponse],
652        ___deadline: zx::MonotonicInstant,
653    ) -> Result<Vec<TouchEventWithLocalHit>, fidl::Error> {
654        let _response = self.client.send_query::<
655            TouchSourceWithLocalHitWatchRequest,
656            TouchSourceWithLocalHitWatchResponse,
657        >(
658            (responses,),
659            0x4eb5acc052ada449,
660            fidl::encoding::DynamicFlags::empty(),
661            ___deadline,
662        )?;
663        Ok(_response.events)
664    }
665
666    pub fn r#update_response(
668        &self,
669        mut interaction: &fidl_fuchsia_ui_pointer::TouchInteractionId,
670        mut response: &fidl_fuchsia_ui_pointer::TouchResponse,
671        ___deadline: zx::MonotonicInstant,
672    ) -> Result<(), fidl::Error> {
673        let _response = self.client.send_query::<
674            TouchSourceWithLocalHitUpdateResponseRequest,
675            fidl::encoding::EmptyPayload,
676        >(
677            (interaction, response,),
678            0x1f2fde6734e7da1,
679            fidl::encoding::DynamicFlags::empty(),
680            ___deadline,
681        )?;
682        Ok(_response)
683    }
684}
685
686#[cfg(target_os = "fuchsia")]
687impl From<TouchSourceWithLocalHitSynchronousProxy> for zx::Handle {
688    fn from(value: TouchSourceWithLocalHitSynchronousProxy) -> Self {
689        value.into_channel().into()
690    }
691}
692
693#[cfg(target_os = "fuchsia")]
694impl From<fidl::Channel> for TouchSourceWithLocalHitSynchronousProxy {
695    fn from(value: fidl::Channel) -> Self {
696        Self::new(value)
697    }
698}
699
700#[cfg(target_os = "fuchsia")]
701impl fidl::endpoints::FromClient for TouchSourceWithLocalHitSynchronousProxy {
702    type Protocol = TouchSourceWithLocalHitMarker;
703
704    fn from_client(value: fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>) -> Self {
705        Self::new(value.into_channel())
706    }
707}
708
709#[derive(Debug, Clone)]
710pub struct TouchSourceWithLocalHitProxy {
711    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
712}
713
714impl fidl::endpoints::Proxy for TouchSourceWithLocalHitProxy {
715    type Protocol = TouchSourceWithLocalHitMarker;
716
717    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
718        Self::new(inner)
719    }
720
721    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
722        self.client.into_channel().map_err(|client| Self { client })
723    }
724
725    fn as_channel(&self) -> &::fidl::AsyncChannel {
726        self.client.as_channel()
727    }
728}
729
730impl TouchSourceWithLocalHitProxy {
731    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
733        let protocol_name =
734            <TouchSourceWithLocalHitMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
735        Self { client: fidl::client::Client::new(channel, protocol_name) }
736    }
737
738    pub fn take_event_stream(&self) -> TouchSourceWithLocalHitEventStream {
744        TouchSourceWithLocalHitEventStream { event_receiver: self.client.take_event_receiver() }
745    }
746
747    pub fn r#watch(
750        &self,
751        mut responses: &[fidl_fuchsia_ui_pointer::TouchResponse],
752    ) -> fidl::client::QueryResponseFut<
753        Vec<TouchEventWithLocalHit>,
754        fidl::encoding::DefaultFuchsiaResourceDialect,
755    > {
756        TouchSourceWithLocalHitProxyInterface::r#watch(self, responses)
757    }
758
759    pub fn r#update_response(
761        &self,
762        mut interaction: &fidl_fuchsia_ui_pointer::TouchInteractionId,
763        mut response: &fidl_fuchsia_ui_pointer::TouchResponse,
764    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
765        TouchSourceWithLocalHitProxyInterface::r#update_response(self, interaction, response)
766    }
767}
768
769impl TouchSourceWithLocalHitProxyInterface for TouchSourceWithLocalHitProxy {
770    type WatchResponseFut = fidl::client::QueryResponseFut<
771        Vec<TouchEventWithLocalHit>,
772        fidl::encoding::DefaultFuchsiaResourceDialect,
773    >;
774    fn r#watch(
775        &self,
776        mut responses: &[fidl_fuchsia_ui_pointer::TouchResponse],
777    ) -> Self::WatchResponseFut {
778        fn _decode(
779            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
780        ) -> Result<Vec<TouchEventWithLocalHit>, fidl::Error> {
781            let _response = fidl::client::decode_transaction_body::<
782                TouchSourceWithLocalHitWatchResponse,
783                fidl::encoding::DefaultFuchsiaResourceDialect,
784                0x4eb5acc052ada449,
785            >(_buf?)?;
786            Ok(_response.events)
787        }
788        self.client.send_query_and_decode::<
789            TouchSourceWithLocalHitWatchRequest,
790            Vec<TouchEventWithLocalHit>,
791        >(
792            (responses,),
793            0x4eb5acc052ada449,
794            fidl::encoding::DynamicFlags::empty(),
795            _decode,
796        )
797    }
798
799    type UpdateResponseResponseFut =
800        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
801    fn r#update_response(
802        &self,
803        mut interaction: &fidl_fuchsia_ui_pointer::TouchInteractionId,
804        mut response: &fidl_fuchsia_ui_pointer::TouchResponse,
805    ) -> Self::UpdateResponseResponseFut {
806        fn _decode(
807            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
808        ) -> Result<(), fidl::Error> {
809            let _response = fidl::client::decode_transaction_body::<
810                fidl::encoding::EmptyPayload,
811                fidl::encoding::DefaultFuchsiaResourceDialect,
812                0x1f2fde6734e7da1,
813            >(_buf?)?;
814            Ok(_response)
815        }
816        self.client.send_query_and_decode::<TouchSourceWithLocalHitUpdateResponseRequest, ()>(
817            (interaction, response),
818            0x1f2fde6734e7da1,
819            fidl::encoding::DynamicFlags::empty(),
820            _decode,
821        )
822    }
823}
824
825pub struct TouchSourceWithLocalHitEventStream {
826    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
827}
828
829impl std::marker::Unpin for TouchSourceWithLocalHitEventStream {}
830
831impl futures::stream::FusedStream for TouchSourceWithLocalHitEventStream {
832    fn is_terminated(&self) -> bool {
833        self.event_receiver.is_terminated()
834    }
835}
836
837impl futures::Stream for TouchSourceWithLocalHitEventStream {
838    type Item = Result<TouchSourceWithLocalHitEvent, fidl::Error>;
839
840    fn poll_next(
841        mut self: std::pin::Pin<&mut Self>,
842        cx: &mut std::task::Context<'_>,
843    ) -> std::task::Poll<Option<Self::Item>> {
844        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
845            &mut self.event_receiver,
846            cx
847        )?) {
848            Some(buf) => std::task::Poll::Ready(Some(TouchSourceWithLocalHitEvent::decode(buf))),
849            None => std::task::Poll::Ready(None),
850        }
851    }
852}
853
854#[derive(Debug)]
855pub enum TouchSourceWithLocalHitEvent {}
856
857impl TouchSourceWithLocalHitEvent {
858    fn decode(
860        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
861    ) -> Result<TouchSourceWithLocalHitEvent, fidl::Error> {
862        let (bytes, _handles) = buf.split_mut();
863        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
864        debug_assert_eq!(tx_header.tx_id, 0);
865        match tx_header.ordinal {
866            _ => Err(fidl::Error::UnknownOrdinal {
867                ordinal: tx_header.ordinal,
868                protocol_name:
869                    <TouchSourceWithLocalHitMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
870            }),
871        }
872    }
873}
874
875pub struct TouchSourceWithLocalHitRequestStream {
877    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
878    is_terminated: bool,
879}
880
881impl std::marker::Unpin for TouchSourceWithLocalHitRequestStream {}
882
883impl futures::stream::FusedStream for TouchSourceWithLocalHitRequestStream {
884    fn is_terminated(&self) -> bool {
885        self.is_terminated
886    }
887}
888
889impl fidl::endpoints::RequestStream for TouchSourceWithLocalHitRequestStream {
890    type Protocol = TouchSourceWithLocalHitMarker;
891    type ControlHandle = TouchSourceWithLocalHitControlHandle;
892
893    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
894        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
895    }
896
897    fn control_handle(&self) -> Self::ControlHandle {
898        TouchSourceWithLocalHitControlHandle { inner: self.inner.clone() }
899    }
900
901    fn into_inner(
902        self,
903    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
904    {
905        (self.inner, self.is_terminated)
906    }
907
908    fn from_inner(
909        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
910        is_terminated: bool,
911    ) -> Self {
912        Self { inner, is_terminated }
913    }
914}
915
916impl futures::Stream for TouchSourceWithLocalHitRequestStream {
917    type Item = Result<TouchSourceWithLocalHitRequest, fidl::Error>;
918
919    fn poll_next(
920        mut self: std::pin::Pin<&mut Self>,
921        cx: &mut std::task::Context<'_>,
922    ) -> std::task::Poll<Option<Self::Item>> {
923        let this = &mut *self;
924        if this.inner.check_shutdown(cx) {
925            this.is_terminated = true;
926            return std::task::Poll::Ready(None);
927        }
928        if this.is_terminated {
929            panic!("polled TouchSourceWithLocalHitRequestStream after completion");
930        }
931        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
932            |bytes, handles| {
933                match this.inner.channel().read_etc(cx, bytes, handles) {
934                    std::task::Poll::Ready(Ok(())) => {}
935                    std::task::Poll::Pending => return std::task::Poll::Pending,
936                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
937                        this.is_terminated = true;
938                        return std::task::Poll::Ready(None);
939                    }
940                    std::task::Poll::Ready(Err(e)) => {
941                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
942                            e.into(),
943                        ))));
944                    }
945                }
946
947                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
949
950                std::task::Poll::Ready(Some(match header.ordinal {
951                0x4eb5acc052ada449 => {
952                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
953                    let mut req = fidl::new_empty!(TouchSourceWithLocalHitWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
954                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TouchSourceWithLocalHitWatchRequest>(&header, _body_bytes, handles, &mut req)?;
955                    let control_handle = TouchSourceWithLocalHitControlHandle {
956                        inner: this.inner.clone(),
957                    };
958                    Ok(TouchSourceWithLocalHitRequest::Watch {responses: req.responses,
959
960                        responder: TouchSourceWithLocalHitWatchResponder {
961                            control_handle: std::mem::ManuallyDrop::new(control_handle),
962                            tx_id: header.tx_id,
963                        },
964                    })
965                }
966                0x1f2fde6734e7da1 => {
967                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
968                    let mut req = fidl::new_empty!(TouchSourceWithLocalHitUpdateResponseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
969                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TouchSourceWithLocalHitUpdateResponseRequest>(&header, _body_bytes, handles, &mut req)?;
970                    let control_handle = TouchSourceWithLocalHitControlHandle {
971                        inner: this.inner.clone(),
972                    };
973                    Ok(TouchSourceWithLocalHitRequest::UpdateResponse {interaction: req.interaction,
974response: req.response,
975
976                        responder: TouchSourceWithLocalHitUpdateResponseResponder {
977                            control_handle: std::mem::ManuallyDrop::new(control_handle),
978                            tx_id: header.tx_id,
979                        },
980                    })
981                }
982                _ => Err(fidl::Error::UnknownOrdinal {
983                    ordinal: header.ordinal,
984                    protocol_name: <TouchSourceWithLocalHitMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
985                }),
986            }))
987            },
988        )
989    }
990}
991
992#[derive(Debug)]
997pub enum TouchSourceWithLocalHitRequest {
998    Watch {
1001        responses: Vec<fidl_fuchsia_ui_pointer::TouchResponse>,
1002        responder: TouchSourceWithLocalHitWatchResponder,
1003    },
1004    UpdateResponse {
1006        interaction: fidl_fuchsia_ui_pointer::TouchInteractionId,
1007        response: fidl_fuchsia_ui_pointer::TouchResponse,
1008        responder: TouchSourceWithLocalHitUpdateResponseResponder,
1009    },
1010}
1011
1012impl TouchSourceWithLocalHitRequest {
1013    #[allow(irrefutable_let_patterns)]
1014    pub fn into_watch(
1015        self,
1016    ) -> Option<(Vec<fidl_fuchsia_ui_pointer::TouchResponse>, TouchSourceWithLocalHitWatchResponder)>
1017    {
1018        if let TouchSourceWithLocalHitRequest::Watch { responses, responder } = self {
1019            Some((responses, responder))
1020        } else {
1021            None
1022        }
1023    }
1024
1025    #[allow(irrefutable_let_patterns)]
1026    pub fn into_update_response(
1027        self,
1028    ) -> Option<(
1029        fidl_fuchsia_ui_pointer::TouchInteractionId,
1030        fidl_fuchsia_ui_pointer::TouchResponse,
1031        TouchSourceWithLocalHitUpdateResponseResponder,
1032    )> {
1033        if let TouchSourceWithLocalHitRequest::UpdateResponse { interaction, response, responder } =
1034            self
1035        {
1036            Some((interaction, response, responder))
1037        } else {
1038            None
1039        }
1040    }
1041
1042    pub fn method_name(&self) -> &'static str {
1044        match *self {
1045            TouchSourceWithLocalHitRequest::Watch { .. } => "watch",
1046            TouchSourceWithLocalHitRequest::UpdateResponse { .. } => "update_response",
1047        }
1048    }
1049}
1050
1051#[derive(Debug, Clone)]
1052pub struct TouchSourceWithLocalHitControlHandle {
1053    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1054}
1055
1056impl fidl::endpoints::ControlHandle for TouchSourceWithLocalHitControlHandle {
1057    fn shutdown(&self) {
1058        self.inner.shutdown()
1059    }
1060    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1061        self.inner.shutdown_with_epitaph(status)
1062    }
1063
1064    fn is_closed(&self) -> bool {
1065        self.inner.channel().is_closed()
1066    }
1067    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1068        self.inner.channel().on_closed()
1069    }
1070
1071    #[cfg(target_os = "fuchsia")]
1072    fn signal_peer(
1073        &self,
1074        clear_mask: zx::Signals,
1075        set_mask: zx::Signals,
1076    ) -> Result<(), zx_status::Status> {
1077        use fidl::Peered;
1078        self.inner.channel().signal_peer(clear_mask, set_mask)
1079    }
1080}
1081
1082impl TouchSourceWithLocalHitControlHandle {}
1083
1084#[must_use = "FIDL methods require a response to be sent"]
1085#[derive(Debug)]
1086pub struct TouchSourceWithLocalHitWatchResponder {
1087    control_handle: std::mem::ManuallyDrop<TouchSourceWithLocalHitControlHandle>,
1088    tx_id: u32,
1089}
1090
1091impl std::ops::Drop for TouchSourceWithLocalHitWatchResponder {
1095    fn drop(&mut self) {
1096        self.control_handle.shutdown();
1097        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1099    }
1100}
1101
1102impl fidl::endpoints::Responder for TouchSourceWithLocalHitWatchResponder {
1103    type ControlHandle = TouchSourceWithLocalHitControlHandle;
1104
1105    fn control_handle(&self) -> &TouchSourceWithLocalHitControlHandle {
1106        &self.control_handle
1107    }
1108
1109    fn drop_without_shutdown(mut self) {
1110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1112        std::mem::forget(self);
1114    }
1115}
1116
1117impl TouchSourceWithLocalHitWatchResponder {
1118    pub fn send(self, mut events: Vec<TouchEventWithLocalHit>) -> Result<(), fidl::Error> {
1122        let _result = self.send_raw(events);
1123        if _result.is_err() {
1124            self.control_handle.shutdown();
1125        }
1126        self.drop_without_shutdown();
1127        _result
1128    }
1129
1130    pub fn send_no_shutdown_on_err(
1132        self,
1133        mut events: Vec<TouchEventWithLocalHit>,
1134    ) -> Result<(), fidl::Error> {
1135        let _result = self.send_raw(events);
1136        self.drop_without_shutdown();
1137        _result
1138    }
1139
1140    fn send_raw(&self, mut events: Vec<TouchEventWithLocalHit>) -> Result<(), fidl::Error> {
1141        self.control_handle.inner.send::<TouchSourceWithLocalHitWatchResponse>(
1142            (events.as_mut(),),
1143            self.tx_id,
1144            0x4eb5acc052ada449,
1145            fidl::encoding::DynamicFlags::empty(),
1146        )
1147    }
1148}
1149
1150#[must_use = "FIDL methods require a response to be sent"]
1151#[derive(Debug)]
1152pub struct TouchSourceWithLocalHitUpdateResponseResponder {
1153    control_handle: std::mem::ManuallyDrop<TouchSourceWithLocalHitControlHandle>,
1154    tx_id: u32,
1155}
1156
1157impl std::ops::Drop for TouchSourceWithLocalHitUpdateResponseResponder {
1161    fn drop(&mut self) {
1162        self.control_handle.shutdown();
1163        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1165    }
1166}
1167
1168impl fidl::endpoints::Responder for TouchSourceWithLocalHitUpdateResponseResponder {
1169    type ControlHandle = TouchSourceWithLocalHitControlHandle;
1170
1171    fn control_handle(&self) -> &TouchSourceWithLocalHitControlHandle {
1172        &self.control_handle
1173    }
1174
1175    fn drop_without_shutdown(mut self) {
1176        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1178        std::mem::forget(self);
1180    }
1181}
1182
1183impl TouchSourceWithLocalHitUpdateResponseResponder {
1184    pub fn send(self) -> Result<(), fidl::Error> {
1188        let _result = self.send_raw();
1189        if _result.is_err() {
1190            self.control_handle.shutdown();
1191        }
1192        self.drop_without_shutdown();
1193        _result
1194    }
1195
1196    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1198        let _result = self.send_raw();
1199        self.drop_without_shutdown();
1200        _result
1201    }
1202
1203    fn send_raw(&self) -> Result<(), fidl::Error> {
1204        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1205            (),
1206            self.tx_id,
1207            0x1f2fde6734e7da1,
1208            fidl::encoding::DynamicFlags::empty(),
1209        )
1210    }
1211}
1212
1213mod internal {
1214    use super::*;
1215
1216    impl fidl::encoding::ResourceTypeMarker for ErrorForLocalHit {
1217        type Borrowed<'a> = &'a mut Self;
1218        fn take_or_borrow<'a>(
1219            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1220        ) -> Self::Borrowed<'a> {
1221            value
1222        }
1223    }
1224
1225    unsafe impl fidl::encoding::TypeMarker for ErrorForLocalHit {
1226        type Owned = Self;
1227
1228        #[inline(always)]
1229        fn inline_align(_context: fidl::encoding::Context) -> usize {
1230            4
1231        }
1232
1233        #[inline(always)]
1234        fn inline_size(_context: fidl::encoding::Context) -> usize {
1235            8
1236        }
1237    }
1238
1239    unsafe impl
1240        fidl::encoding::Encode<ErrorForLocalHit, fidl::encoding::DefaultFuchsiaResourceDialect>
1241        for &mut ErrorForLocalHit
1242    {
1243        #[inline]
1244        unsafe fn encode(
1245            self,
1246            encoder: &mut fidl::encoding::Encoder<
1247                '_,
1248                fidl::encoding::DefaultFuchsiaResourceDialect,
1249            >,
1250            offset: usize,
1251            _depth: fidl::encoding::Depth,
1252        ) -> fidl::Result<()> {
1253            encoder.debug_check_bounds::<ErrorForLocalHit>(offset);
1254            fidl::encoding::Encode::<ErrorForLocalHit, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1256                (
1257                    <ErrorReason as fidl::encoding::ValueTypeMarker>::borrow(&self.error_reason),
1258                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.original),
1259                ),
1260                encoder, offset, _depth
1261            )
1262        }
1263    }
1264    unsafe impl<
1265        T0: fidl::encoding::Encode<ErrorReason, fidl::encoding::DefaultFuchsiaResourceDialect>,
1266        T1: fidl::encoding::Encode<
1267                fidl::encoding::Endpoint<
1268                    fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
1269                >,
1270                fidl::encoding::DefaultFuchsiaResourceDialect,
1271            >,
1272    > fidl::encoding::Encode<ErrorForLocalHit, fidl::encoding::DefaultFuchsiaResourceDialect>
1273        for (T0, T1)
1274    {
1275        #[inline]
1276        unsafe fn encode(
1277            self,
1278            encoder: &mut fidl::encoding::Encoder<
1279                '_,
1280                fidl::encoding::DefaultFuchsiaResourceDialect,
1281            >,
1282            offset: usize,
1283            depth: fidl::encoding::Depth,
1284        ) -> fidl::Result<()> {
1285            encoder.debug_check_bounds::<ErrorForLocalHit>(offset);
1286            self.0.encode(encoder, offset + 0, depth)?;
1290            self.1.encode(encoder, offset + 4, depth)?;
1291            Ok(())
1292        }
1293    }
1294
1295    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1296        for ErrorForLocalHit
1297    {
1298        #[inline(always)]
1299        fn new_empty() -> Self {
1300            Self {
1301                error_reason: fidl::new_empty!(
1302                    ErrorReason,
1303                    fidl::encoding::DefaultFuchsiaResourceDialect
1304                ),
1305                original: fidl::new_empty!(
1306                    fidl::encoding::Endpoint<
1307                        fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
1308                    >,
1309                    fidl::encoding::DefaultFuchsiaResourceDialect
1310                ),
1311            }
1312        }
1313
1314        #[inline]
1315        unsafe fn decode(
1316            &mut self,
1317            decoder: &mut fidl::encoding::Decoder<
1318                '_,
1319                fidl::encoding::DefaultFuchsiaResourceDialect,
1320            >,
1321            offset: usize,
1322            _depth: fidl::encoding::Depth,
1323        ) -> fidl::Result<()> {
1324            decoder.debug_check_bounds::<Self>(offset);
1325            fidl::decode!(
1327                ErrorReason,
1328                fidl::encoding::DefaultFuchsiaResourceDialect,
1329                &mut self.error_reason,
1330                decoder,
1331                offset + 0,
1332                _depth
1333            )?;
1334            fidl::decode!(
1335                fidl::encoding::Endpoint<
1336                    fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
1337                >,
1338                fidl::encoding::DefaultFuchsiaResourceDialect,
1339                &mut self.original,
1340                decoder,
1341                offset + 4,
1342                _depth
1343            )?;
1344            Ok(())
1345        }
1346    }
1347
1348    impl fidl::encoding::ResourceTypeMarker for LocalHitUpgradeRequest {
1349        type Borrowed<'a> = &'a mut Self;
1350        fn take_or_borrow<'a>(
1351            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1352        ) -> Self::Borrowed<'a> {
1353            value
1354        }
1355    }
1356
1357    unsafe impl fidl::encoding::TypeMarker for LocalHitUpgradeRequest {
1358        type Owned = Self;
1359
1360        #[inline(always)]
1361        fn inline_align(_context: fidl::encoding::Context) -> usize {
1362            4
1363        }
1364
1365        #[inline(always)]
1366        fn inline_size(_context: fidl::encoding::Context) -> usize {
1367            4
1368        }
1369    }
1370
1371    unsafe impl
1372        fidl::encoding::Encode<
1373            LocalHitUpgradeRequest,
1374            fidl::encoding::DefaultFuchsiaResourceDialect,
1375        > for &mut LocalHitUpgradeRequest
1376    {
1377        #[inline]
1378        unsafe fn encode(
1379            self,
1380            encoder: &mut fidl::encoding::Encoder<
1381                '_,
1382                fidl::encoding::DefaultFuchsiaResourceDialect,
1383            >,
1384            offset: usize,
1385            _depth: fidl::encoding::Depth,
1386        ) -> fidl::Result<()> {
1387            encoder.debug_check_bounds::<LocalHitUpgradeRequest>(offset);
1388            fidl::encoding::Encode::<
1390                LocalHitUpgradeRequest,
1391                fidl::encoding::DefaultFuchsiaResourceDialect,
1392            >::encode(
1393                (<fidl::encoding::Endpoint<
1394                    fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
1395                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1396                    &mut self.original
1397                ),),
1398                encoder,
1399                offset,
1400                _depth,
1401            )
1402        }
1403    }
1404    unsafe impl<
1405        T0: fidl::encoding::Encode<
1406                fidl::encoding::Endpoint<
1407                    fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
1408                >,
1409                fidl::encoding::DefaultFuchsiaResourceDialect,
1410            >,
1411    >
1412        fidl::encoding::Encode<
1413            LocalHitUpgradeRequest,
1414            fidl::encoding::DefaultFuchsiaResourceDialect,
1415        > for (T0,)
1416    {
1417        #[inline]
1418        unsafe fn encode(
1419            self,
1420            encoder: &mut fidl::encoding::Encoder<
1421                '_,
1422                fidl::encoding::DefaultFuchsiaResourceDialect,
1423            >,
1424            offset: usize,
1425            depth: fidl::encoding::Depth,
1426        ) -> fidl::Result<()> {
1427            encoder.debug_check_bounds::<LocalHitUpgradeRequest>(offset);
1428            self.0.encode(encoder, offset + 0, depth)?;
1432            Ok(())
1433        }
1434    }
1435
1436    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1437        for LocalHitUpgradeRequest
1438    {
1439        #[inline(always)]
1440        fn new_empty() -> Self {
1441            Self {
1442                original: fidl::new_empty!(
1443                    fidl::encoding::Endpoint<
1444                        fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
1445                    >,
1446                    fidl::encoding::DefaultFuchsiaResourceDialect
1447                ),
1448            }
1449        }
1450
1451        #[inline]
1452        unsafe fn decode(
1453            &mut self,
1454            decoder: &mut fidl::encoding::Decoder<
1455                '_,
1456                fidl::encoding::DefaultFuchsiaResourceDialect,
1457            >,
1458            offset: usize,
1459            _depth: fidl::encoding::Depth,
1460        ) -> fidl::Result<()> {
1461            decoder.debug_check_bounds::<Self>(offset);
1462            fidl::decode!(
1464                fidl::encoding::Endpoint<
1465                    fidl::endpoints::ClientEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
1466                >,
1467                fidl::encoding::DefaultFuchsiaResourceDialect,
1468                &mut self.original,
1469                decoder,
1470                offset + 0,
1471                _depth
1472            )?;
1473            Ok(())
1474        }
1475    }
1476
1477    impl fidl::encoding::ResourceTypeMarker for LocalHitUpgradeResponse {
1478        type Borrowed<'a> = &'a mut Self;
1479        fn take_or_borrow<'a>(
1480            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1481        ) -> Self::Borrowed<'a> {
1482            value
1483        }
1484    }
1485
1486    unsafe impl fidl::encoding::TypeMarker for LocalHitUpgradeResponse {
1487        type Owned = Self;
1488
1489        #[inline(always)]
1490        fn inline_align(_context: fidl::encoding::Context) -> usize {
1491            8
1492        }
1493
1494        #[inline(always)]
1495        fn inline_size(_context: fidl::encoding::Context) -> usize {
1496            16
1497        }
1498    }
1499
1500    unsafe impl
1501        fidl::encoding::Encode<
1502            LocalHitUpgradeResponse,
1503            fidl::encoding::DefaultFuchsiaResourceDialect,
1504        > for &mut LocalHitUpgradeResponse
1505    {
1506        #[inline]
1507        unsafe fn encode(
1508            self,
1509            encoder: &mut fidl::encoding::Encoder<
1510                '_,
1511                fidl::encoding::DefaultFuchsiaResourceDialect,
1512            >,
1513            offset: usize,
1514            _depth: fidl::encoding::Depth,
1515        ) -> fidl::Result<()> {
1516            encoder.debug_check_bounds::<LocalHitUpgradeResponse>(offset);
1517            fidl::encoding::Encode::<LocalHitUpgradeResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1519                (
1520                    <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.augmented),
1521                    <fidl::encoding::Boxed<ErrorForLocalHit> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.error),
1522                ),
1523                encoder, offset, _depth
1524            )
1525        }
1526    }
1527    unsafe impl<
1528        T0: fidl::encoding::Encode<
1529                fidl::encoding::Optional<
1530                    fidl::encoding::Endpoint<
1531                        fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>,
1532                    >,
1533                >,
1534                fidl::encoding::DefaultFuchsiaResourceDialect,
1535            >,
1536        T1: fidl::encoding::Encode<
1537                fidl::encoding::Boxed<ErrorForLocalHit>,
1538                fidl::encoding::DefaultFuchsiaResourceDialect,
1539            >,
1540    >
1541        fidl::encoding::Encode<
1542            LocalHitUpgradeResponse,
1543            fidl::encoding::DefaultFuchsiaResourceDialect,
1544        > for (T0, T1)
1545    {
1546        #[inline]
1547        unsafe fn encode(
1548            self,
1549            encoder: &mut fidl::encoding::Encoder<
1550                '_,
1551                fidl::encoding::DefaultFuchsiaResourceDialect,
1552            >,
1553            offset: usize,
1554            depth: fidl::encoding::Depth,
1555        ) -> fidl::Result<()> {
1556            encoder.debug_check_bounds::<LocalHitUpgradeResponse>(offset);
1557            unsafe {
1560                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1561                (ptr as *mut u64).write_unaligned(0);
1562            }
1563            self.0.encode(encoder, offset + 0, depth)?;
1565            self.1.encode(encoder, offset + 8, depth)?;
1566            Ok(())
1567        }
1568    }
1569
1570    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1571        for LocalHitUpgradeResponse
1572    {
1573        #[inline(always)]
1574        fn new_empty() -> Self {
1575            Self {
1576                augmented: fidl::new_empty!(
1577                    fidl::encoding::Optional<
1578                        fidl::encoding::Endpoint<
1579                            fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>,
1580                        >,
1581                    >,
1582                    fidl::encoding::DefaultFuchsiaResourceDialect
1583                ),
1584                error: fidl::new_empty!(
1585                    fidl::encoding::Boxed<ErrorForLocalHit>,
1586                    fidl::encoding::DefaultFuchsiaResourceDialect
1587                ),
1588            }
1589        }
1590
1591        #[inline]
1592        unsafe fn decode(
1593            &mut self,
1594            decoder: &mut fidl::encoding::Decoder<
1595                '_,
1596                fidl::encoding::DefaultFuchsiaResourceDialect,
1597            >,
1598            offset: usize,
1599            _depth: fidl::encoding::Depth,
1600        ) -> fidl::Result<()> {
1601            decoder.debug_check_bounds::<Self>(offset);
1602            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1604            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1605            let mask = 0xffffffff00000000u64;
1606            let maskedval = padval & mask;
1607            if maskedval != 0 {
1608                return Err(fidl::Error::NonZeroPadding {
1609                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1610                });
1611            }
1612            fidl::decode!(
1613                fidl::encoding::Optional<
1614                    fidl::encoding::Endpoint<
1615                        fidl::endpoints::ClientEnd<TouchSourceWithLocalHitMarker>,
1616                    >,
1617                >,
1618                fidl::encoding::DefaultFuchsiaResourceDialect,
1619                &mut self.augmented,
1620                decoder,
1621                offset + 0,
1622                _depth
1623            )?;
1624            fidl::decode!(
1625                fidl::encoding::Boxed<ErrorForLocalHit>,
1626                fidl::encoding::DefaultFuchsiaResourceDialect,
1627                &mut self.error,
1628                decoder,
1629                offset + 8,
1630                _depth
1631            )?;
1632            Ok(())
1633        }
1634    }
1635
1636    impl fidl::encoding::ResourceTypeMarker for TouchEventWithLocalHit {
1637        type Borrowed<'a> = &'a mut Self;
1638        fn take_or_borrow<'a>(
1639            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1640        ) -> Self::Borrowed<'a> {
1641            value
1642        }
1643    }
1644
1645    unsafe impl fidl::encoding::TypeMarker for TouchEventWithLocalHit {
1646        type Owned = Self;
1647
1648        #[inline(always)]
1649        fn inline_align(_context: fidl::encoding::Context) -> usize {
1650            8
1651        }
1652
1653        #[inline(always)]
1654        fn inline_size(_context: fidl::encoding::Context) -> usize {
1655            32
1656        }
1657    }
1658
1659    unsafe impl
1660        fidl::encoding::Encode<
1661            TouchEventWithLocalHit,
1662            fidl::encoding::DefaultFuchsiaResourceDialect,
1663        > for &mut TouchEventWithLocalHit
1664    {
1665        #[inline]
1666        unsafe fn encode(
1667            self,
1668            encoder: &mut fidl::encoding::Encoder<
1669                '_,
1670                fidl::encoding::DefaultFuchsiaResourceDialect,
1671            >,
1672            offset: usize,
1673            _depth: fidl::encoding::Depth,
1674        ) -> fidl::Result<()> {
1675            encoder.debug_check_bounds::<TouchEventWithLocalHit>(offset);
1676            fidl::encoding::Encode::<TouchEventWithLocalHit, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1678                (
1679                    <fidl_fuchsia_ui_pointer::TouchEvent as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.touch_event),
1680                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.local_viewref_koid),
1681                    <fidl::encoding::Array<f32, 2> as fidl::encoding::ValueTypeMarker>::borrow(&self.local_point),
1682                ),
1683                encoder, offset, _depth
1684            )
1685        }
1686    }
1687    unsafe impl<
1688        T0: fidl::encoding::Encode<
1689                fidl_fuchsia_ui_pointer::TouchEvent,
1690                fidl::encoding::DefaultFuchsiaResourceDialect,
1691            >,
1692        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
1693        T2: fidl::encoding::Encode<
1694                fidl::encoding::Array<f32, 2>,
1695                fidl::encoding::DefaultFuchsiaResourceDialect,
1696            >,
1697    >
1698        fidl::encoding::Encode<
1699            TouchEventWithLocalHit,
1700            fidl::encoding::DefaultFuchsiaResourceDialect,
1701        > for (T0, T1, T2)
1702    {
1703        #[inline]
1704        unsafe fn encode(
1705            self,
1706            encoder: &mut fidl::encoding::Encoder<
1707                '_,
1708                fidl::encoding::DefaultFuchsiaResourceDialect,
1709            >,
1710            offset: usize,
1711            depth: fidl::encoding::Depth,
1712        ) -> fidl::Result<()> {
1713            encoder.debug_check_bounds::<TouchEventWithLocalHit>(offset);
1714            self.0.encode(encoder, offset + 0, depth)?;
1718            self.1.encode(encoder, offset + 16, depth)?;
1719            self.2.encode(encoder, offset + 24, depth)?;
1720            Ok(())
1721        }
1722    }
1723
1724    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1725        for TouchEventWithLocalHit
1726    {
1727        #[inline(always)]
1728        fn new_empty() -> Self {
1729            Self {
1730                touch_event: fidl::new_empty!(
1731                    fidl_fuchsia_ui_pointer::TouchEvent,
1732                    fidl::encoding::DefaultFuchsiaResourceDialect
1733                ),
1734                local_viewref_koid: fidl::new_empty!(
1735                    u64,
1736                    fidl::encoding::DefaultFuchsiaResourceDialect
1737                ),
1738                local_point: fidl::new_empty!(fidl::encoding::Array<f32, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
1739            }
1740        }
1741
1742        #[inline]
1743        unsafe fn decode(
1744            &mut self,
1745            decoder: &mut fidl::encoding::Decoder<
1746                '_,
1747                fidl::encoding::DefaultFuchsiaResourceDialect,
1748            >,
1749            offset: usize,
1750            _depth: fidl::encoding::Depth,
1751        ) -> fidl::Result<()> {
1752            decoder.debug_check_bounds::<Self>(offset);
1753            fidl::decode!(
1755                fidl_fuchsia_ui_pointer::TouchEvent,
1756                fidl::encoding::DefaultFuchsiaResourceDialect,
1757                &mut self.touch_event,
1758                decoder,
1759                offset + 0,
1760                _depth
1761            )?;
1762            fidl::decode!(
1763                u64,
1764                fidl::encoding::DefaultFuchsiaResourceDialect,
1765                &mut self.local_viewref_koid,
1766                decoder,
1767                offset + 16,
1768                _depth
1769            )?;
1770            fidl::decode!(fidl::encoding::Array<f32, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.local_point, decoder, offset + 24, _depth)?;
1771            Ok(())
1772        }
1773    }
1774
1775    impl fidl::encoding::ResourceTypeMarker for TouchSourceWithLocalHitWatchResponse {
1776        type Borrowed<'a> = &'a mut Self;
1777        fn take_or_borrow<'a>(
1778            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1779        ) -> Self::Borrowed<'a> {
1780            value
1781        }
1782    }
1783
1784    unsafe impl fidl::encoding::TypeMarker for TouchSourceWithLocalHitWatchResponse {
1785        type Owned = Self;
1786
1787        #[inline(always)]
1788        fn inline_align(_context: fidl::encoding::Context) -> usize {
1789            8
1790        }
1791
1792        #[inline(always)]
1793        fn inline_size(_context: fidl::encoding::Context) -> usize {
1794            16
1795        }
1796    }
1797
1798    unsafe impl
1799        fidl::encoding::Encode<
1800            TouchSourceWithLocalHitWatchResponse,
1801            fidl::encoding::DefaultFuchsiaResourceDialect,
1802        > for &mut TouchSourceWithLocalHitWatchResponse
1803    {
1804        #[inline]
1805        unsafe fn encode(
1806            self,
1807            encoder: &mut fidl::encoding::Encoder<
1808                '_,
1809                fidl::encoding::DefaultFuchsiaResourceDialect,
1810            >,
1811            offset: usize,
1812            _depth: fidl::encoding::Depth,
1813        ) -> fidl::Result<()> {
1814            encoder.debug_check_bounds::<TouchSourceWithLocalHitWatchResponse>(offset);
1815            fidl::encoding::Encode::<TouchSourceWithLocalHitWatchResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1817                (
1818                    <fidl::encoding::Vector<TouchEventWithLocalHit, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
1819                ),
1820                encoder, offset, _depth
1821            )
1822        }
1823    }
1824    unsafe impl<
1825        T0: fidl::encoding::Encode<
1826                fidl::encoding::Vector<TouchEventWithLocalHit, 128>,
1827                fidl::encoding::DefaultFuchsiaResourceDialect,
1828            >,
1829    >
1830        fidl::encoding::Encode<
1831            TouchSourceWithLocalHitWatchResponse,
1832            fidl::encoding::DefaultFuchsiaResourceDialect,
1833        > for (T0,)
1834    {
1835        #[inline]
1836        unsafe fn encode(
1837            self,
1838            encoder: &mut fidl::encoding::Encoder<
1839                '_,
1840                fidl::encoding::DefaultFuchsiaResourceDialect,
1841            >,
1842            offset: usize,
1843            depth: fidl::encoding::Depth,
1844        ) -> fidl::Result<()> {
1845            encoder.debug_check_bounds::<TouchSourceWithLocalHitWatchResponse>(offset);
1846            self.0.encode(encoder, offset + 0, depth)?;
1850            Ok(())
1851        }
1852    }
1853
1854    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1855        for TouchSourceWithLocalHitWatchResponse
1856    {
1857        #[inline(always)]
1858        fn new_empty() -> Self {
1859            Self {
1860                events: fidl::new_empty!(fidl::encoding::Vector<TouchEventWithLocalHit, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
1861            }
1862        }
1863
1864        #[inline]
1865        unsafe fn decode(
1866            &mut self,
1867            decoder: &mut fidl::encoding::Decoder<
1868                '_,
1869                fidl::encoding::DefaultFuchsiaResourceDialect,
1870            >,
1871            offset: usize,
1872            _depth: fidl::encoding::Depth,
1873        ) -> fidl::Result<()> {
1874            decoder.debug_check_bounds::<Self>(offset);
1875            fidl::decode!(fidl::encoding::Vector<TouchEventWithLocalHit, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.events, decoder, offset + 0, _depth)?;
1877            Ok(())
1878        }
1879    }
1880}