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