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_input_report__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct InputDeviceGetInputReportsReaderRequest {
16 pub reader: fidl::endpoints::ServerEnd<InputReportsReaderMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for InputDeviceGetInputReportsReaderRequest
21{
22}
23
24#[derive(Debug, PartialEq)]
25pub struct InputDeviceGetInputReportResponse {
26 pub report: InputReport,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for InputDeviceGetInputReportResponse
31{
32}
33
34#[derive(Debug, PartialEq)]
35pub struct InputReportsReaderReadInputReportsResponse {
36 pub reports: Vec<InputReport>,
37}
38
39impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
40 for InputReportsReaderReadInputReportsResponse
41{
42}
43
44#[derive(Debug, Default, PartialEq)]
49pub struct InputReport {
50 pub event_time: Option<i64>,
52 pub mouse: Option<MouseInputReport>,
54 pub sensor: Option<SensorInputReport>,
56 pub touch: Option<TouchInputReport>,
58 pub keyboard: Option<KeyboardInputReport>,
60 pub consumer_control: Option<ConsumerControlInputReport>,
63 pub trace_id: Option<u64>,
65 pub report_id: Option<u8>,
68 pub wake_lease: Option<fidl::EventPair>,
70 #[doc(hidden)]
71 pub __source_breaking: fidl::marker::SourceBreaking,
72}
73
74impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InputReport {}
75
76#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
77pub struct InputDeviceMarker;
78
79impl fidl::endpoints::ProtocolMarker for InputDeviceMarker {
80 type Proxy = InputDeviceProxy;
81 type RequestStream = InputDeviceRequestStream;
82 #[cfg(target_os = "fuchsia")]
83 type SynchronousProxy = InputDeviceSynchronousProxy;
84
85 const DEBUG_NAME: &'static str = "fuchsia.input.report.InputDevice";
86}
87impl fidl::endpoints::DiscoverableProtocolMarker for InputDeviceMarker {}
88pub type InputDeviceSendOutputReportResult = Result<(), i32>;
89pub type InputDeviceGetFeatureReportResult = Result<FeatureReport, i32>;
90pub type InputDeviceSetFeatureReportResult = Result<(), i32>;
91pub type InputDeviceGetInputReportResult = Result<InputReport, i32>;
92
93pub trait InputDeviceProxyInterface: Send + Sync {
94 fn r#get_input_reports_reader(
95 &self,
96 reader: fidl::endpoints::ServerEnd<InputReportsReaderMarker>,
97 ) -> Result<(), fidl::Error>;
98 type GetDescriptorResponseFut: std::future::Future<Output = Result<DeviceDescriptor, fidl::Error>>
99 + Send;
100 fn r#get_descriptor(&self) -> Self::GetDescriptorResponseFut;
101 type SendOutputReportResponseFut: std::future::Future<Output = Result<InputDeviceSendOutputReportResult, fidl::Error>>
102 + Send;
103 fn r#send_output_report(&self, report: &OutputReport) -> Self::SendOutputReportResponseFut;
104 type GetFeatureReportResponseFut: std::future::Future<Output = Result<InputDeviceGetFeatureReportResult, fidl::Error>>
105 + Send;
106 fn r#get_feature_report(&self) -> Self::GetFeatureReportResponseFut;
107 type SetFeatureReportResponseFut: std::future::Future<Output = Result<InputDeviceSetFeatureReportResult, fidl::Error>>
108 + Send;
109 fn r#set_feature_report(&self, report: &FeatureReport) -> Self::SetFeatureReportResponseFut;
110 type GetInputReportResponseFut: std::future::Future<Output = Result<InputDeviceGetInputReportResult, fidl::Error>>
111 + Send;
112 fn r#get_input_report(&self, device_type: DeviceType) -> Self::GetInputReportResponseFut;
113}
114#[derive(Debug)]
115#[cfg(target_os = "fuchsia")]
116pub struct InputDeviceSynchronousProxy {
117 client: fidl::client::sync::Client,
118}
119
120#[cfg(target_os = "fuchsia")]
121impl fidl::endpoints::SynchronousProxy for InputDeviceSynchronousProxy {
122 type Proxy = InputDeviceProxy;
123 type Protocol = InputDeviceMarker;
124
125 fn from_channel(inner: fidl::Channel) -> Self {
126 Self::new(inner)
127 }
128
129 fn into_channel(self) -> fidl::Channel {
130 self.client.into_channel()
131 }
132
133 fn as_channel(&self) -> &fidl::Channel {
134 self.client.as_channel()
135 }
136}
137
138#[cfg(target_os = "fuchsia")]
139impl InputDeviceSynchronousProxy {
140 pub fn new(channel: fidl::Channel) -> Self {
141 let protocol_name = <InputDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
142 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
143 }
144
145 pub fn into_channel(self) -> fidl::Channel {
146 self.client.into_channel()
147 }
148
149 pub fn wait_for_event(
152 &self,
153 deadline: zx::MonotonicInstant,
154 ) -> Result<InputDeviceEvent, fidl::Error> {
155 InputDeviceEvent::decode(self.client.wait_for_event(deadline)?)
156 }
157
158 pub fn r#get_input_reports_reader(
161 &self,
162 mut reader: fidl::endpoints::ServerEnd<InputReportsReaderMarker>,
163 ) -> Result<(), fidl::Error> {
164 self.client.send::<InputDeviceGetInputReportsReaderRequest>(
165 (reader,),
166 0x68d9cf83e397ab41,
167 fidl::encoding::DynamicFlags::empty(),
168 )
169 }
170
171 pub fn r#get_descriptor(
173 &self,
174 ___deadline: zx::MonotonicInstant,
175 ) -> Result<DeviceDescriptor, fidl::Error> {
176 let _response = self
177 .client
178 .send_query::<fidl::encoding::EmptyPayload, InputDeviceGetDescriptorResponse>(
179 (),
180 0x3d76420f2ff8ad32,
181 fidl::encoding::DynamicFlags::empty(),
182 ___deadline,
183 )?;
184 Ok(_response.descriptor)
185 }
186
187 pub fn r#send_output_report(
190 &self,
191 mut report: &OutputReport,
192 ___deadline: zx::MonotonicInstant,
193 ) -> Result<InputDeviceSendOutputReportResult, fidl::Error> {
194 let _response = self.client.send_query::<
195 InputDeviceSendOutputReportRequest,
196 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
197 >(
198 (report,),
199 0x67a4888774e6f3a,
200 fidl::encoding::DynamicFlags::empty(),
201 ___deadline,
202 )?;
203 Ok(_response.map(|x| x))
204 }
205
206 pub fn r#get_feature_report(
209 &self,
210 ___deadline: zx::MonotonicInstant,
211 ) -> Result<InputDeviceGetFeatureReportResult, fidl::Error> {
212 let _response = self.client.send_query::<
213 fidl::encoding::EmptyPayload,
214 fidl::encoding::ResultType<InputDeviceGetFeatureReportResponse, i32>,
215 >(
216 (),
217 0x497a7d98d9391f16,
218 fidl::encoding::DynamicFlags::empty(),
219 ___deadline,
220 )?;
221 Ok(_response.map(|x| x.report))
222 }
223
224 pub fn r#set_feature_report(
227 &self,
228 mut report: &FeatureReport,
229 ___deadline: zx::MonotonicInstant,
230 ) -> Result<InputDeviceSetFeatureReportResult, fidl::Error> {
231 let _response = self.client.send_query::<
232 InputDeviceSetFeatureReportRequest,
233 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
234 >(
235 (report,),
236 0x7679a2f5a42842ef,
237 fidl::encoding::DynamicFlags::empty(),
238 ___deadline,
239 )?;
240 Ok(_response.map(|x| x))
241 }
242
243 pub fn r#get_input_report(
249 &self,
250 mut device_type: DeviceType,
251 ___deadline: zx::MonotonicInstant,
252 ) -> Result<InputDeviceGetInputReportResult, fidl::Error> {
253 let _response = self.client.send_query::<
254 InputDeviceGetInputReportRequest,
255 fidl::encoding::ResultType<InputDeviceGetInputReportResponse, i32>,
256 >(
257 (device_type,),
258 0x4752ccab96c10248,
259 fidl::encoding::DynamicFlags::empty(),
260 ___deadline,
261 )?;
262 Ok(_response.map(|x| x.report))
263 }
264}
265
266#[cfg(target_os = "fuchsia")]
267impl From<InputDeviceSynchronousProxy> for zx::NullableHandle {
268 fn from(value: InputDeviceSynchronousProxy) -> Self {
269 value.into_channel().into()
270 }
271}
272
273#[cfg(target_os = "fuchsia")]
274impl From<fidl::Channel> for InputDeviceSynchronousProxy {
275 fn from(value: fidl::Channel) -> Self {
276 Self::new(value)
277 }
278}
279
280#[cfg(target_os = "fuchsia")]
281impl fidl::endpoints::FromClient for InputDeviceSynchronousProxy {
282 type Protocol = InputDeviceMarker;
283
284 fn from_client(value: fidl::endpoints::ClientEnd<InputDeviceMarker>) -> Self {
285 Self::new(value.into_channel())
286 }
287}
288
289#[derive(Debug, Clone)]
290pub struct InputDeviceProxy {
291 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
292}
293
294impl fidl::endpoints::Proxy for InputDeviceProxy {
295 type Protocol = InputDeviceMarker;
296
297 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
298 Self::new(inner)
299 }
300
301 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
302 self.client.into_channel().map_err(|client| Self { client })
303 }
304
305 fn as_channel(&self) -> &::fidl::AsyncChannel {
306 self.client.as_channel()
307 }
308}
309
310impl InputDeviceProxy {
311 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
313 let protocol_name = <InputDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
314 Self { client: fidl::client::Client::new(channel, protocol_name) }
315 }
316
317 pub fn take_event_stream(&self) -> InputDeviceEventStream {
323 InputDeviceEventStream { event_receiver: self.client.take_event_receiver() }
324 }
325
326 pub fn r#get_input_reports_reader(
329 &self,
330 mut reader: fidl::endpoints::ServerEnd<InputReportsReaderMarker>,
331 ) -> Result<(), fidl::Error> {
332 InputDeviceProxyInterface::r#get_input_reports_reader(self, reader)
333 }
334
335 pub fn r#get_descriptor(
337 &self,
338 ) -> fidl::client::QueryResponseFut<
339 DeviceDescriptor,
340 fidl::encoding::DefaultFuchsiaResourceDialect,
341 > {
342 InputDeviceProxyInterface::r#get_descriptor(self)
343 }
344
345 pub fn r#send_output_report(
348 &self,
349 mut report: &OutputReport,
350 ) -> fidl::client::QueryResponseFut<
351 InputDeviceSendOutputReportResult,
352 fidl::encoding::DefaultFuchsiaResourceDialect,
353 > {
354 InputDeviceProxyInterface::r#send_output_report(self, report)
355 }
356
357 pub fn r#get_feature_report(
360 &self,
361 ) -> fidl::client::QueryResponseFut<
362 InputDeviceGetFeatureReportResult,
363 fidl::encoding::DefaultFuchsiaResourceDialect,
364 > {
365 InputDeviceProxyInterface::r#get_feature_report(self)
366 }
367
368 pub fn r#set_feature_report(
371 &self,
372 mut report: &FeatureReport,
373 ) -> fidl::client::QueryResponseFut<
374 InputDeviceSetFeatureReportResult,
375 fidl::encoding::DefaultFuchsiaResourceDialect,
376 > {
377 InputDeviceProxyInterface::r#set_feature_report(self, report)
378 }
379
380 pub fn r#get_input_report(
386 &self,
387 mut device_type: DeviceType,
388 ) -> fidl::client::QueryResponseFut<
389 InputDeviceGetInputReportResult,
390 fidl::encoding::DefaultFuchsiaResourceDialect,
391 > {
392 InputDeviceProxyInterface::r#get_input_report(self, device_type)
393 }
394}
395
396impl InputDeviceProxyInterface for InputDeviceProxy {
397 fn r#get_input_reports_reader(
398 &self,
399 mut reader: fidl::endpoints::ServerEnd<InputReportsReaderMarker>,
400 ) -> Result<(), fidl::Error> {
401 self.client.send::<InputDeviceGetInputReportsReaderRequest>(
402 (reader,),
403 0x68d9cf83e397ab41,
404 fidl::encoding::DynamicFlags::empty(),
405 )
406 }
407
408 type GetDescriptorResponseFut = fidl::client::QueryResponseFut<
409 DeviceDescriptor,
410 fidl::encoding::DefaultFuchsiaResourceDialect,
411 >;
412 fn r#get_descriptor(&self) -> Self::GetDescriptorResponseFut {
413 fn _decode(
414 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
415 ) -> Result<DeviceDescriptor, fidl::Error> {
416 let _response = fidl::client::decode_transaction_body::<
417 InputDeviceGetDescriptorResponse,
418 fidl::encoding::DefaultFuchsiaResourceDialect,
419 0x3d76420f2ff8ad32,
420 >(_buf?)?;
421 Ok(_response.descriptor)
422 }
423 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DeviceDescriptor>(
424 (),
425 0x3d76420f2ff8ad32,
426 fidl::encoding::DynamicFlags::empty(),
427 _decode,
428 )
429 }
430
431 type SendOutputReportResponseFut = fidl::client::QueryResponseFut<
432 InputDeviceSendOutputReportResult,
433 fidl::encoding::DefaultFuchsiaResourceDialect,
434 >;
435 fn r#send_output_report(&self, mut report: &OutputReport) -> Self::SendOutputReportResponseFut {
436 fn _decode(
437 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
438 ) -> Result<InputDeviceSendOutputReportResult, fidl::Error> {
439 let _response = fidl::client::decode_transaction_body::<
440 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
441 fidl::encoding::DefaultFuchsiaResourceDialect,
442 0x67a4888774e6f3a,
443 >(_buf?)?;
444 Ok(_response.map(|x| x))
445 }
446 self.client.send_query_and_decode::<
447 InputDeviceSendOutputReportRequest,
448 InputDeviceSendOutputReportResult,
449 >(
450 (report,),
451 0x67a4888774e6f3a,
452 fidl::encoding::DynamicFlags::empty(),
453 _decode,
454 )
455 }
456
457 type GetFeatureReportResponseFut = fidl::client::QueryResponseFut<
458 InputDeviceGetFeatureReportResult,
459 fidl::encoding::DefaultFuchsiaResourceDialect,
460 >;
461 fn r#get_feature_report(&self) -> Self::GetFeatureReportResponseFut {
462 fn _decode(
463 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
464 ) -> Result<InputDeviceGetFeatureReportResult, fidl::Error> {
465 let _response = fidl::client::decode_transaction_body::<
466 fidl::encoding::ResultType<InputDeviceGetFeatureReportResponse, i32>,
467 fidl::encoding::DefaultFuchsiaResourceDialect,
468 0x497a7d98d9391f16,
469 >(_buf?)?;
470 Ok(_response.map(|x| x.report))
471 }
472 self.client.send_query_and_decode::<
473 fidl::encoding::EmptyPayload,
474 InputDeviceGetFeatureReportResult,
475 >(
476 (),
477 0x497a7d98d9391f16,
478 fidl::encoding::DynamicFlags::empty(),
479 _decode,
480 )
481 }
482
483 type SetFeatureReportResponseFut = fidl::client::QueryResponseFut<
484 InputDeviceSetFeatureReportResult,
485 fidl::encoding::DefaultFuchsiaResourceDialect,
486 >;
487 fn r#set_feature_report(
488 &self,
489 mut report: &FeatureReport,
490 ) -> Self::SetFeatureReportResponseFut {
491 fn _decode(
492 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
493 ) -> Result<InputDeviceSetFeatureReportResult, fidl::Error> {
494 let _response = fidl::client::decode_transaction_body::<
495 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
496 fidl::encoding::DefaultFuchsiaResourceDialect,
497 0x7679a2f5a42842ef,
498 >(_buf?)?;
499 Ok(_response.map(|x| x))
500 }
501 self.client.send_query_and_decode::<
502 InputDeviceSetFeatureReportRequest,
503 InputDeviceSetFeatureReportResult,
504 >(
505 (report,),
506 0x7679a2f5a42842ef,
507 fidl::encoding::DynamicFlags::empty(),
508 _decode,
509 )
510 }
511
512 type GetInputReportResponseFut = fidl::client::QueryResponseFut<
513 InputDeviceGetInputReportResult,
514 fidl::encoding::DefaultFuchsiaResourceDialect,
515 >;
516 fn r#get_input_report(&self, mut device_type: DeviceType) -> Self::GetInputReportResponseFut {
517 fn _decode(
518 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
519 ) -> Result<InputDeviceGetInputReportResult, fidl::Error> {
520 let _response = fidl::client::decode_transaction_body::<
521 fidl::encoding::ResultType<InputDeviceGetInputReportResponse, i32>,
522 fidl::encoding::DefaultFuchsiaResourceDialect,
523 0x4752ccab96c10248,
524 >(_buf?)?;
525 Ok(_response.map(|x| x.report))
526 }
527 self.client.send_query_and_decode::<
528 InputDeviceGetInputReportRequest,
529 InputDeviceGetInputReportResult,
530 >(
531 (device_type,),
532 0x4752ccab96c10248,
533 fidl::encoding::DynamicFlags::empty(),
534 _decode,
535 )
536 }
537}
538
539pub struct InputDeviceEventStream {
540 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
541}
542
543impl std::marker::Unpin for InputDeviceEventStream {}
544
545impl futures::stream::FusedStream for InputDeviceEventStream {
546 fn is_terminated(&self) -> bool {
547 self.event_receiver.is_terminated()
548 }
549}
550
551impl futures::Stream for InputDeviceEventStream {
552 type Item = Result<InputDeviceEvent, fidl::Error>;
553
554 fn poll_next(
555 mut self: std::pin::Pin<&mut Self>,
556 cx: &mut std::task::Context<'_>,
557 ) -> std::task::Poll<Option<Self::Item>> {
558 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
559 &mut self.event_receiver,
560 cx
561 )?) {
562 Some(buf) => std::task::Poll::Ready(Some(InputDeviceEvent::decode(buf))),
563 None => std::task::Poll::Ready(None),
564 }
565 }
566}
567
568#[derive(Debug)]
569pub enum InputDeviceEvent {
570 #[non_exhaustive]
571 _UnknownEvent {
572 ordinal: u64,
574 },
575}
576
577impl InputDeviceEvent {
578 fn decode(
580 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
581 ) -> Result<InputDeviceEvent, fidl::Error> {
582 let (bytes, _handles) = buf.split_mut();
583 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
584 debug_assert_eq!(tx_header.tx_id, 0);
585 match tx_header.ordinal {
586 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
587 Ok(InputDeviceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
588 }
589 _ => Err(fidl::Error::UnknownOrdinal {
590 ordinal: tx_header.ordinal,
591 protocol_name: <InputDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
592 }),
593 }
594 }
595}
596
597pub struct InputDeviceRequestStream {
599 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
600 is_terminated: bool,
601}
602
603impl std::marker::Unpin for InputDeviceRequestStream {}
604
605impl futures::stream::FusedStream for InputDeviceRequestStream {
606 fn is_terminated(&self) -> bool {
607 self.is_terminated
608 }
609}
610
611impl fidl::endpoints::RequestStream for InputDeviceRequestStream {
612 type Protocol = InputDeviceMarker;
613 type ControlHandle = InputDeviceControlHandle;
614
615 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
616 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
617 }
618
619 fn control_handle(&self) -> Self::ControlHandle {
620 InputDeviceControlHandle { inner: self.inner.clone() }
621 }
622
623 fn into_inner(
624 self,
625 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
626 {
627 (self.inner, self.is_terminated)
628 }
629
630 fn from_inner(
631 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
632 is_terminated: bool,
633 ) -> Self {
634 Self { inner, is_terminated }
635 }
636}
637
638impl futures::Stream for InputDeviceRequestStream {
639 type Item = Result<InputDeviceRequest, fidl::Error>;
640
641 fn poll_next(
642 mut self: std::pin::Pin<&mut Self>,
643 cx: &mut std::task::Context<'_>,
644 ) -> std::task::Poll<Option<Self::Item>> {
645 let this = &mut *self;
646 if this.inner.check_shutdown(cx) {
647 this.is_terminated = true;
648 return std::task::Poll::Ready(None);
649 }
650 if this.is_terminated {
651 panic!("polled InputDeviceRequestStream after completion");
652 }
653 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
654 |bytes, handles| {
655 match this.inner.channel().read_etc(cx, bytes, handles) {
656 std::task::Poll::Ready(Ok(())) => {}
657 std::task::Poll::Pending => return std::task::Poll::Pending,
658 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
659 this.is_terminated = true;
660 return std::task::Poll::Ready(None);
661 }
662 std::task::Poll::Ready(Err(e)) => {
663 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
664 e.into(),
665 ))));
666 }
667 }
668
669 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
671
672 std::task::Poll::Ready(Some(match header.ordinal {
673 0x68d9cf83e397ab41 => {
674 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
675 let mut req = fidl::new_empty!(
676 InputDeviceGetInputReportsReaderRequest,
677 fidl::encoding::DefaultFuchsiaResourceDialect
678 );
679 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InputDeviceGetInputReportsReaderRequest>(&header, _body_bytes, handles, &mut req)?;
680 let control_handle = InputDeviceControlHandle { inner: this.inner.clone() };
681 Ok(InputDeviceRequest::GetInputReportsReader {
682 reader: req.reader,
683
684 control_handle,
685 })
686 }
687 0x3d76420f2ff8ad32 => {
688 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
689 let mut req = fidl::new_empty!(
690 fidl::encoding::EmptyPayload,
691 fidl::encoding::DefaultFuchsiaResourceDialect
692 );
693 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
694 let control_handle = InputDeviceControlHandle { inner: this.inner.clone() };
695 Ok(InputDeviceRequest::GetDescriptor {
696 responder: InputDeviceGetDescriptorResponder {
697 control_handle: std::mem::ManuallyDrop::new(control_handle),
698 tx_id: header.tx_id,
699 },
700 })
701 }
702 0x67a4888774e6f3a => {
703 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
704 let mut req = fidl::new_empty!(
705 InputDeviceSendOutputReportRequest,
706 fidl::encoding::DefaultFuchsiaResourceDialect
707 );
708 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InputDeviceSendOutputReportRequest>(&header, _body_bytes, handles, &mut req)?;
709 let control_handle = InputDeviceControlHandle { inner: this.inner.clone() };
710 Ok(InputDeviceRequest::SendOutputReport {
711 report: req.report,
712
713 responder: InputDeviceSendOutputReportResponder {
714 control_handle: std::mem::ManuallyDrop::new(control_handle),
715 tx_id: header.tx_id,
716 },
717 })
718 }
719 0x497a7d98d9391f16 => {
720 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
721 let mut req = fidl::new_empty!(
722 fidl::encoding::EmptyPayload,
723 fidl::encoding::DefaultFuchsiaResourceDialect
724 );
725 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
726 let control_handle = InputDeviceControlHandle { inner: this.inner.clone() };
727 Ok(InputDeviceRequest::GetFeatureReport {
728 responder: InputDeviceGetFeatureReportResponder {
729 control_handle: std::mem::ManuallyDrop::new(control_handle),
730 tx_id: header.tx_id,
731 },
732 })
733 }
734 0x7679a2f5a42842ef => {
735 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
736 let mut req = fidl::new_empty!(
737 InputDeviceSetFeatureReportRequest,
738 fidl::encoding::DefaultFuchsiaResourceDialect
739 );
740 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InputDeviceSetFeatureReportRequest>(&header, _body_bytes, handles, &mut req)?;
741 let control_handle = InputDeviceControlHandle { inner: this.inner.clone() };
742 Ok(InputDeviceRequest::SetFeatureReport {
743 report: req.report,
744
745 responder: InputDeviceSetFeatureReportResponder {
746 control_handle: std::mem::ManuallyDrop::new(control_handle),
747 tx_id: header.tx_id,
748 },
749 })
750 }
751 0x4752ccab96c10248 => {
752 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
753 let mut req = fidl::new_empty!(
754 InputDeviceGetInputReportRequest,
755 fidl::encoding::DefaultFuchsiaResourceDialect
756 );
757 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InputDeviceGetInputReportRequest>(&header, _body_bytes, handles, &mut req)?;
758 let control_handle = InputDeviceControlHandle { inner: this.inner.clone() };
759 Ok(InputDeviceRequest::GetInputReport {
760 device_type: req.device_type,
761
762 responder: InputDeviceGetInputReportResponder {
763 control_handle: std::mem::ManuallyDrop::new(control_handle),
764 tx_id: header.tx_id,
765 },
766 })
767 }
768 _ if header.tx_id == 0
769 && header
770 .dynamic_flags()
771 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
772 {
773 Ok(InputDeviceRequest::_UnknownMethod {
774 ordinal: header.ordinal,
775 control_handle: InputDeviceControlHandle { inner: this.inner.clone() },
776 method_type: fidl::MethodType::OneWay,
777 })
778 }
779 _ if header
780 .dynamic_flags()
781 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
782 {
783 this.inner.send_framework_err(
784 fidl::encoding::FrameworkErr::UnknownMethod,
785 header.tx_id,
786 header.ordinal,
787 header.dynamic_flags(),
788 (bytes, handles),
789 )?;
790 Ok(InputDeviceRequest::_UnknownMethod {
791 ordinal: header.ordinal,
792 control_handle: InputDeviceControlHandle { inner: this.inner.clone() },
793 method_type: fidl::MethodType::TwoWay,
794 })
795 }
796 _ => Err(fidl::Error::UnknownOrdinal {
797 ordinal: header.ordinal,
798 protocol_name:
799 <InputDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
800 }),
801 }))
802 },
803 )
804 }
805}
806
807#[derive(Debug)]
813pub enum InputDeviceRequest {
814 GetInputReportsReader {
817 reader: fidl::endpoints::ServerEnd<InputReportsReaderMarker>,
818 control_handle: InputDeviceControlHandle,
819 },
820 GetDescriptor { responder: InputDeviceGetDescriptorResponder },
822 SendOutputReport { report: OutputReport, responder: InputDeviceSendOutputReportResponder },
825 GetFeatureReport { responder: InputDeviceGetFeatureReportResponder },
828 SetFeatureReport { report: FeatureReport, responder: InputDeviceSetFeatureReportResponder },
831 GetInputReport { device_type: DeviceType, responder: InputDeviceGetInputReportResponder },
837 #[non_exhaustive]
839 _UnknownMethod {
840 ordinal: u64,
842 control_handle: InputDeviceControlHandle,
843 method_type: fidl::MethodType,
844 },
845}
846
847impl InputDeviceRequest {
848 #[allow(irrefutable_let_patterns)]
849 pub fn into_get_input_reports_reader(
850 self,
851 ) -> Option<(fidl::endpoints::ServerEnd<InputReportsReaderMarker>, InputDeviceControlHandle)>
852 {
853 if let InputDeviceRequest::GetInputReportsReader { reader, control_handle } = self {
854 Some((reader, control_handle))
855 } else {
856 None
857 }
858 }
859
860 #[allow(irrefutable_let_patterns)]
861 pub fn into_get_descriptor(self) -> Option<(InputDeviceGetDescriptorResponder)> {
862 if let InputDeviceRequest::GetDescriptor { responder } = self {
863 Some((responder))
864 } else {
865 None
866 }
867 }
868
869 #[allow(irrefutable_let_patterns)]
870 pub fn into_send_output_report(
871 self,
872 ) -> Option<(OutputReport, InputDeviceSendOutputReportResponder)> {
873 if let InputDeviceRequest::SendOutputReport { report, responder } = self {
874 Some((report, responder))
875 } else {
876 None
877 }
878 }
879
880 #[allow(irrefutable_let_patterns)]
881 pub fn into_get_feature_report(self) -> Option<(InputDeviceGetFeatureReportResponder)> {
882 if let InputDeviceRequest::GetFeatureReport { responder } = self {
883 Some((responder))
884 } else {
885 None
886 }
887 }
888
889 #[allow(irrefutable_let_patterns)]
890 pub fn into_set_feature_report(
891 self,
892 ) -> Option<(FeatureReport, InputDeviceSetFeatureReportResponder)> {
893 if let InputDeviceRequest::SetFeatureReport { report, responder } = self {
894 Some((report, responder))
895 } else {
896 None
897 }
898 }
899
900 #[allow(irrefutable_let_patterns)]
901 pub fn into_get_input_report(self) -> Option<(DeviceType, InputDeviceGetInputReportResponder)> {
902 if let InputDeviceRequest::GetInputReport { device_type, responder } = self {
903 Some((device_type, responder))
904 } else {
905 None
906 }
907 }
908
909 pub fn method_name(&self) -> &'static str {
911 match *self {
912 InputDeviceRequest::GetInputReportsReader { .. } => "get_input_reports_reader",
913 InputDeviceRequest::GetDescriptor { .. } => "get_descriptor",
914 InputDeviceRequest::SendOutputReport { .. } => "send_output_report",
915 InputDeviceRequest::GetFeatureReport { .. } => "get_feature_report",
916 InputDeviceRequest::SetFeatureReport { .. } => "set_feature_report",
917 InputDeviceRequest::GetInputReport { .. } => "get_input_report",
918 InputDeviceRequest::_UnknownMethod {
919 method_type: fidl::MethodType::OneWay, ..
920 } => "unknown one-way method",
921 InputDeviceRequest::_UnknownMethod {
922 method_type: fidl::MethodType::TwoWay, ..
923 } => "unknown two-way method",
924 }
925 }
926}
927
928#[derive(Debug, Clone)]
929pub struct InputDeviceControlHandle {
930 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
931}
932
933impl fidl::endpoints::ControlHandle for InputDeviceControlHandle {
934 fn shutdown(&self) {
935 self.inner.shutdown()
936 }
937
938 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
939 self.inner.shutdown_with_epitaph(status)
940 }
941
942 fn is_closed(&self) -> bool {
943 self.inner.channel().is_closed()
944 }
945 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
946 self.inner.channel().on_closed()
947 }
948
949 #[cfg(target_os = "fuchsia")]
950 fn signal_peer(
951 &self,
952 clear_mask: zx::Signals,
953 set_mask: zx::Signals,
954 ) -> Result<(), zx_status::Status> {
955 use fidl::Peered;
956 self.inner.channel().signal_peer(clear_mask, set_mask)
957 }
958}
959
960impl InputDeviceControlHandle {}
961
962#[must_use = "FIDL methods require a response to be sent"]
963#[derive(Debug)]
964pub struct InputDeviceGetDescriptorResponder {
965 control_handle: std::mem::ManuallyDrop<InputDeviceControlHandle>,
966 tx_id: u32,
967}
968
969impl std::ops::Drop for InputDeviceGetDescriptorResponder {
973 fn drop(&mut self) {
974 self.control_handle.shutdown();
975 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
977 }
978}
979
980impl fidl::endpoints::Responder for InputDeviceGetDescriptorResponder {
981 type ControlHandle = InputDeviceControlHandle;
982
983 fn control_handle(&self) -> &InputDeviceControlHandle {
984 &self.control_handle
985 }
986
987 fn drop_without_shutdown(mut self) {
988 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
990 std::mem::forget(self);
992 }
993}
994
995impl InputDeviceGetDescriptorResponder {
996 pub fn send(self, mut descriptor: &DeviceDescriptor) -> Result<(), fidl::Error> {
1000 let _result = self.send_raw(descriptor);
1001 if _result.is_err() {
1002 self.control_handle.shutdown();
1003 }
1004 self.drop_without_shutdown();
1005 _result
1006 }
1007
1008 pub fn send_no_shutdown_on_err(
1010 self,
1011 mut descriptor: &DeviceDescriptor,
1012 ) -> Result<(), fidl::Error> {
1013 let _result = self.send_raw(descriptor);
1014 self.drop_without_shutdown();
1015 _result
1016 }
1017
1018 fn send_raw(&self, mut descriptor: &DeviceDescriptor) -> Result<(), fidl::Error> {
1019 self.control_handle.inner.send::<InputDeviceGetDescriptorResponse>(
1020 (descriptor,),
1021 self.tx_id,
1022 0x3d76420f2ff8ad32,
1023 fidl::encoding::DynamicFlags::empty(),
1024 )
1025 }
1026}
1027
1028#[must_use = "FIDL methods require a response to be sent"]
1029#[derive(Debug)]
1030pub struct InputDeviceSendOutputReportResponder {
1031 control_handle: std::mem::ManuallyDrop<InputDeviceControlHandle>,
1032 tx_id: u32,
1033}
1034
1035impl std::ops::Drop for InputDeviceSendOutputReportResponder {
1039 fn drop(&mut self) {
1040 self.control_handle.shutdown();
1041 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1043 }
1044}
1045
1046impl fidl::endpoints::Responder for InputDeviceSendOutputReportResponder {
1047 type ControlHandle = InputDeviceControlHandle;
1048
1049 fn control_handle(&self) -> &InputDeviceControlHandle {
1050 &self.control_handle
1051 }
1052
1053 fn drop_without_shutdown(mut self) {
1054 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1056 std::mem::forget(self);
1058 }
1059}
1060
1061impl InputDeviceSendOutputReportResponder {
1062 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1066 let _result = self.send_raw(result);
1067 if _result.is_err() {
1068 self.control_handle.shutdown();
1069 }
1070 self.drop_without_shutdown();
1071 _result
1072 }
1073
1074 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1076 let _result = self.send_raw(result);
1077 self.drop_without_shutdown();
1078 _result
1079 }
1080
1081 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1082 self.control_handle
1083 .inner
1084 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1085 result,
1086 self.tx_id,
1087 0x67a4888774e6f3a,
1088 fidl::encoding::DynamicFlags::empty(),
1089 )
1090 }
1091}
1092
1093#[must_use = "FIDL methods require a response to be sent"]
1094#[derive(Debug)]
1095pub struct InputDeviceGetFeatureReportResponder {
1096 control_handle: std::mem::ManuallyDrop<InputDeviceControlHandle>,
1097 tx_id: u32,
1098}
1099
1100impl std::ops::Drop for InputDeviceGetFeatureReportResponder {
1104 fn drop(&mut self) {
1105 self.control_handle.shutdown();
1106 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1108 }
1109}
1110
1111impl fidl::endpoints::Responder for InputDeviceGetFeatureReportResponder {
1112 type ControlHandle = InputDeviceControlHandle;
1113
1114 fn control_handle(&self) -> &InputDeviceControlHandle {
1115 &self.control_handle
1116 }
1117
1118 fn drop_without_shutdown(mut self) {
1119 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1121 std::mem::forget(self);
1123 }
1124}
1125
1126impl InputDeviceGetFeatureReportResponder {
1127 pub fn send(self, mut result: Result<&FeatureReport, i32>) -> Result<(), fidl::Error> {
1131 let _result = self.send_raw(result);
1132 if _result.is_err() {
1133 self.control_handle.shutdown();
1134 }
1135 self.drop_without_shutdown();
1136 _result
1137 }
1138
1139 pub fn send_no_shutdown_on_err(
1141 self,
1142 mut result: Result<&FeatureReport, i32>,
1143 ) -> Result<(), fidl::Error> {
1144 let _result = self.send_raw(result);
1145 self.drop_without_shutdown();
1146 _result
1147 }
1148
1149 fn send_raw(&self, mut result: Result<&FeatureReport, i32>) -> Result<(), fidl::Error> {
1150 self.control_handle.inner.send::<fidl::encoding::ResultType<
1151 InputDeviceGetFeatureReportResponse,
1152 i32,
1153 >>(
1154 result.map(|report| (report,)),
1155 self.tx_id,
1156 0x497a7d98d9391f16,
1157 fidl::encoding::DynamicFlags::empty(),
1158 )
1159 }
1160}
1161
1162#[must_use = "FIDL methods require a response to be sent"]
1163#[derive(Debug)]
1164pub struct InputDeviceSetFeatureReportResponder {
1165 control_handle: std::mem::ManuallyDrop<InputDeviceControlHandle>,
1166 tx_id: u32,
1167}
1168
1169impl std::ops::Drop for InputDeviceSetFeatureReportResponder {
1173 fn drop(&mut self) {
1174 self.control_handle.shutdown();
1175 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1177 }
1178}
1179
1180impl fidl::endpoints::Responder for InputDeviceSetFeatureReportResponder {
1181 type ControlHandle = InputDeviceControlHandle;
1182
1183 fn control_handle(&self) -> &InputDeviceControlHandle {
1184 &self.control_handle
1185 }
1186
1187 fn drop_without_shutdown(mut self) {
1188 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1190 std::mem::forget(self);
1192 }
1193}
1194
1195impl InputDeviceSetFeatureReportResponder {
1196 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1200 let _result = self.send_raw(result);
1201 if _result.is_err() {
1202 self.control_handle.shutdown();
1203 }
1204 self.drop_without_shutdown();
1205 _result
1206 }
1207
1208 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1210 let _result = self.send_raw(result);
1211 self.drop_without_shutdown();
1212 _result
1213 }
1214
1215 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1216 self.control_handle
1217 .inner
1218 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1219 result,
1220 self.tx_id,
1221 0x7679a2f5a42842ef,
1222 fidl::encoding::DynamicFlags::empty(),
1223 )
1224 }
1225}
1226
1227#[must_use = "FIDL methods require a response to be sent"]
1228#[derive(Debug)]
1229pub struct InputDeviceGetInputReportResponder {
1230 control_handle: std::mem::ManuallyDrop<InputDeviceControlHandle>,
1231 tx_id: u32,
1232}
1233
1234impl std::ops::Drop for InputDeviceGetInputReportResponder {
1238 fn drop(&mut self) {
1239 self.control_handle.shutdown();
1240 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1242 }
1243}
1244
1245impl fidl::endpoints::Responder for InputDeviceGetInputReportResponder {
1246 type ControlHandle = InputDeviceControlHandle;
1247
1248 fn control_handle(&self) -> &InputDeviceControlHandle {
1249 &self.control_handle
1250 }
1251
1252 fn drop_without_shutdown(mut self) {
1253 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1255 std::mem::forget(self);
1257 }
1258}
1259
1260impl InputDeviceGetInputReportResponder {
1261 pub fn send(self, mut result: Result<InputReport, i32>) -> Result<(), fidl::Error> {
1265 let _result = self.send_raw(result);
1266 if _result.is_err() {
1267 self.control_handle.shutdown();
1268 }
1269 self.drop_without_shutdown();
1270 _result
1271 }
1272
1273 pub fn send_no_shutdown_on_err(
1275 self,
1276 mut result: Result<InputReport, i32>,
1277 ) -> Result<(), fidl::Error> {
1278 let _result = self.send_raw(result);
1279 self.drop_without_shutdown();
1280 _result
1281 }
1282
1283 fn send_raw(&self, mut result: Result<InputReport, i32>) -> Result<(), fidl::Error> {
1284 self.control_handle
1285 .inner
1286 .send::<fidl::encoding::ResultType<InputDeviceGetInputReportResponse, i32>>(
1287 result.as_mut().map_err(|e| *e).map(|report| (report,)),
1288 self.tx_id,
1289 0x4752ccab96c10248,
1290 fidl::encoding::DynamicFlags::empty(),
1291 )
1292 }
1293}
1294
1295#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1296pub struct InputReportsReaderMarker;
1297
1298impl fidl::endpoints::ProtocolMarker for InputReportsReaderMarker {
1299 type Proxy = InputReportsReaderProxy;
1300 type RequestStream = InputReportsReaderRequestStream;
1301 #[cfg(target_os = "fuchsia")]
1302 type SynchronousProxy = InputReportsReaderSynchronousProxy;
1303
1304 const DEBUG_NAME: &'static str = "(anonymous) InputReportsReader";
1305}
1306pub type InputReportsReaderReadInputReportsResult = Result<Vec<InputReport>, i32>;
1307
1308pub trait InputReportsReaderProxyInterface: Send + Sync {
1309 type ReadInputReportsResponseFut: std::future::Future<Output = Result<InputReportsReaderReadInputReportsResult, fidl::Error>>
1310 + Send;
1311 fn r#read_input_reports(&self) -> Self::ReadInputReportsResponseFut;
1312}
1313#[derive(Debug)]
1314#[cfg(target_os = "fuchsia")]
1315pub struct InputReportsReaderSynchronousProxy {
1316 client: fidl::client::sync::Client,
1317}
1318
1319#[cfg(target_os = "fuchsia")]
1320impl fidl::endpoints::SynchronousProxy for InputReportsReaderSynchronousProxy {
1321 type Proxy = InputReportsReaderProxy;
1322 type Protocol = InputReportsReaderMarker;
1323
1324 fn from_channel(inner: fidl::Channel) -> Self {
1325 Self::new(inner)
1326 }
1327
1328 fn into_channel(self) -> fidl::Channel {
1329 self.client.into_channel()
1330 }
1331
1332 fn as_channel(&self) -> &fidl::Channel {
1333 self.client.as_channel()
1334 }
1335}
1336
1337#[cfg(target_os = "fuchsia")]
1338impl InputReportsReaderSynchronousProxy {
1339 pub fn new(channel: fidl::Channel) -> Self {
1340 let protocol_name =
1341 <InputReportsReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1342 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1343 }
1344
1345 pub fn into_channel(self) -> fidl::Channel {
1346 self.client.into_channel()
1347 }
1348
1349 pub fn wait_for_event(
1352 &self,
1353 deadline: zx::MonotonicInstant,
1354 ) -> Result<InputReportsReaderEvent, fidl::Error> {
1355 InputReportsReaderEvent::decode(self.client.wait_for_event(deadline)?)
1356 }
1357
1358 pub fn r#read_input_reports(
1364 &self,
1365 ___deadline: zx::MonotonicInstant,
1366 ) -> Result<InputReportsReaderReadInputReportsResult, fidl::Error> {
1367 let _response =
1368 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1369 InputReportsReaderReadInputReportsResponse,
1370 i32,
1371 >>(
1372 (),
1373 0x3595efdc88842559,
1374 fidl::encoding::DynamicFlags::empty(),
1375 ___deadline,
1376 )?;
1377 Ok(_response.map(|x| x.reports))
1378 }
1379}
1380
1381#[cfg(target_os = "fuchsia")]
1382impl From<InputReportsReaderSynchronousProxy> for zx::NullableHandle {
1383 fn from(value: InputReportsReaderSynchronousProxy) -> Self {
1384 value.into_channel().into()
1385 }
1386}
1387
1388#[cfg(target_os = "fuchsia")]
1389impl From<fidl::Channel> for InputReportsReaderSynchronousProxy {
1390 fn from(value: fidl::Channel) -> Self {
1391 Self::new(value)
1392 }
1393}
1394
1395#[cfg(target_os = "fuchsia")]
1396impl fidl::endpoints::FromClient for InputReportsReaderSynchronousProxy {
1397 type Protocol = InputReportsReaderMarker;
1398
1399 fn from_client(value: fidl::endpoints::ClientEnd<InputReportsReaderMarker>) -> Self {
1400 Self::new(value.into_channel())
1401 }
1402}
1403
1404#[derive(Debug, Clone)]
1405pub struct InputReportsReaderProxy {
1406 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1407}
1408
1409impl fidl::endpoints::Proxy for InputReportsReaderProxy {
1410 type Protocol = InputReportsReaderMarker;
1411
1412 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1413 Self::new(inner)
1414 }
1415
1416 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1417 self.client.into_channel().map_err(|client| Self { client })
1418 }
1419
1420 fn as_channel(&self) -> &::fidl::AsyncChannel {
1421 self.client.as_channel()
1422 }
1423}
1424
1425impl InputReportsReaderProxy {
1426 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1428 let protocol_name =
1429 <InputReportsReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1430 Self { client: fidl::client::Client::new(channel, protocol_name) }
1431 }
1432
1433 pub fn take_event_stream(&self) -> InputReportsReaderEventStream {
1439 InputReportsReaderEventStream { event_receiver: self.client.take_event_receiver() }
1440 }
1441
1442 pub fn r#read_input_reports(
1448 &self,
1449 ) -> fidl::client::QueryResponseFut<
1450 InputReportsReaderReadInputReportsResult,
1451 fidl::encoding::DefaultFuchsiaResourceDialect,
1452 > {
1453 InputReportsReaderProxyInterface::r#read_input_reports(self)
1454 }
1455}
1456
1457impl InputReportsReaderProxyInterface for InputReportsReaderProxy {
1458 type ReadInputReportsResponseFut = fidl::client::QueryResponseFut<
1459 InputReportsReaderReadInputReportsResult,
1460 fidl::encoding::DefaultFuchsiaResourceDialect,
1461 >;
1462 fn r#read_input_reports(&self) -> Self::ReadInputReportsResponseFut {
1463 fn _decode(
1464 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1465 ) -> Result<InputReportsReaderReadInputReportsResult, fidl::Error> {
1466 let _response = fidl::client::decode_transaction_body::<
1467 fidl::encoding::ResultType<InputReportsReaderReadInputReportsResponse, i32>,
1468 fidl::encoding::DefaultFuchsiaResourceDialect,
1469 0x3595efdc88842559,
1470 >(_buf?)?;
1471 Ok(_response.map(|x| x.reports))
1472 }
1473 self.client.send_query_and_decode::<
1474 fidl::encoding::EmptyPayload,
1475 InputReportsReaderReadInputReportsResult,
1476 >(
1477 (),
1478 0x3595efdc88842559,
1479 fidl::encoding::DynamicFlags::empty(),
1480 _decode,
1481 )
1482 }
1483}
1484
1485pub struct InputReportsReaderEventStream {
1486 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1487}
1488
1489impl std::marker::Unpin for InputReportsReaderEventStream {}
1490
1491impl futures::stream::FusedStream for InputReportsReaderEventStream {
1492 fn is_terminated(&self) -> bool {
1493 self.event_receiver.is_terminated()
1494 }
1495}
1496
1497impl futures::Stream for InputReportsReaderEventStream {
1498 type Item = Result<InputReportsReaderEvent, fidl::Error>;
1499
1500 fn poll_next(
1501 mut self: std::pin::Pin<&mut Self>,
1502 cx: &mut std::task::Context<'_>,
1503 ) -> std::task::Poll<Option<Self::Item>> {
1504 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1505 &mut self.event_receiver,
1506 cx
1507 )?) {
1508 Some(buf) => std::task::Poll::Ready(Some(InputReportsReaderEvent::decode(buf))),
1509 None => std::task::Poll::Ready(None),
1510 }
1511 }
1512}
1513
1514#[derive(Debug)]
1515pub enum InputReportsReaderEvent {}
1516
1517impl InputReportsReaderEvent {
1518 fn decode(
1520 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1521 ) -> Result<InputReportsReaderEvent, fidl::Error> {
1522 let (bytes, _handles) = buf.split_mut();
1523 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1524 debug_assert_eq!(tx_header.tx_id, 0);
1525 match tx_header.ordinal {
1526 _ => Err(fidl::Error::UnknownOrdinal {
1527 ordinal: tx_header.ordinal,
1528 protocol_name:
1529 <InputReportsReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1530 }),
1531 }
1532 }
1533}
1534
1535pub struct InputReportsReaderRequestStream {
1537 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1538 is_terminated: bool,
1539}
1540
1541impl std::marker::Unpin for InputReportsReaderRequestStream {}
1542
1543impl futures::stream::FusedStream for InputReportsReaderRequestStream {
1544 fn is_terminated(&self) -> bool {
1545 self.is_terminated
1546 }
1547}
1548
1549impl fidl::endpoints::RequestStream for InputReportsReaderRequestStream {
1550 type Protocol = InputReportsReaderMarker;
1551 type ControlHandle = InputReportsReaderControlHandle;
1552
1553 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1554 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1555 }
1556
1557 fn control_handle(&self) -> Self::ControlHandle {
1558 InputReportsReaderControlHandle { inner: self.inner.clone() }
1559 }
1560
1561 fn into_inner(
1562 self,
1563 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1564 {
1565 (self.inner, self.is_terminated)
1566 }
1567
1568 fn from_inner(
1569 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1570 is_terminated: bool,
1571 ) -> Self {
1572 Self { inner, is_terminated }
1573 }
1574}
1575
1576impl futures::Stream for InputReportsReaderRequestStream {
1577 type Item = Result<InputReportsReaderRequest, fidl::Error>;
1578
1579 fn poll_next(
1580 mut self: std::pin::Pin<&mut Self>,
1581 cx: &mut std::task::Context<'_>,
1582 ) -> std::task::Poll<Option<Self::Item>> {
1583 let this = &mut *self;
1584 if this.inner.check_shutdown(cx) {
1585 this.is_terminated = true;
1586 return std::task::Poll::Ready(None);
1587 }
1588 if this.is_terminated {
1589 panic!("polled InputReportsReaderRequestStream after completion");
1590 }
1591 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1592 |bytes, handles| {
1593 match this.inner.channel().read_etc(cx, bytes, handles) {
1594 std::task::Poll::Ready(Ok(())) => {}
1595 std::task::Poll::Pending => return std::task::Poll::Pending,
1596 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1597 this.is_terminated = true;
1598 return std::task::Poll::Ready(None);
1599 }
1600 std::task::Poll::Ready(Err(e)) => {
1601 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1602 e.into(),
1603 ))));
1604 }
1605 }
1606
1607 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1609
1610 std::task::Poll::Ready(Some(match header.ordinal {
1611 0x3595efdc88842559 => {
1612 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1613 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1614 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1615 let control_handle = InputReportsReaderControlHandle {
1616 inner: this.inner.clone(),
1617 };
1618 Ok(InputReportsReaderRequest::ReadInputReports {
1619 responder: InputReportsReaderReadInputReportsResponder {
1620 control_handle: std::mem::ManuallyDrop::new(control_handle),
1621 tx_id: header.tx_id,
1622 },
1623 })
1624 }
1625 _ => Err(fidl::Error::UnknownOrdinal {
1626 ordinal: header.ordinal,
1627 protocol_name: <InputReportsReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1628 }),
1629 }))
1630 },
1631 )
1632 }
1633}
1634
1635#[derive(Debug)]
1640pub enum InputReportsReaderRequest {
1641 ReadInputReports { responder: InputReportsReaderReadInputReportsResponder },
1647}
1648
1649impl InputReportsReaderRequest {
1650 #[allow(irrefutable_let_patterns)]
1651 pub fn into_read_input_reports(self) -> Option<(InputReportsReaderReadInputReportsResponder)> {
1652 if let InputReportsReaderRequest::ReadInputReports { responder } = self {
1653 Some((responder))
1654 } else {
1655 None
1656 }
1657 }
1658
1659 pub fn method_name(&self) -> &'static str {
1661 match *self {
1662 InputReportsReaderRequest::ReadInputReports { .. } => "read_input_reports",
1663 }
1664 }
1665}
1666
1667#[derive(Debug, Clone)]
1668pub struct InputReportsReaderControlHandle {
1669 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1670}
1671
1672impl fidl::endpoints::ControlHandle for InputReportsReaderControlHandle {
1673 fn shutdown(&self) {
1674 self.inner.shutdown()
1675 }
1676
1677 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1678 self.inner.shutdown_with_epitaph(status)
1679 }
1680
1681 fn is_closed(&self) -> bool {
1682 self.inner.channel().is_closed()
1683 }
1684 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1685 self.inner.channel().on_closed()
1686 }
1687
1688 #[cfg(target_os = "fuchsia")]
1689 fn signal_peer(
1690 &self,
1691 clear_mask: zx::Signals,
1692 set_mask: zx::Signals,
1693 ) -> Result<(), zx_status::Status> {
1694 use fidl::Peered;
1695 self.inner.channel().signal_peer(clear_mask, set_mask)
1696 }
1697}
1698
1699impl InputReportsReaderControlHandle {}
1700
1701#[must_use = "FIDL methods require a response to be sent"]
1702#[derive(Debug)]
1703pub struct InputReportsReaderReadInputReportsResponder {
1704 control_handle: std::mem::ManuallyDrop<InputReportsReaderControlHandle>,
1705 tx_id: u32,
1706}
1707
1708impl std::ops::Drop for InputReportsReaderReadInputReportsResponder {
1712 fn drop(&mut self) {
1713 self.control_handle.shutdown();
1714 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1716 }
1717}
1718
1719impl fidl::endpoints::Responder for InputReportsReaderReadInputReportsResponder {
1720 type ControlHandle = InputReportsReaderControlHandle;
1721
1722 fn control_handle(&self) -> &InputReportsReaderControlHandle {
1723 &self.control_handle
1724 }
1725
1726 fn drop_without_shutdown(mut self) {
1727 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1729 std::mem::forget(self);
1731 }
1732}
1733
1734impl InputReportsReaderReadInputReportsResponder {
1735 pub fn send(self, mut result: Result<Vec<InputReport>, i32>) -> Result<(), fidl::Error> {
1739 let _result = self.send_raw(result);
1740 if _result.is_err() {
1741 self.control_handle.shutdown();
1742 }
1743 self.drop_without_shutdown();
1744 _result
1745 }
1746
1747 pub fn send_no_shutdown_on_err(
1749 self,
1750 mut result: Result<Vec<InputReport>, i32>,
1751 ) -> Result<(), fidl::Error> {
1752 let _result = self.send_raw(result);
1753 self.drop_without_shutdown();
1754 _result
1755 }
1756
1757 fn send_raw(&self, mut result: Result<Vec<InputReport>, i32>) -> Result<(), fidl::Error> {
1758 self.control_handle.inner.send::<fidl::encoding::ResultType<
1759 InputReportsReaderReadInputReportsResponse,
1760 i32,
1761 >>(
1762 result.as_mut().map_err(|e| *e).map(|reports| (reports.as_mut_slice(),)),
1763 self.tx_id,
1764 0x3595efdc88842559,
1765 fidl::encoding::DynamicFlags::empty(),
1766 )
1767 }
1768}
1769
1770#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1771pub struct ServiceMarker;
1772
1773#[cfg(target_os = "fuchsia")]
1774impl fidl::endpoints::ServiceMarker for ServiceMarker {
1775 type Proxy = ServiceProxy;
1776 type Request = ServiceRequest;
1777 const SERVICE_NAME: &'static str = "fuchsia.input.report.Service";
1778}
1779
1780#[cfg(target_os = "fuchsia")]
1783pub enum ServiceRequest {
1784 InputDevice(InputDeviceRequestStream),
1785}
1786
1787#[cfg(target_os = "fuchsia")]
1788impl fidl::endpoints::ServiceRequest for ServiceRequest {
1789 type Service = ServiceMarker;
1790
1791 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
1792 match name {
1793 "input_device" => Self::InputDevice(
1794 <InputDeviceRequestStream as fidl::endpoints::RequestStream>::from_channel(
1795 _channel,
1796 ),
1797 ),
1798 _ => panic!("no such member protocol name for service Service"),
1799 }
1800 }
1801
1802 fn member_names() -> &'static [&'static str] {
1803 &["input_device"]
1804 }
1805}
1806#[cfg(target_os = "fuchsia")]
1807pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
1808
1809#[cfg(target_os = "fuchsia")]
1810impl fidl::endpoints::ServiceProxy for ServiceProxy {
1811 type Service = ServiceMarker;
1812
1813 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
1814 Self(opener)
1815 }
1816}
1817
1818#[cfg(target_os = "fuchsia")]
1819impl ServiceProxy {
1820 pub fn connect_to_input_device(&self) -> Result<InputDeviceProxy, fidl::Error> {
1821 let (proxy, server_end) = fidl::endpoints::create_proxy::<InputDeviceMarker>();
1822 self.connect_channel_to_input_device(server_end)?;
1823 Ok(proxy)
1824 }
1825
1826 pub fn connect_to_input_device_sync(&self) -> Result<InputDeviceSynchronousProxy, fidl::Error> {
1829 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<InputDeviceMarker>();
1830 self.connect_channel_to_input_device(server_end)?;
1831 Ok(proxy)
1832 }
1833
1834 pub fn connect_channel_to_input_device(
1837 &self,
1838 server_end: fidl::endpoints::ServerEnd<InputDeviceMarker>,
1839 ) -> Result<(), fidl::Error> {
1840 self.0.open_member("input_device", server_end.into_channel())
1841 }
1842
1843 pub fn instance_name(&self) -> &str {
1844 self.0.instance_name()
1845 }
1846}
1847
1848mod internal {
1849 use super::*;
1850
1851 impl fidl::encoding::ResourceTypeMarker for InputDeviceGetInputReportsReaderRequest {
1852 type Borrowed<'a> = &'a mut Self;
1853 fn take_or_borrow<'a>(
1854 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1855 ) -> Self::Borrowed<'a> {
1856 value
1857 }
1858 }
1859
1860 unsafe impl fidl::encoding::TypeMarker for InputDeviceGetInputReportsReaderRequest {
1861 type Owned = Self;
1862
1863 #[inline(always)]
1864 fn inline_align(_context: fidl::encoding::Context) -> usize {
1865 4
1866 }
1867
1868 #[inline(always)]
1869 fn inline_size(_context: fidl::encoding::Context) -> usize {
1870 4
1871 }
1872 }
1873
1874 unsafe impl
1875 fidl::encoding::Encode<
1876 InputDeviceGetInputReportsReaderRequest,
1877 fidl::encoding::DefaultFuchsiaResourceDialect,
1878 > for &mut InputDeviceGetInputReportsReaderRequest
1879 {
1880 #[inline]
1881 unsafe fn encode(
1882 self,
1883 encoder: &mut fidl::encoding::Encoder<
1884 '_,
1885 fidl::encoding::DefaultFuchsiaResourceDialect,
1886 >,
1887 offset: usize,
1888 _depth: fidl::encoding::Depth,
1889 ) -> fidl::Result<()> {
1890 encoder.debug_check_bounds::<InputDeviceGetInputReportsReaderRequest>(offset);
1891 fidl::encoding::Encode::<InputDeviceGetInputReportsReaderRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1893 (
1894 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<InputReportsReaderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.reader),
1895 ),
1896 encoder, offset, _depth
1897 )
1898 }
1899 }
1900 unsafe impl<
1901 T0: fidl::encoding::Encode<
1902 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<InputReportsReaderMarker>>,
1903 fidl::encoding::DefaultFuchsiaResourceDialect,
1904 >,
1905 >
1906 fidl::encoding::Encode<
1907 InputDeviceGetInputReportsReaderRequest,
1908 fidl::encoding::DefaultFuchsiaResourceDialect,
1909 > for (T0,)
1910 {
1911 #[inline]
1912 unsafe fn encode(
1913 self,
1914 encoder: &mut fidl::encoding::Encoder<
1915 '_,
1916 fidl::encoding::DefaultFuchsiaResourceDialect,
1917 >,
1918 offset: usize,
1919 depth: fidl::encoding::Depth,
1920 ) -> fidl::Result<()> {
1921 encoder.debug_check_bounds::<InputDeviceGetInputReportsReaderRequest>(offset);
1922 self.0.encode(encoder, offset + 0, depth)?;
1926 Ok(())
1927 }
1928 }
1929
1930 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1931 for InputDeviceGetInputReportsReaderRequest
1932 {
1933 #[inline(always)]
1934 fn new_empty() -> Self {
1935 Self {
1936 reader: fidl::new_empty!(
1937 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<InputReportsReaderMarker>>,
1938 fidl::encoding::DefaultFuchsiaResourceDialect
1939 ),
1940 }
1941 }
1942
1943 #[inline]
1944 unsafe fn decode(
1945 &mut self,
1946 decoder: &mut fidl::encoding::Decoder<
1947 '_,
1948 fidl::encoding::DefaultFuchsiaResourceDialect,
1949 >,
1950 offset: usize,
1951 _depth: fidl::encoding::Depth,
1952 ) -> fidl::Result<()> {
1953 decoder.debug_check_bounds::<Self>(offset);
1954 fidl::decode!(
1956 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<InputReportsReaderMarker>>,
1957 fidl::encoding::DefaultFuchsiaResourceDialect,
1958 &mut self.reader,
1959 decoder,
1960 offset + 0,
1961 _depth
1962 )?;
1963 Ok(())
1964 }
1965 }
1966
1967 impl fidl::encoding::ResourceTypeMarker for InputDeviceGetInputReportResponse {
1968 type Borrowed<'a> = &'a mut Self;
1969 fn take_or_borrow<'a>(
1970 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1971 ) -> Self::Borrowed<'a> {
1972 value
1973 }
1974 }
1975
1976 unsafe impl fidl::encoding::TypeMarker for InputDeviceGetInputReportResponse {
1977 type Owned = Self;
1978
1979 #[inline(always)]
1980 fn inline_align(_context: fidl::encoding::Context) -> usize {
1981 8
1982 }
1983
1984 #[inline(always)]
1985 fn inline_size(_context: fidl::encoding::Context) -> usize {
1986 16
1987 }
1988 }
1989
1990 unsafe impl
1991 fidl::encoding::Encode<
1992 InputDeviceGetInputReportResponse,
1993 fidl::encoding::DefaultFuchsiaResourceDialect,
1994 > for &mut InputDeviceGetInputReportResponse
1995 {
1996 #[inline]
1997 unsafe fn encode(
1998 self,
1999 encoder: &mut fidl::encoding::Encoder<
2000 '_,
2001 fidl::encoding::DefaultFuchsiaResourceDialect,
2002 >,
2003 offset: usize,
2004 _depth: fidl::encoding::Depth,
2005 ) -> fidl::Result<()> {
2006 encoder.debug_check_bounds::<InputDeviceGetInputReportResponse>(offset);
2007 fidl::encoding::Encode::<
2009 InputDeviceGetInputReportResponse,
2010 fidl::encoding::DefaultFuchsiaResourceDialect,
2011 >::encode(
2012 (<InputReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2013 &mut self.report,
2014 ),),
2015 encoder,
2016 offset,
2017 _depth,
2018 )
2019 }
2020 }
2021 unsafe impl<
2022 T0: fidl::encoding::Encode<InputReport, fidl::encoding::DefaultFuchsiaResourceDialect>,
2023 >
2024 fidl::encoding::Encode<
2025 InputDeviceGetInputReportResponse,
2026 fidl::encoding::DefaultFuchsiaResourceDialect,
2027 > for (T0,)
2028 {
2029 #[inline]
2030 unsafe fn encode(
2031 self,
2032 encoder: &mut fidl::encoding::Encoder<
2033 '_,
2034 fidl::encoding::DefaultFuchsiaResourceDialect,
2035 >,
2036 offset: usize,
2037 depth: fidl::encoding::Depth,
2038 ) -> fidl::Result<()> {
2039 encoder.debug_check_bounds::<InputDeviceGetInputReportResponse>(offset);
2040 self.0.encode(encoder, offset + 0, depth)?;
2044 Ok(())
2045 }
2046 }
2047
2048 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2049 for InputDeviceGetInputReportResponse
2050 {
2051 #[inline(always)]
2052 fn new_empty() -> Self {
2053 Self {
2054 report: fidl::new_empty!(
2055 InputReport,
2056 fidl::encoding::DefaultFuchsiaResourceDialect
2057 ),
2058 }
2059 }
2060
2061 #[inline]
2062 unsafe fn decode(
2063 &mut self,
2064 decoder: &mut fidl::encoding::Decoder<
2065 '_,
2066 fidl::encoding::DefaultFuchsiaResourceDialect,
2067 >,
2068 offset: usize,
2069 _depth: fidl::encoding::Depth,
2070 ) -> fidl::Result<()> {
2071 decoder.debug_check_bounds::<Self>(offset);
2072 fidl::decode!(
2074 InputReport,
2075 fidl::encoding::DefaultFuchsiaResourceDialect,
2076 &mut self.report,
2077 decoder,
2078 offset + 0,
2079 _depth
2080 )?;
2081 Ok(())
2082 }
2083 }
2084
2085 impl fidl::encoding::ResourceTypeMarker for InputReportsReaderReadInputReportsResponse {
2086 type Borrowed<'a> = &'a mut Self;
2087 fn take_or_borrow<'a>(
2088 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2089 ) -> Self::Borrowed<'a> {
2090 value
2091 }
2092 }
2093
2094 unsafe impl fidl::encoding::TypeMarker for InputReportsReaderReadInputReportsResponse {
2095 type Owned = Self;
2096
2097 #[inline(always)]
2098 fn inline_align(_context: fidl::encoding::Context) -> usize {
2099 8
2100 }
2101
2102 #[inline(always)]
2103 fn inline_size(_context: fidl::encoding::Context) -> usize {
2104 16
2105 }
2106 }
2107
2108 unsafe impl
2109 fidl::encoding::Encode<
2110 InputReportsReaderReadInputReportsResponse,
2111 fidl::encoding::DefaultFuchsiaResourceDialect,
2112 > for &mut InputReportsReaderReadInputReportsResponse
2113 {
2114 #[inline]
2115 unsafe fn encode(
2116 self,
2117 encoder: &mut fidl::encoding::Encoder<
2118 '_,
2119 fidl::encoding::DefaultFuchsiaResourceDialect,
2120 >,
2121 offset: usize,
2122 _depth: fidl::encoding::Depth,
2123 ) -> fidl::Result<()> {
2124 encoder.debug_check_bounds::<InputReportsReaderReadInputReportsResponse>(offset);
2125 fidl::encoding::Encode::<InputReportsReaderReadInputReportsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2127 (
2128 <fidl::encoding::Vector<InputReport, 50> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.reports),
2129 ),
2130 encoder, offset, _depth
2131 )
2132 }
2133 }
2134 unsafe impl<
2135 T0: fidl::encoding::Encode<
2136 fidl::encoding::Vector<InputReport, 50>,
2137 fidl::encoding::DefaultFuchsiaResourceDialect,
2138 >,
2139 >
2140 fidl::encoding::Encode<
2141 InputReportsReaderReadInputReportsResponse,
2142 fidl::encoding::DefaultFuchsiaResourceDialect,
2143 > for (T0,)
2144 {
2145 #[inline]
2146 unsafe fn encode(
2147 self,
2148 encoder: &mut fidl::encoding::Encoder<
2149 '_,
2150 fidl::encoding::DefaultFuchsiaResourceDialect,
2151 >,
2152 offset: usize,
2153 depth: fidl::encoding::Depth,
2154 ) -> fidl::Result<()> {
2155 encoder.debug_check_bounds::<InputReportsReaderReadInputReportsResponse>(offset);
2156 self.0.encode(encoder, offset + 0, depth)?;
2160 Ok(())
2161 }
2162 }
2163
2164 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2165 for InputReportsReaderReadInputReportsResponse
2166 {
2167 #[inline(always)]
2168 fn new_empty() -> Self {
2169 Self {
2170 reports: fidl::new_empty!(fidl::encoding::Vector<InputReport, 50>, fidl::encoding::DefaultFuchsiaResourceDialect),
2171 }
2172 }
2173
2174 #[inline]
2175 unsafe fn decode(
2176 &mut self,
2177 decoder: &mut fidl::encoding::Decoder<
2178 '_,
2179 fidl::encoding::DefaultFuchsiaResourceDialect,
2180 >,
2181 offset: usize,
2182 _depth: fidl::encoding::Depth,
2183 ) -> fidl::Result<()> {
2184 decoder.debug_check_bounds::<Self>(offset);
2185 fidl::decode!(fidl::encoding::Vector<InputReport, 50>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.reports, decoder, offset + 0, _depth)?;
2187 Ok(())
2188 }
2189 }
2190
2191 impl InputReport {
2192 #[inline(always)]
2193 fn max_ordinal_present(&self) -> u64 {
2194 if let Some(_) = self.wake_lease {
2195 return 9;
2196 }
2197 if let Some(_) = self.report_id {
2198 return 8;
2199 }
2200 if let Some(_) = self.trace_id {
2201 return 7;
2202 }
2203 if let Some(_) = self.consumer_control {
2204 return 6;
2205 }
2206 if let Some(_) = self.keyboard {
2207 return 5;
2208 }
2209 if let Some(_) = self.touch {
2210 return 4;
2211 }
2212 if let Some(_) = self.sensor {
2213 return 3;
2214 }
2215 if let Some(_) = self.mouse {
2216 return 2;
2217 }
2218 if let Some(_) = self.event_time {
2219 return 1;
2220 }
2221 0
2222 }
2223 }
2224
2225 impl fidl::encoding::ResourceTypeMarker for InputReport {
2226 type Borrowed<'a> = &'a mut Self;
2227 fn take_or_borrow<'a>(
2228 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2229 ) -> Self::Borrowed<'a> {
2230 value
2231 }
2232 }
2233
2234 unsafe impl fidl::encoding::TypeMarker for InputReport {
2235 type Owned = Self;
2236
2237 #[inline(always)]
2238 fn inline_align(_context: fidl::encoding::Context) -> usize {
2239 8
2240 }
2241
2242 #[inline(always)]
2243 fn inline_size(_context: fidl::encoding::Context) -> usize {
2244 16
2245 }
2246 }
2247
2248 unsafe impl fidl::encoding::Encode<InputReport, fidl::encoding::DefaultFuchsiaResourceDialect>
2249 for &mut InputReport
2250 {
2251 unsafe fn encode(
2252 self,
2253 encoder: &mut fidl::encoding::Encoder<
2254 '_,
2255 fidl::encoding::DefaultFuchsiaResourceDialect,
2256 >,
2257 offset: usize,
2258 mut depth: fidl::encoding::Depth,
2259 ) -> fidl::Result<()> {
2260 encoder.debug_check_bounds::<InputReport>(offset);
2261 let max_ordinal: u64 = self.max_ordinal_present();
2263 encoder.write_num(max_ordinal, offset);
2264 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2265 if max_ordinal == 0 {
2267 return Ok(());
2268 }
2269 depth.increment()?;
2270 let envelope_size = 8;
2271 let bytes_len = max_ordinal as usize * envelope_size;
2272 #[allow(unused_variables)]
2273 let offset = encoder.out_of_line_offset(bytes_len);
2274 let mut _prev_end_offset: usize = 0;
2275 if 1 > max_ordinal {
2276 return Ok(());
2277 }
2278
2279 let cur_offset: usize = (1 - 1) * envelope_size;
2282
2283 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2285
2286 fidl::encoding::encode_in_envelope_optional::<
2291 i64,
2292 fidl::encoding::DefaultFuchsiaResourceDialect,
2293 >(
2294 self.event_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2295 encoder,
2296 offset + cur_offset,
2297 depth,
2298 )?;
2299
2300 _prev_end_offset = cur_offset + envelope_size;
2301 if 2 > max_ordinal {
2302 return Ok(());
2303 }
2304
2305 let cur_offset: usize = (2 - 1) * envelope_size;
2308
2309 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2311
2312 fidl::encoding::encode_in_envelope_optional::<
2317 MouseInputReport,
2318 fidl::encoding::DefaultFuchsiaResourceDialect,
2319 >(
2320 self.mouse
2321 .as_ref()
2322 .map(<MouseInputReport as fidl::encoding::ValueTypeMarker>::borrow),
2323 encoder,
2324 offset + cur_offset,
2325 depth,
2326 )?;
2327
2328 _prev_end_offset = cur_offset + envelope_size;
2329 if 3 > max_ordinal {
2330 return Ok(());
2331 }
2332
2333 let cur_offset: usize = (3 - 1) * envelope_size;
2336
2337 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2339
2340 fidl::encoding::encode_in_envelope_optional::<
2345 SensorInputReport,
2346 fidl::encoding::DefaultFuchsiaResourceDialect,
2347 >(
2348 self.sensor
2349 .as_ref()
2350 .map(<SensorInputReport as fidl::encoding::ValueTypeMarker>::borrow),
2351 encoder,
2352 offset + cur_offset,
2353 depth,
2354 )?;
2355
2356 _prev_end_offset = cur_offset + envelope_size;
2357 if 4 > max_ordinal {
2358 return Ok(());
2359 }
2360
2361 let cur_offset: usize = (4 - 1) * envelope_size;
2364
2365 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2367
2368 fidl::encoding::encode_in_envelope_optional::<
2373 TouchInputReport,
2374 fidl::encoding::DefaultFuchsiaResourceDialect,
2375 >(
2376 self.touch
2377 .as_ref()
2378 .map(<TouchInputReport as fidl::encoding::ValueTypeMarker>::borrow),
2379 encoder,
2380 offset + cur_offset,
2381 depth,
2382 )?;
2383
2384 _prev_end_offset = cur_offset + envelope_size;
2385 if 5 > max_ordinal {
2386 return Ok(());
2387 }
2388
2389 let cur_offset: usize = (5 - 1) * envelope_size;
2392
2393 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2395
2396 fidl::encoding::encode_in_envelope_optional::<
2401 KeyboardInputReport,
2402 fidl::encoding::DefaultFuchsiaResourceDialect,
2403 >(
2404 self.keyboard
2405 .as_ref()
2406 .map(<KeyboardInputReport as fidl::encoding::ValueTypeMarker>::borrow),
2407 encoder,
2408 offset + cur_offset,
2409 depth,
2410 )?;
2411
2412 _prev_end_offset = cur_offset + envelope_size;
2413 if 6 > max_ordinal {
2414 return Ok(());
2415 }
2416
2417 let cur_offset: usize = (6 - 1) * envelope_size;
2420
2421 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2423
2424 fidl::encoding::encode_in_envelope_optional::<
2429 ConsumerControlInputReport,
2430 fidl::encoding::DefaultFuchsiaResourceDialect,
2431 >(
2432 self.consumer_control
2433 .as_ref()
2434 .map(<ConsumerControlInputReport as fidl::encoding::ValueTypeMarker>::borrow),
2435 encoder,
2436 offset + cur_offset,
2437 depth,
2438 )?;
2439
2440 _prev_end_offset = cur_offset + envelope_size;
2441 if 7 > max_ordinal {
2442 return Ok(());
2443 }
2444
2445 let cur_offset: usize = (7 - 1) * envelope_size;
2448
2449 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2451
2452 fidl::encoding::encode_in_envelope_optional::<
2457 u64,
2458 fidl::encoding::DefaultFuchsiaResourceDialect,
2459 >(
2460 self.trace_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2461 encoder,
2462 offset + cur_offset,
2463 depth,
2464 )?;
2465
2466 _prev_end_offset = cur_offset + envelope_size;
2467 if 8 > max_ordinal {
2468 return Ok(());
2469 }
2470
2471 let cur_offset: usize = (8 - 1) * envelope_size;
2474
2475 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2477
2478 fidl::encoding::encode_in_envelope_optional::<
2483 u8,
2484 fidl::encoding::DefaultFuchsiaResourceDialect,
2485 >(
2486 self.report_id.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2487 encoder,
2488 offset + cur_offset,
2489 depth,
2490 )?;
2491
2492 _prev_end_offset = cur_offset + envelope_size;
2493 if 9 > max_ordinal {
2494 return Ok(());
2495 }
2496
2497 let cur_offset: usize = (9 - 1) * envelope_size;
2500
2501 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2503
2504 fidl::encoding::encode_in_envelope_optional::<
2509 fidl::encoding::HandleType<
2510 fidl::EventPair,
2511 { fidl::ObjectType::EVENTPAIR.into_raw() },
2512 2147483648,
2513 >,
2514 fidl::encoding::DefaultFuchsiaResourceDialect,
2515 >(
2516 self.wake_lease.as_mut().map(
2517 <fidl::encoding::HandleType<
2518 fidl::EventPair,
2519 { fidl::ObjectType::EVENTPAIR.into_raw() },
2520 2147483648,
2521 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2522 ),
2523 encoder,
2524 offset + cur_offset,
2525 depth,
2526 )?;
2527
2528 _prev_end_offset = cur_offset + envelope_size;
2529
2530 Ok(())
2531 }
2532 }
2533
2534 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InputReport {
2535 #[inline(always)]
2536 fn new_empty() -> Self {
2537 Self::default()
2538 }
2539
2540 unsafe fn decode(
2541 &mut self,
2542 decoder: &mut fidl::encoding::Decoder<
2543 '_,
2544 fidl::encoding::DefaultFuchsiaResourceDialect,
2545 >,
2546 offset: usize,
2547 mut depth: fidl::encoding::Depth,
2548 ) -> fidl::Result<()> {
2549 decoder.debug_check_bounds::<Self>(offset);
2550 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2551 None => return Err(fidl::Error::NotNullable),
2552 Some(len) => len,
2553 };
2554 if len == 0 {
2556 return Ok(());
2557 };
2558 depth.increment()?;
2559 let envelope_size = 8;
2560 let bytes_len = len * envelope_size;
2561 let offset = decoder.out_of_line_offset(bytes_len)?;
2562 let mut _next_ordinal_to_read = 0;
2564 let mut next_offset = offset;
2565 let end_offset = offset + bytes_len;
2566 _next_ordinal_to_read += 1;
2567 if next_offset >= end_offset {
2568 return Ok(());
2569 }
2570
2571 while _next_ordinal_to_read < 1 {
2573 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2574 _next_ordinal_to_read += 1;
2575 next_offset += envelope_size;
2576 }
2577
2578 let next_out_of_line = decoder.next_out_of_line();
2579 let handles_before = decoder.remaining_handles();
2580 if let Some((inlined, num_bytes, num_handles)) =
2581 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2582 {
2583 let member_inline_size =
2584 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2585 if inlined != (member_inline_size <= 4) {
2586 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2587 }
2588 let inner_offset;
2589 let mut inner_depth = depth.clone();
2590 if inlined {
2591 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2592 inner_offset = next_offset;
2593 } else {
2594 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2595 inner_depth.increment()?;
2596 }
2597 let val_ref = self.event_time.get_or_insert_with(|| {
2598 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
2599 });
2600 fidl::decode!(
2601 i64,
2602 fidl::encoding::DefaultFuchsiaResourceDialect,
2603 val_ref,
2604 decoder,
2605 inner_offset,
2606 inner_depth
2607 )?;
2608 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2609 {
2610 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2611 }
2612 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2613 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2614 }
2615 }
2616
2617 next_offset += envelope_size;
2618 _next_ordinal_to_read += 1;
2619 if next_offset >= end_offset {
2620 return Ok(());
2621 }
2622
2623 while _next_ordinal_to_read < 2 {
2625 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2626 _next_ordinal_to_read += 1;
2627 next_offset += envelope_size;
2628 }
2629
2630 let next_out_of_line = decoder.next_out_of_line();
2631 let handles_before = decoder.remaining_handles();
2632 if let Some((inlined, num_bytes, num_handles)) =
2633 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2634 {
2635 let member_inline_size =
2636 <MouseInputReport as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2637 if inlined != (member_inline_size <= 4) {
2638 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2639 }
2640 let inner_offset;
2641 let mut inner_depth = depth.clone();
2642 if inlined {
2643 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2644 inner_offset = next_offset;
2645 } else {
2646 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2647 inner_depth.increment()?;
2648 }
2649 let val_ref = self.mouse.get_or_insert_with(|| {
2650 fidl::new_empty!(
2651 MouseInputReport,
2652 fidl::encoding::DefaultFuchsiaResourceDialect
2653 )
2654 });
2655 fidl::decode!(
2656 MouseInputReport,
2657 fidl::encoding::DefaultFuchsiaResourceDialect,
2658 val_ref,
2659 decoder,
2660 inner_offset,
2661 inner_depth
2662 )?;
2663 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2664 {
2665 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2666 }
2667 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2668 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2669 }
2670 }
2671
2672 next_offset += envelope_size;
2673 _next_ordinal_to_read += 1;
2674 if next_offset >= end_offset {
2675 return Ok(());
2676 }
2677
2678 while _next_ordinal_to_read < 3 {
2680 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2681 _next_ordinal_to_read += 1;
2682 next_offset += envelope_size;
2683 }
2684
2685 let next_out_of_line = decoder.next_out_of_line();
2686 let handles_before = decoder.remaining_handles();
2687 if let Some((inlined, num_bytes, num_handles)) =
2688 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2689 {
2690 let member_inline_size =
2691 <SensorInputReport as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2692 if inlined != (member_inline_size <= 4) {
2693 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2694 }
2695 let inner_offset;
2696 let mut inner_depth = depth.clone();
2697 if inlined {
2698 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2699 inner_offset = next_offset;
2700 } else {
2701 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2702 inner_depth.increment()?;
2703 }
2704 let val_ref = self.sensor.get_or_insert_with(|| {
2705 fidl::new_empty!(
2706 SensorInputReport,
2707 fidl::encoding::DefaultFuchsiaResourceDialect
2708 )
2709 });
2710 fidl::decode!(
2711 SensorInputReport,
2712 fidl::encoding::DefaultFuchsiaResourceDialect,
2713 val_ref,
2714 decoder,
2715 inner_offset,
2716 inner_depth
2717 )?;
2718 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2719 {
2720 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2721 }
2722 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2723 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2724 }
2725 }
2726
2727 next_offset += envelope_size;
2728 _next_ordinal_to_read += 1;
2729 if next_offset >= end_offset {
2730 return Ok(());
2731 }
2732
2733 while _next_ordinal_to_read < 4 {
2735 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2736 _next_ordinal_to_read += 1;
2737 next_offset += envelope_size;
2738 }
2739
2740 let next_out_of_line = decoder.next_out_of_line();
2741 let handles_before = decoder.remaining_handles();
2742 if let Some((inlined, num_bytes, num_handles)) =
2743 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2744 {
2745 let member_inline_size =
2746 <TouchInputReport as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2747 if inlined != (member_inline_size <= 4) {
2748 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2749 }
2750 let inner_offset;
2751 let mut inner_depth = depth.clone();
2752 if inlined {
2753 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2754 inner_offset = next_offset;
2755 } else {
2756 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2757 inner_depth.increment()?;
2758 }
2759 let val_ref = self.touch.get_or_insert_with(|| {
2760 fidl::new_empty!(
2761 TouchInputReport,
2762 fidl::encoding::DefaultFuchsiaResourceDialect
2763 )
2764 });
2765 fidl::decode!(
2766 TouchInputReport,
2767 fidl::encoding::DefaultFuchsiaResourceDialect,
2768 val_ref,
2769 decoder,
2770 inner_offset,
2771 inner_depth
2772 )?;
2773 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2774 {
2775 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2776 }
2777 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2778 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2779 }
2780 }
2781
2782 next_offset += envelope_size;
2783 _next_ordinal_to_read += 1;
2784 if next_offset >= end_offset {
2785 return Ok(());
2786 }
2787
2788 while _next_ordinal_to_read < 5 {
2790 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2791 _next_ordinal_to_read += 1;
2792 next_offset += envelope_size;
2793 }
2794
2795 let next_out_of_line = decoder.next_out_of_line();
2796 let handles_before = decoder.remaining_handles();
2797 if let Some((inlined, num_bytes, num_handles)) =
2798 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2799 {
2800 let member_inline_size =
2801 <KeyboardInputReport as fidl::encoding::TypeMarker>::inline_size(
2802 decoder.context,
2803 );
2804 if inlined != (member_inline_size <= 4) {
2805 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2806 }
2807 let inner_offset;
2808 let mut inner_depth = depth.clone();
2809 if inlined {
2810 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2811 inner_offset = next_offset;
2812 } else {
2813 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2814 inner_depth.increment()?;
2815 }
2816 let val_ref = self.keyboard.get_or_insert_with(|| {
2817 fidl::new_empty!(
2818 KeyboardInputReport,
2819 fidl::encoding::DefaultFuchsiaResourceDialect
2820 )
2821 });
2822 fidl::decode!(
2823 KeyboardInputReport,
2824 fidl::encoding::DefaultFuchsiaResourceDialect,
2825 val_ref,
2826 decoder,
2827 inner_offset,
2828 inner_depth
2829 )?;
2830 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2831 {
2832 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2833 }
2834 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2835 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2836 }
2837 }
2838
2839 next_offset += envelope_size;
2840 _next_ordinal_to_read += 1;
2841 if next_offset >= end_offset {
2842 return Ok(());
2843 }
2844
2845 while _next_ordinal_to_read < 6 {
2847 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2848 _next_ordinal_to_read += 1;
2849 next_offset += envelope_size;
2850 }
2851
2852 let next_out_of_line = decoder.next_out_of_line();
2853 let handles_before = decoder.remaining_handles();
2854 if let Some((inlined, num_bytes, num_handles)) =
2855 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2856 {
2857 let member_inline_size =
2858 <ConsumerControlInputReport as fidl::encoding::TypeMarker>::inline_size(
2859 decoder.context,
2860 );
2861 if inlined != (member_inline_size <= 4) {
2862 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2863 }
2864 let inner_offset;
2865 let mut inner_depth = depth.clone();
2866 if inlined {
2867 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2868 inner_offset = next_offset;
2869 } else {
2870 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2871 inner_depth.increment()?;
2872 }
2873 let val_ref = self.consumer_control.get_or_insert_with(|| {
2874 fidl::new_empty!(
2875 ConsumerControlInputReport,
2876 fidl::encoding::DefaultFuchsiaResourceDialect
2877 )
2878 });
2879 fidl::decode!(
2880 ConsumerControlInputReport,
2881 fidl::encoding::DefaultFuchsiaResourceDialect,
2882 val_ref,
2883 decoder,
2884 inner_offset,
2885 inner_depth
2886 )?;
2887 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2888 {
2889 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2890 }
2891 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2892 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2893 }
2894 }
2895
2896 next_offset += envelope_size;
2897 _next_ordinal_to_read += 1;
2898 if next_offset >= end_offset {
2899 return Ok(());
2900 }
2901
2902 while _next_ordinal_to_read < 7 {
2904 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2905 _next_ordinal_to_read += 1;
2906 next_offset += envelope_size;
2907 }
2908
2909 let next_out_of_line = decoder.next_out_of_line();
2910 let handles_before = decoder.remaining_handles();
2911 if let Some((inlined, num_bytes, num_handles)) =
2912 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2913 {
2914 let member_inline_size =
2915 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2916 if inlined != (member_inline_size <= 4) {
2917 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2918 }
2919 let inner_offset;
2920 let mut inner_depth = depth.clone();
2921 if inlined {
2922 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2923 inner_offset = next_offset;
2924 } else {
2925 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2926 inner_depth.increment()?;
2927 }
2928 let val_ref = self.trace_id.get_or_insert_with(|| {
2929 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
2930 });
2931 fidl::decode!(
2932 u64,
2933 fidl::encoding::DefaultFuchsiaResourceDialect,
2934 val_ref,
2935 decoder,
2936 inner_offset,
2937 inner_depth
2938 )?;
2939 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2940 {
2941 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2942 }
2943 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2944 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2945 }
2946 }
2947
2948 next_offset += envelope_size;
2949 _next_ordinal_to_read += 1;
2950 if next_offset >= end_offset {
2951 return Ok(());
2952 }
2953
2954 while _next_ordinal_to_read < 8 {
2956 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2957 _next_ordinal_to_read += 1;
2958 next_offset += envelope_size;
2959 }
2960
2961 let next_out_of_line = decoder.next_out_of_line();
2962 let handles_before = decoder.remaining_handles();
2963 if let Some((inlined, num_bytes, num_handles)) =
2964 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2965 {
2966 let member_inline_size =
2967 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2968 if inlined != (member_inline_size <= 4) {
2969 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2970 }
2971 let inner_offset;
2972 let mut inner_depth = depth.clone();
2973 if inlined {
2974 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2975 inner_offset = next_offset;
2976 } else {
2977 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2978 inner_depth.increment()?;
2979 }
2980 let val_ref = self.report_id.get_or_insert_with(|| {
2981 fidl::new_empty!(u8, fidl::encoding::DefaultFuchsiaResourceDialect)
2982 });
2983 fidl::decode!(
2984 u8,
2985 fidl::encoding::DefaultFuchsiaResourceDialect,
2986 val_ref,
2987 decoder,
2988 inner_offset,
2989 inner_depth
2990 )?;
2991 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2992 {
2993 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2994 }
2995 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2996 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2997 }
2998 }
2999
3000 next_offset += envelope_size;
3001 _next_ordinal_to_read += 1;
3002 if next_offset >= end_offset {
3003 return Ok(());
3004 }
3005
3006 while _next_ordinal_to_read < 9 {
3008 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3009 _next_ordinal_to_read += 1;
3010 next_offset += envelope_size;
3011 }
3012
3013 let next_out_of_line = decoder.next_out_of_line();
3014 let handles_before = decoder.remaining_handles();
3015 if let Some((inlined, num_bytes, num_handles)) =
3016 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3017 {
3018 let member_inline_size = <fidl::encoding::HandleType<
3019 fidl::EventPair,
3020 { fidl::ObjectType::EVENTPAIR.into_raw() },
3021 2147483648,
3022 > as fidl::encoding::TypeMarker>::inline_size(
3023 decoder.context
3024 );
3025 if inlined != (member_inline_size <= 4) {
3026 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3027 }
3028 let inner_offset;
3029 let mut inner_depth = depth.clone();
3030 if inlined {
3031 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3032 inner_offset = next_offset;
3033 } else {
3034 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3035 inner_depth.increment()?;
3036 }
3037 let val_ref =
3038 self.wake_lease.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
3039 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3040 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3041 {
3042 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3043 }
3044 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3045 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3046 }
3047 }
3048
3049 next_offset += envelope_size;
3050
3051 while next_offset < end_offset {
3053 _next_ordinal_to_read += 1;
3054 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3055 next_offset += envelope_size;
3056 }
3057
3058 Ok(())
3059 }
3060 }
3061}