1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_ui_views_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct FocuserRequestFocusRequest {
16 pub view_ref: ViewRef,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for FocuserRequestFocusRequest
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31pub struct ViewCreationToken {
32 pub value: fidl::Channel,
33}
34
35impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewCreationToken {}
36
37#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
45pub struct ViewHolderToken {
46 pub value: fidl::EventPair,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewHolderToken {}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
67pub struct ViewIdentityOnCreation {
68 pub view_ref: ViewRef,
70 pub view_ref_control: ViewRefControl,
72}
73
74impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewIdentityOnCreation {}
75
76#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
77pub struct ViewPresentRequest {
78 pub view_token: ViewToken,
79}
80
81impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewPresentRequest {}
82
83#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105pub struct ViewRef {
106 pub reference: fidl::EventPair,
107}
108
109impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewRef {}
110
111#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
126pub struct ViewRefControl {
127 pub reference: fidl::EventPair,
128}
129
130impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewRefControl {}
131
132#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
133pub struct ViewRefInstalledWatchRequest {
134 pub view_ref: ViewRef,
135}
136
137impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
138 for ViewRefInstalledWatchRequest
139{
140}
141
142#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
150pub struct ViewToken {
151 pub value: fidl::EventPair,
152}
153
154impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewToken {}
155
156#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
163pub struct ViewportCreationToken {
164 pub value: fidl::Channel,
165}
166
167impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewportCreationToken {}
168
169#[derive(Debug, Default, PartialEq)]
170pub struct FocuserSetAutoFocusRequest {
171 pub view_ref: Option<ViewRef>,
172 #[doc(hidden)]
173 pub __source_breaking: fidl::marker::SourceBreaking,
174}
175
176impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
177 for FocuserSetAutoFocusRequest
178{
179}
180
181#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
182pub struct FocuserMarker;
183
184impl fidl::endpoints::ProtocolMarker for FocuserMarker {
185 type Proxy = FocuserProxy;
186 type RequestStream = FocuserRequestStream;
187 #[cfg(target_os = "fuchsia")]
188 type SynchronousProxy = FocuserSynchronousProxy;
189
190 const DEBUG_NAME: &'static str = "(anonymous) Focuser";
191}
192pub type FocuserRequestFocusResult = Result<(), Error>;
193pub type FocuserSetAutoFocusResult = Result<(), AutoFocusError>;
194
195pub trait FocuserProxyInterface: Send + Sync {
196 type RequestFocusResponseFut: std::future::Future<Output = Result<FocuserRequestFocusResult, fidl::Error>>
197 + Send;
198 fn r#request_focus(&self, view_ref: ViewRef) -> Self::RequestFocusResponseFut;
199 type SetAutoFocusResponseFut: std::future::Future<Output = Result<FocuserSetAutoFocusResult, fidl::Error>>
200 + Send;
201 fn r#set_auto_focus(
202 &self,
203 payload: FocuserSetAutoFocusRequest,
204 ) -> Self::SetAutoFocusResponseFut;
205}
206#[derive(Debug)]
207#[cfg(target_os = "fuchsia")]
208pub struct FocuserSynchronousProxy {
209 client: fidl::client::sync::Client,
210}
211
212#[cfg(target_os = "fuchsia")]
213impl fidl::endpoints::SynchronousProxy for FocuserSynchronousProxy {
214 type Proxy = FocuserProxy;
215 type Protocol = FocuserMarker;
216
217 fn from_channel(inner: fidl::Channel) -> Self {
218 Self::new(inner)
219 }
220
221 fn into_channel(self) -> fidl::Channel {
222 self.client.into_channel()
223 }
224
225 fn as_channel(&self) -> &fidl::Channel {
226 self.client.as_channel()
227 }
228}
229
230#[cfg(target_os = "fuchsia")]
231impl FocuserSynchronousProxy {
232 pub fn new(channel: fidl::Channel) -> Self {
233 let protocol_name = <FocuserMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
234 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
235 }
236
237 pub fn into_channel(self) -> fidl::Channel {
238 self.client.into_channel()
239 }
240
241 pub fn wait_for_event(
244 &self,
245 deadline: zx::MonotonicInstant,
246 ) -> Result<FocuserEvent, fidl::Error> {
247 FocuserEvent::decode(self.client.wait_for_event(deadline)?)
248 }
249
250 pub fn r#request_focus(
270 &self,
271 mut view_ref: ViewRef,
272 ___deadline: zx::MonotonicInstant,
273 ) -> Result<FocuserRequestFocusResult, fidl::Error> {
274 let _response = self.client.send_query::<
275 FocuserRequestFocusRequest,
276 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
277 >(
278 (&mut view_ref,),
279 0x559067eb07097d5,
280 fidl::encoding::DynamicFlags::empty(),
281 ___deadline,
282 )?;
283 Ok(_response.map(|x| x))
284 }
285
286 pub fn r#set_auto_focus(
316 &self,
317 mut payload: FocuserSetAutoFocusRequest,
318 ___deadline: zx::MonotonicInstant,
319 ) -> Result<FocuserSetAutoFocusResult, fidl::Error> {
320 let _response = self.client.send_query::<
321 FocuserSetAutoFocusRequest,
322 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, AutoFocusError>,
323 >(
324 &mut payload,
325 0x480feb5856329509,
326 fidl::encoding::DynamicFlags::empty(),
327 ___deadline,
328 )?;
329 Ok(_response.map(|x| x))
330 }
331}
332
333#[cfg(target_os = "fuchsia")]
334impl From<FocuserSynchronousProxy> for zx::Handle {
335 fn from(value: FocuserSynchronousProxy) -> Self {
336 value.into_channel().into()
337 }
338}
339
340#[cfg(target_os = "fuchsia")]
341impl From<fidl::Channel> for FocuserSynchronousProxy {
342 fn from(value: fidl::Channel) -> Self {
343 Self::new(value)
344 }
345}
346
347#[derive(Debug, Clone)]
348pub struct FocuserProxy {
349 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
350}
351
352impl fidl::endpoints::Proxy for FocuserProxy {
353 type Protocol = FocuserMarker;
354
355 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
356 Self::new(inner)
357 }
358
359 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
360 self.client.into_channel().map_err(|client| Self { client })
361 }
362
363 fn as_channel(&self) -> &::fidl::AsyncChannel {
364 self.client.as_channel()
365 }
366}
367
368impl FocuserProxy {
369 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
371 let protocol_name = <FocuserMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
372 Self { client: fidl::client::Client::new(channel, protocol_name) }
373 }
374
375 pub fn take_event_stream(&self) -> FocuserEventStream {
381 FocuserEventStream { event_receiver: self.client.take_event_receiver() }
382 }
383
384 pub fn r#request_focus(
404 &self,
405 mut view_ref: ViewRef,
406 ) -> fidl::client::QueryResponseFut<
407 FocuserRequestFocusResult,
408 fidl::encoding::DefaultFuchsiaResourceDialect,
409 > {
410 FocuserProxyInterface::r#request_focus(self, view_ref)
411 }
412
413 pub fn r#set_auto_focus(
443 &self,
444 mut payload: FocuserSetAutoFocusRequest,
445 ) -> fidl::client::QueryResponseFut<
446 FocuserSetAutoFocusResult,
447 fidl::encoding::DefaultFuchsiaResourceDialect,
448 > {
449 FocuserProxyInterface::r#set_auto_focus(self, payload)
450 }
451}
452
453impl FocuserProxyInterface for FocuserProxy {
454 type RequestFocusResponseFut = fidl::client::QueryResponseFut<
455 FocuserRequestFocusResult,
456 fidl::encoding::DefaultFuchsiaResourceDialect,
457 >;
458 fn r#request_focus(&self, mut view_ref: ViewRef) -> Self::RequestFocusResponseFut {
459 fn _decode(
460 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
461 ) -> Result<FocuserRequestFocusResult, fidl::Error> {
462 let _response = fidl::client::decode_transaction_body::<
463 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
464 fidl::encoding::DefaultFuchsiaResourceDialect,
465 0x559067eb07097d5,
466 >(_buf?)?;
467 Ok(_response.map(|x| x))
468 }
469 self.client.send_query_and_decode::<FocuserRequestFocusRequest, FocuserRequestFocusResult>(
470 (&mut view_ref,),
471 0x559067eb07097d5,
472 fidl::encoding::DynamicFlags::empty(),
473 _decode,
474 )
475 }
476
477 type SetAutoFocusResponseFut = fidl::client::QueryResponseFut<
478 FocuserSetAutoFocusResult,
479 fidl::encoding::DefaultFuchsiaResourceDialect,
480 >;
481 fn r#set_auto_focus(
482 &self,
483 mut payload: FocuserSetAutoFocusRequest,
484 ) -> Self::SetAutoFocusResponseFut {
485 fn _decode(
486 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
487 ) -> Result<FocuserSetAutoFocusResult, fidl::Error> {
488 let _response = fidl::client::decode_transaction_body::<
489 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, AutoFocusError>,
490 fidl::encoding::DefaultFuchsiaResourceDialect,
491 0x480feb5856329509,
492 >(_buf?)?;
493 Ok(_response.map(|x| x))
494 }
495 self.client.send_query_and_decode::<FocuserSetAutoFocusRequest, FocuserSetAutoFocusResult>(
496 &mut payload,
497 0x480feb5856329509,
498 fidl::encoding::DynamicFlags::empty(),
499 _decode,
500 )
501 }
502}
503
504pub struct FocuserEventStream {
505 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
506}
507
508impl std::marker::Unpin for FocuserEventStream {}
509
510impl futures::stream::FusedStream for FocuserEventStream {
511 fn is_terminated(&self) -> bool {
512 self.event_receiver.is_terminated()
513 }
514}
515
516impl futures::Stream for FocuserEventStream {
517 type Item = Result<FocuserEvent, fidl::Error>;
518
519 fn poll_next(
520 mut self: std::pin::Pin<&mut Self>,
521 cx: &mut std::task::Context<'_>,
522 ) -> std::task::Poll<Option<Self::Item>> {
523 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
524 &mut self.event_receiver,
525 cx
526 )?) {
527 Some(buf) => std::task::Poll::Ready(Some(FocuserEvent::decode(buf))),
528 None => std::task::Poll::Ready(None),
529 }
530 }
531}
532
533#[derive(Debug)]
534pub enum FocuserEvent {}
535
536impl FocuserEvent {
537 fn decode(
539 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
540 ) -> Result<FocuserEvent, fidl::Error> {
541 let (bytes, _handles) = buf.split_mut();
542 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
543 debug_assert_eq!(tx_header.tx_id, 0);
544 match tx_header.ordinal {
545 _ => Err(fidl::Error::UnknownOrdinal {
546 ordinal: tx_header.ordinal,
547 protocol_name: <FocuserMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
548 }),
549 }
550 }
551}
552
553pub struct FocuserRequestStream {
555 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
556 is_terminated: bool,
557}
558
559impl std::marker::Unpin for FocuserRequestStream {}
560
561impl futures::stream::FusedStream for FocuserRequestStream {
562 fn is_terminated(&self) -> bool {
563 self.is_terminated
564 }
565}
566
567impl fidl::endpoints::RequestStream for FocuserRequestStream {
568 type Protocol = FocuserMarker;
569 type ControlHandle = FocuserControlHandle;
570
571 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
572 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
573 }
574
575 fn control_handle(&self) -> Self::ControlHandle {
576 FocuserControlHandle { inner: self.inner.clone() }
577 }
578
579 fn into_inner(
580 self,
581 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
582 {
583 (self.inner, self.is_terminated)
584 }
585
586 fn from_inner(
587 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
588 is_terminated: bool,
589 ) -> Self {
590 Self { inner, is_terminated }
591 }
592}
593
594impl futures::Stream for FocuserRequestStream {
595 type Item = Result<FocuserRequest, fidl::Error>;
596
597 fn poll_next(
598 mut self: std::pin::Pin<&mut Self>,
599 cx: &mut std::task::Context<'_>,
600 ) -> std::task::Poll<Option<Self::Item>> {
601 let this = &mut *self;
602 if this.inner.check_shutdown(cx) {
603 this.is_terminated = true;
604 return std::task::Poll::Ready(None);
605 }
606 if this.is_terminated {
607 panic!("polled FocuserRequestStream after completion");
608 }
609 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
610 |bytes, handles| {
611 match this.inner.channel().read_etc(cx, bytes, handles) {
612 std::task::Poll::Ready(Ok(())) => {}
613 std::task::Poll::Pending => return std::task::Poll::Pending,
614 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
615 this.is_terminated = true;
616 return std::task::Poll::Ready(None);
617 }
618 std::task::Poll::Ready(Err(e)) => {
619 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
620 e.into(),
621 ))))
622 }
623 }
624
625 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
627
628 std::task::Poll::Ready(Some(match header.ordinal {
629 0x559067eb07097d5 => {
630 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
631 let mut req = fidl::new_empty!(
632 FocuserRequestFocusRequest,
633 fidl::encoding::DefaultFuchsiaResourceDialect
634 );
635 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FocuserRequestFocusRequest>(&header, _body_bytes, handles, &mut req)?;
636 let control_handle = FocuserControlHandle { inner: this.inner.clone() };
637 Ok(FocuserRequest::RequestFocus {
638 view_ref: req.view_ref,
639
640 responder: FocuserRequestFocusResponder {
641 control_handle: std::mem::ManuallyDrop::new(control_handle),
642 tx_id: header.tx_id,
643 },
644 })
645 }
646 0x480feb5856329509 => {
647 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
648 let mut req = fidl::new_empty!(
649 FocuserSetAutoFocusRequest,
650 fidl::encoding::DefaultFuchsiaResourceDialect
651 );
652 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FocuserSetAutoFocusRequest>(&header, _body_bytes, handles, &mut req)?;
653 let control_handle = FocuserControlHandle { inner: this.inner.clone() };
654 Ok(FocuserRequest::SetAutoFocus {
655 payload: req,
656 responder: FocuserSetAutoFocusResponder {
657 control_handle: std::mem::ManuallyDrop::new(control_handle),
658 tx_id: header.tx_id,
659 },
660 })
661 }
662 _ => Err(fidl::Error::UnknownOrdinal {
663 ordinal: header.ordinal,
664 protocol_name:
665 <FocuserMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
666 }),
667 }))
668 },
669 )
670 }
671}
672
673#[derive(Debug)]
678pub enum FocuserRequest {
679 RequestFocus { view_ref: ViewRef, responder: FocuserRequestFocusResponder },
699 SetAutoFocus { payload: FocuserSetAutoFocusRequest, responder: FocuserSetAutoFocusResponder },
729}
730
731impl FocuserRequest {
732 #[allow(irrefutable_let_patterns)]
733 pub fn into_request_focus(self) -> Option<(ViewRef, FocuserRequestFocusResponder)> {
734 if let FocuserRequest::RequestFocus { view_ref, responder } = self {
735 Some((view_ref, responder))
736 } else {
737 None
738 }
739 }
740
741 #[allow(irrefutable_let_patterns)]
742 pub fn into_set_auto_focus(
743 self,
744 ) -> Option<(FocuserSetAutoFocusRequest, FocuserSetAutoFocusResponder)> {
745 if let FocuserRequest::SetAutoFocus { payload, responder } = self {
746 Some((payload, responder))
747 } else {
748 None
749 }
750 }
751
752 pub fn method_name(&self) -> &'static str {
754 match *self {
755 FocuserRequest::RequestFocus { .. } => "request_focus",
756 FocuserRequest::SetAutoFocus { .. } => "set_auto_focus",
757 }
758 }
759}
760
761#[derive(Debug, Clone)]
762pub struct FocuserControlHandle {
763 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
764}
765
766impl fidl::endpoints::ControlHandle for FocuserControlHandle {
767 fn shutdown(&self) {
768 self.inner.shutdown()
769 }
770 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
771 self.inner.shutdown_with_epitaph(status)
772 }
773
774 fn is_closed(&self) -> bool {
775 self.inner.channel().is_closed()
776 }
777 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
778 self.inner.channel().on_closed()
779 }
780
781 #[cfg(target_os = "fuchsia")]
782 fn signal_peer(
783 &self,
784 clear_mask: zx::Signals,
785 set_mask: zx::Signals,
786 ) -> Result<(), zx_status::Status> {
787 use fidl::Peered;
788 self.inner.channel().signal_peer(clear_mask, set_mask)
789 }
790}
791
792impl FocuserControlHandle {}
793
794#[must_use = "FIDL methods require a response to be sent"]
795#[derive(Debug)]
796pub struct FocuserRequestFocusResponder {
797 control_handle: std::mem::ManuallyDrop<FocuserControlHandle>,
798 tx_id: u32,
799}
800
801impl std::ops::Drop for FocuserRequestFocusResponder {
805 fn drop(&mut self) {
806 self.control_handle.shutdown();
807 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
809 }
810}
811
812impl fidl::endpoints::Responder for FocuserRequestFocusResponder {
813 type ControlHandle = FocuserControlHandle;
814
815 fn control_handle(&self) -> &FocuserControlHandle {
816 &self.control_handle
817 }
818
819 fn drop_without_shutdown(mut self) {
820 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
822 std::mem::forget(self);
824 }
825}
826
827impl FocuserRequestFocusResponder {
828 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
832 let _result = self.send_raw(result);
833 if _result.is_err() {
834 self.control_handle.shutdown();
835 }
836 self.drop_without_shutdown();
837 _result
838 }
839
840 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
842 let _result = self.send_raw(result);
843 self.drop_without_shutdown();
844 _result
845 }
846
847 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
848 self.control_handle
849 .inner
850 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
851 result,
852 self.tx_id,
853 0x559067eb07097d5,
854 fidl::encoding::DynamicFlags::empty(),
855 )
856 }
857}
858
859#[must_use = "FIDL methods require a response to be sent"]
860#[derive(Debug)]
861pub struct FocuserSetAutoFocusResponder {
862 control_handle: std::mem::ManuallyDrop<FocuserControlHandle>,
863 tx_id: u32,
864}
865
866impl std::ops::Drop for FocuserSetAutoFocusResponder {
870 fn drop(&mut self) {
871 self.control_handle.shutdown();
872 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
874 }
875}
876
877impl fidl::endpoints::Responder for FocuserSetAutoFocusResponder {
878 type ControlHandle = FocuserControlHandle;
879
880 fn control_handle(&self) -> &FocuserControlHandle {
881 &self.control_handle
882 }
883
884 fn drop_without_shutdown(mut self) {
885 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
887 std::mem::forget(self);
889 }
890}
891
892impl FocuserSetAutoFocusResponder {
893 pub fn send(self, mut result: Result<(), AutoFocusError>) -> Result<(), fidl::Error> {
897 let _result = self.send_raw(result);
898 if _result.is_err() {
899 self.control_handle.shutdown();
900 }
901 self.drop_without_shutdown();
902 _result
903 }
904
905 pub fn send_no_shutdown_on_err(
907 self,
908 mut result: Result<(), AutoFocusError>,
909 ) -> Result<(), fidl::Error> {
910 let _result = self.send_raw(result);
911 self.drop_without_shutdown();
912 _result
913 }
914
915 fn send_raw(&self, mut result: Result<(), AutoFocusError>) -> Result<(), fidl::Error> {
916 self.control_handle.inner.send::<fidl::encoding::ResultType<
917 fidl::encoding::EmptyStruct,
918 AutoFocusError,
919 >>(
920 result,
921 self.tx_id,
922 0x480feb5856329509,
923 fidl::encoding::DynamicFlags::empty(),
924 )
925 }
926}
927
928#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
929pub struct ViewMarker;
930
931impl fidl::endpoints::ProtocolMarker for ViewMarker {
932 type Proxy = ViewProxy;
933 type RequestStream = ViewRequestStream;
934 #[cfg(target_os = "fuchsia")]
935 type SynchronousProxy = ViewSynchronousProxy;
936
937 const DEBUG_NAME: &'static str = "fuchsia.ui.views.View";
938}
939impl fidl::endpoints::DiscoverableProtocolMarker for ViewMarker {}
940
941pub trait ViewProxyInterface: Send + Sync {
942 fn r#present(&self, view_token: ViewToken) -> Result<(), fidl::Error>;
943}
944#[derive(Debug)]
945#[cfg(target_os = "fuchsia")]
946pub struct ViewSynchronousProxy {
947 client: fidl::client::sync::Client,
948}
949
950#[cfg(target_os = "fuchsia")]
951impl fidl::endpoints::SynchronousProxy for ViewSynchronousProxy {
952 type Proxy = ViewProxy;
953 type Protocol = ViewMarker;
954
955 fn from_channel(inner: fidl::Channel) -> Self {
956 Self::new(inner)
957 }
958
959 fn into_channel(self) -> fidl::Channel {
960 self.client.into_channel()
961 }
962
963 fn as_channel(&self) -> &fidl::Channel {
964 self.client.as_channel()
965 }
966}
967
968#[cfg(target_os = "fuchsia")]
969impl ViewSynchronousProxy {
970 pub fn new(channel: fidl::Channel) -> Self {
971 let protocol_name = <ViewMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
972 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
973 }
974
975 pub fn into_channel(self) -> fidl::Channel {
976 self.client.into_channel()
977 }
978
979 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<ViewEvent, fidl::Error> {
982 ViewEvent::decode(self.client.wait_for_event(deadline)?)
983 }
984
985 pub fn r#present(&self, mut view_token: ViewToken) -> Result<(), fidl::Error> {
1000 self.client.send::<ViewPresentRequest>(
1001 (&mut view_token,),
1002 0x6e98ebc6c9de6d9e,
1003 fidl::encoding::DynamicFlags::empty(),
1004 )
1005 }
1006}
1007
1008#[cfg(target_os = "fuchsia")]
1009impl From<ViewSynchronousProxy> for zx::Handle {
1010 fn from(value: ViewSynchronousProxy) -> Self {
1011 value.into_channel().into()
1012 }
1013}
1014
1015#[cfg(target_os = "fuchsia")]
1016impl From<fidl::Channel> for ViewSynchronousProxy {
1017 fn from(value: fidl::Channel) -> Self {
1018 Self::new(value)
1019 }
1020}
1021
1022#[derive(Debug, Clone)]
1023pub struct ViewProxy {
1024 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1025}
1026
1027impl fidl::endpoints::Proxy for ViewProxy {
1028 type Protocol = ViewMarker;
1029
1030 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1031 Self::new(inner)
1032 }
1033
1034 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1035 self.client.into_channel().map_err(|client| Self { client })
1036 }
1037
1038 fn as_channel(&self) -> &::fidl::AsyncChannel {
1039 self.client.as_channel()
1040 }
1041}
1042
1043impl ViewProxy {
1044 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1046 let protocol_name = <ViewMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1047 Self { client: fidl::client::Client::new(channel, protocol_name) }
1048 }
1049
1050 pub fn take_event_stream(&self) -> ViewEventStream {
1056 ViewEventStream { event_receiver: self.client.take_event_receiver() }
1057 }
1058
1059 pub fn r#present(&self, mut view_token: ViewToken) -> Result<(), fidl::Error> {
1074 ViewProxyInterface::r#present(self, view_token)
1075 }
1076}
1077
1078impl ViewProxyInterface for ViewProxy {
1079 fn r#present(&self, mut view_token: ViewToken) -> Result<(), fidl::Error> {
1080 self.client.send::<ViewPresentRequest>(
1081 (&mut view_token,),
1082 0x6e98ebc6c9de6d9e,
1083 fidl::encoding::DynamicFlags::empty(),
1084 )
1085 }
1086}
1087
1088pub struct ViewEventStream {
1089 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1090}
1091
1092impl std::marker::Unpin for ViewEventStream {}
1093
1094impl futures::stream::FusedStream for ViewEventStream {
1095 fn is_terminated(&self) -> bool {
1096 self.event_receiver.is_terminated()
1097 }
1098}
1099
1100impl futures::Stream for ViewEventStream {
1101 type Item = Result<ViewEvent, fidl::Error>;
1102
1103 fn poll_next(
1104 mut self: std::pin::Pin<&mut Self>,
1105 cx: &mut std::task::Context<'_>,
1106 ) -> std::task::Poll<Option<Self::Item>> {
1107 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1108 &mut self.event_receiver,
1109 cx
1110 )?) {
1111 Some(buf) => std::task::Poll::Ready(Some(ViewEvent::decode(buf))),
1112 None => std::task::Poll::Ready(None),
1113 }
1114 }
1115}
1116
1117#[derive(Debug)]
1118pub enum ViewEvent {}
1119
1120impl ViewEvent {
1121 fn decode(
1123 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1124 ) -> Result<ViewEvent, fidl::Error> {
1125 let (bytes, _handles) = buf.split_mut();
1126 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1127 debug_assert_eq!(tx_header.tx_id, 0);
1128 match tx_header.ordinal {
1129 _ => Err(fidl::Error::UnknownOrdinal {
1130 ordinal: tx_header.ordinal,
1131 protocol_name: <ViewMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1132 }),
1133 }
1134 }
1135}
1136
1137pub struct ViewRequestStream {
1139 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1140 is_terminated: bool,
1141}
1142
1143impl std::marker::Unpin for ViewRequestStream {}
1144
1145impl futures::stream::FusedStream for ViewRequestStream {
1146 fn is_terminated(&self) -> bool {
1147 self.is_terminated
1148 }
1149}
1150
1151impl fidl::endpoints::RequestStream for ViewRequestStream {
1152 type Protocol = ViewMarker;
1153 type ControlHandle = ViewControlHandle;
1154
1155 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1156 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1157 }
1158
1159 fn control_handle(&self) -> Self::ControlHandle {
1160 ViewControlHandle { inner: self.inner.clone() }
1161 }
1162
1163 fn into_inner(
1164 self,
1165 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1166 {
1167 (self.inner, self.is_terminated)
1168 }
1169
1170 fn from_inner(
1171 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1172 is_terminated: bool,
1173 ) -> Self {
1174 Self { inner, is_terminated }
1175 }
1176}
1177
1178impl futures::Stream for ViewRequestStream {
1179 type Item = Result<ViewRequest, fidl::Error>;
1180
1181 fn poll_next(
1182 mut self: std::pin::Pin<&mut Self>,
1183 cx: &mut std::task::Context<'_>,
1184 ) -> std::task::Poll<Option<Self::Item>> {
1185 let this = &mut *self;
1186 if this.inner.check_shutdown(cx) {
1187 this.is_terminated = true;
1188 return std::task::Poll::Ready(None);
1189 }
1190 if this.is_terminated {
1191 panic!("polled ViewRequestStream after completion");
1192 }
1193 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1194 |bytes, handles| {
1195 match this.inner.channel().read_etc(cx, bytes, handles) {
1196 std::task::Poll::Ready(Ok(())) => {}
1197 std::task::Poll::Pending => return std::task::Poll::Pending,
1198 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1199 this.is_terminated = true;
1200 return std::task::Poll::Ready(None);
1201 }
1202 std::task::Poll::Ready(Err(e)) => {
1203 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1204 e.into(),
1205 ))))
1206 }
1207 }
1208
1209 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1211
1212 std::task::Poll::Ready(Some(match header.ordinal {
1213 0x6e98ebc6c9de6d9e => {
1214 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1215 let mut req = fidl::new_empty!(
1216 ViewPresentRequest,
1217 fidl::encoding::DefaultFuchsiaResourceDialect
1218 );
1219 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ViewPresentRequest>(&header, _body_bytes, handles, &mut req)?;
1220 let control_handle = ViewControlHandle { inner: this.inner.clone() };
1221 Ok(ViewRequest::Present { view_token: req.view_token, control_handle })
1222 }
1223 _ => Err(fidl::Error::UnknownOrdinal {
1224 ordinal: header.ordinal,
1225 protocol_name: <ViewMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1226 }),
1227 }))
1228 },
1229 )
1230 }
1231}
1232
1233#[derive(Debug)]
1235pub enum ViewRequest {
1236 Present { view_token: ViewToken, control_handle: ViewControlHandle },
1251}
1252
1253impl ViewRequest {
1254 #[allow(irrefutable_let_patterns)]
1255 pub fn into_present(self) -> Option<(ViewToken, ViewControlHandle)> {
1256 if let ViewRequest::Present { view_token, control_handle } = self {
1257 Some((view_token, control_handle))
1258 } else {
1259 None
1260 }
1261 }
1262
1263 pub fn method_name(&self) -> &'static str {
1265 match *self {
1266 ViewRequest::Present { .. } => "present",
1267 }
1268 }
1269}
1270
1271#[derive(Debug, Clone)]
1272pub struct ViewControlHandle {
1273 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1274}
1275
1276impl fidl::endpoints::ControlHandle for ViewControlHandle {
1277 fn shutdown(&self) {
1278 self.inner.shutdown()
1279 }
1280 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1281 self.inner.shutdown_with_epitaph(status)
1282 }
1283
1284 fn is_closed(&self) -> bool {
1285 self.inner.channel().is_closed()
1286 }
1287 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1288 self.inner.channel().on_closed()
1289 }
1290
1291 #[cfg(target_os = "fuchsia")]
1292 fn signal_peer(
1293 &self,
1294 clear_mask: zx::Signals,
1295 set_mask: zx::Signals,
1296 ) -> Result<(), zx_status::Status> {
1297 use fidl::Peered;
1298 self.inner.channel().signal_peer(clear_mask, set_mask)
1299 }
1300}
1301
1302impl ViewControlHandle {}
1303
1304#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1305pub struct ViewRefFocusedMarker;
1306
1307impl fidl::endpoints::ProtocolMarker for ViewRefFocusedMarker {
1308 type Proxy = ViewRefFocusedProxy;
1309 type RequestStream = ViewRefFocusedRequestStream;
1310 #[cfg(target_os = "fuchsia")]
1311 type SynchronousProxy = ViewRefFocusedSynchronousProxy;
1312
1313 const DEBUG_NAME: &'static str = "(anonymous) ViewRefFocused";
1314}
1315
1316pub trait ViewRefFocusedProxyInterface: Send + Sync {
1317 type WatchResponseFut: std::future::Future<Output = Result<FocusState, fidl::Error>> + Send;
1318 fn r#watch(&self) -> Self::WatchResponseFut;
1319}
1320#[derive(Debug)]
1321#[cfg(target_os = "fuchsia")]
1322pub struct ViewRefFocusedSynchronousProxy {
1323 client: fidl::client::sync::Client,
1324}
1325
1326#[cfg(target_os = "fuchsia")]
1327impl fidl::endpoints::SynchronousProxy for ViewRefFocusedSynchronousProxy {
1328 type Proxy = ViewRefFocusedProxy;
1329 type Protocol = ViewRefFocusedMarker;
1330
1331 fn from_channel(inner: fidl::Channel) -> Self {
1332 Self::new(inner)
1333 }
1334
1335 fn into_channel(self) -> fidl::Channel {
1336 self.client.into_channel()
1337 }
1338
1339 fn as_channel(&self) -> &fidl::Channel {
1340 self.client.as_channel()
1341 }
1342}
1343
1344#[cfg(target_os = "fuchsia")]
1345impl ViewRefFocusedSynchronousProxy {
1346 pub fn new(channel: fidl::Channel) -> Self {
1347 let protocol_name = <ViewRefFocusedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1348 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1349 }
1350
1351 pub fn into_channel(self) -> fidl::Channel {
1352 self.client.into_channel()
1353 }
1354
1355 pub fn wait_for_event(
1358 &self,
1359 deadline: zx::MonotonicInstant,
1360 ) -> Result<ViewRefFocusedEvent, fidl::Error> {
1361 ViewRefFocusedEvent::decode(self.client.wait_for_event(deadline)?)
1362 }
1363
1364 pub fn r#watch(&self, ___deadline: zx::MonotonicInstant) -> Result<FocusState, fidl::Error> {
1390 let _response =
1391 self.client.send_query::<fidl::encoding::EmptyPayload, ViewRefFocusedWatchResponse>(
1392 (),
1393 0x3c5e51096d9299b5,
1394 fidl::encoding::DynamicFlags::empty(),
1395 ___deadline,
1396 )?;
1397 Ok(_response.state)
1398 }
1399}
1400
1401#[cfg(target_os = "fuchsia")]
1402impl From<ViewRefFocusedSynchronousProxy> for zx::Handle {
1403 fn from(value: ViewRefFocusedSynchronousProxy) -> Self {
1404 value.into_channel().into()
1405 }
1406}
1407
1408#[cfg(target_os = "fuchsia")]
1409impl From<fidl::Channel> for ViewRefFocusedSynchronousProxy {
1410 fn from(value: fidl::Channel) -> Self {
1411 Self::new(value)
1412 }
1413}
1414
1415#[derive(Debug, Clone)]
1416pub struct ViewRefFocusedProxy {
1417 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1418}
1419
1420impl fidl::endpoints::Proxy for ViewRefFocusedProxy {
1421 type Protocol = ViewRefFocusedMarker;
1422
1423 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1424 Self::new(inner)
1425 }
1426
1427 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1428 self.client.into_channel().map_err(|client| Self { client })
1429 }
1430
1431 fn as_channel(&self) -> &::fidl::AsyncChannel {
1432 self.client.as_channel()
1433 }
1434}
1435
1436impl ViewRefFocusedProxy {
1437 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1439 let protocol_name = <ViewRefFocusedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1440 Self { client: fidl::client::Client::new(channel, protocol_name) }
1441 }
1442
1443 pub fn take_event_stream(&self) -> ViewRefFocusedEventStream {
1449 ViewRefFocusedEventStream { event_receiver: self.client.take_event_receiver() }
1450 }
1451
1452 pub fn r#watch(
1478 &self,
1479 ) -> fidl::client::QueryResponseFut<FocusState, fidl::encoding::DefaultFuchsiaResourceDialect>
1480 {
1481 ViewRefFocusedProxyInterface::r#watch(self)
1482 }
1483}
1484
1485impl ViewRefFocusedProxyInterface for ViewRefFocusedProxy {
1486 type WatchResponseFut =
1487 fidl::client::QueryResponseFut<FocusState, fidl::encoding::DefaultFuchsiaResourceDialect>;
1488 fn r#watch(&self) -> Self::WatchResponseFut {
1489 fn _decode(
1490 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1491 ) -> Result<FocusState, fidl::Error> {
1492 let _response = fidl::client::decode_transaction_body::<
1493 ViewRefFocusedWatchResponse,
1494 fidl::encoding::DefaultFuchsiaResourceDialect,
1495 0x3c5e51096d9299b5,
1496 >(_buf?)?;
1497 Ok(_response.state)
1498 }
1499 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FocusState>(
1500 (),
1501 0x3c5e51096d9299b5,
1502 fidl::encoding::DynamicFlags::empty(),
1503 _decode,
1504 )
1505 }
1506}
1507
1508pub struct ViewRefFocusedEventStream {
1509 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1510}
1511
1512impl std::marker::Unpin for ViewRefFocusedEventStream {}
1513
1514impl futures::stream::FusedStream for ViewRefFocusedEventStream {
1515 fn is_terminated(&self) -> bool {
1516 self.event_receiver.is_terminated()
1517 }
1518}
1519
1520impl futures::Stream for ViewRefFocusedEventStream {
1521 type Item = Result<ViewRefFocusedEvent, fidl::Error>;
1522
1523 fn poll_next(
1524 mut self: std::pin::Pin<&mut Self>,
1525 cx: &mut std::task::Context<'_>,
1526 ) -> std::task::Poll<Option<Self::Item>> {
1527 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1528 &mut self.event_receiver,
1529 cx
1530 )?) {
1531 Some(buf) => std::task::Poll::Ready(Some(ViewRefFocusedEvent::decode(buf))),
1532 None => std::task::Poll::Ready(None),
1533 }
1534 }
1535}
1536
1537#[derive(Debug)]
1538pub enum ViewRefFocusedEvent {}
1539
1540impl ViewRefFocusedEvent {
1541 fn decode(
1543 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1544 ) -> Result<ViewRefFocusedEvent, fidl::Error> {
1545 let (bytes, _handles) = buf.split_mut();
1546 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1547 debug_assert_eq!(tx_header.tx_id, 0);
1548 match tx_header.ordinal {
1549 _ => Err(fidl::Error::UnknownOrdinal {
1550 ordinal: tx_header.ordinal,
1551 protocol_name:
1552 <ViewRefFocusedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1553 }),
1554 }
1555 }
1556}
1557
1558pub struct ViewRefFocusedRequestStream {
1560 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1561 is_terminated: bool,
1562}
1563
1564impl std::marker::Unpin for ViewRefFocusedRequestStream {}
1565
1566impl futures::stream::FusedStream for ViewRefFocusedRequestStream {
1567 fn is_terminated(&self) -> bool {
1568 self.is_terminated
1569 }
1570}
1571
1572impl fidl::endpoints::RequestStream for ViewRefFocusedRequestStream {
1573 type Protocol = ViewRefFocusedMarker;
1574 type ControlHandle = ViewRefFocusedControlHandle;
1575
1576 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1577 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1578 }
1579
1580 fn control_handle(&self) -> Self::ControlHandle {
1581 ViewRefFocusedControlHandle { inner: self.inner.clone() }
1582 }
1583
1584 fn into_inner(
1585 self,
1586 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1587 {
1588 (self.inner, self.is_terminated)
1589 }
1590
1591 fn from_inner(
1592 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1593 is_terminated: bool,
1594 ) -> Self {
1595 Self { inner, is_terminated }
1596 }
1597}
1598
1599impl futures::Stream for ViewRefFocusedRequestStream {
1600 type Item = Result<ViewRefFocusedRequest, fidl::Error>;
1601
1602 fn poll_next(
1603 mut self: std::pin::Pin<&mut Self>,
1604 cx: &mut std::task::Context<'_>,
1605 ) -> std::task::Poll<Option<Self::Item>> {
1606 let this = &mut *self;
1607 if this.inner.check_shutdown(cx) {
1608 this.is_terminated = true;
1609 return std::task::Poll::Ready(None);
1610 }
1611 if this.is_terminated {
1612 panic!("polled ViewRefFocusedRequestStream after completion");
1613 }
1614 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1615 |bytes, handles| {
1616 match this.inner.channel().read_etc(cx, bytes, handles) {
1617 std::task::Poll::Ready(Ok(())) => {}
1618 std::task::Poll::Pending => return std::task::Poll::Pending,
1619 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1620 this.is_terminated = true;
1621 return std::task::Poll::Ready(None);
1622 }
1623 std::task::Poll::Ready(Err(e)) => {
1624 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1625 e.into(),
1626 ))))
1627 }
1628 }
1629
1630 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1632
1633 std::task::Poll::Ready(Some(match header.ordinal {
1634 0x3c5e51096d9299b5 => {
1635 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1636 let mut req = fidl::new_empty!(
1637 fidl::encoding::EmptyPayload,
1638 fidl::encoding::DefaultFuchsiaResourceDialect
1639 );
1640 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1641 let control_handle =
1642 ViewRefFocusedControlHandle { inner: this.inner.clone() };
1643 Ok(ViewRefFocusedRequest::Watch {
1644 responder: ViewRefFocusedWatchResponder {
1645 control_handle: std::mem::ManuallyDrop::new(control_handle),
1646 tx_id: header.tx_id,
1647 },
1648 })
1649 }
1650 _ => Err(fidl::Error::UnknownOrdinal {
1651 ordinal: header.ordinal,
1652 protocol_name:
1653 <ViewRefFocusedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1654 }),
1655 }))
1656 },
1657 )
1658 }
1659}
1660
1661#[derive(Debug)]
1670pub enum ViewRefFocusedRequest {
1671 Watch { responder: ViewRefFocusedWatchResponder },
1697}
1698
1699impl ViewRefFocusedRequest {
1700 #[allow(irrefutable_let_patterns)]
1701 pub fn into_watch(self) -> Option<(ViewRefFocusedWatchResponder)> {
1702 if let ViewRefFocusedRequest::Watch { responder } = self {
1703 Some((responder))
1704 } else {
1705 None
1706 }
1707 }
1708
1709 pub fn method_name(&self) -> &'static str {
1711 match *self {
1712 ViewRefFocusedRequest::Watch { .. } => "watch",
1713 }
1714 }
1715}
1716
1717#[derive(Debug, Clone)]
1718pub struct ViewRefFocusedControlHandle {
1719 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1720}
1721
1722impl fidl::endpoints::ControlHandle for ViewRefFocusedControlHandle {
1723 fn shutdown(&self) {
1724 self.inner.shutdown()
1725 }
1726 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1727 self.inner.shutdown_with_epitaph(status)
1728 }
1729
1730 fn is_closed(&self) -> bool {
1731 self.inner.channel().is_closed()
1732 }
1733 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1734 self.inner.channel().on_closed()
1735 }
1736
1737 #[cfg(target_os = "fuchsia")]
1738 fn signal_peer(
1739 &self,
1740 clear_mask: zx::Signals,
1741 set_mask: zx::Signals,
1742 ) -> Result<(), zx_status::Status> {
1743 use fidl::Peered;
1744 self.inner.channel().signal_peer(clear_mask, set_mask)
1745 }
1746}
1747
1748impl ViewRefFocusedControlHandle {}
1749
1750#[must_use = "FIDL methods require a response to be sent"]
1751#[derive(Debug)]
1752pub struct ViewRefFocusedWatchResponder {
1753 control_handle: std::mem::ManuallyDrop<ViewRefFocusedControlHandle>,
1754 tx_id: u32,
1755}
1756
1757impl std::ops::Drop for ViewRefFocusedWatchResponder {
1761 fn drop(&mut self) {
1762 self.control_handle.shutdown();
1763 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1765 }
1766}
1767
1768impl fidl::endpoints::Responder for ViewRefFocusedWatchResponder {
1769 type ControlHandle = ViewRefFocusedControlHandle;
1770
1771 fn control_handle(&self) -> &ViewRefFocusedControlHandle {
1772 &self.control_handle
1773 }
1774
1775 fn drop_without_shutdown(mut self) {
1776 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1778 std::mem::forget(self);
1780 }
1781}
1782
1783impl ViewRefFocusedWatchResponder {
1784 pub fn send(self, mut state: &FocusState) -> Result<(), fidl::Error> {
1788 let _result = self.send_raw(state);
1789 if _result.is_err() {
1790 self.control_handle.shutdown();
1791 }
1792 self.drop_without_shutdown();
1793 _result
1794 }
1795
1796 pub fn send_no_shutdown_on_err(self, mut state: &FocusState) -> Result<(), fidl::Error> {
1798 let _result = self.send_raw(state);
1799 self.drop_without_shutdown();
1800 _result
1801 }
1802
1803 fn send_raw(&self, mut state: &FocusState) -> Result<(), fidl::Error> {
1804 self.control_handle.inner.send::<ViewRefFocusedWatchResponse>(
1805 (state,),
1806 self.tx_id,
1807 0x3c5e51096d9299b5,
1808 fidl::encoding::DynamicFlags::empty(),
1809 )
1810 }
1811}
1812
1813#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1814pub struct ViewRefInstalledMarker;
1815
1816impl fidl::endpoints::ProtocolMarker for ViewRefInstalledMarker {
1817 type Proxy = ViewRefInstalledProxy;
1818 type RequestStream = ViewRefInstalledRequestStream;
1819 #[cfg(target_os = "fuchsia")]
1820 type SynchronousProxy = ViewRefInstalledSynchronousProxy;
1821
1822 const DEBUG_NAME: &'static str = "fuchsia.ui.views.ViewRefInstalled";
1823}
1824impl fidl::endpoints::DiscoverableProtocolMarker for ViewRefInstalledMarker {}
1825pub type ViewRefInstalledWatchResult = Result<(), ViewRefInstalledError>;
1826
1827pub trait ViewRefInstalledProxyInterface: Send + Sync {
1828 type WatchResponseFut: std::future::Future<Output = Result<ViewRefInstalledWatchResult, fidl::Error>>
1829 + Send;
1830 fn r#watch(&self, view_ref: ViewRef) -> Self::WatchResponseFut;
1831}
1832#[derive(Debug)]
1833#[cfg(target_os = "fuchsia")]
1834pub struct ViewRefInstalledSynchronousProxy {
1835 client: fidl::client::sync::Client,
1836}
1837
1838#[cfg(target_os = "fuchsia")]
1839impl fidl::endpoints::SynchronousProxy for ViewRefInstalledSynchronousProxy {
1840 type Proxy = ViewRefInstalledProxy;
1841 type Protocol = ViewRefInstalledMarker;
1842
1843 fn from_channel(inner: fidl::Channel) -> Self {
1844 Self::new(inner)
1845 }
1846
1847 fn into_channel(self) -> fidl::Channel {
1848 self.client.into_channel()
1849 }
1850
1851 fn as_channel(&self) -> &fidl::Channel {
1852 self.client.as_channel()
1853 }
1854}
1855
1856#[cfg(target_os = "fuchsia")]
1857impl ViewRefInstalledSynchronousProxy {
1858 pub fn new(channel: fidl::Channel) -> Self {
1859 let protocol_name = <ViewRefInstalledMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1860 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1861 }
1862
1863 pub fn into_channel(self) -> fidl::Channel {
1864 self.client.into_channel()
1865 }
1866
1867 pub fn wait_for_event(
1870 &self,
1871 deadline: zx::MonotonicInstant,
1872 ) -> Result<ViewRefInstalledEvent, fidl::Error> {
1873 ViewRefInstalledEvent::decode(self.client.wait_for_event(deadline)?)
1874 }
1875
1876 pub fn r#watch(
1892 &self,
1893 mut view_ref: ViewRef,
1894 ___deadline: zx::MonotonicInstant,
1895 ) -> Result<ViewRefInstalledWatchResult, fidl::Error> {
1896 let _response =
1897 self.client.send_query::<ViewRefInstalledWatchRequest, fidl::encoding::ResultType<
1898 fidl::encoding::EmptyStruct,
1899 ViewRefInstalledError,
1900 >>(
1901 (&mut view_ref,),
1902 0x7ddec2f4ca687971,
1903 fidl::encoding::DynamicFlags::empty(),
1904 ___deadline,
1905 )?;
1906 Ok(_response.map(|x| x))
1907 }
1908}
1909
1910#[cfg(target_os = "fuchsia")]
1911impl From<ViewRefInstalledSynchronousProxy> for zx::Handle {
1912 fn from(value: ViewRefInstalledSynchronousProxy) -> Self {
1913 value.into_channel().into()
1914 }
1915}
1916
1917#[cfg(target_os = "fuchsia")]
1918impl From<fidl::Channel> for ViewRefInstalledSynchronousProxy {
1919 fn from(value: fidl::Channel) -> Self {
1920 Self::new(value)
1921 }
1922}
1923
1924#[derive(Debug, Clone)]
1925pub struct ViewRefInstalledProxy {
1926 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1927}
1928
1929impl fidl::endpoints::Proxy for ViewRefInstalledProxy {
1930 type Protocol = ViewRefInstalledMarker;
1931
1932 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1933 Self::new(inner)
1934 }
1935
1936 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1937 self.client.into_channel().map_err(|client| Self { client })
1938 }
1939
1940 fn as_channel(&self) -> &::fidl::AsyncChannel {
1941 self.client.as_channel()
1942 }
1943}
1944
1945impl ViewRefInstalledProxy {
1946 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1948 let protocol_name = <ViewRefInstalledMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1949 Self { client: fidl::client::Client::new(channel, protocol_name) }
1950 }
1951
1952 pub fn take_event_stream(&self) -> ViewRefInstalledEventStream {
1958 ViewRefInstalledEventStream { event_receiver: self.client.take_event_receiver() }
1959 }
1960
1961 pub fn r#watch(
1977 &self,
1978 mut view_ref: ViewRef,
1979 ) -> fidl::client::QueryResponseFut<
1980 ViewRefInstalledWatchResult,
1981 fidl::encoding::DefaultFuchsiaResourceDialect,
1982 > {
1983 ViewRefInstalledProxyInterface::r#watch(self, view_ref)
1984 }
1985}
1986
1987impl ViewRefInstalledProxyInterface for ViewRefInstalledProxy {
1988 type WatchResponseFut = fidl::client::QueryResponseFut<
1989 ViewRefInstalledWatchResult,
1990 fidl::encoding::DefaultFuchsiaResourceDialect,
1991 >;
1992 fn r#watch(&self, mut view_ref: ViewRef) -> Self::WatchResponseFut {
1993 fn _decode(
1994 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1995 ) -> Result<ViewRefInstalledWatchResult, fidl::Error> {
1996 let _response = fidl::client::decode_transaction_body::<
1997 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ViewRefInstalledError>,
1998 fidl::encoding::DefaultFuchsiaResourceDialect,
1999 0x7ddec2f4ca687971,
2000 >(_buf?)?;
2001 Ok(_response.map(|x| x))
2002 }
2003 self.client
2004 .send_query_and_decode::<ViewRefInstalledWatchRequest, ViewRefInstalledWatchResult>(
2005 (&mut view_ref,),
2006 0x7ddec2f4ca687971,
2007 fidl::encoding::DynamicFlags::empty(),
2008 _decode,
2009 )
2010 }
2011}
2012
2013pub struct ViewRefInstalledEventStream {
2014 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2015}
2016
2017impl std::marker::Unpin for ViewRefInstalledEventStream {}
2018
2019impl futures::stream::FusedStream for ViewRefInstalledEventStream {
2020 fn is_terminated(&self) -> bool {
2021 self.event_receiver.is_terminated()
2022 }
2023}
2024
2025impl futures::Stream for ViewRefInstalledEventStream {
2026 type Item = Result<ViewRefInstalledEvent, fidl::Error>;
2027
2028 fn poll_next(
2029 mut self: std::pin::Pin<&mut Self>,
2030 cx: &mut std::task::Context<'_>,
2031 ) -> std::task::Poll<Option<Self::Item>> {
2032 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2033 &mut self.event_receiver,
2034 cx
2035 )?) {
2036 Some(buf) => std::task::Poll::Ready(Some(ViewRefInstalledEvent::decode(buf))),
2037 None => std::task::Poll::Ready(None),
2038 }
2039 }
2040}
2041
2042#[derive(Debug)]
2043pub enum ViewRefInstalledEvent {}
2044
2045impl ViewRefInstalledEvent {
2046 fn decode(
2048 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2049 ) -> Result<ViewRefInstalledEvent, fidl::Error> {
2050 let (bytes, _handles) = buf.split_mut();
2051 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2052 debug_assert_eq!(tx_header.tx_id, 0);
2053 match tx_header.ordinal {
2054 _ => Err(fidl::Error::UnknownOrdinal {
2055 ordinal: tx_header.ordinal,
2056 protocol_name:
2057 <ViewRefInstalledMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2058 }),
2059 }
2060 }
2061}
2062
2063pub struct ViewRefInstalledRequestStream {
2065 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2066 is_terminated: bool,
2067}
2068
2069impl std::marker::Unpin for ViewRefInstalledRequestStream {}
2070
2071impl futures::stream::FusedStream for ViewRefInstalledRequestStream {
2072 fn is_terminated(&self) -> bool {
2073 self.is_terminated
2074 }
2075}
2076
2077impl fidl::endpoints::RequestStream for ViewRefInstalledRequestStream {
2078 type Protocol = ViewRefInstalledMarker;
2079 type ControlHandle = ViewRefInstalledControlHandle;
2080
2081 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2082 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2083 }
2084
2085 fn control_handle(&self) -> Self::ControlHandle {
2086 ViewRefInstalledControlHandle { inner: self.inner.clone() }
2087 }
2088
2089 fn into_inner(
2090 self,
2091 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2092 {
2093 (self.inner, self.is_terminated)
2094 }
2095
2096 fn from_inner(
2097 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2098 is_terminated: bool,
2099 ) -> Self {
2100 Self { inner, is_terminated }
2101 }
2102}
2103
2104impl futures::Stream for ViewRefInstalledRequestStream {
2105 type Item = Result<ViewRefInstalledRequest, fidl::Error>;
2106
2107 fn poll_next(
2108 mut self: std::pin::Pin<&mut Self>,
2109 cx: &mut std::task::Context<'_>,
2110 ) -> std::task::Poll<Option<Self::Item>> {
2111 let this = &mut *self;
2112 if this.inner.check_shutdown(cx) {
2113 this.is_terminated = true;
2114 return std::task::Poll::Ready(None);
2115 }
2116 if this.is_terminated {
2117 panic!("polled ViewRefInstalledRequestStream after completion");
2118 }
2119 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2120 |bytes, handles| {
2121 match this.inner.channel().read_etc(cx, bytes, handles) {
2122 std::task::Poll::Ready(Ok(())) => {}
2123 std::task::Poll::Pending => return std::task::Poll::Pending,
2124 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2125 this.is_terminated = true;
2126 return std::task::Poll::Ready(None);
2127 }
2128 std::task::Poll::Ready(Err(e)) => {
2129 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2130 e.into(),
2131 ))))
2132 }
2133 }
2134
2135 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2137
2138 std::task::Poll::Ready(Some(match header.ordinal {
2139 0x7ddec2f4ca687971 => {
2140 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2141 let mut req = fidl::new_empty!(
2142 ViewRefInstalledWatchRequest,
2143 fidl::encoding::DefaultFuchsiaResourceDialect
2144 );
2145 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ViewRefInstalledWatchRequest>(&header, _body_bytes, handles, &mut req)?;
2146 let control_handle =
2147 ViewRefInstalledControlHandle { inner: this.inner.clone() };
2148 Ok(ViewRefInstalledRequest::Watch {
2149 view_ref: req.view_ref,
2150
2151 responder: ViewRefInstalledWatchResponder {
2152 control_handle: std::mem::ManuallyDrop::new(control_handle),
2153 tx_id: header.tx_id,
2154 },
2155 })
2156 }
2157 _ => Err(fidl::Error::UnknownOrdinal {
2158 ordinal: header.ordinal,
2159 protocol_name:
2160 <ViewRefInstalledMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2161 }),
2162 }))
2163 },
2164 )
2165 }
2166}
2167
2168#[derive(Debug)]
2180pub enum ViewRefInstalledRequest {
2181 Watch { view_ref: ViewRef, responder: ViewRefInstalledWatchResponder },
2197}
2198
2199impl ViewRefInstalledRequest {
2200 #[allow(irrefutable_let_patterns)]
2201 pub fn into_watch(self) -> Option<(ViewRef, ViewRefInstalledWatchResponder)> {
2202 if let ViewRefInstalledRequest::Watch { view_ref, responder } = self {
2203 Some((view_ref, responder))
2204 } else {
2205 None
2206 }
2207 }
2208
2209 pub fn method_name(&self) -> &'static str {
2211 match *self {
2212 ViewRefInstalledRequest::Watch { .. } => "watch",
2213 }
2214 }
2215}
2216
2217#[derive(Debug, Clone)]
2218pub struct ViewRefInstalledControlHandle {
2219 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2220}
2221
2222impl fidl::endpoints::ControlHandle for ViewRefInstalledControlHandle {
2223 fn shutdown(&self) {
2224 self.inner.shutdown()
2225 }
2226 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2227 self.inner.shutdown_with_epitaph(status)
2228 }
2229
2230 fn is_closed(&self) -> bool {
2231 self.inner.channel().is_closed()
2232 }
2233 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2234 self.inner.channel().on_closed()
2235 }
2236
2237 #[cfg(target_os = "fuchsia")]
2238 fn signal_peer(
2239 &self,
2240 clear_mask: zx::Signals,
2241 set_mask: zx::Signals,
2242 ) -> Result<(), zx_status::Status> {
2243 use fidl::Peered;
2244 self.inner.channel().signal_peer(clear_mask, set_mask)
2245 }
2246}
2247
2248impl ViewRefInstalledControlHandle {}
2249
2250#[must_use = "FIDL methods require a response to be sent"]
2251#[derive(Debug)]
2252pub struct ViewRefInstalledWatchResponder {
2253 control_handle: std::mem::ManuallyDrop<ViewRefInstalledControlHandle>,
2254 tx_id: u32,
2255}
2256
2257impl std::ops::Drop for ViewRefInstalledWatchResponder {
2261 fn drop(&mut self) {
2262 self.control_handle.shutdown();
2263 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2265 }
2266}
2267
2268impl fidl::endpoints::Responder for ViewRefInstalledWatchResponder {
2269 type ControlHandle = ViewRefInstalledControlHandle;
2270
2271 fn control_handle(&self) -> &ViewRefInstalledControlHandle {
2272 &self.control_handle
2273 }
2274
2275 fn drop_without_shutdown(mut self) {
2276 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2278 std::mem::forget(self);
2280 }
2281}
2282
2283impl ViewRefInstalledWatchResponder {
2284 pub fn send(self, mut result: Result<(), ViewRefInstalledError>) -> Result<(), fidl::Error> {
2288 let _result = self.send_raw(result);
2289 if _result.is_err() {
2290 self.control_handle.shutdown();
2291 }
2292 self.drop_without_shutdown();
2293 _result
2294 }
2295
2296 pub fn send_no_shutdown_on_err(
2298 self,
2299 mut result: Result<(), ViewRefInstalledError>,
2300 ) -> Result<(), fidl::Error> {
2301 let _result = self.send_raw(result);
2302 self.drop_without_shutdown();
2303 _result
2304 }
2305
2306 fn send_raw(&self, mut result: Result<(), ViewRefInstalledError>) -> Result<(), fidl::Error> {
2307 self.control_handle.inner.send::<fidl::encoding::ResultType<
2308 fidl::encoding::EmptyStruct,
2309 ViewRefInstalledError,
2310 >>(
2311 result,
2312 self.tx_id,
2313 0x7ddec2f4ca687971,
2314 fidl::encoding::DynamicFlags::empty(),
2315 )
2316 }
2317}
2318
2319mod internal {
2320 use super::*;
2321
2322 impl fidl::encoding::ResourceTypeMarker for FocuserRequestFocusRequest {
2323 type Borrowed<'a> = &'a mut Self;
2324 fn take_or_borrow<'a>(
2325 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2326 ) -> Self::Borrowed<'a> {
2327 value
2328 }
2329 }
2330
2331 unsafe impl fidl::encoding::TypeMarker for FocuserRequestFocusRequest {
2332 type Owned = Self;
2333
2334 #[inline(always)]
2335 fn inline_align(_context: fidl::encoding::Context) -> usize {
2336 4
2337 }
2338
2339 #[inline(always)]
2340 fn inline_size(_context: fidl::encoding::Context) -> usize {
2341 4
2342 }
2343 }
2344
2345 unsafe impl
2346 fidl::encoding::Encode<
2347 FocuserRequestFocusRequest,
2348 fidl::encoding::DefaultFuchsiaResourceDialect,
2349 > for &mut FocuserRequestFocusRequest
2350 {
2351 #[inline]
2352 unsafe fn encode(
2353 self,
2354 encoder: &mut fidl::encoding::Encoder<
2355 '_,
2356 fidl::encoding::DefaultFuchsiaResourceDialect,
2357 >,
2358 offset: usize,
2359 _depth: fidl::encoding::Depth,
2360 ) -> fidl::Result<()> {
2361 encoder.debug_check_bounds::<FocuserRequestFocusRequest>(offset);
2362 fidl::encoding::Encode::<
2364 FocuserRequestFocusRequest,
2365 fidl::encoding::DefaultFuchsiaResourceDialect,
2366 >::encode(
2367 (<ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2368 &mut self.view_ref,
2369 ),),
2370 encoder,
2371 offset,
2372 _depth,
2373 )
2374 }
2375 }
2376 unsafe impl<T0: fidl::encoding::Encode<ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect>>
2377 fidl::encoding::Encode<
2378 FocuserRequestFocusRequest,
2379 fidl::encoding::DefaultFuchsiaResourceDialect,
2380 > for (T0,)
2381 {
2382 #[inline]
2383 unsafe fn encode(
2384 self,
2385 encoder: &mut fidl::encoding::Encoder<
2386 '_,
2387 fidl::encoding::DefaultFuchsiaResourceDialect,
2388 >,
2389 offset: usize,
2390 depth: fidl::encoding::Depth,
2391 ) -> fidl::Result<()> {
2392 encoder.debug_check_bounds::<FocuserRequestFocusRequest>(offset);
2393 self.0.encode(encoder, offset + 0, depth)?;
2397 Ok(())
2398 }
2399 }
2400
2401 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2402 for FocuserRequestFocusRequest
2403 {
2404 #[inline(always)]
2405 fn new_empty() -> Self {
2406 Self {
2407 view_ref: fidl::new_empty!(ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect),
2408 }
2409 }
2410
2411 #[inline]
2412 unsafe fn decode(
2413 &mut self,
2414 decoder: &mut fidl::encoding::Decoder<
2415 '_,
2416 fidl::encoding::DefaultFuchsiaResourceDialect,
2417 >,
2418 offset: usize,
2419 _depth: fidl::encoding::Depth,
2420 ) -> fidl::Result<()> {
2421 decoder.debug_check_bounds::<Self>(offset);
2422 fidl::decode!(
2424 ViewRef,
2425 fidl::encoding::DefaultFuchsiaResourceDialect,
2426 &mut self.view_ref,
2427 decoder,
2428 offset + 0,
2429 _depth
2430 )?;
2431 Ok(())
2432 }
2433 }
2434
2435 impl fidl::encoding::ResourceTypeMarker for ViewCreationToken {
2436 type Borrowed<'a> = &'a mut Self;
2437 fn take_or_borrow<'a>(
2438 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2439 ) -> Self::Borrowed<'a> {
2440 value
2441 }
2442 }
2443
2444 unsafe impl fidl::encoding::TypeMarker for ViewCreationToken {
2445 type Owned = Self;
2446
2447 #[inline(always)]
2448 fn inline_align(_context: fidl::encoding::Context) -> usize {
2449 4
2450 }
2451
2452 #[inline(always)]
2453 fn inline_size(_context: fidl::encoding::Context) -> usize {
2454 4
2455 }
2456 }
2457
2458 unsafe impl
2459 fidl::encoding::Encode<ViewCreationToken, fidl::encoding::DefaultFuchsiaResourceDialect>
2460 for &mut ViewCreationToken
2461 {
2462 #[inline]
2463 unsafe fn encode(
2464 self,
2465 encoder: &mut fidl::encoding::Encoder<
2466 '_,
2467 fidl::encoding::DefaultFuchsiaResourceDialect,
2468 >,
2469 offset: usize,
2470 _depth: fidl::encoding::Depth,
2471 ) -> fidl::Result<()> {
2472 encoder.debug_check_bounds::<ViewCreationToken>(offset);
2473 fidl::encoding::Encode::<ViewCreationToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2475 (
2476 <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.value),
2477 ),
2478 encoder, offset, _depth
2479 )
2480 }
2481 }
2482 unsafe impl<
2483 T0: fidl::encoding::Encode<
2484 fidl::encoding::HandleType<
2485 fidl::Channel,
2486 { fidl::ObjectType::CHANNEL.into_raw() },
2487 2147483648,
2488 >,
2489 fidl::encoding::DefaultFuchsiaResourceDialect,
2490 >,
2491 >
2492 fidl::encoding::Encode<ViewCreationToken, fidl::encoding::DefaultFuchsiaResourceDialect>
2493 for (T0,)
2494 {
2495 #[inline]
2496 unsafe fn encode(
2497 self,
2498 encoder: &mut fidl::encoding::Encoder<
2499 '_,
2500 fidl::encoding::DefaultFuchsiaResourceDialect,
2501 >,
2502 offset: usize,
2503 depth: fidl::encoding::Depth,
2504 ) -> fidl::Result<()> {
2505 encoder.debug_check_bounds::<ViewCreationToken>(offset);
2506 self.0.encode(encoder, offset + 0, depth)?;
2510 Ok(())
2511 }
2512 }
2513
2514 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2515 for ViewCreationToken
2516 {
2517 #[inline(always)]
2518 fn new_empty() -> Self {
2519 Self {
2520 value: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2521 }
2522 }
2523
2524 #[inline]
2525 unsafe fn decode(
2526 &mut self,
2527 decoder: &mut fidl::encoding::Decoder<
2528 '_,
2529 fidl::encoding::DefaultFuchsiaResourceDialect,
2530 >,
2531 offset: usize,
2532 _depth: fidl::encoding::Depth,
2533 ) -> fidl::Result<()> {
2534 decoder.debug_check_bounds::<Self>(offset);
2535 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 0, _depth)?;
2537 Ok(())
2538 }
2539 }
2540
2541 impl fidl::encoding::ResourceTypeMarker for ViewHolderToken {
2542 type Borrowed<'a> = &'a mut Self;
2543 fn take_or_borrow<'a>(
2544 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2545 ) -> Self::Borrowed<'a> {
2546 value
2547 }
2548 }
2549
2550 unsafe impl fidl::encoding::TypeMarker for ViewHolderToken {
2551 type Owned = Self;
2552
2553 #[inline(always)]
2554 fn inline_align(_context: fidl::encoding::Context) -> usize {
2555 4
2556 }
2557
2558 #[inline(always)]
2559 fn inline_size(_context: fidl::encoding::Context) -> usize {
2560 4
2561 }
2562 }
2563
2564 unsafe impl
2565 fidl::encoding::Encode<ViewHolderToken, fidl::encoding::DefaultFuchsiaResourceDialect>
2566 for &mut ViewHolderToken
2567 {
2568 #[inline]
2569 unsafe fn encode(
2570 self,
2571 encoder: &mut fidl::encoding::Encoder<
2572 '_,
2573 fidl::encoding::DefaultFuchsiaResourceDialect,
2574 >,
2575 offset: usize,
2576 _depth: fidl::encoding::Depth,
2577 ) -> fidl::Result<()> {
2578 encoder.debug_check_bounds::<ViewHolderToken>(offset);
2579 fidl::encoding::Encode::<ViewHolderToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2581 (
2582 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.value),
2583 ),
2584 encoder, offset, _depth
2585 )
2586 }
2587 }
2588 unsafe impl<
2589 T0: fidl::encoding::Encode<
2590 fidl::encoding::HandleType<
2591 fidl::EventPair,
2592 { fidl::ObjectType::EVENTPAIR.into_raw() },
2593 2147483648,
2594 >,
2595 fidl::encoding::DefaultFuchsiaResourceDialect,
2596 >,
2597 > fidl::encoding::Encode<ViewHolderToken, fidl::encoding::DefaultFuchsiaResourceDialect>
2598 for (T0,)
2599 {
2600 #[inline]
2601 unsafe fn encode(
2602 self,
2603 encoder: &mut fidl::encoding::Encoder<
2604 '_,
2605 fidl::encoding::DefaultFuchsiaResourceDialect,
2606 >,
2607 offset: usize,
2608 depth: fidl::encoding::Depth,
2609 ) -> fidl::Result<()> {
2610 encoder.debug_check_bounds::<ViewHolderToken>(offset);
2611 self.0.encode(encoder, offset + 0, depth)?;
2615 Ok(())
2616 }
2617 }
2618
2619 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2620 for ViewHolderToken
2621 {
2622 #[inline(always)]
2623 fn new_empty() -> Self {
2624 Self {
2625 value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2626 }
2627 }
2628
2629 #[inline]
2630 unsafe fn decode(
2631 &mut self,
2632 decoder: &mut fidl::encoding::Decoder<
2633 '_,
2634 fidl::encoding::DefaultFuchsiaResourceDialect,
2635 >,
2636 offset: usize,
2637 _depth: fidl::encoding::Depth,
2638 ) -> fidl::Result<()> {
2639 decoder.debug_check_bounds::<Self>(offset);
2640 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 0, _depth)?;
2642 Ok(())
2643 }
2644 }
2645
2646 impl fidl::encoding::ResourceTypeMarker for ViewIdentityOnCreation {
2647 type Borrowed<'a> = &'a mut Self;
2648 fn take_or_borrow<'a>(
2649 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2650 ) -> Self::Borrowed<'a> {
2651 value
2652 }
2653 }
2654
2655 unsafe impl fidl::encoding::TypeMarker for ViewIdentityOnCreation {
2656 type Owned = Self;
2657
2658 #[inline(always)]
2659 fn inline_align(_context: fidl::encoding::Context) -> usize {
2660 4
2661 }
2662
2663 #[inline(always)]
2664 fn inline_size(_context: fidl::encoding::Context) -> usize {
2665 8
2666 }
2667 }
2668
2669 unsafe impl
2670 fidl::encoding::Encode<
2671 ViewIdentityOnCreation,
2672 fidl::encoding::DefaultFuchsiaResourceDialect,
2673 > for &mut ViewIdentityOnCreation
2674 {
2675 #[inline]
2676 unsafe fn encode(
2677 self,
2678 encoder: &mut fidl::encoding::Encoder<
2679 '_,
2680 fidl::encoding::DefaultFuchsiaResourceDialect,
2681 >,
2682 offset: usize,
2683 _depth: fidl::encoding::Depth,
2684 ) -> fidl::Result<()> {
2685 encoder.debug_check_bounds::<ViewIdentityOnCreation>(offset);
2686 fidl::encoding::Encode::<
2688 ViewIdentityOnCreation,
2689 fidl::encoding::DefaultFuchsiaResourceDialect,
2690 >::encode(
2691 (
2692 <ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2693 &mut self.view_ref,
2694 ),
2695 <ViewRefControl as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2696 &mut self.view_ref_control,
2697 ),
2698 ),
2699 encoder,
2700 offset,
2701 _depth,
2702 )
2703 }
2704 }
2705 unsafe impl<
2706 T0: fidl::encoding::Encode<ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect>,
2707 T1: fidl::encoding::Encode<ViewRefControl, fidl::encoding::DefaultFuchsiaResourceDialect>,
2708 >
2709 fidl::encoding::Encode<
2710 ViewIdentityOnCreation,
2711 fidl::encoding::DefaultFuchsiaResourceDialect,
2712 > for (T0, T1)
2713 {
2714 #[inline]
2715 unsafe fn encode(
2716 self,
2717 encoder: &mut fidl::encoding::Encoder<
2718 '_,
2719 fidl::encoding::DefaultFuchsiaResourceDialect,
2720 >,
2721 offset: usize,
2722 depth: fidl::encoding::Depth,
2723 ) -> fidl::Result<()> {
2724 encoder.debug_check_bounds::<ViewIdentityOnCreation>(offset);
2725 self.0.encode(encoder, offset + 0, depth)?;
2729 self.1.encode(encoder, offset + 4, depth)?;
2730 Ok(())
2731 }
2732 }
2733
2734 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2735 for ViewIdentityOnCreation
2736 {
2737 #[inline(always)]
2738 fn new_empty() -> Self {
2739 Self {
2740 view_ref: fidl::new_empty!(ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect),
2741 view_ref_control: fidl::new_empty!(
2742 ViewRefControl,
2743 fidl::encoding::DefaultFuchsiaResourceDialect
2744 ),
2745 }
2746 }
2747
2748 #[inline]
2749 unsafe fn decode(
2750 &mut self,
2751 decoder: &mut fidl::encoding::Decoder<
2752 '_,
2753 fidl::encoding::DefaultFuchsiaResourceDialect,
2754 >,
2755 offset: usize,
2756 _depth: fidl::encoding::Depth,
2757 ) -> fidl::Result<()> {
2758 decoder.debug_check_bounds::<Self>(offset);
2759 fidl::decode!(
2761 ViewRef,
2762 fidl::encoding::DefaultFuchsiaResourceDialect,
2763 &mut self.view_ref,
2764 decoder,
2765 offset + 0,
2766 _depth
2767 )?;
2768 fidl::decode!(
2769 ViewRefControl,
2770 fidl::encoding::DefaultFuchsiaResourceDialect,
2771 &mut self.view_ref_control,
2772 decoder,
2773 offset + 4,
2774 _depth
2775 )?;
2776 Ok(())
2777 }
2778 }
2779
2780 impl fidl::encoding::ResourceTypeMarker for ViewPresentRequest {
2781 type Borrowed<'a> = &'a mut Self;
2782 fn take_or_borrow<'a>(
2783 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2784 ) -> Self::Borrowed<'a> {
2785 value
2786 }
2787 }
2788
2789 unsafe impl fidl::encoding::TypeMarker for ViewPresentRequest {
2790 type Owned = Self;
2791
2792 #[inline(always)]
2793 fn inline_align(_context: fidl::encoding::Context) -> usize {
2794 4
2795 }
2796
2797 #[inline(always)]
2798 fn inline_size(_context: fidl::encoding::Context) -> usize {
2799 4
2800 }
2801 }
2802
2803 unsafe impl
2804 fidl::encoding::Encode<ViewPresentRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2805 for &mut ViewPresentRequest
2806 {
2807 #[inline]
2808 unsafe fn encode(
2809 self,
2810 encoder: &mut fidl::encoding::Encoder<
2811 '_,
2812 fidl::encoding::DefaultFuchsiaResourceDialect,
2813 >,
2814 offset: usize,
2815 _depth: fidl::encoding::Depth,
2816 ) -> fidl::Result<()> {
2817 encoder.debug_check_bounds::<ViewPresentRequest>(offset);
2818 fidl::encoding::Encode::<
2820 ViewPresentRequest,
2821 fidl::encoding::DefaultFuchsiaResourceDialect,
2822 >::encode(
2823 (<ViewToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2824 &mut self.view_token,
2825 ),),
2826 encoder,
2827 offset,
2828 _depth,
2829 )
2830 }
2831 }
2832 unsafe impl<T0: fidl::encoding::Encode<ViewToken, fidl::encoding::DefaultFuchsiaResourceDialect>>
2833 fidl::encoding::Encode<ViewPresentRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2834 for (T0,)
2835 {
2836 #[inline]
2837 unsafe fn encode(
2838 self,
2839 encoder: &mut fidl::encoding::Encoder<
2840 '_,
2841 fidl::encoding::DefaultFuchsiaResourceDialect,
2842 >,
2843 offset: usize,
2844 depth: fidl::encoding::Depth,
2845 ) -> fidl::Result<()> {
2846 encoder.debug_check_bounds::<ViewPresentRequest>(offset);
2847 self.0.encode(encoder, offset + 0, depth)?;
2851 Ok(())
2852 }
2853 }
2854
2855 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2856 for ViewPresentRequest
2857 {
2858 #[inline(always)]
2859 fn new_empty() -> Self {
2860 Self {
2861 view_token: fidl::new_empty!(
2862 ViewToken,
2863 fidl::encoding::DefaultFuchsiaResourceDialect
2864 ),
2865 }
2866 }
2867
2868 #[inline]
2869 unsafe fn decode(
2870 &mut self,
2871 decoder: &mut fidl::encoding::Decoder<
2872 '_,
2873 fidl::encoding::DefaultFuchsiaResourceDialect,
2874 >,
2875 offset: usize,
2876 _depth: fidl::encoding::Depth,
2877 ) -> fidl::Result<()> {
2878 decoder.debug_check_bounds::<Self>(offset);
2879 fidl::decode!(
2881 ViewToken,
2882 fidl::encoding::DefaultFuchsiaResourceDialect,
2883 &mut self.view_token,
2884 decoder,
2885 offset + 0,
2886 _depth
2887 )?;
2888 Ok(())
2889 }
2890 }
2891
2892 impl fidl::encoding::ResourceTypeMarker for ViewRef {
2893 type Borrowed<'a> = &'a mut Self;
2894 fn take_or_borrow<'a>(
2895 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2896 ) -> Self::Borrowed<'a> {
2897 value
2898 }
2899 }
2900
2901 unsafe impl fidl::encoding::TypeMarker for ViewRef {
2902 type Owned = Self;
2903
2904 #[inline(always)]
2905 fn inline_align(_context: fidl::encoding::Context) -> usize {
2906 4
2907 }
2908
2909 #[inline(always)]
2910 fn inline_size(_context: fidl::encoding::Context) -> usize {
2911 4
2912 }
2913 }
2914
2915 unsafe impl fidl::encoding::Encode<ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect>
2916 for &mut ViewRef
2917 {
2918 #[inline]
2919 unsafe fn encode(
2920 self,
2921 encoder: &mut fidl::encoding::Encoder<
2922 '_,
2923 fidl::encoding::DefaultFuchsiaResourceDialect,
2924 >,
2925 offset: usize,
2926 _depth: fidl::encoding::Depth,
2927 ) -> fidl::Result<()> {
2928 encoder.debug_check_bounds::<ViewRef>(offset);
2929 fidl::encoding::Encode::<ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2931 (<fidl::encoding::HandleType<
2932 fidl::EventPair,
2933 { fidl::ObjectType::EVENTPAIR.into_raw() },
2934 2147483648,
2935 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2936 &mut self.reference
2937 ),),
2938 encoder,
2939 offset,
2940 _depth,
2941 )
2942 }
2943 }
2944 unsafe impl<
2945 T0: fidl::encoding::Encode<
2946 fidl::encoding::HandleType<
2947 fidl::EventPair,
2948 { fidl::ObjectType::EVENTPAIR.into_raw() },
2949 2147483648,
2950 >,
2951 fidl::encoding::DefaultFuchsiaResourceDialect,
2952 >,
2953 > fidl::encoding::Encode<ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
2954 {
2955 #[inline]
2956 unsafe fn encode(
2957 self,
2958 encoder: &mut fidl::encoding::Encoder<
2959 '_,
2960 fidl::encoding::DefaultFuchsiaResourceDialect,
2961 >,
2962 offset: usize,
2963 depth: fidl::encoding::Depth,
2964 ) -> fidl::Result<()> {
2965 encoder.debug_check_bounds::<ViewRef>(offset);
2966 self.0.encode(encoder, offset + 0, depth)?;
2970 Ok(())
2971 }
2972 }
2973
2974 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ViewRef {
2975 #[inline(always)]
2976 fn new_empty() -> Self {
2977 Self {
2978 reference: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2979 }
2980 }
2981
2982 #[inline]
2983 unsafe fn decode(
2984 &mut self,
2985 decoder: &mut fidl::encoding::Decoder<
2986 '_,
2987 fidl::encoding::DefaultFuchsiaResourceDialect,
2988 >,
2989 offset: usize,
2990 _depth: fidl::encoding::Depth,
2991 ) -> fidl::Result<()> {
2992 decoder.debug_check_bounds::<Self>(offset);
2993 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.reference, decoder, offset + 0, _depth)?;
2995 Ok(())
2996 }
2997 }
2998
2999 impl fidl::encoding::ResourceTypeMarker for ViewRefControl {
3000 type Borrowed<'a> = &'a mut Self;
3001 fn take_or_borrow<'a>(
3002 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3003 ) -> Self::Borrowed<'a> {
3004 value
3005 }
3006 }
3007
3008 unsafe impl fidl::encoding::TypeMarker for ViewRefControl {
3009 type Owned = Self;
3010
3011 #[inline(always)]
3012 fn inline_align(_context: fidl::encoding::Context) -> usize {
3013 4
3014 }
3015
3016 #[inline(always)]
3017 fn inline_size(_context: fidl::encoding::Context) -> usize {
3018 4
3019 }
3020 }
3021
3022 unsafe impl
3023 fidl::encoding::Encode<ViewRefControl, fidl::encoding::DefaultFuchsiaResourceDialect>
3024 for &mut ViewRefControl
3025 {
3026 #[inline]
3027 unsafe fn encode(
3028 self,
3029 encoder: &mut fidl::encoding::Encoder<
3030 '_,
3031 fidl::encoding::DefaultFuchsiaResourceDialect,
3032 >,
3033 offset: usize,
3034 _depth: fidl::encoding::Depth,
3035 ) -> fidl::Result<()> {
3036 encoder.debug_check_bounds::<ViewRefControl>(offset);
3037 fidl::encoding::Encode::<ViewRefControl, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3039 (
3040 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.reference),
3041 ),
3042 encoder, offset, _depth
3043 )
3044 }
3045 }
3046 unsafe impl<
3047 T0: fidl::encoding::Encode<
3048 fidl::encoding::HandleType<
3049 fidl::EventPair,
3050 { fidl::ObjectType::EVENTPAIR.into_raw() },
3051 2147483648,
3052 >,
3053 fidl::encoding::DefaultFuchsiaResourceDialect,
3054 >,
3055 > fidl::encoding::Encode<ViewRefControl, fidl::encoding::DefaultFuchsiaResourceDialect>
3056 for (T0,)
3057 {
3058 #[inline]
3059 unsafe fn encode(
3060 self,
3061 encoder: &mut fidl::encoding::Encoder<
3062 '_,
3063 fidl::encoding::DefaultFuchsiaResourceDialect,
3064 >,
3065 offset: usize,
3066 depth: fidl::encoding::Depth,
3067 ) -> fidl::Result<()> {
3068 encoder.debug_check_bounds::<ViewRefControl>(offset);
3069 self.0.encode(encoder, offset + 0, depth)?;
3073 Ok(())
3074 }
3075 }
3076
3077 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3078 for ViewRefControl
3079 {
3080 #[inline(always)]
3081 fn new_empty() -> Self {
3082 Self {
3083 reference: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3084 }
3085 }
3086
3087 #[inline]
3088 unsafe fn decode(
3089 &mut self,
3090 decoder: &mut fidl::encoding::Decoder<
3091 '_,
3092 fidl::encoding::DefaultFuchsiaResourceDialect,
3093 >,
3094 offset: usize,
3095 _depth: fidl::encoding::Depth,
3096 ) -> fidl::Result<()> {
3097 decoder.debug_check_bounds::<Self>(offset);
3098 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.reference, decoder, offset + 0, _depth)?;
3100 Ok(())
3101 }
3102 }
3103
3104 impl fidl::encoding::ResourceTypeMarker for ViewRefInstalledWatchRequest {
3105 type Borrowed<'a> = &'a mut Self;
3106 fn take_or_borrow<'a>(
3107 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3108 ) -> Self::Borrowed<'a> {
3109 value
3110 }
3111 }
3112
3113 unsafe impl fidl::encoding::TypeMarker for ViewRefInstalledWatchRequest {
3114 type Owned = Self;
3115
3116 #[inline(always)]
3117 fn inline_align(_context: fidl::encoding::Context) -> usize {
3118 4
3119 }
3120
3121 #[inline(always)]
3122 fn inline_size(_context: fidl::encoding::Context) -> usize {
3123 4
3124 }
3125 }
3126
3127 unsafe impl
3128 fidl::encoding::Encode<
3129 ViewRefInstalledWatchRequest,
3130 fidl::encoding::DefaultFuchsiaResourceDialect,
3131 > for &mut ViewRefInstalledWatchRequest
3132 {
3133 #[inline]
3134 unsafe fn encode(
3135 self,
3136 encoder: &mut fidl::encoding::Encoder<
3137 '_,
3138 fidl::encoding::DefaultFuchsiaResourceDialect,
3139 >,
3140 offset: usize,
3141 _depth: fidl::encoding::Depth,
3142 ) -> fidl::Result<()> {
3143 encoder.debug_check_bounds::<ViewRefInstalledWatchRequest>(offset);
3144 fidl::encoding::Encode::<
3146 ViewRefInstalledWatchRequest,
3147 fidl::encoding::DefaultFuchsiaResourceDialect,
3148 >::encode(
3149 (<ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3150 &mut self.view_ref,
3151 ),),
3152 encoder,
3153 offset,
3154 _depth,
3155 )
3156 }
3157 }
3158 unsafe impl<T0: fidl::encoding::Encode<ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect>>
3159 fidl::encoding::Encode<
3160 ViewRefInstalledWatchRequest,
3161 fidl::encoding::DefaultFuchsiaResourceDialect,
3162 > for (T0,)
3163 {
3164 #[inline]
3165 unsafe fn encode(
3166 self,
3167 encoder: &mut fidl::encoding::Encoder<
3168 '_,
3169 fidl::encoding::DefaultFuchsiaResourceDialect,
3170 >,
3171 offset: usize,
3172 depth: fidl::encoding::Depth,
3173 ) -> fidl::Result<()> {
3174 encoder.debug_check_bounds::<ViewRefInstalledWatchRequest>(offset);
3175 self.0.encode(encoder, offset + 0, depth)?;
3179 Ok(())
3180 }
3181 }
3182
3183 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3184 for ViewRefInstalledWatchRequest
3185 {
3186 #[inline(always)]
3187 fn new_empty() -> Self {
3188 Self {
3189 view_ref: fidl::new_empty!(ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect),
3190 }
3191 }
3192
3193 #[inline]
3194 unsafe fn decode(
3195 &mut self,
3196 decoder: &mut fidl::encoding::Decoder<
3197 '_,
3198 fidl::encoding::DefaultFuchsiaResourceDialect,
3199 >,
3200 offset: usize,
3201 _depth: fidl::encoding::Depth,
3202 ) -> fidl::Result<()> {
3203 decoder.debug_check_bounds::<Self>(offset);
3204 fidl::decode!(
3206 ViewRef,
3207 fidl::encoding::DefaultFuchsiaResourceDialect,
3208 &mut self.view_ref,
3209 decoder,
3210 offset + 0,
3211 _depth
3212 )?;
3213 Ok(())
3214 }
3215 }
3216
3217 impl fidl::encoding::ResourceTypeMarker for ViewToken {
3218 type Borrowed<'a> = &'a mut Self;
3219 fn take_or_borrow<'a>(
3220 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3221 ) -> Self::Borrowed<'a> {
3222 value
3223 }
3224 }
3225
3226 unsafe impl fidl::encoding::TypeMarker for ViewToken {
3227 type Owned = Self;
3228
3229 #[inline(always)]
3230 fn inline_align(_context: fidl::encoding::Context) -> usize {
3231 4
3232 }
3233
3234 #[inline(always)]
3235 fn inline_size(_context: fidl::encoding::Context) -> usize {
3236 4
3237 }
3238 }
3239
3240 unsafe impl fidl::encoding::Encode<ViewToken, fidl::encoding::DefaultFuchsiaResourceDialect>
3241 for &mut ViewToken
3242 {
3243 #[inline]
3244 unsafe fn encode(
3245 self,
3246 encoder: &mut fidl::encoding::Encoder<
3247 '_,
3248 fidl::encoding::DefaultFuchsiaResourceDialect,
3249 >,
3250 offset: usize,
3251 _depth: fidl::encoding::Depth,
3252 ) -> fidl::Result<()> {
3253 encoder.debug_check_bounds::<ViewToken>(offset);
3254 fidl::encoding::Encode::<ViewToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3256 (
3257 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.value),
3258 ),
3259 encoder, offset, _depth
3260 )
3261 }
3262 }
3263 unsafe impl<
3264 T0: fidl::encoding::Encode<
3265 fidl::encoding::HandleType<
3266 fidl::EventPair,
3267 { fidl::ObjectType::EVENTPAIR.into_raw() },
3268 2147483648,
3269 >,
3270 fidl::encoding::DefaultFuchsiaResourceDialect,
3271 >,
3272 > fidl::encoding::Encode<ViewToken, fidl::encoding::DefaultFuchsiaResourceDialect>
3273 for (T0,)
3274 {
3275 #[inline]
3276 unsafe fn encode(
3277 self,
3278 encoder: &mut fidl::encoding::Encoder<
3279 '_,
3280 fidl::encoding::DefaultFuchsiaResourceDialect,
3281 >,
3282 offset: usize,
3283 depth: fidl::encoding::Depth,
3284 ) -> fidl::Result<()> {
3285 encoder.debug_check_bounds::<ViewToken>(offset);
3286 self.0.encode(encoder, offset + 0, depth)?;
3290 Ok(())
3291 }
3292 }
3293
3294 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ViewToken {
3295 #[inline(always)]
3296 fn new_empty() -> Self {
3297 Self {
3298 value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3299 }
3300 }
3301
3302 #[inline]
3303 unsafe fn decode(
3304 &mut self,
3305 decoder: &mut fidl::encoding::Decoder<
3306 '_,
3307 fidl::encoding::DefaultFuchsiaResourceDialect,
3308 >,
3309 offset: usize,
3310 _depth: fidl::encoding::Depth,
3311 ) -> fidl::Result<()> {
3312 decoder.debug_check_bounds::<Self>(offset);
3313 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 0, _depth)?;
3315 Ok(())
3316 }
3317 }
3318
3319 impl fidl::encoding::ResourceTypeMarker for ViewportCreationToken {
3320 type Borrowed<'a> = &'a mut Self;
3321 fn take_or_borrow<'a>(
3322 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3323 ) -> Self::Borrowed<'a> {
3324 value
3325 }
3326 }
3327
3328 unsafe impl fidl::encoding::TypeMarker for ViewportCreationToken {
3329 type Owned = Self;
3330
3331 #[inline(always)]
3332 fn inline_align(_context: fidl::encoding::Context) -> usize {
3333 4
3334 }
3335
3336 #[inline(always)]
3337 fn inline_size(_context: fidl::encoding::Context) -> usize {
3338 4
3339 }
3340 }
3341
3342 unsafe impl
3343 fidl::encoding::Encode<ViewportCreationToken, fidl::encoding::DefaultFuchsiaResourceDialect>
3344 for &mut ViewportCreationToken
3345 {
3346 #[inline]
3347 unsafe fn encode(
3348 self,
3349 encoder: &mut fidl::encoding::Encoder<
3350 '_,
3351 fidl::encoding::DefaultFuchsiaResourceDialect,
3352 >,
3353 offset: usize,
3354 _depth: fidl::encoding::Depth,
3355 ) -> fidl::Result<()> {
3356 encoder.debug_check_bounds::<ViewportCreationToken>(offset);
3357 fidl::encoding::Encode::<
3359 ViewportCreationToken,
3360 fidl::encoding::DefaultFuchsiaResourceDialect,
3361 >::encode(
3362 (<fidl::encoding::HandleType<
3363 fidl::Channel,
3364 { fidl::ObjectType::CHANNEL.into_raw() },
3365 2147483648,
3366 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3367 &mut self.value
3368 ),),
3369 encoder,
3370 offset,
3371 _depth,
3372 )
3373 }
3374 }
3375 unsafe impl<
3376 T0: fidl::encoding::Encode<
3377 fidl::encoding::HandleType<
3378 fidl::Channel,
3379 { fidl::ObjectType::CHANNEL.into_raw() },
3380 2147483648,
3381 >,
3382 fidl::encoding::DefaultFuchsiaResourceDialect,
3383 >,
3384 >
3385 fidl::encoding::Encode<ViewportCreationToken, fidl::encoding::DefaultFuchsiaResourceDialect>
3386 for (T0,)
3387 {
3388 #[inline]
3389 unsafe fn encode(
3390 self,
3391 encoder: &mut fidl::encoding::Encoder<
3392 '_,
3393 fidl::encoding::DefaultFuchsiaResourceDialect,
3394 >,
3395 offset: usize,
3396 depth: fidl::encoding::Depth,
3397 ) -> fidl::Result<()> {
3398 encoder.debug_check_bounds::<ViewportCreationToken>(offset);
3399 self.0.encode(encoder, offset + 0, depth)?;
3403 Ok(())
3404 }
3405 }
3406
3407 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3408 for ViewportCreationToken
3409 {
3410 #[inline(always)]
3411 fn new_empty() -> Self {
3412 Self {
3413 value: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3414 }
3415 }
3416
3417 #[inline]
3418 unsafe fn decode(
3419 &mut self,
3420 decoder: &mut fidl::encoding::Decoder<
3421 '_,
3422 fidl::encoding::DefaultFuchsiaResourceDialect,
3423 >,
3424 offset: usize,
3425 _depth: fidl::encoding::Depth,
3426 ) -> fidl::Result<()> {
3427 decoder.debug_check_bounds::<Self>(offset);
3428 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 0, _depth)?;
3430 Ok(())
3431 }
3432 }
3433
3434 impl FocuserSetAutoFocusRequest {
3435 #[inline(always)]
3436 fn max_ordinal_present(&self) -> u64 {
3437 if let Some(_) = self.view_ref {
3438 return 1;
3439 }
3440 0
3441 }
3442 }
3443
3444 impl fidl::encoding::ResourceTypeMarker for FocuserSetAutoFocusRequest {
3445 type Borrowed<'a> = &'a mut Self;
3446 fn take_or_borrow<'a>(
3447 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3448 ) -> Self::Borrowed<'a> {
3449 value
3450 }
3451 }
3452
3453 unsafe impl fidl::encoding::TypeMarker for FocuserSetAutoFocusRequest {
3454 type Owned = Self;
3455
3456 #[inline(always)]
3457 fn inline_align(_context: fidl::encoding::Context) -> usize {
3458 8
3459 }
3460
3461 #[inline(always)]
3462 fn inline_size(_context: fidl::encoding::Context) -> usize {
3463 16
3464 }
3465 }
3466
3467 unsafe impl
3468 fidl::encoding::Encode<
3469 FocuserSetAutoFocusRequest,
3470 fidl::encoding::DefaultFuchsiaResourceDialect,
3471 > for &mut FocuserSetAutoFocusRequest
3472 {
3473 unsafe fn encode(
3474 self,
3475 encoder: &mut fidl::encoding::Encoder<
3476 '_,
3477 fidl::encoding::DefaultFuchsiaResourceDialect,
3478 >,
3479 offset: usize,
3480 mut depth: fidl::encoding::Depth,
3481 ) -> fidl::Result<()> {
3482 encoder.debug_check_bounds::<FocuserSetAutoFocusRequest>(offset);
3483 let max_ordinal: u64 = self.max_ordinal_present();
3485 encoder.write_num(max_ordinal, offset);
3486 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3487 if max_ordinal == 0 {
3489 return Ok(());
3490 }
3491 depth.increment()?;
3492 let envelope_size = 8;
3493 let bytes_len = max_ordinal as usize * envelope_size;
3494 #[allow(unused_variables)]
3495 let offset = encoder.out_of_line_offset(bytes_len);
3496 let mut _prev_end_offset: usize = 0;
3497 if 1 > max_ordinal {
3498 return Ok(());
3499 }
3500
3501 let cur_offset: usize = (1 - 1) * envelope_size;
3504
3505 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3507
3508 fidl::encoding::encode_in_envelope_optional::<
3513 ViewRef,
3514 fidl::encoding::DefaultFuchsiaResourceDialect,
3515 >(
3516 self.view_ref
3517 .as_mut()
3518 .map(<ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
3519 encoder,
3520 offset + cur_offset,
3521 depth,
3522 )?;
3523
3524 _prev_end_offset = cur_offset + envelope_size;
3525
3526 Ok(())
3527 }
3528 }
3529
3530 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3531 for FocuserSetAutoFocusRequest
3532 {
3533 #[inline(always)]
3534 fn new_empty() -> Self {
3535 Self::default()
3536 }
3537
3538 unsafe fn decode(
3539 &mut self,
3540 decoder: &mut fidl::encoding::Decoder<
3541 '_,
3542 fidl::encoding::DefaultFuchsiaResourceDialect,
3543 >,
3544 offset: usize,
3545 mut depth: fidl::encoding::Depth,
3546 ) -> fidl::Result<()> {
3547 decoder.debug_check_bounds::<Self>(offset);
3548 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3549 None => return Err(fidl::Error::NotNullable),
3550 Some(len) => len,
3551 };
3552 if len == 0 {
3554 return Ok(());
3555 };
3556 depth.increment()?;
3557 let envelope_size = 8;
3558 let bytes_len = len * envelope_size;
3559 let offset = decoder.out_of_line_offset(bytes_len)?;
3560 let mut _next_ordinal_to_read = 0;
3562 let mut next_offset = offset;
3563 let end_offset = offset + bytes_len;
3564 _next_ordinal_to_read += 1;
3565 if next_offset >= end_offset {
3566 return Ok(());
3567 }
3568
3569 while _next_ordinal_to_read < 1 {
3571 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3572 _next_ordinal_to_read += 1;
3573 next_offset += envelope_size;
3574 }
3575
3576 let next_out_of_line = decoder.next_out_of_line();
3577 let handles_before = decoder.remaining_handles();
3578 if let Some((inlined, num_bytes, num_handles)) =
3579 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3580 {
3581 let member_inline_size =
3582 <ViewRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3583 if inlined != (member_inline_size <= 4) {
3584 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3585 }
3586 let inner_offset;
3587 let mut inner_depth = depth.clone();
3588 if inlined {
3589 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3590 inner_offset = next_offset;
3591 } else {
3592 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3593 inner_depth.increment()?;
3594 }
3595 let val_ref = self.view_ref.get_or_insert_with(|| {
3596 fidl::new_empty!(ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect)
3597 });
3598 fidl::decode!(
3599 ViewRef,
3600 fidl::encoding::DefaultFuchsiaResourceDialect,
3601 val_ref,
3602 decoder,
3603 inner_offset,
3604 inner_depth
3605 )?;
3606 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3607 {
3608 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3609 }
3610 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3611 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3612 }
3613 }
3614
3615 next_offset += envelope_size;
3616
3617 while next_offset < end_offset {
3619 _next_ordinal_to_read += 1;
3620 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3621 next_offset += envelope_size;
3622 }
3623
3624 Ok(())
3625 }
3626 }
3627}