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