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_web_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ContextCreateFrameRequest {
16 pub frame: fidl::endpoints::ServerEnd<FrameMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ContextCreateFrameRequest {}
20
21#[derive(Debug, PartialEq)]
22pub struct ContextCreateFrameWithParamsRequest {
23 pub params: CreateFrameParams,
24 pub frame: fidl::endpoints::ServerEnd<FrameMarker>,
25}
26
27impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
28 for ContextCreateFrameWithParamsRequest
29{
30}
31
32#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33pub struct ContextGetCookieManagerRequest {
34 pub manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
35}
36
37impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
38 for ContextGetCookieManagerRequest
39{
40}
41
42#[derive(Debug, PartialEq)]
43pub struct ContextProviderCreateRequest {
44 pub params: CreateContextParams,
45 pub context: fidl::endpoints::ServerEnd<ContextMarker>,
46}
47
48impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
49 for ContextProviderCreateRequest
50{
51}
52
53#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
54pub struct CookieManagerGetCookieListRequest {
55 pub url: Option<String>,
56 pub name: Option<String>,
57 pub cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
58}
59
60impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
61 for CookieManagerGetCookieListRequest
62{
63}
64
65#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
66pub struct CookieManagerObserveCookieChangesRequest {
67 pub url: Option<String>,
68 pub name: Option<String>,
69 pub changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
70}
71
72impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
73 for CookieManagerObserveCookieChangesRequest
74{
75}
76
77#[derive(Debug, PartialEq)]
78pub struct CookiesIteratorGetNextResponse {
79 pub changed_cookies: Vec<Cookie>,
80}
81
82impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
83 for CookiesIteratorGetNextResponse
84{
85}
86
87#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
88pub struct DebugEnableDevToolsRequest {
89 pub listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
90}
91
92impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
93 for DebugEnableDevToolsRequest
94{
95}
96
97#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
98pub struct DevToolsListenerOnContextDevToolsAvailableRequest {
99 pub listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
100}
101
102impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
103 for DevToolsListenerOnContextDevToolsAvailableRequest
104{
105}
106
107#[derive(Debug, PartialEq)]
108pub struct FrameAddBeforeLoadJavaScriptRequest {
109 pub id: u64,
110 pub origins: Vec<String>,
111 pub script: fidl_fuchsia_mem::Buffer,
112}
113
114impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
115 for FrameAddBeforeLoadJavaScriptRequest
116{
117}
118
119#[derive(Debug, PartialEq)]
120pub struct FrameCreateView2Request {
121 pub args: CreateView2Args,
122}
123
124impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FrameCreateView2Request {}
125
126#[derive(Debug, PartialEq)]
127pub struct FrameCreateViewRequest {
128 pub view_token: fidl_fuchsia_ui_views::ViewToken,
129}
130
131impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FrameCreateViewRequest {}
132
133#[derive(Debug, PartialEq)]
134pub struct FrameCreateViewWithViewRefRequest {
135 pub view_token: fidl_fuchsia_ui_views::ViewToken,
136 pub view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
137 pub view_ref: fidl_fuchsia_ui_views::ViewRef,
138}
139
140impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
141 for FrameCreateViewWithViewRefRequest
142{
143}
144
145#[derive(Debug, PartialEq)]
146pub struct FrameExecuteJavaScriptNoResultRequest {
147 pub origins: Vec<String>,
148 pub script: fidl_fuchsia_mem::Buffer,
149}
150
151impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
152 for FrameExecuteJavaScriptNoResultRequest
153{
154}
155
156#[derive(Debug, PartialEq)]
157pub struct FrameExecuteJavaScriptRequest {
158 pub origins: Vec<String>,
159 pub script: fidl_fuchsia_mem::Buffer,
160}
161
162impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
163 for FrameExecuteJavaScriptRequest
164{
165}
166
167#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
168pub struct FrameGetMediaPlayerRequest {
169 pub player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
170}
171
172impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
173 for FrameGetMediaPlayerRequest
174{
175}
176
177#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
178pub struct FrameGetNavigationControllerRequest {
179 pub controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
180}
181
182impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
183 for FrameGetNavigationControllerRequest
184{
185}
186
187#[derive(Debug, PartialEq)]
188pub struct FrameHostCreateFrameWithParamsRequest {
189 pub params: CreateFrameParams,
190 pub frame: fidl::endpoints::ServerEnd<FrameMarker>,
191}
192
193impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
194 for FrameHostCreateFrameWithParamsRequest
195{
196}
197
198#[derive(Debug, PartialEq)]
199pub struct FramePostMessageRequest {
200 pub target_origin: String,
201 pub message: WebMessage,
202}
203
204impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FramePostMessageRequest {}
205
206#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
207pub struct FrameSetConsoleLogSinkRequest {
208 pub sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
209}
210
211impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
212 for FrameSetConsoleLogSinkRequest
213{
214}
215
216#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
217pub struct FrameSetNavigationEventListener2Request {
218 pub listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
219 pub flags: NavigationEventListenerFlags,
220}
221
222impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
223 for FrameSetNavigationEventListener2Request
224{
225}
226
227#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
228pub struct FrameSetNavigationEventListenerRequest {
229 pub listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
230}
231
232impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
233 for FrameSetNavigationEventListenerRequest
234{
235}
236
237#[derive(Debug, PartialEq)]
238pub struct FrameSetNavigationPolicyProviderRequest {
239 pub params: NavigationPolicyProviderParams,
240 pub provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
241}
242
243impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
244 for FrameSetNavigationPolicyProviderRequest
245{
246}
247
248#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
249pub struct FrameSetPopupFrameCreationListenerRequest {
250 pub listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
251}
252
253impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
254 for FrameSetPopupFrameCreationListenerRequest
255{
256}
257
258#[derive(Debug, PartialEq)]
259pub struct FrameExecuteJavaScriptResponse {
260 pub result: fidl_fuchsia_mem::Buffer,
261}
262
263impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
264 for FrameExecuteJavaScriptResponse
265{
266}
267
268#[derive(Debug, PartialEq)]
269pub struct MessagePortPostMessageRequest {
270 pub message: WebMessage,
271}
272
273impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
274 for MessagePortPostMessageRequest
275{
276}
277
278#[derive(Debug, PartialEq)]
279pub struct MessagePortReceiveMessageResponse {
280 pub message: WebMessage,
281}
282
283impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
284 for MessagePortReceiveMessageResponse
285{
286}
287
288#[derive(Debug, PartialEq)]
289pub struct NavigationControllerLoadUrlRequest {
290 pub url: String,
291 pub params: LoadUrlParams,
292}
293
294impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
295 for NavigationControllerLoadUrlRequest
296{
297}
298
299#[derive(Debug, PartialEq)]
300pub struct NavigationEventListenerOnNavigationStateChangedRequest {
301 pub change: NavigationState,
302}
303
304impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
305 for NavigationEventListenerOnNavigationStateChangedRequest
306{
307}
308
309#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
310pub struct NavigationPolicyProviderEvaluateRequestedNavigationResponse {
311 pub decision: NavigationDecision,
312}
313
314impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
315 for NavigationPolicyProviderEvaluateRequestedNavigationResponse
316{
317}
318
319#[derive(Debug, PartialEq)]
320pub struct PopupFrameCreationListenerOnPopupFrameCreatedRequest {
321 pub frame: fidl::endpoints::ClientEnd<FrameMarker>,
322 pub info: PopupFrameCreationInfo,
323}
324
325impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
326 for PopupFrameCreationListenerOnPopupFrameCreatedRequest
327{
328}
329
330#[derive(Debug, Default, PartialEq)]
351pub struct ContentDirectoryProvider {
352 pub name: Option<String>,
355 pub directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
357 #[doc(hidden)]
358 pub __source_breaking: fidl::marker::SourceBreaking,
359}
360
361impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ContentDirectoryProvider {}
362
363#[derive(Debug, Default, PartialEq)]
364pub struct Cookie {
365 pub id: Option<CookieId>,
367 pub value: Option<String>,
371 #[doc(hidden)]
372 pub __source_breaking: fidl::marker::SourceBreaking,
373}
374
375impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Cookie {}
376
377#[derive(Debug, Default, PartialEq)]
379pub struct CreateContextParams {
380 pub service_directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
410 pub data_directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
416 pub user_agent_product: Option<String>,
421 pub user_agent_version: Option<String>,
425 pub remote_debugging_port: Option<u16>,
433 pub content_directories: Option<Vec<ContentDirectoryProvider>>,
435 pub features: Option<ContextFeatureFlags>,
438 pub playready_key_system: Option<String>,
445 pub unsafely_treat_insecure_origins_as_secure: Option<Vec<String>>,
451 pub cors_exempt_headers: Option<Vec<Vec<u8>>>,
454 pub cdm_data_directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
465 pub cdm_data_quota_bytes: Option<u64>,
469 pub data_quota_bytes: Option<u64>,
473 #[doc(hidden)]
474 pub __source_breaking: fidl::marker::SourceBreaking,
475}
476
477impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateContextParams {}
478
479#[derive(Debug, Default, PartialEq)]
481pub struct CreateFrameParams {
482 pub enable_remote_debugging: Option<bool>,
486 pub debug_name: Option<String>,
491 pub explicit_sites_filter_error_page: Option<fidl_fuchsia_mem::Data>,
500 #[doc(hidden)]
501 pub __source_breaking: fidl::marker::SourceBreaking,
502}
503
504impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateFrameParams {}
505
506#[derive(Debug, Default, PartialEq)]
508pub struct CreateView2Args {
509 pub view_creation_token: Option<fidl_fuchsia_ui_views::ViewCreationToken>,
512 #[doc(hidden)]
513 pub __source_breaking: fidl::marker::SourceBreaking,
514}
515
516impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateView2Args {}
517
518#[derive(Debug, Default, PartialEq)]
521pub struct Favicon {
522 pub data: Option<fidl_fuchsia_mem::Buffer>,
526 pub width: Option<u32>,
528 pub height: Option<u32>,
530 #[doc(hidden)]
531 pub __source_breaking: fidl::marker::SourceBreaking,
532}
533
534impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Favicon {}
535
536#[derive(Debug, Default, PartialEq)]
538pub struct LoadUrlParams {
539 pub type_: Option<LoadUrlReason>,
541 pub referrer_url: Option<String>,
543 pub was_user_activated: Option<bool>,
547 pub headers: Option<Vec<fidl_fuchsia_net_http::Header>>,
550 #[doc(hidden)]
551 pub __source_breaking: fidl::marker::SourceBreaking,
552}
553
554impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LoadUrlParams {}
555
556#[derive(Debug, Default, PartialEq)]
558pub struct NavigationState {
559 pub url: Option<String>,
561 pub title: Option<String>,
564 pub page_type: Option<PageType>,
566 pub can_go_forward: Option<bool>,
568 pub can_go_back: Option<bool>,
570 pub is_main_document_loaded: Option<bool>,
572 pub favicon: Option<Favicon>,
575 pub error_detail: Option<ErrorDetail>,
577 #[doc(hidden)]
578 pub __source_breaking: fidl::marker::SourceBreaking,
579}
580
581impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NavigationState {}
582
583#[derive(Debug, Default, PartialEq)]
585pub struct PopupFrameCreationInfo {
586 pub initial_url: Option<String>,
588 pub initiated_by_user: Option<bool>,
591 #[doc(hidden)]
592 pub __source_breaking: fidl::marker::SourceBreaking,
593}
594
595impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PopupFrameCreationInfo {}
596
597#[derive(Debug, Default, PartialEq)]
598pub struct WebMessage {
599 pub data: Option<fidl_fuchsia_mem::Buffer>,
601 pub incoming_transfer: Option<Vec<IncomingTransferable>>,
603 pub outgoing_transfer: Option<Vec<OutgoingTransferable>>,
605 #[doc(hidden)]
606 pub __source_breaking: fidl::marker::SourceBreaking,
607}
608
609impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WebMessage {}
610
611#[derive(Debug)]
612pub enum IncomingTransferable {
613 MessagePort(fidl::endpoints::ClientEnd<MessagePortMarker>),
614 #[doc(hidden)]
615 __SourceBreaking {
616 unknown_ordinal: u64,
617 },
618}
619
620#[macro_export]
622macro_rules! IncomingTransferableUnknown {
623 () => {
624 _
625 };
626}
627
628impl PartialEq for IncomingTransferable {
630 fn eq(&self, other: &Self) -> bool {
631 match (self, other) {
632 (Self::MessagePort(x), Self::MessagePort(y)) => *x == *y,
633 _ => false,
634 }
635 }
636}
637
638impl IncomingTransferable {
639 #[inline]
640 pub fn ordinal(&self) -> u64 {
641 match *self {
642 Self::MessagePort(_) => 1,
643 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
644 }
645 }
646
647 #[inline]
648 pub fn unknown_variant_for_testing() -> Self {
649 Self::__SourceBreaking { unknown_ordinal: 0 }
650 }
651
652 #[inline]
653 pub fn is_unknown(&self) -> bool {
654 match self {
655 Self::__SourceBreaking { .. } => true,
656 _ => false,
657 }
658 }
659}
660
661impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for IncomingTransferable {}
662
663#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
666pub enum NavigationDecision {
667 Proceed(NoArgumentsAction),
669 Abort(NoArgumentsAction),
671}
672
673impl NavigationDecision {
674 #[inline]
675 pub fn ordinal(&self) -> u64 {
676 match *self {
677 Self::Proceed(_) => 1,
678 Self::Abort(_) => 2,
679 }
680 }
681
682 #[deprecated = "Strict unions should not use `is_unknown`"]
683 #[inline]
684 pub fn is_unknown(&self) -> bool {
685 false
686 }
687}
688
689impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NavigationDecision {}
690
691#[derive(Debug)]
692pub enum OutgoingTransferable {
693 MessagePort(fidl::endpoints::ServerEnd<MessagePortMarker>),
694 #[doc(hidden)]
695 __SourceBreaking {
696 unknown_ordinal: u64,
697 },
698}
699
700#[macro_export]
702macro_rules! OutgoingTransferableUnknown {
703 () => {
704 _
705 };
706}
707
708impl PartialEq for OutgoingTransferable {
710 fn eq(&self, other: &Self) -> bool {
711 match (self, other) {
712 (Self::MessagePort(x), Self::MessagePort(y)) => *x == *y,
713 _ => false,
714 }
715 }
716}
717
718impl OutgoingTransferable {
719 #[inline]
720 pub fn ordinal(&self) -> u64 {
721 match *self {
722 Self::MessagePort(_) => 1,
723 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
724 }
725 }
726
727 #[inline]
728 pub fn unknown_variant_for_testing() -> Self {
729 Self::__SourceBreaking { unknown_ordinal: 0 }
730 }
731
732 #[inline]
733 pub fn is_unknown(&self) -> bool {
734 match self {
735 Self::__SourceBreaking { .. } => true,
736 _ => false,
737 }
738 }
739}
740
741impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for OutgoingTransferable {}
742
743#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
744pub struct ContextMarker;
745
746impl fidl::endpoints::ProtocolMarker for ContextMarker {
747 type Proxy = ContextProxy;
748 type RequestStream = ContextRequestStream;
749 #[cfg(target_os = "fuchsia")]
750 type SynchronousProxy = ContextSynchronousProxy;
751
752 const DEBUG_NAME: &'static str = "fuchsia.web.Context";
753}
754impl fidl::endpoints::DiscoverableProtocolMarker for ContextMarker {}
755pub type ContextGetRemoteDebuggingPortResult = Result<u16, ContextError>;
756
757pub trait ContextProxyInterface: Send + Sync {
758 fn r#create_frame(
759 &self,
760 frame: fidl::endpoints::ServerEnd<FrameMarker>,
761 ) -> Result<(), fidl::Error>;
762 fn r#create_frame_with_params(
763 &self,
764 params: CreateFrameParams,
765 frame: fidl::endpoints::ServerEnd<FrameMarker>,
766 ) -> Result<(), fidl::Error>;
767 fn r#get_cookie_manager(
768 &self,
769 manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
770 ) -> Result<(), fidl::Error>;
771 type GetRemoteDebuggingPortResponseFut: std::future::Future<Output = Result<ContextGetRemoteDebuggingPortResult, fidl::Error>>
772 + Send;
773 fn r#get_remote_debugging_port(&self) -> Self::GetRemoteDebuggingPortResponseFut;
774}
775#[derive(Debug)]
776#[cfg(target_os = "fuchsia")]
777pub struct ContextSynchronousProxy {
778 client: fidl::client::sync::Client,
779}
780
781#[cfg(target_os = "fuchsia")]
782impl fidl::endpoints::SynchronousProxy for ContextSynchronousProxy {
783 type Proxy = ContextProxy;
784 type Protocol = ContextMarker;
785
786 fn from_channel(inner: fidl::Channel) -> Self {
787 Self::new(inner)
788 }
789
790 fn into_channel(self) -> fidl::Channel {
791 self.client.into_channel()
792 }
793
794 fn as_channel(&self) -> &fidl::Channel {
795 self.client.as_channel()
796 }
797}
798
799#[cfg(target_os = "fuchsia")]
800impl ContextSynchronousProxy {
801 pub fn new(channel: fidl::Channel) -> Self {
802 let protocol_name = <ContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
803 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
804 }
805
806 pub fn into_channel(self) -> fidl::Channel {
807 self.client.into_channel()
808 }
809
810 pub fn wait_for_event(
813 &self,
814 deadline: zx::MonotonicInstant,
815 ) -> Result<ContextEvent, fidl::Error> {
816 ContextEvent::decode(self.client.wait_for_event(deadline)?)
817 }
818
819 pub fn r#create_frame(
825 &self,
826 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
827 ) -> Result<(), fidl::Error> {
828 self.client.send::<ContextCreateFrameRequest>(
829 (frame,),
830 0x5440a38db7cd7d8f,
831 fidl::encoding::DynamicFlags::empty(),
832 )
833 }
834
835 pub fn r#create_frame_with_params(
841 &self,
842 mut params: CreateFrameParams,
843 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
844 ) -> Result<(), fidl::Error> {
845 self.client.send::<ContextCreateFrameWithParamsRequest>(
846 (&mut params, frame),
847 0x2c968a330787be96,
848 fidl::encoding::DynamicFlags::empty(),
849 )
850 }
851
852 pub fn r#get_cookie_manager(
854 &self,
855 mut manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
856 ) -> Result<(), fidl::Error> {
857 self.client.send::<ContextGetCookieManagerRequest>(
858 (manager,),
859 0x7396cda568e3fca,
860 fidl::encoding::DynamicFlags::empty(),
861 )
862 }
863
864 pub fn r#get_remote_debugging_port(
871 &self,
872 ___deadline: zx::MonotonicInstant,
873 ) -> Result<ContextGetRemoteDebuggingPortResult, fidl::Error> {
874 let _response =
875 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
876 ContextGetRemoteDebuggingPortResponse,
877 ContextError,
878 >>(
879 (),
880 0x4ac6a26fe972f29,
881 fidl::encoding::DynamicFlags::empty(),
882 ___deadline,
883 )?;
884 Ok(_response.map(|x| x.port))
885 }
886}
887
888#[cfg(target_os = "fuchsia")]
889impl From<ContextSynchronousProxy> for zx::Handle {
890 fn from(value: ContextSynchronousProxy) -> Self {
891 value.into_channel().into()
892 }
893}
894
895#[cfg(target_os = "fuchsia")]
896impl From<fidl::Channel> for ContextSynchronousProxy {
897 fn from(value: fidl::Channel) -> Self {
898 Self::new(value)
899 }
900}
901
902#[derive(Debug, Clone)]
903pub struct ContextProxy {
904 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
905}
906
907impl fidl::endpoints::Proxy for ContextProxy {
908 type Protocol = ContextMarker;
909
910 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
911 Self::new(inner)
912 }
913
914 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
915 self.client.into_channel().map_err(|client| Self { client })
916 }
917
918 fn as_channel(&self) -> &::fidl::AsyncChannel {
919 self.client.as_channel()
920 }
921}
922
923impl ContextProxy {
924 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
926 let protocol_name = <ContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
927 Self { client: fidl::client::Client::new(channel, protocol_name) }
928 }
929
930 pub fn take_event_stream(&self) -> ContextEventStream {
936 ContextEventStream { event_receiver: self.client.take_event_receiver() }
937 }
938
939 pub fn r#create_frame(
945 &self,
946 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
947 ) -> Result<(), fidl::Error> {
948 ContextProxyInterface::r#create_frame(self, frame)
949 }
950
951 pub fn r#create_frame_with_params(
957 &self,
958 mut params: CreateFrameParams,
959 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
960 ) -> Result<(), fidl::Error> {
961 ContextProxyInterface::r#create_frame_with_params(self, params, frame)
962 }
963
964 pub fn r#get_cookie_manager(
966 &self,
967 mut manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
968 ) -> Result<(), fidl::Error> {
969 ContextProxyInterface::r#get_cookie_manager(self, manager)
970 }
971
972 pub fn r#get_remote_debugging_port(
979 &self,
980 ) -> fidl::client::QueryResponseFut<
981 ContextGetRemoteDebuggingPortResult,
982 fidl::encoding::DefaultFuchsiaResourceDialect,
983 > {
984 ContextProxyInterface::r#get_remote_debugging_port(self)
985 }
986}
987
988impl ContextProxyInterface for ContextProxy {
989 fn r#create_frame(
990 &self,
991 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
992 ) -> Result<(), fidl::Error> {
993 self.client.send::<ContextCreateFrameRequest>(
994 (frame,),
995 0x5440a38db7cd7d8f,
996 fidl::encoding::DynamicFlags::empty(),
997 )
998 }
999
1000 fn r#create_frame_with_params(
1001 &self,
1002 mut params: CreateFrameParams,
1003 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
1004 ) -> Result<(), fidl::Error> {
1005 self.client.send::<ContextCreateFrameWithParamsRequest>(
1006 (&mut params, frame),
1007 0x2c968a330787be96,
1008 fidl::encoding::DynamicFlags::empty(),
1009 )
1010 }
1011
1012 fn r#get_cookie_manager(
1013 &self,
1014 mut manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
1015 ) -> Result<(), fidl::Error> {
1016 self.client.send::<ContextGetCookieManagerRequest>(
1017 (manager,),
1018 0x7396cda568e3fca,
1019 fidl::encoding::DynamicFlags::empty(),
1020 )
1021 }
1022
1023 type GetRemoteDebuggingPortResponseFut = fidl::client::QueryResponseFut<
1024 ContextGetRemoteDebuggingPortResult,
1025 fidl::encoding::DefaultFuchsiaResourceDialect,
1026 >;
1027 fn r#get_remote_debugging_port(&self) -> Self::GetRemoteDebuggingPortResponseFut {
1028 fn _decode(
1029 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1030 ) -> Result<ContextGetRemoteDebuggingPortResult, fidl::Error> {
1031 let _response = fidl::client::decode_transaction_body::<
1032 fidl::encoding::ResultType<ContextGetRemoteDebuggingPortResponse, ContextError>,
1033 fidl::encoding::DefaultFuchsiaResourceDialect,
1034 0x4ac6a26fe972f29,
1035 >(_buf?)?;
1036 Ok(_response.map(|x| x.port))
1037 }
1038 self.client.send_query_and_decode::<
1039 fidl::encoding::EmptyPayload,
1040 ContextGetRemoteDebuggingPortResult,
1041 >(
1042 (),
1043 0x4ac6a26fe972f29,
1044 fidl::encoding::DynamicFlags::empty(),
1045 _decode,
1046 )
1047 }
1048}
1049
1050pub struct ContextEventStream {
1051 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1052}
1053
1054impl std::marker::Unpin for ContextEventStream {}
1055
1056impl futures::stream::FusedStream for ContextEventStream {
1057 fn is_terminated(&self) -> bool {
1058 self.event_receiver.is_terminated()
1059 }
1060}
1061
1062impl futures::Stream for ContextEventStream {
1063 type Item = Result<ContextEvent, fidl::Error>;
1064
1065 fn poll_next(
1066 mut self: std::pin::Pin<&mut Self>,
1067 cx: &mut std::task::Context<'_>,
1068 ) -> std::task::Poll<Option<Self::Item>> {
1069 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1070 &mut self.event_receiver,
1071 cx
1072 )?) {
1073 Some(buf) => std::task::Poll::Ready(Some(ContextEvent::decode(buf))),
1074 None => std::task::Poll::Ready(None),
1075 }
1076 }
1077}
1078
1079#[derive(Debug)]
1080pub enum ContextEvent {}
1081
1082impl ContextEvent {
1083 fn decode(
1085 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1086 ) -> Result<ContextEvent, fidl::Error> {
1087 let (bytes, _handles) = buf.split_mut();
1088 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1089 debug_assert_eq!(tx_header.tx_id, 0);
1090 match tx_header.ordinal {
1091 _ => Err(fidl::Error::UnknownOrdinal {
1092 ordinal: tx_header.ordinal,
1093 protocol_name: <ContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1094 }),
1095 }
1096 }
1097}
1098
1099pub struct ContextRequestStream {
1101 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1102 is_terminated: bool,
1103}
1104
1105impl std::marker::Unpin for ContextRequestStream {}
1106
1107impl futures::stream::FusedStream for ContextRequestStream {
1108 fn is_terminated(&self) -> bool {
1109 self.is_terminated
1110 }
1111}
1112
1113impl fidl::endpoints::RequestStream for ContextRequestStream {
1114 type Protocol = ContextMarker;
1115 type ControlHandle = ContextControlHandle;
1116
1117 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1118 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1119 }
1120
1121 fn control_handle(&self) -> Self::ControlHandle {
1122 ContextControlHandle { inner: self.inner.clone() }
1123 }
1124
1125 fn into_inner(
1126 self,
1127 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1128 {
1129 (self.inner, self.is_terminated)
1130 }
1131
1132 fn from_inner(
1133 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1134 is_terminated: bool,
1135 ) -> Self {
1136 Self { inner, is_terminated }
1137 }
1138}
1139
1140impl futures::Stream for ContextRequestStream {
1141 type Item = Result<ContextRequest, fidl::Error>;
1142
1143 fn poll_next(
1144 mut self: std::pin::Pin<&mut Self>,
1145 cx: &mut std::task::Context<'_>,
1146 ) -> std::task::Poll<Option<Self::Item>> {
1147 let this = &mut *self;
1148 if this.inner.check_shutdown(cx) {
1149 this.is_terminated = true;
1150 return std::task::Poll::Ready(None);
1151 }
1152 if this.is_terminated {
1153 panic!("polled ContextRequestStream after completion");
1154 }
1155 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1156 |bytes, handles| {
1157 match this.inner.channel().read_etc(cx, bytes, handles) {
1158 std::task::Poll::Ready(Ok(())) => {}
1159 std::task::Poll::Pending => return std::task::Poll::Pending,
1160 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1161 this.is_terminated = true;
1162 return std::task::Poll::Ready(None);
1163 }
1164 std::task::Poll::Ready(Err(e)) => {
1165 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1166 e.into(),
1167 ))))
1168 }
1169 }
1170
1171 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1173
1174 std::task::Poll::Ready(Some(match header.ordinal {
1175 0x5440a38db7cd7d8f => {
1176 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1177 let mut req = fidl::new_empty!(
1178 ContextCreateFrameRequest,
1179 fidl::encoding::DefaultFuchsiaResourceDialect
1180 );
1181 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContextCreateFrameRequest>(&header, _body_bytes, handles, &mut req)?;
1182 let control_handle = ContextControlHandle { inner: this.inner.clone() };
1183 Ok(ContextRequest::CreateFrame { frame: req.frame, control_handle })
1184 }
1185 0x2c968a330787be96 => {
1186 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1187 let mut req = fidl::new_empty!(
1188 ContextCreateFrameWithParamsRequest,
1189 fidl::encoding::DefaultFuchsiaResourceDialect
1190 );
1191 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContextCreateFrameWithParamsRequest>(&header, _body_bytes, handles, &mut req)?;
1192 let control_handle = ContextControlHandle { inner: this.inner.clone() };
1193 Ok(ContextRequest::CreateFrameWithParams {
1194 params: req.params,
1195 frame: req.frame,
1196
1197 control_handle,
1198 })
1199 }
1200 0x7396cda568e3fca => {
1201 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1202 let mut req = fidl::new_empty!(
1203 ContextGetCookieManagerRequest,
1204 fidl::encoding::DefaultFuchsiaResourceDialect
1205 );
1206 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContextGetCookieManagerRequest>(&header, _body_bytes, handles, &mut req)?;
1207 let control_handle = ContextControlHandle { inner: this.inner.clone() };
1208 Ok(ContextRequest::GetCookieManager {
1209 manager: req.manager,
1210
1211 control_handle,
1212 })
1213 }
1214 0x4ac6a26fe972f29 => {
1215 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1216 let mut req = fidl::new_empty!(
1217 fidl::encoding::EmptyPayload,
1218 fidl::encoding::DefaultFuchsiaResourceDialect
1219 );
1220 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1221 let control_handle = ContextControlHandle { inner: this.inner.clone() };
1222 Ok(ContextRequest::GetRemoteDebuggingPort {
1223 responder: ContextGetRemoteDebuggingPortResponder {
1224 control_handle: std::mem::ManuallyDrop::new(control_handle),
1225 tx_id: header.tx_id,
1226 },
1227 })
1228 }
1229 _ => Err(fidl::Error::UnknownOrdinal {
1230 ordinal: header.ordinal,
1231 protocol_name:
1232 <ContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1233 }),
1234 }))
1235 },
1236 )
1237 }
1238}
1239
1240#[derive(Debug)]
1242pub enum ContextRequest {
1243 CreateFrame {
1249 frame: fidl::endpoints::ServerEnd<FrameMarker>,
1250 control_handle: ContextControlHandle,
1251 },
1252 CreateFrameWithParams {
1258 params: CreateFrameParams,
1259 frame: fidl::endpoints::ServerEnd<FrameMarker>,
1260 control_handle: ContextControlHandle,
1261 },
1262 GetCookieManager {
1264 manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
1265 control_handle: ContextControlHandle,
1266 },
1267 GetRemoteDebuggingPort { responder: ContextGetRemoteDebuggingPortResponder },
1274}
1275
1276impl ContextRequest {
1277 #[allow(irrefutable_let_patterns)]
1278 pub fn into_create_frame(
1279 self,
1280 ) -> Option<(fidl::endpoints::ServerEnd<FrameMarker>, ContextControlHandle)> {
1281 if let ContextRequest::CreateFrame { frame, control_handle } = self {
1282 Some((frame, control_handle))
1283 } else {
1284 None
1285 }
1286 }
1287
1288 #[allow(irrefutable_let_patterns)]
1289 pub fn into_create_frame_with_params(
1290 self,
1291 ) -> Option<(CreateFrameParams, fidl::endpoints::ServerEnd<FrameMarker>, ContextControlHandle)>
1292 {
1293 if let ContextRequest::CreateFrameWithParams { params, frame, control_handle } = self {
1294 Some((params, frame, control_handle))
1295 } else {
1296 None
1297 }
1298 }
1299
1300 #[allow(irrefutable_let_patterns)]
1301 pub fn into_get_cookie_manager(
1302 self,
1303 ) -> Option<(fidl::endpoints::ServerEnd<CookieManagerMarker>, ContextControlHandle)> {
1304 if let ContextRequest::GetCookieManager { manager, control_handle } = self {
1305 Some((manager, control_handle))
1306 } else {
1307 None
1308 }
1309 }
1310
1311 #[allow(irrefutable_let_patterns)]
1312 pub fn into_get_remote_debugging_port(
1313 self,
1314 ) -> Option<(ContextGetRemoteDebuggingPortResponder)> {
1315 if let ContextRequest::GetRemoteDebuggingPort { responder } = self {
1316 Some((responder))
1317 } else {
1318 None
1319 }
1320 }
1321
1322 pub fn method_name(&self) -> &'static str {
1324 match *self {
1325 ContextRequest::CreateFrame { .. } => "create_frame",
1326 ContextRequest::CreateFrameWithParams { .. } => "create_frame_with_params",
1327 ContextRequest::GetCookieManager { .. } => "get_cookie_manager",
1328 ContextRequest::GetRemoteDebuggingPort { .. } => "get_remote_debugging_port",
1329 }
1330 }
1331}
1332
1333#[derive(Debug, Clone)]
1334pub struct ContextControlHandle {
1335 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1336}
1337
1338impl fidl::endpoints::ControlHandle for ContextControlHandle {
1339 fn shutdown(&self) {
1340 self.inner.shutdown()
1341 }
1342 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1343 self.inner.shutdown_with_epitaph(status)
1344 }
1345
1346 fn is_closed(&self) -> bool {
1347 self.inner.channel().is_closed()
1348 }
1349 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1350 self.inner.channel().on_closed()
1351 }
1352
1353 #[cfg(target_os = "fuchsia")]
1354 fn signal_peer(
1355 &self,
1356 clear_mask: zx::Signals,
1357 set_mask: zx::Signals,
1358 ) -> Result<(), zx_status::Status> {
1359 use fidl::Peered;
1360 self.inner.channel().signal_peer(clear_mask, set_mask)
1361 }
1362}
1363
1364impl ContextControlHandle {}
1365
1366#[must_use = "FIDL methods require a response to be sent"]
1367#[derive(Debug)]
1368pub struct ContextGetRemoteDebuggingPortResponder {
1369 control_handle: std::mem::ManuallyDrop<ContextControlHandle>,
1370 tx_id: u32,
1371}
1372
1373impl std::ops::Drop for ContextGetRemoteDebuggingPortResponder {
1377 fn drop(&mut self) {
1378 self.control_handle.shutdown();
1379 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1381 }
1382}
1383
1384impl fidl::endpoints::Responder for ContextGetRemoteDebuggingPortResponder {
1385 type ControlHandle = ContextControlHandle;
1386
1387 fn control_handle(&self) -> &ContextControlHandle {
1388 &self.control_handle
1389 }
1390
1391 fn drop_without_shutdown(mut self) {
1392 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1394 std::mem::forget(self);
1396 }
1397}
1398
1399impl ContextGetRemoteDebuggingPortResponder {
1400 pub fn send(self, mut result: Result<u16, ContextError>) -> Result<(), fidl::Error> {
1404 let _result = self.send_raw(result);
1405 if _result.is_err() {
1406 self.control_handle.shutdown();
1407 }
1408 self.drop_without_shutdown();
1409 _result
1410 }
1411
1412 pub fn send_no_shutdown_on_err(
1414 self,
1415 mut result: Result<u16, ContextError>,
1416 ) -> Result<(), fidl::Error> {
1417 let _result = self.send_raw(result);
1418 self.drop_without_shutdown();
1419 _result
1420 }
1421
1422 fn send_raw(&self, mut result: Result<u16, ContextError>) -> Result<(), fidl::Error> {
1423 self.control_handle.inner.send::<fidl::encoding::ResultType<
1424 ContextGetRemoteDebuggingPortResponse,
1425 ContextError,
1426 >>(
1427 result.map(|port| (port,)),
1428 self.tx_id,
1429 0x4ac6a26fe972f29,
1430 fidl::encoding::DynamicFlags::empty(),
1431 )
1432 }
1433}
1434
1435#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1436pub struct ContextProviderMarker;
1437
1438impl fidl::endpoints::ProtocolMarker for ContextProviderMarker {
1439 type Proxy = ContextProviderProxy;
1440 type RequestStream = ContextProviderRequestStream;
1441 #[cfg(target_os = "fuchsia")]
1442 type SynchronousProxy = ContextProviderSynchronousProxy;
1443
1444 const DEBUG_NAME: &'static str = "fuchsia.web.ContextProvider";
1445}
1446impl fidl::endpoints::DiscoverableProtocolMarker for ContextProviderMarker {}
1447
1448pub trait ContextProviderProxyInterface: Send + Sync {
1449 fn r#create(
1450 &self,
1451 params: CreateContextParams,
1452 context: fidl::endpoints::ServerEnd<ContextMarker>,
1453 ) -> Result<(), fidl::Error>;
1454}
1455#[derive(Debug)]
1456#[cfg(target_os = "fuchsia")]
1457pub struct ContextProviderSynchronousProxy {
1458 client: fidl::client::sync::Client,
1459}
1460
1461#[cfg(target_os = "fuchsia")]
1462impl fidl::endpoints::SynchronousProxy for ContextProviderSynchronousProxy {
1463 type Proxy = ContextProviderProxy;
1464 type Protocol = ContextProviderMarker;
1465
1466 fn from_channel(inner: fidl::Channel) -> Self {
1467 Self::new(inner)
1468 }
1469
1470 fn into_channel(self) -> fidl::Channel {
1471 self.client.into_channel()
1472 }
1473
1474 fn as_channel(&self) -> &fidl::Channel {
1475 self.client.as_channel()
1476 }
1477}
1478
1479#[cfg(target_os = "fuchsia")]
1480impl ContextProviderSynchronousProxy {
1481 pub fn new(channel: fidl::Channel) -> Self {
1482 let protocol_name = <ContextProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1483 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1484 }
1485
1486 pub fn into_channel(self) -> fidl::Channel {
1487 self.client.into_channel()
1488 }
1489
1490 pub fn wait_for_event(
1493 &self,
1494 deadline: zx::MonotonicInstant,
1495 ) -> Result<ContextProviderEvent, fidl::Error> {
1496 ContextProviderEvent::decode(self.client.wait_for_event(deadline)?)
1497 }
1498
1499 pub fn r#create(
1506 &self,
1507 mut params: CreateContextParams,
1508 mut context: fidl::endpoints::ServerEnd<ContextMarker>,
1509 ) -> Result<(), fidl::Error> {
1510 self.client.send::<ContextProviderCreateRequest>(
1511 (&mut params, context),
1512 0x6ee6fa35978eb98d,
1513 fidl::encoding::DynamicFlags::empty(),
1514 )
1515 }
1516}
1517
1518#[cfg(target_os = "fuchsia")]
1519impl From<ContextProviderSynchronousProxy> for zx::Handle {
1520 fn from(value: ContextProviderSynchronousProxy) -> Self {
1521 value.into_channel().into()
1522 }
1523}
1524
1525#[cfg(target_os = "fuchsia")]
1526impl From<fidl::Channel> for ContextProviderSynchronousProxy {
1527 fn from(value: fidl::Channel) -> Self {
1528 Self::new(value)
1529 }
1530}
1531
1532#[derive(Debug, Clone)]
1533pub struct ContextProviderProxy {
1534 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1535}
1536
1537impl fidl::endpoints::Proxy for ContextProviderProxy {
1538 type Protocol = ContextProviderMarker;
1539
1540 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1541 Self::new(inner)
1542 }
1543
1544 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1545 self.client.into_channel().map_err(|client| Self { client })
1546 }
1547
1548 fn as_channel(&self) -> &::fidl::AsyncChannel {
1549 self.client.as_channel()
1550 }
1551}
1552
1553impl ContextProviderProxy {
1554 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1556 let protocol_name = <ContextProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1557 Self { client: fidl::client::Client::new(channel, protocol_name) }
1558 }
1559
1560 pub fn take_event_stream(&self) -> ContextProviderEventStream {
1566 ContextProviderEventStream { event_receiver: self.client.take_event_receiver() }
1567 }
1568
1569 pub fn r#create(
1576 &self,
1577 mut params: CreateContextParams,
1578 mut context: fidl::endpoints::ServerEnd<ContextMarker>,
1579 ) -> Result<(), fidl::Error> {
1580 ContextProviderProxyInterface::r#create(self, params, context)
1581 }
1582}
1583
1584impl ContextProviderProxyInterface for ContextProviderProxy {
1585 fn r#create(
1586 &self,
1587 mut params: CreateContextParams,
1588 mut context: fidl::endpoints::ServerEnd<ContextMarker>,
1589 ) -> Result<(), fidl::Error> {
1590 self.client.send::<ContextProviderCreateRequest>(
1591 (&mut params, context),
1592 0x6ee6fa35978eb98d,
1593 fidl::encoding::DynamicFlags::empty(),
1594 )
1595 }
1596}
1597
1598pub struct ContextProviderEventStream {
1599 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1600}
1601
1602impl std::marker::Unpin for ContextProviderEventStream {}
1603
1604impl futures::stream::FusedStream for ContextProviderEventStream {
1605 fn is_terminated(&self) -> bool {
1606 self.event_receiver.is_terminated()
1607 }
1608}
1609
1610impl futures::Stream for ContextProviderEventStream {
1611 type Item = Result<ContextProviderEvent, fidl::Error>;
1612
1613 fn poll_next(
1614 mut self: std::pin::Pin<&mut Self>,
1615 cx: &mut std::task::Context<'_>,
1616 ) -> std::task::Poll<Option<Self::Item>> {
1617 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1618 &mut self.event_receiver,
1619 cx
1620 )?) {
1621 Some(buf) => std::task::Poll::Ready(Some(ContextProviderEvent::decode(buf))),
1622 None => std::task::Poll::Ready(None),
1623 }
1624 }
1625}
1626
1627#[derive(Debug)]
1628pub enum ContextProviderEvent {}
1629
1630impl ContextProviderEvent {
1631 fn decode(
1633 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1634 ) -> Result<ContextProviderEvent, fidl::Error> {
1635 let (bytes, _handles) = buf.split_mut();
1636 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1637 debug_assert_eq!(tx_header.tx_id, 0);
1638 match tx_header.ordinal {
1639 _ => Err(fidl::Error::UnknownOrdinal {
1640 ordinal: tx_header.ordinal,
1641 protocol_name:
1642 <ContextProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1643 }),
1644 }
1645 }
1646}
1647
1648pub struct ContextProviderRequestStream {
1650 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1651 is_terminated: bool,
1652}
1653
1654impl std::marker::Unpin for ContextProviderRequestStream {}
1655
1656impl futures::stream::FusedStream for ContextProviderRequestStream {
1657 fn is_terminated(&self) -> bool {
1658 self.is_terminated
1659 }
1660}
1661
1662impl fidl::endpoints::RequestStream for ContextProviderRequestStream {
1663 type Protocol = ContextProviderMarker;
1664 type ControlHandle = ContextProviderControlHandle;
1665
1666 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1667 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1668 }
1669
1670 fn control_handle(&self) -> Self::ControlHandle {
1671 ContextProviderControlHandle { inner: self.inner.clone() }
1672 }
1673
1674 fn into_inner(
1675 self,
1676 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1677 {
1678 (self.inner, self.is_terminated)
1679 }
1680
1681 fn from_inner(
1682 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1683 is_terminated: bool,
1684 ) -> Self {
1685 Self { inner, is_terminated }
1686 }
1687}
1688
1689impl futures::Stream for ContextProviderRequestStream {
1690 type Item = Result<ContextProviderRequest, fidl::Error>;
1691
1692 fn poll_next(
1693 mut self: std::pin::Pin<&mut Self>,
1694 cx: &mut std::task::Context<'_>,
1695 ) -> std::task::Poll<Option<Self::Item>> {
1696 let this = &mut *self;
1697 if this.inner.check_shutdown(cx) {
1698 this.is_terminated = true;
1699 return std::task::Poll::Ready(None);
1700 }
1701 if this.is_terminated {
1702 panic!("polled ContextProviderRequestStream after completion");
1703 }
1704 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1705 |bytes, handles| {
1706 match this.inner.channel().read_etc(cx, bytes, handles) {
1707 std::task::Poll::Ready(Ok(())) => {}
1708 std::task::Poll::Pending => return std::task::Poll::Pending,
1709 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1710 this.is_terminated = true;
1711 return std::task::Poll::Ready(None);
1712 }
1713 std::task::Poll::Ready(Err(e)) => {
1714 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1715 e.into(),
1716 ))))
1717 }
1718 }
1719
1720 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1722
1723 std::task::Poll::Ready(Some(match header.ordinal {
1724 0x6ee6fa35978eb98d => {
1725 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1726 let mut req = fidl::new_empty!(
1727 ContextProviderCreateRequest,
1728 fidl::encoding::DefaultFuchsiaResourceDialect
1729 );
1730 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContextProviderCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1731 let control_handle =
1732 ContextProviderControlHandle { inner: this.inner.clone() };
1733 Ok(ContextProviderRequest::Create {
1734 params: req.params,
1735 context: req.context,
1736
1737 control_handle,
1738 })
1739 }
1740 _ => Err(fidl::Error::UnknownOrdinal {
1741 ordinal: header.ordinal,
1742 protocol_name:
1743 <ContextProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1744 }),
1745 }))
1746 },
1747 )
1748 }
1749}
1750
1751#[derive(Debug)]
1753pub enum ContextProviderRequest {
1754 Create {
1761 params: CreateContextParams,
1762 context: fidl::endpoints::ServerEnd<ContextMarker>,
1763 control_handle: ContextProviderControlHandle,
1764 },
1765}
1766
1767impl ContextProviderRequest {
1768 #[allow(irrefutable_let_patterns)]
1769 pub fn into_create(
1770 self,
1771 ) -> Option<(
1772 CreateContextParams,
1773 fidl::endpoints::ServerEnd<ContextMarker>,
1774 ContextProviderControlHandle,
1775 )> {
1776 if let ContextProviderRequest::Create { params, context, control_handle } = self {
1777 Some((params, context, control_handle))
1778 } else {
1779 None
1780 }
1781 }
1782
1783 pub fn method_name(&self) -> &'static str {
1785 match *self {
1786 ContextProviderRequest::Create { .. } => "create",
1787 }
1788 }
1789}
1790
1791#[derive(Debug, Clone)]
1792pub struct ContextProviderControlHandle {
1793 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1794}
1795
1796impl fidl::endpoints::ControlHandle for ContextProviderControlHandle {
1797 fn shutdown(&self) {
1798 self.inner.shutdown()
1799 }
1800 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1801 self.inner.shutdown_with_epitaph(status)
1802 }
1803
1804 fn is_closed(&self) -> bool {
1805 self.inner.channel().is_closed()
1806 }
1807 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1808 self.inner.channel().on_closed()
1809 }
1810
1811 #[cfg(target_os = "fuchsia")]
1812 fn signal_peer(
1813 &self,
1814 clear_mask: zx::Signals,
1815 set_mask: zx::Signals,
1816 ) -> Result<(), zx_status::Status> {
1817 use fidl::Peered;
1818 self.inner.channel().signal_peer(clear_mask, set_mask)
1819 }
1820}
1821
1822impl ContextProviderControlHandle {}
1823
1824#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1825pub struct CookieManagerMarker;
1826
1827impl fidl::endpoints::ProtocolMarker for CookieManagerMarker {
1828 type Proxy = CookieManagerProxy;
1829 type RequestStream = CookieManagerRequestStream;
1830 #[cfg(target_os = "fuchsia")]
1831 type SynchronousProxy = CookieManagerSynchronousProxy;
1832
1833 const DEBUG_NAME: &'static str = "(anonymous) CookieManager";
1834}
1835
1836pub trait CookieManagerProxyInterface: Send + Sync {
1837 fn r#observe_cookie_changes(
1838 &self,
1839 url: Option<&str>,
1840 name: Option<&str>,
1841 changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1842 ) -> Result<(), fidl::Error>;
1843 fn r#get_cookie_list(
1844 &self,
1845 url: Option<&str>,
1846 name: Option<&str>,
1847 cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1848 ) -> Result<(), fidl::Error>;
1849}
1850#[derive(Debug)]
1851#[cfg(target_os = "fuchsia")]
1852pub struct CookieManagerSynchronousProxy {
1853 client: fidl::client::sync::Client,
1854}
1855
1856#[cfg(target_os = "fuchsia")]
1857impl fidl::endpoints::SynchronousProxy for CookieManagerSynchronousProxy {
1858 type Proxy = CookieManagerProxy;
1859 type Protocol = CookieManagerMarker;
1860
1861 fn from_channel(inner: fidl::Channel) -> Self {
1862 Self::new(inner)
1863 }
1864
1865 fn into_channel(self) -> fidl::Channel {
1866 self.client.into_channel()
1867 }
1868
1869 fn as_channel(&self) -> &fidl::Channel {
1870 self.client.as_channel()
1871 }
1872}
1873
1874#[cfg(target_os = "fuchsia")]
1875impl CookieManagerSynchronousProxy {
1876 pub fn new(channel: fidl::Channel) -> Self {
1877 let protocol_name = <CookieManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1878 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1879 }
1880
1881 pub fn into_channel(self) -> fidl::Channel {
1882 self.client.into_channel()
1883 }
1884
1885 pub fn wait_for_event(
1888 &self,
1889 deadline: zx::MonotonicInstant,
1890 ) -> Result<CookieManagerEvent, fidl::Error> {
1891 CookieManagerEvent::decode(self.client.wait_for_event(deadline)?)
1892 }
1893
1894 pub fn r#observe_cookie_changes(
1903 &self,
1904 mut url: Option<&str>,
1905 mut name: Option<&str>,
1906 mut changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1907 ) -> Result<(), fidl::Error> {
1908 self.client.send::<CookieManagerObserveCookieChangesRequest>(
1909 (url, name, changes),
1910 0x49d8259726088b2,
1911 fidl::encoding::DynamicFlags::empty(),
1912 )
1913 }
1914
1915 pub fn r#get_cookie_list(
1918 &self,
1919 mut url: Option<&str>,
1920 mut name: Option<&str>,
1921 mut cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1922 ) -> Result<(), fidl::Error> {
1923 self.client.send::<CookieManagerGetCookieListRequest>(
1924 (url, name, cookies),
1925 0x391d79f54044f334,
1926 fidl::encoding::DynamicFlags::empty(),
1927 )
1928 }
1929}
1930
1931#[cfg(target_os = "fuchsia")]
1932impl From<CookieManagerSynchronousProxy> for zx::Handle {
1933 fn from(value: CookieManagerSynchronousProxy) -> Self {
1934 value.into_channel().into()
1935 }
1936}
1937
1938#[cfg(target_os = "fuchsia")]
1939impl From<fidl::Channel> for CookieManagerSynchronousProxy {
1940 fn from(value: fidl::Channel) -> Self {
1941 Self::new(value)
1942 }
1943}
1944
1945#[derive(Debug, Clone)]
1946pub struct CookieManagerProxy {
1947 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1948}
1949
1950impl fidl::endpoints::Proxy for CookieManagerProxy {
1951 type Protocol = CookieManagerMarker;
1952
1953 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1954 Self::new(inner)
1955 }
1956
1957 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1958 self.client.into_channel().map_err(|client| Self { client })
1959 }
1960
1961 fn as_channel(&self) -> &::fidl::AsyncChannel {
1962 self.client.as_channel()
1963 }
1964}
1965
1966impl CookieManagerProxy {
1967 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1969 let protocol_name = <CookieManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1970 Self { client: fidl::client::Client::new(channel, protocol_name) }
1971 }
1972
1973 pub fn take_event_stream(&self) -> CookieManagerEventStream {
1979 CookieManagerEventStream { event_receiver: self.client.take_event_receiver() }
1980 }
1981
1982 pub fn r#observe_cookie_changes(
1991 &self,
1992 mut url: Option<&str>,
1993 mut name: Option<&str>,
1994 mut changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1995 ) -> Result<(), fidl::Error> {
1996 CookieManagerProxyInterface::r#observe_cookie_changes(self, url, name, changes)
1997 }
1998
1999 pub fn r#get_cookie_list(
2002 &self,
2003 mut url: Option<&str>,
2004 mut name: Option<&str>,
2005 mut cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2006 ) -> Result<(), fidl::Error> {
2007 CookieManagerProxyInterface::r#get_cookie_list(self, url, name, cookies)
2008 }
2009}
2010
2011impl CookieManagerProxyInterface for CookieManagerProxy {
2012 fn r#observe_cookie_changes(
2013 &self,
2014 mut url: Option<&str>,
2015 mut name: Option<&str>,
2016 mut changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2017 ) -> Result<(), fidl::Error> {
2018 self.client.send::<CookieManagerObserveCookieChangesRequest>(
2019 (url, name, changes),
2020 0x49d8259726088b2,
2021 fidl::encoding::DynamicFlags::empty(),
2022 )
2023 }
2024
2025 fn r#get_cookie_list(
2026 &self,
2027 mut url: Option<&str>,
2028 mut name: Option<&str>,
2029 mut cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2030 ) -> Result<(), fidl::Error> {
2031 self.client.send::<CookieManagerGetCookieListRequest>(
2032 (url, name, cookies),
2033 0x391d79f54044f334,
2034 fidl::encoding::DynamicFlags::empty(),
2035 )
2036 }
2037}
2038
2039pub struct CookieManagerEventStream {
2040 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2041}
2042
2043impl std::marker::Unpin for CookieManagerEventStream {}
2044
2045impl futures::stream::FusedStream for CookieManagerEventStream {
2046 fn is_terminated(&self) -> bool {
2047 self.event_receiver.is_terminated()
2048 }
2049}
2050
2051impl futures::Stream for CookieManagerEventStream {
2052 type Item = Result<CookieManagerEvent, fidl::Error>;
2053
2054 fn poll_next(
2055 mut self: std::pin::Pin<&mut Self>,
2056 cx: &mut std::task::Context<'_>,
2057 ) -> std::task::Poll<Option<Self::Item>> {
2058 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2059 &mut self.event_receiver,
2060 cx
2061 )?) {
2062 Some(buf) => std::task::Poll::Ready(Some(CookieManagerEvent::decode(buf))),
2063 None => std::task::Poll::Ready(None),
2064 }
2065 }
2066}
2067
2068#[derive(Debug)]
2069pub enum CookieManagerEvent {}
2070
2071impl CookieManagerEvent {
2072 fn decode(
2074 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2075 ) -> Result<CookieManagerEvent, fidl::Error> {
2076 let (bytes, _handles) = buf.split_mut();
2077 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2078 debug_assert_eq!(tx_header.tx_id, 0);
2079 match tx_header.ordinal {
2080 _ => Err(fidl::Error::UnknownOrdinal {
2081 ordinal: tx_header.ordinal,
2082 protocol_name: <CookieManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2083 }),
2084 }
2085 }
2086}
2087
2088pub struct CookieManagerRequestStream {
2090 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2091 is_terminated: bool,
2092}
2093
2094impl std::marker::Unpin for CookieManagerRequestStream {}
2095
2096impl futures::stream::FusedStream for CookieManagerRequestStream {
2097 fn is_terminated(&self) -> bool {
2098 self.is_terminated
2099 }
2100}
2101
2102impl fidl::endpoints::RequestStream for CookieManagerRequestStream {
2103 type Protocol = CookieManagerMarker;
2104 type ControlHandle = CookieManagerControlHandle;
2105
2106 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2107 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2108 }
2109
2110 fn control_handle(&self) -> Self::ControlHandle {
2111 CookieManagerControlHandle { inner: self.inner.clone() }
2112 }
2113
2114 fn into_inner(
2115 self,
2116 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2117 {
2118 (self.inner, self.is_terminated)
2119 }
2120
2121 fn from_inner(
2122 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2123 is_terminated: bool,
2124 ) -> Self {
2125 Self { inner, is_terminated }
2126 }
2127}
2128
2129impl futures::Stream for CookieManagerRequestStream {
2130 type Item = Result<CookieManagerRequest, fidl::Error>;
2131
2132 fn poll_next(
2133 mut self: std::pin::Pin<&mut Self>,
2134 cx: &mut std::task::Context<'_>,
2135 ) -> std::task::Poll<Option<Self::Item>> {
2136 let this = &mut *self;
2137 if this.inner.check_shutdown(cx) {
2138 this.is_terminated = true;
2139 return std::task::Poll::Ready(None);
2140 }
2141 if this.is_terminated {
2142 panic!("polled CookieManagerRequestStream after completion");
2143 }
2144 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2145 |bytes, handles| {
2146 match this.inner.channel().read_etc(cx, bytes, handles) {
2147 std::task::Poll::Ready(Ok(())) => {}
2148 std::task::Poll::Pending => return std::task::Poll::Pending,
2149 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2150 this.is_terminated = true;
2151 return std::task::Poll::Ready(None);
2152 }
2153 std::task::Poll::Ready(Err(e)) => {
2154 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2155 e.into(),
2156 ))))
2157 }
2158 }
2159
2160 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2162
2163 std::task::Poll::Ready(Some(match header.ordinal {
2164 0x49d8259726088b2 => {
2165 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2166 let mut req = fidl::new_empty!(
2167 CookieManagerObserveCookieChangesRequest,
2168 fidl::encoding::DefaultFuchsiaResourceDialect
2169 );
2170 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CookieManagerObserveCookieChangesRequest>(&header, _body_bytes, handles, &mut req)?;
2171 let control_handle =
2172 CookieManagerControlHandle { inner: this.inner.clone() };
2173 Ok(CookieManagerRequest::ObserveCookieChanges {
2174 url: req.url,
2175 name: req.name,
2176 changes: req.changes,
2177
2178 control_handle,
2179 })
2180 }
2181 0x391d79f54044f334 => {
2182 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2183 let mut req = fidl::new_empty!(
2184 CookieManagerGetCookieListRequest,
2185 fidl::encoding::DefaultFuchsiaResourceDialect
2186 );
2187 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CookieManagerGetCookieListRequest>(&header, _body_bytes, handles, &mut req)?;
2188 let control_handle =
2189 CookieManagerControlHandle { inner: this.inner.clone() };
2190 Ok(CookieManagerRequest::GetCookieList {
2191 url: req.url,
2192 name: req.name,
2193 cookies: req.cookies,
2194
2195 control_handle,
2196 })
2197 }
2198 _ => Err(fidl::Error::UnknownOrdinal {
2199 ordinal: header.ordinal,
2200 protocol_name:
2201 <CookieManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2202 }),
2203 }))
2204 },
2205 )
2206 }
2207}
2208
2209#[derive(Debug)]
2211pub enum CookieManagerRequest {
2212 ObserveCookieChanges {
2221 url: Option<String>,
2222 name: Option<String>,
2223 changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2224 control_handle: CookieManagerControlHandle,
2225 },
2226 GetCookieList {
2229 url: Option<String>,
2230 name: Option<String>,
2231 cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2232 control_handle: CookieManagerControlHandle,
2233 },
2234}
2235
2236impl CookieManagerRequest {
2237 #[allow(irrefutable_let_patterns)]
2238 pub fn into_observe_cookie_changes(
2239 self,
2240 ) -> Option<(
2241 Option<String>,
2242 Option<String>,
2243 fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2244 CookieManagerControlHandle,
2245 )> {
2246 if let CookieManagerRequest::ObserveCookieChanges { url, name, changes, control_handle } =
2247 self
2248 {
2249 Some((url, name, changes, control_handle))
2250 } else {
2251 None
2252 }
2253 }
2254
2255 #[allow(irrefutable_let_patterns)]
2256 pub fn into_get_cookie_list(
2257 self,
2258 ) -> Option<(
2259 Option<String>,
2260 Option<String>,
2261 fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2262 CookieManagerControlHandle,
2263 )> {
2264 if let CookieManagerRequest::GetCookieList { url, name, cookies, control_handle } = self {
2265 Some((url, name, cookies, control_handle))
2266 } else {
2267 None
2268 }
2269 }
2270
2271 pub fn method_name(&self) -> &'static str {
2273 match *self {
2274 CookieManagerRequest::ObserveCookieChanges { .. } => "observe_cookie_changes",
2275 CookieManagerRequest::GetCookieList { .. } => "get_cookie_list",
2276 }
2277 }
2278}
2279
2280#[derive(Debug, Clone)]
2281pub struct CookieManagerControlHandle {
2282 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2283}
2284
2285impl fidl::endpoints::ControlHandle for CookieManagerControlHandle {
2286 fn shutdown(&self) {
2287 self.inner.shutdown()
2288 }
2289 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2290 self.inner.shutdown_with_epitaph(status)
2291 }
2292
2293 fn is_closed(&self) -> bool {
2294 self.inner.channel().is_closed()
2295 }
2296 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2297 self.inner.channel().on_closed()
2298 }
2299
2300 #[cfg(target_os = "fuchsia")]
2301 fn signal_peer(
2302 &self,
2303 clear_mask: zx::Signals,
2304 set_mask: zx::Signals,
2305 ) -> Result<(), zx_status::Status> {
2306 use fidl::Peered;
2307 self.inner.channel().signal_peer(clear_mask, set_mask)
2308 }
2309}
2310
2311impl CookieManagerControlHandle {}
2312
2313#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2314pub struct CookiesIteratorMarker;
2315
2316impl fidl::endpoints::ProtocolMarker for CookiesIteratorMarker {
2317 type Proxy = CookiesIteratorProxy;
2318 type RequestStream = CookiesIteratorRequestStream;
2319 #[cfg(target_os = "fuchsia")]
2320 type SynchronousProxy = CookiesIteratorSynchronousProxy;
2321
2322 const DEBUG_NAME: &'static str = "(anonymous) CookiesIterator";
2323}
2324
2325pub trait CookiesIteratorProxyInterface: Send + Sync {
2326 type GetNextResponseFut: std::future::Future<Output = Result<Vec<Cookie>, fidl::Error>> + Send;
2327 fn r#get_next(&self) -> Self::GetNextResponseFut;
2328}
2329#[derive(Debug)]
2330#[cfg(target_os = "fuchsia")]
2331pub struct CookiesIteratorSynchronousProxy {
2332 client: fidl::client::sync::Client,
2333}
2334
2335#[cfg(target_os = "fuchsia")]
2336impl fidl::endpoints::SynchronousProxy for CookiesIteratorSynchronousProxy {
2337 type Proxy = CookiesIteratorProxy;
2338 type Protocol = CookiesIteratorMarker;
2339
2340 fn from_channel(inner: fidl::Channel) -> Self {
2341 Self::new(inner)
2342 }
2343
2344 fn into_channel(self) -> fidl::Channel {
2345 self.client.into_channel()
2346 }
2347
2348 fn as_channel(&self) -> &fidl::Channel {
2349 self.client.as_channel()
2350 }
2351}
2352
2353#[cfg(target_os = "fuchsia")]
2354impl CookiesIteratorSynchronousProxy {
2355 pub fn new(channel: fidl::Channel) -> Self {
2356 let protocol_name = <CookiesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2357 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2358 }
2359
2360 pub fn into_channel(self) -> fidl::Channel {
2361 self.client.into_channel()
2362 }
2363
2364 pub fn wait_for_event(
2367 &self,
2368 deadline: zx::MonotonicInstant,
2369 ) -> Result<CookiesIteratorEvent, fidl::Error> {
2370 CookiesIteratorEvent::decode(self.client.wait_for_event(deadline)?)
2371 }
2372
2373 pub fn r#get_next(
2377 &self,
2378 ___deadline: zx::MonotonicInstant,
2379 ) -> Result<Vec<Cookie>, fidl::Error> {
2380 let _response = self
2381 .client
2382 .send_query::<fidl::encoding::EmptyPayload, CookiesIteratorGetNextResponse>(
2383 (),
2384 0x61b55ebf67ec457d,
2385 fidl::encoding::DynamicFlags::empty(),
2386 ___deadline,
2387 )?;
2388 Ok(_response.changed_cookies)
2389 }
2390}
2391
2392#[cfg(target_os = "fuchsia")]
2393impl From<CookiesIteratorSynchronousProxy> for zx::Handle {
2394 fn from(value: CookiesIteratorSynchronousProxy) -> Self {
2395 value.into_channel().into()
2396 }
2397}
2398
2399#[cfg(target_os = "fuchsia")]
2400impl From<fidl::Channel> for CookiesIteratorSynchronousProxy {
2401 fn from(value: fidl::Channel) -> Self {
2402 Self::new(value)
2403 }
2404}
2405
2406#[derive(Debug, Clone)]
2407pub struct CookiesIteratorProxy {
2408 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2409}
2410
2411impl fidl::endpoints::Proxy for CookiesIteratorProxy {
2412 type Protocol = CookiesIteratorMarker;
2413
2414 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2415 Self::new(inner)
2416 }
2417
2418 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2419 self.client.into_channel().map_err(|client| Self { client })
2420 }
2421
2422 fn as_channel(&self) -> &::fidl::AsyncChannel {
2423 self.client.as_channel()
2424 }
2425}
2426
2427impl CookiesIteratorProxy {
2428 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2430 let protocol_name = <CookiesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2431 Self { client: fidl::client::Client::new(channel, protocol_name) }
2432 }
2433
2434 pub fn take_event_stream(&self) -> CookiesIteratorEventStream {
2440 CookiesIteratorEventStream { event_receiver: self.client.take_event_receiver() }
2441 }
2442
2443 pub fn r#get_next(
2447 &self,
2448 ) -> fidl::client::QueryResponseFut<Vec<Cookie>, fidl::encoding::DefaultFuchsiaResourceDialect>
2449 {
2450 CookiesIteratorProxyInterface::r#get_next(self)
2451 }
2452}
2453
2454impl CookiesIteratorProxyInterface for CookiesIteratorProxy {
2455 type GetNextResponseFut =
2456 fidl::client::QueryResponseFut<Vec<Cookie>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2457 fn r#get_next(&self) -> Self::GetNextResponseFut {
2458 fn _decode(
2459 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2460 ) -> Result<Vec<Cookie>, fidl::Error> {
2461 let _response = fidl::client::decode_transaction_body::<
2462 CookiesIteratorGetNextResponse,
2463 fidl::encoding::DefaultFuchsiaResourceDialect,
2464 0x61b55ebf67ec457d,
2465 >(_buf?)?;
2466 Ok(_response.changed_cookies)
2467 }
2468 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Cookie>>(
2469 (),
2470 0x61b55ebf67ec457d,
2471 fidl::encoding::DynamicFlags::empty(),
2472 _decode,
2473 )
2474 }
2475}
2476
2477pub struct CookiesIteratorEventStream {
2478 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2479}
2480
2481impl std::marker::Unpin for CookiesIteratorEventStream {}
2482
2483impl futures::stream::FusedStream for CookiesIteratorEventStream {
2484 fn is_terminated(&self) -> bool {
2485 self.event_receiver.is_terminated()
2486 }
2487}
2488
2489impl futures::Stream for CookiesIteratorEventStream {
2490 type Item = Result<CookiesIteratorEvent, fidl::Error>;
2491
2492 fn poll_next(
2493 mut self: std::pin::Pin<&mut Self>,
2494 cx: &mut std::task::Context<'_>,
2495 ) -> std::task::Poll<Option<Self::Item>> {
2496 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2497 &mut self.event_receiver,
2498 cx
2499 )?) {
2500 Some(buf) => std::task::Poll::Ready(Some(CookiesIteratorEvent::decode(buf))),
2501 None => std::task::Poll::Ready(None),
2502 }
2503 }
2504}
2505
2506#[derive(Debug)]
2507pub enum CookiesIteratorEvent {}
2508
2509impl CookiesIteratorEvent {
2510 fn decode(
2512 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2513 ) -> Result<CookiesIteratorEvent, fidl::Error> {
2514 let (bytes, _handles) = buf.split_mut();
2515 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2516 debug_assert_eq!(tx_header.tx_id, 0);
2517 match tx_header.ordinal {
2518 _ => Err(fidl::Error::UnknownOrdinal {
2519 ordinal: tx_header.ordinal,
2520 protocol_name:
2521 <CookiesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2522 }),
2523 }
2524 }
2525}
2526
2527pub struct CookiesIteratorRequestStream {
2529 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2530 is_terminated: bool,
2531}
2532
2533impl std::marker::Unpin for CookiesIteratorRequestStream {}
2534
2535impl futures::stream::FusedStream for CookiesIteratorRequestStream {
2536 fn is_terminated(&self) -> bool {
2537 self.is_terminated
2538 }
2539}
2540
2541impl fidl::endpoints::RequestStream for CookiesIteratorRequestStream {
2542 type Protocol = CookiesIteratorMarker;
2543 type ControlHandle = CookiesIteratorControlHandle;
2544
2545 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2546 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2547 }
2548
2549 fn control_handle(&self) -> Self::ControlHandle {
2550 CookiesIteratorControlHandle { inner: self.inner.clone() }
2551 }
2552
2553 fn into_inner(
2554 self,
2555 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2556 {
2557 (self.inner, self.is_terminated)
2558 }
2559
2560 fn from_inner(
2561 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2562 is_terminated: bool,
2563 ) -> Self {
2564 Self { inner, is_terminated }
2565 }
2566}
2567
2568impl futures::Stream for CookiesIteratorRequestStream {
2569 type Item = Result<CookiesIteratorRequest, fidl::Error>;
2570
2571 fn poll_next(
2572 mut self: std::pin::Pin<&mut Self>,
2573 cx: &mut std::task::Context<'_>,
2574 ) -> std::task::Poll<Option<Self::Item>> {
2575 let this = &mut *self;
2576 if this.inner.check_shutdown(cx) {
2577 this.is_terminated = true;
2578 return std::task::Poll::Ready(None);
2579 }
2580 if this.is_terminated {
2581 panic!("polled CookiesIteratorRequestStream after completion");
2582 }
2583 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2584 |bytes, handles| {
2585 match this.inner.channel().read_etc(cx, bytes, handles) {
2586 std::task::Poll::Ready(Ok(())) => {}
2587 std::task::Poll::Pending => return std::task::Poll::Pending,
2588 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2589 this.is_terminated = true;
2590 return std::task::Poll::Ready(None);
2591 }
2592 std::task::Poll::Ready(Err(e)) => {
2593 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2594 e.into(),
2595 ))))
2596 }
2597 }
2598
2599 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2601
2602 std::task::Poll::Ready(Some(match header.ordinal {
2603 0x61b55ebf67ec457d => {
2604 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2605 let mut req = fidl::new_empty!(
2606 fidl::encoding::EmptyPayload,
2607 fidl::encoding::DefaultFuchsiaResourceDialect
2608 );
2609 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2610 let control_handle =
2611 CookiesIteratorControlHandle { inner: this.inner.clone() };
2612 Ok(CookiesIteratorRequest::GetNext {
2613 responder: CookiesIteratorGetNextResponder {
2614 control_handle: std::mem::ManuallyDrop::new(control_handle),
2615 tx_id: header.tx_id,
2616 },
2617 })
2618 }
2619 _ => Err(fidl::Error::UnknownOrdinal {
2620 ordinal: header.ordinal,
2621 protocol_name:
2622 <CookiesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2623 }),
2624 }))
2625 },
2626 )
2627 }
2628}
2629
2630#[derive(Debug)]
2632pub enum CookiesIteratorRequest {
2633 GetNext { responder: CookiesIteratorGetNextResponder },
2637}
2638
2639impl CookiesIteratorRequest {
2640 #[allow(irrefutable_let_patterns)]
2641 pub fn into_get_next(self) -> Option<(CookiesIteratorGetNextResponder)> {
2642 if let CookiesIteratorRequest::GetNext { responder } = self {
2643 Some((responder))
2644 } else {
2645 None
2646 }
2647 }
2648
2649 pub fn method_name(&self) -> &'static str {
2651 match *self {
2652 CookiesIteratorRequest::GetNext { .. } => "get_next",
2653 }
2654 }
2655}
2656
2657#[derive(Debug, Clone)]
2658pub struct CookiesIteratorControlHandle {
2659 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2660}
2661
2662impl fidl::endpoints::ControlHandle for CookiesIteratorControlHandle {
2663 fn shutdown(&self) {
2664 self.inner.shutdown()
2665 }
2666 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2667 self.inner.shutdown_with_epitaph(status)
2668 }
2669
2670 fn is_closed(&self) -> bool {
2671 self.inner.channel().is_closed()
2672 }
2673 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2674 self.inner.channel().on_closed()
2675 }
2676
2677 #[cfg(target_os = "fuchsia")]
2678 fn signal_peer(
2679 &self,
2680 clear_mask: zx::Signals,
2681 set_mask: zx::Signals,
2682 ) -> Result<(), zx_status::Status> {
2683 use fidl::Peered;
2684 self.inner.channel().signal_peer(clear_mask, set_mask)
2685 }
2686}
2687
2688impl CookiesIteratorControlHandle {}
2689
2690#[must_use = "FIDL methods require a response to be sent"]
2691#[derive(Debug)]
2692pub struct CookiesIteratorGetNextResponder {
2693 control_handle: std::mem::ManuallyDrop<CookiesIteratorControlHandle>,
2694 tx_id: u32,
2695}
2696
2697impl std::ops::Drop for CookiesIteratorGetNextResponder {
2701 fn drop(&mut self) {
2702 self.control_handle.shutdown();
2703 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2705 }
2706}
2707
2708impl fidl::endpoints::Responder for CookiesIteratorGetNextResponder {
2709 type ControlHandle = CookiesIteratorControlHandle;
2710
2711 fn control_handle(&self) -> &CookiesIteratorControlHandle {
2712 &self.control_handle
2713 }
2714
2715 fn drop_without_shutdown(mut self) {
2716 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2718 std::mem::forget(self);
2720 }
2721}
2722
2723impl CookiesIteratorGetNextResponder {
2724 pub fn send(self, mut changed_cookies: Vec<Cookie>) -> Result<(), fidl::Error> {
2728 let _result = self.send_raw(changed_cookies);
2729 if _result.is_err() {
2730 self.control_handle.shutdown();
2731 }
2732 self.drop_without_shutdown();
2733 _result
2734 }
2735
2736 pub fn send_no_shutdown_on_err(
2738 self,
2739 mut changed_cookies: Vec<Cookie>,
2740 ) -> Result<(), fidl::Error> {
2741 let _result = self.send_raw(changed_cookies);
2742 self.drop_without_shutdown();
2743 _result
2744 }
2745
2746 fn send_raw(&self, mut changed_cookies: Vec<Cookie>) -> Result<(), fidl::Error> {
2747 self.control_handle.inner.send::<CookiesIteratorGetNextResponse>(
2748 (changed_cookies.as_mut(),),
2749 self.tx_id,
2750 0x61b55ebf67ec457d,
2751 fidl::encoding::DynamicFlags::empty(),
2752 )
2753 }
2754}
2755
2756#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2757pub struct DebugMarker;
2758
2759impl fidl::endpoints::ProtocolMarker for DebugMarker {
2760 type Proxy = DebugProxy;
2761 type RequestStream = DebugRequestStream;
2762 #[cfg(target_os = "fuchsia")]
2763 type SynchronousProxy = DebugSynchronousProxy;
2764
2765 const DEBUG_NAME: &'static str = "fuchsia.web.Debug";
2766}
2767impl fidl::endpoints::DiscoverableProtocolMarker for DebugMarker {}
2768
2769pub trait DebugProxyInterface: Send + Sync {
2770 type EnableDevToolsResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2771 fn r#enable_dev_tools(
2772 &self,
2773 listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
2774 ) -> Self::EnableDevToolsResponseFut;
2775}
2776#[derive(Debug)]
2777#[cfg(target_os = "fuchsia")]
2778pub struct DebugSynchronousProxy {
2779 client: fidl::client::sync::Client,
2780}
2781
2782#[cfg(target_os = "fuchsia")]
2783impl fidl::endpoints::SynchronousProxy for DebugSynchronousProxy {
2784 type Proxy = DebugProxy;
2785 type Protocol = DebugMarker;
2786
2787 fn from_channel(inner: fidl::Channel) -> Self {
2788 Self::new(inner)
2789 }
2790
2791 fn into_channel(self) -> fidl::Channel {
2792 self.client.into_channel()
2793 }
2794
2795 fn as_channel(&self) -> &fidl::Channel {
2796 self.client.as_channel()
2797 }
2798}
2799
2800#[cfg(target_os = "fuchsia")]
2801impl DebugSynchronousProxy {
2802 pub fn new(channel: fidl::Channel) -> Self {
2803 let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2804 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2805 }
2806
2807 pub fn into_channel(self) -> fidl::Channel {
2808 self.client.into_channel()
2809 }
2810
2811 pub fn wait_for_event(
2814 &self,
2815 deadline: zx::MonotonicInstant,
2816 ) -> Result<DebugEvent, fidl::Error> {
2817 DebugEvent::decode(self.client.wait_for_event(deadline)?)
2818 }
2819
2820 pub fn r#enable_dev_tools(
2829 &self,
2830 mut listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
2831 ___deadline: zx::MonotonicInstant,
2832 ) -> Result<(), fidl::Error> {
2833 let _response =
2834 self.client.send_query::<DebugEnableDevToolsRequest, fidl::encoding::EmptyPayload>(
2835 (listener,),
2836 0x44b5e1f4e4c548e4,
2837 fidl::encoding::DynamicFlags::empty(),
2838 ___deadline,
2839 )?;
2840 Ok(_response)
2841 }
2842}
2843
2844#[cfg(target_os = "fuchsia")]
2845impl From<DebugSynchronousProxy> for zx::Handle {
2846 fn from(value: DebugSynchronousProxy) -> Self {
2847 value.into_channel().into()
2848 }
2849}
2850
2851#[cfg(target_os = "fuchsia")]
2852impl From<fidl::Channel> for DebugSynchronousProxy {
2853 fn from(value: fidl::Channel) -> Self {
2854 Self::new(value)
2855 }
2856}
2857
2858#[derive(Debug, Clone)]
2859pub struct DebugProxy {
2860 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2861}
2862
2863impl fidl::endpoints::Proxy for DebugProxy {
2864 type Protocol = DebugMarker;
2865
2866 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2867 Self::new(inner)
2868 }
2869
2870 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2871 self.client.into_channel().map_err(|client| Self { client })
2872 }
2873
2874 fn as_channel(&self) -> &::fidl::AsyncChannel {
2875 self.client.as_channel()
2876 }
2877}
2878
2879impl DebugProxy {
2880 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2882 let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2883 Self { client: fidl::client::Client::new(channel, protocol_name) }
2884 }
2885
2886 pub fn take_event_stream(&self) -> DebugEventStream {
2892 DebugEventStream { event_receiver: self.client.take_event_receiver() }
2893 }
2894
2895 pub fn r#enable_dev_tools(
2904 &self,
2905 mut listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
2906 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2907 DebugProxyInterface::r#enable_dev_tools(self, listener)
2908 }
2909}
2910
2911impl DebugProxyInterface for DebugProxy {
2912 type EnableDevToolsResponseFut =
2913 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2914 fn r#enable_dev_tools(
2915 &self,
2916 mut listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
2917 ) -> Self::EnableDevToolsResponseFut {
2918 fn _decode(
2919 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2920 ) -> Result<(), fidl::Error> {
2921 let _response = fidl::client::decode_transaction_body::<
2922 fidl::encoding::EmptyPayload,
2923 fidl::encoding::DefaultFuchsiaResourceDialect,
2924 0x44b5e1f4e4c548e4,
2925 >(_buf?)?;
2926 Ok(_response)
2927 }
2928 self.client.send_query_and_decode::<DebugEnableDevToolsRequest, ()>(
2929 (listener,),
2930 0x44b5e1f4e4c548e4,
2931 fidl::encoding::DynamicFlags::empty(),
2932 _decode,
2933 )
2934 }
2935}
2936
2937pub struct DebugEventStream {
2938 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2939}
2940
2941impl std::marker::Unpin for DebugEventStream {}
2942
2943impl futures::stream::FusedStream for DebugEventStream {
2944 fn is_terminated(&self) -> bool {
2945 self.event_receiver.is_terminated()
2946 }
2947}
2948
2949impl futures::Stream for DebugEventStream {
2950 type Item = Result<DebugEvent, fidl::Error>;
2951
2952 fn poll_next(
2953 mut self: std::pin::Pin<&mut Self>,
2954 cx: &mut std::task::Context<'_>,
2955 ) -> std::task::Poll<Option<Self::Item>> {
2956 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2957 &mut self.event_receiver,
2958 cx
2959 )?) {
2960 Some(buf) => std::task::Poll::Ready(Some(DebugEvent::decode(buf))),
2961 None => std::task::Poll::Ready(None),
2962 }
2963 }
2964}
2965
2966#[derive(Debug)]
2967pub enum DebugEvent {}
2968
2969impl DebugEvent {
2970 fn decode(
2972 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2973 ) -> Result<DebugEvent, fidl::Error> {
2974 let (bytes, _handles) = buf.split_mut();
2975 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2976 debug_assert_eq!(tx_header.tx_id, 0);
2977 match tx_header.ordinal {
2978 _ => Err(fidl::Error::UnknownOrdinal {
2979 ordinal: tx_header.ordinal,
2980 protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2981 }),
2982 }
2983 }
2984}
2985
2986pub struct DebugRequestStream {
2988 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2989 is_terminated: bool,
2990}
2991
2992impl std::marker::Unpin for DebugRequestStream {}
2993
2994impl futures::stream::FusedStream for DebugRequestStream {
2995 fn is_terminated(&self) -> bool {
2996 self.is_terminated
2997 }
2998}
2999
3000impl fidl::endpoints::RequestStream for DebugRequestStream {
3001 type Protocol = DebugMarker;
3002 type ControlHandle = DebugControlHandle;
3003
3004 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3005 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3006 }
3007
3008 fn control_handle(&self) -> Self::ControlHandle {
3009 DebugControlHandle { inner: self.inner.clone() }
3010 }
3011
3012 fn into_inner(
3013 self,
3014 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3015 {
3016 (self.inner, self.is_terminated)
3017 }
3018
3019 fn from_inner(
3020 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3021 is_terminated: bool,
3022 ) -> Self {
3023 Self { inner, is_terminated }
3024 }
3025}
3026
3027impl futures::Stream for DebugRequestStream {
3028 type Item = Result<DebugRequest, fidl::Error>;
3029
3030 fn poll_next(
3031 mut self: std::pin::Pin<&mut Self>,
3032 cx: &mut std::task::Context<'_>,
3033 ) -> std::task::Poll<Option<Self::Item>> {
3034 let this = &mut *self;
3035 if this.inner.check_shutdown(cx) {
3036 this.is_terminated = true;
3037 return std::task::Poll::Ready(None);
3038 }
3039 if this.is_terminated {
3040 panic!("polled DebugRequestStream after completion");
3041 }
3042 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3043 |bytes, handles| {
3044 match this.inner.channel().read_etc(cx, bytes, handles) {
3045 std::task::Poll::Ready(Ok(())) => {}
3046 std::task::Poll::Pending => return std::task::Poll::Pending,
3047 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3048 this.is_terminated = true;
3049 return std::task::Poll::Ready(None);
3050 }
3051 std::task::Poll::Ready(Err(e)) => {
3052 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3053 e.into(),
3054 ))))
3055 }
3056 }
3057
3058 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3060
3061 std::task::Poll::Ready(Some(match header.ordinal {
3062 0x44b5e1f4e4c548e4 => {
3063 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3064 let mut req = fidl::new_empty!(
3065 DebugEnableDevToolsRequest,
3066 fidl::encoding::DefaultFuchsiaResourceDialect
3067 );
3068 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugEnableDevToolsRequest>(&header, _body_bytes, handles, &mut req)?;
3069 let control_handle = DebugControlHandle { inner: this.inner.clone() };
3070 Ok(DebugRequest::EnableDevTools {
3071 listener: req.listener,
3072
3073 responder: DebugEnableDevToolsResponder {
3074 control_handle: std::mem::ManuallyDrop::new(control_handle),
3075 tx_id: header.tx_id,
3076 },
3077 })
3078 }
3079 _ => Err(fidl::Error::UnknownOrdinal {
3080 ordinal: header.ordinal,
3081 protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3082 }),
3083 }))
3084 },
3085 )
3086 }
3087}
3088
3089#[derive(Debug)]
3091pub enum DebugRequest {
3092 EnableDevTools {
3101 listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
3102 responder: DebugEnableDevToolsResponder,
3103 },
3104}
3105
3106impl DebugRequest {
3107 #[allow(irrefutable_let_patterns)]
3108 pub fn into_enable_dev_tools(
3109 self,
3110 ) -> Option<(fidl::endpoints::ClientEnd<DevToolsListenerMarker>, DebugEnableDevToolsResponder)>
3111 {
3112 if let DebugRequest::EnableDevTools { listener, responder } = self {
3113 Some((listener, responder))
3114 } else {
3115 None
3116 }
3117 }
3118
3119 pub fn method_name(&self) -> &'static str {
3121 match *self {
3122 DebugRequest::EnableDevTools { .. } => "enable_dev_tools",
3123 }
3124 }
3125}
3126
3127#[derive(Debug, Clone)]
3128pub struct DebugControlHandle {
3129 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3130}
3131
3132impl fidl::endpoints::ControlHandle for DebugControlHandle {
3133 fn shutdown(&self) {
3134 self.inner.shutdown()
3135 }
3136 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3137 self.inner.shutdown_with_epitaph(status)
3138 }
3139
3140 fn is_closed(&self) -> bool {
3141 self.inner.channel().is_closed()
3142 }
3143 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3144 self.inner.channel().on_closed()
3145 }
3146
3147 #[cfg(target_os = "fuchsia")]
3148 fn signal_peer(
3149 &self,
3150 clear_mask: zx::Signals,
3151 set_mask: zx::Signals,
3152 ) -> Result<(), zx_status::Status> {
3153 use fidl::Peered;
3154 self.inner.channel().signal_peer(clear_mask, set_mask)
3155 }
3156}
3157
3158impl DebugControlHandle {}
3159
3160#[must_use = "FIDL methods require a response to be sent"]
3161#[derive(Debug)]
3162pub struct DebugEnableDevToolsResponder {
3163 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
3164 tx_id: u32,
3165}
3166
3167impl std::ops::Drop for DebugEnableDevToolsResponder {
3171 fn drop(&mut self) {
3172 self.control_handle.shutdown();
3173 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3175 }
3176}
3177
3178impl fidl::endpoints::Responder for DebugEnableDevToolsResponder {
3179 type ControlHandle = DebugControlHandle;
3180
3181 fn control_handle(&self) -> &DebugControlHandle {
3182 &self.control_handle
3183 }
3184
3185 fn drop_without_shutdown(mut self) {
3186 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3188 std::mem::forget(self);
3190 }
3191}
3192
3193impl DebugEnableDevToolsResponder {
3194 pub fn send(self) -> Result<(), fidl::Error> {
3198 let _result = self.send_raw();
3199 if _result.is_err() {
3200 self.control_handle.shutdown();
3201 }
3202 self.drop_without_shutdown();
3203 _result
3204 }
3205
3206 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3208 let _result = self.send_raw();
3209 self.drop_without_shutdown();
3210 _result
3211 }
3212
3213 fn send_raw(&self) -> Result<(), fidl::Error> {
3214 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3215 (),
3216 self.tx_id,
3217 0x44b5e1f4e4c548e4,
3218 fidl::encoding::DynamicFlags::empty(),
3219 )
3220 }
3221}
3222
3223#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3224pub struct DevToolsListenerMarker;
3225
3226impl fidl::endpoints::ProtocolMarker for DevToolsListenerMarker {
3227 type Proxy = DevToolsListenerProxy;
3228 type RequestStream = DevToolsListenerRequestStream;
3229 #[cfg(target_os = "fuchsia")]
3230 type SynchronousProxy = DevToolsListenerSynchronousProxy;
3231
3232 const DEBUG_NAME: &'static str = "(anonymous) DevToolsListener";
3233}
3234
3235pub trait DevToolsListenerProxyInterface: Send + Sync {
3236 fn r#on_context_dev_tools_available(
3237 &self,
3238 listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3239 ) -> Result<(), fidl::Error>;
3240}
3241#[derive(Debug)]
3242#[cfg(target_os = "fuchsia")]
3243pub struct DevToolsListenerSynchronousProxy {
3244 client: fidl::client::sync::Client,
3245}
3246
3247#[cfg(target_os = "fuchsia")]
3248impl fidl::endpoints::SynchronousProxy for DevToolsListenerSynchronousProxy {
3249 type Proxy = DevToolsListenerProxy;
3250 type Protocol = DevToolsListenerMarker;
3251
3252 fn from_channel(inner: fidl::Channel) -> Self {
3253 Self::new(inner)
3254 }
3255
3256 fn into_channel(self) -> fidl::Channel {
3257 self.client.into_channel()
3258 }
3259
3260 fn as_channel(&self) -> &fidl::Channel {
3261 self.client.as_channel()
3262 }
3263}
3264
3265#[cfg(target_os = "fuchsia")]
3266impl DevToolsListenerSynchronousProxy {
3267 pub fn new(channel: fidl::Channel) -> Self {
3268 let protocol_name = <DevToolsListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3269 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3270 }
3271
3272 pub fn into_channel(self) -> fidl::Channel {
3273 self.client.into_channel()
3274 }
3275
3276 pub fn wait_for_event(
3279 &self,
3280 deadline: zx::MonotonicInstant,
3281 ) -> Result<DevToolsListenerEvent, fidl::Error> {
3282 DevToolsListenerEvent::decode(self.client.wait_for_event(deadline)?)
3283 }
3284
3285 pub fn r#on_context_dev_tools_available(
3290 &self,
3291 mut listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3292 ) -> Result<(), fidl::Error> {
3293 self.client.send::<DevToolsListenerOnContextDevToolsAvailableRequest>(
3294 (listener,),
3295 0x4b259fb4d7e49e87,
3296 fidl::encoding::DynamicFlags::empty(),
3297 )
3298 }
3299}
3300
3301#[cfg(target_os = "fuchsia")]
3302impl From<DevToolsListenerSynchronousProxy> for zx::Handle {
3303 fn from(value: DevToolsListenerSynchronousProxy) -> Self {
3304 value.into_channel().into()
3305 }
3306}
3307
3308#[cfg(target_os = "fuchsia")]
3309impl From<fidl::Channel> for DevToolsListenerSynchronousProxy {
3310 fn from(value: fidl::Channel) -> Self {
3311 Self::new(value)
3312 }
3313}
3314
3315#[derive(Debug, Clone)]
3316pub struct DevToolsListenerProxy {
3317 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3318}
3319
3320impl fidl::endpoints::Proxy for DevToolsListenerProxy {
3321 type Protocol = DevToolsListenerMarker;
3322
3323 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3324 Self::new(inner)
3325 }
3326
3327 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3328 self.client.into_channel().map_err(|client| Self { client })
3329 }
3330
3331 fn as_channel(&self) -> &::fidl::AsyncChannel {
3332 self.client.as_channel()
3333 }
3334}
3335
3336impl DevToolsListenerProxy {
3337 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3339 let protocol_name = <DevToolsListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3340 Self { client: fidl::client::Client::new(channel, protocol_name) }
3341 }
3342
3343 pub fn take_event_stream(&self) -> DevToolsListenerEventStream {
3349 DevToolsListenerEventStream { event_receiver: self.client.take_event_receiver() }
3350 }
3351
3352 pub fn r#on_context_dev_tools_available(
3357 &self,
3358 mut listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3359 ) -> Result<(), fidl::Error> {
3360 DevToolsListenerProxyInterface::r#on_context_dev_tools_available(self, listener)
3361 }
3362}
3363
3364impl DevToolsListenerProxyInterface for DevToolsListenerProxy {
3365 fn r#on_context_dev_tools_available(
3366 &self,
3367 mut listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3368 ) -> Result<(), fidl::Error> {
3369 self.client.send::<DevToolsListenerOnContextDevToolsAvailableRequest>(
3370 (listener,),
3371 0x4b259fb4d7e49e87,
3372 fidl::encoding::DynamicFlags::empty(),
3373 )
3374 }
3375}
3376
3377pub struct DevToolsListenerEventStream {
3378 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3379}
3380
3381impl std::marker::Unpin for DevToolsListenerEventStream {}
3382
3383impl futures::stream::FusedStream for DevToolsListenerEventStream {
3384 fn is_terminated(&self) -> bool {
3385 self.event_receiver.is_terminated()
3386 }
3387}
3388
3389impl futures::Stream for DevToolsListenerEventStream {
3390 type Item = Result<DevToolsListenerEvent, fidl::Error>;
3391
3392 fn poll_next(
3393 mut self: std::pin::Pin<&mut Self>,
3394 cx: &mut std::task::Context<'_>,
3395 ) -> std::task::Poll<Option<Self::Item>> {
3396 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3397 &mut self.event_receiver,
3398 cx
3399 )?) {
3400 Some(buf) => std::task::Poll::Ready(Some(DevToolsListenerEvent::decode(buf))),
3401 None => std::task::Poll::Ready(None),
3402 }
3403 }
3404}
3405
3406#[derive(Debug)]
3407pub enum DevToolsListenerEvent {}
3408
3409impl DevToolsListenerEvent {
3410 fn decode(
3412 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3413 ) -> Result<DevToolsListenerEvent, fidl::Error> {
3414 let (bytes, _handles) = buf.split_mut();
3415 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3416 debug_assert_eq!(tx_header.tx_id, 0);
3417 match tx_header.ordinal {
3418 _ => Err(fidl::Error::UnknownOrdinal {
3419 ordinal: tx_header.ordinal,
3420 protocol_name:
3421 <DevToolsListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3422 }),
3423 }
3424 }
3425}
3426
3427pub struct DevToolsListenerRequestStream {
3429 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3430 is_terminated: bool,
3431}
3432
3433impl std::marker::Unpin for DevToolsListenerRequestStream {}
3434
3435impl futures::stream::FusedStream for DevToolsListenerRequestStream {
3436 fn is_terminated(&self) -> bool {
3437 self.is_terminated
3438 }
3439}
3440
3441impl fidl::endpoints::RequestStream for DevToolsListenerRequestStream {
3442 type Protocol = DevToolsListenerMarker;
3443 type ControlHandle = DevToolsListenerControlHandle;
3444
3445 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3446 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3447 }
3448
3449 fn control_handle(&self) -> Self::ControlHandle {
3450 DevToolsListenerControlHandle { inner: self.inner.clone() }
3451 }
3452
3453 fn into_inner(
3454 self,
3455 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3456 {
3457 (self.inner, self.is_terminated)
3458 }
3459
3460 fn from_inner(
3461 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3462 is_terminated: bool,
3463 ) -> Self {
3464 Self { inner, is_terminated }
3465 }
3466}
3467
3468impl futures::Stream for DevToolsListenerRequestStream {
3469 type Item = Result<DevToolsListenerRequest, fidl::Error>;
3470
3471 fn poll_next(
3472 mut self: std::pin::Pin<&mut Self>,
3473 cx: &mut std::task::Context<'_>,
3474 ) -> std::task::Poll<Option<Self::Item>> {
3475 let this = &mut *self;
3476 if this.inner.check_shutdown(cx) {
3477 this.is_terminated = true;
3478 return std::task::Poll::Ready(None);
3479 }
3480 if this.is_terminated {
3481 panic!("polled DevToolsListenerRequestStream after completion");
3482 }
3483 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3484 |bytes, handles| {
3485 match this.inner.channel().read_etc(cx, bytes, handles) {
3486 std::task::Poll::Ready(Ok(())) => {}
3487 std::task::Poll::Pending => return std::task::Poll::Pending,
3488 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3489 this.is_terminated = true;
3490 return std::task::Poll::Ready(None);
3491 }
3492 std::task::Poll::Ready(Err(e)) => {
3493 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3494 e.into(),
3495 ))))
3496 }
3497 }
3498
3499 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3501
3502 std::task::Poll::Ready(Some(match header.ordinal {
3503 0x4b259fb4d7e49e87 => {
3504 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3505 let mut req = fidl::new_empty!(
3506 DevToolsListenerOnContextDevToolsAvailableRequest,
3507 fidl::encoding::DefaultFuchsiaResourceDialect
3508 );
3509 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevToolsListenerOnContextDevToolsAvailableRequest>(&header, _body_bytes, handles, &mut req)?;
3510 let control_handle =
3511 DevToolsListenerControlHandle { inner: this.inner.clone() };
3512 Ok(DevToolsListenerRequest::OnContextDevToolsAvailable {
3513 listener: req.listener,
3514
3515 control_handle,
3516 })
3517 }
3518 _ => Err(fidl::Error::UnknownOrdinal {
3519 ordinal: header.ordinal,
3520 protocol_name:
3521 <DevToolsListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3522 }),
3523 }))
3524 },
3525 )
3526 }
3527}
3528
3529#[derive(Debug)]
3531pub enum DevToolsListenerRequest {
3532 OnContextDevToolsAvailable {
3537 listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3538 control_handle: DevToolsListenerControlHandle,
3539 },
3540}
3541
3542impl DevToolsListenerRequest {
3543 #[allow(irrefutable_let_patterns)]
3544 pub fn into_on_context_dev_tools_available(
3545 self,
3546 ) -> Option<(
3547 fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3548 DevToolsListenerControlHandle,
3549 )> {
3550 if let DevToolsListenerRequest::OnContextDevToolsAvailable { listener, control_handle } =
3551 self
3552 {
3553 Some((listener, control_handle))
3554 } else {
3555 None
3556 }
3557 }
3558
3559 pub fn method_name(&self) -> &'static str {
3561 match *self {
3562 DevToolsListenerRequest::OnContextDevToolsAvailable { .. } => {
3563 "on_context_dev_tools_available"
3564 }
3565 }
3566 }
3567}
3568
3569#[derive(Debug, Clone)]
3570pub struct DevToolsListenerControlHandle {
3571 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3572}
3573
3574impl fidl::endpoints::ControlHandle for DevToolsListenerControlHandle {
3575 fn shutdown(&self) {
3576 self.inner.shutdown()
3577 }
3578 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3579 self.inner.shutdown_with_epitaph(status)
3580 }
3581
3582 fn is_closed(&self) -> bool {
3583 self.inner.channel().is_closed()
3584 }
3585 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3586 self.inner.channel().on_closed()
3587 }
3588
3589 #[cfg(target_os = "fuchsia")]
3590 fn signal_peer(
3591 &self,
3592 clear_mask: zx::Signals,
3593 set_mask: zx::Signals,
3594 ) -> Result<(), zx_status::Status> {
3595 use fidl::Peered;
3596 self.inner.channel().signal_peer(clear_mask, set_mask)
3597 }
3598}
3599
3600impl DevToolsListenerControlHandle {}
3601
3602#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3603pub struct DevToolsPerContextListenerMarker;
3604
3605impl fidl::endpoints::ProtocolMarker for DevToolsPerContextListenerMarker {
3606 type Proxy = DevToolsPerContextListenerProxy;
3607 type RequestStream = DevToolsPerContextListenerRequestStream;
3608 #[cfg(target_os = "fuchsia")]
3609 type SynchronousProxy = DevToolsPerContextListenerSynchronousProxy;
3610
3611 const DEBUG_NAME: &'static str = "(anonymous) DevToolsPerContextListener";
3612}
3613
3614pub trait DevToolsPerContextListenerProxyInterface: Send + Sync {
3615 fn r#on_http_port_open(&self, port: u16) -> Result<(), fidl::Error>;
3616}
3617#[derive(Debug)]
3618#[cfg(target_os = "fuchsia")]
3619pub struct DevToolsPerContextListenerSynchronousProxy {
3620 client: fidl::client::sync::Client,
3621}
3622
3623#[cfg(target_os = "fuchsia")]
3624impl fidl::endpoints::SynchronousProxy for DevToolsPerContextListenerSynchronousProxy {
3625 type Proxy = DevToolsPerContextListenerProxy;
3626 type Protocol = DevToolsPerContextListenerMarker;
3627
3628 fn from_channel(inner: fidl::Channel) -> Self {
3629 Self::new(inner)
3630 }
3631
3632 fn into_channel(self) -> fidl::Channel {
3633 self.client.into_channel()
3634 }
3635
3636 fn as_channel(&self) -> &fidl::Channel {
3637 self.client.as_channel()
3638 }
3639}
3640
3641#[cfg(target_os = "fuchsia")]
3642impl DevToolsPerContextListenerSynchronousProxy {
3643 pub fn new(channel: fidl::Channel) -> Self {
3644 let protocol_name =
3645 <DevToolsPerContextListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3646 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3647 }
3648
3649 pub fn into_channel(self) -> fidl::Channel {
3650 self.client.into_channel()
3651 }
3652
3653 pub fn wait_for_event(
3656 &self,
3657 deadline: zx::MonotonicInstant,
3658 ) -> Result<DevToolsPerContextListenerEvent, fidl::Error> {
3659 DevToolsPerContextListenerEvent::decode(self.client.wait_for_event(deadline)?)
3660 }
3661
3662 pub fn r#on_http_port_open(&self, mut port: u16) -> Result<(), fidl::Error> {
3667 self.client.send::<DevToolsPerContextListenerOnHttpPortOpenRequest>(
3668 (port,),
3669 0x5e330939b035553b,
3670 fidl::encoding::DynamicFlags::empty(),
3671 )
3672 }
3673}
3674
3675#[cfg(target_os = "fuchsia")]
3676impl From<DevToolsPerContextListenerSynchronousProxy> for zx::Handle {
3677 fn from(value: DevToolsPerContextListenerSynchronousProxy) -> Self {
3678 value.into_channel().into()
3679 }
3680}
3681
3682#[cfg(target_os = "fuchsia")]
3683impl From<fidl::Channel> for DevToolsPerContextListenerSynchronousProxy {
3684 fn from(value: fidl::Channel) -> Self {
3685 Self::new(value)
3686 }
3687}
3688
3689#[derive(Debug, Clone)]
3690pub struct DevToolsPerContextListenerProxy {
3691 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3692}
3693
3694impl fidl::endpoints::Proxy for DevToolsPerContextListenerProxy {
3695 type Protocol = DevToolsPerContextListenerMarker;
3696
3697 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3698 Self::new(inner)
3699 }
3700
3701 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3702 self.client.into_channel().map_err(|client| Self { client })
3703 }
3704
3705 fn as_channel(&self) -> &::fidl::AsyncChannel {
3706 self.client.as_channel()
3707 }
3708}
3709
3710impl DevToolsPerContextListenerProxy {
3711 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3713 let protocol_name =
3714 <DevToolsPerContextListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3715 Self { client: fidl::client::Client::new(channel, protocol_name) }
3716 }
3717
3718 pub fn take_event_stream(&self) -> DevToolsPerContextListenerEventStream {
3724 DevToolsPerContextListenerEventStream { event_receiver: self.client.take_event_receiver() }
3725 }
3726
3727 pub fn r#on_http_port_open(&self, mut port: u16) -> Result<(), fidl::Error> {
3732 DevToolsPerContextListenerProxyInterface::r#on_http_port_open(self, port)
3733 }
3734}
3735
3736impl DevToolsPerContextListenerProxyInterface for DevToolsPerContextListenerProxy {
3737 fn r#on_http_port_open(&self, mut port: u16) -> Result<(), fidl::Error> {
3738 self.client.send::<DevToolsPerContextListenerOnHttpPortOpenRequest>(
3739 (port,),
3740 0x5e330939b035553b,
3741 fidl::encoding::DynamicFlags::empty(),
3742 )
3743 }
3744}
3745
3746pub struct DevToolsPerContextListenerEventStream {
3747 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3748}
3749
3750impl std::marker::Unpin for DevToolsPerContextListenerEventStream {}
3751
3752impl futures::stream::FusedStream for DevToolsPerContextListenerEventStream {
3753 fn is_terminated(&self) -> bool {
3754 self.event_receiver.is_terminated()
3755 }
3756}
3757
3758impl futures::Stream for DevToolsPerContextListenerEventStream {
3759 type Item = Result<DevToolsPerContextListenerEvent, fidl::Error>;
3760
3761 fn poll_next(
3762 mut self: std::pin::Pin<&mut Self>,
3763 cx: &mut std::task::Context<'_>,
3764 ) -> std::task::Poll<Option<Self::Item>> {
3765 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3766 &mut self.event_receiver,
3767 cx
3768 )?) {
3769 Some(buf) => std::task::Poll::Ready(Some(DevToolsPerContextListenerEvent::decode(buf))),
3770 None => std::task::Poll::Ready(None),
3771 }
3772 }
3773}
3774
3775#[derive(Debug)]
3776pub enum DevToolsPerContextListenerEvent {}
3777
3778impl DevToolsPerContextListenerEvent {
3779 fn decode(
3781 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3782 ) -> Result<DevToolsPerContextListenerEvent, fidl::Error> {
3783 let (bytes, _handles) = buf.split_mut();
3784 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3785 debug_assert_eq!(tx_header.tx_id, 0);
3786 match tx_header.ordinal {
3787 _ => Err(fidl::Error::UnknownOrdinal {
3788 ordinal: tx_header.ordinal,
3789 protocol_name: <DevToolsPerContextListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3790 })
3791 }
3792 }
3793}
3794
3795pub struct DevToolsPerContextListenerRequestStream {
3797 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3798 is_terminated: bool,
3799}
3800
3801impl std::marker::Unpin for DevToolsPerContextListenerRequestStream {}
3802
3803impl futures::stream::FusedStream for DevToolsPerContextListenerRequestStream {
3804 fn is_terminated(&self) -> bool {
3805 self.is_terminated
3806 }
3807}
3808
3809impl fidl::endpoints::RequestStream for DevToolsPerContextListenerRequestStream {
3810 type Protocol = DevToolsPerContextListenerMarker;
3811 type ControlHandle = DevToolsPerContextListenerControlHandle;
3812
3813 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3814 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3815 }
3816
3817 fn control_handle(&self) -> Self::ControlHandle {
3818 DevToolsPerContextListenerControlHandle { inner: self.inner.clone() }
3819 }
3820
3821 fn into_inner(
3822 self,
3823 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3824 {
3825 (self.inner, self.is_terminated)
3826 }
3827
3828 fn from_inner(
3829 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3830 is_terminated: bool,
3831 ) -> Self {
3832 Self { inner, is_terminated }
3833 }
3834}
3835
3836impl futures::Stream for DevToolsPerContextListenerRequestStream {
3837 type Item = Result<DevToolsPerContextListenerRequest, fidl::Error>;
3838
3839 fn poll_next(
3840 mut self: std::pin::Pin<&mut Self>,
3841 cx: &mut std::task::Context<'_>,
3842 ) -> std::task::Poll<Option<Self::Item>> {
3843 let this = &mut *self;
3844 if this.inner.check_shutdown(cx) {
3845 this.is_terminated = true;
3846 return std::task::Poll::Ready(None);
3847 }
3848 if this.is_terminated {
3849 panic!("polled DevToolsPerContextListenerRequestStream after completion");
3850 }
3851 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3852 |bytes, handles| {
3853 match this.inner.channel().read_etc(cx, bytes, handles) {
3854 std::task::Poll::Ready(Ok(())) => {}
3855 std::task::Poll::Pending => return std::task::Poll::Pending,
3856 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3857 this.is_terminated = true;
3858 return std::task::Poll::Ready(None);
3859 }
3860 std::task::Poll::Ready(Err(e)) => {
3861 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3862 e.into(),
3863 ))))
3864 }
3865 }
3866
3867 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3869
3870 std::task::Poll::Ready(Some(match header.ordinal {
3871 0x5e330939b035553b => {
3872 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3873 let mut req = fidl::new_empty!(DevToolsPerContextListenerOnHttpPortOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3874 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevToolsPerContextListenerOnHttpPortOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3875 let control_handle = DevToolsPerContextListenerControlHandle {
3876 inner: this.inner.clone(),
3877 };
3878 Ok(DevToolsPerContextListenerRequest::OnHttpPortOpen {port: req.port,
3879
3880 control_handle,
3881 })
3882 }
3883 _ => Err(fidl::Error::UnknownOrdinal {
3884 ordinal: header.ordinal,
3885 protocol_name: <DevToolsPerContextListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3886 }),
3887 }))
3888 },
3889 )
3890 }
3891}
3892
3893#[derive(Debug)]
3895pub enum DevToolsPerContextListenerRequest {
3896 OnHttpPortOpen { port: u16, control_handle: DevToolsPerContextListenerControlHandle },
3901}
3902
3903impl DevToolsPerContextListenerRequest {
3904 #[allow(irrefutable_let_patterns)]
3905 pub fn into_on_http_port_open(self) -> Option<(u16, DevToolsPerContextListenerControlHandle)> {
3906 if let DevToolsPerContextListenerRequest::OnHttpPortOpen { port, control_handle } = self {
3907 Some((port, control_handle))
3908 } else {
3909 None
3910 }
3911 }
3912
3913 pub fn method_name(&self) -> &'static str {
3915 match *self {
3916 DevToolsPerContextListenerRequest::OnHttpPortOpen { .. } => "on_http_port_open",
3917 }
3918 }
3919}
3920
3921#[derive(Debug, Clone)]
3922pub struct DevToolsPerContextListenerControlHandle {
3923 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3924}
3925
3926impl fidl::endpoints::ControlHandle for DevToolsPerContextListenerControlHandle {
3927 fn shutdown(&self) {
3928 self.inner.shutdown()
3929 }
3930 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3931 self.inner.shutdown_with_epitaph(status)
3932 }
3933
3934 fn is_closed(&self) -> bool {
3935 self.inner.channel().is_closed()
3936 }
3937 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3938 self.inner.channel().on_closed()
3939 }
3940
3941 #[cfg(target_os = "fuchsia")]
3942 fn signal_peer(
3943 &self,
3944 clear_mask: zx::Signals,
3945 set_mask: zx::Signals,
3946 ) -> Result<(), zx_status::Status> {
3947 use fidl::Peered;
3948 self.inner.channel().signal_peer(clear_mask, set_mask)
3949 }
3950}
3951
3952impl DevToolsPerContextListenerControlHandle {}
3953
3954#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3955pub struct FrameMarker;
3956
3957impl fidl::endpoints::ProtocolMarker for FrameMarker {
3958 type Proxy = FrameProxy;
3959 type RequestStream = FrameRequestStream;
3960 #[cfg(target_os = "fuchsia")]
3961 type SynchronousProxy = FrameSynchronousProxy;
3962
3963 const DEBUG_NAME: &'static str = "(anonymous) Frame";
3964}
3965pub type FrameExecuteJavaScriptResult = Result<fidl_fuchsia_mem::Buffer, FrameError>;
3966pub type FrameExecuteJavaScriptNoResultResult = Result<(), FrameError>;
3967pub type FrameAddBeforeLoadJavaScriptResult = Result<(), FrameError>;
3968pub type FramePostMessageResult = Result<(), FrameError>;
3969
3970pub trait FrameProxyInterface: Send + Sync {
3971 fn r#create_view(
3972 &self,
3973 view_token: fidl_fuchsia_ui_views::ViewToken,
3974 ) -> Result<(), fidl::Error>;
3975 fn r#create_view_with_view_ref(
3976 &self,
3977 view_token: fidl_fuchsia_ui_views::ViewToken,
3978 view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
3979 view_ref: fidl_fuchsia_ui_views::ViewRef,
3980 ) -> Result<(), fidl::Error>;
3981 fn r#create_view2(&self, args: CreateView2Args) -> Result<(), fidl::Error>;
3982 fn r#enable_headless_rendering(&self) -> Result<(), fidl::Error>;
3983 fn r#disable_headless_rendering(&self) -> Result<(), fidl::Error>;
3984 fn r#get_media_player(
3985 &self,
3986 player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
3987 ) -> Result<(), fidl::Error>;
3988 fn r#get_navigation_controller(
3989 &self,
3990 controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
3991 ) -> Result<(), fidl::Error>;
3992 type ExecuteJavaScriptResponseFut: std::future::Future<Output = Result<FrameExecuteJavaScriptResult, fidl::Error>>
3993 + Send;
3994 fn r#execute_java_script(
3995 &self,
3996 origins: &[String],
3997 script: fidl_fuchsia_mem::Buffer,
3998 ) -> Self::ExecuteJavaScriptResponseFut;
3999 type ExecuteJavaScriptNoResultResponseFut: std::future::Future<Output = Result<FrameExecuteJavaScriptNoResultResult, fidl::Error>>
4000 + Send;
4001 fn r#execute_java_script_no_result(
4002 &self,
4003 origins: &[String],
4004 script: fidl_fuchsia_mem::Buffer,
4005 ) -> Self::ExecuteJavaScriptNoResultResponseFut;
4006 type AddBeforeLoadJavaScriptResponseFut: std::future::Future<Output = Result<FrameAddBeforeLoadJavaScriptResult, fidl::Error>>
4007 + Send;
4008 fn r#add_before_load_java_script(
4009 &self,
4010 id: u64,
4011 origins: &[String],
4012 script: fidl_fuchsia_mem::Buffer,
4013 ) -> Self::AddBeforeLoadJavaScriptResponseFut;
4014 fn r#remove_before_load_java_script(&self, id: u64) -> Result<(), fidl::Error>;
4015 type PostMessageResponseFut: std::future::Future<Output = Result<FramePostMessageResult, fidl::Error>>
4016 + Send;
4017 fn r#post_message(
4018 &self,
4019 target_origin: &str,
4020 message: WebMessage,
4021 ) -> Self::PostMessageResponseFut;
4022 fn r#set_navigation_event_listener(
4023 &self,
4024 listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4025 ) -> Result<(), fidl::Error>;
4026 fn r#set_navigation_event_listener2(
4027 &self,
4028 listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4029 flags: NavigationEventListenerFlags,
4030 ) -> Result<(), fidl::Error>;
4031 fn r#set_java_script_log_level(&self, level: ConsoleLogLevel) -> Result<(), fidl::Error>;
4032 fn r#set_console_log_sink(
4033 &self,
4034 sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
4035 ) -> Result<(), fidl::Error>;
4036 fn r#configure_input_types(
4037 &self,
4038 types: InputTypes,
4039 allow: AllowInputState,
4040 ) -> Result<(), fidl::Error>;
4041 fn r#set_popup_frame_creation_listener(
4042 &self,
4043 listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
4044 ) -> Result<(), fidl::Error>;
4045 type SetUrlRequestRewriteRulesResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
4046 + Send;
4047 fn r#set_url_request_rewrite_rules(
4048 &self,
4049 rules: &[UrlRequestRewriteRule],
4050 ) -> Self::SetUrlRequestRewriteRulesResponseFut;
4051 fn r#set_media_settings(&self, settings: &FrameMediaSettings) -> Result<(), fidl::Error>;
4052 fn r#force_content_dimensions(
4053 &self,
4054 web_dips: Option<&fidl_fuchsia_ui_gfx::Vec2>,
4055 ) -> Result<(), fidl::Error>;
4056 fn r#set_permission_state(
4057 &self,
4058 permission: &PermissionDescriptor,
4059 web_origin: &str,
4060 state: PermissionState,
4061 ) -> Result<(), fidl::Error>;
4062 fn r#set_block_media_loading(&self, blocked: bool) -> Result<(), fidl::Error>;
4063 type GetPrivateMemorySizeResponseFut: std::future::Future<Output = Result<u64, fidl::Error>>
4064 + Send;
4065 fn r#get_private_memory_size(&self) -> Self::GetPrivateMemorySizeResponseFut;
4066 fn r#set_navigation_policy_provider(
4067 &self,
4068 params: &NavigationPolicyProviderParams,
4069 provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
4070 ) -> Result<(), fidl::Error>;
4071 fn r#set_content_area_settings(
4072 &self,
4073 settings: &ContentAreaSettings,
4074 ) -> Result<(), fidl::Error>;
4075 fn r#reset_content_area_settings(&self) -> Result<(), fidl::Error>;
4076 fn r#close(&self, payload: &FrameCloseRequest) -> Result<(), fidl::Error>;
4077}
4078#[derive(Debug)]
4079#[cfg(target_os = "fuchsia")]
4080pub struct FrameSynchronousProxy {
4081 client: fidl::client::sync::Client,
4082}
4083
4084#[cfg(target_os = "fuchsia")]
4085impl fidl::endpoints::SynchronousProxy for FrameSynchronousProxy {
4086 type Proxy = FrameProxy;
4087 type Protocol = FrameMarker;
4088
4089 fn from_channel(inner: fidl::Channel) -> Self {
4090 Self::new(inner)
4091 }
4092
4093 fn into_channel(self) -> fidl::Channel {
4094 self.client.into_channel()
4095 }
4096
4097 fn as_channel(&self) -> &fidl::Channel {
4098 self.client.as_channel()
4099 }
4100}
4101
4102#[cfg(target_os = "fuchsia")]
4103impl FrameSynchronousProxy {
4104 pub fn new(channel: fidl::Channel) -> Self {
4105 let protocol_name = <FrameMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4106 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4107 }
4108
4109 pub fn into_channel(self) -> fidl::Channel {
4110 self.client.into_channel()
4111 }
4112
4113 pub fn wait_for_event(
4116 &self,
4117 deadline: zx::MonotonicInstant,
4118 ) -> Result<FrameEvent, fidl::Error> {
4119 FrameEvent::decode(self.client.wait_for_event(deadline)?)
4120 }
4121
4122 pub fn r#create_view(
4128 &self,
4129 mut view_token: fidl_fuchsia_ui_views::ViewToken,
4130 ) -> Result<(), fidl::Error> {
4131 self.client.send::<FrameCreateViewRequest>(
4132 (&mut view_token,),
4133 0x6a27859439133264,
4134 fidl::encoding::DynamicFlags::empty(),
4135 )
4136 }
4137
4138 pub fn r#create_view_with_view_ref(
4149 &self,
4150 mut view_token: fidl_fuchsia_ui_views::ViewToken,
4151 mut view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
4152 mut view_ref: fidl_fuchsia_ui_views::ViewRef,
4153 ) -> Result<(), fidl::Error> {
4154 self.client.send::<FrameCreateViewWithViewRefRequest>(
4155 (&mut view_token, &mut view_ref_control, &mut view_ref),
4156 0x1eb17ab2442326ac,
4157 fidl::encoding::DynamicFlags::empty(),
4158 )
4159 }
4160
4161 pub fn r#create_view2(&self, mut args: CreateView2Args) -> Result<(), fidl::Error> {
4166 self.client.send::<FrameCreateView2Request>(
4167 (&mut args,),
4168 0x1be7e9512962eb37,
4169 fidl::encoding::DynamicFlags::empty(),
4170 )
4171 }
4172
4173 pub fn r#enable_headless_rendering(&self) -> Result<(), fidl::Error> {
4178 self.client.send::<fidl::encoding::EmptyPayload>(
4179 (),
4180 0x72a81aaae7a80d2b,
4181 fidl::encoding::DynamicFlags::empty(),
4182 )
4183 }
4184
4185 pub fn r#disable_headless_rendering(&self) -> Result<(), fidl::Error> {
4189 self.client.send::<fidl::encoding::EmptyPayload>(
4190 (),
4191 0x5ca38a3d1f7f543a,
4192 fidl::encoding::DynamicFlags::empty(),
4193 )
4194 }
4195
4196 pub fn r#get_media_player(
4200 &self,
4201 mut player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
4202 ) -> Result<(), fidl::Error> {
4203 self.client.send::<FrameGetMediaPlayerRequest>(
4204 (player,),
4205 0xaafb639fc0b9eb9,
4206 fidl::encoding::DynamicFlags::empty(),
4207 )
4208 }
4209
4210 pub fn r#get_navigation_controller(
4216 &self,
4217 mut controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
4218 ) -> Result<(), fidl::Error> {
4219 self.client.send::<FrameGetNavigationControllerRequest>(
4220 (controller,),
4221 0x4521cfe95217a688,
4222 fidl::encoding::DynamicFlags::empty(),
4223 )
4224 }
4225
4226 pub fn r#execute_java_script(
4243 &self,
4244 mut origins: &[String],
4245 mut script: fidl_fuchsia_mem::Buffer,
4246 ___deadline: zx::MonotonicInstant,
4247 ) -> Result<FrameExecuteJavaScriptResult, fidl::Error> {
4248 let _response = self.client.send_query::<
4249 FrameExecuteJavaScriptRequest,
4250 fidl::encoding::ResultType<FrameExecuteJavaScriptResponse, FrameError>,
4251 >(
4252 (origins, &mut script,),
4253 0x79abdd4907000542,
4254 fidl::encoding::DynamicFlags::empty(),
4255 ___deadline,
4256 )?;
4257 Ok(_response.map(|x| x.result))
4258 }
4259
4260 pub fn r#execute_java_script_no_result(
4263 &self,
4264 mut origins: &[String],
4265 mut script: fidl_fuchsia_mem::Buffer,
4266 ___deadline: zx::MonotonicInstant,
4267 ) -> Result<FrameExecuteJavaScriptNoResultResult, fidl::Error> {
4268 let _response = self.client.send_query::<
4269 FrameExecuteJavaScriptNoResultRequest,
4270 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
4271 >(
4272 (origins, &mut script,),
4273 0x16b8491520cbcd63,
4274 fidl::encoding::DynamicFlags::empty(),
4275 ___deadline,
4276 )?;
4277 Ok(_response.map(|x| x))
4278 }
4279
4280 pub fn r#add_before_load_java_script(
4298 &self,
4299 mut id: u64,
4300 mut origins: &[String],
4301 mut script: fidl_fuchsia_mem::Buffer,
4302 ___deadline: zx::MonotonicInstant,
4303 ) -> Result<FrameAddBeforeLoadJavaScriptResult, fidl::Error> {
4304 let _response = self.client.send_query::<
4305 FrameAddBeforeLoadJavaScriptRequest,
4306 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
4307 >(
4308 (id, origins, &mut script,),
4309 0x540ac0da59d823e,
4310 fidl::encoding::DynamicFlags::empty(),
4311 ___deadline,
4312 )?;
4313 Ok(_response.map(|x| x))
4314 }
4315
4316 pub fn r#remove_before_load_java_script(&self, mut id: u64) -> Result<(), fidl::Error> {
4319 self.client.send::<FrameRemoveBeforeLoadJavaScriptRequest>(
4320 (id,),
4321 0x17d92b855b61d23a,
4322 fidl::encoding::DynamicFlags::empty(),
4323 )
4324 }
4325
4326 pub fn r#post_message(
4340 &self,
4341 mut target_origin: &str,
4342 mut message: WebMessage,
4343 ___deadline: zx::MonotonicInstant,
4344 ) -> Result<FramePostMessageResult, fidl::Error> {
4345 let _response = self.client.send_query::<
4346 FramePostMessageRequest,
4347 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
4348 >(
4349 (target_origin, &mut message,),
4350 0x751d686eb7caa341,
4351 fidl::encoding::DynamicFlags::empty(),
4352 ___deadline,
4353 )?;
4354 Ok(_response.map(|x| x))
4355 }
4356
4357 pub fn r#set_navigation_event_listener(
4361 &self,
4362 mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4363 ) -> Result<(), fidl::Error> {
4364 self.client.send::<FrameSetNavigationEventListenerRequest>(
4365 (listener,),
4366 0x965ba0fa20e0a56,
4367 fidl::encoding::DynamicFlags::empty(),
4368 )
4369 }
4370
4371 pub fn r#set_navigation_event_listener2(
4377 &self,
4378 mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4379 mut flags: NavigationEventListenerFlags,
4380 ) -> Result<(), fidl::Error> {
4381 self.client.send::<FrameSetNavigationEventListener2Request>(
4382 (listener, flags),
4383 0x5f8b40607f1f578f,
4384 fidl::encoding::DynamicFlags::empty(),
4385 )
4386 }
4387
4388 pub fn r#set_java_script_log_level(
4404 &self,
4405 mut level: ConsoleLogLevel,
4406 ) -> Result<(), fidl::Error> {
4407 self.client.send::<FrameSetJavaScriptLogLevelRequest>(
4408 (level,),
4409 0x74824b11a71c4b5b,
4410 fidl::encoding::DynamicFlags::empty(),
4411 )
4412 }
4413
4414 pub fn r#set_console_log_sink(
4420 &self,
4421 mut sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
4422 ) -> Result<(), fidl::Error> {
4423 self.client.send::<FrameSetConsoleLogSinkRequest>(
4424 (sink,),
4425 0x18f5cbc19fa4687b,
4426 fidl::encoding::DynamicFlags::empty(),
4427 )
4428 }
4429
4430 pub fn r#configure_input_types(
4434 &self,
4435 mut types: InputTypes,
4436 mut allow: AllowInputState,
4437 ) -> Result<(), fidl::Error> {
4438 self.client.send::<FrameConfigureInputTypesRequest>(
4439 (types, allow),
4440 0x38e08fe763c6bef6,
4441 fidl::encoding::DynamicFlags::empty(),
4442 )
4443 }
4444
4445 pub fn r#set_popup_frame_creation_listener(
4450 &self,
4451 mut listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
4452 ) -> Result<(), fidl::Error> {
4453 self.client.send::<FrameSetPopupFrameCreationListenerRequest>(
4454 (listener,),
4455 0x34ddec4e9f11e2aa,
4456 fidl::encoding::DynamicFlags::empty(),
4457 )
4458 }
4459
4460 pub fn r#set_url_request_rewrite_rules(
4469 &self,
4470 mut rules: &[UrlRequestRewriteRule],
4471 ___deadline: zx::MonotonicInstant,
4472 ) -> Result<(), fidl::Error> {
4473 let _response = self
4474 .client
4475 .send_query::<FrameSetUrlRequestRewriteRulesRequest, fidl::encoding::EmptyPayload>(
4476 (rules,),
4477 0x2e3f797350ab3281,
4478 fidl::encoding::DynamicFlags::empty(),
4479 ___deadline,
4480 )?;
4481 Ok(_response)
4482 }
4483
4484 pub fn r#set_media_settings(
4490 &self,
4491 mut settings: &FrameMediaSettings,
4492 ) -> Result<(), fidl::Error> {
4493 self.client.send::<FrameSetMediaSettingsRequest>(
4494 (settings,),
4495 0x7da879b6d284c143,
4496 fidl::encoding::DynamicFlags::empty(),
4497 )
4498 }
4499
4500 pub fn r#force_content_dimensions(
4505 &self,
4506 mut web_dips: Option<&fidl_fuchsia_ui_gfx::Vec2>,
4507 ) -> Result<(), fidl::Error> {
4508 self.client.send::<FrameForceContentDimensionsRequest>(
4509 (web_dips,),
4510 0x8c7024c7149c901,
4511 fidl::encoding::DynamicFlags::empty(),
4512 )
4513 }
4514
4515 pub fn r#set_permission_state(
4518 &self,
4519 mut permission: &PermissionDescriptor,
4520 mut web_origin: &str,
4521 mut state: PermissionState,
4522 ) -> Result<(), fidl::Error> {
4523 self.client.send::<FrameSetPermissionStateRequest>(
4524 (permission, web_origin, state),
4525 0x19574e92a7033f4f,
4526 fidl::encoding::DynamicFlags::empty(),
4527 )
4528 }
4529
4530 pub fn r#set_block_media_loading(&self, mut blocked: bool) -> Result<(), fidl::Error> {
4546 self.client.send::<FrameSetBlockMediaLoadingRequest>(
4547 (blocked,),
4548 0x211071458fc9cf4f,
4549 fidl::encoding::DynamicFlags::empty(),
4550 )
4551 }
4552
4553 pub fn r#get_private_memory_size(
4556 &self,
4557 ___deadline: zx::MonotonicInstant,
4558 ) -> Result<u64, fidl::Error> {
4559 let _response = self
4560 .client
4561 .send_query::<fidl::encoding::EmptyPayload, FrameGetPrivateMemorySizeResponse>(
4562 (),
4563 0x6ad4d43da6c129b0,
4564 fidl::encoding::DynamicFlags::empty(),
4565 ___deadline,
4566 )?;
4567 Ok(_response.size_bytes)
4568 }
4569
4570 pub fn r#set_navigation_policy_provider(
4579 &self,
4580 mut params: &NavigationPolicyProviderParams,
4581 mut provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
4582 ) -> Result<(), fidl::Error> {
4583 self.client.send::<FrameSetNavigationPolicyProviderRequest>(
4584 (params, provider),
4585 0x602ce35195d66654,
4586 fidl::encoding::DynamicFlags::empty(),
4587 )
4588 }
4589
4590 pub fn r#set_content_area_settings(
4597 &self,
4598 mut settings: &ContentAreaSettings,
4599 ) -> Result<(), fidl::Error> {
4600 self.client.send::<FrameSetContentAreaSettingsRequest>(
4601 (settings,),
4602 0x851f4de50c3c27e,
4603 fidl::encoding::DynamicFlags::empty(),
4604 )
4605 }
4606
4607 pub fn r#reset_content_area_settings(&self) -> Result<(), fidl::Error> {
4609 self.client.send::<fidl::encoding::EmptyPayload>(
4610 (),
4611 0x6807e04f16f8ee5d,
4612 fidl::encoding::DynamicFlags::empty(),
4613 )
4614 }
4615
4616 pub fn r#close(&self, mut payload: &FrameCloseRequest) -> Result<(), fidl::Error> {
4635 self.client.send::<FrameCloseRequest>(
4636 payload,
4637 0x442e84138e65351,
4638 fidl::encoding::DynamicFlags::empty(),
4639 )
4640 }
4641}
4642
4643#[cfg(target_os = "fuchsia")]
4644impl From<FrameSynchronousProxy> for zx::Handle {
4645 fn from(value: FrameSynchronousProxy) -> Self {
4646 value.into_channel().into()
4647 }
4648}
4649
4650#[cfg(target_os = "fuchsia")]
4651impl From<fidl::Channel> for FrameSynchronousProxy {
4652 fn from(value: fidl::Channel) -> Self {
4653 Self::new(value)
4654 }
4655}
4656
4657#[derive(Debug, Clone)]
4658pub struct FrameProxy {
4659 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4660}
4661
4662impl fidl::endpoints::Proxy for FrameProxy {
4663 type Protocol = FrameMarker;
4664
4665 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4666 Self::new(inner)
4667 }
4668
4669 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4670 self.client.into_channel().map_err(|client| Self { client })
4671 }
4672
4673 fn as_channel(&self) -> &::fidl::AsyncChannel {
4674 self.client.as_channel()
4675 }
4676}
4677
4678impl FrameProxy {
4679 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4681 let protocol_name = <FrameMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4682 Self { client: fidl::client::Client::new(channel, protocol_name) }
4683 }
4684
4685 pub fn take_event_stream(&self) -> FrameEventStream {
4691 FrameEventStream { event_receiver: self.client.take_event_receiver() }
4692 }
4693
4694 pub fn r#create_view(
4700 &self,
4701 mut view_token: fidl_fuchsia_ui_views::ViewToken,
4702 ) -> Result<(), fidl::Error> {
4703 FrameProxyInterface::r#create_view(self, view_token)
4704 }
4705
4706 pub fn r#create_view_with_view_ref(
4717 &self,
4718 mut view_token: fidl_fuchsia_ui_views::ViewToken,
4719 mut view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
4720 mut view_ref: fidl_fuchsia_ui_views::ViewRef,
4721 ) -> Result<(), fidl::Error> {
4722 FrameProxyInterface::r#create_view_with_view_ref(
4723 self,
4724 view_token,
4725 view_ref_control,
4726 view_ref,
4727 )
4728 }
4729
4730 pub fn r#create_view2(&self, mut args: CreateView2Args) -> Result<(), fidl::Error> {
4735 FrameProxyInterface::r#create_view2(self, args)
4736 }
4737
4738 pub fn r#enable_headless_rendering(&self) -> Result<(), fidl::Error> {
4743 FrameProxyInterface::r#enable_headless_rendering(self)
4744 }
4745
4746 pub fn r#disable_headless_rendering(&self) -> Result<(), fidl::Error> {
4750 FrameProxyInterface::r#disable_headless_rendering(self)
4751 }
4752
4753 pub fn r#get_media_player(
4757 &self,
4758 mut player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
4759 ) -> Result<(), fidl::Error> {
4760 FrameProxyInterface::r#get_media_player(self, player)
4761 }
4762
4763 pub fn r#get_navigation_controller(
4769 &self,
4770 mut controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
4771 ) -> Result<(), fidl::Error> {
4772 FrameProxyInterface::r#get_navigation_controller(self, controller)
4773 }
4774
4775 pub fn r#execute_java_script(
4792 &self,
4793 mut origins: &[String],
4794 mut script: fidl_fuchsia_mem::Buffer,
4795 ) -> fidl::client::QueryResponseFut<
4796 FrameExecuteJavaScriptResult,
4797 fidl::encoding::DefaultFuchsiaResourceDialect,
4798 > {
4799 FrameProxyInterface::r#execute_java_script(self, origins, script)
4800 }
4801
4802 pub fn r#execute_java_script_no_result(
4805 &self,
4806 mut origins: &[String],
4807 mut script: fidl_fuchsia_mem::Buffer,
4808 ) -> fidl::client::QueryResponseFut<
4809 FrameExecuteJavaScriptNoResultResult,
4810 fidl::encoding::DefaultFuchsiaResourceDialect,
4811 > {
4812 FrameProxyInterface::r#execute_java_script_no_result(self, origins, script)
4813 }
4814
4815 pub fn r#add_before_load_java_script(
4833 &self,
4834 mut id: u64,
4835 mut origins: &[String],
4836 mut script: fidl_fuchsia_mem::Buffer,
4837 ) -> fidl::client::QueryResponseFut<
4838 FrameAddBeforeLoadJavaScriptResult,
4839 fidl::encoding::DefaultFuchsiaResourceDialect,
4840 > {
4841 FrameProxyInterface::r#add_before_load_java_script(self, id, origins, script)
4842 }
4843
4844 pub fn r#remove_before_load_java_script(&self, mut id: u64) -> Result<(), fidl::Error> {
4847 FrameProxyInterface::r#remove_before_load_java_script(self, id)
4848 }
4849
4850 pub fn r#post_message(
4864 &self,
4865 mut target_origin: &str,
4866 mut message: WebMessage,
4867 ) -> fidl::client::QueryResponseFut<
4868 FramePostMessageResult,
4869 fidl::encoding::DefaultFuchsiaResourceDialect,
4870 > {
4871 FrameProxyInterface::r#post_message(self, target_origin, message)
4872 }
4873
4874 pub fn r#set_navigation_event_listener(
4878 &self,
4879 mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4880 ) -> Result<(), fidl::Error> {
4881 FrameProxyInterface::r#set_navigation_event_listener(self, listener)
4882 }
4883
4884 pub fn r#set_navigation_event_listener2(
4890 &self,
4891 mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4892 mut flags: NavigationEventListenerFlags,
4893 ) -> Result<(), fidl::Error> {
4894 FrameProxyInterface::r#set_navigation_event_listener2(self, listener, flags)
4895 }
4896
4897 pub fn r#set_java_script_log_level(
4913 &self,
4914 mut level: ConsoleLogLevel,
4915 ) -> Result<(), fidl::Error> {
4916 FrameProxyInterface::r#set_java_script_log_level(self, level)
4917 }
4918
4919 pub fn r#set_console_log_sink(
4925 &self,
4926 mut sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
4927 ) -> Result<(), fidl::Error> {
4928 FrameProxyInterface::r#set_console_log_sink(self, sink)
4929 }
4930
4931 pub fn r#configure_input_types(
4935 &self,
4936 mut types: InputTypes,
4937 mut allow: AllowInputState,
4938 ) -> Result<(), fidl::Error> {
4939 FrameProxyInterface::r#configure_input_types(self, types, allow)
4940 }
4941
4942 pub fn r#set_popup_frame_creation_listener(
4947 &self,
4948 mut listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
4949 ) -> Result<(), fidl::Error> {
4950 FrameProxyInterface::r#set_popup_frame_creation_listener(self, listener)
4951 }
4952
4953 pub fn r#set_url_request_rewrite_rules(
4962 &self,
4963 mut rules: &[UrlRequestRewriteRule],
4964 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4965 FrameProxyInterface::r#set_url_request_rewrite_rules(self, rules)
4966 }
4967
4968 pub fn r#set_media_settings(
4974 &self,
4975 mut settings: &FrameMediaSettings,
4976 ) -> Result<(), fidl::Error> {
4977 FrameProxyInterface::r#set_media_settings(self, settings)
4978 }
4979
4980 pub fn r#force_content_dimensions(
4985 &self,
4986 mut web_dips: Option<&fidl_fuchsia_ui_gfx::Vec2>,
4987 ) -> Result<(), fidl::Error> {
4988 FrameProxyInterface::r#force_content_dimensions(self, web_dips)
4989 }
4990
4991 pub fn r#set_permission_state(
4994 &self,
4995 mut permission: &PermissionDescriptor,
4996 mut web_origin: &str,
4997 mut state: PermissionState,
4998 ) -> Result<(), fidl::Error> {
4999 FrameProxyInterface::r#set_permission_state(self, permission, web_origin, state)
5000 }
5001
5002 pub fn r#set_block_media_loading(&self, mut blocked: bool) -> Result<(), fidl::Error> {
5018 FrameProxyInterface::r#set_block_media_loading(self, blocked)
5019 }
5020
5021 pub fn r#get_private_memory_size(
5024 &self,
5025 ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
5026 FrameProxyInterface::r#get_private_memory_size(self)
5027 }
5028
5029 pub fn r#set_navigation_policy_provider(
5038 &self,
5039 mut params: &NavigationPolicyProviderParams,
5040 mut provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
5041 ) -> Result<(), fidl::Error> {
5042 FrameProxyInterface::r#set_navigation_policy_provider(self, params, provider)
5043 }
5044
5045 pub fn r#set_content_area_settings(
5052 &self,
5053 mut settings: &ContentAreaSettings,
5054 ) -> Result<(), fidl::Error> {
5055 FrameProxyInterface::r#set_content_area_settings(self, settings)
5056 }
5057
5058 pub fn r#reset_content_area_settings(&self) -> Result<(), fidl::Error> {
5060 FrameProxyInterface::r#reset_content_area_settings(self)
5061 }
5062
5063 pub fn r#close(&self, mut payload: &FrameCloseRequest) -> Result<(), fidl::Error> {
5082 FrameProxyInterface::r#close(self, payload)
5083 }
5084}
5085
5086impl FrameProxyInterface for FrameProxy {
5087 fn r#create_view(
5088 &self,
5089 mut view_token: fidl_fuchsia_ui_views::ViewToken,
5090 ) -> Result<(), fidl::Error> {
5091 self.client.send::<FrameCreateViewRequest>(
5092 (&mut view_token,),
5093 0x6a27859439133264,
5094 fidl::encoding::DynamicFlags::empty(),
5095 )
5096 }
5097
5098 fn r#create_view_with_view_ref(
5099 &self,
5100 mut view_token: fidl_fuchsia_ui_views::ViewToken,
5101 mut view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
5102 mut view_ref: fidl_fuchsia_ui_views::ViewRef,
5103 ) -> Result<(), fidl::Error> {
5104 self.client.send::<FrameCreateViewWithViewRefRequest>(
5105 (&mut view_token, &mut view_ref_control, &mut view_ref),
5106 0x1eb17ab2442326ac,
5107 fidl::encoding::DynamicFlags::empty(),
5108 )
5109 }
5110
5111 fn r#create_view2(&self, mut args: CreateView2Args) -> Result<(), fidl::Error> {
5112 self.client.send::<FrameCreateView2Request>(
5113 (&mut args,),
5114 0x1be7e9512962eb37,
5115 fidl::encoding::DynamicFlags::empty(),
5116 )
5117 }
5118
5119 fn r#enable_headless_rendering(&self) -> Result<(), fidl::Error> {
5120 self.client.send::<fidl::encoding::EmptyPayload>(
5121 (),
5122 0x72a81aaae7a80d2b,
5123 fidl::encoding::DynamicFlags::empty(),
5124 )
5125 }
5126
5127 fn r#disable_headless_rendering(&self) -> Result<(), fidl::Error> {
5128 self.client.send::<fidl::encoding::EmptyPayload>(
5129 (),
5130 0x5ca38a3d1f7f543a,
5131 fidl::encoding::DynamicFlags::empty(),
5132 )
5133 }
5134
5135 fn r#get_media_player(
5136 &self,
5137 mut player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
5138 ) -> Result<(), fidl::Error> {
5139 self.client.send::<FrameGetMediaPlayerRequest>(
5140 (player,),
5141 0xaafb639fc0b9eb9,
5142 fidl::encoding::DynamicFlags::empty(),
5143 )
5144 }
5145
5146 fn r#get_navigation_controller(
5147 &self,
5148 mut controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
5149 ) -> Result<(), fidl::Error> {
5150 self.client.send::<FrameGetNavigationControllerRequest>(
5151 (controller,),
5152 0x4521cfe95217a688,
5153 fidl::encoding::DynamicFlags::empty(),
5154 )
5155 }
5156
5157 type ExecuteJavaScriptResponseFut = fidl::client::QueryResponseFut<
5158 FrameExecuteJavaScriptResult,
5159 fidl::encoding::DefaultFuchsiaResourceDialect,
5160 >;
5161 fn r#execute_java_script(
5162 &self,
5163 mut origins: &[String],
5164 mut script: fidl_fuchsia_mem::Buffer,
5165 ) -> Self::ExecuteJavaScriptResponseFut {
5166 fn _decode(
5167 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5168 ) -> Result<FrameExecuteJavaScriptResult, fidl::Error> {
5169 let _response = fidl::client::decode_transaction_body::<
5170 fidl::encoding::ResultType<FrameExecuteJavaScriptResponse, FrameError>,
5171 fidl::encoding::DefaultFuchsiaResourceDialect,
5172 0x79abdd4907000542,
5173 >(_buf?)?;
5174 Ok(_response.map(|x| x.result))
5175 }
5176 self.client
5177 .send_query_and_decode::<FrameExecuteJavaScriptRequest, FrameExecuteJavaScriptResult>(
5178 (origins, &mut script),
5179 0x79abdd4907000542,
5180 fidl::encoding::DynamicFlags::empty(),
5181 _decode,
5182 )
5183 }
5184
5185 type ExecuteJavaScriptNoResultResponseFut = fidl::client::QueryResponseFut<
5186 FrameExecuteJavaScriptNoResultResult,
5187 fidl::encoding::DefaultFuchsiaResourceDialect,
5188 >;
5189 fn r#execute_java_script_no_result(
5190 &self,
5191 mut origins: &[String],
5192 mut script: fidl_fuchsia_mem::Buffer,
5193 ) -> Self::ExecuteJavaScriptNoResultResponseFut {
5194 fn _decode(
5195 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5196 ) -> Result<FrameExecuteJavaScriptNoResultResult, fidl::Error> {
5197 let _response = fidl::client::decode_transaction_body::<
5198 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
5199 fidl::encoding::DefaultFuchsiaResourceDialect,
5200 0x16b8491520cbcd63,
5201 >(_buf?)?;
5202 Ok(_response.map(|x| x))
5203 }
5204 self.client.send_query_and_decode::<
5205 FrameExecuteJavaScriptNoResultRequest,
5206 FrameExecuteJavaScriptNoResultResult,
5207 >(
5208 (origins, &mut script,),
5209 0x16b8491520cbcd63,
5210 fidl::encoding::DynamicFlags::empty(),
5211 _decode,
5212 )
5213 }
5214
5215 type AddBeforeLoadJavaScriptResponseFut = fidl::client::QueryResponseFut<
5216 FrameAddBeforeLoadJavaScriptResult,
5217 fidl::encoding::DefaultFuchsiaResourceDialect,
5218 >;
5219 fn r#add_before_load_java_script(
5220 &self,
5221 mut id: u64,
5222 mut origins: &[String],
5223 mut script: fidl_fuchsia_mem::Buffer,
5224 ) -> Self::AddBeforeLoadJavaScriptResponseFut {
5225 fn _decode(
5226 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5227 ) -> Result<FrameAddBeforeLoadJavaScriptResult, fidl::Error> {
5228 let _response = fidl::client::decode_transaction_body::<
5229 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
5230 fidl::encoding::DefaultFuchsiaResourceDialect,
5231 0x540ac0da59d823e,
5232 >(_buf?)?;
5233 Ok(_response.map(|x| x))
5234 }
5235 self.client.send_query_and_decode::<
5236 FrameAddBeforeLoadJavaScriptRequest,
5237 FrameAddBeforeLoadJavaScriptResult,
5238 >(
5239 (id, origins, &mut script,),
5240 0x540ac0da59d823e,
5241 fidl::encoding::DynamicFlags::empty(),
5242 _decode,
5243 )
5244 }
5245
5246 fn r#remove_before_load_java_script(&self, mut id: u64) -> Result<(), fidl::Error> {
5247 self.client.send::<FrameRemoveBeforeLoadJavaScriptRequest>(
5248 (id,),
5249 0x17d92b855b61d23a,
5250 fidl::encoding::DynamicFlags::empty(),
5251 )
5252 }
5253
5254 type PostMessageResponseFut = fidl::client::QueryResponseFut<
5255 FramePostMessageResult,
5256 fidl::encoding::DefaultFuchsiaResourceDialect,
5257 >;
5258 fn r#post_message(
5259 &self,
5260 mut target_origin: &str,
5261 mut message: WebMessage,
5262 ) -> Self::PostMessageResponseFut {
5263 fn _decode(
5264 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5265 ) -> Result<FramePostMessageResult, fidl::Error> {
5266 let _response = fidl::client::decode_transaction_body::<
5267 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
5268 fidl::encoding::DefaultFuchsiaResourceDialect,
5269 0x751d686eb7caa341,
5270 >(_buf?)?;
5271 Ok(_response.map(|x| x))
5272 }
5273 self.client.send_query_and_decode::<FramePostMessageRequest, FramePostMessageResult>(
5274 (target_origin, &mut message),
5275 0x751d686eb7caa341,
5276 fidl::encoding::DynamicFlags::empty(),
5277 _decode,
5278 )
5279 }
5280
5281 fn r#set_navigation_event_listener(
5282 &self,
5283 mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
5284 ) -> Result<(), fidl::Error> {
5285 self.client.send::<FrameSetNavigationEventListenerRequest>(
5286 (listener,),
5287 0x965ba0fa20e0a56,
5288 fidl::encoding::DynamicFlags::empty(),
5289 )
5290 }
5291
5292 fn r#set_navigation_event_listener2(
5293 &self,
5294 mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
5295 mut flags: NavigationEventListenerFlags,
5296 ) -> Result<(), fidl::Error> {
5297 self.client.send::<FrameSetNavigationEventListener2Request>(
5298 (listener, flags),
5299 0x5f8b40607f1f578f,
5300 fidl::encoding::DynamicFlags::empty(),
5301 )
5302 }
5303
5304 fn r#set_java_script_log_level(&self, mut level: ConsoleLogLevel) -> Result<(), fidl::Error> {
5305 self.client.send::<FrameSetJavaScriptLogLevelRequest>(
5306 (level,),
5307 0x74824b11a71c4b5b,
5308 fidl::encoding::DynamicFlags::empty(),
5309 )
5310 }
5311
5312 fn r#set_console_log_sink(
5313 &self,
5314 mut sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
5315 ) -> Result<(), fidl::Error> {
5316 self.client.send::<FrameSetConsoleLogSinkRequest>(
5317 (sink,),
5318 0x18f5cbc19fa4687b,
5319 fidl::encoding::DynamicFlags::empty(),
5320 )
5321 }
5322
5323 fn r#configure_input_types(
5324 &self,
5325 mut types: InputTypes,
5326 mut allow: AllowInputState,
5327 ) -> Result<(), fidl::Error> {
5328 self.client.send::<FrameConfigureInputTypesRequest>(
5329 (types, allow),
5330 0x38e08fe763c6bef6,
5331 fidl::encoding::DynamicFlags::empty(),
5332 )
5333 }
5334
5335 fn r#set_popup_frame_creation_listener(
5336 &self,
5337 mut listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
5338 ) -> Result<(), fidl::Error> {
5339 self.client.send::<FrameSetPopupFrameCreationListenerRequest>(
5340 (listener,),
5341 0x34ddec4e9f11e2aa,
5342 fidl::encoding::DynamicFlags::empty(),
5343 )
5344 }
5345
5346 type SetUrlRequestRewriteRulesResponseFut =
5347 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5348 fn r#set_url_request_rewrite_rules(
5349 &self,
5350 mut rules: &[UrlRequestRewriteRule],
5351 ) -> Self::SetUrlRequestRewriteRulesResponseFut {
5352 fn _decode(
5353 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5354 ) -> Result<(), fidl::Error> {
5355 let _response = fidl::client::decode_transaction_body::<
5356 fidl::encoding::EmptyPayload,
5357 fidl::encoding::DefaultFuchsiaResourceDialect,
5358 0x2e3f797350ab3281,
5359 >(_buf?)?;
5360 Ok(_response)
5361 }
5362 self.client.send_query_and_decode::<FrameSetUrlRequestRewriteRulesRequest, ()>(
5363 (rules,),
5364 0x2e3f797350ab3281,
5365 fidl::encoding::DynamicFlags::empty(),
5366 _decode,
5367 )
5368 }
5369
5370 fn r#set_media_settings(&self, mut settings: &FrameMediaSettings) -> Result<(), fidl::Error> {
5371 self.client.send::<FrameSetMediaSettingsRequest>(
5372 (settings,),
5373 0x7da879b6d284c143,
5374 fidl::encoding::DynamicFlags::empty(),
5375 )
5376 }
5377
5378 fn r#force_content_dimensions(
5379 &self,
5380 mut web_dips: Option<&fidl_fuchsia_ui_gfx::Vec2>,
5381 ) -> Result<(), fidl::Error> {
5382 self.client.send::<FrameForceContentDimensionsRequest>(
5383 (web_dips,),
5384 0x8c7024c7149c901,
5385 fidl::encoding::DynamicFlags::empty(),
5386 )
5387 }
5388
5389 fn r#set_permission_state(
5390 &self,
5391 mut permission: &PermissionDescriptor,
5392 mut web_origin: &str,
5393 mut state: PermissionState,
5394 ) -> Result<(), fidl::Error> {
5395 self.client.send::<FrameSetPermissionStateRequest>(
5396 (permission, web_origin, state),
5397 0x19574e92a7033f4f,
5398 fidl::encoding::DynamicFlags::empty(),
5399 )
5400 }
5401
5402 fn r#set_block_media_loading(&self, mut blocked: bool) -> Result<(), fidl::Error> {
5403 self.client.send::<FrameSetBlockMediaLoadingRequest>(
5404 (blocked,),
5405 0x211071458fc9cf4f,
5406 fidl::encoding::DynamicFlags::empty(),
5407 )
5408 }
5409
5410 type GetPrivateMemorySizeResponseFut =
5411 fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
5412 fn r#get_private_memory_size(&self) -> Self::GetPrivateMemorySizeResponseFut {
5413 fn _decode(
5414 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5415 ) -> Result<u64, fidl::Error> {
5416 let _response = fidl::client::decode_transaction_body::<
5417 FrameGetPrivateMemorySizeResponse,
5418 fidl::encoding::DefaultFuchsiaResourceDialect,
5419 0x6ad4d43da6c129b0,
5420 >(_buf?)?;
5421 Ok(_response.size_bytes)
5422 }
5423 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
5424 (),
5425 0x6ad4d43da6c129b0,
5426 fidl::encoding::DynamicFlags::empty(),
5427 _decode,
5428 )
5429 }
5430
5431 fn r#set_navigation_policy_provider(
5432 &self,
5433 mut params: &NavigationPolicyProviderParams,
5434 mut provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
5435 ) -> Result<(), fidl::Error> {
5436 self.client.send::<FrameSetNavigationPolicyProviderRequest>(
5437 (params, provider),
5438 0x602ce35195d66654,
5439 fidl::encoding::DynamicFlags::empty(),
5440 )
5441 }
5442
5443 fn r#set_content_area_settings(
5444 &self,
5445 mut settings: &ContentAreaSettings,
5446 ) -> Result<(), fidl::Error> {
5447 self.client.send::<FrameSetContentAreaSettingsRequest>(
5448 (settings,),
5449 0x851f4de50c3c27e,
5450 fidl::encoding::DynamicFlags::empty(),
5451 )
5452 }
5453
5454 fn r#reset_content_area_settings(&self) -> Result<(), fidl::Error> {
5455 self.client.send::<fidl::encoding::EmptyPayload>(
5456 (),
5457 0x6807e04f16f8ee5d,
5458 fidl::encoding::DynamicFlags::empty(),
5459 )
5460 }
5461
5462 fn r#close(&self, mut payload: &FrameCloseRequest) -> Result<(), fidl::Error> {
5463 self.client.send::<FrameCloseRequest>(
5464 payload,
5465 0x442e84138e65351,
5466 fidl::encoding::DynamicFlags::empty(),
5467 )
5468 }
5469}
5470
5471pub struct FrameEventStream {
5472 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5473}
5474
5475impl std::marker::Unpin for FrameEventStream {}
5476
5477impl futures::stream::FusedStream for FrameEventStream {
5478 fn is_terminated(&self) -> bool {
5479 self.event_receiver.is_terminated()
5480 }
5481}
5482
5483impl futures::Stream for FrameEventStream {
5484 type Item = Result<FrameEvent, fidl::Error>;
5485
5486 fn poll_next(
5487 mut self: std::pin::Pin<&mut Self>,
5488 cx: &mut std::task::Context<'_>,
5489 ) -> std::task::Poll<Option<Self::Item>> {
5490 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5491 &mut self.event_receiver,
5492 cx
5493 )?) {
5494 Some(buf) => std::task::Poll::Ready(Some(FrameEvent::decode(buf))),
5495 None => std::task::Poll::Ready(None),
5496 }
5497 }
5498}
5499
5500#[derive(Debug)]
5501pub enum FrameEvent {}
5502
5503impl FrameEvent {
5504 fn decode(
5506 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5507 ) -> Result<FrameEvent, fidl::Error> {
5508 let (bytes, _handles) = buf.split_mut();
5509 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5510 debug_assert_eq!(tx_header.tx_id, 0);
5511 match tx_header.ordinal {
5512 _ => Err(fidl::Error::UnknownOrdinal {
5513 ordinal: tx_header.ordinal,
5514 protocol_name: <FrameMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5515 }),
5516 }
5517 }
5518}
5519
5520pub struct FrameRequestStream {
5522 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5523 is_terminated: bool,
5524}
5525
5526impl std::marker::Unpin for FrameRequestStream {}
5527
5528impl futures::stream::FusedStream for FrameRequestStream {
5529 fn is_terminated(&self) -> bool {
5530 self.is_terminated
5531 }
5532}
5533
5534impl fidl::endpoints::RequestStream for FrameRequestStream {
5535 type Protocol = FrameMarker;
5536 type ControlHandle = FrameControlHandle;
5537
5538 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5539 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5540 }
5541
5542 fn control_handle(&self) -> Self::ControlHandle {
5543 FrameControlHandle { inner: self.inner.clone() }
5544 }
5545
5546 fn into_inner(
5547 self,
5548 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5549 {
5550 (self.inner, self.is_terminated)
5551 }
5552
5553 fn from_inner(
5554 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5555 is_terminated: bool,
5556 ) -> Self {
5557 Self { inner, is_terminated }
5558 }
5559}
5560
5561impl futures::Stream for FrameRequestStream {
5562 type Item = Result<FrameRequest, fidl::Error>;
5563
5564 fn poll_next(
5565 mut self: std::pin::Pin<&mut Self>,
5566 cx: &mut std::task::Context<'_>,
5567 ) -> std::task::Poll<Option<Self::Item>> {
5568 let this = &mut *self;
5569 if this.inner.check_shutdown(cx) {
5570 this.is_terminated = true;
5571 return std::task::Poll::Ready(None);
5572 }
5573 if this.is_terminated {
5574 panic!("polled FrameRequestStream after completion");
5575 }
5576 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5577 |bytes, handles| {
5578 match this.inner.channel().read_etc(cx, bytes, handles) {
5579 std::task::Poll::Ready(Ok(())) => {}
5580 std::task::Poll::Pending => return std::task::Poll::Pending,
5581 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5582 this.is_terminated = true;
5583 return std::task::Poll::Ready(None);
5584 }
5585 std::task::Poll::Ready(Err(e)) => {
5586 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5587 e.into(),
5588 ))))
5589 }
5590 }
5591
5592 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5594
5595 std::task::Poll::Ready(Some(match header.ordinal {
5596 0x6a27859439133264 => {
5597 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5598 let mut req = fidl::new_empty!(
5599 FrameCreateViewRequest,
5600 fidl::encoding::DefaultFuchsiaResourceDialect
5601 );
5602 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameCreateViewRequest>(&header, _body_bytes, handles, &mut req)?;
5603 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5604 Ok(FrameRequest::CreateView { view_token: req.view_token, control_handle })
5605 }
5606 0x1eb17ab2442326ac => {
5607 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5608 let mut req = fidl::new_empty!(
5609 FrameCreateViewWithViewRefRequest,
5610 fidl::encoding::DefaultFuchsiaResourceDialect
5611 );
5612 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameCreateViewWithViewRefRequest>(&header, _body_bytes, handles, &mut req)?;
5613 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5614 Ok(FrameRequest::CreateViewWithViewRef {
5615 view_token: req.view_token,
5616 view_ref_control: req.view_ref_control,
5617 view_ref: req.view_ref,
5618
5619 control_handle,
5620 })
5621 }
5622 0x1be7e9512962eb37 => {
5623 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5624 let mut req = fidl::new_empty!(
5625 FrameCreateView2Request,
5626 fidl::encoding::DefaultFuchsiaResourceDialect
5627 );
5628 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameCreateView2Request>(&header, _body_bytes, handles, &mut req)?;
5629 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5630 Ok(FrameRequest::CreateView2 { args: req.args, control_handle })
5631 }
5632 0x72a81aaae7a80d2b => {
5633 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5634 let mut req = fidl::new_empty!(
5635 fidl::encoding::EmptyPayload,
5636 fidl::encoding::DefaultFuchsiaResourceDialect
5637 );
5638 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5639 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5640 Ok(FrameRequest::EnableHeadlessRendering { control_handle })
5641 }
5642 0x5ca38a3d1f7f543a => {
5643 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5644 let mut req = fidl::new_empty!(
5645 fidl::encoding::EmptyPayload,
5646 fidl::encoding::DefaultFuchsiaResourceDialect
5647 );
5648 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5649 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5650 Ok(FrameRequest::DisableHeadlessRendering { control_handle })
5651 }
5652 0xaafb639fc0b9eb9 => {
5653 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5654 let mut req = fidl::new_empty!(
5655 FrameGetMediaPlayerRequest,
5656 fidl::encoding::DefaultFuchsiaResourceDialect
5657 );
5658 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameGetMediaPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
5659 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5660 Ok(FrameRequest::GetMediaPlayer { player: req.player, control_handle })
5661 }
5662 0x4521cfe95217a688 => {
5663 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5664 let mut req = fidl::new_empty!(
5665 FrameGetNavigationControllerRequest,
5666 fidl::encoding::DefaultFuchsiaResourceDialect
5667 );
5668 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameGetNavigationControllerRequest>(&header, _body_bytes, handles, &mut req)?;
5669 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5670 Ok(FrameRequest::GetNavigationController {
5671 controller: req.controller,
5672
5673 control_handle,
5674 })
5675 }
5676 0x79abdd4907000542 => {
5677 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5678 let mut req = fidl::new_empty!(
5679 FrameExecuteJavaScriptRequest,
5680 fidl::encoding::DefaultFuchsiaResourceDialect
5681 );
5682 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameExecuteJavaScriptRequest>(&header, _body_bytes, handles, &mut req)?;
5683 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5684 Ok(FrameRequest::ExecuteJavaScript {
5685 origins: req.origins,
5686 script: req.script,
5687
5688 responder: FrameExecuteJavaScriptResponder {
5689 control_handle: std::mem::ManuallyDrop::new(control_handle),
5690 tx_id: header.tx_id,
5691 },
5692 })
5693 }
5694 0x16b8491520cbcd63 => {
5695 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5696 let mut req = fidl::new_empty!(
5697 FrameExecuteJavaScriptNoResultRequest,
5698 fidl::encoding::DefaultFuchsiaResourceDialect
5699 );
5700 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameExecuteJavaScriptNoResultRequest>(&header, _body_bytes, handles, &mut req)?;
5701 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5702 Ok(FrameRequest::ExecuteJavaScriptNoResult {
5703 origins: req.origins,
5704 script: req.script,
5705
5706 responder: FrameExecuteJavaScriptNoResultResponder {
5707 control_handle: std::mem::ManuallyDrop::new(control_handle),
5708 tx_id: header.tx_id,
5709 },
5710 })
5711 }
5712 0x540ac0da59d823e => {
5713 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5714 let mut req = fidl::new_empty!(
5715 FrameAddBeforeLoadJavaScriptRequest,
5716 fidl::encoding::DefaultFuchsiaResourceDialect
5717 );
5718 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameAddBeforeLoadJavaScriptRequest>(&header, _body_bytes, handles, &mut req)?;
5719 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5720 Ok(FrameRequest::AddBeforeLoadJavaScript {
5721 id: req.id,
5722 origins: req.origins,
5723 script: req.script,
5724
5725 responder: FrameAddBeforeLoadJavaScriptResponder {
5726 control_handle: std::mem::ManuallyDrop::new(control_handle),
5727 tx_id: header.tx_id,
5728 },
5729 })
5730 }
5731 0x17d92b855b61d23a => {
5732 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5733 let mut req = fidl::new_empty!(
5734 FrameRemoveBeforeLoadJavaScriptRequest,
5735 fidl::encoding::DefaultFuchsiaResourceDialect
5736 );
5737 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameRemoveBeforeLoadJavaScriptRequest>(&header, _body_bytes, handles, &mut req)?;
5738 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5739 Ok(FrameRequest::RemoveBeforeLoadJavaScript { id: req.id, control_handle })
5740 }
5741 0x751d686eb7caa341 => {
5742 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5743 let mut req = fidl::new_empty!(
5744 FramePostMessageRequest,
5745 fidl::encoding::DefaultFuchsiaResourceDialect
5746 );
5747 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FramePostMessageRequest>(&header, _body_bytes, handles, &mut req)?;
5748 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5749 Ok(FrameRequest::PostMessage {
5750 target_origin: req.target_origin,
5751 message: req.message,
5752
5753 responder: FramePostMessageResponder {
5754 control_handle: std::mem::ManuallyDrop::new(control_handle),
5755 tx_id: header.tx_id,
5756 },
5757 })
5758 }
5759 0x965ba0fa20e0a56 => {
5760 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5761 let mut req = fidl::new_empty!(
5762 FrameSetNavigationEventListenerRequest,
5763 fidl::encoding::DefaultFuchsiaResourceDialect
5764 );
5765 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetNavigationEventListenerRequest>(&header, _body_bytes, handles, &mut req)?;
5766 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5767 Ok(FrameRequest::SetNavigationEventListener {
5768 listener: req.listener,
5769
5770 control_handle,
5771 })
5772 }
5773 0x5f8b40607f1f578f => {
5774 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5775 let mut req = fidl::new_empty!(
5776 FrameSetNavigationEventListener2Request,
5777 fidl::encoding::DefaultFuchsiaResourceDialect
5778 );
5779 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetNavigationEventListener2Request>(&header, _body_bytes, handles, &mut req)?;
5780 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5781 Ok(FrameRequest::SetNavigationEventListener2 {
5782 listener: req.listener,
5783 flags: req.flags,
5784
5785 control_handle,
5786 })
5787 }
5788 0x74824b11a71c4b5b => {
5789 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5790 let mut req = fidl::new_empty!(
5791 FrameSetJavaScriptLogLevelRequest,
5792 fidl::encoding::DefaultFuchsiaResourceDialect
5793 );
5794 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetJavaScriptLogLevelRequest>(&header, _body_bytes, handles, &mut req)?;
5795 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5796 Ok(FrameRequest::SetJavaScriptLogLevel { level: req.level, control_handle })
5797 }
5798 0x18f5cbc19fa4687b => {
5799 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5800 let mut req = fidl::new_empty!(
5801 FrameSetConsoleLogSinkRequest,
5802 fidl::encoding::DefaultFuchsiaResourceDialect
5803 );
5804 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetConsoleLogSinkRequest>(&header, _body_bytes, handles, &mut req)?;
5805 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5806 Ok(FrameRequest::SetConsoleLogSink { sink: req.sink, control_handle })
5807 }
5808 0x38e08fe763c6bef6 => {
5809 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5810 let mut req = fidl::new_empty!(
5811 FrameConfigureInputTypesRequest,
5812 fidl::encoding::DefaultFuchsiaResourceDialect
5813 );
5814 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameConfigureInputTypesRequest>(&header, _body_bytes, handles, &mut req)?;
5815 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5816 Ok(FrameRequest::ConfigureInputTypes {
5817 types: req.types,
5818 allow: req.allow,
5819
5820 control_handle,
5821 })
5822 }
5823 0x34ddec4e9f11e2aa => {
5824 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5825 let mut req = fidl::new_empty!(
5826 FrameSetPopupFrameCreationListenerRequest,
5827 fidl::encoding::DefaultFuchsiaResourceDialect
5828 );
5829 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetPopupFrameCreationListenerRequest>(&header, _body_bytes, handles, &mut req)?;
5830 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5831 Ok(FrameRequest::SetPopupFrameCreationListener {
5832 listener: req.listener,
5833
5834 control_handle,
5835 })
5836 }
5837 0x2e3f797350ab3281 => {
5838 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5839 let mut req = fidl::new_empty!(
5840 FrameSetUrlRequestRewriteRulesRequest,
5841 fidl::encoding::DefaultFuchsiaResourceDialect
5842 );
5843 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetUrlRequestRewriteRulesRequest>(&header, _body_bytes, handles, &mut req)?;
5844 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5845 Ok(FrameRequest::SetUrlRequestRewriteRules {
5846 rules: req.rules,
5847
5848 responder: FrameSetUrlRequestRewriteRulesResponder {
5849 control_handle: std::mem::ManuallyDrop::new(control_handle),
5850 tx_id: header.tx_id,
5851 },
5852 })
5853 }
5854 0x7da879b6d284c143 => {
5855 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5856 let mut req = fidl::new_empty!(
5857 FrameSetMediaSettingsRequest,
5858 fidl::encoding::DefaultFuchsiaResourceDialect
5859 );
5860 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetMediaSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
5861 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5862 Ok(FrameRequest::SetMediaSettings {
5863 settings: req.settings,
5864
5865 control_handle,
5866 })
5867 }
5868 0x8c7024c7149c901 => {
5869 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5870 let mut req = fidl::new_empty!(
5871 FrameForceContentDimensionsRequest,
5872 fidl::encoding::DefaultFuchsiaResourceDialect
5873 );
5874 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameForceContentDimensionsRequest>(&header, _body_bytes, handles, &mut req)?;
5875 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5876 Ok(FrameRequest::ForceContentDimensions {
5877 web_dips: req.web_dips,
5878
5879 control_handle,
5880 })
5881 }
5882 0x19574e92a7033f4f => {
5883 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5884 let mut req = fidl::new_empty!(
5885 FrameSetPermissionStateRequest,
5886 fidl::encoding::DefaultFuchsiaResourceDialect
5887 );
5888 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetPermissionStateRequest>(&header, _body_bytes, handles, &mut req)?;
5889 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5890 Ok(FrameRequest::SetPermissionState {
5891 permission: req.permission,
5892 web_origin: req.web_origin,
5893 state: req.state,
5894
5895 control_handle,
5896 })
5897 }
5898 0x211071458fc9cf4f => {
5899 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5900 let mut req = fidl::new_empty!(
5901 FrameSetBlockMediaLoadingRequest,
5902 fidl::encoding::DefaultFuchsiaResourceDialect
5903 );
5904 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetBlockMediaLoadingRequest>(&header, _body_bytes, handles, &mut req)?;
5905 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5906 Ok(FrameRequest::SetBlockMediaLoading {
5907 blocked: req.blocked,
5908
5909 control_handle,
5910 })
5911 }
5912 0x6ad4d43da6c129b0 => {
5913 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5914 let mut req = fidl::new_empty!(
5915 fidl::encoding::EmptyPayload,
5916 fidl::encoding::DefaultFuchsiaResourceDialect
5917 );
5918 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5919 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5920 Ok(FrameRequest::GetPrivateMemorySize {
5921 responder: FrameGetPrivateMemorySizeResponder {
5922 control_handle: std::mem::ManuallyDrop::new(control_handle),
5923 tx_id: header.tx_id,
5924 },
5925 })
5926 }
5927 0x602ce35195d66654 => {
5928 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5929 let mut req = fidl::new_empty!(
5930 FrameSetNavigationPolicyProviderRequest,
5931 fidl::encoding::DefaultFuchsiaResourceDialect
5932 );
5933 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetNavigationPolicyProviderRequest>(&header, _body_bytes, handles, &mut req)?;
5934 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5935 Ok(FrameRequest::SetNavigationPolicyProvider {
5936 params: req.params,
5937 provider: req.provider,
5938
5939 control_handle,
5940 })
5941 }
5942 0x851f4de50c3c27e => {
5943 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5944 let mut req = fidl::new_empty!(
5945 FrameSetContentAreaSettingsRequest,
5946 fidl::encoding::DefaultFuchsiaResourceDialect
5947 );
5948 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetContentAreaSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
5949 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5950 Ok(FrameRequest::SetContentAreaSettings {
5951 settings: req.settings,
5952
5953 control_handle,
5954 })
5955 }
5956 0x6807e04f16f8ee5d => {
5957 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5958 let mut req = fidl::new_empty!(
5959 fidl::encoding::EmptyPayload,
5960 fidl::encoding::DefaultFuchsiaResourceDialect
5961 );
5962 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5963 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5964 Ok(FrameRequest::ResetContentAreaSettings { control_handle })
5965 }
5966 0x442e84138e65351 => {
5967 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5968 let mut req = fidl::new_empty!(
5969 FrameCloseRequest,
5970 fidl::encoding::DefaultFuchsiaResourceDialect
5971 );
5972 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameCloseRequest>(&header, _body_bytes, handles, &mut req)?;
5973 let control_handle = FrameControlHandle { inner: this.inner.clone() };
5974 Ok(FrameRequest::Close { payload: req, control_handle })
5975 }
5976 _ => Err(fidl::Error::UnknownOrdinal {
5977 ordinal: header.ordinal,
5978 protocol_name: <FrameMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5979 }),
5980 }))
5981 },
5982 )
5983 }
5984}
5985
5986#[derive(Debug)]
5987pub enum FrameRequest {
5988 CreateView { view_token: fidl_fuchsia_ui_views::ViewToken, control_handle: FrameControlHandle },
5994 CreateViewWithViewRef {
6005 view_token: fidl_fuchsia_ui_views::ViewToken,
6006 view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
6007 view_ref: fidl_fuchsia_ui_views::ViewRef,
6008 control_handle: FrameControlHandle,
6009 },
6010 CreateView2 { args: CreateView2Args, control_handle: FrameControlHandle },
6015 EnableHeadlessRendering { control_handle: FrameControlHandle },
6020 DisableHeadlessRendering { control_handle: FrameControlHandle },
6024 GetMediaPlayer {
6028 player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
6029 control_handle: FrameControlHandle,
6030 },
6031 GetNavigationController {
6037 controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
6038 control_handle: FrameControlHandle,
6039 },
6040 ExecuteJavaScript {
6057 origins: Vec<String>,
6058 script: fidl_fuchsia_mem::Buffer,
6059 responder: FrameExecuteJavaScriptResponder,
6060 },
6061 ExecuteJavaScriptNoResult {
6064 origins: Vec<String>,
6065 script: fidl_fuchsia_mem::Buffer,
6066 responder: FrameExecuteJavaScriptNoResultResponder,
6067 },
6068 AddBeforeLoadJavaScript {
6086 id: u64,
6087 origins: Vec<String>,
6088 script: fidl_fuchsia_mem::Buffer,
6089 responder: FrameAddBeforeLoadJavaScriptResponder,
6090 },
6091 RemoveBeforeLoadJavaScript { id: u64, control_handle: FrameControlHandle },
6094 PostMessage { target_origin: String, message: WebMessage, responder: FramePostMessageResponder },
6108 SetNavigationEventListener {
6112 listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
6113 control_handle: FrameControlHandle,
6114 },
6115 SetNavigationEventListener2 {
6121 listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
6122 flags: NavigationEventListenerFlags,
6123 control_handle: FrameControlHandle,
6124 },
6125 SetJavaScriptLogLevel { level: ConsoleLogLevel, control_handle: FrameControlHandle },
6141 SetConsoleLogSink {
6147 sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
6148 control_handle: FrameControlHandle,
6149 },
6150 ConfigureInputTypes {
6154 types: InputTypes,
6155 allow: AllowInputState,
6156 control_handle: FrameControlHandle,
6157 },
6158 SetPopupFrameCreationListener {
6163 listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
6164 control_handle: FrameControlHandle,
6165 },
6166 SetUrlRequestRewriteRules {
6175 rules: Vec<UrlRequestRewriteRule>,
6176 responder: FrameSetUrlRequestRewriteRulesResponder,
6177 },
6178 SetMediaSettings { settings: FrameMediaSettings, control_handle: FrameControlHandle },
6184 ForceContentDimensions {
6189 web_dips: Option<Box<fidl_fuchsia_ui_gfx::Vec2>>,
6190 control_handle: FrameControlHandle,
6191 },
6192 SetPermissionState {
6195 permission: PermissionDescriptor,
6196 web_origin: String,
6197 state: PermissionState,
6198 control_handle: FrameControlHandle,
6199 },
6200 SetBlockMediaLoading { blocked: bool, control_handle: FrameControlHandle },
6216 GetPrivateMemorySize { responder: FrameGetPrivateMemorySizeResponder },
6219 SetNavigationPolicyProvider {
6228 params: NavigationPolicyProviderParams,
6229 provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
6230 control_handle: FrameControlHandle,
6231 },
6232 SetContentAreaSettings { settings: ContentAreaSettings, control_handle: FrameControlHandle },
6239 ResetContentAreaSettings { control_handle: FrameControlHandle },
6241 Close { payload: FrameCloseRequest, control_handle: FrameControlHandle },
6260}
6261
6262impl FrameRequest {
6263 #[allow(irrefutable_let_patterns)]
6264 pub fn into_create_view(
6265 self,
6266 ) -> Option<(fidl_fuchsia_ui_views::ViewToken, FrameControlHandle)> {
6267 if let FrameRequest::CreateView { view_token, control_handle } = self {
6268 Some((view_token, control_handle))
6269 } else {
6270 None
6271 }
6272 }
6273
6274 #[allow(irrefutable_let_patterns)]
6275 pub fn into_create_view_with_view_ref(
6276 self,
6277 ) -> Option<(
6278 fidl_fuchsia_ui_views::ViewToken,
6279 fidl_fuchsia_ui_views::ViewRefControl,
6280 fidl_fuchsia_ui_views::ViewRef,
6281 FrameControlHandle,
6282 )> {
6283 if let FrameRequest::CreateViewWithViewRef {
6284 view_token,
6285 view_ref_control,
6286 view_ref,
6287 control_handle,
6288 } = self
6289 {
6290 Some((view_token, view_ref_control, view_ref, control_handle))
6291 } else {
6292 None
6293 }
6294 }
6295
6296 #[allow(irrefutable_let_patterns)]
6297 pub fn into_create_view2(self) -> Option<(CreateView2Args, FrameControlHandle)> {
6298 if let FrameRequest::CreateView2 { args, control_handle } = self {
6299 Some((args, control_handle))
6300 } else {
6301 None
6302 }
6303 }
6304
6305 #[allow(irrefutable_let_patterns)]
6306 pub fn into_enable_headless_rendering(self) -> Option<(FrameControlHandle)> {
6307 if let FrameRequest::EnableHeadlessRendering { control_handle } = self {
6308 Some((control_handle))
6309 } else {
6310 None
6311 }
6312 }
6313
6314 #[allow(irrefutable_let_patterns)]
6315 pub fn into_disable_headless_rendering(self) -> Option<(FrameControlHandle)> {
6316 if let FrameRequest::DisableHeadlessRendering { control_handle } = self {
6317 Some((control_handle))
6318 } else {
6319 None
6320 }
6321 }
6322
6323 #[allow(irrefutable_let_patterns)]
6324 pub fn into_get_media_player(
6325 self,
6326 ) -> Option<(
6327 fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
6328 FrameControlHandle,
6329 )> {
6330 if let FrameRequest::GetMediaPlayer { player, control_handle } = self {
6331 Some((player, control_handle))
6332 } else {
6333 None
6334 }
6335 }
6336
6337 #[allow(irrefutable_let_patterns)]
6338 pub fn into_get_navigation_controller(
6339 self,
6340 ) -> Option<(fidl::endpoints::ServerEnd<NavigationControllerMarker>, FrameControlHandle)> {
6341 if let FrameRequest::GetNavigationController { controller, control_handle } = self {
6342 Some((controller, control_handle))
6343 } else {
6344 None
6345 }
6346 }
6347
6348 #[allow(irrefutable_let_patterns)]
6349 pub fn into_execute_java_script(
6350 self,
6351 ) -> Option<(Vec<String>, fidl_fuchsia_mem::Buffer, FrameExecuteJavaScriptResponder)> {
6352 if let FrameRequest::ExecuteJavaScript { origins, script, responder } = self {
6353 Some((origins, script, responder))
6354 } else {
6355 None
6356 }
6357 }
6358
6359 #[allow(irrefutable_let_patterns)]
6360 pub fn into_execute_java_script_no_result(
6361 self,
6362 ) -> Option<(Vec<String>, fidl_fuchsia_mem::Buffer, FrameExecuteJavaScriptNoResultResponder)>
6363 {
6364 if let FrameRequest::ExecuteJavaScriptNoResult { origins, script, responder } = self {
6365 Some((origins, script, responder))
6366 } else {
6367 None
6368 }
6369 }
6370
6371 #[allow(irrefutable_let_patterns)]
6372 pub fn into_add_before_load_java_script(
6373 self,
6374 ) -> Option<(u64, Vec<String>, fidl_fuchsia_mem::Buffer, FrameAddBeforeLoadJavaScriptResponder)>
6375 {
6376 if let FrameRequest::AddBeforeLoadJavaScript { id, origins, script, responder } = self {
6377 Some((id, origins, script, responder))
6378 } else {
6379 None
6380 }
6381 }
6382
6383 #[allow(irrefutable_let_patterns)]
6384 pub fn into_remove_before_load_java_script(self) -> Option<(u64, FrameControlHandle)> {
6385 if let FrameRequest::RemoveBeforeLoadJavaScript { id, control_handle } = self {
6386 Some((id, control_handle))
6387 } else {
6388 None
6389 }
6390 }
6391
6392 #[allow(irrefutable_let_patterns)]
6393 pub fn into_post_message(self) -> Option<(String, WebMessage, FramePostMessageResponder)> {
6394 if let FrameRequest::PostMessage { target_origin, message, responder } = self {
6395 Some((target_origin, message, responder))
6396 } else {
6397 None
6398 }
6399 }
6400
6401 #[allow(irrefutable_let_patterns)]
6402 pub fn into_set_navigation_event_listener(
6403 self,
6404 ) -> Option<(
6405 Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
6406 FrameControlHandle,
6407 )> {
6408 if let FrameRequest::SetNavigationEventListener { listener, control_handle } = self {
6409 Some((listener, control_handle))
6410 } else {
6411 None
6412 }
6413 }
6414
6415 #[allow(irrefutable_let_patterns)]
6416 pub fn into_set_navigation_event_listener2(
6417 self,
6418 ) -> Option<(
6419 Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
6420 NavigationEventListenerFlags,
6421 FrameControlHandle,
6422 )> {
6423 if let FrameRequest::SetNavigationEventListener2 { listener, flags, control_handle } = self
6424 {
6425 Some((listener, flags, control_handle))
6426 } else {
6427 None
6428 }
6429 }
6430
6431 #[allow(irrefutable_let_patterns)]
6432 pub fn into_set_java_script_log_level(self) -> Option<(ConsoleLogLevel, FrameControlHandle)> {
6433 if let FrameRequest::SetJavaScriptLogLevel { level, control_handle } = self {
6434 Some((level, control_handle))
6435 } else {
6436 None
6437 }
6438 }
6439
6440 #[allow(irrefutable_let_patterns)]
6441 pub fn into_set_console_log_sink(
6442 self,
6443 ) -> Option<(
6444 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
6445 FrameControlHandle,
6446 )> {
6447 if let FrameRequest::SetConsoleLogSink { sink, control_handle } = self {
6448 Some((sink, control_handle))
6449 } else {
6450 None
6451 }
6452 }
6453
6454 #[allow(irrefutable_let_patterns)]
6455 pub fn into_configure_input_types(
6456 self,
6457 ) -> Option<(InputTypes, AllowInputState, FrameControlHandle)> {
6458 if let FrameRequest::ConfigureInputTypes { types, allow, control_handle } = self {
6459 Some((types, allow, control_handle))
6460 } else {
6461 None
6462 }
6463 }
6464
6465 #[allow(irrefutable_let_patterns)]
6466 pub fn into_set_popup_frame_creation_listener(
6467 self,
6468 ) -> Option<(
6469 Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
6470 FrameControlHandle,
6471 )> {
6472 if let FrameRequest::SetPopupFrameCreationListener { listener, control_handle } = self {
6473 Some((listener, control_handle))
6474 } else {
6475 None
6476 }
6477 }
6478
6479 #[allow(irrefutable_let_patterns)]
6480 pub fn into_set_url_request_rewrite_rules(
6481 self,
6482 ) -> Option<(Vec<UrlRequestRewriteRule>, FrameSetUrlRequestRewriteRulesResponder)> {
6483 if let FrameRequest::SetUrlRequestRewriteRules { rules, responder } = self {
6484 Some((rules, responder))
6485 } else {
6486 None
6487 }
6488 }
6489
6490 #[allow(irrefutable_let_patterns)]
6491 pub fn into_set_media_settings(self) -> Option<(FrameMediaSettings, FrameControlHandle)> {
6492 if let FrameRequest::SetMediaSettings { settings, control_handle } = self {
6493 Some((settings, control_handle))
6494 } else {
6495 None
6496 }
6497 }
6498
6499 #[allow(irrefutable_let_patterns)]
6500 pub fn into_force_content_dimensions(
6501 self,
6502 ) -> Option<(Option<Box<fidl_fuchsia_ui_gfx::Vec2>>, FrameControlHandle)> {
6503 if let FrameRequest::ForceContentDimensions { web_dips, control_handle } = self {
6504 Some((web_dips, control_handle))
6505 } else {
6506 None
6507 }
6508 }
6509
6510 #[allow(irrefutable_let_patterns)]
6511 pub fn into_set_permission_state(
6512 self,
6513 ) -> Option<(PermissionDescriptor, String, PermissionState, FrameControlHandle)> {
6514 if let FrameRequest::SetPermissionState { permission, web_origin, state, control_handle } =
6515 self
6516 {
6517 Some((permission, web_origin, state, control_handle))
6518 } else {
6519 None
6520 }
6521 }
6522
6523 #[allow(irrefutable_let_patterns)]
6524 pub fn into_set_block_media_loading(self) -> Option<(bool, FrameControlHandle)> {
6525 if let FrameRequest::SetBlockMediaLoading { blocked, control_handle } = self {
6526 Some((blocked, control_handle))
6527 } else {
6528 None
6529 }
6530 }
6531
6532 #[allow(irrefutable_let_patterns)]
6533 pub fn into_get_private_memory_size(self) -> Option<(FrameGetPrivateMemorySizeResponder)> {
6534 if let FrameRequest::GetPrivateMemorySize { responder } = self {
6535 Some((responder))
6536 } else {
6537 None
6538 }
6539 }
6540
6541 #[allow(irrefutable_let_patterns)]
6542 pub fn into_set_navigation_policy_provider(
6543 self,
6544 ) -> Option<(
6545 NavigationPolicyProviderParams,
6546 fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
6547 FrameControlHandle,
6548 )> {
6549 if let FrameRequest::SetNavigationPolicyProvider { params, provider, control_handle } = self
6550 {
6551 Some((params, provider, control_handle))
6552 } else {
6553 None
6554 }
6555 }
6556
6557 #[allow(irrefutable_let_patterns)]
6558 pub fn into_set_content_area_settings(
6559 self,
6560 ) -> Option<(ContentAreaSettings, FrameControlHandle)> {
6561 if let FrameRequest::SetContentAreaSettings { settings, control_handle } = self {
6562 Some((settings, control_handle))
6563 } else {
6564 None
6565 }
6566 }
6567
6568 #[allow(irrefutable_let_patterns)]
6569 pub fn into_reset_content_area_settings(self) -> Option<(FrameControlHandle)> {
6570 if let FrameRequest::ResetContentAreaSettings { control_handle } = self {
6571 Some((control_handle))
6572 } else {
6573 None
6574 }
6575 }
6576
6577 #[allow(irrefutable_let_patterns)]
6578 pub fn into_close(self) -> Option<(FrameCloseRequest, FrameControlHandle)> {
6579 if let FrameRequest::Close { payload, control_handle } = self {
6580 Some((payload, control_handle))
6581 } else {
6582 None
6583 }
6584 }
6585
6586 pub fn method_name(&self) -> &'static str {
6588 match *self {
6589 FrameRequest::CreateView { .. } => "create_view",
6590 FrameRequest::CreateViewWithViewRef { .. } => "create_view_with_view_ref",
6591 FrameRequest::CreateView2 { .. } => "create_view2",
6592 FrameRequest::EnableHeadlessRendering { .. } => "enable_headless_rendering",
6593 FrameRequest::DisableHeadlessRendering { .. } => "disable_headless_rendering",
6594 FrameRequest::GetMediaPlayer { .. } => "get_media_player",
6595 FrameRequest::GetNavigationController { .. } => "get_navigation_controller",
6596 FrameRequest::ExecuteJavaScript { .. } => "execute_java_script",
6597 FrameRequest::ExecuteJavaScriptNoResult { .. } => "execute_java_script_no_result",
6598 FrameRequest::AddBeforeLoadJavaScript { .. } => "add_before_load_java_script",
6599 FrameRequest::RemoveBeforeLoadJavaScript { .. } => "remove_before_load_java_script",
6600 FrameRequest::PostMessage { .. } => "post_message",
6601 FrameRequest::SetNavigationEventListener { .. } => "set_navigation_event_listener",
6602 FrameRequest::SetNavigationEventListener2 { .. } => "set_navigation_event_listener2",
6603 FrameRequest::SetJavaScriptLogLevel { .. } => "set_java_script_log_level",
6604 FrameRequest::SetConsoleLogSink { .. } => "set_console_log_sink",
6605 FrameRequest::ConfigureInputTypes { .. } => "configure_input_types",
6606 FrameRequest::SetPopupFrameCreationListener { .. } => {
6607 "set_popup_frame_creation_listener"
6608 }
6609 FrameRequest::SetUrlRequestRewriteRules { .. } => "set_url_request_rewrite_rules",
6610 FrameRequest::SetMediaSettings { .. } => "set_media_settings",
6611 FrameRequest::ForceContentDimensions { .. } => "force_content_dimensions",
6612 FrameRequest::SetPermissionState { .. } => "set_permission_state",
6613 FrameRequest::SetBlockMediaLoading { .. } => "set_block_media_loading",
6614 FrameRequest::GetPrivateMemorySize { .. } => "get_private_memory_size",
6615 FrameRequest::SetNavigationPolicyProvider { .. } => "set_navigation_policy_provider",
6616 FrameRequest::SetContentAreaSettings { .. } => "set_content_area_settings",
6617 FrameRequest::ResetContentAreaSettings { .. } => "reset_content_area_settings",
6618 FrameRequest::Close { .. } => "close",
6619 }
6620 }
6621}
6622
6623#[derive(Debug, Clone)]
6624pub struct FrameControlHandle {
6625 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6626}
6627
6628impl fidl::endpoints::ControlHandle for FrameControlHandle {
6629 fn shutdown(&self) {
6630 self.inner.shutdown()
6631 }
6632 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6633 self.inner.shutdown_with_epitaph(status)
6634 }
6635
6636 fn is_closed(&self) -> bool {
6637 self.inner.channel().is_closed()
6638 }
6639 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6640 self.inner.channel().on_closed()
6641 }
6642
6643 #[cfg(target_os = "fuchsia")]
6644 fn signal_peer(
6645 &self,
6646 clear_mask: zx::Signals,
6647 set_mask: zx::Signals,
6648 ) -> Result<(), zx_status::Status> {
6649 use fidl::Peered;
6650 self.inner.channel().signal_peer(clear_mask, set_mask)
6651 }
6652}
6653
6654impl FrameControlHandle {}
6655
6656#[must_use = "FIDL methods require a response to be sent"]
6657#[derive(Debug)]
6658pub struct FrameExecuteJavaScriptResponder {
6659 control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6660 tx_id: u32,
6661}
6662
6663impl std::ops::Drop for FrameExecuteJavaScriptResponder {
6667 fn drop(&mut self) {
6668 self.control_handle.shutdown();
6669 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6671 }
6672}
6673
6674impl fidl::endpoints::Responder for FrameExecuteJavaScriptResponder {
6675 type ControlHandle = FrameControlHandle;
6676
6677 fn control_handle(&self) -> &FrameControlHandle {
6678 &self.control_handle
6679 }
6680
6681 fn drop_without_shutdown(mut self) {
6682 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6684 std::mem::forget(self);
6686 }
6687}
6688
6689impl FrameExecuteJavaScriptResponder {
6690 pub fn send(
6694 self,
6695 mut result: Result<fidl_fuchsia_mem::Buffer, FrameError>,
6696 ) -> Result<(), fidl::Error> {
6697 let _result = self.send_raw(result);
6698 if _result.is_err() {
6699 self.control_handle.shutdown();
6700 }
6701 self.drop_without_shutdown();
6702 _result
6703 }
6704
6705 pub fn send_no_shutdown_on_err(
6707 self,
6708 mut result: Result<fidl_fuchsia_mem::Buffer, FrameError>,
6709 ) -> Result<(), fidl::Error> {
6710 let _result = self.send_raw(result);
6711 self.drop_without_shutdown();
6712 _result
6713 }
6714
6715 fn send_raw(
6716 &self,
6717 mut result: Result<fidl_fuchsia_mem::Buffer, FrameError>,
6718 ) -> Result<(), fidl::Error> {
6719 self.control_handle.inner.send::<fidl::encoding::ResultType<
6720 FrameExecuteJavaScriptResponse,
6721 FrameError,
6722 >>(
6723 result.as_mut().map_err(|e| *e).map(|result| (result,)),
6724 self.tx_id,
6725 0x79abdd4907000542,
6726 fidl::encoding::DynamicFlags::empty(),
6727 )
6728 }
6729}
6730
6731#[must_use = "FIDL methods require a response to be sent"]
6732#[derive(Debug)]
6733pub struct FrameExecuteJavaScriptNoResultResponder {
6734 control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6735 tx_id: u32,
6736}
6737
6738impl std::ops::Drop for FrameExecuteJavaScriptNoResultResponder {
6742 fn drop(&mut self) {
6743 self.control_handle.shutdown();
6744 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6746 }
6747}
6748
6749impl fidl::endpoints::Responder for FrameExecuteJavaScriptNoResultResponder {
6750 type ControlHandle = FrameControlHandle;
6751
6752 fn control_handle(&self) -> &FrameControlHandle {
6753 &self.control_handle
6754 }
6755
6756 fn drop_without_shutdown(mut self) {
6757 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6759 std::mem::forget(self);
6761 }
6762}
6763
6764impl FrameExecuteJavaScriptNoResultResponder {
6765 pub fn send(self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6769 let _result = self.send_raw(result);
6770 if _result.is_err() {
6771 self.control_handle.shutdown();
6772 }
6773 self.drop_without_shutdown();
6774 _result
6775 }
6776
6777 pub fn send_no_shutdown_on_err(
6779 self,
6780 mut result: Result<(), FrameError>,
6781 ) -> Result<(), fidl::Error> {
6782 let _result = self.send_raw(result);
6783 self.drop_without_shutdown();
6784 _result
6785 }
6786
6787 fn send_raw(&self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6788 self.control_handle
6789 .inner
6790 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>>(
6791 result,
6792 self.tx_id,
6793 0x16b8491520cbcd63,
6794 fidl::encoding::DynamicFlags::empty(),
6795 )
6796 }
6797}
6798
6799#[must_use = "FIDL methods require a response to be sent"]
6800#[derive(Debug)]
6801pub struct FrameAddBeforeLoadJavaScriptResponder {
6802 control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6803 tx_id: u32,
6804}
6805
6806impl std::ops::Drop for FrameAddBeforeLoadJavaScriptResponder {
6810 fn drop(&mut self) {
6811 self.control_handle.shutdown();
6812 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6814 }
6815}
6816
6817impl fidl::endpoints::Responder for FrameAddBeforeLoadJavaScriptResponder {
6818 type ControlHandle = FrameControlHandle;
6819
6820 fn control_handle(&self) -> &FrameControlHandle {
6821 &self.control_handle
6822 }
6823
6824 fn drop_without_shutdown(mut self) {
6825 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6827 std::mem::forget(self);
6829 }
6830}
6831
6832impl FrameAddBeforeLoadJavaScriptResponder {
6833 pub fn send(self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6837 let _result = self.send_raw(result);
6838 if _result.is_err() {
6839 self.control_handle.shutdown();
6840 }
6841 self.drop_without_shutdown();
6842 _result
6843 }
6844
6845 pub fn send_no_shutdown_on_err(
6847 self,
6848 mut result: Result<(), FrameError>,
6849 ) -> Result<(), fidl::Error> {
6850 let _result = self.send_raw(result);
6851 self.drop_without_shutdown();
6852 _result
6853 }
6854
6855 fn send_raw(&self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6856 self.control_handle
6857 .inner
6858 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>>(
6859 result,
6860 self.tx_id,
6861 0x540ac0da59d823e,
6862 fidl::encoding::DynamicFlags::empty(),
6863 )
6864 }
6865}
6866
6867#[must_use = "FIDL methods require a response to be sent"]
6868#[derive(Debug)]
6869pub struct FramePostMessageResponder {
6870 control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6871 tx_id: u32,
6872}
6873
6874impl std::ops::Drop for FramePostMessageResponder {
6878 fn drop(&mut self) {
6879 self.control_handle.shutdown();
6880 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6882 }
6883}
6884
6885impl fidl::endpoints::Responder for FramePostMessageResponder {
6886 type ControlHandle = FrameControlHandle;
6887
6888 fn control_handle(&self) -> &FrameControlHandle {
6889 &self.control_handle
6890 }
6891
6892 fn drop_without_shutdown(mut self) {
6893 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6895 std::mem::forget(self);
6897 }
6898}
6899
6900impl FramePostMessageResponder {
6901 pub fn send(self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6905 let _result = self.send_raw(result);
6906 if _result.is_err() {
6907 self.control_handle.shutdown();
6908 }
6909 self.drop_without_shutdown();
6910 _result
6911 }
6912
6913 pub fn send_no_shutdown_on_err(
6915 self,
6916 mut result: Result<(), FrameError>,
6917 ) -> Result<(), fidl::Error> {
6918 let _result = self.send_raw(result);
6919 self.drop_without_shutdown();
6920 _result
6921 }
6922
6923 fn send_raw(&self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6924 self.control_handle
6925 .inner
6926 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>>(
6927 result,
6928 self.tx_id,
6929 0x751d686eb7caa341,
6930 fidl::encoding::DynamicFlags::empty(),
6931 )
6932 }
6933}
6934
6935#[must_use = "FIDL methods require a response to be sent"]
6936#[derive(Debug)]
6937pub struct FrameSetUrlRequestRewriteRulesResponder {
6938 control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6939 tx_id: u32,
6940}
6941
6942impl std::ops::Drop for FrameSetUrlRequestRewriteRulesResponder {
6946 fn drop(&mut self) {
6947 self.control_handle.shutdown();
6948 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6950 }
6951}
6952
6953impl fidl::endpoints::Responder for FrameSetUrlRequestRewriteRulesResponder {
6954 type ControlHandle = FrameControlHandle;
6955
6956 fn control_handle(&self) -> &FrameControlHandle {
6957 &self.control_handle
6958 }
6959
6960 fn drop_without_shutdown(mut self) {
6961 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6963 std::mem::forget(self);
6965 }
6966}
6967
6968impl FrameSetUrlRequestRewriteRulesResponder {
6969 pub fn send(self) -> Result<(), fidl::Error> {
6973 let _result = self.send_raw();
6974 if _result.is_err() {
6975 self.control_handle.shutdown();
6976 }
6977 self.drop_without_shutdown();
6978 _result
6979 }
6980
6981 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
6983 let _result = self.send_raw();
6984 self.drop_without_shutdown();
6985 _result
6986 }
6987
6988 fn send_raw(&self) -> Result<(), fidl::Error> {
6989 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
6990 (),
6991 self.tx_id,
6992 0x2e3f797350ab3281,
6993 fidl::encoding::DynamicFlags::empty(),
6994 )
6995 }
6996}
6997
6998#[must_use = "FIDL methods require a response to be sent"]
6999#[derive(Debug)]
7000pub struct FrameGetPrivateMemorySizeResponder {
7001 control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
7002 tx_id: u32,
7003}
7004
7005impl std::ops::Drop for FrameGetPrivateMemorySizeResponder {
7009 fn drop(&mut self) {
7010 self.control_handle.shutdown();
7011 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7013 }
7014}
7015
7016impl fidl::endpoints::Responder for FrameGetPrivateMemorySizeResponder {
7017 type ControlHandle = FrameControlHandle;
7018
7019 fn control_handle(&self) -> &FrameControlHandle {
7020 &self.control_handle
7021 }
7022
7023 fn drop_without_shutdown(mut self) {
7024 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7026 std::mem::forget(self);
7028 }
7029}
7030
7031impl FrameGetPrivateMemorySizeResponder {
7032 pub fn send(self, mut size_bytes: u64) -> Result<(), fidl::Error> {
7036 let _result = self.send_raw(size_bytes);
7037 if _result.is_err() {
7038 self.control_handle.shutdown();
7039 }
7040 self.drop_without_shutdown();
7041 _result
7042 }
7043
7044 pub fn send_no_shutdown_on_err(self, mut size_bytes: u64) -> Result<(), fidl::Error> {
7046 let _result = self.send_raw(size_bytes);
7047 self.drop_without_shutdown();
7048 _result
7049 }
7050
7051 fn send_raw(&self, mut size_bytes: u64) -> Result<(), fidl::Error> {
7052 self.control_handle.inner.send::<FrameGetPrivateMemorySizeResponse>(
7053 (size_bytes,),
7054 self.tx_id,
7055 0x6ad4d43da6c129b0,
7056 fidl::encoding::DynamicFlags::empty(),
7057 )
7058 }
7059}
7060
7061#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7062pub struct FrameHostMarker;
7063
7064impl fidl::endpoints::ProtocolMarker for FrameHostMarker {
7065 type Proxy = FrameHostProxy;
7066 type RequestStream = FrameHostRequestStream;
7067 #[cfg(target_os = "fuchsia")]
7068 type SynchronousProxy = FrameHostSynchronousProxy;
7069
7070 const DEBUG_NAME: &'static str = "fuchsia.web.FrameHost";
7071}
7072impl fidl::endpoints::DiscoverableProtocolMarker for FrameHostMarker {}
7073
7074pub trait FrameHostProxyInterface: Send + Sync {
7075 fn r#create_frame_with_params(
7076 &self,
7077 params: CreateFrameParams,
7078 frame: fidl::endpoints::ServerEnd<FrameMarker>,
7079 ) -> Result<(), fidl::Error>;
7080}
7081#[derive(Debug)]
7082#[cfg(target_os = "fuchsia")]
7083pub struct FrameHostSynchronousProxy {
7084 client: fidl::client::sync::Client,
7085}
7086
7087#[cfg(target_os = "fuchsia")]
7088impl fidl::endpoints::SynchronousProxy for FrameHostSynchronousProxy {
7089 type Proxy = FrameHostProxy;
7090 type Protocol = FrameHostMarker;
7091
7092 fn from_channel(inner: fidl::Channel) -> Self {
7093 Self::new(inner)
7094 }
7095
7096 fn into_channel(self) -> fidl::Channel {
7097 self.client.into_channel()
7098 }
7099
7100 fn as_channel(&self) -> &fidl::Channel {
7101 self.client.as_channel()
7102 }
7103}
7104
7105#[cfg(target_os = "fuchsia")]
7106impl FrameHostSynchronousProxy {
7107 pub fn new(channel: fidl::Channel) -> Self {
7108 let protocol_name = <FrameHostMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7109 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7110 }
7111
7112 pub fn into_channel(self) -> fidl::Channel {
7113 self.client.into_channel()
7114 }
7115
7116 pub fn wait_for_event(
7119 &self,
7120 deadline: zx::MonotonicInstant,
7121 ) -> Result<FrameHostEvent, fidl::Error> {
7122 FrameHostEvent::decode(self.client.wait_for_event(deadline)?)
7123 }
7124
7125 pub fn r#create_frame_with_params(
7127 &self,
7128 mut params: CreateFrameParams,
7129 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
7130 ) -> Result<(), fidl::Error> {
7131 self.client.send::<FrameHostCreateFrameWithParamsRequest>(
7132 (&mut params, frame),
7133 0x670186c3a1b3f28,
7134 fidl::encoding::DynamicFlags::empty(),
7135 )
7136 }
7137}
7138
7139#[cfg(target_os = "fuchsia")]
7140impl From<FrameHostSynchronousProxy> for zx::Handle {
7141 fn from(value: FrameHostSynchronousProxy) -> Self {
7142 value.into_channel().into()
7143 }
7144}
7145
7146#[cfg(target_os = "fuchsia")]
7147impl From<fidl::Channel> for FrameHostSynchronousProxy {
7148 fn from(value: fidl::Channel) -> Self {
7149 Self::new(value)
7150 }
7151}
7152
7153#[derive(Debug, Clone)]
7154pub struct FrameHostProxy {
7155 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7156}
7157
7158impl fidl::endpoints::Proxy for FrameHostProxy {
7159 type Protocol = FrameHostMarker;
7160
7161 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7162 Self::new(inner)
7163 }
7164
7165 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7166 self.client.into_channel().map_err(|client| Self { client })
7167 }
7168
7169 fn as_channel(&self) -> &::fidl::AsyncChannel {
7170 self.client.as_channel()
7171 }
7172}
7173
7174impl FrameHostProxy {
7175 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7177 let protocol_name = <FrameHostMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7178 Self { client: fidl::client::Client::new(channel, protocol_name) }
7179 }
7180
7181 pub fn take_event_stream(&self) -> FrameHostEventStream {
7187 FrameHostEventStream { event_receiver: self.client.take_event_receiver() }
7188 }
7189
7190 pub fn r#create_frame_with_params(
7192 &self,
7193 mut params: CreateFrameParams,
7194 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
7195 ) -> Result<(), fidl::Error> {
7196 FrameHostProxyInterface::r#create_frame_with_params(self, params, frame)
7197 }
7198}
7199
7200impl FrameHostProxyInterface for FrameHostProxy {
7201 fn r#create_frame_with_params(
7202 &self,
7203 mut params: CreateFrameParams,
7204 mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
7205 ) -> Result<(), fidl::Error> {
7206 self.client.send::<FrameHostCreateFrameWithParamsRequest>(
7207 (&mut params, frame),
7208 0x670186c3a1b3f28,
7209 fidl::encoding::DynamicFlags::empty(),
7210 )
7211 }
7212}
7213
7214pub struct FrameHostEventStream {
7215 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7216}
7217
7218impl std::marker::Unpin for FrameHostEventStream {}
7219
7220impl futures::stream::FusedStream for FrameHostEventStream {
7221 fn is_terminated(&self) -> bool {
7222 self.event_receiver.is_terminated()
7223 }
7224}
7225
7226impl futures::Stream for FrameHostEventStream {
7227 type Item = Result<FrameHostEvent, fidl::Error>;
7228
7229 fn poll_next(
7230 mut self: std::pin::Pin<&mut Self>,
7231 cx: &mut std::task::Context<'_>,
7232 ) -> std::task::Poll<Option<Self::Item>> {
7233 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7234 &mut self.event_receiver,
7235 cx
7236 )?) {
7237 Some(buf) => std::task::Poll::Ready(Some(FrameHostEvent::decode(buf))),
7238 None => std::task::Poll::Ready(None),
7239 }
7240 }
7241}
7242
7243#[derive(Debug)]
7244pub enum FrameHostEvent {}
7245
7246impl FrameHostEvent {
7247 fn decode(
7249 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7250 ) -> Result<FrameHostEvent, fidl::Error> {
7251 let (bytes, _handles) = buf.split_mut();
7252 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7253 debug_assert_eq!(tx_header.tx_id, 0);
7254 match tx_header.ordinal {
7255 _ => Err(fidl::Error::UnknownOrdinal {
7256 ordinal: tx_header.ordinal,
7257 protocol_name: <FrameHostMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7258 }),
7259 }
7260 }
7261}
7262
7263pub struct FrameHostRequestStream {
7265 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7266 is_terminated: bool,
7267}
7268
7269impl std::marker::Unpin for FrameHostRequestStream {}
7270
7271impl futures::stream::FusedStream for FrameHostRequestStream {
7272 fn is_terminated(&self) -> bool {
7273 self.is_terminated
7274 }
7275}
7276
7277impl fidl::endpoints::RequestStream for FrameHostRequestStream {
7278 type Protocol = FrameHostMarker;
7279 type ControlHandle = FrameHostControlHandle;
7280
7281 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7282 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7283 }
7284
7285 fn control_handle(&self) -> Self::ControlHandle {
7286 FrameHostControlHandle { inner: self.inner.clone() }
7287 }
7288
7289 fn into_inner(
7290 self,
7291 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7292 {
7293 (self.inner, self.is_terminated)
7294 }
7295
7296 fn from_inner(
7297 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7298 is_terminated: bool,
7299 ) -> Self {
7300 Self { inner, is_terminated }
7301 }
7302}
7303
7304impl futures::Stream for FrameHostRequestStream {
7305 type Item = Result<FrameHostRequest, fidl::Error>;
7306
7307 fn poll_next(
7308 mut self: std::pin::Pin<&mut Self>,
7309 cx: &mut std::task::Context<'_>,
7310 ) -> std::task::Poll<Option<Self::Item>> {
7311 let this = &mut *self;
7312 if this.inner.check_shutdown(cx) {
7313 this.is_terminated = true;
7314 return std::task::Poll::Ready(None);
7315 }
7316 if this.is_terminated {
7317 panic!("polled FrameHostRequestStream after completion");
7318 }
7319 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7320 |bytes, handles| {
7321 match this.inner.channel().read_etc(cx, bytes, handles) {
7322 std::task::Poll::Ready(Ok(())) => {}
7323 std::task::Poll::Pending => return std::task::Poll::Pending,
7324 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7325 this.is_terminated = true;
7326 return std::task::Poll::Ready(None);
7327 }
7328 std::task::Poll::Ready(Err(e)) => {
7329 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7330 e.into(),
7331 ))))
7332 }
7333 }
7334
7335 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7337
7338 std::task::Poll::Ready(Some(match header.ordinal {
7339 0x670186c3a1b3f28 => {
7340 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7341 let mut req = fidl::new_empty!(
7342 FrameHostCreateFrameWithParamsRequest,
7343 fidl::encoding::DefaultFuchsiaResourceDialect
7344 );
7345 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameHostCreateFrameWithParamsRequest>(&header, _body_bytes, handles, &mut req)?;
7346 let control_handle = FrameHostControlHandle { inner: this.inner.clone() };
7347 Ok(FrameHostRequest::CreateFrameWithParams {
7348 params: req.params,
7349 frame: req.frame,
7350
7351 control_handle,
7352 })
7353 }
7354 _ => Err(fidl::Error::UnknownOrdinal {
7355 ordinal: header.ordinal,
7356 protocol_name:
7357 <FrameHostMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7358 }),
7359 }))
7360 },
7361 )
7362 }
7363}
7364
7365#[derive(Debug)]
7367pub enum FrameHostRequest {
7368 CreateFrameWithParams {
7370 params: CreateFrameParams,
7371 frame: fidl::endpoints::ServerEnd<FrameMarker>,
7372 control_handle: FrameHostControlHandle,
7373 },
7374}
7375
7376impl FrameHostRequest {
7377 #[allow(irrefutable_let_patterns)]
7378 pub fn into_create_frame_with_params(
7379 self,
7380 ) -> Option<(CreateFrameParams, fidl::endpoints::ServerEnd<FrameMarker>, FrameHostControlHandle)>
7381 {
7382 if let FrameHostRequest::CreateFrameWithParams { params, frame, control_handle } = self {
7383 Some((params, frame, control_handle))
7384 } else {
7385 None
7386 }
7387 }
7388
7389 pub fn method_name(&self) -> &'static str {
7391 match *self {
7392 FrameHostRequest::CreateFrameWithParams { .. } => "create_frame_with_params",
7393 }
7394 }
7395}
7396
7397#[derive(Debug, Clone)]
7398pub struct FrameHostControlHandle {
7399 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7400}
7401
7402impl fidl::endpoints::ControlHandle for FrameHostControlHandle {
7403 fn shutdown(&self) {
7404 self.inner.shutdown()
7405 }
7406 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7407 self.inner.shutdown_with_epitaph(status)
7408 }
7409
7410 fn is_closed(&self) -> bool {
7411 self.inner.channel().is_closed()
7412 }
7413 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7414 self.inner.channel().on_closed()
7415 }
7416
7417 #[cfg(target_os = "fuchsia")]
7418 fn signal_peer(
7419 &self,
7420 clear_mask: zx::Signals,
7421 set_mask: zx::Signals,
7422 ) -> Result<(), zx_status::Status> {
7423 use fidl::Peered;
7424 self.inner.channel().signal_peer(clear_mask, set_mask)
7425 }
7426}
7427
7428impl FrameHostControlHandle {}
7429
7430#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7431pub struct MessagePortMarker;
7432
7433impl fidl::endpoints::ProtocolMarker for MessagePortMarker {
7434 type Proxy = MessagePortProxy;
7435 type RequestStream = MessagePortRequestStream;
7436 #[cfg(target_os = "fuchsia")]
7437 type SynchronousProxy = MessagePortSynchronousProxy;
7438
7439 const DEBUG_NAME: &'static str = "(anonymous) MessagePort";
7440}
7441pub type MessagePortPostMessageResult = Result<(), FrameError>;
7442
7443pub trait MessagePortProxyInterface: Send + Sync {
7444 type PostMessageResponseFut: std::future::Future<Output = Result<MessagePortPostMessageResult, fidl::Error>>
7445 + Send;
7446 fn r#post_message(&self, message: WebMessage) -> Self::PostMessageResponseFut;
7447 type ReceiveMessageResponseFut: std::future::Future<Output = Result<WebMessage, fidl::Error>>
7448 + Send;
7449 fn r#receive_message(&self) -> Self::ReceiveMessageResponseFut;
7450}
7451#[derive(Debug)]
7452#[cfg(target_os = "fuchsia")]
7453pub struct MessagePortSynchronousProxy {
7454 client: fidl::client::sync::Client,
7455}
7456
7457#[cfg(target_os = "fuchsia")]
7458impl fidl::endpoints::SynchronousProxy for MessagePortSynchronousProxy {
7459 type Proxy = MessagePortProxy;
7460 type Protocol = MessagePortMarker;
7461
7462 fn from_channel(inner: fidl::Channel) -> Self {
7463 Self::new(inner)
7464 }
7465
7466 fn into_channel(self) -> fidl::Channel {
7467 self.client.into_channel()
7468 }
7469
7470 fn as_channel(&self) -> &fidl::Channel {
7471 self.client.as_channel()
7472 }
7473}
7474
7475#[cfg(target_os = "fuchsia")]
7476impl MessagePortSynchronousProxy {
7477 pub fn new(channel: fidl::Channel) -> Self {
7478 let protocol_name = <MessagePortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7479 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7480 }
7481
7482 pub fn into_channel(self) -> fidl::Channel {
7483 self.client.into_channel()
7484 }
7485
7486 pub fn wait_for_event(
7489 &self,
7490 deadline: zx::MonotonicInstant,
7491 ) -> Result<MessagePortEvent, fidl::Error> {
7492 MessagePortEvent::decode(self.client.wait_for_event(deadline)?)
7493 }
7494
7495 pub fn r#post_message(
7503 &self,
7504 mut message: WebMessage,
7505 ___deadline: zx::MonotonicInstant,
7506 ) -> Result<MessagePortPostMessageResult, fidl::Error> {
7507 let _response = self.client.send_query::<
7508 MessagePortPostMessageRequest,
7509 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
7510 >(
7511 (&mut message,),
7512 0x2bcf0a6ed30ffd1f,
7513 fidl::encoding::DynamicFlags::empty(),
7514 ___deadline,
7515 )?;
7516 Ok(_response.map(|x| x))
7517 }
7518
7519 pub fn r#receive_message(
7523 &self,
7524 ___deadline: zx::MonotonicInstant,
7525 ) -> Result<WebMessage, fidl::Error> {
7526 let _response = self
7527 .client
7528 .send_query::<fidl::encoding::EmptyPayload, MessagePortReceiveMessageResponse>(
7529 (),
7530 0x6c8a6051690be58d,
7531 fidl::encoding::DynamicFlags::empty(),
7532 ___deadline,
7533 )?;
7534 Ok(_response.message)
7535 }
7536}
7537
7538#[cfg(target_os = "fuchsia")]
7539impl From<MessagePortSynchronousProxy> for zx::Handle {
7540 fn from(value: MessagePortSynchronousProxy) -> Self {
7541 value.into_channel().into()
7542 }
7543}
7544
7545#[cfg(target_os = "fuchsia")]
7546impl From<fidl::Channel> for MessagePortSynchronousProxy {
7547 fn from(value: fidl::Channel) -> Self {
7548 Self::new(value)
7549 }
7550}
7551
7552#[derive(Debug, Clone)]
7553pub struct MessagePortProxy {
7554 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7555}
7556
7557impl fidl::endpoints::Proxy for MessagePortProxy {
7558 type Protocol = MessagePortMarker;
7559
7560 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7561 Self::new(inner)
7562 }
7563
7564 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7565 self.client.into_channel().map_err(|client| Self { client })
7566 }
7567
7568 fn as_channel(&self) -> &::fidl::AsyncChannel {
7569 self.client.as_channel()
7570 }
7571}
7572
7573impl MessagePortProxy {
7574 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7576 let protocol_name = <MessagePortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7577 Self { client: fidl::client::Client::new(channel, protocol_name) }
7578 }
7579
7580 pub fn take_event_stream(&self) -> MessagePortEventStream {
7586 MessagePortEventStream { event_receiver: self.client.take_event_receiver() }
7587 }
7588
7589 pub fn r#post_message(
7597 &self,
7598 mut message: WebMessage,
7599 ) -> fidl::client::QueryResponseFut<
7600 MessagePortPostMessageResult,
7601 fidl::encoding::DefaultFuchsiaResourceDialect,
7602 > {
7603 MessagePortProxyInterface::r#post_message(self, message)
7604 }
7605
7606 pub fn r#receive_message(
7610 &self,
7611 ) -> fidl::client::QueryResponseFut<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>
7612 {
7613 MessagePortProxyInterface::r#receive_message(self)
7614 }
7615}
7616
7617impl MessagePortProxyInterface for MessagePortProxy {
7618 type PostMessageResponseFut = fidl::client::QueryResponseFut<
7619 MessagePortPostMessageResult,
7620 fidl::encoding::DefaultFuchsiaResourceDialect,
7621 >;
7622 fn r#post_message(&self, mut message: WebMessage) -> Self::PostMessageResponseFut {
7623 fn _decode(
7624 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7625 ) -> Result<MessagePortPostMessageResult, fidl::Error> {
7626 let _response = fidl::client::decode_transaction_body::<
7627 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
7628 fidl::encoding::DefaultFuchsiaResourceDialect,
7629 0x2bcf0a6ed30ffd1f,
7630 >(_buf?)?;
7631 Ok(_response.map(|x| x))
7632 }
7633 self.client
7634 .send_query_and_decode::<MessagePortPostMessageRequest, MessagePortPostMessageResult>(
7635 (&mut message,),
7636 0x2bcf0a6ed30ffd1f,
7637 fidl::encoding::DynamicFlags::empty(),
7638 _decode,
7639 )
7640 }
7641
7642 type ReceiveMessageResponseFut =
7643 fidl::client::QueryResponseFut<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>;
7644 fn r#receive_message(&self) -> Self::ReceiveMessageResponseFut {
7645 fn _decode(
7646 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7647 ) -> Result<WebMessage, fidl::Error> {
7648 let _response = fidl::client::decode_transaction_body::<
7649 MessagePortReceiveMessageResponse,
7650 fidl::encoding::DefaultFuchsiaResourceDialect,
7651 0x6c8a6051690be58d,
7652 >(_buf?)?;
7653 Ok(_response.message)
7654 }
7655 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WebMessage>(
7656 (),
7657 0x6c8a6051690be58d,
7658 fidl::encoding::DynamicFlags::empty(),
7659 _decode,
7660 )
7661 }
7662}
7663
7664pub struct MessagePortEventStream {
7665 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7666}
7667
7668impl std::marker::Unpin for MessagePortEventStream {}
7669
7670impl futures::stream::FusedStream for MessagePortEventStream {
7671 fn is_terminated(&self) -> bool {
7672 self.event_receiver.is_terminated()
7673 }
7674}
7675
7676impl futures::Stream for MessagePortEventStream {
7677 type Item = Result<MessagePortEvent, fidl::Error>;
7678
7679 fn poll_next(
7680 mut self: std::pin::Pin<&mut Self>,
7681 cx: &mut std::task::Context<'_>,
7682 ) -> std::task::Poll<Option<Self::Item>> {
7683 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7684 &mut self.event_receiver,
7685 cx
7686 )?) {
7687 Some(buf) => std::task::Poll::Ready(Some(MessagePortEvent::decode(buf))),
7688 None => std::task::Poll::Ready(None),
7689 }
7690 }
7691}
7692
7693#[derive(Debug)]
7694pub enum MessagePortEvent {}
7695
7696impl MessagePortEvent {
7697 fn decode(
7699 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7700 ) -> Result<MessagePortEvent, fidl::Error> {
7701 let (bytes, _handles) = buf.split_mut();
7702 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7703 debug_assert_eq!(tx_header.tx_id, 0);
7704 match tx_header.ordinal {
7705 _ => Err(fidl::Error::UnknownOrdinal {
7706 ordinal: tx_header.ordinal,
7707 protocol_name: <MessagePortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7708 }),
7709 }
7710 }
7711}
7712
7713pub struct MessagePortRequestStream {
7715 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7716 is_terminated: bool,
7717}
7718
7719impl std::marker::Unpin for MessagePortRequestStream {}
7720
7721impl futures::stream::FusedStream for MessagePortRequestStream {
7722 fn is_terminated(&self) -> bool {
7723 self.is_terminated
7724 }
7725}
7726
7727impl fidl::endpoints::RequestStream for MessagePortRequestStream {
7728 type Protocol = MessagePortMarker;
7729 type ControlHandle = MessagePortControlHandle;
7730
7731 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7732 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7733 }
7734
7735 fn control_handle(&self) -> Self::ControlHandle {
7736 MessagePortControlHandle { inner: self.inner.clone() }
7737 }
7738
7739 fn into_inner(
7740 self,
7741 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7742 {
7743 (self.inner, self.is_terminated)
7744 }
7745
7746 fn from_inner(
7747 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7748 is_terminated: bool,
7749 ) -> Self {
7750 Self { inner, is_terminated }
7751 }
7752}
7753
7754impl futures::Stream for MessagePortRequestStream {
7755 type Item = Result<MessagePortRequest, fidl::Error>;
7756
7757 fn poll_next(
7758 mut self: std::pin::Pin<&mut Self>,
7759 cx: &mut std::task::Context<'_>,
7760 ) -> std::task::Poll<Option<Self::Item>> {
7761 let this = &mut *self;
7762 if this.inner.check_shutdown(cx) {
7763 this.is_terminated = true;
7764 return std::task::Poll::Ready(None);
7765 }
7766 if this.is_terminated {
7767 panic!("polled MessagePortRequestStream after completion");
7768 }
7769 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7770 |bytes, handles| {
7771 match this.inner.channel().read_etc(cx, bytes, handles) {
7772 std::task::Poll::Ready(Ok(())) => {}
7773 std::task::Poll::Pending => return std::task::Poll::Pending,
7774 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7775 this.is_terminated = true;
7776 return std::task::Poll::Ready(None);
7777 }
7778 std::task::Poll::Ready(Err(e)) => {
7779 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7780 e.into(),
7781 ))))
7782 }
7783 }
7784
7785 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7787
7788 std::task::Poll::Ready(Some(match header.ordinal {
7789 0x2bcf0a6ed30ffd1f => {
7790 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7791 let mut req = fidl::new_empty!(
7792 MessagePortPostMessageRequest,
7793 fidl::encoding::DefaultFuchsiaResourceDialect
7794 );
7795 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MessagePortPostMessageRequest>(&header, _body_bytes, handles, &mut req)?;
7796 let control_handle = MessagePortControlHandle { inner: this.inner.clone() };
7797 Ok(MessagePortRequest::PostMessage {
7798 message: req.message,
7799
7800 responder: MessagePortPostMessageResponder {
7801 control_handle: std::mem::ManuallyDrop::new(control_handle),
7802 tx_id: header.tx_id,
7803 },
7804 })
7805 }
7806 0x6c8a6051690be58d => {
7807 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7808 let mut req = fidl::new_empty!(
7809 fidl::encoding::EmptyPayload,
7810 fidl::encoding::DefaultFuchsiaResourceDialect
7811 );
7812 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7813 let control_handle = MessagePortControlHandle { inner: this.inner.clone() };
7814 Ok(MessagePortRequest::ReceiveMessage {
7815 responder: MessagePortReceiveMessageResponder {
7816 control_handle: std::mem::ManuallyDrop::new(control_handle),
7817 tx_id: header.tx_id,
7818 },
7819 })
7820 }
7821 _ => Err(fidl::Error::UnknownOrdinal {
7822 ordinal: header.ordinal,
7823 protocol_name:
7824 <MessagePortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7825 }),
7826 }))
7827 },
7828 )
7829 }
7830}
7831
7832#[derive(Debug)]
7836pub enum MessagePortRequest {
7837 PostMessage { message: WebMessage, responder: MessagePortPostMessageResponder },
7845 ReceiveMessage { responder: MessagePortReceiveMessageResponder },
7849}
7850
7851impl MessagePortRequest {
7852 #[allow(irrefutable_let_patterns)]
7853 pub fn into_post_message(self) -> Option<(WebMessage, MessagePortPostMessageResponder)> {
7854 if let MessagePortRequest::PostMessage { message, responder } = self {
7855 Some((message, responder))
7856 } else {
7857 None
7858 }
7859 }
7860
7861 #[allow(irrefutable_let_patterns)]
7862 pub fn into_receive_message(self) -> Option<(MessagePortReceiveMessageResponder)> {
7863 if let MessagePortRequest::ReceiveMessage { responder } = self {
7864 Some((responder))
7865 } else {
7866 None
7867 }
7868 }
7869
7870 pub fn method_name(&self) -> &'static str {
7872 match *self {
7873 MessagePortRequest::PostMessage { .. } => "post_message",
7874 MessagePortRequest::ReceiveMessage { .. } => "receive_message",
7875 }
7876 }
7877}
7878
7879#[derive(Debug, Clone)]
7880pub struct MessagePortControlHandle {
7881 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7882}
7883
7884impl fidl::endpoints::ControlHandle for MessagePortControlHandle {
7885 fn shutdown(&self) {
7886 self.inner.shutdown()
7887 }
7888 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7889 self.inner.shutdown_with_epitaph(status)
7890 }
7891
7892 fn is_closed(&self) -> bool {
7893 self.inner.channel().is_closed()
7894 }
7895 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7896 self.inner.channel().on_closed()
7897 }
7898
7899 #[cfg(target_os = "fuchsia")]
7900 fn signal_peer(
7901 &self,
7902 clear_mask: zx::Signals,
7903 set_mask: zx::Signals,
7904 ) -> Result<(), zx_status::Status> {
7905 use fidl::Peered;
7906 self.inner.channel().signal_peer(clear_mask, set_mask)
7907 }
7908}
7909
7910impl MessagePortControlHandle {}
7911
7912#[must_use = "FIDL methods require a response to be sent"]
7913#[derive(Debug)]
7914pub struct MessagePortPostMessageResponder {
7915 control_handle: std::mem::ManuallyDrop<MessagePortControlHandle>,
7916 tx_id: u32,
7917}
7918
7919impl std::ops::Drop for MessagePortPostMessageResponder {
7923 fn drop(&mut self) {
7924 self.control_handle.shutdown();
7925 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7927 }
7928}
7929
7930impl fidl::endpoints::Responder for MessagePortPostMessageResponder {
7931 type ControlHandle = MessagePortControlHandle;
7932
7933 fn control_handle(&self) -> &MessagePortControlHandle {
7934 &self.control_handle
7935 }
7936
7937 fn drop_without_shutdown(mut self) {
7938 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7940 std::mem::forget(self);
7942 }
7943}
7944
7945impl MessagePortPostMessageResponder {
7946 pub fn send(self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
7950 let _result = self.send_raw(result);
7951 if _result.is_err() {
7952 self.control_handle.shutdown();
7953 }
7954 self.drop_without_shutdown();
7955 _result
7956 }
7957
7958 pub fn send_no_shutdown_on_err(
7960 self,
7961 mut result: Result<(), FrameError>,
7962 ) -> Result<(), fidl::Error> {
7963 let _result = self.send_raw(result);
7964 self.drop_without_shutdown();
7965 _result
7966 }
7967
7968 fn send_raw(&self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
7969 self.control_handle
7970 .inner
7971 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>>(
7972 result,
7973 self.tx_id,
7974 0x2bcf0a6ed30ffd1f,
7975 fidl::encoding::DynamicFlags::empty(),
7976 )
7977 }
7978}
7979
7980#[must_use = "FIDL methods require a response to be sent"]
7981#[derive(Debug)]
7982pub struct MessagePortReceiveMessageResponder {
7983 control_handle: std::mem::ManuallyDrop<MessagePortControlHandle>,
7984 tx_id: u32,
7985}
7986
7987impl std::ops::Drop for MessagePortReceiveMessageResponder {
7991 fn drop(&mut self) {
7992 self.control_handle.shutdown();
7993 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7995 }
7996}
7997
7998impl fidl::endpoints::Responder for MessagePortReceiveMessageResponder {
7999 type ControlHandle = MessagePortControlHandle;
8000
8001 fn control_handle(&self) -> &MessagePortControlHandle {
8002 &self.control_handle
8003 }
8004
8005 fn drop_without_shutdown(mut self) {
8006 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8008 std::mem::forget(self);
8010 }
8011}
8012
8013impl MessagePortReceiveMessageResponder {
8014 pub fn send(self, mut message: WebMessage) -> Result<(), fidl::Error> {
8018 let _result = self.send_raw(message);
8019 if _result.is_err() {
8020 self.control_handle.shutdown();
8021 }
8022 self.drop_without_shutdown();
8023 _result
8024 }
8025
8026 pub fn send_no_shutdown_on_err(self, mut message: WebMessage) -> Result<(), fidl::Error> {
8028 let _result = self.send_raw(message);
8029 self.drop_without_shutdown();
8030 _result
8031 }
8032
8033 fn send_raw(&self, mut message: WebMessage) -> Result<(), fidl::Error> {
8034 self.control_handle.inner.send::<MessagePortReceiveMessageResponse>(
8035 (&mut message,),
8036 self.tx_id,
8037 0x6c8a6051690be58d,
8038 fidl::encoding::DynamicFlags::empty(),
8039 )
8040 }
8041}
8042
8043#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8044pub struct NavigationControllerMarker;
8045
8046impl fidl::endpoints::ProtocolMarker for NavigationControllerMarker {
8047 type Proxy = NavigationControllerProxy;
8048 type RequestStream = NavigationControllerRequestStream;
8049 #[cfg(target_os = "fuchsia")]
8050 type SynchronousProxy = NavigationControllerSynchronousProxy;
8051
8052 const DEBUG_NAME: &'static str = "(anonymous) NavigationController";
8053}
8054pub type NavigationControllerLoadUrlResult = Result<(), NavigationControllerError>;
8055
8056pub trait NavigationControllerProxyInterface: Send + Sync {
8057 type LoadUrlResponseFut: std::future::Future<Output = Result<NavigationControllerLoadUrlResult, fidl::Error>>
8058 + Send;
8059 fn r#load_url(&self, url: &str, params: LoadUrlParams) -> Self::LoadUrlResponseFut;
8060 fn r#go_back(&self) -> Result<(), fidl::Error>;
8061 fn r#go_forward(&self) -> Result<(), fidl::Error>;
8062 fn r#stop(&self) -> Result<(), fidl::Error>;
8063 fn r#reload(&self, type_: ReloadType) -> Result<(), fidl::Error>;
8064}
8065#[derive(Debug)]
8066#[cfg(target_os = "fuchsia")]
8067pub struct NavigationControllerSynchronousProxy {
8068 client: fidl::client::sync::Client,
8069}
8070
8071#[cfg(target_os = "fuchsia")]
8072impl fidl::endpoints::SynchronousProxy for NavigationControllerSynchronousProxy {
8073 type Proxy = NavigationControllerProxy;
8074 type Protocol = NavigationControllerMarker;
8075
8076 fn from_channel(inner: fidl::Channel) -> Self {
8077 Self::new(inner)
8078 }
8079
8080 fn into_channel(self) -> fidl::Channel {
8081 self.client.into_channel()
8082 }
8083
8084 fn as_channel(&self) -> &fidl::Channel {
8085 self.client.as_channel()
8086 }
8087}
8088
8089#[cfg(target_os = "fuchsia")]
8090impl NavigationControllerSynchronousProxy {
8091 pub fn new(channel: fidl::Channel) -> Self {
8092 let protocol_name =
8093 <NavigationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8094 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8095 }
8096
8097 pub fn into_channel(self) -> fidl::Channel {
8098 self.client.into_channel()
8099 }
8100
8101 pub fn wait_for_event(
8104 &self,
8105 deadline: zx::MonotonicInstant,
8106 ) -> Result<NavigationControllerEvent, fidl::Error> {
8107 NavigationControllerEvent::decode(self.client.wait_for_event(deadline)?)
8108 }
8109
8110 pub fn r#load_url(
8120 &self,
8121 mut url: &str,
8122 mut params: LoadUrlParams,
8123 ___deadline: zx::MonotonicInstant,
8124 ) -> Result<NavigationControllerLoadUrlResult, fidl::Error> {
8125 let _response =
8126 self.client
8127 .send_query::<NavigationControllerLoadUrlRequest, fidl::encoding::ResultType<
8128 fidl::encoding::EmptyStruct,
8129 NavigationControllerError,
8130 >>(
8131 (url, &mut params),
8132 0x78f2ab0a480d0182,
8133 fidl::encoding::DynamicFlags::empty(),
8134 ___deadline,
8135 )?;
8136 Ok(_response.map(|x| x))
8137 }
8138
8139 pub fn r#go_back(&self) -> Result<(), fidl::Error> {
8141 self.client.send::<fidl::encoding::EmptyPayload>(
8142 (),
8143 0x2accdd8d87d89c38,
8144 fidl::encoding::DynamicFlags::empty(),
8145 )
8146 }
8147
8148 pub fn r#go_forward(&self) -> Result<(), fidl::Error> {
8150 self.client.send::<fidl::encoding::EmptyPayload>(
8151 (),
8152 0x39e4ac955ade2781,
8153 fidl::encoding::DynamicFlags::empty(),
8154 )
8155 }
8156
8157 pub fn r#stop(&self) -> Result<(), fidl::Error> {
8159 self.client.send::<fidl::encoding::EmptyPayload>(
8160 (),
8161 0x2383078ffbe6fea,
8162 fidl::encoding::DynamicFlags::empty(),
8163 )
8164 }
8165
8166 pub fn r#reload(&self, mut type_: ReloadType) -> Result<(), fidl::Error> {
8168 self.client.send::<NavigationControllerReloadRequest>(
8169 (type_,),
8170 0x33faedfe67d6f00,
8171 fidl::encoding::DynamicFlags::empty(),
8172 )
8173 }
8174}
8175
8176#[cfg(target_os = "fuchsia")]
8177impl From<NavigationControllerSynchronousProxy> for zx::Handle {
8178 fn from(value: NavigationControllerSynchronousProxy) -> Self {
8179 value.into_channel().into()
8180 }
8181}
8182
8183#[cfg(target_os = "fuchsia")]
8184impl From<fidl::Channel> for NavigationControllerSynchronousProxy {
8185 fn from(value: fidl::Channel) -> Self {
8186 Self::new(value)
8187 }
8188}
8189
8190#[derive(Debug, Clone)]
8191pub struct NavigationControllerProxy {
8192 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8193}
8194
8195impl fidl::endpoints::Proxy for NavigationControllerProxy {
8196 type Protocol = NavigationControllerMarker;
8197
8198 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8199 Self::new(inner)
8200 }
8201
8202 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8203 self.client.into_channel().map_err(|client| Self { client })
8204 }
8205
8206 fn as_channel(&self) -> &::fidl::AsyncChannel {
8207 self.client.as_channel()
8208 }
8209}
8210
8211impl NavigationControllerProxy {
8212 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8214 let protocol_name =
8215 <NavigationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8216 Self { client: fidl::client::Client::new(channel, protocol_name) }
8217 }
8218
8219 pub fn take_event_stream(&self) -> NavigationControllerEventStream {
8225 NavigationControllerEventStream { event_receiver: self.client.take_event_receiver() }
8226 }
8227
8228 pub fn r#load_url(
8238 &self,
8239 mut url: &str,
8240 mut params: LoadUrlParams,
8241 ) -> fidl::client::QueryResponseFut<
8242 NavigationControllerLoadUrlResult,
8243 fidl::encoding::DefaultFuchsiaResourceDialect,
8244 > {
8245 NavigationControllerProxyInterface::r#load_url(self, url, params)
8246 }
8247
8248 pub fn r#go_back(&self) -> Result<(), fidl::Error> {
8250 NavigationControllerProxyInterface::r#go_back(self)
8251 }
8252
8253 pub fn r#go_forward(&self) -> Result<(), fidl::Error> {
8255 NavigationControllerProxyInterface::r#go_forward(self)
8256 }
8257
8258 pub fn r#stop(&self) -> Result<(), fidl::Error> {
8260 NavigationControllerProxyInterface::r#stop(self)
8261 }
8262
8263 pub fn r#reload(&self, mut type_: ReloadType) -> Result<(), fidl::Error> {
8265 NavigationControllerProxyInterface::r#reload(self, type_)
8266 }
8267}
8268
8269impl NavigationControllerProxyInterface for NavigationControllerProxy {
8270 type LoadUrlResponseFut = fidl::client::QueryResponseFut<
8271 NavigationControllerLoadUrlResult,
8272 fidl::encoding::DefaultFuchsiaResourceDialect,
8273 >;
8274 fn r#load_url(&self, mut url: &str, mut params: LoadUrlParams) -> Self::LoadUrlResponseFut {
8275 fn _decode(
8276 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8277 ) -> Result<NavigationControllerLoadUrlResult, fidl::Error> {
8278 let _response = fidl::client::decode_transaction_body::<
8279 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, NavigationControllerError>,
8280 fidl::encoding::DefaultFuchsiaResourceDialect,
8281 0x78f2ab0a480d0182,
8282 >(_buf?)?;
8283 Ok(_response.map(|x| x))
8284 }
8285 self.client.send_query_and_decode::<
8286 NavigationControllerLoadUrlRequest,
8287 NavigationControllerLoadUrlResult,
8288 >(
8289 (url, &mut params,),
8290 0x78f2ab0a480d0182,
8291 fidl::encoding::DynamicFlags::empty(),
8292 _decode,
8293 )
8294 }
8295
8296 fn r#go_back(&self) -> Result<(), fidl::Error> {
8297 self.client.send::<fidl::encoding::EmptyPayload>(
8298 (),
8299 0x2accdd8d87d89c38,
8300 fidl::encoding::DynamicFlags::empty(),
8301 )
8302 }
8303
8304 fn r#go_forward(&self) -> Result<(), fidl::Error> {
8305 self.client.send::<fidl::encoding::EmptyPayload>(
8306 (),
8307 0x39e4ac955ade2781,
8308 fidl::encoding::DynamicFlags::empty(),
8309 )
8310 }
8311
8312 fn r#stop(&self) -> Result<(), fidl::Error> {
8313 self.client.send::<fidl::encoding::EmptyPayload>(
8314 (),
8315 0x2383078ffbe6fea,
8316 fidl::encoding::DynamicFlags::empty(),
8317 )
8318 }
8319
8320 fn r#reload(&self, mut type_: ReloadType) -> Result<(), fidl::Error> {
8321 self.client.send::<NavigationControllerReloadRequest>(
8322 (type_,),
8323 0x33faedfe67d6f00,
8324 fidl::encoding::DynamicFlags::empty(),
8325 )
8326 }
8327}
8328
8329pub struct NavigationControllerEventStream {
8330 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8331}
8332
8333impl std::marker::Unpin for NavigationControllerEventStream {}
8334
8335impl futures::stream::FusedStream for NavigationControllerEventStream {
8336 fn is_terminated(&self) -> bool {
8337 self.event_receiver.is_terminated()
8338 }
8339}
8340
8341impl futures::Stream for NavigationControllerEventStream {
8342 type Item = Result<NavigationControllerEvent, fidl::Error>;
8343
8344 fn poll_next(
8345 mut self: std::pin::Pin<&mut Self>,
8346 cx: &mut std::task::Context<'_>,
8347 ) -> std::task::Poll<Option<Self::Item>> {
8348 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8349 &mut self.event_receiver,
8350 cx
8351 )?) {
8352 Some(buf) => std::task::Poll::Ready(Some(NavigationControllerEvent::decode(buf))),
8353 None => std::task::Poll::Ready(None),
8354 }
8355 }
8356}
8357
8358#[derive(Debug)]
8359pub enum NavigationControllerEvent {}
8360
8361impl NavigationControllerEvent {
8362 fn decode(
8364 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8365 ) -> Result<NavigationControllerEvent, fidl::Error> {
8366 let (bytes, _handles) = buf.split_mut();
8367 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8368 debug_assert_eq!(tx_header.tx_id, 0);
8369 match tx_header.ordinal {
8370 _ => Err(fidl::Error::UnknownOrdinal {
8371 ordinal: tx_header.ordinal,
8372 protocol_name:
8373 <NavigationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8374 }),
8375 }
8376 }
8377}
8378
8379pub struct NavigationControllerRequestStream {
8381 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8382 is_terminated: bool,
8383}
8384
8385impl std::marker::Unpin for NavigationControllerRequestStream {}
8386
8387impl futures::stream::FusedStream for NavigationControllerRequestStream {
8388 fn is_terminated(&self) -> bool {
8389 self.is_terminated
8390 }
8391}
8392
8393impl fidl::endpoints::RequestStream for NavigationControllerRequestStream {
8394 type Protocol = NavigationControllerMarker;
8395 type ControlHandle = NavigationControllerControlHandle;
8396
8397 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8398 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8399 }
8400
8401 fn control_handle(&self) -> Self::ControlHandle {
8402 NavigationControllerControlHandle { inner: self.inner.clone() }
8403 }
8404
8405 fn into_inner(
8406 self,
8407 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8408 {
8409 (self.inner, self.is_terminated)
8410 }
8411
8412 fn from_inner(
8413 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8414 is_terminated: bool,
8415 ) -> Self {
8416 Self { inner, is_terminated }
8417 }
8418}
8419
8420impl futures::Stream for NavigationControllerRequestStream {
8421 type Item = Result<NavigationControllerRequest, fidl::Error>;
8422
8423 fn poll_next(
8424 mut self: std::pin::Pin<&mut Self>,
8425 cx: &mut std::task::Context<'_>,
8426 ) -> std::task::Poll<Option<Self::Item>> {
8427 let this = &mut *self;
8428 if this.inner.check_shutdown(cx) {
8429 this.is_terminated = true;
8430 return std::task::Poll::Ready(None);
8431 }
8432 if this.is_terminated {
8433 panic!("polled NavigationControllerRequestStream after completion");
8434 }
8435 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8436 |bytes, handles| {
8437 match this.inner.channel().read_etc(cx, bytes, handles) {
8438 std::task::Poll::Ready(Ok(())) => {}
8439 std::task::Poll::Pending => return std::task::Poll::Pending,
8440 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8441 this.is_terminated = true;
8442 return std::task::Poll::Ready(None);
8443 }
8444 std::task::Poll::Ready(Err(e)) => {
8445 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8446 e.into(),
8447 ))))
8448 }
8449 }
8450
8451 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8453
8454 std::task::Poll::Ready(Some(match header.ordinal {
8455 0x78f2ab0a480d0182 => {
8456 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8457 let mut req = fidl::new_empty!(NavigationControllerLoadUrlRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8458 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NavigationControllerLoadUrlRequest>(&header, _body_bytes, handles, &mut req)?;
8459 let control_handle = NavigationControllerControlHandle {
8460 inner: this.inner.clone(),
8461 };
8462 Ok(NavigationControllerRequest::LoadUrl {url: req.url,
8463params: req.params,
8464
8465 responder: NavigationControllerLoadUrlResponder {
8466 control_handle: std::mem::ManuallyDrop::new(control_handle),
8467 tx_id: header.tx_id,
8468 },
8469 })
8470 }
8471 0x2accdd8d87d89c38 => {
8472 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8473 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
8474 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8475 let control_handle = NavigationControllerControlHandle {
8476 inner: this.inner.clone(),
8477 };
8478 Ok(NavigationControllerRequest::GoBack {
8479 control_handle,
8480 })
8481 }
8482 0x39e4ac955ade2781 => {
8483 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8484 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
8485 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8486 let control_handle = NavigationControllerControlHandle {
8487 inner: this.inner.clone(),
8488 };
8489 Ok(NavigationControllerRequest::GoForward {
8490 control_handle,
8491 })
8492 }
8493 0x2383078ffbe6fea => {
8494 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8495 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
8496 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8497 let control_handle = NavigationControllerControlHandle {
8498 inner: this.inner.clone(),
8499 };
8500 Ok(NavigationControllerRequest::Stop {
8501 control_handle,
8502 })
8503 }
8504 0x33faedfe67d6f00 => {
8505 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8506 let mut req = fidl::new_empty!(NavigationControllerReloadRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8507 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NavigationControllerReloadRequest>(&header, _body_bytes, handles, &mut req)?;
8508 let control_handle = NavigationControllerControlHandle {
8509 inner: this.inner.clone(),
8510 };
8511 Ok(NavigationControllerRequest::Reload {type_: req.type_,
8512
8513 control_handle,
8514 })
8515 }
8516 _ => Err(fidl::Error::UnknownOrdinal {
8517 ordinal: header.ordinal,
8518 protocol_name: <NavigationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8519 }),
8520 }))
8521 },
8522 )
8523 }
8524}
8525
8526#[derive(Debug)]
8528pub enum NavigationControllerRequest {
8529 LoadUrl { url: String, params: LoadUrlParams, responder: NavigationControllerLoadUrlResponder },
8539 GoBack { control_handle: NavigationControllerControlHandle },
8541 GoForward { control_handle: NavigationControllerControlHandle },
8543 Stop { control_handle: NavigationControllerControlHandle },
8545 Reload { type_: ReloadType, control_handle: NavigationControllerControlHandle },
8547}
8548
8549impl NavigationControllerRequest {
8550 #[allow(irrefutable_let_patterns)]
8551 pub fn into_load_url(
8552 self,
8553 ) -> Option<(String, LoadUrlParams, NavigationControllerLoadUrlResponder)> {
8554 if let NavigationControllerRequest::LoadUrl { url, params, responder } = self {
8555 Some((url, params, responder))
8556 } else {
8557 None
8558 }
8559 }
8560
8561 #[allow(irrefutable_let_patterns)]
8562 pub fn into_go_back(self) -> Option<(NavigationControllerControlHandle)> {
8563 if let NavigationControllerRequest::GoBack { control_handle } = self {
8564 Some((control_handle))
8565 } else {
8566 None
8567 }
8568 }
8569
8570 #[allow(irrefutable_let_patterns)]
8571 pub fn into_go_forward(self) -> Option<(NavigationControllerControlHandle)> {
8572 if let NavigationControllerRequest::GoForward { control_handle } = self {
8573 Some((control_handle))
8574 } else {
8575 None
8576 }
8577 }
8578
8579 #[allow(irrefutable_let_patterns)]
8580 pub fn into_stop(self) -> Option<(NavigationControllerControlHandle)> {
8581 if let NavigationControllerRequest::Stop { control_handle } = self {
8582 Some((control_handle))
8583 } else {
8584 None
8585 }
8586 }
8587
8588 #[allow(irrefutable_let_patterns)]
8589 pub fn into_reload(self) -> Option<(ReloadType, NavigationControllerControlHandle)> {
8590 if let NavigationControllerRequest::Reload { type_, control_handle } = self {
8591 Some((type_, control_handle))
8592 } else {
8593 None
8594 }
8595 }
8596
8597 pub fn method_name(&self) -> &'static str {
8599 match *self {
8600 NavigationControllerRequest::LoadUrl { .. } => "load_url",
8601 NavigationControllerRequest::GoBack { .. } => "go_back",
8602 NavigationControllerRequest::GoForward { .. } => "go_forward",
8603 NavigationControllerRequest::Stop { .. } => "stop",
8604 NavigationControllerRequest::Reload { .. } => "reload",
8605 }
8606 }
8607}
8608
8609#[derive(Debug, Clone)]
8610pub struct NavigationControllerControlHandle {
8611 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8612}
8613
8614impl fidl::endpoints::ControlHandle for NavigationControllerControlHandle {
8615 fn shutdown(&self) {
8616 self.inner.shutdown()
8617 }
8618 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8619 self.inner.shutdown_with_epitaph(status)
8620 }
8621
8622 fn is_closed(&self) -> bool {
8623 self.inner.channel().is_closed()
8624 }
8625 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8626 self.inner.channel().on_closed()
8627 }
8628
8629 #[cfg(target_os = "fuchsia")]
8630 fn signal_peer(
8631 &self,
8632 clear_mask: zx::Signals,
8633 set_mask: zx::Signals,
8634 ) -> Result<(), zx_status::Status> {
8635 use fidl::Peered;
8636 self.inner.channel().signal_peer(clear_mask, set_mask)
8637 }
8638}
8639
8640impl NavigationControllerControlHandle {}
8641
8642#[must_use = "FIDL methods require a response to be sent"]
8643#[derive(Debug)]
8644pub struct NavigationControllerLoadUrlResponder {
8645 control_handle: std::mem::ManuallyDrop<NavigationControllerControlHandle>,
8646 tx_id: u32,
8647}
8648
8649impl std::ops::Drop for NavigationControllerLoadUrlResponder {
8653 fn drop(&mut self) {
8654 self.control_handle.shutdown();
8655 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8657 }
8658}
8659
8660impl fidl::endpoints::Responder for NavigationControllerLoadUrlResponder {
8661 type ControlHandle = NavigationControllerControlHandle;
8662
8663 fn control_handle(&self) -> &NavigationControllerControlHandle {
8664 &self.control_handle
8665 }
8666
8667 fn drop_without_shutdown(mut self) {
8668 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8670 std::mem::forget(self);
8672 }
8673}
8674
8675impl NavigationControllerLoadUrlResponder {
8676 pub fn send(
8680 self,
8681 mut result: Result<(), NavigationControllerError>,
8682 ) -> Result<(), fidl::Error> {
8683 let _result = self.send_raw(result);
8684 if _result.is_err() {
8685 self.control_handle.shutdown();
8686 }
8687 self.drop_without_shutdown();
8688 _result
8689 }
8690
8691 pub fn send_no_shutdown_on_err(
8693 self,
8694 mut result: Result<(), NavigationControllerError>,
8695 ) -> Result<(), fidl::Error> {
8696 let _result = self.send_raw(result);
8697 self.drop_without_shutdown();
8698 _result
8699 }
8700
8701 fn send_raw(
8702 &self,
8703 mut result: Result<(), NavigationControllerError>,
8704 ) -> Result<(), fidl::Error> {
8705 self.control_handle.inner.send::<fidl::encoding::ResultType<
8706 fidl::encoding::EmptyStruct,
8707 NavigationControllerError,
8708 >>(
8709 result,
8710 self.tx_id,
8711 0x78f2ab0a480d0182,
8712 fidl::encoding::DynamicFlags::empty(),
8713 )
8714 }
8715}
8716
8717#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8718pub struct NavigationEventListenerMarker;
8719
8720impl fidl::endpoints::ProtocolMarker for NavigationEventListenerMarker {
8721 type Proxy = NavigationEventListenerProxy;
8722 type RequestStream = NavigationEventListenerRequestStream;
8723 #[cfg(target_os = "fuchsia")]
8724 type SynchronousProxy = NavigationEventListenerSynchronousProxy;
8725
8726 const DEBUG_NAME: &'static str = "(anonymous) NavigationEventListener";
8727}
8728
8729pub trait NavigationEventListenerProxyInterface: Send + Sync {
8730 type OnNavigationStateChangedResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
8731 + Send;
8732 fn r#on_navigation_state_changed(
8733 &self,
8734 change: NavigationState,
8735 ) -> Self::OnNavigationStateChangedResponseFut;
8736}
8737#[derive(Debug)]
8738#[cfg(target_os = "fuchsia")]
8739pub struct NavigationEventListenerSynchronousProxy {
8740 client: fidl::client::sync::Client,
8741}
8742
8743#[cfg(target_os = "fuchsia")]
8744impl fidl::endpoints::SynchronousProxy for NavigationEventListenerSynchronousProxy {
8745 type Proxy = NavigationEventListenerProxy;
8746 type Protocol = NavigationEventListenerMarker;
8747
8748 fn from_channel(inner: fidl::Channel) -> Self {
8749 Self::new(inner)
8750 }
8751
8752 fn into_channel(self) -> fidl::Channel {
8753 self.client.into_channel()
8754 }
8755
8756 fn as_channel(&self) -> &fidl::Channel {
8757 self.client.as_channel()
8758 }
8759}
8760
8761#[cfg(target_os = "fuchsia")]
8762impl NavigationEventListenerSynchronousProxy {
8763 pub fn new(channel: fidl::Channel) -> Self {
8764 let protocol_name =
8765 <NavigationEventListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8766 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8767 }
8768
8769 pub fn into_channel(self) -> fidl::Channel {
8770 self.client.into_channel()
8771 }
8772
8773 pub fn wait_for_event(
8776 &self,
8777 deadline: zx::MonotonicInstant,
8778 ) -> Result<NavigationEventListenerEvent, fidl::Error> {
8779 NavigationEventListenerEvent::decode(self.client.wait_for_event(deadline)?)
8780 }
8781
8782 pub fn r#on_navigation_state_changed(
8792 &self,
8793 mut change: NavigationState,
8794 ___deadline: zx::MonotonicInstant,
8795 ) -> Result<(), fidl::Error> {
8796 let _response = self.client.send_query::<
8797 NavigationEventListenerOnNavigationStateChangedRequest,
8798 fidl::encoding::EmptyPayload,
8799 >(
8800 (&mut change,),
8801 0x453ac6bcbc82fbb6,
8802 fidl::encoding::DynamicFlags::empty(),
8803 ___deadline,
8804 )?;
8805 Ok(_response)
8806 }
8807}
8808
8809#[cfg(target_os = "fuchsia")]
8810impl From<NavigationEventListenerSynchronousProxy> for zx::Handle {
8811 fn from(value: NavigationEventListenerSynchronousProxy) -> Self {
8812 value.into_channel().into()
8813 }
8814}
8815
8816#[cfg(target_os = "fuchsia")]
8817impl From<fidl::Channel> for NavigationEventListenerSynchronousProxy {
8818 fn from(value: fidl::Channel) -> Self {
8819 Self::new(value)
8820 }
8821}
8822
8823#[derive(Debug, Clone)]
8824pub struct NavigationEventListenerProxy {
8825 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8826}
8827
8828impl fidl::endpoints::Proxy for NavigationEventListenerProxy {
8829 type Protocol = NavigationEventListenerMarker;
8830
8831 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8832 Self::new(inner)
8833 }
8834
8835 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8836 self.client.into_channel().map_err(|client| Self { client })
8837 }
8838
8839 fn as_channel(&self) -> &::fidl::AsyncChannel {
8840 self.client.as_channel()
8841 }
8842}
8843
8844impl NavigationEventListenerProxy {
8845 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8847 let protocol_name =
8848 <NavigationEventListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8849 Self { client: fidl::client::Client::new(channel, protocol_name) }
8850 }
8851
8852 pub fn take_event_stream(&self) -> NavigationEventListenerEventStream {
8858 NavigationEventListenerEventStream { event_receiver: self.client.take_event_receiver() }
8859 }
8860
8861 pub fn r#on_navigation_state_changed(
8871 &self,
8872 mut change: NavigationState,
8873 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
8874 NavigationEventListenerProxyInterface::r#on_navigation_state_changed(self, change)
8875 }
8876}
8877
8878impl NavigationEventListenerProxyInterface for NavigationEventListenerProxy {
8879 type OnNavigationStateChangedResponseFut =
8880 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
8881 fn r#on_navigation_state_changed(
8882 &self,
8883 mut change: NavigationState,
8884 ) -> Self::OnNavigationStateChangedResponseFut {
8885 fn _decode(
8886 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8887 ) -> Result<(), fidl::Error> {
8888 let _response = fidl::client::decode_transaction_body::<
8889 fidl::encoding::EmptyPayload,
8890 fidl::encoding::DefaultFuchsiaResourceDialect,
8891 0x453ac6bcbc82fbb6,
8892 >(_buf?)?;
8893 Ok(_response)
8894 }
8895 self.client
8896 .send_query_and_decode::<NavigationEventListenerOnNavigationStateChangedRequest, ()>(
8897 (&mut change,),
8898 0x453ac6bcbc82fbb6,
8899 fidl::encoding::DynamicFlags::empty(),
8900 _decode,
8901 )
8902 }
8903}
8904
8905pub struct NavigationEventListenerEventStream {
8906 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8907}
8908
8909impl std::marker::Unpin for NavigationEventListenerEventStream {}
8910
8911impl futures::stream::FusedStream for NavigationEventListenerEventStream {
8912 fn is_terminated(&self) -> bool {
8913 self.event_receiver.is_terminated()
8914 }
8915}
8916
8917impl futures::Stream for NavigationEventListenerEventStream {
8918 type Item = Result<NavigationEventListenerEvent, fidl::Error>;
8919
8920 fn poll_next(
8921 mut self: std::pin::Pin<&mut Self>,
8922 cx: &mut std::task::Context<'_>,
8923 ) -> std::task::Poll<Option<Self::Item>> {
8924 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8925 &mut self.event_receiver,
8926 cx
8927 )?) {
8928 Some(buf) => std::task::Poll::Ready(Some(NavigationEventListenerEvent::decode(buf))),
8929 None => std::task::Poll::Ready(None),
8930 }
8931 }
8932}
8933
8934#[derive(Debug)]
8935pub enum NavigationEventListenerEvent {}
8936
8937impl NavigationEventListenerEvent {
8938 fn decode(
8940 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8941 ) -> Result<NavigationEventListenerEvent, fidl::Error> {
8942 let (bytes, _handles) = buf.split_mut();
8943 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8944 debug_assert_eq!(tx_header.tx_id, 0);
8945 match tx_header.ordinal {
8946 _ => Err(fidl::Error::UnknownOrdinal {
8947 ordinal: tx_header.ordinal,
8948 protocol_name:
8949 <NavigationEventListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8950 }),
8951 }
8952 }
8953}
8954
8955pub struct NavigationEventListenerRequestStream {
8957 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8958 is_terminated: bool,
8959}
8960
8961impl std::marker::Unpin for NavigationEventListenerRequestStream {}
8962
8963impl futures::stream::FusedStream for NavigationEventListenerRequestStream {
8964 fn is_terminated(&self) -> bool {
8965 self.is_terminated
8966 }
8967}
8968
8969impl fidl::endpoints::RequestStream for NavigationEventListenerRequestStream {
8970 type Protocol = NavigationEventListenerMarker;
8971 type ControlHandle = NavigationEventListenerControlHandle;
8972
8973 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8974 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8975 }
8976
8977 fn control_handle(&self) -> Self::ControlHandle {
8978 NavigationEventListenerControlHandle { inner: self.inner.clone() }
8979 }
8980
8981 fn into_inner(
8982 self,
8983 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8984 {
8985 (self.inner, self.is_terminated)
8986 }
8987
8988 fn from_inner(
8989 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8990 is_terminated: bool,
8991 ) -> Self {
8992 Self { inner, is_terminated }
8993 }
8994}
8995
8996impl futures::Stream for NavigationEventListenerRequestStream {
8997 type Item = Result<NavigationEventListenerRequest, fidl::Error>;
8998
8999 fn poll_next(
9000 mut self: std::pin::Pin<&mut Self>,
9001 cx: &mut std::task::Context<'_>,
9002 ) -> std::task::Poll<Option<Self::Item>> {
9003 let this = &mut *self;
9004 if this.inner.check_shutdown(cx) {
9005 this.is_terminated = true;
9006 return std::task::Poll::Ready(None);
9007 }
9008 if this.is_terminated {
9009 panic!("polled NavigationEventListenerRequestStream after completion");
9010 }
9011 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9012 |bytes, handles| {
9013 match this.inner.channel().read_etc(cx, bytes, handles) {
9014 std::task::Poll::Ready(Ok(())) => {}
9015 std::task::Poll::Pending => return std::task::Poll::Pending,
9016 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9017 this.is_terminated = true;
9018 return std::task::Poll::Ready(None);
9019 }
9020 std::task::Poll::Ready(Err(e)) => {
9021 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9022 e.into(),
9023 ))))
9024 }
9025 }
9026
9027 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9029
9030 std::task::Poll::Ready(Some(match header.ordinal {
9031 0x453ac6bcbc82fbb6 => {
9032 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9033 let mut req = fidl::new_empty!(NavigationEventListenerOnNavigationStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9034 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NavigationEventListenerOnNavigationStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
9035 let control_handle = NavigationEventListenerControlHandle {
9036 inner: this.inner.clone(),
9037 };
9038 Ok(NavigationEventListenerRequest::OnNavigationStateChanged {change: req.change,
9039
9040 responder: NavigationEventListenerOnNavigationStateChangedResponder {
9041 control_handle: std::mem::ManuallyDrop::new(control_handle),
9042 tx_id: header.tx_id,
9043 },
9044 })
9045 }
9046 _ => Err(fidl::Error::UnknownOrdinal {
9047 ordinal: header.ordinal,
9048 protocol_name: <NavigationEventListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9049 }),
9050 }))
9051 },
9052 )
9053 }
9054}
9055
9056#[derive(Debug)]
9059pub enum NavigationEventListenerRequest {
9060 OnNavigationStateChanged {
9070 change: NavigationState,
9071 responder: NavigationEventListenerOnNavigationStateChangedResponder,
9072 },
9073}
9074
9075impl NavigationEventListenerRequest {
9076 #[allow(irrefutable_let_patterns)]
9077 pub fn into_on_navigation_state_changed(
9078 self,
9079 ) -> Option<(NavigationState, NavigationEventListenerOnNavigationStateChangedResponder)> {
9080 if let NavigationEventListenerRequest::OnNavigationStateChanged { change, responder } = self
9081 {
9082 Some((change, responder))
9083 } else {
9084 None
9085 }
9086 }
9087
9088 pub fn method_name(&self) -> &'static str {
9090 match *self {
9091 NavigationEventListenerRequest::OnNavigationStateChanged { .. } => {
9092 "on_navigation_state_changed"
9093 }
9094 }
9095 }
9096}
9097
9098#[derive(Debug, Clone)]
9099pub struct NavigationEventListenerControlHandle {
9100 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9101}
9102
9103impl fidl::endpoints::ControlHandle for NavigationEventListenerControlHandle {
9104 fn shutdown(&self) {
9105 self.inner.shutdown()
9106 }
9107 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9108 self.inner.shutdown_with_epitaph(status)
9109 }
9110
9111 fn is_closed(&self) -> bool {
9112 self.inner.channel().is_closed()
9113 }
9114 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9115 self.inner.channel().on_closed()
9116 }
9117
9118 #[cfg(target_os = "fuchsia")]
9119 fn signal_peer(
9120 &self,
9121 clear_mask: zx::Signals,
9122 set_mask: zx::Signals,
9123 ) -> Result<(), zx_status::Status> {
9124 use fidl::Peered;
9125 self.inner.channel().signal_peer(clear_mask, set_mask)
9126 }
9127}
9128
9129impl NavigationEventListenerControlHandle {}
9130
9131#[must_use = "FIDL methods require a response to be sent"]
9132#[derive(Debug)]
9133pub struct NavigationEventListenerOnNavigationStateChangedResponder {
9134 control_handle: std::mem::ManuallyDrop<NavigationEventListenerControlHandle>,
9135 tx_id: u32,
9136}
9137
9138impl std::ops::Drop for NavigationEventListenerOnNavigationStateChangedResponder {
9142 fn drop(&mut self) {
9143 self.control_handle.shutdown();
9144 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9146 }
9147}
9148
9149impl fidl::endpoints::Responder for NavigationEventListenerOnNavigationStateChangedResponder {
9150 type ControlHandle = NavigationEventListenerControlHandle;
9151
9152 fn control_handle(&self) -> &NavigationEventListenerControlHandle {
9153 &self.control_handle
9154 }
9155
9156 fn drop_without_shutdown(mut self) {
9157 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9159 std::mem::forget(self);
9161 }
9162}
9163
9164impl NavigationEventListenerOnNavigationStateChangedResponder {
9165 pub fn send(self) -> Result<(), fidl::Error> {
9169 let _result = self.send_raw();
9170 if _result.is_err() {
9171 self.control_handle.shutdown();
9172 }
9173 self.drop_without_shutdown();
9174 _result
9175 }
9176
9177 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9179 let _result = self.send_raw();
9180 self.drop_without_shutdown();
9181 _result
9182 }
9183
9184 fn send_raw(&self) -> Result<(), fidl::Error> {
9185 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9186 (),
9187 self.tx_id,
9188 0x453ac6bcbc82fbb6,
9189 fidl::encoding::DynamicFlags::empty(),
9190 )
9191 }
9192}
9193
9194#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9195pub struct NavigationPolicyProviderMarker;
9196
9197impl fidl::endpoints::ProtocolMarker for NavigationPolicyProviderMarker {
9198 type Proxy = NavigationPolicyProviderProxy;
9199 type RequestStream = NavigationPolicyProviderRequestStream;
9200 #[cfg(target_os = "fuchsia")]
9201 type SynchronousProxy = NavigationPolicyProviderSynchronousProxy;
9202
9203 const DEBUG_NAME: &'static str = "(anonymous) NavigationPolicyProvider";
9204}
9205
9206pub trait NavigationPolicyProviderProxyInterface: Send + Sync {
9207 type EvaluateRequestedNavigationResponseFut: std::future::Future<Output = Result<NavigationDecision, fidl::Error>>
9208 + Send;
9209 fn r#evaluate_requested_navigation(
9210 &self,
9211 requested_navigation: &RequestedNavigation,
9212 ) -> Self::EvaluateRequestedNavigationResponseFut;
9213}
9214#[derive(Debug)]
9215#[cfg(target_os = "fuchsia")]
9216pub struct NavigationPolicyProviderSynchronousProxy {
9217 client: fidl::client::sync::Client,
9218}
9219
9220#[cfg(target_os = "fuchsia")]
9221impl fidl::endpoints::SynchronousProxy for NavigationPolicyProviderSynchronousProxy {
9222 type Proxy = NavigationPolicyProviderProxy;
9223 type Protocol = NavigationPolicyProviderMarker;
9224
9225 fn from_channel(inner: fidl::Channel) -> Self {
9226 Self::new(inner)
9227 }
9228
9229 fn into_channel(self) -> fidl::Channel {
9230 self.client.into_channel()
9231 }
9232
9233 fn as_channel(&self) -> &fidl::Channel {
9234 self.client.as_channel()
9235 }
9236}
9237
9238#[cfg(target_os = "fuchsia")]
9239impl NavigationPolicyProviderSynchronousProxy {
9240 pub fn new(channel: fidl::Channel) -> Self {
9241 let protocol_name =
9242 <NavigationPolicyProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9243 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9244 }
9245
9246 pub fn into_channel(self) -> fidl::Channel {
9247 self.client.into_channel()
9248 }
9249
9250 pub fn wait_for_event(
9253 &self,
9254 deadline: zx::MonotonicInstant,
9255 ) -> Result<NavigationPolicyProviderEvent, fidl::Error> {
9256 NavigationPolicyProviderEvent::decode(self.client.wait_for_event(deadline)?)
9257 }
9258
9259 pub fn r#evaluate_requested_navigation(
9263 &self,
9264 mut requested_navigation: &RequestedNavigation,
9265 ___deadline: zx::MonotonicInstant,
9266 ) -> Result<NavigationDecision, fidl::Error> {
9267 let _response = self.client.send_query::<
9268 NavigationPolicyProviderEvaluateRequestedNavigationRequest,
9269 NavigationPolicyProviderEvaluateRequestedNavigationResponse,
9270 >(
9271 (requested_navigation,),
9272 0x54446b50cf3512b6,
9273 fidl::encoding::DynamicFlags::empty(),
9274 ___deadline,
9275 )?;
9276 Ok(_response.decision)
9277 }
9278}
9279
9280#[cfg(target_os = "fuchsia")]
9281impl From<NavigationPolicyProviderSynchronousProxy> for zx::Handle {
9282 fn from(value: NavigationPolicyProviderSynchronousProxy) -> Self {
9283 value.into_channel().into()
9284 }
9285}
9286
9287#[cfg(target_os = "fuchsia")]
9288impl From<fidl::Channel> for NavigationPolicyProviderSynchronousProxy {
9289 fn from(value: fidl::Channel) -> Self {
9290 Self::new(value)
9291 }
9292}
9293
9294#[derive(Debug, Clone)]
9295pub struct NavigationPolicyProviderProxy {
9296 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9297}
9298
9299impl fidl::endpoints::Proxy for NavigationPolicyProviderProxy {
9300 type Protocol = NavigationPolicyProviderMarker;
9301
9302 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9303 Self::new(inner)
9304 }
9305
9306 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9307 self.client.into_channel().map_err(|client| Self { client })
9308 }
9309
9310 fn as_channel(&self) -> &::fidl::AsyncChannel {
9311 self.client.as_channel()
9312 }
9313}
9314
9315impl NavigationPolicyProviderProxy {
9316 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9318 let protocol_name =
9319 <NavigationPolicyProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9320 Self { client: fidl::client::Client::new(channel, protocol_name) }
9321 }
9322
9323 pub fn take_event_stream(&self) -> NavigationPolicyProviderEventStream {
9329 NavigationPolicyProviderEventStream { event_receiver: self.client.take_event_receiver() }
9330 }
9331
9332 pub fn r#evaluate_requested_navigation(
9336 &self,
9337 mut requested_navigation: &RequestedNavigation,
9338 ) -> fidl::client::QueryResponseFut<
9339 NavigationDecision,
9340 fidl::encoding::DefaultFuchsiaResourceDialect,
9341 > {
9342 NavigationPolicyProviderProxyInterface::r#evaluate_requested_navigation(
9343 self,
9344 requested_navigation,
9345 )
9346 }
9347}
9348
9349impl NavigationPolicyProviderProxyInterface for NavigationPolicyProviderProxy {
9350 type EvaluateRequestedNavigationResponseFut = fidl::client::QueryResponseFut<
9351 NavigationDecision,
9352 fidl::encoding::DefaultFuchsiaResourceDialect,
9353 >;
9354 fn r#evaluate_requested_navigation(
9355 &self,
9356 mut requested_navigation: &RequestedNavigation,
9357 ) -> Self::EvaluateRequestedNavigationResponseFut {
9358 fn _decode(
9359 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9360 ) -> Result<NavigationDecision, fidl::Error> {
9361 let _response = fidl::client::decode_transaction_body::<
9362 NavigationPolicyProviderEvaluateRequestedNavigationResponse,
9363 fidl::encoding::DefaultFuchsiaResourceDialect,
9364 0x54446b50cf3512b6,
9365 >(_buf?)?;
9366 Ok(_response.decision)
9367 }
9368 self.client.send_query_and_decode::<
9369 NavigationPolicyProviderEvaluateRequestedNavigationRequest,
9370 NavigationDecision,
9371 >(
9372 (requested_navigation,),
9373 0x54446b50cf3512b6,
9374 fidl::encoding::DynamicFlags::empty(),
9375 _decode,
9376 )
9377 }
9378}
9379
9380pub struct NavigationPolicyProviderEventStream {
9381 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9382}
9383
9384impl std::marker::Unpin for NavigationPolicyProviderEventStream {}
9385
9386impl futures::stream::FusedStream for NavigationPolicyProviderEventStream {
9387 fn is_terminated(&self) -> bool {
9388 self.event_receiver.is_terminated()
9389 }
9390}
9391
9392impl futures::Stream for NavigationPolicyProviderEventStream {
9393 type Item = Result<NavigationPolicyProviderEvent, fidl::Error>;
9394
9395 fn poll_next(
9396 mut self: std::pin::Pin<&mut Self>,
9397 cx: &mut std::task::Context<'_>,
9398 ) -> std::task::Poll<Option<Self::Item>> {
9399 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9400 &mut self.event_receiver,
9401 cx
9402 )?) {
9403 Some(buf) => std::task::Poll::Ready(Some(NavigationPolicyProviderEvent::decode(buf))),
9404 None => std::task::Poll::Ready(None),
9405 }
9406 }
9407}
9408
9409#[derive(Debug)]
9410pub enum NavigationPolicyProviderEvent {}
9411
9412impl NavigationPolicyProviderEvent {
9413 fn decode(
9415 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9416 ) -> Result<NavigationPolicyProviderEvent, fidl::Error> {
9417 let (bytes, _handles) = buf.split_mut();
9418 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9419 debug_assert_eq!(tx_header.tx_id, 0);
9420 match tx_header.ordinal {
9421 _ => Err(fidl::Error::UnknownOrdinal {
9422 ordinal: tx_header.ordinal,
9423 protocol_name:
9424 <NavigationPolicyProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9425 }),
9426 }
9427 }
9428}
9429
9430pub struct NavigationPolicyProviderRequestStream {
9432 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9433 is_terminated: bool,
9434}
9435
9436impl std::marker::Unpin for NavigationPolicyProviderRequestStream {}
9437
9438impl futures::stream::FusedStream for NavigationPolicyProviderRequestStream {
9439 fn is_terminated(&self) -> bool {
9440 self.is_terminated
9441 }
9442}
9443
9444impl fidl::endpoints::RequestStream for NavigationPolicyProviderRequestStream {
9445 type Protocol = NavigationPolicyProviderMarker;
9446 type ControlHandle = NavigationPolicyProviderControlHandle;
9447
9448 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9449 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9450 }
9451
9452 fn control_handle(&self) -> Self::ControlHandle {
9453 NavigationPolicyProviderControlHandle { inner: self.inner.clone() }
9454 }
9455
9456 fn into_inner(
9457 self,
9458 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9459 {
9460 (self.inner, self.is_terminated)
9461 }
9462
9463 fn from_inner(
9464 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9465 is_terminated: bool,
9466 ) -> Self {
9467 Self { inner, is_terminated }
9468 }
9469}
9470
9471impl futures::Stream for NavigationPolicyProviderRequestStream {
9472 type Item = Result<NavigationPolicyProviderRequest, fidl::Error>;
9473
9474 fn poll_next(
9475 mut self: std::pin::Pin<&mut Self>,
9476 cx: &mut std::task::Context<'_>,
9477 ) -> std::task::Poll<Option<Self::Item>> {
9478 let this = &mut *self;
9479 if this.inner.check_shutdown(cx) {
9480 this.is_terminated = true;
9481 return std::task::Poll::Ready(None);
9482 }
9483 if this.is_terminated {
9484 panic!("polled NavigationPolicyProviderRequestStream after completion");
9485 }
9486 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9487 |bytes, handles| {
9488 match this.inner.channel().read_etc(cx, bytes, handles) {
9489 std::task::Poll::Ready(Ok(())) => {}
9490 std::task::Poll::Pending => return std::task::Poll::Pending,
9491 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9492 this.is_terminated = true;
9493 return std::task::Poll::Ready(None);
9494 }
9495 std::task::Poll::Ready(Err(e)) => {
9496 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9497 e.into(),
9498 ))))
9499 }
9500 }
9501
9502 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9504
9505 std::task::Poll::Ready(Some(match header.ordinal {
9506 0x54446b50cf3512b6 => {
9507 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9508 let mut req = fidl::new_empty!(NavigationPolicyProviderEvaluateRequestedNavigationRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9509 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NavigationPolicyProviderEvaluateRequestedNavigationRequest>(&header, _body_bytes, handles, &mut req)?;
9510 let control_handle = NavigationPolicyProviderControlHandle {
9511 inner: this.inner.clone(),
9512 };
9513 Ok(NavigationPolicyProviderRequest::EvaluateRequestedNavigation {requested_navigation: req.requested_navigation,
9514
9515 responder: NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9516 control_handle: std::mem::ManuallyDrop::new(control_handle),
9517 tx_id: header.tx_id,
9518 },
9519 })
9520 }
9521 _ => Err(fidl::Error::UnknownOrdinal {
9522 ordinal: header.ordinal,
9523 protocol_name: <NavigationPolicyProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9524 }),
9525 }))
9526 },
9527 )
9528 }
9529}
9530
9531#[derive(Debug)]
9532pub enum NavigationPolicyProviderRequest {
9533 EvaluateRequestedNavigation {
9537 requested_navigation: RequestedNavigation,
9538 responder: NavigationPolicyProviderEvaluateRequestedNavigationResponder,
9539 },
9540}
9541
9542impl NavigationPolicyProviderRequest {
9543 #[allow(irrefutable_let_patterns)]
9544 pub fn into_evaluate_requested_navigation(
9545 self,
9546 ) -> Option<(RequestedNavigation, NavigationPolicyProviderEvaluateRequestedNavigationResponder)>
9547 {
9548 if let NavigationPolicyProviderRequest::EvaluateRequestedNavigation {
9549 requested_navigation,
9550 responder,
9551 } = self
9552 {
9553 Some((requested_navigation, responder))
9554 } else {
9555 None
9556 }
9557 }
9558
9559 pub fn method_name(&self) -> &'static str {
9561 match *self {
9562 NavigationPolicyProviderRequest::EvaluateRequestedNavigation { .. } => {
9563 "evaluate_requested_navigation"
9564 }
9565 }
9566 }
9567}
9568
9569#[derive(Debug, Clone)]
9570pub struct NavigationPolicyProviderControlHandle {
9571 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9572}
9573
9574impl fidl::endpoints::ControlHandle for NavigationPolicyProviderControlHandle {
9575 fn shutdown(&self) {
9576 self.inner.shutdown()
9577 }
9578 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9579 self.inner.shutdown_with_epitaph(status)
9580 }
9581
9582 fn is_closed(&self) -> bool {
9583 self.inner.channel().is_closed()
9584 }
9585 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9586 self.inner.channel().on_closed()
9587 }
9588
9589 #[cfg(target_os = "fuchsia")]
9590 fn signal_peer(
9591 &self,
9592 clear_mask: zx::Signals,
9593 set_mask: zx::Signals,
9594 ) -> Result<(), zx_status::Status> {
9595 use fidl::Peered;
9596 self.inner.channel().signal_peer(clear_mask, set_mask)
9597 }
9598}
9599
9600impl NavigationPolicyProviderControlHandle {}
9601
9602#[must_use = "FIDL methods require a response to be sent"]
9603#[derive(Debug)]
9604pub struct NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9605 control_handle: std::mem::ManuallyDrop<NavigationPolicyProviderControlHandle>,
9606 tx_id: u32,
9607}
9608
9609impl std::ops::Drop for NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9613 fn drop(&mut self) {
9614 self.control_handle.shutdown();
9615 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9617 }
9618}
9619
9620impl fidl::endpoints::Responder for NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9621 type ControlHandle = NavigationPolicyProviderControlHandle;
9622
9623 fn control_handle(&self) -> &NavigationPolicyProviderControlHandle {
9624 &self.control_handle
9625 }
9626
9627 fn drop_without_shutdown(mut self) {
9628 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9630 std::mem::forget(self);
9632 }
9633}
9634
9635impl NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9636 pub fn send(self, mut decision: NavigationDecision) -> Result<(), fidl::Error> {
9640 let _result = self.send_raw(decision);
9641 if _result.is_err() {
9642 self.control_handle.shutdown();
9643 }
9644 self.drop_without_shutdown();
9645 _result
9646 }
9647
9648 pub fn send_no_shutdown_on_err(
9650 self,
9651 mut decision: NavigationDecision,
9652 ) -> Result<(), fidl::Error> {
9653 let _result = self.send_raw(decision);
9654 self.drop_without_shutdown();
9655 _result
9656 }
9657
9658 fn send_raw(&self, mut decision: NavigationDecision) -> Result<(), fidl::Error> {
9659 self.control_handle
9660 .inner
9661 .send::<NavigationPolicyProviderEvaluateRequestedNavigationResponse>(
9662 (&mut decision,),
9663 self.tx_id,
9664 0x54446b50cf3512b6,
9665 fidl::encoding::DynamicFlags::empty(),
9666 )
9667 }
9668}
9669
9670#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9671pub struct PopupFrameCreationListenerMarker;
9672
9673impl fidl::endpoints::ProtocolMarker for PopupFrameCreationListenerMarker {
9674 type Proxy = PopupFrameCreationListenerProxy;
9675 type RequestStream = PopupFrameCreationListenerRequestStream;
9676 #[cfg(target_os = "fuchsia")]
9677 type SynchronousProxy = PopupFrameCreationListenerSynchronousProxy;
9678
9679 const DEBUG_NAME: &'static str = "(anonymous) PopupFrameCreationListener";
9680}
9681
9682pub trait PopupFrameCreationListenerProxyInterface: Send + Sync {
9683 type OnPopupFrameCreatedResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
9684 + Send;
9685 fn r#on_popup_frame_created(
9686 &self,
9687 frame: fidl::endpoints::ClientEnd<FrameMarker>,
9688 info: PopupFrameCreationInfo,
9689 ) -> Self::OnPopupFrameCreatedResponseFut;
9690}
9691#[derive(Debug)]
9692#[cfg(target_os = "fuchsia")]
9693pub struct PopupFrameCreationListenerSynchronousProxy {
9694 client: fidl::client::sync::Client,
9695}
9696
9697#[cfg(target_os = "fuchsia")]
9698impl fidl::endpoints::SynchronousProxy for PopupFrameCreationListenerSynchronousProxy {
9699 type Proxy = PopupFrameCreationListenerProxy;
9700 type Protocol = PopupFrameCreationListenerMarker;
9701
9702 fn from_channel(inner: fidl::Channel) -> Self {
9703 Self::new(inner)
9704 }
9705
9706 fn into_channel(self) -> fidl::Channel {
9707 self.client.into_channel()
9708 }
9709
9710 fn as_channel(&self) -> &fidl::Channel {
9711 self.client.as_channel()
9712 }
9713}
9714
9715#[cfg(target_os = "fuchsia")]
9716impl PopupFrameCreationListenerSynchronousProxy {
9717 pub fn new(channel: fidl::Channel) -> Self {
9718 let protocol_name =
9719 <PopupFrameCreationListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9720 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9721 }
9722
9723 pub fn into_channel(self) -> fidl::Channel {
9724 self.client.into_channel()
9725 }
9726
9727 pub fn wait_for_event(
9730 &self,
9731 deadline: zx::MonotonicInstant,
9732 ) -> Result<PopupFrameCreationListenerEvent, fidl::Error> {
9733 PopupFrameCreationListenerEvent::decode(self.client.wait_for_event(deadline)?)
9734 }
9735
9736 pub fn r#on_popup_frame_created(
9740 &self,
9741 mut frame: fidl::endpoints::ClientEnd<FrameMarker>,
9742 mut info: PopupFrameCreationInfo,
9743 ___deadline: zx::MonotonicInstant,
9744 ) -> Result<(), fidl::Error> {
9745 let _response = self.client.send_query::<
9746 PopupFrameCreationListenerOnPopupFrameCreatedRequest,
9747 fidl::encoding::EmptyPayload,
9748 >(
9749 (frame, &mut info,),
9750 0x19b212672dc41d51,
9751 fidl::encoding::DynamicFlags::empty(),
9752 ___deadline,
9753 )?;
9754 Ok(_response)
9755 }
9756}
9757
9758#[cfg(target_os = "fuchsia")]
9759impl From<PopupFrameCreationListenerSynchronousProxy> for zx::Handle {
9760 fn from(value: PopupFrameCreationListenerSynchronousProxy) -> Self {
9761 value.into_channel().into()
9762 }
9763}
9764
9765#[cfg(target_os = "fuchsia")]
9766impl From<fidl::Channel> for PopupFrameCreationListenerSynchronousProxy {
9767 fn from(value: fidl::Channel) -> Self {
9768 Self::new(value)
9769 }
9770}
9771
9772#[derive(Debug, Clone)]
9773pub struct PopupFrameCreationListenerProxy {
9774 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9775}
9776
9777impl fidl::endpoints::Proxy for PopupFrameCreationListenerProxy {
9778 type Protocol = PopupFrameCreationListenerMarker;
9779
9780 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9781 Self::new(inner)
9782 }
9783
9784 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9785 self.client.into_channel().map_err(|client| Self { client })
9786 }
9787
9788 fn as_channel(&self) -> &::fidl::AsyncChannel {
9789 self.client.as_channel()
9790 }
9791}
9792
9793impl PopupFrameCreationListenerProxy {
9794 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9796 let protocol_name =
9797 <PopupFrameCreationListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9798 Self { client: fidl::client::Client::new(channel, protocol_name) }
9799 }
9800
9801 pub fn take_event_stream(&self) -> PopupFrameCreationListenerEventStream {
9807 PopupFrameCreationListenerEventStream { event_receiver: self.client.take_event_receiver() }
9808 }
9809
9810 pub fn r#on_popup_frame_created(
9814 &self,
9815 mut frame: fidl::endpoints::ClientEnd<FrameMarker>,
9816 mut info: PopupFrameCreationInfo,
9817 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9818 PopupFrameCreationListenerProxyInterface::r#on_popup_frame_created(self, frame, info)
9819 }
9820}
9821
9822impl PopupFrameCreationListenerProxyInterface for PopupFrameCreationListenerProxy {
9823 type OnPopupFrameCreatedResponseFut =
9824 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9825 fn r#on_popup_frame_created(
9826 &self,
9827 mut frame: fidl::endpoints::ClientEnd<FrameMarker>,
9828 mut info: PopupFrameCreationInfo,
9829 ) -> Self::OnPopupFrameCreatedResponseFut {
9830 fn _decode(
9831 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9832 ) -> Result<(), fidl::Error> {
9833 let _response = fidl::client::decode_transaction_body::<
9834 fidl::encoding::EmptyPayload,
9835 fidl::encoding::DefaultFuchsiaResourceDialect,
9836 0x19b212672dc41d51,
9837 >(_buf?)?;
9838 Ok(_response)
9839 }
9840 self.client
9841 .send_query_and_decode::<PopupFrameCreationListenerOnPopupFrameCreatedRequest, ()>(
9842 (frame, &mut info),
9843 0x19b212672dc41d51,
9844 fidl::encoding::DynamicFlags::empty(),
9845 _decode,
9846 )
9847 }
9848}
9849
9850pub struct PopupFrameCreationListenerEventStream {
9851 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9852}
9853
9854impl std::marker::Unpin for PopupFrameCreationListenerEventStream {}
9855
9856impl futures::stream::FusedStream for PopupFrameCreationListenerEventStream {
9857 fn is_terminated(&self) -> bool {
9858 self.event_receiver.is_terminated()
9859 }
9860}
9861
9862impl futures::Stream for PopupFrameCreationListenerEventStream {
9863 type Item = Result<PopupFrameCreationListenerEvent, fidl::Error>;
9864
9865 fn poll_next(
9866 mut self: std::pin::Pin<&mut Self>,
9867 cx: &mut std::task::Context<'_>,
9868 ) -> std::task::Poll<Option<Self::Item>> {
9869 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9870 &mut self.event_receiver,
9871 cx
9872 )?) {
9873 Some(buf) => std::task::Poll::Ready(Some(PopupFrameCreationListenerEvent::decode(buf))),
9874 None => std::task::Poll::Ready(None),
9875 }
9876 }
9877}
9878
9879#[derive(Debug)]
9880pub enum PopupFrameCreationListenerEvent {}
9881
9882impl PopupFrameCreationListenerEvent {
9883 fn decode(
9885 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9886 ) -> Result<PopupFrameCreationListenerEvent, fidl::Error> {
9887 let (bytes, _handles) = buf.split_mut();
9888 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9889 debug_assert_eq!(tx_header.tx_id, 0);
9890 match tx_header.ordinal {
9891 _ => Err(fidl::Error::UnknownOrdinal {
9892 ordinal: tx_header.ordinal,
9893 protocol_name: <PopupFrameCreationListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9894 })
9895 }
9896 }
9897}
9898
9899pub struct PopupFrameCreationListenerRequestStream {
9901 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9902 is_terminated: bool,
9903}
9904
9905impl std::marker::Unpin for PopupFrameCreationListenerRequestStream {}
9906
9907impl futures::stream::FusedStream for PopupFrameCreationListenerRequestStream {
9908 fn is_terminated(&self) -> bool {
9909 self.is_terminated
9910 }
9911}
9912
9913impl fidl::endpoints::RequestStream for PopupFrameCreationListenerRequestStream {
9914 type Protocol = PopupFrameCreationListenerMarker;
9915 type ControlHandle = PopupFrameCreationListenerControlHandle;
9916
9917 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9918 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9919 }
9920
9921 fn control_handle(&self) -> Self::ControlHandle {
9922 PopupFrameCreationListenerControlHandle { inner: self.inner.clone() }
9923 }
9924
9925 fn into_inner(
9926 self,
9927 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9928 {
9929 (self.inner, self.is_terminated)
9930 }
9931
9932 fn from_inner(
9933 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9934 is_terminated: bool,
9935 ) -> Self {
9936 Self { inner, is_terminated }
9937 }
9938}
9939
9940impl futures::Stream for PopupFrameCreationListenerRequestStream {
9941 type Item = Result<PopupFrameCreationListenerRequest, fidl::Error>;
9942
9943 fn poll_next(
9944 mut self: std::pin::Pin<&mut Self>,
9945 cx: &mut std::task::Context<'_>,
9946 ) -> std::task::Poll<Option<Self::Item>> {
9947 let this = &mut *self;
9948 if this.inner.check_shutdown(cx) {
9949 this.is_terminated = true;
9950 return std::task::Poll::Ready(None);
9951 }
9952 if this.is_terminated {
9953 panic!("polled PopupFrameCreationListenerRequestStream after completion");
9954 }
9955 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9956 |bytes, handles| {
9957 match this.inner.channel().read_etc(cx, bytes, handles) {
9958 std::task::Poll::Ready(Ok(())) => {}
9959 std::task::Poll::Pending => return std::task::Poll::Pending,
9960 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9961 this.is_terminated = true;
9962 return std::task::Poll::Ready(None);
9963 }
9964 std::task::Poll::Ready(Err(e)) => {
9965 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9966 e.into(),
9967 ))))
9968 }
9969 }
9970
9971 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9973
9974 std::task::Poll::Ready(Some(match header.ordinal {
9975 0x19b212672dc41d51 => {
9976 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9977 let mut req = fidl::new_empty!(PopupFrameCreationListenerOnPopupFrameCreatedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9978 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PopupFrameCreationListenerOnPopupFrameCreatedRequest>(&header, _body_bytes, handles, &mut req)?;
9979 let control_handle = PopupFrameCreationListenerControlHandle {
9980 inner: this.inner.clone(),
9981 };
9982 Ok(PopupFrameCreationListenerRequest::OnPopupFrameCreated {frame: req.frame,
9983info: req.info,
9984
9985 responder: PopupFrameCreationListenerOnPopupFrameCreatedResponder {
9986 control_handle: std::mem::ManuallyDrop::new(control_handle),
9987 tx_id: header.tx_id,
9988 },
9989 })
9990 }
9991 _ => Err(fidl::Error::UnknownOrdinal {
9992 ordinal: header.ordinal,
9993 protocol_name: <PopupFrameCreationListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9994 }),
9995 }))
9996 },
9997 )
9998 }
9999}
10000
10001#[derive(Debug)]
10002pub enum PopupFrameCreationListenerRequest {
10003 OnPopupFrameCreated {
10007 frame: fidl::endpoints::ClientEnd<FrameMarker>,
10008 info: PopupFrameCreationInfo,
10009 responder: PopupFrameCreationListenerOnPopupFrameCreatedResponder,
10010 },
10011}
10012
10013impl PopupFrameCreationListenerRequest {
10014 #[allow(irrefutable_let_patterns)]
10015 pub fn into_on_popup_frame_created(
10016 self,
10017 ) -> Option<(
10018 fidl::endpoints::ClientEnd<FrameMarker>,
10019 PopupFrameCreationInfo,
10020 PopupFrameCreationListenerOnPopupFrameCreatedResponder,
10021 )> {
10022 if let PopupFrameCreationListenerRequest::OnPopupFrameCreated { frame, info, responder } =
10023 self
10024 {
10025 Some((frame, info, responder))
10026 } else {
10027 None
10028 }
10029 }
10030
10031 pub fn method_name(&self) -> &'static str {
10033 match *self {
10034 PopupFrameCreationListenerRequest::OnPopupFrameCreated { .. } => {
10035 "on_popup_frame_created"
10036 }
10037 }
10038 }
10039}
10040
10041#[derive(Debug, Clone)]
10042pub struct PopupFrameCreationListenerControlHandle {
10043 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10044}
10045
10046impl fidl::endpoints::ControlHandle for PopupFrameCreationListenerControlHandle {
10047 fn shutdown(&self) {
10048 self.inner.shutdown()
10049 }
10050 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10051 self.inner.shutdown_with_epitaph(status)
10052 }
10053
10054 fn is_closed(&self) -> bool {
10055 self.inner.channel().is_closed()
10056 }
10057 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10058 self.inner.channel().on_closed()
10059 }
10060
10061 #[cfg(target_os = "fuchsia")]
10062 fn signal_peer(
10063 &self,
10064 clear_mask: zx::Signals,
10065 set_mask: zx::Signals,
10066 ) -> Result<(), zx_status::Status> {
10067 use fidl::Peered;
10068 self.inner.channel().signal_peer(clear_mask, set_mask)
10069 }
10070}
10071
10072impl PopupFrameCreationListenerControlHandle {}
10073
10074#[must_use = "FIDL methods require a response to be sent"]
10075#[derive(Debug)]
10076pub struct PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10077 control_handle: std::mem::ManuallyDrop<PopupFrameCreationListenerControlHandle>,
10078 tx_id: u32,
10079}
10080
10081impl std::ops::Drop for PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10085 fn drop(&mut self) {
10086 self.control_handle.shutdown();
10087 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10089 }
10090}
10091
10092impl fidl::endpoints::Responder for PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10093 type ControlHandle = PopupFrameCreationListenerControlHandle;
10094
10095 fn control_handle(&self) -> &PopupFrameCreationListenerControlHandle {
10096 &self.control_handle
10097 }
10098
10099 fn drop_without_shutdown(mut self) {
10100 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10102 std::mem::forget(self);
10104 }
10105}
10106
10107impl PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10108 pub fn send(self) -> Result<(), fidl::Error> {
10112 let _result = self.send_raw();
10113 if _result.is_err() {
10114 self.control_handle.shutdown();
10115 }
10116 self.drop_without_shutdown();
10117 _result
10118 }
10119
10120 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
10122 let _result = self.send_raw();
10123 self.drop_without_shutdown();
10124 _result
10125 }
10126
10127 fn send_raw(&self) -> Result<(), fidl::Error> {
10128 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
10129 (),
10130 self.tx_id,
10131 0x19b212672dc41d51,
10132 fidl::encoding::DynamicFlags::empty(),
10133 )
10134 }
10135}
10136
10137mod internal {
10138 use super::*;
10139
10140 impl fidl::encoding::ResourceTypeMarker for ContextCreateFrameRequest {
10141 type Borrowed<'a> = &'a mut Self;
10142 fn take_or_borrow<'a>(
10143 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10144 ) -> Self::Borrowed<'a> {
10145 value
10146 }
10147 }
10148
10149 unsafe impl fidl::encoding::TypeMarker for ContextCreateFrameRequest {
10150 type Owned = Self;
10151
10152 #[inline(always)]
10153 fn inline_align(_context: fidl::encoding::Context) -> usize {
10154 4
10155 }
10156
10157 #[inline(always)]
10158 fn inline_size(_context: fidl::encoding::Context) -> usize {
10159 4
10160 }
10161 }
10162
10163 unsafe impl
10164 fidl::encoding::Encode<
10165 ContextCreateFrameRequest,
10166 fidl::encoding::DefaultFuchsiaResourceDialect,
10167 > for &mut ContextCreateFrameRequest
10168 {
10169 #[inline]
10170 unsafe fn encode(
10171 self,
10172 encoder: &mut fidl::encoding::Encoder<
10173 '_,
10174 fidl::encoding::DefaultFuchsiaResourceDialect,
10175 >,
10176 offset: usize,
10177 _depth: fidl::encoding::Depth,
10178 ) -> fidl::Result<()> {
10179 encoder.debug_check_bounds::<ContextCreateFrameRequest>(offset);
10180 fidl::encoding::Encode::<ContextCreateFrameRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10182 (
10183 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.frame),
10184 ),
10185 encoder, offset, _depth
10186 )
10187 }
10188 }
10189 unsafe impl<
10190 T0: fidl::encoding::Encode<
10191 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10192 fidl::encoding::DefaultFuchsiaResourceDialect,
10193 >,
10194 >
10195 fidl::encoding::Encode<
10196 ContextCreateFrameRequest,
10197 fidl::encoding::DefaultFuchsiaResourceDialect,
10198 > for (T0,)
10199 {
10200 #[inline]
10201 unsafe fn encode(
10202 self,
10203 encoder: &mut fidl::encoding::Encoder<
10204 '_,
10205 fidl::encoding::DefaultFuchsiaResourceDialect,
10206 >,
10207 offset: usize,
10208 depth: fidl::encoding::Depth,
10209 ) -> fidl::Result<()> {
10210 encoder.debug_check_bounds::<ContextCreateFrameRequest>(offset);
10211 self.0.encode(encoder, offset + 0, depth)?;
10215 Ok(())
10216 }
10217 }
10218
10219 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10220 for ContextCreateFrameRequest
10221 {
10222 #[inline(always)]
10223 fn new_empty() -> Self {
10224 Self {
10225 frame: fidl::new_empty!(
10226 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10227 fidl::encoding::DefaultFuchsiaResourceDialect
10228 ),
10229 }
10230 }
10231
10232 #[inline]
10233 unsafe fn decode(
10234 &mut self,
10235 decoder: &mut fidl::encoding::Decoder<
10236 '_,
10237 fidl::encoding::DefaultFuchsiaResourceDialect,
10238 >,
10239 offset: usize,
10240 _depth: fidl::encoding::Depth,
10241 ) -> fidl::Result<()> {
10242 decoder.debug_check_bounds::<Self>(offset);
10243 fidl::decode!(
10245 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10246 fidl::encoding::DefaultFuchsiaResourceDialect,
10247 &mut self.frame,
10248 decoder,
10249 offset + 0,
10250 _depth
10251 )?;
10252 Ok(())
10253 }
10254 }
10255
10256 impl fidl::encoding::ResourceTypeMarker for ContextCreateFrameWithParamsRequest {
10257 type Borrowed<'a> = &'a mut Self;
10258 fn take_or_borrow<'a>(
10259 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10260 ) -> Self::Borrowed<'a> {
10261 value
10262 }
10263 }
10264
10265 unsafe impl fidl::encoding::TypeMarker for ContextCreateFrameWithParamsRequest {
10266 type Owned = Self;
10267
10268 #[inline(always)]
10269 fn inline_align(_context: fidl::encoding::Context) -> usize {
10270 8
10271 }
10272
10273 #[inline(always)]
10274 fn inline_size(_context: fidl::encoding::Context) -> usize {
10275 24
10276 }
10277 }
10278
10279 unsafe impl
10280 fidl::encoding::Encode<
10281 ContextCreateFrameWithParamsRequest,
10282 fidl::encoding::DefaultFuchsiaResourceDialect,
10283 > for &mut ContextCreateFrameWithParamsRequest
10284 {
10285 #[inline]
10286 unsafe fn encode(
10287 self,
10288 encoder: &mut fidl::encoding::Encoder<
10289 '_,
10290 fidl::encoding::DefaultFuchsiaResourceDialect,
10291 >,
10292 offset: usize,
10293 _depth: fidl::encoding::Depth,
10294 ) -> fidl::Result<()> {
10295 encoder.debug_check_bounds::<ContextCreateFrameWithParamsRequest>(offset);
10296 fidl::encoding::Encode::<ContextCreateFrameWithParamsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10298 (
10299 <CreateFrameParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.params),
10300 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.frame),
10301 ),
10302 encoder, offset, _depth
10303 )
10304 }
10305 }
10306 unsafe impl<
10307 T0: fidl::encoding::Encode<
10308 CreateFrameParams,
10309 fidl::encoding::DefaultFuchsiaResourceDialect,
10310 >,
10311 T1: fidl::encoding::Encode<
10312 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10313 fidl::encoding::DefaultFuchsiaResourceDialect,
10314 >,
10315 >
10316 fidl::encoding::Encode<
10317 ContextCreateFrameWithParamsRequest,
10318 fidl::encoding::DefaultFuchsiaResourceDialect,
10319 > for (T0, T1)
10320 {
10321 #[inline]
10322 unsafe fn encode(
10323 self,
10324 encoder: &mut fidl::encoding::Encoder<
10325 '_,
10326 fidl::encoding::DefaultFuchsiaResourceDialect,
10327 >,
10328 offset: usize,
10329 depth: fidl::encoding::Depth,
10330 ) -> fidl::Result<()> {
10331 encoder.debug_check_bounds::<ContextCreateFrameWithParamsRequest>(offset);
10332 unsafe {
10335 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10336 (ptr as *mut u64).write_unaligned(0);
10337 }
10338 self.0.encode(encoder, offset + 0, depth)?;
10340 self.1.encode(encoder, offset + 16, depth)?;
10341 Ok(())
10342 }
10343 }
10344
10345 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10346 for ContextCreateFrameWithParamsRequest
10347 {
10348 #[inline(always)]
10349 fn new_empty() -> Self {
10350 Self {
10351 params: fidl::new_empty!(
10352 CreateFrameParams,
10353 fidl::encoding::DefaultFuchsiaResourceDialect
10354 ),
10355 frame: fidl::new_empty!(
10356 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10357 fidl::encoding::DefaultFuchsiaResourceDialect
10358 ),
10359 }
10360 }
10361
10362 #[inline]
10363 unsafe fn decode(
10364 &mut self,
10365 decoder: &mut fidl::encoding::Decoder<
10366 '_,
10367 fidl::encoding::DefaultFuchsiaResourceDialect,
10368 >,
10369 offset: usize,
10370 _depth: fidl::encoding::Depth,
10371 ) -> fidl::Result<()> {
10372 decoder.debug_check_bounds::<Self>(offset);
10373 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10375 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10376 let mask = 0xffffffff00000000u64;
10377 let maskedval = padval & mask;
10378 if maskedval != 0 {
10379 return Err(fidl::Error::NonZeroPadding {
10380 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10381 });
10382 }
10383 fidl::decode!(
10384 CreateFrameParams,
10385 fidl::encoding::DefaultFuchsiaResourceDialect,
10386 &mut self.params,
10387 decoder,
10388 offset + 0,
10389 _depth
10390 )?;
10391 fidl::decode!(
10392 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10393 fidl::encoding::DefaultFuchsiaResourceDialect,
10394 &mut self.frame,
10395 decoder,
10396 offset + 16,
10397 _depth
10398 )?;
10399 Ok(())
10400 }
10401 }
10402
10403 impl fidl::encoding::ResourceTypeMarker for ContextGetCookieManagerRequest {
10404 type Borrowed<'a> = &'a mut Self;
10405 fn take_or_borrow<'a>(
10406 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10407 ) -> Self::Borrowed<'a> {
10408 value
10409 }
10410 }
10411
10412 unsafe impl fidl::encoding::TypeMarker for ContextGetCookieManagerRequest {
10413 type Owned = Self;
10414
10415 #[inline(always)]
10416 fn inline_align(_context: fidl::encoding::Context) -> usize {
10417 4
10418 }
10419
10420 #[inline(always)]
10421 fn inline_size(_context: fidl::encoding::Context) -> usize {
10422 4
10423 }
10424 }
10425
10426 unsafe impl
10427 fidl::encoding::Encode<
10428 ContextGetCookieManagerRequest,
10429 fidl::encoding::DefaultFuchsiaResourceDialect,
10430 > for &mut ContextGetCookieManagerRequest
10431 {
10432 #[inline]
10433 unsafe fn encode(
10434 self,
10435 encoder: &mut fidl::encoding::Encoder<
10436 '_,
10437 fidl::encoding::DefaultFuchsiaResourceDialect,
10438 >,
10439 offset: usize,
10440 _depth: fidl::encoding::Depth,
10441 ) -> fidl::Result<()> {
10442 encoder.debug_check_bounds::<ContextGetCookieManagerRequest>(offset);
10443 fidl::encoding::Encode::<ContextGetCookieManagerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10445 (
10446 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookieManagerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.manager),
10447 ),
10448 encoder, offset, _depth
10449 )
10450 }
10451 }
10452 unsafe impl<
10453 T0: fidl::encoding::Encode<
10454 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookieManagerMarker>>,
10455 fidl::encoding::DefaultFuchsiaResourceDialect,
10456 >,
10457 >
10458 fidl::encoding::Encode<
10459 ContextGetCookieManagerRequest,
10460 fidl::encoding::DefaultFuchsiaResourceDialect,
10461 > for (T0,)
10462 {
10463 #[inline]
10464 unsafe fn encode(
10465 self,
10466 encoder: &mut fidl::encoding::Encoder<
10467 '_,
10468 fidl::encoding::DefaultFuchsiaResourceDialect,
10469 >,
10470 offset: usize,
10471 depth: fidl::encoding::Depth,
10472 ) -> fidl::Result<()> {
10473 encoder.debug_check_bounds::<ContextGetCookieManagerRequest>(offset);
10474 self.0.encode(encoder, offset + 0, depth)?;
10478 Ok(())
10479 }
10480 }
10481
10482 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10483 for ContextGetCookieManagerRequest
10484 {
10485 #[inline(always)]
10486 fn new_empty() -> Self {
10487 Self {
10488 manager: fidl::new_empty!(
10489 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookieManagerMarker>>,
10490 fidl::encoding::DefaultFuchsiaResourceDialect
10491 ),
10492 }
10493 }
10494
10495 #[inline]
10496 unsafe fn decode(
10497 &mut self,
10498 decoder: &mut fidl::encoding::Decoder<
10499 '_,
10500 fidl::encoding::DefaultFuchsiaResourceDialect,
10501 >,
10502 offset: usize,
10503 _depth: fidl::encoding::Depth,
10504 ) -> fidl::Result<()> {
10505 decoder.debug_check_bounds::<Self>(offset);
10506 fidl::decode!(
10508 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookieManagerMarker>>,
10509 fidl::encoding::DefaultFuchsiaResourceDialect,
10510 &mut self.manager,
10511 decoder,
10512 offset + 0,
10513 _depth
10514 )?;
10515 Ok(())
10516 }
10517 }
10518
10519 impl fidl::encoding::ResourceTypeMarker for ContextProviderCreateRequest {
10520 type Borrowed<'a> = &'a mut Self;
10521 fn take_or_borrow<'a>(
10522 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10523 ) -> Self::Borrowed<'a> {
10524 value
10525 }
10526 }
10527
10528 unsafe impl fidl::encoding::TypeMarker for ContextProviderCreateRequest {
10529 type Owned = Self;
10530
10531 #[inline(always)]
10532 fn inline_align(_context: fidl::encoding::Context) -> usize {
10533 8
10534 }
10535
10536 #[inline(always)]
10537 fn inline_size(_context: fidl::encoding::Context) -> usize {
10538 24
10539 }
10540 }
10541
10542 unsafe impl
10543 fidl::encoding::Encode<
10544 ContextProviderCreateRequest,
10545 fidl::encoding::DefaultFuchsiaResourceDialect,
10546 > for &mut ContextProviderCreateRequest
10547 {
10548 #[inline]
10549 unsafe fn encode(
10550 self,
10551 encoder: &mut fidl::encoding::Encoder<
10552 '_,
10553 fidl::encoding::DefaultFuchsiaResourceDialect,
10554 >,
10555 offset: usize,
10556 _depth: fidl::encoding::Depth,
10557 ) -> fidl::Result<()> {
10558 encoder.debug_check_bounds::<ContextProviderCreateRequest>(offset);
10559 fidl::encoding::Encode::<ContextProviderCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10561 (
10562 <CreateContextParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.params),
10563 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ContextMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.context),
10564 ),
10565 encoder, offset, _depth
10566 )
10567 }
10568 }
10569 unsafe impl<
10570 T0: fidl::encoding::Encode<
10571 CreateContextParams,
10572 fidl::encoding::DefaultFuchsiaResourceDialect,
10573 >,
10574 T1: fidl::encoding::Encode<
10575 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ContextMarker>>,
10576 fidl::encoding::DefaultFuchsiaResourceDialect,
10577 >,
10578 >
10579 fidl::encoding::Encode<
10580 ContextProviderCreateRequest,
10581 fidl::encoding::DefaultFuchsiaResourceDialect,
10582 > for (T0, T1)
10583 {
10584 #[inline]
10585 unsafe fn encode(
10586 self,
10587 encoder: &mut fidl::encoding::Encoder<
10588 '_,
10589 fidl::encoding::DefaultFuchsiaResourceDialect,
10590 >,
10591 offset: usize,
10592 depth: fidl::encoding::Depth,
10593 ) -> fidl::Result<()> {
10594 encoder.debug_check_bounds::<ContextProviderCreateRequest>(offset);
10595 unsafe {
10598 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10599 (ptr as *mut u64).write_unaligned(0);
10600 }
10601 self.0.encode(encoder, offset + 0, depth)?;
10603 self.1.encode(encoder, offset + 16, depth)?;
10604 Ok(())
10605 }
10606 }
10607
10608 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10609 for ContextProviderCreateRequest
10610 {
10611 #[inline(always)]
10612 fn new_empty() -> Self {
10613 Self {
10614 params: fidl::new_empty!(
10615 CreateContextParams,
10616 fidl::encoding::DefaultFuchsiaResourceDialect
10617 ),
10618 context: fidl::new_empty!(
10619 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ContextMarker>>,
10620 fidl::encoding::DefaultFuchsiaResourceDialect
10621 ),
10622 }
10623 }
10624
10625 #[inline]
10626 unsafe fn decode(
10627 &mut self,
10628 decoder: &mut fidl::encoding::Decoder<
10629 '_,
10630 fidl::encoding::DefaultFuchsiaResourceDialect,
10631 >,
10632 offset: usize,
10633 _depth: fidl::encoding::Depth,
10634 ) -> fidl::Result<()> {
10635 decoder.debug_check_bounds::<Self>(offset);
10636 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10638 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10639 let mask = 0xffffffff00000000u64;
10640 let maskedval = padval & mask;
10641 if maskedval != 0 {
10642 return Err(fidl::Error::NonZeroPadding {
10643 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10644 });
10645 }
10646 fidl::decode!(
10647 CreateContextParams,
10648 fidl::encoding::DefaultFuchsiaResourceDialect,
10649 &mut self.params,
10650 decoder,
10651 offset + 0,
10652 _depth
10653 )?;
10654 fidl::decode!(
10655 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ContextMarker>>,
10656 fidl::encoding::DefaultFuchsiaResourceDialect,
10657 &mut self.context,
10658 decoder,
10659 offset + 16,
10660 _depth
10661 )?;
10662 Ok(())
10663 }
10664 }
10665
10666 impl fidl::encoding::ResourceTypeMarker for CookieManagerGetCookieListRequest {
10667 type Borrowed<'a> = &'a mut Self;
10668 fn take_or_borrow<'a>(
10669 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10670 ) -> Self::Borrowed<'a> {
10671 value
10672 }
10673 }
10674
10675 unsafe impl fidl::encoding::TypeMarker for CookieManagerGetCookieListRequest {
10676 type Owned = Self;
10677
10678 #[inline(always)]
10679 fn inline_align(_context: fidl::encoding::Context) -> usize {
10680 8
10681 }
10682
10683 #[inline(always)]
10684 fn inline_size(_context: fidl::encoding::Context) -> usize {
10685 40
10686 }
10687 }
10688
10689 unsafe impl
10690 fidl::encoding::Encode<
10691 CookieManagerGetCookieListRequest,
10692 fidl::encoding::DefaultFuchsiaResourceDialect,
10693 > for &mut CookieManagerGetCookieListRequest
10694 {
10695 #[inline]
10696 unsafe fn encode(
10697 self,
10698 encoder: &mut fidl::encoding::Encoder<
10699 '_,
10700 fidl::encoding::DefaultFuchsiaResourceDialect,
10701 >,
10702 offset: usize,
10703 _depth: fidl::encoding::Depth,
10704 ) -> fidl::Result<()> {
10705 encoder.debug_check_bounds::<CookieManagerGetCookieListRequest>(offset);
10706 fidl::encoding::Encode::<CookieManagerGetCookieListRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10708 (
10709 <fidl::encoding::Optional<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
10710 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
10711 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.cookies),
10712 ),
10713 encoder, offset, _depth
10714 )
10715 }
10716 }
10717 unsafe impl<
10718 T0: fidl::encoding::Encode<
10719 fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
10720 fidl::encoding::DefaultFuchsiaResourceDialect,
10721 >,
10722 T1: fidl::encoding::Encode<
10723 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
10724 fidl::encoding::DefaultFuchsiaResourceDialect,
10725 >,
10726 T2: fidl::encoding::Encode<
10727 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
10728 fidl::encoding::DefaultFuchsiaResourceDialect,
10729 >,
10730 >
10731 fidl::encoding::Encode<
10732 CookieManagerGetCookieListRequest,
10733 fidl::encoding::DefaultFuchsiaResourceDialect,
10734 > for (T0, T1, T2)
10735 {
10736 #[inline]
10737 unsafe fn encode(
10738 self,
10739 encoder: &mut fidl::encoding::Encoder<
10740 '_,
10741 fidl::encoding::DefaultFuchsiaResourceDialect,
10742 >,
10743 offset: usize,
10744 depth: fidl::encoding::Depth,
10745 ) -> fidl::Result<()> {
10746 encoder.debug_check_bounds::<CookieManagerGetCookieListRequest>(offset);
10747 unsafe {
10750 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
10751 (ptr as *mut u64).write_unaligned(0);
10752 }
10753 self.0.encode(encoder, offset + 0, depth)?;
10755 self.1.encode(encoder, offset + 16, depth)?;
10756 self.2.encode(encoder, offset + 32, depth)?;
10757 Ok(())
10758 }
10759 }
10760
10761 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10762 for CookieManagerGetCookieListRequest
10763 {
10764 #[inline(always)]
10765 fn new_empty() -> Self {
10766 Self {
10767 url: fidl::new_empty!(
10768 fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
10769 fidl::encoding::DefaultFuchsiaResourceDialect
10770 ),
10771 name: fidl::new_empty!(
10772 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
10773 fidl::encoding::DefaultFuchsiaResourceDialect
10774 ),
10775 cookies: fidl::new_empty!(
10776 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
10777 fidl::encoding::DefaultFuchsiaResourceDialect
10778 ),
10779 }
10780 }
10781
10782 #[inline]
10783 unsafe fn decode(
10784 &mut self,
10785 decoder: &mut fidl::encoding::Decoder<
10786 '_,
10787 fidl::encoding::DefaultFuchsiaResourceDialect,
10788 >,
10789 offset: usize,
10790 _depth: fidl::encoding::Depth,
10791 ) -> fidl::Result<()> {
10792 decoder.debug_check_bounds::<Self>(offset);
10793 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
10795 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10796 let mask = 0xffffffff00000000u64;
10797 let maskedval = padval & mask;
10798 if maskedval != 0 {
10799 return Err(fidl::Error::NonZeroPadding {
10800 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
10801 });
10802 }
10803 fidl::decode!(
10804 fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
10805 fidl::encoding::DefaultFuchsiaResourceDialect,
10806 &mut self.url,
10807 decoder,
10808 offset + 0,
10809 _depth
10810 )?;
10811 fidl::decode!(
10812 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
10813 fidl::encoding::DefaultFuchsiaResourceDialect,
10814 &mut self.name,
10815 decoder,
10816 offset + 16,
10817 _depth
10818 )?;
10819 fidl::decode!(
10820 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
10821 fidl::encoding::DefaultFuchsiaResourceDialect,
10822 &mut self.cookies,
10823 decoder,
10824 offset + 32,
10825 _depth
10826 )?;
10827 Ok(())
10828 }
10829 }
10830
10831 impl fidl::encoding::ResourceTypeMarker for CookieManagerObserveCookieChangesRequest {
10832 type Borrowed<'a> = &'a mut Self;
10833 fn take_or_borrow<'a>(
10834 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10835 ) -> Self::Borrowed<'a> {
10836 value
10837 }
10838 }
10839
10840 unsafe impl fidl::encoding::TypeMarker for CookieManagerObserveCookieChangesRequest {
10841 type Owned = Self;
10842
10843 #[inline(always)]
10844 fn inline_align(_context: fidl::encoding::Context) -> usize {
10845 8
10846 }
10847
10848 #[inline(always)]
10849 fn inline_size(_context: fidl::encoding::Context) -> usize {
10850 40
10851 }
10852 }
10853
10854 unsafe impl
10855 fidl::encoding::Encode<
10856 CookieManagerObserveCookieChangesRequest,
10857 fidl::encoding::DefaultFuchsiaResourceDialect,
10858 > for &mut CookieManagerObserveCookieChangesRequest
10859 {
10860 #[inline]
10861 unsafe fn encode(
10862 self,
10863 encoder: &mut fidl::encoding::Encoder<
10864 '_,
10865 fidl::encoding::DefaultFuchsiaResourceDialect,
10866 >,
10867 offset: usize,
10868 _depth: fidl::encoding::Depth,
10869 ) -> fidl::Result<()> {
10870 encoder.debug_check_bounds::<CookieManagerObserveCookieChangesRequest>(offset);
10871 fidl::encoding::Encode::<CookieManagerObserveCookieChangesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10873 (
10874 <fidl::encoding::Optional<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
10875 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
10876 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.changes),
10877 ),
10878 encoder, offset, _depth
10879 )
10880 }
10881 }
10882 unsafe impl<
10883 T0: fidl::encoding::Encode<
10884 fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
10885 fidl::encoding::DefaultFuchsiaResourceDialect,
10886 >,
10887 T1: fidl::encoding::Encode<
10888 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
10889 fidl::encoding::DefaultFuchsiaResourceDialect,
10890 >,
10891 T2: fidl::encoding::Encode<
10892 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
10893 fidl::encoding::DefaultFuchsiaResourceDialect,
10894 >,
10895 >
10896 fidl::encoding::Encode<
10897 CookieManagerObserveCookieChangesRequest,
10898 fidl::encoding::DefaultFuchsiaResourceDialect,
10899 > for (T0, T1, T2)
10900 {
10901 #[inline]
10902 unsafe fn encode(
10903 self,
10904 encoder: &mut fidl::encoding::Encoder<
10905 '_,
10906 fidl::encoding::DefaultFuchsiaResourceDialect,
10907 >,
10908 offset: usize,
10909 depth: fidl::encoding::Depth,
10910 ) -> fidl::Result<()> {
10911 encoder.debug_check_bounds::<CookieManagerObserveCookieChangesRequest>(offset);
10912 unsafe {
10915 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
10916 (ptr as *mut u64).write_unaligned(0);
10917 }
10918 self.0.encode(encoder, offset + 0, depth)?;
10920 self.1.encode(encoder, offset + 16, depth)?;
10921 self.2.encode(encoder, offset + 32, depth)?;
10922 Ok(())
10923 }
10924 }
10925
10926 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10927 for CookieManagerObserveCookieChangesRequest
10928 {
10929 #[inline(always)]
10930 fn new_empty() -> Self {
10931 Self {
10932 url: fidl::new_empty!(
10933 fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
10934 fidl::encoding::DefaultFuchsiaResourceDialect
10935 ),
10936 name: fidl::new_empty!(
10937 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
10938 fidl::encoding::DefaultFuchsiaResourceDialect
10939 ),
10940 changes: fidl::new_empty!(
10941 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
10942 fidl::encoding::DefaultFuchsiaResourceDialect
10943 ),
10944 }
10945 }
10946
10947 #[inline]
10948 unsafe fn decode(
10949 &mut self,
10950 decoder: &mut fidl::encoding::Decoder<
10951 '_,
10952 fidl::encoding::DefaultFuchsiaResourceDialect,
10953 >,
10954 offset: usize,
10955 _depth: fidl::encoding::Depth,
10956 ) -> fidl::Result<()> {
10957 decoder.debug_check_bounds::<Self>(offset);
10958 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
10960 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10961 let mask = 0xffffffff00000000u64;
10962 let maskedval = padval & mask;
10963 if maskedval != 0 {
10964 return Err(fidl::Error::NonZeroPadding {
10965 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
10966 });
10967 }
10968 fidl::decode!(
10969 fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
10970 fidl::encoding::DefaultFuchsiaResourceDialect,
10971 &mut self.url,
10972 decoder,
10973 offset + 0,
10974 _depth
10975 )?;
10976 fidl::decode!(
10977 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
10978 fidl::encoding::DefaultFuchsiaResourceDialect,
10979 &mut self.name,
10980 decoder,
10981 offset + 16,
10982 _depth
10983 )?;
10984 fidl::decode!(
10985 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
10986 fidl::encoding::DefaultFuchsiaResourceDialect,
10987 &mut self.changes,
10988 decoder,
10989 offset + 32,
10990 _depth
10991 )?;
10992 Ok(())
10993 }
10994 }
10995
10996 impl fidl::encoding::ResourceTypeMarker for CookiesIteratorGetNextResponse {
10997 type Borrowed<'a> = &'a mut Self;
10998 fn take_or_borrow<'a>(
10999 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11000 ) -> Self::Borrowed<'a> {
11001 value
11002 }
11003 }
11004
11005 unsafe impl fidl::encoding::TypeMarker for CookiesIteratorGetNextResponse {
11006 type Owned = Self;
11007
11008 #[inline(always)]
11009 fn inline_align(_context: fidl::encoding::Context) -> usize {
11010 8
11011 }
11012
11013 #[inline(always)]
11014 fn inline_size(_context: fidl::encoding::Context) -> usize {
11015 16
11016 }
11017 }
11018
11019 unsafe impl
11020 fidl::encoding::Encode<
11021 CookiesIteratorGetNextResponse,
11022 fidl::encoding::DefaultFuchsiaResourceDialect,
11023 > for &mut CookiesIteratorGetNextResponse
11024 {
11025 #[inline]
11026 unsafe fn encode(
11027 self,
11028 encoder: &mut fidl::encoding::Encoder<
11029 '_,
11030 fidl::encoding::DefaultFuchsiaResourceDialect,
11031 >,
11032 offset: usize,
11033 _depth: fidl::encoding::Depth,
11034 ) -> fidl::Result<()> {
11035 encoder.debug_check_bounds::<CookiesIteratorGetNextResponse>(offset);
11036 fidl::encoding::Encode::<CookiesIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11038 (
11039 <fidl::encoding::UnboundedVector<Cookie> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.changed_cookies),
11040 ),
11041 encoder, offset, _depth
11042 )
11043 }
11044 }
11045 unsafe impl<
11046 T0: fidl::encoding::Encode<
11047 fidl::encoding::UnboundedVector<Cookie>,
11048 fidl::encoding::DefaultFuchsiaResourceDialect,
11049 >,
11050 >
11051 fidl::encoding::Encode<
11052 CookiesIteratorGetNextResponse,
11053 fidl::encoding::DefaultFuchsiaResourceDialect,
11054 > for (T0,)
11055 {
11056 #[inline]
11057 unsafe fn encode(
11058 self,
11059 encoder: &mut fidl::encoding::Encoder<
11060 '_,
11061 fidl::encoding::DefaultFuchsiaResourceDialect,
11062 >,
11063 offset: usize,
11064 depth: fidl::encoding::Depth,
11065 ) -> fidl::Result<()> {
11066 encoder.debug_check_bounds::<CookiesIteratorGetNextResponse>(offset);
11067 self.0.encode(encoder, offset + 0, depth)?;
11071 Ok(())
11072 }
11073 }
11074
11075 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11076 for CookiesIteratorGetNextResponse
11077 {
11078 #[inline(always)]
11079 fn new_empty() -> Self {
11080 Self {
11081 changed_cookies: fidl::new_empty!(
11082 fidl::encoding::UnboundedVector<Cookie>,
11083 fidl::encoding::DefaultFuchsiaResourceDialect
11084 ),
11085 }
11086 }
11087
11088 #[inline]
11089 unsafe fn decode(
11090 &mut self,
11091 decoder: &mut fidl::encoding::Decoder<
11092 '_,
11093 fidl::encoding::DefaultFuchsiaResourceDialect,
11094 >,
11095 offset: usize,
11096 _depth: fidl::encoding::Depth,
11097 ) -> fidl::Result<()> {
11098 decoder.debug_check_bounds::<Self>(offset);
11099 fidl::decode!(
11101 fidl::encoding::UnboundedVector<Cookie>,
11102 fidl::encoding::DefaultFuchsiaResourceDialect,
11103 &mut self.changed_cookies,
11104 decoder,
11105 offset + 0,
11106 _depth
11107 )?;
11108 Ok(())
11109 }
11110 }
11111
11112 impl fidl::encoding::ResourceTypeMarker for DebugEnableDevToolsRequest {
11113 type Borrowed<'a> = &'a mut Self;
11114 fn take_or_borrow<'a>(
11115 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11116 ) -> Self::Borrowed<'a> {
11117 value
11118 }
11119 }
11120
11121 unsafe impl fidl::encoding::TypeMarker for DebugEnableDevToolsRequest {
11122 type Owned = Self;
11123
11124 #[inline(always)]
11125 fn inline_align(_context: fidl::encoding::Context) -> usize {
11126 4
11127 }
11128
11129 #[inline(always)]
11130 fn inline_size(_context: fidl::encoding::Context) -> usize {
11131 4
11132 }
11133 }
11134
11135 unsafe impl
11136 fidl::encoding::Encode<
11137 DebugEnableDevToolsRequest,
11138 fidl::encoding::DefaultFuchsiaResourceDialect,
11139 > for &mut DebugEnableDevToolsRequest
11140 {
11141 #[inline]
11142 unsafe fn encode(
11143 self,
11144 encoder: &mut fidl::encoding::Encoder<
11145 '_,
11146 fidl::encoding::DefaultFuchsiaResourceDialect,
11147 >,
11148 offset: usize,
11149 _depth: fidl::encoding::Depth,
11150 ) -> fidl::Result<()> {
11151 encoder.debug_check_bounds::<DebugEnableDevToolsRequest>(offset);
11152 fidl::encoding::Encode::<DebugEnableDevToolsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11154 (
11155 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevToolsListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.listener),
11156 ),
11157 encoder, offset, _depth
11158 )
11159 }
11160 }
11161 unsafe impl<
11162 T0: fidl::encoding::Encode<
11163 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevToolsListenerMarker>>,
11164 fidl::encoding::DefaultFuchsiaResourceDialect,
11165 >,
11166 >
11167 fidl::encoding::Encode<
11168 DebugEnableDevToolsRequest,
11169 fidl::encoding::DefaultFuchsiaResourceDialect,
11170 > for (T0,)
11171 {
11172 #[inline]
11173 unsafe fn encode(
11174 self,
11175 encoder: &mut fidl::encoding::Encoder<
11176 '_,
11177 fidl::encoding::DefaultFuchsiaResourceDialect,
11178 >,
11179 offset: usize,
11180 depth: fidl::encoding::Depth,
11181 ) -> fidl::Result<()> {
11182 encoder.debug_check_bounds::<DebugEnableDevToolsRequest>(offset);
11183 self.0.encode(encoder, offset + 0, depth)?;
11187 Ok(())
11188 }
11189 }
11190
11191 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11192 for DebugEnableDevToolsRequest
11193 {
11194 #[inline(always)]
11195 fn new_empty() -> Self {
11196 Self {
11197 listener: fidl::new_empty!(
11198 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevToolsListenerMarker>>,
11199 fidl::encoding::DefaultFuchsiaResourceDialect
11200 ),
11201 }
11202 }
11203
11204 #[inline]
11205 unsafe fn decode(
11206 &mut self,
11207 decoder: &mut fidl::encoding::Decoder<
11208 '_,
11209 fidl::encoding::DefaultFuchsiaResourceDialect,
11210 >,
11211 offset: usize,
11212 _depth: fidl::encoding::Depth,
11213 ) -> fidl::Result<()> {
11214 decoder.debug_check_bounds::<Self>(offset);
11215 fidl::decode!(
11217 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevToolsListenerMarker>>,
11218 fidl::encoding::DefaultFuchsiaResourceDialect,
11219 &mut self.listener,
11220 decoder,
11221 offset + 0,
11222 _depth
11223 )?;
11224 Ok(())
11225 }
11226 }
11227
11228 impl fidl::encoding::ResourceTypeMarker for DevToolsListenerOnContextDevToolsAvailableRequest {
11229 type Borrowed<'a> = &'a mut Self;
11230 fn take_or_borrow<'a>(
11231 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11232 ) -> Self::Borrowed<'a> {
11233 value
11234 }
11235 }
11236
11237 unsafe impl fidl::encoding::TypeMarker for DevToolsListenerOnContextDevToolsAvailableRequest {
11238 type Owned = Self;
11239
11240 #[inline(always)]
11241 fn inline_align(_context: fidl::encoding::Context) -> usize {
11242 4
11243 }
11244
11245 #[inline(always)]
11246 fn inline_size(_context: fidl::encoding::Context) -> usize {
11247 4
11248 }
11249 }
11250
11251 unsafe impl
11252 fidl::encoding::Encode<
11253 DevToolsListenerOnContextDevToolsAvailableRequest,
11254 fidl::encoding::DefaultFuchsiaResourceDialect,
11255 > for &mut DevToolsListenerOnContextDevToolsAvailableRequest
11256 {
11257 #[inline]
11258 unsafe fn encode(
11259 self,
11260 encoder: &mut fidl::encoding::Encoder<
11261 '_,
11262 fidl::encoding::DefaultFuchsiaResourceDialect,
11263 >,
11264 offset: usize,
11265 _depth: fidl::encoding::Depth,
11266 ) -> fidl::Result<()> {
11267 encoder.debug_check_bounds::<DevToolsListenerOnContextDevToolsAvailableRequest>(offset);
11268 fidl::encoding::Encode::<
11270 DevToolsListenerOnContextDevToolsAvailableRequest,
11271 fidl::encoding::DefaultFuchsiaResourceDialect,
11272 >::encode(
11273 (<fidl::encoding::Endpoint<
11274 fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
11275 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11276 &mut self.listener
11277 ),),
11278 encoder,
11279 offset,
11280 _depth,
11281 )
11282 }
11283 }
11284 unsafe impl<
11285 T0: fidl::encoding::Encode<
11286 fidl::encoding::Endpoint<
11287 fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
11288 >,
11289 fidl::encoding::DefaultFuchsiaResourceDialect,
11290 >,
11291 >
11292 fidl::encoding::Encode<
11293 DevToolsListenerOnContextDevToolsAvailableRequest,
11294 fidl::encoding::DefaultFuchsiaResourceDialect,
11295 > for (T0,)
11296 {
11297 #[inline]
11298 unsafe fn encode(
11299 self,
11300 encoder: &mut fidl::encoding::Encoder<
11301 '_,
11302 fidl::encoding::DefaultFuchsiaResourceDialect,
11303 >,
11304 offset: usize,
11305 depth: fidl::encoding::Depth,
11306 ) -> fidl::Result<()> {
11307 encoder.debug_check_bounds::<DevToolsListenerOnContextDevToolsAvailableRequest>(offset);
11308 self.0.encode(encoder, offset + 0, depth)?;
11312 Ok(())
11313 }
11314 }
11315
11316 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11317 for DevToolsListenerOnContextDevToolsAvailableRequest
11318 {
11319 #[inline(always)]
11320 fn new_empty() -> Self {
11321 Self {
11322 listener: fidl::new_empty!(
11323 fidl::encoding::Endpoint<
11324 fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
11325 >,
11326 fidl::encoding::DefaultFuchsiaResourceDialect
11327 ),
11328 }
11329 }
11330
11331 #[inline]
11332 unsafe fn decode(
11333 &mut self,
11334 decoder: &mut fidl::encoding::Decoder<
11335 '_,
11336 fidl::encoding::DefaultFuchsiaResourceDialect,
11337 >,
11338 offset: usize,
11339 _depth: fidl::encoding::Depth,
11340 ) -> fidl::Result<()> {
11341 decoder.debug_check_bounds::<Self>(offset);
11342 fidl::decode!(
11344 fidl::encoding::Endpoint<
11345 fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
11346 >,
11347 fidl::encoding::DefaultFuchsiaResourceDialect,
11348 &mut self.listener,
11349 decoder,
11350 offset + 0,
11351 _depth
11352 )?;
11353 Ok(())
11354 }
11355 }
11356
11357 impl fidl::encoding::ResourceTypeMarker for FrameAddBeforeLoadJavaScriptRequest {
11358 type Borrowed<'a> = &'a mut Self;
11359 fn take_or_borrow<'a>(
11360 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11361 ) -> Self::Borrowed<'a> {
11362 value
11363 }
11364 }
11365
11366 unsafe impl fidl::encoding::TypeMarker for FrameAddBeforeLoadJavaScriptRequest {
11367 type Owned = Self;
11368
11369 #[inline(always)]
11370 fn inline_align(_context: fidl::encoding::Context) -> usize {
11371 8
11372 }
11373
11374 #[inline(always)]
11375 fn inline_size(_context: fidl::encoding::Context) -> usize {
11376 40
11377 }
11378 }
11379
11380 unsafe impl
11381 fidl::encoding::Encode<
11382 FrameAddBeforeLoadJavaScriptRequest,
11383 fidl::encoding::DefaultFuchsiaResourceDialect,
11384 > for &mut FrameAddBeforeLoadJavaScriptRequest
11385 {
11386 #[inline]
11387 unsafe fn encode(
11388 self,
11389 encoder: &mut fidl::encoding::Encoder<
11390 '_,
11391 fidl::encoding::DefaultFuchsiaResourceDialect,
11392 >,
11393 offset: usize,
11394 _depth: fidl::encoding::Depth,
11395 ) -> fidl::Result<()> {
11396 encoder.debug_check_bounds::<FrameAddBeforeLoadJavaScriptRequest>(offset);
11397 fidl::encoding::Encode::<FrameAddBeforeLoadJavaScriptRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11399 (
11400 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11401 <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.origins),
11402 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.script),
11403 ),
11404 encoder, offset, _depth
11405 )
11406 }
11407 }
11408 unsafe impl<
11409 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11410 T1: fidl::encoding::Encode<
11411 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
11412 fidl::encoding::DefaultFuchsiaResourceDialect,
11413 >,
11414 T2: fidl::encoding::Encode<
11415 fidl_fuchsia_mem::Buffer,
11416 fidl::encoding::DefaultFuchsiaResourceDialect,
11417 >,
11418 >
11419 fidl::encoding::Encode<
11420 FrameAddBeforeLoadJavaScriptRequest,
11421 fidl::encoding::DefaultFuchsiaResourceDialect,
11422 > for (T0, T1, T2)
11423 {
11424 #[inline]
11425 unsafe fn encode(
11426 self,
11427 encoder: &mut fidl::encoding::Encoder<
11428 '_,
11429 fidl::encoding::DefaultFuchsiaResourceDialect,
11430 >,
11431 offset: usize,
11432 depth: fidl::encoding::Depth,
11433 ) -> fidl::Result<()> {
11434 encoder.debug_check_bounds::<FrameAddBeforeLoadJavaScriptRequest>(offset);
11435 self.0.encode(encoder, offset + 0, depth)?;
11439 self.1.encode(encoder, offset + 8, depth)?;
11440 self.2.encode(encoder, offset + 24, depth)?;
11441 Ok(())
11442 }
11443 }
11444
11445 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11446 for FrameAddBeforeLoadJavaScriptRequest
11447 {
11448 #[inline(always)]
11449 fn new_empty() -> Self {
11450 Self {
11451 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11452 origins: fidl::new_empty!(
11453 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
11454 fidl::encoding::DefaultFuchsiaResourceDialect
11455 ),
11456 script: fidl::new_empty!(
11457 fidl_fuchsia_mem::Buffer,
11458 fidl::encoding::DefaultFuchsiaResourceDialect
11459 ),
11460 }
11461 }
11462
11463 #[inline]
11464 unsafe fn decode(
11465 &mut self,
11466 decoder: &mut fidl::encoding::Decoder<
11467 '_,
11468 fidl::encoding::DefaultFuchsiaResourceDialect,
11469 >,
11470 offset: usize,
11471 _depth: fidl::encoding::Depth,
11472 ) -> fidl::Result<()> {
11473 decoder.debug_check_bounds::<Self>(offset);
11474 fidl::decode!(
11476 u64,
11477 fidl::encoding::DefaultFuchsiaResourceDialect,
11478 &mut self.id,
11479 decoder,
11480 offset + 0,
11481 _depth
11482 )?;
11483 fidl::decode!(
11484 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
11485 fidl::encoding::DefaultFuchsiaResourceDialect,
11486 &mut self.origins,
11487 decoder,
11488 offset + 8,
11489 _depth
11490 )?;
11491 fidl::decode!(
11492 fidl_fuchsia_mem::Buffer,
11493 fidl::encoding::DefaultFuchsiaResourceDialect,
11494 &mut self.script,
11495 decoder,
11496 offset + 24,
11497 _depth
11498 )?;
11499 Ok(())
11500 }
11501 }
11502
11503 impl fidl::encoding::ResourceTypeMarker for FrameCreateView2Request {
11504 type Borrowed<'a> = &'a mut Self;
11505 fn take_or_borrow<'a>(
11506 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11507 ) -> Self::Borrowed<'a> {
11508 value
11509 }
11510 }
11511
11512 unsafe impl fidl::encoding::TypeMarker for FrameCreateView2Request {
11513 type Owned = Self;
11514
11515 #[inline(always)]
11516 fn inline_align(_context: fidl::encoding::Context) -> usize {
11517 8
11518 }
11519
11520 #[inline(always)]
11521 fn inline_size(_context: fidl::encoding::Context) -> usize {
11522 16
11523 }
11524 }
11525
11526 unsafe impl
11527 fidl::encoding::Encode<
11528 FrameCreateView2Request,
11529 fidl::encoding::DefaultFuchsiaResourceDialect,
11530 > for &mut FrameCreateView2Request
11531 {
11532 #[inline]
11533 unsafe fn encode(
11534 self,
11535 encoder: &mut fidl::encoding::Encoder<
11536 '_,
11537 fidl::encoding::DefaultFuchsiaResourceDialect,
11538 >,
11539 offset: usize,
11540 _depth: fidl::encoding::Depth,
11541 ) -> fidl::Result<()> {
11542 encoder.debug_check_bounds::<FrameCreateView2Request>(offset);
11543 fidl::encoding::Encode::<
11545 FrameCreateView2Request,
11546 fidl::encoding::DefaultFuchsiaResourceDialect,
11547 >::encode(
11548 (<CreateView2Args as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11549 &mut self.args,
11550 ),),
11551 encoder,
11552 offset,
11553 _depth,
11554 )
11555 }
11556 }
11557 unsafe impl<
11558 T0: fidl::encoding::Encode<CreateView2Args, fidl::encoding::DefaultFuchsiaResourceDialect>,
11559 >
11560 fidl::encoding::Encode<
11561 FrameCreateView2Request,
11562 fidl::encoding::DefaultFuchsiaResourceDialect,
11563 > for (T0,)
11564 {
11565 #[inline]
11566 unsafe fn encode(
11567 self,
11568 encoder: &mut fidl::encoding::Encoder<
11569 '_,
11570 fidl::encoding::DefaultFuchsiaResourceDialect,
11571 >,
11572 offset: usize,
11573 depth: fidl::encoding::Depth,
11574 ) -> fidl::Result<()> {
11575 encoder.debug_check_bounds::<FrameCreateView2Request>(offset);
11576 self.0.encode(encoder, offset + 0, depth)?;
11580 Ok(())
11581 }
11582 }
11583
11584 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11585 for FrameCreateView2Request
11586 {
11587 #[inline(always)]
11588 fn new_empty() -> Self {
11589 Self {
11590 args: fidl::new_empty!(
11591 CreateView2Args,
11592 fidl::encoding::DefaultFuchsiaResourceDialect
11593 ),
11594 }
11595 }
11596
11597 #[inline]
11598 unsafe fn decode(
11599 &mut self,
11600 decoder: &mut fidl::encoding::Decoder<
11601 '_,
11602 fidl::encoding::DefaultFuchsiaResourceDialect,
11603 >,
11604 offset: usize,
11605 _depth: fidl::encoding::Depth,
11606 ) -> fidl::Result<()> {
11607 decoder.debug_check_bounds::<Self>(offset);
11608 fidl::decode!(
11610 CreateView2Args,
11611 fidl::encoding::DefaultFuchsiaResourceDialect,
11612 &mut self.args,
11613 decoder,
11614 offset + 0,
11615 _depth
11616 )?;
11617 Ok(())
11618 }
11619 }
11620
11621 impl fidl::encoding::ResourceTypeMarker for FrameCreateViewRequest {
11622 type Borrowed<'a> = &'a mut Self;
11623 fn take_or_borrow<'a>(
11624 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11625 ) -> Self::Borrowed<'a> {
11626 value
11627 }
11628 }
11629
11630 unsafe impl fidl::encoding::TypeMarker for FrameCreateViewRequest {
11631 type Owned = Self;
11632
11633 #[inline(always)]
11634 fn inline_align(_context: fidl::encoding::Context) -> usize {
11635 4
11636 }
11637
11638 #[inline(always)]
11639 fn inline_size(_context: fidl::encoding::Context) -> usize {
11640 4
11641 }
11642 }
11643
11644 unsafe impl
11645 fidl::encoding::Encode<
11646 FrameCreateViewRequest,
11647 fidl::encoding::DefaultFuchsiaResourceDialect,
11648 > for &mut FrameCreateViewRequest
11649 {
11650 #[inline]
11651 unsafe fn encode(
11652 self,
11653 encoder: &mut fidl::encoding::Encoder<
11654 '_,
11655 fidl::encoding::DefaultFuchsiaResourceDialect,
11656 >,
11657 offset: usize,
11658 _depth: fidl::encoding::Depth,
11659 ) -> fidl::Result<()> {
11660 encoder.debug_check_bounds::<FrameCreateViewRequest>(offset);
11661 fidl::encoding::Encode::<FrameCreateViewRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11663 (
11664 <fidl_fuchsia_ui_views::ViewToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_token),
11665 ),
11666 encoder, offset, _depth
11667 )
11668 }
11669 }
11670 unsafe impl<
11671 T0: fidl::encoding::Encode<
11672 fidl_fuchsia_ui_views::ViewToken,
11673 fidl::encoding::DefaultFuchsiaResourceDialect,
11674 >,
11675 >
11676 fidl::encoding::Encode<
11677 FrameCreateViewRequest,
11678 fidl::encoding::DefaultFuchsiaResourceDialect,
11679 > for (T0,)
11680 {
11681 #[inline]
11682 unsafe fn encode(
11683 self,
11684 encoder: &mut fidl::encoding::Encoder<
11685 '_,
11686 fidl::encoding::DefaultFuchsiaResourceDialect,
11687 >,
11688 offset: usize,
11689 depth: fidl::encoding::Depth,
11690 ) -> fidl::Result<()> {
11691 encoder.debug_check_bounds::<FrameCreateViewRequest>(offset);
11692 self.0.encode(encoder, offset + 0, depth)?;
11696 Ok(())
11697 }
11698 }
11699
11700 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11701 for FrameCreateViewRequest
11702 {
11703 #[inline(always)]
11704 fn new_empty() -> Self {
11705 Self {
11706 view_token: fidl::new_empty!(
11707 fidl_fuchsia_ui_views::ViewToken,
11708 fidl::encoding::DefaultFuchsiaResourceDialect
11709 ),
11710 }
11711 }
11712
11713 #[inline]
11714 unsafe fn decode(
11715 &mut self,
11716 decoder: &mut fidl::encoding::Decoder<
11717 '_,
11718 fidl::encoding::DefaultFuchsiaResourceDialect,
11719 >,
11720 offset: usize,
11721 _depth: fidl::encoding::Depth,
11722 ) -> fidl::Result<()> {
11723 decoder.debug_check_bounds::<Self>(offset);
11724 fidl::decode!(
11726 fidl_fuchsia_ui_views::ViewToken,
11727 fidl::encoding::DefaultFuchsiaResourceDialect,
11728 &mut self.view_token,
11729 decoder,
11730 offset + 0,
11731 _depth
11732 )?;
11733 Ok(())
11734 }
11735 }
11736
11737 impl fidl::encoding::ResourceTypeMarker for FrameCreateViewWithViewRefRequest {
11738 type Borrowed<'a> = &'a mut Self;
11739 fn take_or_borrow<'a>(
11740 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11741 ) -> Self::Borrowed<'a> {
11742 value
11743 }
11744 }
11745
11746 unsafe impl fidl::encoding::TypeMarker for FrameCreateViewWithViewRefRequest {
11747 type Owned = Self;
11748
11749 #[inline(always)]
11750 fn inline_align(_context: fidl::encoding::Context) -> usize {
11751 4
11752 }
11753
11754 #[inline(always)]
11755 fn inline_size(_context: fidl::encoding::Context) -> usize {
11756 12
11757 }
11758 }
11759
11760 unsafe impl
11761 fidl::encoding::Encode<
11762 FrameCreateViewWithViewRefRequest,
11763 fidl::encoding::DefaultFuchsiaResourceDialect,
11764 > for &mut FrameCreateViewWithViewRefRequest
11765 {
11766 #[inline]
11767 unsafe fn encode(
11768 self,
11769 encoder: &mut fidl::encoding::Encoder<
11770 '_,
11771 fidl::encoding::DefaultFuchsiaResourceDialect,
11772 >,
11773 offset: usize,
11774 _depth: fidl::encoding::Depth,
11775 ) -> fidl::Result<()> {
11776 encoder.debug_check_bounds::<FrameCreateViewWithViewRefRequest>(offset);
11777 fidl::encoding::Encode::<FrameCreateViewWithViewRefRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11779 (
11780 <fidl_fuchsia_ui_views::ViewToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_token),
11781 <fidl_fuchsia_ui_views::ViewRefControl as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_ref_control),
11782 <fidl_fuchsia_ui_views::ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_ref),
11783 ),
11784 encoder, offset, _depth
11785 )
11786 }
11787 }
11788 unsafe impl<
11789 T0: fidl::encoding::Encode<
11790 fidl_fuchsia_ui_views::ViewToken,
11791 fidl::encoding::DefaultFuchsiaResourceDialect,
11792 >,
11793 T1: fidl::encoding::Encode<
11794 fidl_fuchsia_ui_views::ViewRefControl,
11795 fidl::encoding::DefaultFuchsiaResourceDialect,
11796 >,
11797 T2: fidl::encoding::Encode<
11798 fidl_fuchsia_ui_views::ViewRef,
11799 fidl::encoding::DefaultFuchsiaResourceDialect,
11800 >,
11801 >
11802 fidl::encoding::Encode<
11803 FrameCreateViewWithViewRefRequest,
11804 fidl::encoding::DefaultFuchsiaResourceDialect,
11805 > for (T0, T1, T2)
11806 {
11807 #[inline]
11808 unsafe fn encode(
11809 self,
11810 encoder: &mut fidl::encoding::Encoder<
11811 '_,
11812 fidl::encoding::DefaultFuchsiaResourceDialect,
11813 >,
11814 offset: usize,
11815 depth: fidl::encoding::Depth,
11816 ) -> fidl::Result<()> {
11817 encoder.debug_check_bounds::<FrameCreateViewWithViewRefRequest>(offset);
11818 self.0.encode(encoder, offset + 0, depth)?;
11822 self.1.encode(encoder, offset + 4, depth)?;
11823 self.2.encode(encoder, offset + 8, depth)?;
11824 Ok(())
11825 }
11826 }
11827
11828 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11829 for FrameCreateViewWithViewRefRequest
11830 {
11831 #[inline(always)]
11832 fn new_empty() -> Self {
11833 Self {
11834 view_token: fidl::new_empty!(
11835 fidl_fuchsia_ui_views::ViewToken,
11836 fidl::encoding::DefaultFuchsiaResourceDialect
11837 ),
11838 view_ref_control: fidl::new_empty!(
11839 fidl_fuchsia_ui_views::ViewRefControl,
11840 fidl::encoding::DefaultFuchsiaResourceDialect
11841 ),
11842 view_ref: fidl::new_empty!(
11843 fidl_fuchsia_ui_views::ViewRef,
11844 fidl::encoding::DefaultFuchsiaResourceDialect
11845 ),
11846 }
11847 }
11848
11849 #[inline]
11850 unsafe fn decode(
11851 &mut self,
11852 decoder: &mut fidl::encoding::Decoder<
11853 '_,
11854 fidl::encoding::DefaultFuchsiaResourceDialect,
11855 >,
11856 offset: usize,
11857 _depth: fidl::encoding::Depth,
11858 ) -> fidl::Result<()> {
11859 decoder.debug_check_bounds::<Self>(offset);
11860 fidl::decode!(
11862 fidl_fuchsia_ui_views::ViewToken,
11863 fidl::encoding::DefaultFuchsiaResourceDialect,
11864 &mut self.view_token,
11865 decoder,
11866 offset + 0,
11867 _depth
11868 )?;
11869 fidl::decode!(
11870 fidl_fuchsia_ui_views::ViewRefControl,
11871 fidl::encoding::DefaultFuchsiaResourceDialect,
11872 &mut self.view_ref_control,
11873 decoder,
11874 offset + 4,
11875 _depth
11876 )?;
11877 fidl::decode!(
11878 fidl_fuchsia_ui_views::ViewRef,
11879 fidl::encoding::DefaultFuchsiaResourceDialect,
11880 &mut self.view_ref,
11881 decoder,
11882 offset + 8,
11883 _depth
11884 )?;
11885 Ok(())
11886 }
11887 }
11888
11889 impl fidl::encoding::ResourceTypeMarker for FrameExecuteJavaScriptNoResultRequest {
11890 type Borrowed<'a> = &'a mut Self;
11891 fn take_or_borrow<'a>(
11892 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11893 ) -> Self::Borrowed<'a> {
11894 value
11895 }
11896 }
11897
11898 unsafe impl fidl::encoding::TypeMarker for FrameExecuteJavaScriptNoResultRequest {
11899 type Owned = Self;
11900
11901 #[inline(always)]
11902 fn inline_align(_context: fidl::encoding::Context) -> usize {
11903 8
11904 }
11905
11906 #[inline(always)]
11907 fn inline_size(_context: fidl::encoding::Context) -> usize {
11908 32
11909 }
11910 }
11911
11912 unsafe impl
11913 fidl::encoding::Encode<
11914 FrameExecuteJavaScriptNoResultRequest,
11915 fidl::encoding::DefaultFuchsiaResourceDialect,
11916 > for &mut FrameExecuteJavaScriptNoResultRequest
11917 {
11918 #[inline]
11919 unsafe fn encode(
11920 self,
11921 encoder: &mut fidl::encoding::Encoder<
11922 '_,
11923 fidl::encoding::DefaultFuchsiaResourceDialect,
11924 >,
11925 offset: usize,
11926 _depth: fidl::encoding::Depth,
11927 ) -> fidl::Result<()> {
11928 encoder.debug_check_bounds::<FrameExecuteJavaScriptNoResultRequest>(offset);
11929 fidl::encoding::Encode::<FrameExecuteJavaScriptNoResultRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11931 (
11932 <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.origins),
11933 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.script),
11934 ),
11935 encoder, offset, _depth
11936 )
11937 }
11938 }
11939 unsafe impl<
11940 T0: fidl::encoding::Encode<
11941 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
11942 fidl::encoding::DefaultFuchsiaResourceDialect,
11943 >,
11944 T1: fidl::encoding::Encode<
11945 fidl_fuchsia_mem::Buffer,
11946 fidl::encoding::DefaultFuchsiaResourceDialect,
11947 >,
11948 >
11949 fidl::encoding::Encode<
11950 FrameExecuteJavaScriptNoResultRequest,
11951 fidl::encoding::DefaultFuchsiaResourceDialect,
11952 > for (T0, T1)
11953 {
11954 #[inline]
11955 unsafe fn encode(
11956 self,
11957 encoder: &mut fidl::encoding::Encoder<
11958 '_,
11959 fidl::encoding::DefaultFuchsiaResourceDialect,
11960 >,
11961 offset: usize,
11962 depth: fidl::encoding::Depth,
11963 ) -> fidl::Result<()> {
11964 encoder.debug_check_bounds::<FrameExecuteJavaScriptNoResultRequest>(offset);
11965 self.0.encode(encoder, offset + 0, depth)?;
11969 self.1.encode(encoder, offset + 16, depth)?;
11970 Ok(())
11971 }
11972 }
11973
11974 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11975 for FrameExecuteJavaScriptNoResultRequest
11976 {
11977 #[inline(always)]
11978 fn new_empty() -> Self {
11979 Self {
11980 origins: fidl::new_empty!(
11981 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
11982 fidl::encoding::DefaultFuchsiaResourceDialect
11983 ),
11984 script: fidl::new_empty!(
11985 fidl_fuchsia_mem::Buffer,
11986 fidl::encoding::DefaultFuchsiaResourceDialect
11987 ),
11988 }
11989 }
11990
11991 #[inline]
11992 unsafe fn decode(
11993 &mut self,
11994 decoder: &mut fidl::encoding::Decoder<
11995 '_,
11996 fidl::encoding::DefaultFuchsiaResourceDialect,
11997 >,
11998 offset: usize,
11999 _depth: fidl::encoding::Depth,
12000 ) -> fidl::Result<()> {
12001 decoder.debug_check_bounds::<Self>(offset);
12002 fidl::decode!(
12004 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12005 fidl::encoding::DefaultFuchsiaResourceDialect,
12006 &mut self.origins,
12007 decoder,
12008 offset + 0,
12009 _depth
12010 )?;
12011 fidl::decode!(
12012 fidl_fuchsia_mem::Buffer,
12013 fidl::encoding::DefaultFuchsiaResourceDialect,
12014 &mut self.script,
12015 decoder,
12016 offset + 16,
12017 _depth
12018 )?;
12019 Ok(())
12020 }
12021 }
12022
12023 impl fidl::encoding::ResourceTypeMarker for FrameExecuteJavaScriptRequest {
12024 type Borrowed<'a> = &'a mut Self;
12025 fn take_or_borrow<'a>(
12026 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12027 ) -> Self::Borrowed<'a> {
12028 value
12029 }
12030 }
12031
12032 unsafe impl fidl::encoding::TypeMarker for FrameExecuteJavaScriptRequest {
12033 type Owned = Self;
12034
12035 #[inline(always)]
12036 fn inline_align(_context: fidl::encoding::Context) -> usize {
12037 8
12038 }
12039
12040 #[inline(always)]
12041 fn inline_size(_context: fidl::encoding::Context) -> usize {
12042 32
12043 }
12044 }
12045
12046 unsafe impl
12047 fidl::encoding::Encode<
12048 FrameExecuteJavaScriptRequest,
12049 fidl::encoding::DefaultFuchsiaResourceDialect,
12050 > for &mut FrameExecuteJavaScriptRequest
12051 {
12052 #[inline]
12053 unsafe fn encode(
12054 self,
12055 encoder: &mut fidl::encoding::Encoder<
12056 '_,
12057 fidl::encoding::DefaultFuchsiaResourceDialect,
12058 >,
12059 offset: usize,
12060 _depth: fidl::encoding::Depth,
12061 ) -> fidl::Result<()> {
12062 encoder.debug_check_bounds::<FrameExecuteJavaScriptRequest>(offset);
12063 fidl::encoding::Encode::<FrameExecuteJavaScriptRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12065 (
12066 <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.origins),
12067 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.script),
12068 ),
12069 encoder, offset, _depth
12070 )
12071 }
12072 }
12073 unsafe impl<
12074 T0: fidl::encoding::Encode<
12075 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12076 fidl::encoding::DefaultFuchsiaResourceDialect,
12077 >,
12078 T1: fidl::encoding::Encode<
12079 fidl_fuchsia_mem::Buffer,
12080 fidl::encoding::DefaultFuchsiaResourceDialect,
12081 >,
12082 >
12083 fidl::encoding::Encode<
12084 FrameExecuteJavaScriptRequest,
12085 fidl::encoding::DefaultFuchsiaResourceDialect,
12086 > for (T0, T1)
12087 {
12088 #[inline]
12089 unsafe fn encode(
12090 self,
12091 encoder: &mut fidl::encoding::Encoder<
12092 '_,
12093 fidl::encoding::DefaultFuchsiaResourceDialect,
12094 >,
12095 offset: usize,
12096 depth: fidl::encoding::Depth,
12097 ) -> fidl::Result<()> {
12098 encoder.debug_check_bounds::<FrameExecuteJavaScriptRequest>(offset);
12099 self.0.encode(encoder, offset + 0, depth)?;
12103 self.1.encode(encoder, offset + 16, depth)?;
12104 Ok(())
12105 }
12106 }
12107
12108 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12109 for FrameExecuteJavaScriptRequest
12110 {
12111 #[inline(always)]
12112 fn new_empty() -> Self {
12113 Self {
12114 origins: fidl::new_empty!(
12115 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12116 fidl::encoding::DefaultFuchsiaResourceDialect
12117 ),
12118 script: fidl::new_empty!(
12119 fidl_fuchsia_mem::Buffer,
12120 fidl::encoding::DefaultFuchsiaResourceDialect
12121 ),
12122 }
12123 }
12124
12125 #[inline]
12126 unsafe fn decode(
12127 &mut self,
12128 decoder: &mut fidl::encoding::Decoder<
12129 '_,
12130 fidl::encoding::DefaultFuchsiaResourceDialect,
12131 >,
12132 offset: usize,
12133 _depth: fidl::encoding::Depth,
12134 ) -> fidl::Result<()> {
12135 decoder.debug_check_bounds::<Self>(offset);
12136 fidl::decode!(
12138 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12139 fidl::encoding::DefaultFuchsiaResourceDialect,
12140 &mut self.origins,
12141 decoder,
12142 offset + 0,
12143 _depth
12144 )?;
12145 fidl::decode!(
12146 fidl_fuchsia_mem::Buffer,
12147 fidl::encoding::DefaultFuchsiaResourceDialect,
12148 &mut self.script,
12149 decoder,
12150 offset + 16,
12151 _depth
12152 )?;
12153 Ok(())
12154 }
12155 }
12156
12157 impl fidl::encoding::ResourceTypeMarker for FrameGetMediaPlayerRequest {
12158 type Borrowed<'a> = &'a mut Self;
12159 fn take_or_borrow<'a>(
12160 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12161 ) -> Self::Borrowed<'a> {
12162 value
12163 }
12164 }
12165
12166 unsafe impl fidl::encoding::TypeMarker for FrameGetMediaPlayerRequest {
12167 type Owned = Self;
12168
12169 #[inline(always)]
12170 fn inline_align(_context: fidl::encoding::Context) -> usize {
12171 4
12172 }
12173
12174 #[inline(always)]
12175 fn inline_size(_context: fidl::encoding::Context) -> usize {
12176 4
12177 }
12178 }
12179
12180 unsafe impl
12181 fidl::encoding::Encode<
12182 FrameGetMediaPlayerRequest,
12183 fidl::encoding::DefaultFuchsiaResourceDialect,
12184 > for &mut FrameGetMediaPlayerRequest
12185 {
12186 #[inline]
12187 unsafe fn encode(
12188 self,
12189 encoder: &mut fidl::encoding::Encoder<
12190 '_,
12191 fidl::encoding::DefaultFuchsiaResourceDialect,
12192 >,
12193 offset: usize,
12194 _depth: fidl::encoding::Depth,
12195 ) -> fidl::Result<()> {
12196 encoder.debug_check_bounds::<FrameGetMediaPlayerRequest>(offset);
12197 fidl::encoding::Encode::<
12199 FrameGetMediaPlayerRequest,
12200 fidl::encoding::DefaultFuchsiaResourceDialect,
12201 >::encode(
12202 (<fidl::encoding::Endpoint<
12203 fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
12204 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12205 &mut self.player
12206 ),),
12207 encoder,
12208 offset,
12209 _depth,
12210 )
12211 }
12212 }
12213 unsafe impl<
12214 T0: fidl::encoding::Encode<
12215 fidl::encoding::Endpoint<
12216 fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
12217 >,
12218 fidl::encoding::DefaultFuchsiaResourceDialect,
12219 >,
12220 >
12221 fidl::encoding::Encode<
12222 FrameGetMediaPlayerRequest,
12223 fidl::encoding::DefaultFuchsiaResourceDialect,
12224 > for (T0,)
12225 {
12226 #[inline]
12227 unsafe fn encode(
12228 self,
12229 encoder: &mut fidl::encoding::Encoder<
12230 '_,
12231 fidl::encoding::DefaultFuchsiaResourceDialect,
12232 >,
12233 offset: usize,
12234 depth: fidl::encoding::Depth,
12235 ) -> fidl::Result<()> {
12236 encoder.debug_check_bounds::<FrameGetMediaPlayerRequest>(offset);
12237 self.0.encode(encoder, offset + 0, depth)?;
12241 Ok(())
12242 }
12243 }
12244
12245 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12246 for FrameGetMediaPlayerRequest
12247 {
12248 #[inline(always)]
12249 fn new_empty() -> Self {
12250 Self {
12251 player: fidl::new_empty!(
12252 fidl::encoding::Endpoint<
12253 fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
12254 >,
12255 fidl::encoding::DefaultFuchsiaResourceDialect
12256 ),
12257 }
12258 }
12259
12260 #[inline]
12261 unsafe fn decode(
12262 &mut self,
12263 decoder: &mut fidl::encoding::Decoder<
12264 '_,
12265 fidl::encoding::DefaultFuchsiaResourceDialect,
12266 >,
12267 offset: usize,
12268 _depth: fidl::encoding::Depth,
12269 ) -> fidl::Result<()> {
12270 decoder.debug_check_bounds::<Self>(offset);
12271 fidl::decode!(
12273 fidl::encoding::Endpoint<
12274 fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
12275 >,
12276 fidl::encoding::DefaultFuchsiaResourceDialect,
12277 &mut self.player,
12278 decoder,
12279 offset + 0,
12280 _depth
12281 )?;
12282 Ok(())
12283 }
12284 }
12285
12286 impl fidl::encoding::ResourceTypeMarker for FrameGetNavigationControllerRequest {
12287 type Borrowed<'a> = &'a mut Self;
12288 fn take_or_borrow<'a>(
12289 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12290 ) -> Self::Borrowed<'a> {
12291 value
12292 }
12293 }
12294
12295 unsafe impl fidl::encoding::TypeMarker for FrameGetNavigationControllerRequest {
12296 type Owned = Self;
12297
12298 #[inline(always)]
12299 fn inline_align(_context: fidl::encoding::Context) -> usize {
12300 4
12301 }
12302
12303 #[inline(always)]
12304 fn inline_size(_context: fidl::encoding::Context) -> usize {
12305 4
12306 }
12307 }
12308
12309 unsafe impl
12310 fidl::encoding::Encode<
12311 FrameGetNavigationControllerRequest,
12312 fidl::encoding::DefaultFuchsiaResourceDialect,
12313 > for &mut FrameGetNavigationControllerRequest
12314 {
12315 #[inline]
12316 unsafe fn encode(
12317 self,
12318 encoder: &mut fidl::encoding::Encoder<
12319 '_,
12320 fidl::encoding::DefaultFuchsiaResourceDialect,
12321 >,
12322 offset: usize,
12323 _depth: fidl::encoding::Depth,
12324 ) -> fidl::Result<()> {
12325 encoder.debug_check_bounds::<FrameGetNavigationControllerRequest>(offset);
12326 fidl::encoding::Encode::<
12328 FrameGetNavigationControllerRequest,
12329 fidl::encoding::DefaultFuchsiaResourceDialect,
12330 >::encode(
12331 (
12332 <fidl::encoding::Endpoint<
12333 fidl::endpoints::ServerEnd<NavigationControllerMarker>,
12334 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12335 &mut self.controller
12336 ),
12337 ),
12338 encoder,
12339 offset,
12340 _depth,
12341 )
12342 }
12343 }
12344 unsafe impl<
12345 T0: fidl::encoding::Encode<
12346 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NavigationControllerMarker>>,
12347 fidl::encoding::DefaultFuchsiaResourceDialect,
12348 >,
12349 >
12350 fidl::encoding::Encode<
12351 FrameGetNavigationControllerRequest,
12352 fidl::encoding::DefaultFuchsiaResourceDialect,
12353 > for (T0,)
12354 {
12355 #[inline]
12356 unsafe fn encode(
12357 self,
12358 encoder: &mut fidl::encoding::Encoder<
12359 '_,
12360 fidl::encoding::DefaultFuchsiaResourceDialect,
12361 >,
12362 offset: usize,
12363 depth: fidl::encoding::Depth,
12364 ) -> fidl::Result<()> {
12365 encoder.debug_check_bounds::<FrameGetNavigationControllerRequest>(offset);
12366 self.0.encode(encoder, offset + 0, depth)?;
12370 Ok(())
12371 }
12372 }
12373
12374 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12375 for FrameGetNavigationControllerRequest
12376 {
12377 #[inline(always)]
12378 fn new_empty() -> Self {
12379 Self {
12380 controller: fidl::new_empty!(
12381 fidl::encoding::Endpoint<
12382 fidl::endpoints::ServerEnd<NavigationControllerMarker>,
12383 >,
12384 fidl::encoding::DefaultFuchsiaResourceDialect
12385 ),
12386 }
12387 }
12388
12389 #[inline]
12390 unsafe fn decode(
12391 &mut self,
12392 decoder: &mut fidl::encoding::Decoder<
12393 '_,
12394 fidl::encoding::DefaultFuchsiaResourceDialect,
12395 >,
12396 offset: usize,
12397 _depth: fidl::encoding::Depth,
12398 ) -> fidl::Result<()> {
12399 decoder.debug_check_bounds::<Self>(offset);
12400 fidl::decode!(
12402 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NavigationControllerMarker>>,
12403 fidl::encoding::DefaultFuchsiaResourceDialect,
12404 &mut self.controller,
12405 decoder,
12406 offset + 0,
12407 _depth
12408 )?;
12409 Ok(())
12410 }
12411 }
12412
12413 impl fidl::encoding::ResourceTypeMarker for FrameHostCreateFrameWithParamsRequest {
12414 type Borrowed<'a> = &'a mut Self;
12415 fn take_or_borrow<'a>(
12416 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12417 ) -> Self::Borrowed<'a> {
12418 value
12419 }
12420 }
12421
12422 unsafe impl fidl::encoding::TypeMarker for FrameHostCreateFrameWithParamsRequest {
12423 type Owned = Self;
12424
12425 #[inline(always)]
12426 fn inline_align(_context: fidl::encoding::Context) -> usize {
12427 8
12428 }
12429
12430 #[inline(always)]
12431 fn inline_size(_context: fidl::encoding::Context) -> usize {
12432 24
12433 }
12434 }
12435
12436 unsafe impl
12437 fidl::encoding::Encode<
12438 FrameHostCreateFrameWithParamsRequest,
12439 fidl::encoding::DefaultFuchsiaResourceDialect,
12440 > for &mut FrameHostCreateFrameWithParamsRequest
12441 {
12442 #[inline]
12443 unsafe fn encode(
12444 self,
12445 encoder: &mut fidl::encoding::Encoder<
12446 '_,
12447 fidl::encoding::DefaultFuchsiaResourceDialect,
12448 >,
12449 offset: usize,
12450 _depth: fidl::encoding::Depth,
12451 ) -> fidl::Result<()> {
12452 encoder.debug_check_bounds::<FrameHostCreateFrameWithParamsRequest>(offset);
12453 fidl::encoding::Encode::<FrameHostCreateFrameWithParamsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12455 (
12456 <CreateFrameParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.params),
12457 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.frame),
12458 ),
12459 encoder, offset, _depth
12460 )
12461 }
12462 }
12463 unsafe impl<
12464 T0: fidl::encoding::Encode<
12465 CreateFrameParams,
12466 fidl::encoding::DefaultFuchsiaResourceDialect,
12467 >,
12468 T1: fidl::encoding::Encode<
12469 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
12470 fidl::encoding::DefaultFuchsiaResourceDialect,
12471 >,
12472 >
12473 fidl::encoding::Encode<
12474 FrameHostCreateFrameWithParamsRequest,
12475 fidl::encoding::DefaultFuchsiaResourceDialect,
12476 > for (T0, T1)
12477 {
12478 #[inline]
12479 unsafe fn encode(
12480 self,
12481 encoder: &mut fidl::encoding::Encoder<
12482 '_,
12483 fidl::encoding::DefaultFuchsiaResourceDialect,
12484 >,
12485 offset: usize,
12486 depth: fidl::encoding::Depth,
12487 ) -> fidl::Result<()> {
12488 encoder.debug_check_bounds::<FrameHostCreateFrameWithParamsRequest>(offset);
12489 unsafe {
12492 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
12493 (ptr as *mut u64).write_unaligned(0);
12494 }
12495 self.0.encode(encoder, offset + 0, depth)?;
12497 self.1.encode(encoder, offset + 16, depth)?;
12498 Ok(())
12499 }
12500 }
12501
12502 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12503 for FrameHostCreateFrameWithParamsRequest
12504 {
12505 #[inline(always)]
12506 fn new_empty() -> Self {
12507 Self {
12508 params: fidl::new_empty!(
12509 CreateFrameParams,
12510 fidl::encoding::DefaultFuchsiaResourceDialect
12511 ),
12512 frame: fidl::new_empty!(
12513 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
12514 fidl::encoding::DefaultFuchsiaResourceDialect
12515 ),
12516 }
12517 }
12518
12519 #[inline]
12520 unsafe fn decode(
12521 &mut self,
12522 decoder: &mut fidl::encoding::Decoder<
12523 '_,
12524 fidl::encoding::DefaultFuchsiaResourceDialect,
12525 >,
12526 offset: usize,
12527 _depth: fidl::encoding::Depth,
12528 ) -> fidl::Result<()> {
12529 decoder.debug_check_bounds::<Self>(offset);
12530 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
12532 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12533 let mask = 0xffffffff00000000u64;
12534 let maskedval = padval & mask;
12535 if maskedval != 0 {
12536 return Err(fidl::Error::NonZeroPadding {
12537 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
12538 });
12539 }
12540 fidl::decode!(
12541 CreateFrameParams,
12542 fidl::encoding::DefaultFuchsiaResourceDialect,
12543 &mut self.params,
12544 decoder,
12545 offset + 0,
12546 _depth
12547 )?;
12548 fidl::decode!(
12549 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
12550 fidl::encoding::DefaultFuchsiaResourceDialect,
12551 &mut self.frame,
12552 decoder,
12553 offset + 16,
12554 _depth
12555 )?;
12556 Ok(())
12557 }
12558 }
12559
12560 impl fidl::encoding::ResourceTypeMarker for FramePostMessageRequest {
12561 type Borrowed<'a> = &'a mut Self;
12562 fn take_or_borrow<'a>(
12563 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12564 ) -> Self::Borrowed<'a> {
12565 value
12566 }
12567 }
12568
12569 unsafe impl fidl::encoding::TypeMarker for FramePostMessageRequest {
12570 type Owned = Self;
12571
12572 #[inline(always)]
12573 fn inline_align(_context: fidl::encoding::Context) -> usize {
12574 8
12575 }
12576
12577 #[inline(always)]
12578 fn inline_size(_context: fidl::encoding::Context) -> usize {
12579 32
12580 }
12581 }
12582
12583 unsafe impl
12584 fidl::encoding::Encode<
12585 FramePostMessageRequest,
12586 fidl::encoding::DefaultFuchsiaResourceDialect,
12587 > for &mut FramePostMessageRequest
12588 {
12589 #[inline]
12590 unsafe fn encode(
12591 self,
12592 encoder: &mut fidl::encoding::Encoder<
12593 '_,
12594 fidl::encoding::DefaultFuchsiaResourceDialect,
12595 >,
12596 offset: usize,
12597 _depth: fidl::encoding::Depth,
12598 ) -> fidl::Result<()> {
12599 encoder.debug_check_bounds::<FramePostMessageRequest>(offset);
12600 fidl::encoding::Encode::<FramePostMessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12602 (
12603 <fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow(&self.target_origin),
12604 <WebMessage as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.message),
12605 ),
12606 encoder, offset, _depth
12607 )
12608 }
12609 }
12610 unsafe impl<
12611 T0: fidl::encoding::Encode<
12612 fidl::encoding::BoundedString<65536>,
12613 fidl::encoding::DefaultFuchsiaResourceDialect,
12614 >,
12615 T1: fidl::encoding::Encode<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>,
12616 >
12617 fidl::encoding::Encode<
12618 FramePostMessageRequest,
12619 fidl::encoding::DefaultFuchsiaResourceDialect,
12620 > for (T0, T1)
12621 {
12622 #[inline]
12623 unsafe fn encode(
12624 self,
12625 encoder: &mut fidl::encoding::Encoder<
12626 '_,
12627 fidl::encoding::DefaultFuchsiaResourceDialect,
12628 >,
12629 offset: usize,
12630 depth: fidl::encoding::Depth,
12631 ) -> fidl::Result<()> {
12632 encoder.debug_check_bounds::<FramePostMessageRequest>(offset);
12633 self.0.encode(encoder, offset + 0, depth)?;
12637 self.1.encode(encoder, offset + 16, depth)?;
12638 Ok(())
12639 }
12640 }
12641
12642 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12643 for FramePostMessageRequest
12644 {
12645 #[inline(always)]
12646 fn new_empty() -> Self {
12647 Self {
12648 target_origin: fidl::new_empty!(
12649 fidl::encoding::BoundedString<65536>,
12650 fidl::encoding::DefaultFuchsiaResourceDialect
12651 ),
12652 message: fidl::new_empty!(
12653 WebMessage,
12654 fidl::encoding::DefaultFuchsiaResourceDialect
12655 ),
12656 }
12657 }
12658
12659 #[inline]
12660 unsafe fn decode(
12661 &mut self,
12662 decoder: &mut fidl::encoding::Decoder<
12663 '_,
12664 fidl::encoding::DefaultFuchsiaResourceDialect,
12665 >,
12666 offset: usize,
12667 _depth: fidl::encoding::Depth,
12668 ) -> fidl::Result<()> {
12669 decoder.debug_check_bounds::<Self>(offset);
12670 fidl::decode!(
12672 fidl::encoding::BoundedString<65536>,
12673 fidl::encoding::DefaultFuchsiaResourceDialect,
12674 &mut self.target_origin,
12675 decoder,
12676 offset + 0,
12677 _depth
12678 )?;
12679 fidl::decode!(
12680 WebMessage,
12681 fidl::encoding::DefaultFuchsiaResourceDialect,
12682 &mut self.message,
12683 decoder,
12684 offset + 16,
12685 _depth
12686 )?;
12687 Ok(())
12688 }
12689 }
12690
12691 impl fidl::encoding::ResourceTypeMarker for FrameSetConsoleLogSinkRequest {
12692 type Borrowed<'a> = &'a mut Self;
12693 fn take_or_borrow<'a>(
12694 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12695 ) -> Self::Borrowed<'a> {
12696 value
12697 }
12698 }
12699
12700 unsafe impl fidl::encoding::TypeMarker for FrameSetConsoleLogSinkRequest {
12701 type Owned = Self;
12702
12703 #[inline(always)]
12704 fn inline_align(_context: fidl::encoding::Context) -> usize {
12705 4
12706 }
12707
12708 #[inline(always)]
12709 fn inline_size(_context: fidl::encoding::Context) -> usize {
12710 4
12711 }
12712 }
12713
12714 unsafe impl
12715 fidl::encoding::Encode<
12716 FrameSetConsoleLogSinkRequest,
12717 fidl::encoding::DefaultFuchsiaResourceDialect,
12718 > for &mut FrameSetConsoleLogSinkRequest
12719 {
12720 #[inline]
12721 unsafe fn encode(
12722 self,
12723 encoder: &mut fidl::encoding::Encoder<
12724 '_,
12725 fidl::encoding::DefaultFuchsiaResourceDialect,
12726 >,
12727 offset: usize,
12728 _depth: fidl::encoding::Depth,
12729 ) -> fidl::Result<()> {
12730 encoder.debug_check_bounds::<FrameSetConsoleLogSinkRequest>(offset);
12731 fidl::encoding::Encode::<
12733 FrameSetConsoleLogSinkRequest,
12734 fidl::encoding::DefaultFuchsiaResourceDialect,
12735 >::encode(
12736 (<fidl::encoding::Optional<
12737 fidl::encoding::Endpoint<
12738 fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>,
12739 >,
12740 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12741 &mut self.sink
12742 ),),
12743 encoder,
12744 offset,
12745 _depth,
12746 )
12747 }
12748 }
12749 unsafe impl<
12750 T0: fidl::encoding::Encode<
12751 fidl::encoding::Optional<
12752 fidl::encoding::Endpoint<
12753 fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>,
12754 >,
12755 >,
12756 fidl::encoding::DefaultFuchsiaResourceDialect,
12757 >,
12758 >
12759 fidl::encoding::Encode<
12760 FrameSetConsoleLogSinkRequest,
12761 fidl::encoding::DefaultFuchsiaResourceDialect,
12762 > for (T0,)
12763 {
12764 #[inline]
12765 unsafe fn encode(
12766 self,
12767 encoder: &mut fidl::encoding::Encoder<
12768 '_,
12769 fidl::encoding::DefaultFuchsiaResourceDialect,
12770 >,
12771 offset: usize,
12772 depth: fidl::encoding::Depth,
12773 ) -> fidl::Result<()> {
12774 encoder.debug_check_bounds::<FrameSetConsoleLogSinkRequest>(offset);
12775 self.0.encode(encoder, offset + 0, depth)?;
12779 Ok(())
12780 }
12781 }
12782
12783 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12784 for FrameSetConsoleLogSinkRequest
12785 {
12786 #[inline(always)]
12787 fn new_empty() -> Self {
12788 Self {
12789 sink: fidl::new_empty!(
12790 fidl::encoding::Optional<
12791 fidl::encoding::Endpoint<
12792 fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>,
12793 >,
12794 >,
12795 fidl::encoding::DefaultFuchsiaResourceDialect
12796 ),
12797 }
12798 }
12799
12800 #[inline]
12801 unsafe fn decode(
12802 &mut self,
12803 decoder: &mut fidl::encoding::Decoder<
12804 '_,
12805 fidl::encoding::DefaultFuchsiaResourceDialect,
12806 >,
12807 offset: usize,
12808 _depth: fidl::encoding::Depth,
12809 ) -> fidl::Result<()> {
12810 decoder.debug_check_bounds::<Self>(offset);
12811 fidl::decode!(
12813 fidl::encoding::Optional<
12814 fidl::encoding::Endpoint<
12815 fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>,
12816 >,
12817 >,
12818 fidl::encoding::DefaultFuchsiaResourceDialect,
12819 &mut self.sink,
12820 decoder,
12821 offset + 0,
12822 _depth
12823 )?;
12824 Ok(())
12825 }
12826 }
12827
12828 impl fidl::encoding::ResourceTypeMarker for FrameSetNavigationEventListener2Request {
12829 type Borrowed<'a> = &'a mut Self;
12830 fn take_or_borrow<'a>(
12831 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12832 ) -> Self::Borrowed<'a> {
12833 value
12834 }
12835 }
12836
12837 unsafe impl fidl::encoding::TypeMarker for FrameSetNavigationEventListener2Request {
12838 type Owned = Self;
12839
12840 #[inline(always)]
12841 fn inline_align(_context: fidl::encoding::Context) -> usize {
12842 8
12843 }
12844
12845 #[inline(always)]
12846 fn inline_size(_context: fidl::encoding::Context) -> usize {
12847 16
12848 }
12849 }
12850
12851 unsafe impl
12852 fidl::encoding::Encode<
12853 FrameSetNavigationEventListener2Request,
12854 fidl::encoding::DefaultFuchsiaResourceDialect,
12855 > for &mut FrameSetNavigationEventListener2Request
12856 {
12857 #[inline]
12858 unsafe fn encode(
12859 self,
12860 encoder: &mut fidl::encoding::Encoder<
12861 '_,
12862 fidl::encoding::DefaultFuchsiaResourceDialect,
12863 >,
12864 offset: usize,
12865 _depth: fidl::encoding::Depth,
12866 ) -> fidl::Result<()> {
12867 encoder.debug_check_bounds::<FrameSetNavigationEventListener2Request>(offset);
12868 fidl::encoding::Encode::<
12870 FrameSetNavigationEventListener2Request,
12871 fidl::encoding::DefaultFuchsiaResourceDialect,
12872 >::encode(
12873 (
12874 <fidl::encoding::Optional<
12875 fidl::encoding::Endpoint<
12876 fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
12877 >,
12878 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12879 &mut self.listener
12880 ),
12881 <NavigationEventListenerFlags as fidl::encoding::ValueTypeMarker>::borrow(
12882 &self.flags,
12883 ),
12884 ),
12885 encoder,
12886 offset,
12887 _depth,
12888 )
12889 }
12890 }
12891 unsafe impl<
12892 T0: fidl::encoding::Encode<
12893 fidl::encoding::Optional<
12894 fidl::encoding::Endpoint<
12895 fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
12896 >,
12897 >,
12898 fidl::encoding::DefaultFuchsiaResourceDialect,
12899 >,
12900 T1: fidl::encoding::Encode<
12901 NavigationEventListenerFlags,
12902 fidl::encoding::DefaultFuchsiaResourceDialect,
12903 >,
12904 >
12905 fidl::encoding::Encode<
12906 FrameSetNavigationEventListener2Request,
12907 fidl::encoding::DefaultFuchsiaResourceDialect,
12908 > for (T0, T1)
12909 {
12910 #[inline]
12911 unsafe fn encode(
12912 self,
12913 encoder: &mut fidl::encoding::Encoder<
12914 '_,
12915 fidl::encoding::DefaultFuchsiaResourceDialect,
12916 >,
12917 offset: usize,
12918 depth: fidl::encoding::Depth,
12919 ) -> fidl::Result<()> {
12920 encoder.debug_check_bounds::<FrameSetNavigationEventListener2Request>(offset);
12921 unsafe {
12924 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12925 (ptr as *mut u64).write_unaligned(0);
12926 }
12927 self.0.encode(encoder, offset + 0, depth)?;
12929 self.1.encode(encoder, offset + 8, depth)?;
12930 Ok(())
12931 }
12932 }
12933
12934 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12935 for FrameSetNavigationEventListener2Request
12936 {
12937 #[inline(always)]
12938 fn new_empty() -> Self {
12939 Self {
12940 listener: fidl::new_empty!(
12941 fidl::encoding::Optional<
12942 fidl::encoding::Endpoint<
12943 fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
12944 >,
12945 >,
12946 fidl::encoding::DefaultFuchsiaResourceDialect
12947 ),
12948 flags: fidl::new_empty!(
12949 NavigationEventListenerFlags,
12950 fidl::encoding::DefaultFuchsiaResourceDialect
12951 ),
12952 }
12953 }
12954
12955 #[inline]
12956 unsafe fn decode(
12957 &mut self,
12958 decoder: &mut fidl::encoding::Decoder<
12959 '_,
12960 fidl::encoding::DefaultFuchsiaResourceDialect,
12961 >,
12962 offset: usize,
12963 _depth: fidl::encoding::Depth,
12964 ) -> fidl::Result<()> {
12965 decoder.debug_check_bounds::<Self>(offset);
12966 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12968 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12969 let mask = 0xffffffff00000000u64;
12970 let maskedval = padval & mask;
12971 if maskedval != 0 {
12972 return Err(fidl::Error::NonZeroPadding {
12973 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12974 });
12975 }
12976 fidl::decode!(
12977 fidl::encoding::Optional<
12978 fidl::encoding::Endpoint<
12979 fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
12980 >,
12981 >,
12982 fidl::encoding::DefaultFuchsiaResourceDialect,
12983 &mut self.listener,
12984 decoder,
12985 offset + 0,
12986 _depth
12987 )?;
12988 fidl::decode!(
12989 NavigationEventListenerFlags,
12990 fidl::encoding::DefaultFuchsiaResourceDialect,
12991 &mut self.flags,
12992 decoder,
12993 offset + 8,
12994 _depth
12995 )?;
12996 Ok(())
12997 }
12998 }
12999
13000 impl fidl::encoding::ResourceTypeMarker for FrameSetNavigationEventListenerRequest {
13001 type Borrowed<'a> = &'a mut Self;
13002 fn take_or_borrow<'a>(
13003 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13004 ) -> Self::Borrowed<'a> {
13005 value
13006 }
13007 }
13008
13009 unsafe impl fidl::encoding::TypeMarker for FrameSetNavigationEventListenerRequest {
13010 type Owned = Self;
13011
13012 #[inline(always)]
13013 fn inline_align(_context: fidl::encoding::Context) -> usize {
13014 4
13015 }
13016
13017 #[inline(always)]
13018 fn inline_size(_context: fidl::encoding::Context) -> usize {
13019 4
13020 }
13021 }
13022
13023 unsafe impl
13024 fidl::encoding::Encode<
13025 FrameSetNavigationEventListenerRequest,
13026 fidl::encoding::DefaultFuchsiaResourceDialect,
13027 > for &mut FrameSetNavigationEventListenerRequest
13028 {
13029 #[inline]
13030 unsafe fn encode(
13031 self,
13032 encoder: &mut fidl::encoding::Encoder<
13033 '_,
13034 fidl::encoding::DefaultFuchsiaResourceDialect,
13035 >,
13036 offset: usize,
13037 _depth: fidl::encoding::Depth,
13038 ) -> fidl::Result<()> {
13039 encoder.debug_check_bounds::<FrameSetNavigationEventListenerRequest>(offset);
13040 fidl::encoding::Encode::<
13042 FrameSetNavigationEventListenerRequest,
13043 fidl::encoding::DefaultFuchsiaResourceDialect,
13044 >::encode(
13045 (<fidl::encoding::Optional<
13046 fidl::encoding::Endpoint<
13047 fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13048 >,
13049 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13050 &mut self.listener
13051 ),),
13052 encoder,
13053 offset,
13054 _depth,
13055 )
13056 }
13057 }
13058 unsafe impl<
13059 T0: fidl::encoding::Encode<
13060 fidl::encoding::Optional<
13061 fidl::encoding::Endpoint<
13062 fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13063 >,
13064 >,
13065 fidl::encoding::DefaultFuchsiaResourceDialect,
13066 >,
13067 >
13068 fidl::encoding::Encode<
13069 FrameSetNavigationEventListenerRequest,
13070 fidl::encoding::DefaultFuchsiaResourceDialect,
13071 > for (T0,)
13072 {
13073 #[inline]
13074 unsafe fn encode(
13075 self,
13076 encoder: &mut fidl::encoding::Encoder<
13077 '_,
13078 fidl::encoding::DefaultFuchsiaResourceDialect,
13079 >,
13080 offset: usize,
13081 depth: fidl::encoding::Depth,
13082 ) -> fidl::Result<()> {
13083 encoder.debug_check_bounds::<FrameSetNavigationEventListenerRequest>(offset);
13084 self.0.encode(encoder, offset + 0, depth)?;
13088 Ok(())
13089 }
13090 }
13091
13092 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13093 for FrameSetNavigationEventListenerRequest
13094 {
13095 #[inline(always)]
13096 fn new_empty() -> Self {
13097 Self {
13098 listener: fidl::new_empty!(
13099 fidl::encoding::Optional<
13100 fidl::encoding::Endpoint<
13101 fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13102 >,
13103 >,
13104 fidl::encoding::DefaultFuchsiaResourceDialect
13105 ),
13106 }
13107 }
13108
13109 #[inline]
13110 unsafe fn decode(
13111 &mut self,
13112 decoder: &mut fidl::encoding::Decoder<
13113 '_,
13114 fidl::encoding::DefaultFuchsiaResourceDialect,
13115 >,
13116 offset: usize,
13117 _depth: fidl::encoding::Depth,
13118 ) -> fidl::Result<()> {
13119 decoder.debug_check_bounds::<Self>(offset);
13120 fidl::decode!(
13122 fidl::encoding::Optional<
13123 fidl::encoding::Endpoint<
13124 fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13125 >,
13126 >,
13127 fidl::encoding::DefaultFuchsiaResourceDialect,
13128 &mut self.listener,
13129 decoder,
13130 offset + 0,
13131 _depth
13132 )?;
13133 Ok(())
13134 }
13135 }
13136
13137 impl fidl::encoding::ResourceTypeMarker for FrameSetNavigationPolicyProviderRequest {
13138 type Borrowed<'a> = &'a mut Self;
13139 fn take_or_borrow<'a>(
13140 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13141 ) -> Self::Borrowed<'a> {
13142 value
13143 }
13144 }
13145
13146 unsafe impl fidl::encoding::TypeMarker for FrameSetNavigationPolicyProviderRequest {
13147 type Owned = Self;
13148
13149 #[inline(always)]
13150 fn inline_align(_context: fidl::encoding::Context) -> usize {
13151 8
13152 }
13153
13154 #[inline(always)]
13155 fn inline_size(_context: fidl::encoding::Context) -> usize {
13156 24
13157 }
13158 }
13159
13160 unsafe impl
13161 fidl::encoding::Encode<
13162 FrameSetNavigationPolicyProviderRequest,
13163 fidl::encoding::DefaultFuchsiaResourceDialect,
13164 > for &mut FrameSetNavigationPolicyProviderRequest
13165 {
13166 #[inline]
13167 unsafe fn encode(
13168 self,
13169 encoder: &mut fidl::encoding::Encoder<
13170 '_,
13171 fidl::encoding::DefaultFuchsiaResourceDialect,
13172 >,
13173 offset: usize,
13174 _depth: fidl::encoding::Depth,
13175 ) -> fidl::Result<()> {
13176 encoder.debug_check_bounds::<FrameSetNavigationPolicyProviderRequest>(offset);
13177 fidl::encoding::Encode::<
13179 FrameSetNavigationPolicyProviderRequest,
13180 fidl::encoding::DefaultFuchsiaResourceDialect,
13181 >::encode(
13182 (
13183 <NavigationPolicyProviderParams as fidl::encoding::ValueTypeMarker>::borrow(
13184 &self.params,
13185 ),
13186 <fidl::encoding::Endpoint<
13187 fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
13188 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13189 &mut self.provider
13190 ),
13191 ),
13192 encoder,
13193 offset,
13194 _depth,
13195 )
13196 }
13197 }
13198 unsafe impl<
13199 T0: fidl::encoding::Encode<
13200 NavigationPolicyProviderParams,
13201 fidl::encoding::DefaultFuchsiaResourceDialect,
13202 >,
13203 T1: fidl::encoding::Encode<
13204 fidl::encoding::Endpoint<
13205 fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
13206 >,
13207 fidl::encoding::DefaultFuchsiaResourceDialect,
13208 >,
13209 >
13210 fidl::encoding::Encode<
13211 FrameSetNavigationPolicyProviderRequest,
13212 fidl::encoding::DefaultFuchsiaResourceDialect,
13213 > for (T0, T1)
13214 {
13215 #[inline]
13216 unsafe fn encode(
13217 self,
13218 encoder: &mut fidl::encoding::Encoder<
13219 '_,
13220 fidl::encoding::DefaultFuchsiaResourceDialect,
13221 >,
13222 offset: usize,
13223 depth: fidl::encoding::Depth,
13224 ) -> fidl::Result<()> {
13225 encoder.debug_check_bounds::<FrameSetNavigationPolicyProviderRequest>(offset);
13226 unsafe {
13229 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
13230 (ptr as *mut u64).write_unaligned(0);
13231 }
13232 self.0.encode(encoder, offset + 0, depth)?;
13234 self.1.encode(encoder, offset + 16, depth)?;
13235 Ok(())
13236 }
13237 }
13238
13239 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13240 for FrameSetNavigationPolicyProviderRequest
13241 {
13242 #[inline(always)]
13243 fn new_empty() -> Self {
13244 Self {
13245 params: fidl::new_empty!(
13246 NavigationPolicyProviderParams,
13247 fidl::encoding::DefaultFuchsiaResourceDialect
13248 ),
13249 provider: fidl::new_empty!(
13250 fidl::encoding::Endpoint<
13251 fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
13252 >,
13253 fidl::encoding::DefaultFuchsiaResourceDialect
13254 ),
13255 }
13256 }
13257
13258 #[inline]
13259 unsafe fn decode(
13260 &mut self,
13261 decoder: &mut fidl::encoding::Decoder<
13262 '_,
13263 fidl::encoding::DefaultFuchsiaResourceDialect,
13264 >,
13265 offset: usize,
13266 _depth: fidl::encoding::Depth,
13267 ) -> fidl::Result<()> {
13268 decoder.debug_check_bounds::<Self>(offset);
13269 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
13271 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13272 let mask = 0xffffffff00000000u64;
13273 let maskedval = padval & mask;
13274 if maskedval != 0 {
13275 return Err(fidl::Error::NonZeroPadding {
13276 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
13277 });
13278 }
13279 fidl::decode!(
13280 NavigationPolicyProviderParams,
13281 fidl::encoding::DefaultFuchsiaResourceDialect,
13282 &mut self.params,
13283 decoder,
13284 offset + 0,
13285 _depth
13286 )?;
13287 fidl::decode!(
13288 fidl::encoding::Endpoint<
13289 fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
13290 >,
13291 fidl::encoding::DefaultFuchsiaResourceDialect,
13292 &mut self.provider,
13293 decoder,
13294 offset + 16,
13295 _depth
13296 )?;
13297 Ok(())
13298 }
13299 }
13300
13301 impl fidl::encoding::ResourceTypeMarker for FrameSetPopupFrameCreationListenerRequest {
13302 type Borrowed<'a> = &'a mut Self;
13303 fn take_or_borrow<'a>(
13304 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13305 ) -> Self::Borrowed<'a> {
13306 value
13307 }
13308 }
13309
13310 unsafe impl fidl::encoding::TypeMarker for FrameSetPopupFrameCreationListenerRequest {
13311 type Owned = Self;
13312
13313 #[inline(always)]
13314 fn inline_align(_context: fidl::encoding::Context) -> usize {
13315 4
13316 }
13317
13318 #[inline(always)]
13319 fn inline_size(_context: fidl::encoding::Context) -> usize {
13320 4
13321 }
13322 }
13323
13324 unsafe impl
13325 fidl::encoding::Encode<
13326 FrameSetPopupFrameCreationListenerRequest,
13327 fidl::encoding::DefaultFuchsiaResourceDialect,
13328 > for &mut FrameSetPopupFrameCreationListenerRequest
13329 {
13330 #[inline]
13331 unsafe fn encode(
13332 self,
13333 encoder: &mut fidl::encoding::Encoder<
13334 '_,
13335 fidl::encoding::DefaultFuchsiaResourceDialect,
13336 >,
13337 offset: usize,
13338 _depth: fidl::encoding::Depth,
13339 ) -> fidl::Result<()> {
13340 encoder.debug_check_bounds::<FrameSetPopupFrameCreationListenerRequest>(offset);
13341 fidl::encoding::Encode::<
13343 FrameSetPopupFrameCreationListenerRequest,
13344 fidl::encoding::DefaultFuchsiaResourceDialect,
13345 >::encode(
13346 (<fidl::encoding::Optional<
13347 fidl::encoding::Endpoint<
13348 fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>,
13349 >,
13350 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13351 &mut self.listener
13352 ),),
13353 encoder,
13354 offset,
13355 _depth,
13356 )
13357 }
13358 }
13359 unsafe impl<
13360 T0: fidl::encoding::Encode<
13361 fidl::encoding::Optional<
13362 fidl::encoding::Endpoint<
13363 fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>,
13364 >,
13365 >,
13366 fidl::encoding::DefaultFuchsiaResourceDialect,
13367 >,
13368 >
13369 fidl::encoding::Encode<
13370 FrameSetPopupFrameCreationListenerRequest,
13371 fidl::encoding::DefaultFuchsiaResourceDialect,
13372 > for (T0,)
13373 {
13374 #[inline]
13375 unsafe fn encode(
13376 self,
13377 encoder: &mut fidl::encoding::Encoder<
13378 '_,
13379 fidl::encoding::DefaultFuchsiaResourceDialect,
13380 >,
13381 offset: usize,
13382 depth: fidl::encoding::Depth,
13383 ) -> fidl::Result<()> {
13384 encoder.debug_check_bounds::<FrameSetPopupFrameCreationListenerRequest>(offset);
13385 self.0.encode(encoder, offset + 0, depth)?;
13389 Ok(())
13390 }
13391 }
13392
13393 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13394 for FrameSetPopupFrameCreationListenerRequest
13395 {
13396 #[inline(always)]
13397 fn new_empty() -> Self {
13398 Self {
13399 listener: fidl::new_empty!(
13400 fidl::encoding::Optional<
13401 fidl::encoding::Endpoint<
13402 fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>,
13403 >,
13404 >,
13405 fidl::encoding::DefaultFuchsiaResourceDialect
13406 ),
13407 }
13408 }
13409
13410 #[inline]
13411 unsafe fn decode(
13412 &mut self,
13413 decoder: &mut fidl::encoding::Decoder<
13414 '_,
13415 fidl::encoding::DefaultFuchsiaResourceDialect,
13416 >,
13417 offset: usize,
13418 _depth: fidl::encoding::Depth,
13419 ) -> fidl::Result<()> {
13420 decoder.debug_check_bounds::<Self>(offset);
13421 fidl::decode!(
13423 fidl::encoding::Optional<
13424 fidl::encoding::Endpoint<
13425 fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>,
13426 >,
13427 >,
13428 fidl::encoding::DefaultFuchsiaResourceDialect,
13429 &mut self.listener,
13430 decoder,
13431 offset + 0,
13432 _depth
13433 )?;
13434 Ok(())
13435 }
13436 }
13437
13438 impl fidl::encoding::ResourceTypeMarker for FrameExecuteJavaScriptResponse {
13439 type Borrowed<'a> = &'a mut Self;
13440 fn take_or_borrow<'a>(
13441 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13442 ) -> Self::Borrowed<'a> {
13443 value
13444 }
13445 }
13446
13447 unsafe impl fidl::encoding::TypeMarker for FrameExecuteJavaScriptResponse {
13448 type Owned = Self;
13449
13450 #[inline(always)]
13451 fn inline_align(_context: fidl::encoding::Context) -> usize {
13452 8
13453 }
13454
13455 #[inline(always)]
13456 fn inline_size(_context: fidl::encoding::Context) -> usize {
13457 16
13458 }
13459 }
13460
13461 unsafe impl
13462 fidl::encoding::Encode<
13463 FrameExecuteJavaScriptResponse,
13464 fidl::encoding::DefaultFuchsiaResourceDialect,
13465 > for &mut FrameExecuteJavaScriptResponse
13466 {
13467 #[inline]
13468 unsafe fn encode(
13469 self,
13470 encoder: &mut fidl::encoding::Encoder<
13471 '_,
13472 fidl::encoding::DefaultFuchsiaResourceDialect,
13473 >,
13474 offset: usize,
13475 _depth: fidl::encoding::Depth,
13476 ) -> fidl::Result<()> {
13477 encoder.debug_check_bounds::<FrameExecuteJavaScriptResponse>(offset);
13478 fidl::encoding::Encode::<
13480 FrameExecuteJavaScriptResponse,
13481 fidl::encoding::DefaultFuchsiaResourceDialect,
13482 >::encode(
13483 (<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13484 &mut self.result,
13485 ),),
13486 encoder,
13487 offset,
13488 _depth,
13489 )
13490 }
13491 }
13492 unsafe impl<
13493 T0: fidl::encoding::Encode<
13494 fidl_fuchsia_mem::Buffer,
13495 fidl::encoding::DefaultFuchsiaResourceDialect,
13496 >,
13497 >
13498 fidl::encoding::Encode<
13499 FrameExecuteJavaScriptResponse,
13500 fidl::encoding::DefaultFuchsiaResourceDialect,
13501 > for (T0,)
13502 {
13503 #[inline]
13504 unsafe fn encode(
13505 self,
13506 encoder: &mut fidl::encoding::Encoder<
13507 '_,
13508 fidl::encoding::DefaultFuchsiaResourceDialect,
13509 >,
13510 offset: usize,
13511 depth: fidl::encoding::Depth,
13512 ) -> fidl::Result<()> {
13513 encoder.debug_check_bounds::<FrameExecuteJavaScriptResponse>(offset);
13514 self.0.encode(encoder, offset + 0, depth)?;
13518 Ok(())
13519 }
13520 }
13521
13522 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13523 for FrameExecuteJavaScriptResponse
13524 {
13525 #[inline(always)]
13526 fn new_empty() -> Self {
13527 Self {
13528 result: fidl::new_empty!(
13529 fidl_fuchsia_mem::Buffer,
13530 fidl::encoding::DefaultFuchsiaResourceDialect
13531 ),
13532 }
13533 }
13534
13535 #[inline]
13536 unsafe fn decode(
13537 &mut self,
13538 decoder: &mut fidl::encoding::Decoder<
13539 '_,
13540 fidl::encoding::DefaultFuchsiaResourceDialect,
13541 >,
13542 offset: usize,
13543 _depth: fidl::encoding::Depth,
13544 ) -> fidl::Result<()> {
13545 decoder.debug_check_bounds::<Self>(offset);
13546 fidl::decode!(
13548 fidl_fuchsia_mem::Buffer,
13549 fidl::encoding::DefaultFuchsiaResourceDialect,
13550 &mut self.result,
13551 decoder,
13552 offset + 0,
13553 _depth
13554 )?;
13555 Ok(())
13556 }
13557 }
13558
13559 impl fidl::encoding::ResourceTypeMarker for MessagePortPostMessageRequest {
13560 type Borrowed<'a> = &'a mut Self;
13561 fn take_or_borrow<'a>(
13562 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13563 ) -> Self::Borrowed<'a> {
13564 value
13565 }
13566 }
13567
13568 unsafe impl fidl::encoding::TypeMarker for MessagePortPostMessageRequest {
13569 type Owned = Self;
13570
13571 #[inline(always)]
13572 fn inline_align(_context: fidl::encoding::Context) -> usize {
13573 8
13574 }
13575
13576 #[inline(always)]
13577 fn inline_size(_context: fidl::encoding::Context) -> usize {
13578 16
13579 }
13580 }
13581
13582 unsafe impl
13583 fidl::encoding::Encode<
13584 MessagePortPostMessageRequest,
13585 fidl::encoding::DefaultFuchsiaResourceDialect,
13586 > for &mut MessagePortPostMessageRequest
13587 {
13588 #[inline]
13589 unsafe fn encode(
13590 self,
13591 encoder: &mut fidl::encoding::Encoder<
13592 '_,
13593 fidl::encoding::DefaultFuchsiaResourceDialect,
13594 >,
13595 offset: usize,
13596 _depth: fidl::encoding::Depth,
13597 ) -> fidl::Result<()> {
13598 encoder.debug_check_bounds::<MessagePortPostMessageRequest>(offset);
13599 fidl::encoding::Encode::<
13601 MessagePortPostMessageRequest,
13602 fidl::encoding::DefaultFuchsiaResourceDialect,
13603 >::encode(
13604 (<WebMessage as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13605 &mut self.message,
13606 ),),
13607 encoder,
13608 offset,
13609 _depth,
13610 )
13611 }
13612 }
13613 unsafe impl<T0: fidl::encoding::Encode<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>>
13614 fidl::encoding::Encode<
13615 MessagePortPostMessageRequest,
13616 fidl::encoding::DefaultFuchsiaResourceDialect,
13617 > for (T0,)
13618 {
13619 #[inline]
13620 unsafe fn encode(
13621 self,
13622 encoder: &mut fidl::encoding::Encoder<
13623 '_,
13624 fidl::encoding::DefaultFuchsiaResourceDialect,
13625 >,
13626 offset: usize,
13627 depth: fidl::encoding::Depth,
13628 ) -> fidl::Result<()> {
13629 encoder.debug_check_bounds::<MessagePortPostMessageRequest>(offset);
13630 self.0.encode(encoder, offset + 0, depth)?;
13634 Ok(())
13635 }
13636 }
13637
13638 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13639 for MessagePortPostMessageRequest
13640 {
13641 #[inline(always)]
13642 fn new_empty() -> Self {
13643 Self {
13644 message: fidl::new_empty!(
13645 WebMessage,
13646 fidl::encoding::DefaultFuchsiaResourceDialect
13647 ),
13648 }
13649 }
13650
13651 #[inline]
13652 unsafe fn decode(
13653 &mut self,
13654 decoder: &mut fidl::encoding::Decoder<
13655 '_,
13656 fidl::encoding::DefaultFuchsiaResourceDialect,
13657 >,
13658 offset: usize,
13659 _depth: fidl::encoding::Depth,
13660 ) -> fidl::Result<()> {
13661 decoder.debug_check_bounds::<Self>(offset);
13662 fidl::decode!(
13664 WebMessage,
13665 fidl::encoding::DefaultFuchsiaResourceDialect,
13666 &mut self.message,
13667 decoder,
13668 offset + 0,
13669 _depth
13670 )?;
13671 Ok(())
13672 }
13673 }
13674
13675 impl fidl::encoding::ResourceTypeMarker for MessagePortReceiveMessageResponse {
13676 type Borrowed<'a> = &'a mut Self;
13677 fn take_or_borrow<'a>(
13678 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13679 ) -> Self::Borrowed<'a> {
13680 value
13681 }
13682 }
13683
13684 unsafe impl fidl::encoding::TypeMarker for MessagePortReceiveMessageResponse {
13685 type Owned = Self;
13686
13687 #[inline(always)]
13688 fn inline_align(_context: fidl::encoding::Context) -> usize {
13689 8
13690 }
13691
13692 #[inline(always)]
13693 fn inline_size(_context: fidl::encoding::Context) -> usize {
13694 16
13695 }
13696 }
13697
13698 unsafe impl
13699 fidl::encoding::Encode<
13700 MessagePortReceiveMessageResponse,
13701 fidl::encoding::DefaultFuchsiaResourceDialect,
13702 > for &mut MessagePortReceiveMessageResponse
13703 {
13704 #[inline]
13705 unsafe fn encode(
13706 self,
13707 encoder: &mut fidl::encoding::Encoder<
13708 '_,
13709 fidl::encoding::DefaultFuchsiaResourceDialect,
13710 >,
13711 offset: usize,
13712 _depth: fidl::encoding::Depth,
13713 ) -> fidl::Result<()> {
13714 encoder.debug_check_bounds::<MessagePortReceiveMessageResponse>(offset);
13715 fidl::encoding::Encode::<
13717 MessagePortReceiveMessageResponse,
13718 fidl::encoding::DefaultFuchsiaResourceDialect,
13719 >::encode(
13720 (<WebMessage as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13721 &mut self.message,
13722 ),),
13723 encoder,
13724 offset,
13725 _depth,
13726 )
13727 }
13728 }
13729 unsafe impl<T0: fidl::encoding::Encode<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>>
13730 fidl::encoding::Encode<
13731 MessagePortReceiveMessageResponse,
13732 fidl::encoding::DefaultFuchsiaResourceDialect,
13733 > for (T0,)
13734 {
13735 #[inline]
13736 unsafe fn encode(
13737 self,
13738 encoder: &mut fidl::encoding::Encoder<
13739 '_,
13740 fidl::encoding::DefaultFuchsiaResourceDialect,
13741 >,
13742 offset: usize,
13743 depth: fidl::encoding::Depth,
13744 ) -> fidl::Result<()> {
13745 encoder.debug_check_bounds::<MessagePortReceiveMessageResponse>(offset);
13746 self.0.encode(encoder, offset + 0, depth)?;
13750 Ok(())
13751 }
13752 }
13753
13754 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13755 for MessagePortReceiveMessageResponse
13756 {
13757 #[inline(always)]
13758 fn new_empty() -> Self {
13759 Self {
13760 message: fidl::new_empty!(
13761 WebMessage,
13762 fidl::encoding::DefaultFuchsiaResourceDialect
13763 ),
13764 }
13765 }
13766
13767 #[inline]
13768 unsafe fn decode(
13769 &mut self,
13770 decoder: &mut fidl::encoding::Decoder<
13771 '_,
13772 fidl::encoding::DefaultFuchsiaResourceDialect,
13773 >,
13774 offset: usize,
13775 _depth: fidl::encoding::Depth,
13776 ) -> fidl::Result<()> {
13777 decoder.debug_check_bounds::<Self>(offset);
13778 fidl::decode!(
13780 WebMessage,
13781 fidl::encoding::DefaultFuchsiaResourceDialect,
13782 &mut self.message,
13783 decoder,
13784 offset + 0,
13785 _depth
13786 )?;
13787 Ok(())
13788 }
13789 }
13790
13791 impl fidl::encoding::ResourceTypeMarker for NavigationControllerLoadUrlRequest {
13792 type Borrowed<'a> = &'a mut Self;
13793 fn take_or_borrow<'a>(
13794 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13795 ) -> Self::Borrowed<'a> {
13796 value
13797 }
13798 }
13799
13800 unsafe impl fidl::encoding::TypeMarker for NavigationControllerLoadUrlRequest {
13801 type Owned = Self;
13802
13803 #[inline(always)]
13804 fn inline_align(_context: fidl::encoding::Context) -> usize {
13805 8
13806 }
13807
13808 #[inline(always)]
13809 fn inline_size(_context: fidl::encoding::Context) -> usize {
13810 32
13811 }
13812 }
13813
13814 unsafe impl
13815 fidl::encoding::Encode<
13816 NavigationControllerLoadUrlRequest,
13817 fidl::encoding::DefaultFuchsiaResourceDialect,
13818 > for &mut NavigationControllerLoadUrlRequest
13819 {
13820 #[inline]
13821 unsafe fn encode(
13822 self,
13823 encoder: &mut fidl::encoding::Encoder<
13824 '_,
13825 fidl::encoding::DefaultFuchsiaResourceDialect,
13826 >,
13827 offset: usize,
13828 _depth: fidl::encoding::Depth,
13829 ) -> fidl::Result<()> {
13830 encoder.debug_check_bounds::<NavigationControllerLoadUrlRequest>(offset);
13831 fidl::encoding::Encode::<NavigationControllerLoadUrlRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13833 (
13834 <fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
13835 <LoadUrlParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.params),
13836 ),
13837 encoder, offset, _depth
13838 )
13839 }
13840 }
13841 unsafe impl<
13842 T0: fidl::encoding::Encode<
13843 fidl::encoding::BoundedString<65536>,
13844 fidl::encoding::DefaultFuchsiaResourceDialect,
13845 >,
13846 T1: fidl::encoding::Encode<LoadUrlParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
13847 >
13848 fidl::encoding::Encode<
13849 NavigationControllerLoadUrlRequest,
13850 fidl::encoding::DefaultFuchsiaResourceDialect,
13851 > for (T0, T1)
13852 {
13853 #[inline]
13854 unsafe fn encode(
13855 self,
13856 encoder: &mut fidl::encoding::Encoder<
13857 '_,
13858 fidl::encoding::DefaultFuchsiaResourceDialect,
13859 >,
13860 offset: usize,
13861 depth: fidl::encoding::Depth,
13862 ) -> fidl::Result<()> {
13863 encoder.debug_check_bounds::<NavigationControllerLoadUrlRequest>(offset);
13864 self.0.encode(encoder, offset + 0, depth)?;
13868 self.1.encode(encoder, offset + 16, depth)?;
13869 Ok(())
13870 }
13871 }
13872
13873 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13874 for NavigationControllerLoadUrlRequest
13875 {
13876 #[inline(always)]
13877 fn new_empty() -> Self {
13878 Self {
13879 url: fidl::new_empty!(
13880 fidl::encoding::BoundedString<65536>,
13881 fidl::encoding::DefaultFuchsiaResourceDialect
13882 ),
13883 params: fidl::new_empty!(
13884 LoadUrlParams,
13885 fidl::encoding::DefaultFuchsiaResourceDialect
13886 ),
13887 }
13888 }
13889
13890 #[inline]
13891 unsafe fn decode(
13892 &mut self,
13893 decoder: &mut fidl::encoding::Decoder<
13894 '_,
13895 fidl::encoding::DefaultFuchsiaResourceDialect,
13896 >,
13897 offset: usize,
13898 _depth: fidl::encoding::Depth,
13899 ) -> fidl::Result<()> {
13900 decoder.debug_check_bounds::<Self>(offset);
13901 fidl::decode!(
13903 fidl::encoding::BoundedString<65536>,
13904 fidl::encoding::DefaultFuchsiaResourceDialect,
13905 &mut self.url,
13906 decoder,
13907 offset + 0,
13908 _depth
13909 )?;
13910 fidl::decode!(
13911 LoadUrlParams,
13912 fidl::encoding::DefaultFuchsiaResourceDialect,
13913 &mut self.params,
13914 decoder,
13915 offset + 16,
13916 _depth
13917 )?;
13918 Ok(())
13919 }
13920 }
13921
13922 impl fidl::encoding::ResourceTypeMarker for NavigationEventListenerOnNavigationStateChangedRequest {
13923 type Borrowed<'a> = &'a mut Self;
13924 fn take_or_borrow<'a>(
13925 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13926 ) -> Self::Borrowed<'a> {
13927 value
13928 }
13929 }
13930
13931 unsafe impl fidl::encoding::TypeMarker for NavigationEventListenerOnNavigationStateChangedRequest {
13932 type Owned = Self;
13933
13934 #[inline(always)]
13935 fn inline_align(_context: fidl::encoding::Context) -> usize {
13936 8
13937 }
13938
13939 #[inline(always)]
13940 fn inline_size(_context: fidl::encoding::Context) -> usize {
13941 16
13942 }
13943 }
13944
13945 unsafe impl
13946 fidl::encoding::Encode<
13947 NavigationEventListenerOnNavigationStateChangedRequest,
13948 fidl::encoding::DefaultFuchsiaResourceDialect,
13949 > for &mut NavigationEventListenerOnNavigationStateChangedRequest
13950 {
13951 #[inline]
13952 unsafe fn encode(
13953 self,
13954 encoder: &mut fidl::encoding::Encoder<
13955 '_,
13956 fidl::encoding::DefaultFuchsiaResourceDialect,
13957 >,
13958 offset: usize,
13959 _depth: fidl::encoding::Depth,
13960 ) -> fidl::Result<()> {
13961 encoder.debug_check_bounds::<NavigationEventListenerOnNavigationStateChangedRequest>(
13962 offset,
13963 );
13964 fidl::encoding::Encode::<
13966 NavigationEventListenerOnNavigationStateChangedRequest,
13967 fidl::encoding::DefaultFuchsiaResourceDialect,
13968 >::encode(
13969 (<NavigationState as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13970 &mut self.change,
13971 ),),
13972 encoder,
13973 offset,
13974 _depth,
13975 )
13976 }
13977 }
13978 unsafe impl<
13979 T0: fidl::encoding::Encode<NavigationState, fidl::encoding::DefaultFuchsiaResourceDialect>,
13980 >
13981 fidl::encoding::Encode<
13982 NavigationEventListenerOnNavigationStateChangedRequest,
13983 fidl::encoding::DefaultFuchsiaResourceDialect,
13984 > for (T0,)
13985 {
13986 #[inline]
13987 unsafe fn encode(
13988 self,
13989 encoder: &mut fidl::encoding::Encoder<
13990 '_,
13991 fidl::encoding::DefaultFuchsiaResourceDialect,
13992 >,
13993 offset: usize,
13994 depth: fidl::encoding::Depth,
13995 ) -> fidl::Result<()> {
13996 encoder.debug_check_bounds::<NavigationEventListenerOnNavigationStateChangedRequest>(
13997 offset,
13998 );
13999 self.0.encode(encoder, offset + 0, depth)?;
14003 Ok(())
14004 }
14005 }
14006
14007 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14008 for NavigationEventListenerOnNavigationStateChangedRequest
14009 {
14010 #[inline(always)]
14011 fn new_empty() -> Self {
14012 Self {
14013 change: fidl::new_empty!(
14014 NavigationState,
14015 fidl::encoding::DefaultFuchsiaResourceDialect
14016 ),
14017 }
14018 }
14019
14020 #[inline]
14021 unsafe fn decode(
14022 &mut self,
14023 decoder: &mut fidl::encoding::Decoder<
14024 '_,
14025 fidl::encoding::DefaultFuchsiaResourceDialect,
14026 >,
14027 offset: usize,
14028 _depth: fidl::encoding::Depth,
14029 ) -> fidl::Result<()> {
14030 decoder.debug_check_bounds::<Self>(offset);
14031 fidl::decode!(
14033 NavigationState,
14034 fidl::encoding::DefaultFuchsiaResourceDialect,
14035 &mut self.change,
14036 decoder,
14037 offset + 0,
14038 _depth
14039 )?;
14040 Ok(())
14041 }
14042 }
14043
14044 impl fidl::encoding::ResourceTypeMarker
14045 for NavigationPolicyProviderEvaluateRequestedNavigationResponse
14046 {
14047 type Borrowed<'a> = &'a mut Self;
14048 fn take_or_borrow<'a>(
14049 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14050 ) -> Self::Borrowed<'a> {
14051 value
14052 }
14053 }
14054
14055 unsafe impl fidl::encoding::TypeMarker
14056 for NavigationPolicyProviderEvaluateRequestedNavigationResponse
14057 {
14058 type Owned = Self;
14059
14060 #[inline(always)]
14061 fn inline_align(_context: fidl::encoding::Context) -> usize {
14062 8
14063 }
14064
14065 #[inline(always)]
14066 fn inline_size(_context: fidl::encoding::Context) -> usize {
14067 16
14068 }
14069 }
14070
14071 unsafe impl
14072 fidl::encoding::Encode<
14073 NavigationPolicyProviderEvaluateRequestedNavigationResponse,
14074 fidl::encoding::DefaultFuchsiaResourceDialect,
14075 > for &mut NavigationPolicyProviderEvaluateRequestedNavigationResponse
14076 {
14077 #[inline]
14078 unsafe fn encode(
14079 self,
14080 encoder: &mut fidl::encoding::Encoder<
14081 '_,
14082 fidl::encoding::DefaultFuchsiaResourceDialect,
14083 >,
14084 offset: usize,
14085 _depth: fidl::encoding::Depth,
14086 ) -> fidl::Result<()> {
14087 encoder
14088 .debug_check_bounds::<NavigationPolicyProviderEvaluateRequestedNavigationResponse>(
14089 offset,
14090 );
14091 fidl::encoding::Encode::<
14093 NavigationPolicyProviderEvaluateRequestedNavigationResponse,
14094 fidl::encoding::DefaultFuchsiaResourceDialect,
14095 >::encode(
14096 (<NavigationDecision as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14097 &mut self.decision,
14098 ),),
14099 encoder,
14100 offset,
14101 _depth,
14102 )
14103 }
14104 }
14105 unsafe impl<
14106 T0: fidl::encoding::Encode<
14107 NavigationDecision,
14108 fidl::encoding::DefaultFuchsiaResourceDialect,
14109 >,
14110 >
14111 fidl::encoding::Encode<
14112 NavigationPolicyProviderEvaluateRequestedNavigationResponse,
14113 fidl::encoding::DefaultFuchsiaResourceDialect,
14114 > for (T0,)
14115 {
14116 #[inline]
14117 unsafe fn encode(
14118 self,
14119 encoder: &mut fidl::encoding::Encoder<
14120 '_,
14121 fidl::encoding::DefaultFuchsiaResourceDialect,
14122 >,
14123 offset: usize,
14124 depth: fidl::encoding::Depth,
14125 ) -> fidl::Result<()> {
14126 encoder
14127 .debug_check_bounds::<NavigationPolicyProviderEvaluateRequestedNavigationResponse>(
14128 offset,
14129 );
14130 self.0.encode(encoder, offset + 0, depth)?;
14134 Ok(())
14135 }
14136 }
14137
14138 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14139 for NavigationPolicyProviderEvaluateRequestedNavigationResponse
14140 {
14141 #[inline(always)]
14142 fn new_empty() -> Self {
14143 Self {
14144 decision: fidl::new_empty!(
14145 NavigationDecision,
14146 fidl::encoding::DefaultFuchsiaResourceDialect
14147 ),
14148 }
14149 }
14150
14151 #[inline]
14152 unsafe fn decode(
14153 &mut self,
14154 decoder: &mut fidl::encoding::Decoder<
14155 '_,
14156 fidl::encoding::DefaultFuchsiaResourceDialect,
14157 >,
14158 offset: usize,
14159 _depth: fidl::encoding::Depth,
14160 ) -> fidl::Result<()> {
14161 decoder.debug_check_bounds::<Self>(offset);
14162 fidl::decode!(
14164 NavigationDecision,
14165 fidl::encoding::DefaultFuchsiaResourceDialect,
14166 &mut self.decision,
14167 decoder,
14168 offset + 0,
14169 _depth
14170 )?;
14171 Ok(())
14172 }
14173 }
14174
14175 impl fidl::encoding::ResourceTypeMarker for PopupFrameCreationListenerOnPopupFrameCreatedRequest {
14176 type Borrowed<'a> = &'a mut Self;
14177 fn take_or_borrow<'a>(
14178 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14179 ) -> Self::Borrowed<'a> {
14180 value
14181 }
14182 }
14183
14184 unsafe impl fidl::encoding::TypeMarker for PopupFrameCreationListenerOnPopupFrameCreatedRequest {
14185 type Owned = Self;
14186
14187 #[inline(always)]
14188 fn inline_align(_context: fidl::encoding::Context) -> usize {
14189 8
14190 }
14191
14192 #[inline(always)]
14193 fn inline_size(_context: fidl::encoding::Context) -> usize {
14194 24
14195 }
14196 }
14197
14198 unsafe impl
14199 fidl::encoding::Encode<
14200 PopupFrameCreationListenerOnPopupFrameCreatedRequest,
14201 fidl::encoding::DefaultFuchsiaResourceDialect,
14202 > for &mut PopupFrameCreationListenerOnPopupFrameCreatedRequest
14203 {
14204 #[inline]
14205 unsafe fn encode(
14206 self,
14207 encoder: &mut fidl::encoding::Encoder<
14208 '_,
14209 fidl::encoding::DefaultFuchsiaResourceDialect,
14210 >,
14211 offset: usize,
14212 _depth: fidl::encoding::Depth,
14213 ) -> fidl::Result<()> {
14214 encoder
14215 .debug_check_bounds::<PopupFrameCreationListenerOnPopupFrameCreatedRequest>(offset);
14216 fidl::encoding::Encode::<PopupFrameCreationListenerOnPopupFrameCreatedRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
14218 (
14219 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<FrameMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.frame),
14220 <PopupFrameCreationInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
14221 ),
14222 encoder, offset, _depth
14223 )
14224 }
14225 }
14226 unsafe impl<
14227 T0: fidl::encoding::Encode<
14228 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<FrameMarker>>,
14229 fidl::encoding::DefaultFuchsiaResourceDialect,
14230 >,
14231 T1: fidl::encoding::Encode<
14232 PopupFrameCreationInfo,
14233 fidl::encoding::DefaultFuchsiaResourceDialect,
14234 >,
14235 >
14236 fidl::encoding::Encode<
14237 PopupFrameCreationListenerOnPopupFrameCreatedRequest,
14238 fidl::encoding::DefaultFuchsiaResourceDialect,
14239 > for (T0, T1)
14240 {
14241 #[inline]
14242 unsafe fn encode(
14243 self,
14244 encoder: &mut fidl::encoding::Encoder<
14245 '_,
14246 fidl::encoding::DefaultFuchsiaResourceDialect,
14247 >,
14248 offset: usize,
14249 depth: fidl::encoding::Depth,
14250 ) -> fidl::Result<()> {
14251 encoder
14252 .debug_check_bounds::<PopupFrameCreationListenerOnPopupFrameCreatedRequest>(offset);
14253 unsafe {
14256 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14257 (ptr as *mut u64).write_unaligned(0);
14258 }
14259 self.0.encode(encoder, offset + 0, depth)?;
14261 self.1.encode(encoder, offset + 8, depth)?;
14262 Ok(())
14263 }
14264 }
14265
14266 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14267 for PopupFrameCreationListenerOnPopupFrameCreatedRequest
14268 {
14269 #[inline(always)]
14270 fn new_empty() -> Self {
14271 Self {
14272 frame: fidl::new_empty!(
14273 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<FrameMarker>>,
14274 fidl::encoding::DefaultFuchsiaResourceDialect
14275 ),
14276 info: fidl::new_empty!(
14277 PopupFrameCreationInfo,
14278 fidl::encoding::DefaultFuchsiaResourceDialect
14279 ),
14280 }
14281 }
14282
14283 #[inline]
14284 unsafe fn decode(
14285 &mut self,
14286 decoder: &mut fidl::encoding::Decoder<
14287 '_,
14288 fidl::encoding::DefaultFuchsiaResourceDialect,
14289 >,
14290 offset: usize,
14291 _depth: fidl::encoding::Depth,
14292 ) -> fidl::Result<()> {
14293 decoder.debug_check_bounds::<Self>(offset);
14294 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14296 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14297 let mask = 0xffffffff00000000u64;
14298 let maskedval = padval & mask;
14299 if maskedval != 0 {
14300 return Err(fidl::Error::NonZeroPadding {
14301 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14302 });
14303 }
14304 fidl::decode!(
14305 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<FrameMarker>>,
14306 fidl::encoding::DefaultFuchsiaResourceDialect,
14307 &mut self.frame,
14308 decoder,
14309 offset + 0,
14310 _depth
14311 )?;
14312 fidl::decode!(
14313 PopupFrameCreationInfo,
14314 fidl::encoding::DefaultFuchsiaResourceDialect,
14315 &mut self.info,
14316 decoder,
14317 offset + 8,
14318 _depth
14319 )?;
14320 Ok(())
14321 }
14322 }
14323
14324 impl ContentDirectoryProvider {
14325 #[inline(always)]
14326 fn max_ordinal_present(&self) -> u64 {
14327 if let Some(_) = self.directory {
14328 return 2;
14329 }
14330 if let Some(_) = self.name {
14331 return 1;
14332 }
14333 0
14334 }
14335 }
14336
14337 impl fidl::encoding::ResourceTypeMarker for ContentDirectoryProvider {
14338 type Borrowed<'a> = &'a mut Self;
14339 fn take_or_borrow<'a>(
14340 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14341 ) -> Self::Borrowed<'a> {
14342 value
14343 }
14344 }
14345
14346 unsafe impl fidl::encoding::TypeMarker for ContentDirectoryProvider {
14347 type Owned = Self;
14348
14349 #[inline(always)]
14350 fn inline_align(_context: fidl::encoding::Context) -> usize {
14351 8
14352 }
14353
14354 #[inline(always)]
14355 fn inline_size(_context: fidl::encoding::Context) -> usize {
14356 16
14357 }
14358 }
14359
14360 unsafe impl
14361 fidl::encoding::Encode<
14362 ContentDirectoryProvider,
14363 fidl::encoding::DefaultFuchsiaResourceDialect,
14364 > for &mut ContentDirectoryProvider
14365 {
14366 unsafe fn encode(
14367 self,
14368 encoder: &mut fidl::encoding::Encoder<
14369 '_,
14370 fidl::encoding::DefaultFuchsiaResourceDialect,
14371 >,
14372 offset: usize,
14373 mut depth: fidl::encoding::Depth,
14374 ) -> fidl::Result<()> {
14375 encoder.debug_check_bounds::<ContentDirectoryProvider>(offset);
14376 let max_ordinal: u64 = self.max_ordinal_present();
14378 encoder.write_num(max_ordinal, offset);
14379 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14380 if max_ordinal == 0 {
14382 return Ok(());
14383 }
14384 depth.increment()?;
14385 let envelope_size = 8;
14386 let bytes_len = max_ordinal as usize * envelope_size;
14387 #[allow(unused_variables)]
14388 let offset = encoder.out_of_line_offset(bytes_len);
14389 let mut _prev_end_offset: usize = 0;
14390 if 1 > max_ordinal {
14391 return Ok(());
14392 }
14393
14394 let cur_offset: usize = (1 - 1) * envelope_size;
14397
14398 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14400
14401 fidl::encoding::encode_in_envelope_optional::<
14406 fidl::encoding::BoundedString<255>,
14407 fidl::encoding::DefaultFuchsiaResourceDialect,
14408 >(
14409 self.name.as_ref().map(
14410 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
14411 ),
14412 encoder,
14413 offset + cur_offset,
14414 depth,
14415 )?;
14416
14417 _prev_end_offset = cur_offset + envelope_size;
14418 if 2 > max_ordinal {
14419 return Ok(());
14420 }
14421
14422 let cur_offset: usize = (2 - 1) * envelope_size;
14425
14426 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14428
14429 fidl::encoding::encode_in_envelope_optional::<
14434 fidl::encoding::Endpoint<
14435 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14436 >,
14437 fidl::encoding::DefaultFuchsiaResourceDialect,
14438 >(
14439 self.directory.as_mut().map(
14440 <fidl::encoding::Endpoint<
14441 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14442 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
14443 ),
14444 encoder,
14445 offset + cur_offset,
14446 depth,
14447 )?;
14448
14449 _prev_end_offset = cur_offset + envelope_size;
14450
14451 Ok(())
14452 }
14453 }
14454
14455 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14456 for ContentDirectoryProvider
14457 {
14458 #[inline(always)]
14459 fn new_empty() -> Self {
14460 Self::default()
14461 }
14462
14463 unsafe fn decode(
14464 &mut self,
14465 decoder: &mut fidl::encoding::Decoder<
14466 '_,
14467 fidl::encoding::DefaultFuchsiaResourceDialect,
14468 >,
14469 offset: usize,
14470 mut depth: fidl::encoding::Depth,
14471 ) -> fidl::Result<()> {
14472 decoder.debug_check_bounds::<Self>(offset);
14473 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14474 None => return Err(fidl::Error::NotNullable),
14475 Some(len) => len,
14476 };
14477 if len == 0 {
14479 return Ok(());
14480 };
14481 depth.increment()?;
14482 let envelope_size = 8;
14483 let bytes_len = len * envelope_size;
14484 let offset = decoder.out_of_line_offset(bytes_len)?;
14485 let mut _next_ordinal_to_read = 0;
14487 let mut next_offset = offset;
14488 let end_offset = offset + bytes_len;
14489 _next_ordinal_to_read += 1;
14490 if next_offset >= end_offset {
14491 return Ok(());
14492 }
14493
14494 while _next_ordinal_to_read < 1 {
14496 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14497 _next_ordinal_to_read += 1;
14498 next_offset += envelope_size;
14499 }
14500
14501 let next_out_of_line = decoder.next_out_of_line();
14502 let handles_before = decoder.remaining_handles();
14503 if let Some((inlined, num_bytes, num_handles)) =
14504 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14505 {
14506 let member_inline_size =
14507 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
14508 decoder.context,
14509 );
14510 if inlined != (member_inline_size <= 4) {
14511 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14512 }
14513 let inner_offset;
14514 let mut inner_depth = depth.clone();
14515 if inlined {
14516 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14517 inner_offset = next_offset;
14518 } else {
14519 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14520 inner_depth.increment()?;
14521 }
14522 let val_ref = self.name.get_or_insert_with(|| {
14523 fidl::new_empty!(
14524 fidl::encoding::BoundedString<255>,
14525 fidl::encoding::DefaultFuchsiaResourceDialect
14526 )
14527 });
14528 fidl::decode!(
14529 fidl::encoding::BoundedString<255>,
14530 fidl::encoding::DefaultFuchsiaResourceDialect,
14531 val_ref,
14532 decoder,
14533 inner_offset,
14534 inner_depth
14535 )?;
14536 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14537 {
14538 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14539 }
14540 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14541 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14542 }
14543 }
14544
14545 next_offset += envelope_size;
14546 _next_ordinal_to_read += 1;
14547 if next_offset >= end_offset {
14548 return Ok(());
14549 }
14550
14551 while _next_ordinal_to_read < 2 {
14553 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14554 _next_ordinal_to_read += 1;
14555 next_offset += envelope_size;
14556 }
14557
14558 let next_out_of_line = decoder.next_out_of_line();
14559 let handles_before = decoder.remaining_handles();
14560 if let Some((inlined, num_bytes, num_handles)) =
14561 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14562 {
14563 let member_inline_size = <fidl::encoding::Endpoint<
14564 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14565 > as fidl::encoding::TypeMarker>::inline_size(
14566 decoder.context
14567 );
14568 if inlined != (member_inline_size <= 4) {
14569 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14570 }
14571 let inner_offset;
14572 let mut inner_depth = depth.clone();
14573 if inlined {
14574 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14575 inner_offset = next_offset;
14576 } else {
14577 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14578 inner_depth.increment()?;
14579 }
14580 let val_ref = self.directory.get_or_insert_with(|| {
14581 fidl::new_empty!(
14582 fidl::encoding::Endpoint<
14583 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14584 >,
14585 fidl::encoding::DefaultFuchsiaResourceDialect
14586 )
14587 });
14588 fidl::decode!(
14589 fidl::encoding::Endpoint<
14590 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14591 >,
14592 fidl::encoding::DefaultFuchsiaResourceDialect,
14593 val_ref,
14594 decoder,
14595 inner_offset,
14596 inner_depth
14597 )?;
14598 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14599 {
14600 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14601 }
14602 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14603 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14604 }
14605 }
14606
14607 next_offset += envelope_size;
14608
14609 while next_offset < end_offset {
14611 _next_ordinal_to_read += 1;
14612 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14613 next_offset += envelope_size;
14614 }
14615
14616 Ok(())
14617 }
14618 }
14619
14620 impl Cookie {
14621 #[inline(always)]
14622 fn max_ordinal_present(&self) -> u64 {
14623 if let Some(_) = self.value {
14624 return 2;
14625 }
14626 if let Some(_) = self.id {
14627 return 1;
14628 }
14629 0
14630 }
14631 }
14632
14633 impl fidl::encoding::ResourceTypeMarker for Cookie {
14634 type Borrowed<'a> = &'a mut Self;
14635 fn take_or_borrow<'a>(
14636 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14637 ) -> Self::Borrowed<'a> {
14638 value
14639 }
14640 }
14641
14642 unsafe impl fidl::encoding::TypeMarker for Cookie {
14643 type Owned = Self;
14644
14645 #[inline(always)]
14646 fn inline_align(_context: fidl::encoding::Context) -> usize {
14647 8
14648 }
14649
14650 #[inline(always)]
14651 fn inline_size(_context: fidl::encoding::Context) -> usize {
14652 16
14653 }
14654 }
14655
14656 unsafe impl fidl::encoding::Encode<Cookie, fidl::encoding::DefaultFuchsiaResourceDialect>
14657 for &mut Cookie
14658 {
14659 unsafe fn encode(
14660 self,
14661 encoder: &mut fidl::encoding::Encoder<
14662 '_,
14663 fidl::encoding::DefaultFuchsiaResourceDialect,
14664 >,
14665 offset: usize,
14666 mut depth: fidl::encoding::Depth,
14667 ) -> fidl::Result<()> {
14668 encoder.debug_check_bounds::<Cookie>(offset);
14669 let max_ordinal: u64 = self.max_ordinal_present();
14671 encoder.write_num(max_ordinal, offset);
14672 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14673 if max_ordinal == 0 {
14675 return Ok(());
14676 }
14677 depth.increment()?;
14678 let envelope_size = 8;
14679 let bytes_len = max_ordinal as usize * envelope_size;
14680 #[allow(unused_variables)]
14681 let offset = encoder.out_of_line_offset(bytes_len);
14682 let mut _prev_end_offset: usize = 0;
14683 if 1 > max_ordinal {
14684 return Ok(());
14685 }
14686
14687 let cur_offset: usize = (1 - 1) * envelope_size;
14690
14691 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14693
14694 fidl::encoding::encode_in_envelope_optional::<
14699 CookieId,
14700 fidl::encoding::DefaultFuchsiaResourceDialect,
14701 >(
14702 self.id.as_ref().map(<CookieId as fidl::encoding::ValueTypeMarker>::borrow),
14703 encoder,
14704 offset + cur_offset,
14705 depth,
14706 )?;
14707
14708 _prev_end_offset = cur_offset + envelope_size;
14709 if 2 > max_ordinal {
14710 return Ok(());
14711 }
14712
14713 let cur_offset: usize = (2 - 1) * envelope_size;
14716
14717 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14719
14720 fidl::encoding::encode_in_envelope_optional::<
14725 fidl::encoding::UnboundedString,
14726 fidl::encoding::DefaultFuchsiaResourceDialect,
14727 >(
14728 self.value.as_ref().map(
14729 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
14730 ),
14731 encoder,
14732 offset + cur_offset,
14733 depth,
14734 )?;
14735
14736 _prev_end_offset = cur_offset + envelope_size;
14737
14738 Ok(())
14739 }
14740 }
14741
14742 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Cookie {
14743 #[inline(always)]
14744 fn new_empty() -> Self {
14745 Self::default()
14746 }
14747
14748 unsafe fn decode(
14749 &mut self,
14750 decoder: &mut fidl::encoding::Decoder<
14751 '_,
14752 fidl::encoding::DefaultFuchsiaResourceDialect,
14753 >,
14754 offset: usize,
14755 mut depth: fidl::encoding::Depth,
14756 ) -> fidl::Result<()> {
14757 decoder.debug_check_bounds::<Self>(offset);
14758 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14759 None => return Err(fidl::Error::NotNullable),
14760 Some(len) => len,
14761 };
14762 if len == 0 {
14764 return Ok(());
14765 };
14766 depth.increment()?;
14767 let envelope_size = 8;
14768 let bytes_len = len * envelope_size;
14769 let offset = decoder.out_of_line_offset(bytes_len)?;
14770 let mut _next_ordinal_to_read = 0;
14772 let mut next_offset = offset;
14773 let end_offset = offset + bytes_len;
14774 _next_ordinal_to_read += 1;
14775 if next_offset >= end_offset {
14776 return Ok(());
14777 }
14778
14779 while _next_ordinal_to_read < 1 {
14781 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14782 _next_ordinal_to_read += 1;
14783 next_offset += envelope_size;
14784 }
14785
14786 let next_out_of_line = decoder.next_out_of_line();
14787 let handles_before = decoder.remaining_handles();
14788 if let Some((inlined, num_bytes, num_handles)) =
14789 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14790 {
14791 let member_inline_size =
14792 <CookieId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14793 if inlined != (member_inline_size <= 4) {
14794 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14795 }
14796 let inner_offset;
14797 let mut inner_depth = depth.clone();
14798 if inlined {
14799 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14800 inner_offset = next_offset;
14801 } else {
14802 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14803 inner_depth.increment()?;
14804 }
14805 let val_ref = self.id.get_or_insert_with(|| {
14806 fidl::new_empty!(CookieId, fidl::encoding::DefaultFuchsiaResourceDialect)
14807 });
14808 fidl::decode!(
14809 CookieId,
14810 fidl::encoding::DefaultFuchsiaResourceDialect,
14811 val_ref,
14812 decoder,
14813 inner_offset,
14814 inner_depth
14815 )?;
14816 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14817 {
14818 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14819 }
14820 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14821 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14822 }
14823 }
14824
14825 next_offset += envelope_size;
14826 _next_ordinal_to_read += 1;
14827 if next_offset >= end_offset {
14828 return Ok(());
14829 }
14830
14831 while _next_ordinal_to_read < 2 {
14833 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14834 _next_ordinal_to_read += 1;
14835 next_offset += envelope_size;
14836 }
14837
14838 let next_out_of_line = decoder.next_out_of_line();
14839 let handles_before = decoder.remaining_handles();
14840 if let Some((inlined, num_bytes, num_handles)) =
14841 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14842 {
14843 let member_inline_size =
14844 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
14845 decoder.context,
14846 );
14847 if inlined != (member_inline_size <= 4) {
14848 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14849 }
14850 let inner_offset;
14851 let mut inner_depth = depth.clone();
14852 if inlined {
14853 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14854 inner_offset = next_offset;
14855 } else {
14856 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14857 inner_depth.increment()?;
14858 }
14859 let val_ref = self.value.get_or_insert_with(|| {
14860 fidl::new_empty!(
14861 fidl::encoding::UnboundedString,
14862 fidl::encoding::DefaultFuchsiaResourceDialect
14863 )
14864 });
14865 fidl::decode!(
14866 fidl::encoding::UnboundedString,
14867 fidl::encoding::DefaultFuchsiaResourceDialect,
14868 val_ref,
14869 decoder,
14870 inner_offset,
14871 inner_depth
14872 )?;
14873 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14874 {
14875 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14876 }
14877 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14878 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14879 }
14880 }
14881
14882 next_offset += envelope_size;
14883
14884 while next_offset < end_offset {
14886 _next_ordinal_to_read += 1;
14887 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14888 next_offset += envelope_size;
14889 }
14890
14891 Ok(())
14892 }
14893 }
14894
14895 impl CreateContextParams {
14896 #[inline(always)]
14897 fn max_ordinal_present(&self) -> u64 {
14898 if let Some(_) = self.data_quota_bytes {
14899 return 13;
14900 }
14901 if let Some(_) = self.cdm_data_quota_bytes {
14902 return 12;
14903 }
14904 if let Some(_) = self.cdm_data_directory {
14905 return 11;
14906 }
14907 if let Some(_) = self.cors_exempt_headers {
14908 return 10;
14909 }
14910 if let Some(_) = self.unsafely_treat_insecure_origins_as_secure {
14911 return 9;
14912 }
14913 if let Some(_) = self.playready_key_system {
14914 return 8;
14915 }
14916 if let Some(_) = self.features {
14917 return 7;
14918 }
14919 if let Some(_) = self.content_directories {
14920 return 6;
14921 }
14922 if let Some(_) = self.remote_debugging_port {
14923 return 5;
14924 }
14925 if let Some(_) = self.user_agent_version {
14926 return 4;
14927 }
14928 if let Some(_) = self.user_agent_product {
14929 return 3;
14930 }
14931 if let Some(_) = self.data_directory {
14932 return 2;
14933 }
14934 if let Some(_) = self.service_directory {
14935 return 1;
14936 }
14937 0
14938 }
14939 }
14940
14941 impl fidl::encoding::ResourceTypeMarker for CreateContextParams {
14942 type Borrowed<'a> = &'a mut Self;
14943 fn take_or_borrow<'a>(
14944 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14945 ) -> Self::Borrowed<'a> {
14946 value
14947 }
14948 }
14949
14950 unsafe impl fidl::encoding::TypeMarker for CreateContextParams {
14951 type Owned = Self;
14952
14953 #[inline(always)]
14954 fn inline_align(_context: fidl::encoding::Context) -> usize {
14955 8
14956 }
14957
14958 #[inline(always)]
14959 fn inline_size(_context: fidl::encoding::Context) -> usize {
14960 16
14961 }
14962 }
14963
14964 unsafe impl
14965 fidl::encoding::Encode<CreateContextParams, fidl::encoding::DefaultFuchsiaResourceDialect>
14966 for &mut CreateContextParams
14967 {
14968 unsafe fn encode(
14969 self,
14970 encoder: &mut fidl::encoding::Encoder<
14971 '_,
14972 fidl::encoding::DefaultFuchsiaResourceDialect,
14973 >,
14974 offset: usize,
14975 mut depth: fidl::encoding::Depth,
14976 ) -> fidl::Result<()> {
14977 encoder.debug_check_bounds::<CreateContextParams>(offset);
14978 let max_ordinal: u64 = self.max_ordinal_present();
14980 encoder.write_num(max_ordinal, offset);
14981 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14982 if max_ordinal == 0 {
14984 return Ok(());
14985 }
14986 depth.increment()?;
14987 let envelope_size = 8;
14988 let bytes_len = max_ordinal as usize * envelope_size;
14989 #[allow(unused_variables)]
14990 let offset = encoder.out_of_line_offset(bytes_len);
14991 let mut _prev_end_offset: usize = 0;
14992 if 1 > max_ordinal {
14993 return Ok(());
14994 }
14995
14996 let cur_offset: usize = (1 - 1) * envelope_size;
14999
15000 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15002
15003 fidl::encoding::encode_in_envelope_optional::<
15008 fidl::encoding::Endpoint<
15009 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15010 >,
15011 fidl::encoding::DefaultFuchsiaResourceDialect,
15012 >(
15013 self.service_directory.as_mut().map(
15014 <fidl::encoding::Endpoint<
15015 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15016 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
15017 ),
15018 encoder,
15019 offset + cur_offset,
15020 depth,
15021 )?;
15022
15023 _prev_end_offset = cur_offset + envelope_size;
15024 if 2 > max_ordinal {
15025 return Ok(());
15026 }
15027
15028 let cur_offset: usize = (2 - 1) * envelope_size;
15031
15032 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15034
15035 fidl::encoding::encode_in_envelope_optional::<
15040 fidl::encoding::Endpoint<
15041 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15042 >,
15043 fidl::encoding::DefaultFuchsiaResourceDialect,
15044 >(
15045 self.data_directory.as_mut().map(
15046 <fidl::encoding::Endpoint<
15047 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15048 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
15049 ),
15050 encoder,
15051 offset + cur_offset,
15052 depth,
15053 )?;
15054
15055 _prev_end_offset = cur_offset + envelope_size;
15056 if 3 > max_ordinal {
15057 return Ok(());
15058 }
15059
15060 let cur_offset: usize = (3 - 1) * envelope_size;
15063
15064 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15066
15067 fidl::encoding::encode_in_envelope_optional::<
15072 fidl::encoding::BoundedString<128>,
15073 fidl::encoding::DefaultFuchsiaResourceDialect,
15074 >(
15075 self.user_agent_product.as_ref().map(
15076 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
15077 ),
15078 encoder,
15079 offset + cur_offset,
15080 depth,
15081 )?;
15082
15083 _prev_end_offset = cur_offset + envelope_size;
15084 if 4 > max_ordinal {
15085 return Ok(());
15086 }
15087
15088 let cur_offset: usize = (4 - 1) * envelope_size;
15091
15092 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15094
15095 fidl::encoding::encode_in_envelope_optional::<
15100 fidl::encoding::BoundedString<128>,
15101 fidl::encoding::DefaultFuchsiaResourceDialect,
15102 >(
15103 self.user_agent_version.as_ref().map(
15104 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
15105 ),
15106 encoder,
15107 offset + cur_offset,
15108 depth,
15109 )?;
15110
15111 _prev_end_offset = cur_offset + envelope_size;
15112 if 5 > max_ordinal {
15113 return Ok(());
15114 }
15115
15116 let cur_offset: usize = (5 - 1) * envelope_size;
15119
15120 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15122
15123 fidl::encoding::encode_in_envelope_optional::<
15128 u16,
15129 fidl::encoding::DefaultFuchsiaResourceDialect,
15130 >(
15131 self.remote_debugging_port
15132 .as_ref()
15133 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
15134 encoder,
15135 offset + cur_offset,
15136 depth,
15137 )?;
15138
15139 _prev_end_offset = cur_offset + envelope_size;
15140 if 6 > max_ordinal {
15141 return Ok(());
15142 }
15143
15144 let cur_offset: usize = (6 - 1) * envelope_size;
15147
15148 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15150
15151 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ContentDirectoryProvider, 100>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15156 self.content_directories.as_mut().map(<fidl::encoding::Vector<ContentDirectoryProvider, 100> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15157 encoder, offset + cur_offset, depth
15158 )?;
15159
15160 _prev_end_offset = cur_offset + envelope_size;
15161 if 7 > max_ordinal {
15162 return Ok(());
15163 }
15164
15165 let cur_offset: usize = (7 - 1) * envelope_size;
15168
15169 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15171
15172 fidl::encoding::encode_in_envelope_optional::<
15177 ContextFeatureFlags,
15178 fidl::encoding::DefaultFuchsiaResourceDialect,
15179 >(
15180 self.features
15181 .as_ref()
15182 .map(<ContextFeatureFlags as fidl::encoding::ValueTypeMarker>::borrow),
15183 encoder,
15184 offset + cur_offset,
15185 depth,
15186 )?;
15187
15188 _prev_end_offset = cur_offset + envelope_size;
15189 if 8 > max_ordinal {
15190 return Ok(());
15191 }
15192
15193 let cur_offset: usize = (8 - 1) * envelope_size;
15196
15197 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15199
15200 fidl::encoding::encode_in_envelope_optional::<
15205 fidl::encoding::BoundedString<128>,
15206 fidl::encoding::DefaultFuchsiaResourceDialect,
15207 >(
15208 self.playready_key_system.as_ref().map(
15209 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
15210 ),
15211 encoder,
15212 offset + cur_offset,
15213 depth,
15214 )?;
15215
15216 _prev_end_offset = cur_offset + envelope_size;
15217 if 9 > max_ordinal {
15218 return Ok(());
15219 }
15220
15221 let cur_offset: usize = (9 - 1) * envelope_size;
15224
15225 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15227
15228 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<513>, 100>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15233 self.unsafely_treat_insecure_origins_as_secure.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<513>, 100> as fidl::encoding::ValueTypeMarker>::borrow),
15234 encoder, offset + cur_offset, depth
15235 )?;
15236
15237 _prev_end_offset = cur_offset + envelope_size;
15238 if 10 > max_ordinal {
15239 return Ok(());
15240 }
15241
15242 let cur_offset: usize = (10 - 1) * envelope_size;
15245
15246 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15248
15249 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15254 self.cors_exempt_headers.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>> as fidl::encoding::ValueTypeMarker>::borrow),
15255 encoder, offset + cur_offset, depth
15256 )?;
15257
15258 _prev_end_offset = cur_offset + envelope_size;
15259 if 11 > max_ordinal {
15260 return Ok(());
15261 }
15262
15263 let cur_offset: usize = (11 - 1) * envelope_size;
15266
15267 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15269
15270 fidl::encoding::encode_in_envelope_optional::<
15275 fidl::encoding::Endpoint<
15276 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15277 >,
15278 fidl::encoding::DefaultFuchsiaResourceDialect,
15279 >(
15280 self.cdm_data_directory.as_mut().map(
15281 <fidl::encoding::Endpoint<
15282 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15283 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
15284 ),
15285 encoder,
15286 offset + cur_offset,
15287 depth,
15288 )?;
15289
15290 _prev_end_offset = cur_offset + envelope_size;
15291 if 12 > max_ordinal {
15292 return Ok(());
15293 }
15294
15295 let cur_offset: usize = (12 - 1) * envelope_size;
15298
15299 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15301
15302 fidl::encoding::encode_in_envelope_optional::<
15307 u64,
15308 fidl::encoding::DefaultFuchsiaResourceDialect,
15309 >(
15310 self.cdm_data_quota_bytes
15311 .as_ref()
15312 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15313 encoder,
15314 offset + cur_offset,
15315 depth,
15316 )?;
15317
15318 _prev_end_offset = cur_offset + envelope_size;
15319 if 13 > max_ordinal {
15320 return Ok(());
15321 }
15322
15323 let cur_offset: usize = (13 - 1) * envelope_size;
15326
15327 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15329
15330 fidl::encoding::encode_in_envelope_optional::<
15335 u64,
15336 fidl::encoding::DefaultFuchsiaResourceDialect,
15337 >(
15338 self.data_quota_bytes
15339 .as_ref()
15340 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15341 encoder,
15342 offset + cur_offset,
15343 depth,
15344 )?;
15345
15346 _prev_end_offset = cur_offset + envelope_size;
15347
15348 Ok(())
15349 }
15350 }
15351
15352 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15353 for CreateContextParams
15354 {
15355 #[inline(always)]
15356 fn new_empty() -> Self {
15357 Self::default()
15358 }
15359
15360 unsafe fn decode(
15361 &mut self,
15362 decoder: &mut fidl::encoding::Decoder<
15363 '_,
15364 fidl::encoding::DefaultFuchsiaResourceDialect,
15365 >,
15366 offset: usize,
15367 mut depth: fidl::encoding::Depth,
15368 ) -> fidl::Result<()> {
15369 decoder.debug_check_bounds::<Self>(offset);
15370 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15371 None => return Err(fidl::Error::NotNullable),
15372 Some(len) => len,
15373 };
15374 if len == 0 {
15376 return Ok(());
15377 };
15378 depth.increment()?;
15379 let envelope_size = 8;
15380 let bytes_len = len * envelope_size;
15381 let offset = decoder.out_of_line_offset(bytes_len)?;
15382 let mut _next_ordinal_to_read = 0;
15384 let mut next_offset = offset;
15385 let end_offset = offset + bytes_len;
15386 _next_ordinal_to_read += 1;
15387 if next_offset >= end_offset {
15388 return Ok(());
15389 }
15390
15391 while _next_ordinal_to_read < 1 {
15393 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15394 _next_ordinal_to_read += 1;
15395 next_offset += envelope_size;
15396 }
15397
15398 let next_out_of_line = decoder.next_out_of_line();
15399 let handles_before = decoder.remaining_handles();
15400 if let Some((inlined, num_bytes, num_handles)) =
15401 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15402 {
15403 let member_inline_size = <fidl::encoding::Endpoint<
15404 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15405 > as fidl::encoding::TypeMarker>::inline_size(
15406 decoder.context
15407 );
15408 if inlined != (member_inline_size <= 4) {
15409 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15410 }
15411 let inner_offset;
15412 let mut inner_depth = depth.clone();
15413 if inlined {
15414 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15415 inner_offset = next_offset;
15416 } else {
15417 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15418 inner_depth.increment()?;
15419 }
15420 let val_ref = self.service_directory.get_or_insert_with(|| {
15421 fidl::new_empty!(
15422 fidl::encoding::Endpoint<
15423 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15424 >,
15425 fidl::encoding::DefaultFuchsiaResourceDialect
15426 )
15427 });
15428 fidl::decode!(
15429 fidl::encoding::Endpoint<
15430 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15431 >,
15432 fidl::encoding::DefaultFuchsiaResourceDialect,
15433 val_ref,
15434 decoder,
15435 inner_offset,
15436 inner_depth
15437 )?;
15438 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15439 {
15440 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15441 }
15442 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15443 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15444 }
15445 }
15446
15447 next_offset += envelope_size;
15448 _next_ordinal_to_read += 1;
15449 if next_offset >= end_offset {
15450 return Ok(());
15451 }
15452
15453 while _next_ordinal_to_read < 2 {
15455 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15456 _next_ordinal_to_read += 1;
15457 next_offset += envelope_size;
15458 }
15459
15460 let next_out_of_line = decoder.next_out_of_line();
15461 let handles_before = decoder.remaining_handles();
15462 if let Some((inlined, num_bytes, num_handles)) =
15463 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15464 {
15465 let member_inline_size = <fidl::encoding::Endpoint<
15466 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15467 > as fidl::encoding::TypeMarker>::inline_size(
15468 decoder.context
15469 );
15470 if inlined != (member_inline_size <= 4) {
15471 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15472 }
15473 let inner_offset;
15474 let mut inner_depth = depth.clone();
15475 if inlined {
15476 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15477 inner_offset = next_offset;
15478 } else {
15479 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15480 inner_depth.increment()?;
15481 }
15482 let val_ref = self.data_directory.get_or_insert_with(|| {
15483 fidl::new_empty!(
15484 fidl::encoding::Endpoint<
15485 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15486 >,
15487 fidl::encoding::DefaultFuchsiaResourceDialect
15488 )
15489 });
15490 fidl::decode!(
15491 fidl::encoding::Endpoint<
15492 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15493 >,
15494 fidl::encoding::DefaultFuchsiaResourceDialect,
15495 val_ref,
15496 decoder,
15497 inner_offset,
15498 inner_depth
15499 )?;
15500 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15501 {
15502 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15503 }
15504 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15505 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15506 }
15507 }
15508
15509 next_offset += envelope_size;
15510 _next_ordinal_to_read += 1;
15511 if next_offset >= end_offset {
15512 return Ok(());
15513 }
15514
15515 while _next_ordinal_to_read < 3 {
15517 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15518 _next_ordinal_to_read += 1;
15519 next_offset += envelope_size;
15520 }
15521
15522 let next_out_of_line = decoder.next_out_of_line();
15523 let handles_before = decoder.remaining_handles();
15524 if let Some((inlined, num_bytes, num_handles)) =
15525 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15526 {
15527 let member_inline_size =
15528 <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
15529 decoder.context,
15530 );
15531 if inlined != (member_inline_size <= 4) {
15532 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15533 }
15534 let inner_offset;
15535 let mut inner_depth = depth.clone();
15536 if inlined {
15537 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15538 inner_offset = next_offset;
15539 } else {
15540 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15541 inner_depth.increment()?;
15542 }
15543 let val_ref = self.user_agent_product.get_or_insert_with(|| {
15544 fidl::new_empty!(
15545 fidl::encoding::BoundedString<128>,
15546 fidl::encoding::DefaultFuchsiaResourceDialect
15547 )
15548 });
15549 fidl::decode!(
15550 fidl::encoding::BoundedString<128>,
15551 fidl::encoding::DefaultFuchsiaResourceDialect,
15552 val_ref,
15553 decoder,
15554 inner_offset,
15555 inner_depth
15556 )?;
15557 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15558 {
15559 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15560 }
15561 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15562 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15563 }
15564 }
15565
15566 next_offset += envelope_size;
15567 _next_ordinal_to_read += 1;
15568 if next_offset >= end_offset {
15569 return Ok(());
15570 }
15571
15572 while _next_ordinal_to_read < 4 {
15574 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15575 _next_ordinal_to_read += 1;
15576 next_offset += envelope_size;
15577 }
15578
15579 let next_out_of_line = decoder.next_out_of_line();
15580 let handles_before = decoder.remaining_handles();
15581 if let Some((inlined, num_bytes, num_handles)) =
15582 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15583 {
15584 let member_inline_size =
15585 <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
15586 decoder.context,
15587 );
15588 if inlined != (member_inline_size <= 4) {
15589 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15590 }
15591 let inner_offset;
15592 let mut inner_depth = depth.clone();
15593 if inlined {
15594 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15595 inner_offset = next_offset;
15596 } else {
15597 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15598 inner_depth.increment()?;
15599 }
15600 let val_ref = self.user_agent_version.get_or_insert_with(|| {
15601 fidl::new_empty!(
15602 fidl::encoding::BoundedString<128>,
15603 fidl::encoding::DefaultFuchsiaResourceDialect
15604 )
15605 });
15606 fidl::decode!(
15607 fidl::encoding::BoundedString<128>,
15608 fidl::encoding::DefaultFuchsiaResourceDialect,
15609 val_ref,
15610 decoder,
15611 inner_offset,
15612 inner_depth
15613 )?;
15614 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15615 {
15616 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15617 }
15618 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15619 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15620 }
15621 }
15622
15623 next_offset += envelope_size;
15624 _next_ordinal_to_read += 1;
15625 if next_offset >= end_offset {
15626 return Ok(());
15627 }
15628
15629 while _next_ordinal_to_read < 5 {
15631 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15632 _next_ordinal_to_read += 1;
15633 next_offset += envelope_size;
15634 }
15635
15636 let next_out_of_line = decoder.next_out_of_line();
15637 let handles_before = decoder.remaining_handles();
15638 if let Some((inlined, num_bytes, num_handles)) =
15639 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15640 {
15641 let member_inline_size =
15642 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15643 if inlined != (member_inline_size <= 4) {
15644 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15645 }
15646 let inner_offset;
15647 let mut inner_depth = depth.clone();
15648 if inlined {
15649 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15650 inner_offset = next_offset;
15651 } else {
15652 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15653 inner_depth.increment()?;
15654 }
15655 let val_ref = self.remote_debugging_port.get_or_insert_with(|| {
15656 fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect)
15657 });
15658 fidl::decode!(
15659 u16,
15660 fidl::encoding::DefaultFuchsiaResourceDialect,
15661 val_ref,
15662 decoder,
15663 inner_offset,
15664 inner_depth
15665 )?;
15666 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15667 {
15668 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15669 }
15670 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15671 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15672 }
15673 }
15674
15675 next_offset += envelope_size;
15676 _next_ordinal_to_read += 1;
15677 if next_offset >= end_offset {
15678 return Ok(());
15679 }
15680
15681 while _next_ordinal_to_read < 6 {
15683 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15684 _next_ordinal_to_read += 1;
15685 next_offset += envelope_size;
15686 }
15687
15688 let next_out_of_line = decoder.next_out_of_line();
15689 let handles_before = decoder.remaining_handles();
15690 if let Some((inlined, num_bytes, num_handles)) =
15691 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15692 {
15693 let member_inline_size = <fidl::encoding::Vector<ContentDirectoryProvider, 100> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15694 if inlined != (member_inline_size <= 4) {
15695 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15696 }
15697 let inner_offset;
15698 let mut inner_depth = depth.clone();
15699 if inlined {
15700 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15701 inner_offset = next_offset;
15702 } else {
15703 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15704 inner_depth.increment()?;
15705 }
15706 let val_ref =
15707 self.content_directories.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<ContentDirectoryProvider, 100>, fidl::encoding::DefaultFuchsiaResourceDialect));
15708 fidl::decode!(fidl::encoding::Vector<ContentDirectoryProvider, 100>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
15709 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15710 {
15711 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15712 }
15713 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15714 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15715 }
15716 }
15717
15718 next_offset += envelope_size;
15719 _next_ordinal_to_read += 1;
15720 if next_offset >= end_offset {
15721 return Ok(());
15722 }
15723
15724 while _next_ordinal_to_read < 7 {
15726 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15727 _next_ordinal_to_read += 1;
15728 next_offset += envelope_size;
15729 }
15730
15731 let next_out_of_line = decoder.next_out_of_line();
15732 let handles_before = decoder.remaining_handles();
15733 if let Some((inlined, num_bytes, num_handles)) =
15734 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15735 {
15736 let member_inline_size =
15737 <ContextFeatureFlags as fidl::encoding::TypeMarker>::inline_size(
15738 decoder.context,
15739 );
15740 if inlined != (member_inline_size <= 4) {
15741 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15742 }
15743 let inner_offset;
15744 let mut inner_depth = depth.clone();
15745 if inlined {
15746 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15747 inner_offset = next_offset;
15748 } else {
15749 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15750 inner_depth.increment()?;
15751 }
15752 let val_ref = self.features.get_or_insert_with(|| {
15753 fidl::new_empty!(
15754 ContextFeatureFlags,
15755 fidl::encoding::DefaultFuchsiaResourceDialect
15756 )
15757 });
15758 fidl::decode!(
15759 ContextFeatureFlags,
15760 fidl::encoding::DefaultFuchsiaResourceDialect,
15761 val_ref,
15762 decoder,
15763 inner_offset,
15764 inner_depth
15765 )?;
15766 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15767 {
15768 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15769 }
15770 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15771 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15772 }
15773 }
15774
15775 next_offset += envelope_size;
15776 _next_ordinal_to_read += 1;
15777 if next_offset >= end_offset {
15778 return Ok(());
15779 }
15780
15781 while _next_ordinal_to_read < 8 {
15783 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15784 _next_ordinal_to_read += 1;
15785 next_offset += envelope_size;
15786 }
15787
15788 let next_out_of_line = decoder.next_out_of_line();
15789 let handles_before = decoder.remaining_handles();
15790 if let Some((inlined, num_bytes, num_handles)) =
15791 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15792 {
15793 let member_inline_size =
15794 <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
15795 decoder.context,
15796 );
15797 if inlined != (member_inline_size <= 4) {
15798 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15799 }
15800 let inner_offset;
15801 let mut inner_depth = depth.clone();
15802 if inlined {
15803 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15804 inner_offset = next_offset;
15805 } else {
15806 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15807 inner_depth.increment()?;
15808 }
15809 let val_ref = self.playready_key_system.get_or_insert_with(|| {
15810 fidl::new_empty!(
15811 fidl::encoding::BoundedString<128>,
15812 fidl::encoding::DefaultFuchsiaResourceDialect
15813 )
15814 });
15815 fidl::decode!(
15816 fidl::encoding::BoundedString<128>,
15817 fidl::encoding::DefaultFuchsiaResourceDialect,
15818 val_ref,
15819 decoder,
15820 inner_offset,
15821 inner_depth
15822 )?;
15823 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15824 {
15825 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15826 }
15827 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15828 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15829 }
15830 }
15831
15832 next_offset += envelope_size;
15833 _next_ordinal_to_read += 1;
15834 if next_offset >= end_offset {
15835 return Ok(());
15836 }
15837
15838 while _next_ordinal_to_read < 9 {
15840 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15841 _next_ordinal_to_read += 1;
15842 next_offset += envelope_size;
15843 }
15844
15845 let next_out_of_line = decoder.next_out_of_line();
15846 let handles_before = decoder.remaining_handles();
15847 if let Some((inlined, num_bytes, num_handles)) =
15848 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15849 {
15850 let member_inline_size = <fidl::encoding::Vector<
15851 fidl::encoding::BoundedString<513>,
15852 100,
15853 > as fidl::encoding::TypeMarker>::inline_size(
15854 decoder.context
15855 );
15856 if inlined != (member_inline_size <= 4) {
15857 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15858 }
15859 let inner_offset;
15860 let mut inner_depth = depth.clone();
15861 if inlined {
15862 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15863 inner_offset = next_offset;
15864 } else {
15865 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15866 inner_depth.increment()?;
15867 }
15868 let val_ref =
15869 self.unsafely_treat_insecure_origins_as_secure.get_or_insert_with(|| {
15870 fidl::new_empty!(
15871 fidl::encoding::Vector<fidl::encoding::BoundedString<513>, 100>,
15872 fidl::encoding::DefaultFuchsiaResourceDialect
15873 )
15874 });
15875 fidl::decode!(
15876 fidl::encoding::Vector<fidl::encoding::BoundedString<513>, 100>,
15877 fidl::encoding::DefaultFuchsiaResourceDialect,
15878 val_ref,
15879 decoder,
15880 inner_offset,
15881 inner_depth
15882 )?;
15883 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15884 {
15885 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15886 }
15887 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15888 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15889 }
15890 }
15891
15892 next_offset += envelope_size;
15893 _next_ordinal_to_read += 1;
15894 if next_offset >= end_offset {
15895 return Ok(());
15896 }
15897
15898 while _next_ordinal_to_read < 10 {
15900 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15901 _next_ordinal_to_read += 1;
15902 next_offset += envelope_size;
15903 }
15904
15905 let next_out_of_line = decoder.next_out_of_line();
15906 let handles_before = decoder.remaining_handles();
15907 if let Some((inlined, num_bytes, num_handles)) =
15908 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15909 {
15910 let member_inline_size = <fidl::encoding::UnboundedVector<
15911 fidl::encoding::UnboundedVector<u8>,
15912 > as fidl::encoding::TypeMarker>::inline_size(
15913 decoder.context
15914 );
15915 if inlined != (member_inline_size <= 4) {
15916 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15917 }
15918 let inner_offset;
15919 let mut inner_depth = depth.clone();
15920 if inlined {
15921 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15922 inner_offset = next_offset;
15923 } else {
15924 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15925 inner_depth.increment()?;
15926 }
15927 let val_ref = self.cors_exempt_headers.get_or_insert_with(|| {
15928 fidl::new_empty!(
15929 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
15930 fidl::encoding::DefaultFuchsiaResourceDialect
15931 )
15932 });
15933 fidl::decode!(
15934 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
15935 fidl::encoding::DefaultFuchsiaResourceDialect,
15936 val_ref,
15937 decoder,
15938 inner_offset,
15939 inner_depth
15940 )?;
15941 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15942 {
15943 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15944 }
15945 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15946 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15947 }
15948 }
15949
15950 next_offset += envelope_size;
15951 _next_ordinal_to_read += 1;
15952 if next_offset >= end_offset {
15953 return Ok(());
15954 }
15955
15956 while _next_ordinal_to_read < 11 {
15958 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15959 _next_ordinal_to_read += 1;
15960 next_offset += envelope_size;
15961 }
15962
15963 let next_out_of_line = decoder.next_out_of_line();
15964 let handles_before = decoder.remaining_handles();
15965 if let Some((inlined, num_bytes, num_handles)) =
15966 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15967 {
15968 let member_inline_size = <fidl::encoding::Endpoint<
15969 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15970 > as fidl::encoding::TypeMarker>::inline_size(
15971 decoder.context
15972 );
15973 if inlined != (member_inline_size <= 4) {
15974 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15975 }
15976 let inner_offset;
15977 let mut inner_depth = depth.clone();
15978 if inlined {
15979 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15980 inner_offset = next_offset;
15981 } else {
15982 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15983 inner_depth.increment()?;
15984 }
15985 let val_ref = self.cdm_data_directory.get_or_insert_with(|| {
15986 fidl::new_empty!(
15987 fidl::encoding::Endpoint<
15988 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15989 >,
15990 fidl::encoding::DefaultFuchsiaResourceDialect
15991 )
15992 });
15993 fidl::decode!(
15994 fidl::encoding::Endpoint<
15995 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15996 >,
15997 fidl::encoding::DefaultFuchsiaResourceDialect,
15998 val_ref,
15999 decoder,
16000 inner_offset,
16001 inner_depth
16002 )?;
16003 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16004 {
16005 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16006 }
16007 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16008 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16009 }
16010 }
16011
16012 next_offset += envelope_size;
16013 _next_ordinal_to_read += 1;
16014 if next_offset >= end_offset {
16015 return Ok(());
16016 }
16017
16018 while _next_ordinal_to_read < 12 {
16020 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16021 _next_ordinal_to_read += 1;
16022 next_offset += envelope_size;
16023 }
16024
16025 let next_out_of_line = decoder.next_out_of_line();
16026 let handles_before = decoder.remaining_handles();
16027 if let Some((inlined, num_bytes, num_handles)) =
16028 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16029 {
16030 let member_inline_size =
16031 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16032 if inlined != (member_inline_size <= 4) {
16033 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16034 }
16035 let inner_offset;
16036 let mut inner_depth = depth.clone();
16037 if inlined {
16038 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16039 inner_offset = next_offset;
16040 } else {
16041 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16042 inner_depth.increment()?;
16043 }
16044 let val_ref = self.cdm_data_quota_bytes.get_or_insert_with(|| {
16045 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
16046 });
16047 fidl::decode!(
16048 u64,
16049 fidl::encoding::DefaultFuchsiaResourceDialect,
16050 val_ref,
16051 decoder,
16052 inner_offset,
16053 inner_depth
16054 )?;
16055 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16056 {
16057 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16058 }
16059 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16060 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16061 }
16062 }
16063
16064 next_offset += envelope_size;
16065 _next_ordinal_to_read += 1;
16066 if next_offset >= end_offset {
16067 return Ok(());
16068 }
16069
16070 while _next_ordinal_to_read < 13 {
16072 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16073 _next_ordinal_to_read += 1;
16074 next_offset += envelope_size;
16075 }
16076
16077 let next_out_of_line = decoder.next_out_of_line();
16078 let handles_before = decoder.remaining_handles();
16079 if let Some((inlined, num_bytes, num_handles)) =
16080 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16081 {
16082 let member_inline_size =
16083 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16084 if inlined != (member_inline_size <= 4) {
16085 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16086 }
16087 let inner_offset;
16088 let mut inner_depth = depth.clone();
16089 if inlined {
16090 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16091 inner_offset = next_offset;
16092 } else {
16093 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16094 inner_depth.increment()?;
16095 }
16096 let val_ref = self.data_quota_bytes.get_or_insert_with(|| {
16097 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
16098 });
16099 fidl::decode!(
16100 u64,
16101 fidl::encoding::DefaultFuchsiaResourceDialect,
16102 val_ref,
16103 decoder,
16104 inner_offset,
16105 inner_depth
16106 )?;
16107 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16108 {
16109 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16110 }
16111 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16112 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16113 }
16114 }
16115
16116 next_offset += envelope_size;
16117
16118 while next_offset < end_offset {
16120 _next_ordinal_to_read += 1;
16121 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16122 next_offset += envelope_size;
16123 }
16124
16125 Ok(())
16126 }
16127 }
16128
16129 impl CreateFrameParams {
16130 #[inline(always)]
16131 fn max_ordinal_present(&self) -> u64 {
16132 if let Some(_) = self.explicit_sites_filter_error_page {
16133 return 4;
16134 }
16135 if let Some(_) = self.debug_name {
16136 return 2;
16137 }
16138 if let Some(_) = self.enable_remote_debugging {
16139 return 1;
16140 }
16141 0
16142 }
16143 }
16144
16145 impl fidl::encoding::ResourceTypeMarker for CreateFrameParams {
16146 type Borrowed<'a> = &'a mut Self;
16147 fn take_or_borrow<'a>(
16148 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16149 ) -> Self::Borrowed<'a> {
16150 value
16151 }
16152 }
16153
16154 unsafe impl fidl::encoding::TypeMarker for CreateFrameParams {
16155 type Owned = Self;
16156
16157 #[inline(always)]
16158 fn inline_align(_context: fidl::encoding::Context) -> usize {
16159 8
16160 }
16161
16162 #[inline(always)]
16163 fn inline_size(_context: fidl::encoding::Context) -> usize {
16164 16
16165 }
16166 }
16167
16168 unsafe impl
16169 fidl::encoding::Encode<CreateFrameParams, fidl::encoding::DefaultFuchsiaResourceDialect>
16170 for &mut CreateFrameParams
16171 {
16172 unsafe fn encode(
16173 self,
16174 encoder: &mut fidl::encoding::Encoder<
16175 '_,
16176 fidl::encoding::DefaultFuchsiaResourceDialect,
16177 >,
16178 offset: usize,
16179 mut depth: fidl::encoding::Depth,
16180 ) -> fidl::Result<()> {
16181 encoder.debug_check_bounds::<CreateFrameParams>(offset);
16182 let max_ordinal: u64 = self.max_ordinal_present();
16184 encoder.write_num(max_ordinal, offset);
16185 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16186 if max_ordinal == 0 {
16188 return Ok(());
16189 }
16190 depth.increment()?;
16191 let envelope_size = 8;
16192 let bytes_len = max_ordinal as usize * envelope_size;
16193 #[allow(unused_variables)]
16194 let offset = encoder.out_of_line_offset(bytes_len);
16195 let mut _prev_end_offset: usize = 0;
16196 if 1 > max_ordinal {
16197 return Ok(());
16198 }
16199
16200 let cur_offset: usize = (1 - 1) * envelope_size;
16203
16204 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16206
16207 fidl::encoding::encode_in_envelope_optional::<
16212 bool,
16213 fidl::encoding::DefaultFuchsiaResourceDialect,
16214 >(
16215 self.enable_remote_debugging
16216 .as_ref()
16217 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
16218 encoder,
16219 offset + cur_offset,
16220 depth,
16221 )?;
16222
16223 _prev_end_offset = cur_offset + envelope_size;
16224 if 2 > max_ordinal {
16225 return Ok(());
16226 }
16227
16228 let cur_offset: usize = (2 - 1) * envelope_size;
16231
16232 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16234
16235 fidl::encoding::encode_in_envelope_optional::<
16240 fidl::encoding::UnboundedString,
16241 fidl::encoding::DefaultFuchsiaResourceDialect,
16242 >(
16243 self.debug_name.as_ref().map(
16244 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
16245 ),
16246 encoder,
16247 offset + cur_offset,
16248 depth,
16249 )?;
16250
16251 _prev_end_offset = cur_offset + envelope_size;
16252 if 4 > max_ordinal {
16253 return Ok(());
16254 }
16255
16256 let cur_offset: usize = (4 - 1) * envelope_size;
16259
16260 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16262
16263 fidl::encoding::encode_in_envelope_optional::<
16268 fidl_fuchsia_mem::Data,
16269 fidl::encoding::DefaultFuchsiaResourceDialect,
16270 >(
16271 self.explicit_sites_filter_error_page.as_mut().map(
16272 <fidl_fuchsia_mem::Data as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
16273 ),
16274 encoder,
16275 offset + cur_offset,
16276 depth,
16277 )?;
16278
16279 _prev_end_offset = cur_offset + envelope_size;
16280
16281 Ok(())
16282 }
16283 }
16284
16285 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16286 for CreateFrameParams
16287 {
16288 #[inline(always)]
16289 fn new_empty() -> Self {
16290 Self::default()
16291 }
16292
16293 unsafe fn decode(
16294 &mut self,
16295 decoder: &mut fidl::encoding::Decoder<
16296 '_,
16297 fidl::encoding::DefaultFuchsiaResourceDialect,
16298 >,
16299 offset: usize,
16300 mut depth: fidl::encoding::Depth,
16301 ) -> fidl::Result<()> {
16302 decoder.debug_check_bounds::<Self>(offset);
16303 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16304 None => return Err(fidl::Error::NotNullable),
16305 Some(len) => len,
16306 };
16307 if len == 0 {
16309 return Ok(());
16310 };
16311 depth.increment()?;
16312 let envelope_size = 8;
16313 let bytes_len = len * envelope_size;
16314 let offset = decoder.out_of_line_offset(bytes_len)?;
16315 let mut _next_ordinal_to_read = 0;
16317 let mut next_offset = offset;
16318 let end_offset = offset + bytes_len;
16319 _next_ordinal_to_read += 1;
16320 if next_offset >= end_offset {
16321 return Ok(());
16322 }
16323
16324 while _next_ordinal_to_read < 1 {
16326 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16327 _next_ordinal_to_read += 1;
16328 next_offset += envelope_size;
16329 }
16330
16331 let next_out_of_line = decoder.next_out_of_line();
16332 let handles_before = decoder.remaining_handles();
16333 if let Some((inlined, num_bytes, num_handles)) =
16334 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16335 {
16336 let member_inline_size =
16337 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16338 if inlined != (member_inline_size <= 4) {
16339 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16340 }
16341 let inner_offset;
16342 let mut inner_depth = depth.clone();
16343 if inlined {
16344 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16345 inner_offset = next_offset;
16346 } else {
16347 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16348 inner_depth.increment()?;
16349 }
16350 let val_ref = self.enable_remote_debugging.get_or_insert_with(|| {
16351 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
16352 });
16353 fidl::decode!(
16354 bool,
16355 fidl::encoding::DefaultFuchsiaResourceDialect,
16356 val_ref,
16357 decoder,
16358 inner_offset,
16359 inner_depth
16360 )?;
16361 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16362 {
16363 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16364 }
16365 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16366 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16367 }
16368 }
16369
16370 next_offset += envelope_size;
16371 _next_ordinal_to_read += 1;
16372 if next_offset >= end_offset {
16373 return Ok(());
16374 }
16375
16376 while _next_ordinal_to_read < 2 {
16378 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16379 _next_ordinal_to_read += 1;
16380 next_offset += envelope_size;
16381 }
16382
16383 let next_out_of_line = decoder.next_out_of_line();
16384 let handles_before = decoder.remaining_handles();
16385 if let Some((inlined, num_bytes, num_handles)) =
16386 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16387 {
16388 let member_inline_size =
16389 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
16390 decoder.context,
16391 );
16392 if inlined != (member_inline_size <= 4) {
16393 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16394 }
16395 let inner_offset;
16396 let mut inner_depth = depth.clone();
16397 if inlined {
16398 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16399 inner_offset = next_offset;
16400 } else {
16401 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16402 inner_depth.increment()?;
16403 }
16404 let val_ref = self.debug_name.get_or_insert_with(|| {
16405 fidl::new_empty!(
16406 fidl::encoding::UnboundedString,
16407 fidl::encoding::DefaultFuchsiaResourceDialect
16408 )
16409 });
16410 fidl::decode!(
16411 fidl::encoding::UnboundedString,
16412 fidl::encoding::DefaultFuchsiaResourceDialect,
16413 val_ref,
16414 decoder,
16415 inner_offset,
16416 inner_depth
16417 )?;
16418 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16419 {
16420 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16421 }
16422 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16423 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16424 }
16425 }
16426
16427 next_offset += envelope_size;
16428 _next_ordinal_to_read += 1;
16429 if next_offset >= end_offset {
16430 return Ok(());
16431 }
16432
16433 while _next_ordinal_to_read < 4 {
16435 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16436 _next_ordinal_to_read += 1;
16437 next_offset += envelope_size;
16438 }
16439
16440 let next_out_of_line = decoder.next_out_of_line();
16441 let handles_before = decoder.remaining_handles();
16442 if let Some((inlined, num_bytes, num_handles)) =
16443 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16444 {
16445 let member_inline_size =
16446 <fidl_fuchsia_mem::Data as fidl::encoding::TypeMarker>::inline_size(
16447 decoder.context,
16448 );
16449 if inlined != (member_inline_size <= 4) {
16450 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16451 }
16452 let inner_offset;
16453 let mut inner_depth = depth.clone();
16454 if inlined {
16455 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16456 inner_offset = next_offset;
16457 } else {
16458 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16459 inner_depth.increment()?;
16460 }
16461 let val_ref = self.explicit_sites_filter_error_page.get_or_insert_with(|| {
16462 fidl::new_empty!(
16463 fidl_fuchsia_mem::Data,
16464 fidl::encoding::DefaultFuchsiaResourceDialect
16465 )
16466 });
16467 fidl::decode!(
16468 fidl_fuchsia_mem::Data,
16469 fidl::encoding::DefaultFuchsiaResourceDialect,
16470 val_ref,
16471 decoder,
16472 inner_offset,
16473 inner_depth
16474 )?;
16475 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16476 {
16477 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16478 }
16479 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16480 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16481 }
16482 }
16483
16484 next_offset += envelope_size;
16485
16486 while next_offset < end_offset {
16488 _next_ordinal_to_read += 1;
16489 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16490 next_offset += envelope_size;
16491 }
16492
16493 Ok(())
16494 }
16495 }
16496
16497 impl CreateView2Args {
16498 #[inline(always)]
16499 fn max_ordinal_present(&self) -> u64 {
16500 if let Some(_) = self.view_creation_token {
16501 return 1;
16502 }
16503 0
16504 }
16505 }
16506
16507 impl fidl::encoding::ResourceTypeMarker for CreateView2Args {
16508 type Borrowed<'a> = &'a mut Self;
16509 fn take_or_borrow<'a>(
16510 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16511 ) -> Self::Borrowed<'a> {
16512 value
16513 }
16514 }
16515
16516 unsafe impl fidl::encoding::TypeMarker for CreateView2Args {
16517 type Owned = Self;
16518
16519 #[inline(always)]
16520 fn inline_align(_context: fidl::encoding::Context) -> usize {
16521 8
16522 }
16523
16524 #[inline(always)]
16525 fn inline_size(_context: fidl::encoding::Context) -> usize {
16526 16
16527 }
16528 }
16529
16530 unsafe impl
16531 fidl::encoding::Encode<CreateView2Args, fidl::encoding::DefaultFuchsiaResourceDialect>
16532 for &mut CreateView2Args
16533 {
16534 unsafe fn encode(
16535 self,
16536 encoder: &mut fidl::encoding::Encoder<
16537 '_,
16538 fidl::encoding::DefaultFuchsiaResourceDialect,
16539 >,
16540 offset: usize,
16541 mut depth: fidl::encoding::Depth,
16542 ) -> fidl::Result<()> {
16543 encoder.debug_check_bounds::<CreateView2Args>(offset);
16544 let max_ordinal: u64 = self.max_ordinal_present();
16546 encoder.write_num(max_ordinal, offset);
16547 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16548 if max_ordinal == 0 {
16550 return Ok(());
16551 }
16552 depth.increment()?;
16553 let envelope_size = 8;
16554 let bytes_len = max_ordinal as usize * envelope_size;
16555 #[allow(unused_variables)]
16556 let offset = encoder.out_of_line_offset(bytes_len);
16557 let mut _prev_end_offset: usize = 0;
16558 if 1 > max_ordinal {
16559 return Ok(());
16560 }
16561
16562 let cur_offset: usize = (1 - 1) * envelope_size;
16565
16566 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16568
16569 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_views::ViewCreationToken, fidl::encoding::DefaultFuchsiaResourceDialect>(
16574 self.view_creation_token.as_mut().map(<fidl_fuchsia_ui_views::ViewCreationToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16575 encoder, offset + cur_offset, depth
16576 )?;
16577
16578 _prev_end_offset = cur_offset + envelope_size;
16579
16580 Ok(())
16581 }
16582 }
16583
16584 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16585 for CreateView2Args
16586 {
16587 #[inline(always)]
16588 fn new_empty() -> Self {
16589 Self::default()
16590 }
16591
16592 unsafe fn decode(
16593 &mut self,
16594 decoder: &mut fidl::encoding::Decoder<
16595 '_,
16596 fidl::encoding::DefaultFuchsiaResourceDialect,
16597 >,
16598 offset: usize,
16599 mut depth: fidl::encoding::Depth,
16600 ) -> fidl::Result<()> {
16601 decoder.debug_check_bounds::<Self>(offset);
16602 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16603 None => return Err(fidl::Error::NotNullable),
16604 Some(len) => len,
16605 };
16606 if len == 0 {
16608 return Ok(());
16609 };
16610 depth.increment()?;
16611 let envelope_size = 8;
16612 let bytes_len = len * envelope_size;
16613 let offset = decoder.out_of_line_offset(bytes_len)?;
16614 let mut _next_ordinal_to_read = 0;
16616 let mut next_offset = offset;
16617 let end_offset = offset + bytes_len;
16618 _next_ordinal_to_read += 1;
16619 if next_offset >= end_offset {
16620 return Ok(());
16621 }
16622
16623 while _next_ordinal_to_read < 1 {
16625 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16626 _next_ordinal_to_read += 1;
16627 next_offset += envelope_size;
16628 }
16629
16630 let next_out_of_line = decoder.next_out_of_line();
16631 let handles_before = decoder.remaining_handles();
16632 if let Some((inlined, num_bytes, num_handles)) =
16633 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16634 {
16635 let member_inline_size = <fidl_fuchsia_ui_views::ViewCreationToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16636 if inlined != (member_inline_size <= 4) {
16637 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16638 }
16639 let inner_offset;
16640 let mut inner_depth = depth.clone();
16641 if inlined {
16642 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16643 inner_offset = next_offset;
16644 } else {
16645 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16646 inner_depth.increment()?;
16647 }
16648 let val_ref = self.view_creation_token.get_or_insert_with(|| {
16649 fidl::new_empty!(
16650 fidl_fuchsia_ui_views::ViewCreationToken,
16651 fidl::encoding::DefaultFuchsiaResourceDialect
16652 )
16653 });
16654 fidl::decode!(
16655 fidl_fuchsia_ui_views::ViewCreationToken,
16656 fidl::encoding::DefaultFuchsiaResourceDialect,
16657 val_ref,
16658 decoder,
16659 inner_offset,
16660 inner_depth
16661 )?;
16662 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16663 {
16664 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16665 }
16666 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16667 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16668 }
16669 }
16670
16671 next_offset += envelope_size;
16672
16673 while next_offset < end_offset {
16675 _next_ordinal_to_read += 1;
16676 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16677 next_offset += envelope_size;
16678 }
16679
16680 Ok(())
16681 }
16682 }
16683
16684 impl Favicon {
16685 #[inline(always)]
16686 fn max_ordinal_present(&self) -> u64 {
16687 if let Some(_) = self.height {
16688 return 3;
16689 }
16690 if let Some(_) = self.width {
16691 return 2;
16692 }
16693 if let Some(_) = self.data {
16694 return 1;
16695 }
16696 0
16697 }
16698 }
16699
16700 impl fidl::encoding::ResourceTypeMarker for Favicon {
16701 type Borrowed<'a> = &'a mut Self;
16702 fn take_or_borrow<'a>(
16703 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16704 ) -> Self::Borrowed<'a> {
16705 value
16706 }
16707 }
16708
16709 unsafe impl fidl::encoding::TypeMarker for Favicon {
16710 type Owned = Self;
16711
16712 #[inline(always)]
16713 fn inline_align(_context: fidl::encoding::Context) -> usize {
16714 8
16715 }
16716
16717 #[inline(always)]
16718 fn inline_size(_context: fidl::encoding::Context) -> usize {
16719 16
16720 }
16721 }
16722
16723 unsafe impl fidl::encoding::Encode<Favicon, fidl::encoding::DefaultFuchsiaResourceDialect>
16724 for &mut Favicon
16725 {
16726 unsafe fn encode(
16727 self,
16728 encoder: &mut fidl::encoding::Encoder<
16729 '_,
16730 fidl::encoding::DefaultFuchsiaResourceDialect,
16731 >,
16732 offset: usize,
16733 mut depth: fidl::encoding::Depth,
16734 ) -> fidl::Result<()> {
16735 encoder.debug_check_bounds::<Favicon>(offset);
16736 let max_ordinal: u64 = self.max_ordinal_present();
16738 encoder.write_num(max_ordinal, offset);
16739 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16740 if max_ordinal == 0 {
16742 return Ok(());
16743 }
16744 depth.increment()?;
16745 let envelope_size = 8;
16746 let bytes_len = max_ordinal as usize * envelope_size;
16747 #[allow(unused_variables)]
16748 let offset = encoder.out_of_line_offset(bytes_len);
16749 let mut _prev_end_offset: usize = 0;
16750 if 1 > max_ordinal {
16751 return Ok(());
16752 }
16753
16754 let cur_offset: usize = (1 - 1) * envelope_size;
16757
16758 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16760
16761 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
16766 self.data.as_mut().map(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16767 encoder, offset + cur_offset, depth
16768 )?;
16769
16770 _prev_end_offset = cur_offset + envelope_size;
16771 if 2 > max_ordinal {
16772 return Ok(());
16773 }
16774
16775 let cur_offset: usize = (2 - 1) * envelope_size;
16778
16779 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16781
16782 fidl::encoding::encode_in_envelope_optional::<
16787 u32,
16788 fidl::encoding::DefaultFuchsiaResourceDialect,
16789 >(
16790 self.width.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
16791 encoder,
16792 offset + cur_offset,
16793 depth,
16794 )?;
16795
16796 _prev_end_offset = cur_offset + envelope_size;
16797 if 3 > max_ordinal {
16798 return Ok(());
16799 }
16800
16801 let cur_offset: usize = (3 - 1) * envelope_size;
16804
16805 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16807
16808 fidl::encoding::encode_in_envelope_optional::<
16813 u32,
16814 fidl::encoding::DefaultFuchsiaResourceDialect,
16815 >(
16816 self.height.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
16817 encoder,
16818 offset + cur_offset,
16819 depth,
16820 )?;
16821
16822 _prev_end_offset = cur_offset + envelope_size;
16823
16824 Ok(())
16825 }
16826 }
16827
16828 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Favicon {
16829 #[inline(always)]
16830 fn new_empty() -> Self {
16831 Self::default()
16832 }
16833
16834 unsafe fn decode(
16835 &mut self,
16836 decoder: &mut fidl::encoding::Decoder<
16837 '_,
16838 fidl::encoding::DefaultFuchsiaResourceDialect,
16839 >,
16840 offset: usize,
16841 mut depth: fidl::encoding::Depth,
16842 ) -> fidl::Result<()> {
16843 decoder.debug_check_bounds::<Self>(offset);
16844 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16845 None => return Err(fidl::Error::NotNullable),
16846 Some(len) => len,
16847 };
16848 if len == 0 {
16850 return Ok(());
16851 };
16852 depth.increment()?;
16853 let envelope_size = 8;
16854 let bytes_len = len * envelope_size;
16855 let offset = decoder.out_of_line_offset(bytes_len)?;
16856 let mut _next_ordinal_to_read = 0;
16858 let mut next_offset = offset;
16859 let end_offset = offset + bytes_len;
16860 _next_ordinal_to_read += 1;
16861 if next_offset >= end_offset {
16862 return Ok(());
16863 }
16864
16865 while _next_ordinal_to_read < 1 {
16867 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16868 _next_ordinal_to_read += 1;
16869 next_offset += envelope_size;
16870 }
16871
16872 let next_out_of_line = decoder.next_out_of_line();
16873 let handles_before = decoder.remaining_handles();
16874 if let Some((inlined, num_bytes, num_handles)) =
16875 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16876 {
16877 let member_inline_size =
16878 <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
16879 decoder.context,
16880 );
16881 if inlined != (member_inline_size <= 4) {
16882 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16883 }
16884 let inner_offset;
16885 let mut inner_depth = depth.clone();
16886 if inlined {
16887 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16888 inner_offset = next_offset;
16889 } else {
16890 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16891 inner_depth.increment()?;
16892 }
16893 let val_ref = self.data.get_or_insert_with(|| {
16894 fidl::new_empty!(
16895 fidl_fuchsia_mem::Buffer,
16896 fidl::encoding::DefaultFuchsiaResourceDialect
16897 )
16898 });
16899 fidl::decode!(
16900 fidl_fuchsia_mem::Buffer,
16901 fidl::encoding::DefaultFuchsiaResourceDialect,
16902 val_ref,
16903 decoder,
16904 inner_offset,
16905 inner_depth
16906 )?;
16907 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16908 {
16909 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16910 }
16911 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16912 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16913 }
16914 }
16915
16916 next_offset += envelope_size;
16917 _next_ordinal_to_read += 1;
16918 if next_offset >= end_offset {
16919 return Ok(());
16920 }
16921
16922 while _next_ordinal_to_read < 2 {
16924 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16925 _next_ordinal_to_read += 1;
16926 next_offset += envelope_size;
16927 }
16928
16929 let next_out_of_line = decoder.next_out_of_line();
16930 let handles_before = decoder.remaining_handles();
16931 if let Some((inlined, num_bytes, num_handles)) =
16932 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16933 {
16934 let member_inline_size =
16935 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16936 if inlined != (member_inline_size <= 4) {
16937 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16938 }
16939 let inner_offset;
16940 let mut inner_depth = depth.clone();
16941 if inlined {
16942 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16943 inner_offset = next_offset;
16944 } else {
16945 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16946 inner_depth.increment()?;
16947 }
16948 let val_ref = self.width.get_or_insert_with(|| {
16949 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
16950 });
16951 fidl::decode!(
16952 u32,
16953 fidl::encoding::DefaultFuchsiaResourceDialect,
16954 val_ref,
16955 decoder,
16956 inner_offset,
16957 inner_depth
16958 )?;
16959 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16960 {
16961 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16962 }
16963 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16964 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16965 }
16966 }
16967
16968 next_offset += envelope_size;
16969 _next_ordinal_to_read += 1;
16970 if next_offset >= end_offset {
16971 return Ok(());
16972 }
16973
16974 while _next_ordinal_to_read < 3 {
16976 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16977 _next_ordinal_to_read += 1;
16978 next_offset += envelope_size;
16979 }
16980
16981 let next_out_of_line = decoder.next_out_of_line();
16982 let handles_before = decoder.remaining_handles();
16983 if let Some((inlined, num_bytes, num_handles)) =
16984 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16985 {
16986 let member_inline_size =
16987 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16988 if inlined != (member_inline_size <= 4) {
16989 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16990 }
16991 let inner_offset;
16992 let mut inner_depth = depth.clone();
16993 if inlined {
16994 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16995 inner_offset = next_offset;
16996 } else {
16997 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16998 inner_depth.increment()?;
16999 }
17000 let val_ref = self.height.get_or_insert_with(|| {
17001 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
17002 });
17003 fidl::decode!(
17004 u32,
17005 fidl::encoding::DefaultFuchsiaResourceDialect,
17006 val_ref,
17007 decoder,
17008 inner_offset,
17009 inner_depth
17010 )?;
17011 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17012 {
17013 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17014 }
17015 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17016 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17017 }
17018 }
17019
17020 next_offset += envelope_size;
17021
17022 while next_offset < end_offset {
17024 _next_ordinal_to_read += 1;
17025 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17026 next_offset += envelope_size;
17027 }
17028
17029 Ok(())
17030 }
17031 }
17032
17033 impl LoadUrlParams {
17034 #[inline(always)]
17035 fn max_ordinal_present(&self) -> u64 {
17036 if let Some(_) = self.headers {
17037 return 4;
17038 }
17039 if let Some(_) = self.was_user_activated {
17040 return 3;
17041 }
17042 if let Some(_) = self.referrer_url {
17043 return 2;
17044 }
17045 if let Some(_) = self.type_ {
17046 return 1;
17047 }
17048 0
17049 }
17050 }
17051
17052 impl fidl::encoding::ResourceTypeMarker for LoadUrlParams {
17053 type Borrowed<'a> = &'a mut Self;
17054 fn take_or_borrow<'a>(
17055 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17056 ) -> Self::Borrowed<'a> {
17057 value
17058 }
17059 }
17060
17061 unsafe impl fidl::encoding::TypeMarker for LoadUrlParams {
17062 type Owned = Self;
17063
17064 #[inline(always)]
17065 fn inline_align(_context: fidl::encoding::Context) -> usize {
17066 8
17067 }
17068
17069 #[inline(always)]
17070 fn inline_size(_context: fidl::encoding::Context) -> usize {
17071 16
17072 }
17073 }
17074
17075 unsafe impl fidl::encoding::Encode<LoadUrlParams, fidl::encoding::DefaultFuchsiaResourceDialect>
17076 for &mut LoadUrlParams
17077 {
17078 unsafe fn encode(
17079 self,
17080 encoder: &mut fidl::encoding::Encoder<
17081 '_,
17082 fidl::encoding::DefaultFuchsiaResourceDialect,
17083 >,
17084 offset: usize,
17085 mut depth: fidl::encoding::Depth,
17086 ) -> fidl::Result<()> {
17087 encoder.debug_check_bounds::<LoadUrlParams>(offset);
17088 let max_ordinal: u64 = self.max_ordinal_present();
17090 encoder.write_num(max_ordinal, offset);
17091 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17092 if max_ordinal == 0 {
17094 return Ok(());
17095 }
17096 depth.increment()?;
17097 let envelope_size = 8;
17098 let bytes_len = max_ordinal as usize * envelope_size;
17099 #[allow(unused_variables)]
17100 let offset = encoder.out_of_line_offset(bytes_len);
17101 let mut _prev_end_offset: usize = 0;
17102 if 1 > max_ordinal {
17103 return Ok(());
17104 }
17105
17106 let cur_offset: usize = (1 - 1) * envelope_size;
17109
17110 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17112
17113 fidl::encoding::encode_in_envelope_optional::<
17118 LoadUrlReason,
17119 fidl::encoding::DefaultFuchsiaResourceDialect,
17120 >(
17121 self.type_.as_ref().map(<LoadUrlReason as fidl::encoding::ValueTypeMarker>::borrow),
17122 encoder,
17123 offset + cur_offset,
17124 depth,
17125 )?;
17126
17127 _prev_end_offset = cur_offset + envelope_size;
17128 if 2 > max_ordinal {
17129 return Ok(());
17130 }
17131
17132 let cur_offset: usize = (2 - 1) * envelope_size;
17135
17136 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17138
17139 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65536>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17144 self.referrer_url.as_ref().map(<fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow),
17145 encoder, offset + cur_offset, depth
17146 )?;
17147
17148 _prev_end_offset = cur_offset + envelope_size;
17149 if 3 > max_ordinal {
17150 return Ok(());
17151 }
17152
17153 let cur_offset: usize = (3 - 1) * envelope_size;
17156
17157 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17159
17160 fidl::encoding::encode_in_envelope_optional::<
17165 bool,
17166 fidl::encoding::DefaultFuchsiaResourceDialect,
17167 >(
17168 self.was_user_activated
17169 .as_ref()
17170 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17171 encoder,
17172 offset + cur_offset,
17173 depth,
17174 )?;
17175
17176 _prev_end_offset = cur_offset + envelope_size;
17177 if 4 > max_ordinal {
17178 return Ok(());
17179 }
17180
17181 let cur_offset: usize = (4 - 1) * envelope_size;
17184
17185 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17187
17188 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net_http::Header>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17193 self.headers.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net_http::Header> as fidl::encoding::ValueTypeMarker>::borrow),
17194 encoder, offset + cur_offset, depth
17195 )?;
17196
17197 _prev_end_offset = cur_offset + envelope_size;
17198
17199 Ok(())
17200 }
17201 }
17202
17203 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for LoadUrlParams {
17204 #[inline(always)]
17205 fn new_empty() -> Self {
17206 Self::default()
17207 }
17208
17209 unsafe fn decode(
17210 &mut self,
17211 decoder: &mut fidl::encoding::Decoder<
17212 '_,
17213 fidl::encoding::DefaultFuchsiaResourceDialect,
17214 >,
17215 offset: usize,
17216 mut depth: fidl::encoding::Depth,
17217 ) -> fidl::Result<()> {
17218 decoder.debug_check_bounds::<Self>(offset);
17219 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17220 None => return Err(fidl::Error::NotNullable),
17221 Some(len) => len,
17222 };
17223 if len == 0 {
17225 return Ok(());
17226 };
17227 depth.increment()?;
17228 let envelope_size = 8;
17229 let bytes_len = len * envelope_size;
17230 let offset = decoder.out_of_line_offset(bytes_len)?;
17231 let mut _next_ordinal_to_read = 0;
17233 let mut next_offset = offset;
17234 let end_offset = offset + bytes_len;
17235 _next_ordinal_to_read += 1;
17236 if next_offset >= end_offset {
17237 return Ok(());
17238 }
17239
17240 while _next_ordinal_to_read < 1 {
17242 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17243 _next_ordinal_to_read += 1;
17244 next_offset += envelope_size;
17245 }
17246
17247 let next_out_of_line = decoder.next_out_of_line();
17248 let handles_before = decoder.remaining_handles();
17249 if let Some((inlined, num_bytes, num_handles)) =
17250 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17251 {
17252 let member_inline_size =
17253 <LoadUrlReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17254 if inlined != (member_inline_size <= 4) {
17255 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17256 }
17257 let inner_offset;
17258 let mut inner_depth = depth.clone();
17259 if inlined {
17260 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17261 inner_offset = next_offset;
17262 } else {
17263 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17264 inner_depth.increment()?;
17265 }
17266 let val_ref = self.type_.get_or_insert_with(|| {
17267 fidl::new_empty!(LoadUrlReason, fidl::encoding::DefaultFuchsiaResourceDialect)
17268 });
17269 fidl::decode!(
17270 LoadUrlReason,
17271 fidl::encoding::DefaultFuchsiaResourceDialect,
17272 val_ref,
17273 decoder,
17274 inner_offset,
17275 inner_depth
17276 )?;
17277 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17278 {
17279 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17280 }
17281 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17282 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17283 }
17284 }
17285
17286 next_offset += envelope_size;
17287 _next_ordinal_to_read += 1;
17288 if next_offset >= end_offset {
17289 return Ok(());
17290 }
17291
17292 while _next_ordinal_to_read < 2 {
17294 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17295 _next_ordinal_to_read += 1;
17296 next_offset += envelope_size;
17297 }
17298
17299 let next_out_of_line = decoder.next_out_of_line();
17300 let handles_before = decoder.remaining_handles();
17301 if let Some((inlined, num_bytes, num_handles)) =
17302 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17303 {
17304 let member_inline_size = <fidl::encoding::BoundedString<65536> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17305 if inlined != (member_inline_size <= 4) {
17306 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17307 }
17308 let inner_offset;
17309 let mut inner_depth = depth.clone();
17310 if inlined {
17311 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17312 inner_offset = next_offset;
17313 } else {
17314 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17315 inner_depth.increment()?;
17316 }
17317 let val_ref = self.referrer_url.get_or_insert_with(|| {
17318 fidl::new_empty!(
17319 fidl::encoding::BoundedString<65536>,
17320 fidl::encoding::DefaultFuchsiaResourceDialect
17321 )
17322 });
17323 fidl::decode!(
17324 fidl::encoding::BoundedString<65536>,
17325 fidl::encoding::DefaultFuchsiaResourceDialect,
17326 val_ref,
17327 decoder,
17328 inner_offset,
17329 inner_depth
17330 )?;
17331 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17332 {
17333 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17334 }
17335 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17336 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17337 }
17338 }
17339
17340 next_offset += envelope_size;
17341 _next_ordinal_to_read += 1;
17342 if next_offset >= end_offset {
17343 return Ok(());
17344 }
17345
17346 while _next_ordinal_to_read < 3 {
17348 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17349 _next_ordinal_to_read += 1;
17350 next_offset += envelope_size;
17351 }
17352
17353 let next_out_of_line = decoder.next_out_of_line();
17354 let handles_before = decoder.remaining_handles();
17355 if let Some((inlined, num_bytes, num_handles)) =
17356 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17357 {
17358 let member_inline_size =
17359 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17360 if inlined != (member_inline_size <= 4) {
17361 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17362 }
17363 let inner_offset;
17364 let mut inner_depth = depth.clone();
17365 if inlined {
17366 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17367 inner_offset = next_offset;
17368 } else {
17369 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17370 inner_depth.increment()?;
17371 }
17372 let val_ref = self.was_user_activated.get_or_insert_with(|| {
17373 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
17374 });
17375 fidl::decode!(
17376 bool,
17377 fidl::encoding::DefaultFuchsiaResourceDialect,
17378 val_ref,
17379 decoder,
17380 inner_offset,
17381 inner_depth
17382 )?;
17383 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17384 {
17385 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17386 }
17387 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17388 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17389 }
17390 }
17391
17392 next_offset += envelope_size;
17393 _next_ordinal_to_read += 1;
17394 if next_offset >= end_offset {
17395 return Ok(());
17396 }
17397
17398 while _next_ordinal_to_read < 4 {
17400 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17401 _next_ordinal_to_read += 1;
17402 next_offset += envelope_size;
17403 }
17404
17405 let next_out_of_line = decoder.next_out_of_line();
17406 let handles_before = decoder.remaining_handles();
17407 if let Some((inlined, num_bytes, num_handles)) =
17408 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17409 {
17410 let member_inline_size = <fidl::encoding::UnboundedVector<
17411 fidl_fuchsia_net_http::Header,
17412 > as fidl::encoding::TypeMarker>::inline_size(
17413 decoder.context
17414 );
17415 if inlined != (member_inline_size <= 4) {
17416 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17417 }
17418 let inner_offset;
17419 let mut inner_depth = depth.clone();
17420 if inlined {
17421 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17422 inner_offset = next_offset;
17423 } else {
17424 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17425 inner_depth.increment()?;
17426 }
17427 let val_ref = self.headers.get_or_insert_with(|| {
17428 fidl::new_empty!(
17429 fidl::encoding::UnboundedVector<fidl_fuchsia_net_http::Header>,
17430 fidl::encoding::DefaultFuchsiaResourceDialect
17431 )
17432 });
17433 fidl::decode!(
17434 fidl::encoding::UnboundedVector<fidl_fuchsia_net_http::Header>,
17435 fidl::encoding::DefaultFuchsiaResourceDialect,
17436 val_ref,
17437 decoder,
17438 inner_offset,
17439 inner_depth
17440 )?;
17441 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17442 {
17443 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17444 }
17445 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17446 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17447 }
17448 }
17449
17450 next_offset += envelope_size;
17451
17452 while next_offset < end_offset {
17454 _next_ordinal_to_read += 1;
17455 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17456 next_offset += envelope_size;
17457 }
17458
17459 Ok(())
17460 }
17461 }
17462
17463 impl NavigationState {
17464 #[inline(always)]
17465 fn max_ordinal_present(&self) -> u64 {
17466 if let Some(_) = self.error_detail {
17467 return 8;
17468 }
17469 if let Some(_) = self.favicon {
17470 return 7;
17471 }
17472 if let Some(_) = self.is_main_document_loaded {
17473 return 6;
17474 }
17475 if let Some(_) = self.can_go_back {
17476 return 5;
17477 }
17478 if let Some(_) = self.can_go_forward {
17479 return 4;
17480 }
17481 if let Some(_) = self.page_type {
17482 return 3;
17483 }
17484 if let Some(_) = self.title {
17485 return 2;
17486 }
17487 if let Some(_) = self.url {
17488 return 1;
17489 }
17490 0
17491 }
17492 }
17493
17494 impl fidl::encoding::ResourceTypeMarker for NavigationState {
17495 type Borrowed<'a> = &'a mut Self;
17496 fn take_or_borrow<'a>(
17497 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17498 ) -> Self::Borrowed<'a> {
17499 value
17500 }
17501 }
17502
17503 unsafe impl fidl::encoding::TypeMarker for NavigationState {
17504 type Owned = Self;
17505
17506 #[inline(always)]
17507 fn inline_align(_context: fidl::encoding::Context) -> usize {
17508 8
17509 }
17510
17511 #[inline(always)]
17512 fn inline_size(_context: fidl::encoding::Context) -> usize {
17513 16
17514 }
17515 }
17516
17517 unsafe impl
17518 fidl::encoding::Encode<NavigationState, fidl::encoding::DefaultFuchsiaResourceDialect>
17519 for &mut NavigationState
17520 {
17521 unsafe fn encode(
17522 self,
17523 encoder: &mut fidl::encoding::Encoder<
17524 '_,
17525 fidl::encoding::DefaultFuchsiaResourceDialect,
17526 >,
17527 offset: usize,
17528 mut depth: fidl::encoding::Depth,
17529 ) -> fidl::Result<()> {
17530 encoder.debug_check_bounds::<NavigationState>(offset);
17531 let max_ordinal: u64 = self.max_ordinal_present();
17533 encoder.write_num(max_ordinal, offset);
17534 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17535 if max_ordinal == 0 {
17537 return Ok(());
17538 }
17539 depth.increment()?;
17540 let envelope_size = 8;
17541 let bytes_len = max_ordinal as usize * envelope_size;
17542 #[allow(unused_variables)]
17543 let offset = encoder.out_of_line_offset(bytes_len);
17544 let mut _prev_end_offset: usize = 0;
17545 if 1 > max_ordinal {
17546 return Ok(());
17547 }
17548
17549 let cur_offset: usize = (1 - 1) * envelope_size;
17552
17553 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17555
17556 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65536>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17561 self.url.as_ref().map(<fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow),
17562 encoder, offset + cur_offset, depth
17563 )?;
17564
17565 _prev_end_offset = cur_offset + envelope_size;
17566 if 2 > max_ordinal {
17567 return Ok(());
17568 }
17569
17570 let cur_offset: usize = (2 - 1) * envelope_size;
17573
17574 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17576
17577 fidl::encoding::encode_in_envelope_optional::<
17582 fidl::encoding::UnboundedString,
17583 fidl::encoding::DefaultFuchsiaResourceDialect,
17584 >(
17585 self.title.as_ref().map(
17586 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
17587 ),
17588 encoder,
17589 offset + cur_offset,
17590 depth,
17591 )?;
17592
17593 _prev_end_offset = cur_offset + envelope_size;
17594 if 3 > max_ordinal {
17595 return Ok(());
17596 }
17597
17598 let cur_offset: usize = (3 - 1) * envelope_size;
17601
17602 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17604
17605 fidl::encoding::encode_in_envelope_optional::<
17610 PageType,
17611 fidl::encoding::DefaultFuchsiaResourceDialect,
17612 >(
17613 self.page_type.as_ref().map(<PageType as fidl::encoding::ValueTypeMarker>::borrow),
17614 encoder,
17615 offset + cur_offset,
17616 depth,
17617 )?;
17618
17619 _prev_end_offset = cur_offset + envelope_size;
17620 if 4 > max_ordinal {
17621 return Ok(());
17622 }
17623
17624 let cur_offset: usize = (4 - 1) * envelope_size;
17627
17628 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17630
17631 fidl::encoding::encode_in_envelope_optional::<
17636 bool,
17637 fidl::encoding::DefaultFuchsiaResourceDialect,
17638 >(
17639 self.can_go_forward.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17640 encoder,
17641 offset + cur_offset,
17642 depth,
17643 )?;
17644
17645 _prev_end_offset = cur_offset + envelope_size;
17646 if 5 > max_ordinal {
17647 return Ok(());
17648 }
17649
17650 let cur_offset: usize = (5 - 1) * envelope_size;
17653
17654 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17656
17657 fidl::encoding::encode_in_envelope_optional::<
17662 bool,
17663 fidl::encoding::DefaultFuchsiaResourceDialect,
17664 >(
17665 self.can_go_back.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17666 encoder,
17667 offset + cur_offset,
17668 depth,
17669 )?;
17670
17671 _prev_end_offset = cur_offset + envelope_size;
17672 if 6 > max_ordinal {
17673 return Ok(());
17674 }
17675
17676 let cur_offset: usize = (6 - 1) * envelope_size;
17679
17680 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17682
17683 fidl::encoding::encode_in_envelope_optional::<
17688 bool,
17689 fidl::encoding::DefaultFuchsiaResourceDialect,
17690 >(
17691 self.is_main_document_loaded
17692 .as_ref()
17693 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17694 encoder,
17695 offset + cur_offset,
17696 depth,
17697 )?;
17698
17699 _prev_end_offset = cur_offset + envelope_size;
17700 if 7 > max_ordinal {
17701 return Ok(());
17702 }
17703
17704 let cur_offset: usize = (7 - 1) * envelope_size;
17707
17708 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17710
17711 fidl::encoding::encode_in_envelope_optional::<
17716 Favicon,
17717 fidl::encoding::DefaultFuchsiaResourceDialect,
17718 >(
17719 self.favicon
17720 .as_mut()
17721 .map(<Favicon as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
17722 encoder,
17723 offset + cur_offset,
17724 depth,
17725 )?;
17726
17727 _prev_end_offset = cur_offset + envelope_size;
17728 if 8 > max_ordinal {
17729 return Ok(());
17730 }
17731
17732 let cur_offset: usize = (8 - 1) * envelope_size;
17735
17736 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17738
17739 fidl::encoding::encode_in_envelope_optional::<
17744 ErrorDetail,
17745 fidl::encoding::DefaultFuchsiaResourceDialect,
17746 >(
17747 self.error_detail
17748 .as_ref()
17749 .map(<ErrorDetail as fidl::encoding::ValueTypeMarker>::borrow),
17750 encoder,
17751 offset + cur_offset,
17752 depth,
17753 )?;
17754
17755 _prev_end_offset = cur_offset + envelope_size;
17756
17757 Ok(())
17758 }
17759 }
17760
17761 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17762 for NavigationState
17763 {
17764 #[inline(always)]
17765 fn new_empty() -> Self {
17766 Self::default()
17767 }
17768
17769 unsafe fn decode(
17770 &mut self,
17771 decoder: &mut fidl::encoding::Decoder<
17772 '_,
17773 fidl::encoding::DefaultFuchsiaResourceDialect,
17774 >,
17775 offset: usize,
17776 mut depth: fidl::encoding::Depth,
17777 ) -> fidl::Result<()> {
17778 decoder.debug_check_bounds::<Self>(offset);
17779 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17780 None => return Err(fidl::Error::NotNullable),
17781 Some(len) => len,
17782 };
17783 if len == 0 {
17785 return Ok(());
17786 };
17787 depth.increment()?;
17788 let envelope_size = 8;
17789 let bytes_len = len * envelope_size;
17790 let offset = decoder.out_of_line_offset(bytes_len)?;
17791 let mut _next_ordinal_to_read = 0;
17793 let mut next_offset = offset;
17794 let end_offset = offset + bytes_len;
17795 _next_ordinal_to_read += 1;
17796 if next_offset >= end_offset {
17797 return Ok(());
17798 }
17799
17800 while _next_ordinal_to_read < 1 {
17802 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17803 _next_ordinal_to_read += 1;
17804 next_offset += envelope_size;
17805 }
17806
17807 let next_out_of_line = decoder.next_out_of_line();
17808 let handles_before = decoder.remaining_handles();
17809 if let Some((inlined, num_bytes, num_handles)) =
17810 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17811 {
17812 let member_inline_size = <fidl::encoding::BoundedString<65536> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17813 if inlined != (member_inline_size <= 4) {
17814 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17815 }
17816 let inner_offset;
17817 let mut inner_depth = depth.clone();
17818 if inlined {
17819 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17820 inner_offset = next_offset;
17821 } else {
17822 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17823 inner_depth.increment()?;
17824 }
17825 let val_ref = self.url.get_or_insert_with(|| {
17826 fidl::new_empty!(
17827 fidl::encoding::BoundedString<65536>,
17828 fidl::encoding::DefaultFuchsiaResourceDialect
17829 )
17830 });
17831 fidl::decode!(
17832 fidl::encoding::BoundedString<65536>,
17833 fidl::encoding::DefaultFuchsiaResourceDialect,
17834 val_ref,
17835 decoder,
17836 inner_offset,
17837 inner_depth
17838 )?;
17839 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17840 {
17841 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17842 }
17843 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17844 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17845 }
17846 }
17847
17848 next_offset += envelope_size;
17849 _next_ordinal_to_read += 1;
17850 if next_offset >= end_offset {
17851 return Ok(());
17852 }
17853
17854 while _next_ordinal_to_read < 2 {
17856 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17857 _next_ordinal_to_read += 1;
17858 next_offset += envelope_size;
17859 }
17860
17861 let next_out_of_line = decoder.next_out_of_line();
17862 let handles_before = decoder.remaining_handles();
17863 if let Some((inlined, num_bytes, num_handles)) =
17864 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17865 {
17866 let member_inline_size =
17867 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
17868 decoder.context,
17869 );
17870 if inlined != (member_inline_size <= 4) {
17871 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17872 }
17873 let inner_offset;
17874 let mut inner_depth = depth.clone();
17875 if inlined {
17876 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17877 inner_offset = next_offset;
17878 } else {
17879 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17880 inner_depth.increment()?;
17881 }
17882 let val_ref = self.title.get_or_insert_with(|| {
17883 fidl::new_empty!(
17884 fidl::encoding::UnboundedString,
17885 fidl::encoding::DefaultFuchsiaResourceDialect
17886 )
17887 });
17888 fidl::decode!(
17889 fidl::encoding::UnboundedString,
17890 fidl::encoding::DefaultFuchsiaResourceDialect,
17891 val_ref,
17892 decoder,
17893 inner_offset,
17894 inner_depth
17895 )?;
17896 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17897 {
17898 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17899 }
17900 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17901 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17902 }
17903 }
17904
17905 next_offset += envelope_size;
17906 _next_ordinal_to_read += 1;
17907 if next_offset >= end_offset {
17908 return Ok(());
17909 }
17910
17911 while _next_ordinal_to_read < 3 {
17913 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17914 _next_ordinal_to_read += 1;
17915 next_offset += envelope_size;
17916 }
17917
17918 let next_out_of_line = decoder.next_out_of_line();
17919 let handles_before = decoder.remaining_handles();
17920 if let Some((inlined, num_bytes, num_handles)) =
17921 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17922 {
17923 let member_inline_size =
17924 <PageType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17925 if inlined != (member_inline_size <= 4) {
17926 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17927 }
17928 let inner_offset;
17929 let mut inner_depth = depth.clone();
17930 if inlined {
17931 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17932 inner_offset = next_offset;
17933 } else {
17934 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17935 inner_depth.increment()?;
17936 }
17937 let val_ref = self.page_type.get_or_insert_with(|| {
17938 fidl::new_empty!(PageType, fidl::encoding::DefaultFuchsiaResourceDialect)
17939 });
17940 fidl::decode!(
17941 PageType,
17942 fidl::encoding::DefaultFuchsiaResourceDialect,
17943 val_ref,
17944 decoder,
17945 inner_offset,
17946 inner_depth
17947 )?;
17948 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17949 {
17950 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17951 }
17952 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17953 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17954 }
17955 }
17956
17957 next_offset += envelope_size;
17958 _next_ordinal_to_read += 1;
17959 if next_offset >= end_offset {
17960 return Ok(());
17961 }
17962
17963 while _next_ordinal_to_read < 4 {
17965 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17966 _next_ordinal_to_read += 1;
17967 next_offset += envelope_size;
17968 }
17969
17970 let next_out_of_line = decoder.next_out_of_line();
17971 let handles_before = decoder.remaining_handles();
17972 if let Some((inlined, num_bytes, num_handles)) =
17973 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17974 {
17975 let member_inline_size =
17976 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17977 if inlined != (member_inline_size <= 4) {
17978 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17979 }
17980 let inner_offset;
17981 let mut inner_depth = depth.clone();
17982 if inlined {
17983 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17984 inner_offset = next_offset;
17985 } else {
17986 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17987 inner_depth.increment()?;
17988 }
17989 let val_ref = self.can_go_forward.get_or_insert_with(|| {
17990 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
17991 });
17992 fidl::decode!(
17993 bool,
17994 fidl::encoding::DefaultFuchsiaResourceDialect,
17995 val_ref,
17996 decoder,
17997 inner_offset,
17998 inner_depth
17999 )?;
18000 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18001 {
18002 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18003 }
18004 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18005 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18006 }
18007 }
18008
18009 next_offset += envelope_size;
18010 _next_ordinal_to_read += 1;
18011 if next_offset >= end_offset {
18012 return Ok(());
18013 }
18014
18015 while _next_ordinal_to_read < 5 {
18017 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18018 _next_ordinal_to_read += 1;
18019 next_offset += envelope_size;
18020 }
18021
18022 let next_out_of_line = decoder.next_out_of_line();
18023 let handles_before = decoder.remaining_handles();
18024 if let Some((inlined, num_bytes, num_handles)) =
18025 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18026 {
18027 let member_inline_size =
18028 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18029 if inlined != (member_inline_size <= 4) {
18030 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18031 }
18032 let inner_offset;
18033 let mut inner_depth = depth.clone();
18034 if inlined {
18035 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18036 inner_offset = next_offset;
18037 } else {
18038 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18039 inner_depth.increment()?;
18040 }
18041 let val_ref = self.can_go_back.get_or_insert_with(|| {
18042 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
18043 });
18044 fidl::decode!(
18045 bool,
18046 fidl::encoding::DefaultFuchsiaResourceDialect,
18047 val_ref,
18048 decoder,
18049 inner_offset,
18050 inner_depth
18051 )?;
18052 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18053 {
18054 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18055 }
18056 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18057 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18058 }
18059 }
18060
18061 next_offset += envelope_size;
18062 _next_ordinal_to_read += 1;
18063 if next_offset >= end_offset {
18064 return Ok(());
18065 }
18066
18067 while _next_ordinal_to_read < 6 {
18069 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18070 _next_ordinal_to_read += 1;
18071 next_offset += envelope_size;
18072 }
18073
18074 let next_out_of_line = decoder.next_out_of_line();
18075 let handles_before = decoder.remaining_handles();
18076 if let Some((inlined, num_bytes, num_handles)) =
18077 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18078 {
18079 let member_inline_size =
18080 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18081 if inlined != (member_inline_size <= 4) {
18082 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18083 }
18084 let inner_offset;
18085 let mut inner_depth = depth.clone();
18086 if inlined {
18087 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18088 inner_offset = next_offset;
18089 } else {
18090 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18091 inner_depth.increment()?;
18092 }
18093 let val_ref = self.is_main_document_loaded.get_or_insert_with(|| {
18094 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
18095 });
18096 fidl::decode!(
18097 bool,
18098 fidl::encoding::DefaultFuchsiaResourceDialect,
18099 val_ref,
18100 decoder,
18101 inner_offset,
18102 inner_depth
18103 )?;
18104 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18105 {
18106 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18107 }
18108 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18109 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18110 }
18111 }
18112
18113 next_offset += envelope_size;
18114 _next_ordinal_to_read += 1;
18115 if next_offset >= end_offset {
18116 return Ok(());
18117 }
18118
18119 while _next_ordinal_to_read < 7 {
18121 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18122 _next_ordinal_to_read += 1;
18123 next_offset += envelope_size;
18124 }
18125
18126 let next_out_of_line = decoder.next_out_of_line();
18127 let handles_before = decoder.remaining_handles();
18128 if let Some((inlined, num_bytes, num_handles)) =
18129 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18130 {
18131 let member_inline_size =
18132 <Favicon as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18133 if inlined != (member_inline_size <= 4) {
18134 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18135 }
18136 let inner_offset;
18137 let mut inner_depth = depth.clone();
18138 if inlined {
18139 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18140 inner_offset = next_offset;
18141 } else {
18142 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18143 inner_depth.increment()?;
18144 }
18145 let val_ref = self.favicon.get_or_insert_with(|| {
18146 fidl::new_empty!(Favicon, fidl::encoding::DefaultFuchsiaResourceDialect)
18147 });
18148 fidl::decode!(
18149 Favicon,
18150 fidl::encoding::DefaultFuchsiaResourceDialect,
18151 val_ref,
18152 decoder,
18153 inner_offset,
18154 inner_depth
18155 )?;
18156 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18157 {
18158 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18159 }
18160 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18161 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18162 }
18163 }
18164
18165 next_offset += envelope_size;
18166 _next_ordinal_to_read += 1;
18167 if next_offset >= end_offset {
18168 return Ok(());
18169 }
18170
18171 while _next_ordinal_to_read < 8 {
18173 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18174 _next_ordinal_to_read += 1;
18175 next_offset += envelope_size;
18176 }
18177
18178 let next_out_of_line = decoder.next_out_of_line();
18179 let handles_before = decoder.remaining_handles();
18180 if let Some((inlined, num_bytes, num_handles)) =
18181 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18182 {
18183 let member_inline_size =
18184 <ErrorDetail as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18185 if inlined != (member_inline_size <= 4) {
18186 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18187 }
18188 let inner_offset;
18189 let mut inner_depth = depth.clone();
18190 if inlined {
18191 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18192 inner_offset = next_offset;
18193 } else {
18194 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18195 inner_depth.increment()?;
18196 }
18197 let val_ref = self.error_detail.get_or_insert_with(|| {
18198 fidl::new_empty!(ErrorDetail, fidl::encoding::DefaultFuchsiaResourceDialect)
18199 });
18200 fidl::decode!(
18201 ErrorDetail,
18202 fidl::encoding::DefaultFuchsiaResourceDialect,
18203 val_ref,
18204 decoder,
18205 inner_offset,
18206 inner_depth
18207 )?;
18208 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18209 {
18210 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18211 }
18212 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18213 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18214 }
18215 }
18216
18217 next_offset += envelope_size;
18218
18219 while next_offset < end_offset {
18221 _next_ordinal_to_read += 1;
18222 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18223 next_offset += envelope_size;
18224 }
18225
18226 Ok(())
18227 }
18228 }
18229
18230 impl PopupFrameCreationInfo {
18231 #[inline(always)]
18232 fn max_ordinal_present(&self) -> u64 {
18233 if let Some(_) = self.initiated_by_user {
18234 return 2;
18235 }
18236 if let Some(_) = self.initial_url {
18237 return 1;
18238 }
18239 0
18240 }
18241 }
18242
18243 impl fidl::encoding::ResourceTypeMarker for PopupFrameCreationInfo {
18244 type Borrowed<'a> = &'a mut Self;
18245 fn take_or_borrow<'a>(
18246 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18247 ) -> Self::Borrowed<'a> {
18248 value
18249 }
18250 }
18251
18252 unsafe impl fidl::encoding::TypeMarker for PopupFrameCreationInfo {
18253 type Owned = Self;
18254
18255 #[inline(always)]
18256 fn inline_align(_context: fidl::encoding::Context) -> usize {
18257 8
18258 }
18259
18260 #[inline(always)]
18261 fn inline_size(_context: fidl::encoding::Context) -> usize {
18262 16
18263 }
18264 }
18265
18266 unsafe impl
18267 fidl::encoding::Encode<
18268 PopupFrameCreationInfo,
18269 fidl::encoding::DefaultFuchsiaResourceDialect,
18270 > for &mut PopupFrameCreationInfo
18271 {
18272 unsafe fn encode(
18273 self,
18274 encoder: &mut fidl::encoding::Encoder<
18275 '_,
18276 fidl::encoding::DefaultFuchsiaResourceDialect,
18277 >,
18278 offset: usize,
18279 mut depth: fidl::encoding::Depth,
18280 ) -> fidl::Result<()> {
18281 encoder.debug_check_bounds::<PopupFrameCreationInfo>(offset);
18282 let max_ordinal: u64 = self.max_ordinal_present();
18284 encoder.write_num(max_ordinal, offset);
18285 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18286 if max_ordinal == 0 {
18288 return Ok(());
18289 }
18290 depth.increment()?;
18291 let envelope_size = 8;
18292 let bytes_len = max_ordinal as usize * envelope_size;
18293 #[allow(unused_variables)]
18294 let offset = encoder.out_of_line_offset(bytes_len);
18295 let mut _prev_end_offset: usize = 0;
18296 if 1 > max_ordinal {
18297 return Ok(());
18298 }
18299
18300 let cur_offset: usize = (1 - 1) * envelope_size;
18303
18304 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18306
18307 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65536>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18312 self.initial_url.as_ref().map(<fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow),
18313 encoder, offset + cur_offset, depth
18314 )?;
18315
18316 _prev_end_offset = cur_offset + envelope_size;
18317 if 2 > max_ordinal {
18318 return Ok(());
18319 }
18320
18321 let cur_offset: usize = (2 - 1) * envelope_size;
18324
18325 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18327
18328 fidl::encoding::encode_in_envelope_optional::<
18333 bool,
18334 fidl::encoding::DefaultFuchsiaResourceDialect,
18335 >(
18336 self.initiated_by_user
18337 .as_ref()
18338 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
18339 encoder,
18340 offset + cur_offset,
18341 depth,
18342 )?;
18343
18344 _prev_end_offset = cur_offset + envelope_size;
18345
18346 Ok(())
18347 }
18348 }
18349
18350 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18351 for PopupFrameCreationInfo
18352 {
18353 #[inline(always)]
18354 fn new_empty() -> Self {
18355 Self::default()
18356 }
18357
18358 unsafe fn decode(
18359 &mut self,
18360 decoder: &mut fidl::encoding::Decoder<
18361 '_,
18362 fidl::encoding::DefaultFuchsiaResourceDialect,
18363 >,
18364 offset: usize,
18365 mut depth: fidl::encoding::Depth,
18366 ) -> fidl::Result<()> {
18367 decoder.debug_check_bounds::<Self>(offset);
18368 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18369 None => return Err(fidl::Error::NotNullable),
18370 Some(len) => len,
18371 };
18372 if len == 0 {
18374 return Ok(());
18375 };
18376 depth.increment()?;
18377 let envelope_size = 8;
18378 let bytes_len = len * envelope_size;
18379 let offset = decoder.out_of_line_offset(bytes_len)?;
18380 let mut _next_ordinal_to_read = 0;
18382 let mut next_offset = offset;
18383 let end_offset = offset + bytes_len;
18384 _next_ordinal_to_read += 1;
18385 if next_offset >= end_offset {
18386 return Ok(());
18387 }
18388
18389 while _next_ordinal_to_read < 1 {
18391 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18392 _next_ordinal_to_read += 1;
18393 next_offset += envelope_size;
18394 }
18395
18396 let next_out_of_line = decoder.next_out_of_line();
18397 let handles_before = decoder.remaining_handles();
18398 if let Some((inlined, num_bytes, num_handles)) =
18399 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18400 {
18401 let member_inline_size = <fidl::encoding::BoundedString<65536> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18402 if inlined != (member_inline_size <= 4) {
18403 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18404 }
18405 let inner_offset;
18406 let mut inner_depth = depth.clone();
18407 if inlined {
18408 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18409 inner_offset = next_offset;
18410 } else {
18411 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18412 inner_depth.increment()?;
18413 }
18414 let val_ref = self.initial_url.get_or_insert_with(|| {
18415 fidl::new_empty!(
18416 fidl::encoding::BoundedString<65536>,
18417 fidl::encoding::DefaultFuchsiaResourceDialect
18418 )
18419 });
18420 fidl::decode!(
18421 fidl::encoding::BoundedString<65536>,
18422 fidl::encoding::DefaultFuchsiaResourceDialect,
18423 val_ref,
18424 decoder,
18425 inner_offset,
18426 inner_depth
18427 )?;
18428 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18429 {
18430 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18431 }
18432 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18433 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18434 }
18435 }
18436
18437 next_offset += envelope_size;
18438 _next_ordinal_to_read += 1;
18439 if next_offset >= end_offset {
18440 return Ok(());
18441 }
18442
18443 while _next_ordinal_to_read < 2 {
18445 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18446 _next_ordinal_to_read += 1;
18447 next_offset += envelope_size;
18448 }
18449
18450 let next_out_of_line = decoder.next_out_of_line();
18451 let handles_before = decoder.remaining_handles();
18452 if let Some((inlined, num_bytes, num_handles)) =
18453 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18454 {
18455 let member_inline_size =
18456 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18457 if inlined != (member_inline_size <= 4) {
18458 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18459 }
18460 let inner_offset;
18461 let mut inner_depth = depth.clone();
18462 if inlined {
18463 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18464 inner_offset = next_offset;
18465 } else {
18466 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18467 inner_depth.increment()?;
18468 }
18469 let val_ref = self.initiated_by_user.get_or_insert_with(|| {
18470 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
18471 });
18472 fidl::decode!(
18473 bool,
18474 fidl::encoding::DefaultFuchsiaResourceDialect,
18475 val_ref,
18476 decoder,
18477 inner_offset,
18478 inner_depth
18479 )?;
18480 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18481 {
18482 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18483 }
18484 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18485 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18486 }
18487 }
18488
18489 next_offset += envelope_size;
18490
18491 while next_offset < end_offset {
18493 _next_ordinal_to_read += 1;
18494 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18495 next_offset += envelope_size;
18496 }
18497
18498 Ok(())
18499 }
18500 }
18501
18502 impl WebMessage {
18503 #[inline(always)]
18504 fn max_ordinal_present(&self) -> u64 {
18505 if let Some(_) = self.outgoing_transfer {
18506 return 3;
18507 }
18508 if let Some(_) = self.incoming_transfer {
18509 return 2;
18510 }
18511 if let Some(_) = self.data {
18512 return 1;
18513 }
18514 0
18515 }
18516 }
18517
18518 impl fidl::encoding::ResourceTypeMarker for WebMessage {
18519 type Borrowed<'a> = &'a mut Self;
18520 fn take_or_borrow<'a>(
18521 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18522 ) -> Self::Borrowed<'a> {
18523 value
18524 }
18525 }
18526
18527 unsafe impl fidl::encoding::TypeMarker for WebMessage {
18528 type Owned = Self;
18529
18530 #[inline(always)]
18531 fn inline_align(_context: fidl::encoding::Context) -> usize {
18532 8
18533 }
18534
18535 #[inline(always)]
18536 fn inline_size(_context: fidl::encoding::Context) -> usize {
18537 16
18538 }
18539 }
18540
18541 unsafe impl fidl::encoding::Encode<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>
18542 for &mut WebMessage
18543 {
18544 unsafe fn encode(
18545 self,
18546 encoder: &mut fidl::encoding::Encoder<
18547 '_,
18548 fidl::encoding::DefaultFuchsiaResourceDialect,
18549 >,
18550 offset: usize,
18551 mut depth: fidl::encoding::Depth,
18552 ) -> fidl::Result<()> {
18553 encoder.debug_check_bounds::<WebMessage>(offset);
18554 let max_ordinal: u64 = self.max_ordinal_present();
18556 encoder.write_num(max_ordinal, offset);
18557 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18558 if max_ordinal == 0 {
18560 return Ok(());
18561 }
18562 depth.increment()?;
18563 let envelope_size = 8;
18564 let bytes_len = max_ordinal as usize * envelope_size;
18565 #[allow(unused_variables)]
18566 let offset = encoder.out_of_line_offset(bytes_len);
18567 let mut _prev_end_offset: usize = 0;
18568 if 1 > max_ordinal {
18569 return Ok(());
18570 }
18571
18572 let cur_offset: usize = (1 - 1) * envelope_size;
18575
18576 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18578
18579 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
18584 self.data.as_mut().map(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18585 encoder, offset + cur_offset, depth
18586 )?;
18587
18588 _prev_end_offset = cur_offset + envelope_size;
18589 if 2 > max_ordinal {
18590 return Ok(());
18591 }
18592
18593 let cur_offset: usize = (2 - 1) * envelope_size;
18596
18597 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18599
18600 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<IncomingTransferable>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18605 self.incoming_transfer.as_mut().map(<fidl::encoding::UnboundedVector<IncomingTransferable> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18606 encoder, offset + cur_offset, depth
18607 )?;
18608
18609 _prev_end_offset = cur_offset + envelope_size;
18610 if 3 > max_ordinal {
18611 return Ok(());
18612 }
18613
18614 let cur_offset: usize = (3 - 1) * envelope_size;
18617
18618 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18620
18621 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<OutgoingTransferable>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18626 self.outgoing_transfer.as_mut().map(<fidl::encoding::UnboundedVector<OutgoingTransferable> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18627 encoder, offset + cur_offset, depth
18628 )?;
18629
18630 _prev_end_offset = cur_offset + envelope_size;
18631
18632 Ok(())
18633 }
18634 }
18635
18636 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for WebMessage {
18637 #[inline(always)]
18638 fn new_empty() -> Self {
18639 Self::default()
18640 }
18641
18642 unsafe fn decode(
18643 &mut self,
18644 decoder: &mut fidl::encoding::Decoder<
18645 '_,
18646 fidl::encoding::DefaultFuchsiaResourceDialect,
18647 >,
18648 offset: usize,
18649 mut depth: fidl::encoding::Depth,
18650 ) -> fidl::Result<()> {
18651 decoder.debug_check_bounds::<Self>(offset);
18652 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18653 None => return Err(fidl::Error::NotNullable),
18654 Some(len) => len,
18655 };
18656 if len == 0 {
18658 return Ok(());
18659 };
18660 depth.increment()?;
18661 let envelope_size = 8;
18662 let bytes_len = len * envelope_size;
18663 let offset = decoder.out_of_line_offset(bytes_len)?;
18664 let mut _next_ordinal_to_read = 0;
18666 let mut next_offset = offset;
18667 let end_offset = offset + bytes_len;
18668 _next_ordinal_to_read += 1;
18669 if next_offset >= end_offset {
18670 return Ok(());
18671 }
18672
18673 while _next_ordinal_to_read < 1 {
18675 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18676 _next_ordinal_to_read += 1;
18677 next_offset += envelope_size;
18678 }
18679
18680 let next_out_of_line = decoder.next_out_of_line();
18681 let handles_before = decoder.remaining_handles();
18682 if let Some((inlined, num_bytes, num_handles)) =
18683 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18684 {
18685 let member_inline_size =
18686 <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
18687 decoder.context,
18688 );
18689 if inlined != (member_inline_size <= 4) {
18690 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18691 }
18692 let inner_offset;
18693 let mut inner_depth = depth.clone();
18694 if inlined {
18695 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18696 inner_offset = next_offset;
18697 } else {
18698 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18699 inner_depth.increment()?;
18700 }
18701 let val_ref = self.data.get_or_insert_with(|| {
18702 fidl::new_empty!(
18703 fidl_fuchsia_mem::Buffer,
18704 fidl::encoding::DefaultFuchsiaResourceDialect
18705 )
18706 });
18707 fidl::decode!(
18708 fidl_fuchsia_mem::Buffer,
18709 fidl::encoding::DefaultFuchsiaResourceDialect,
18710 val_ref,
18711 decoder,
18712 inner_offset,
18713 inner_depth
18714 )?;
18715 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18716 {
18717 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18718 }
18719 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18720 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18721 }
18722 }
18723
18724 next_offset += envelope_size;
18725 _next_ordinal_to_read += 1;
18726 if next_offset >= end_offset {
18727 return Ok(());
18728 }
18729
18730 while _next_ordinal_to_read < 2 {
18732 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18733 _next_ordinal_to_read += 1;
18734 next_offset += envelope_size;
18735 }
18736
18737 let next_out_of_line = decoder.next_out_of_line();
18738 let handles_before = decoder.remaining_handles();
18739 if let Some((inlined, num_bytes, num_handles)) =
18740 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18741 {
18742 let member_inline_size = <fidl::encoding::UnboundedVector<IncomingTransferable> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18743 if inlined != (member_inline_size <= 4) {
18744 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18745 }
18746 let inner_offset;
18747 let mut inner_depth = depth.clone();
18748 if inlined {
18749 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18750 inner_offset = next_offset;
18751 } else {
18752 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18753 inner_depth.increment()?;
18754 }
18755 let val_ref = self.incoming_transfer.get_or_insert_with(|| {
18756 fidl::new_empty!(
18757 fidl::encoding::UnboundedVector<IncomingTransferable>,
18758 fidl::encoding::DefaultFuchsiaResourceDialect
18759 )
18760 });
18761 fidl::decode!(
18762 fidl::encoding::UnboundedVector<IncomingTransferable>,
18763 fidl::encoding::DefaultFuchsiaResourceDialect,
18764 val_ref,
18765 decoder,
18766 inner_offset,
18767 inner_depth
18768 )?;
18769 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18770 {
18771 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18772 }
18773 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18774 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18775 }
18776 }
18777
18778 next_offset += envelope_size;
18779 _next_ordinal_to_read += 1;
18780 if next_offset >= end_offset {
18781 return Ok(());
18782 }
18783
18784 while _next_ordinal_to_read < 3 {
18786 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18787 _next_ordinal_to_read += 1;
18788 next_offset += envelope_size;
18789 }
18790
18791 let next_out_of_line = decoder.next_out_of_line();
18792 let handles_before = decoder.remaining_handles();
18793 if let Some((inlined, num_bytes, num_handles)) =
18794 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18795 {
18796 let member_inline_size = <fidl::encoding::UnboundedVector<OutgoingTransferable> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18797 if inlined != (member_inline_size <= 4) {
18798 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18799 }
18800 let inner_offset;
18801 let mut inner_depth = depth.clone();
18802 if inlined {
18803 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18804 inner_offset = next_offset;
18805 } else {
18806 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18807 inner_depth.increment()?;
18808 }
18809 let val_ref = self.outgoing_transfer.get_or_insert_with(|| {
18810 fidl::new_empty!(
18811 fidl::encoding::UnboundedVector<OutgoingTransferable>,
18812 fidl::encoding::DefaultFuchsiaResourceDialect
18813 )
18814 });
18815 fidl::decode!(
18816 fidl::encoding::UnboundedVector<OutgoingTransferable>,
18817 fidl::encoding::DefaultFuchsiaResourceDialect,
18818 val_ref,
18819 decoder,
18820 inner_offset,
18821 inner_depth
18822 )?;
18823 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18824 {
18825 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18826 }
18827 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18828 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18829 }
18830 }
18831
18832 next_offset += envelope_size;
18833
18834 while next_offset < end_offset {
18836 _next_ordinal_to_read += 1;
18837 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18838 next_offset += envelope_size;
18839 }
18840
18841 Ok(())
18842 }
18843 }
18844
18845 impl fidl::encoding::ResourceTypeMarker for IncomingTransferable {
18846 type Borrowed<'a> = &'a mut Self;
18847 fn take_or_borrow<'a>(
18848 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18849 ) -> Self::Borrowed<'a> {
18850 value
18851 }
18852 }
18853
18854 unsafe impl fidl::encoding::TypeMarker for IncomingTransferable {
18855 type Owned = Self;
18856
18857 #[inline(always)]
18858 fn inline_align(_context: fidl::encoding::Context) -> usize {
18859 8
18860 }
18861
18862 #[inline(always)]
18863 fn inline_size(_context: fidl::encoding::Context) -> usize {
18864 16
18865 }
18866 }
18867
18868 unsafe impl
18869 fidl::encoding::Encode<IncomingTransferable, fidl::encoding::DefaultFuchsiaResourceDialect>
18870 for &mut IncomingTransferable
18871 {
18872 #[inline]
18873 unsafe fn encode(
18874 self,
18875 encoder: &mut fidl::encoding::Encoder<
18876 '_,
18877 fidl::encoding::DefaultFuchsiaResourceDialect,
18878 >,
18879 offset: usize,
18880 _depth: fidl::encoding::Depth,
18881 ) -> fidl::Result<()> {
18882 encoder.debug_check_bounds::<IncomingTransferable>(offset);
18883 encoder.write_num::<u64>(self.ordinal(), offset);
18884 match self {
18885 IncomingTransferable::MessagePort(ref mut val) => {
18886 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18887 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
18888 encoder, offset + 8, _depth
18889 )
18890 }
18891 IncomingTransferable::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
18892 }
18893 }
18894 }
18895
18896 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18897 for IncomingTransferable
18898 {
18899 #[inline(always)]
18900 fn new_empty() -> Self {
18901 Self::__SourceBreaking { unknown_ordinal: 0 }
18902 }
18903
18904 #[inline]
18905 unsafe fn decode(
18906 &mut self,
18907 decoder: &mut fidl::encoding::Decoder<
18908 '_,
18909 fidl::encoding::DefaultFuchsiaResourceDialect,
18910 >,
18911 offset: usize,
18912 mut depth: fidl::encoding::Depth,
18913 ) -> fidl::Result<()> {
18914 decoder.debug_check_bounds::<Self>(offset);
18915 #[allow(unused_variables)]
18916 let next_out_of_line = decoder.next_out_of_line();
18917 let handles_before = decoder.remaining_handles();
18918 let (ordinal, inlined, num_bytes, num_handles) =
18919 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
18920
18921 let member_inline_size = match ordinal {
18922 1 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18923 0 => return Err(fidl::Error::UnknownUnionTag),
18924 _ => num_bytes as usize,
18925 };
18926
18927 if inlined != (member_inline_size <= 4) {
18928 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18929 }
18930 let _inner_offset;
18931 if inlined {
18932 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
18933 _inner_offset = offset + 8;
18934 } else {
18935 depth.increment()?;
18936 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18937 }
18938 match ordinal {
18939 1 => {
18940 #[allow(irrefutable_let_patterns)]
18941 if let IncomingTransferable::MessagePort(_) = self {
18942 } else {
18944 *self = IncomingTransferable::MessagePort(fidl::new_empty!(
18946 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>>,
18947 fidl::encoding::DefaultFuchsiaResourceDialect
18948 ));
18949 }
18950 #[allow(irrefutable_let_patterns)]
18951 if let IncomingTransferable::MessagePort(ref mut val) = self {
18952 fidl::decode!(
18953 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>>,
18954 fidl::encoding::DefaultFuchsiaResourceDialect,
18955 val,
18956 decoder,
18957 _inner_offset,
18958 depth
18959 )?;
18960 } else {
18961 unreachable!()
18962 }
18963 }
18964 #[allow(deprecated)]
18965 ordinal => {
18966 for _ in 0..num_handles {
18967 decoder.drop_next_handle()?;
18968 }
18969 *self = IncomingTransferable::__SourceBreaking { unknown_ordinal: ordinal };
18970 }
18971 }
18972 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
18973 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18974 }
18975 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18976 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18977 }
18978 Ok(())
18979 }
18980 }
18981
18982 impl fidl::encoding::ResourceTypeMarker for NavigationDecision {
18983 type Borrowed<'a> = &'a mut Self;
18984 fn take_or_borrow<'a>(
18985 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18986 ) -> Self::Borrowed<'a> {
18987 value
18988 }
18989 }
18990
18991 unsafe impl fidl::encoding::TypeMarker for NavigationDecision {
18992 type Owned = Self;
18993
18994 #[inline(always)]
18995 fn inline_align(_context: fidl::encoding::Context) -> usize {
18996 8
18997 }
18998
18999 #[inline(always)]
19000 fn inline_size(_context: fidl::encoding::Context) -> usize {
19001 16
19002 }
19003 }
19004
19005 unsafe impl
19006 fidl::encoding::Encode<NavigationDecision, fidl::encoding::DefaultFuchsiaResourceDialect>
19007 for &mut NavigationDecision
19008 {
19009 #[inline]
19010 unsafe fn encode(
19011 self,
19012 encoder: &mut fidl::encoding::Encoder<
19013 '_,
19014 fidl::encoding::DefaultFuchsiaResourceDialect,
19015 >,
19016 offset: usize,
19017 _depth: fidl::encoding::Depth,
19018 ) -> fidl::Result<()> {
19019 encoder.debug_check_bounds::<NavigationDecision>(offset);
19020 encoder.write_num::<u64>(self.ordinal(), offset);
19021 match self {
19022 NavigationDecision::Proceed(ref val) => fidl::encoding::encode_in_envelope::<
19023 NoArgumentsAction,
19024 fidl::encoding::DefaultFuchsiaResourceDialect,
19025 >(
19026 <NoArgumentsAction as fidl::encoding::ValueTypeMarker>::borrow(val),
19027 encoder,
19028 offset + 8,
19029 _depth,
19030 ),
19031 NavigationDecision::Abort(ref val) => fidl::encoding::encode_in_envelope::<
19032 NoArgumentsAction,
19033 fidl::encoding::DefaultFuchsiaResourceDialect,
19034 >(
19035 <NoArgumentsAction as fidl::encoding::ValueTypeMarker>::borrow(val),
19036 encoder,
19037 offset + 8,
19038 _depth,
19039 ),
19040 }
19041 }
19042 }
19043
19044 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19045 for NavigationDecision
19046 {
19047 #[inline(always)]
19048 fn new_empty() -> Self {
19049 Self::Proceed(fidl::new_empty!(
19050 NoArgumentsAction,
19051 fidl::encoding::DefaultFuchsiaResourceDialect
19052 ))
19053 }
19054
19055 #[inline]
19056 unsafe fn decode(
19057 &mut self,
19058 decoder: &mut fidl::encoding::Decoder<
19059 '_,
19060 fidl::encoding::DefaultFuchsiaResourceDialect,
19061 >,
19062 offset: usize,
19063 mut depth: fidl::encoding::Depth,
19064 ) -> fidl::Result<()> {
19065 decoder.debug_check_bounds::<Self>(offset);
19066 #[allow(unused_variables)]
19067 let next_out_of_line = decoder.next_out_of_line();
19068 let handles_before = decoder.remaining_handles();
19069 let (ordinal, inlined, num_bytes, num_handles) =
19070 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19071
19072 let member_inline_size = match ordinal {
19073 1 => {
19074 <NoArgumentsAction as fidl::encoding::TypeMarker>::inline_size(decoder.context)
19075 }
19076 2 => {
19077 <NoArgumentsAction as fidl::encoding::TypeMarker>::inline_size(decoder.context)
19078 }
19079 _ => return Err(fidl::Error::UnknownUnionTag),
19080 };
19081
19082 if inlined != (member_inline_size <= 4) {
19083 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19084 }
19085 let _inner_offset;
19086 if inlined {
19087 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19088 _inner_offset = offset + 8;
19089 } else {
19090 depth.increment()?;
19091 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19092 }
19093 match ordinal {
19094 1 => {
19095 #[allow(irrefutable_let_patterns)]
19096 if let NavigationDecision::Proceed(_) = self {
19097 } else {
19099 *self = NavigationDecision::Proceed(fidl::new_empty!(
19101 NoArgumentsAction,
19102 fidl::encoding::DefaultFuchsiaResourceDialect
19103 ));
19104 }
19105 #[allow(irrefutable_let_patterns)]
19106 if let NavigationDecision::Proceed(ref mut val) = self {
19107 fidl::decode!(
19108 NoArgumentsAction,
19109 fidl::encoding::DefaultFuchsiaResourceDialect,
19110 val,
19111 decoder,
19112 _inner_offset,
19113 depth
19114 )?;
19115 } else {
19116 unreachable!()
19117 }
19118 }
19119 2 => {
19120 #[allow(irrefutable_let_patterns)]
19121 if let NavigationDecision::Abort(_) = self {
19122 } else {
19124 *self = NavigationDecision::Abort(fidl::new_empty!(
19126 NoArgumentsAction,
19127 fidl::encoding::DefaultFuchsiaResourceDialect
19128 ));
19129 }
19130 #[allow(irrefutable_let_patterns)]
19131 if let NavigationDecision::Abort(ref mut val) = self {
19132 fidl::decode!(
19133 NoArgumentsAction,
19134 fidl::encoding::DefaultFuchsiaResourceDialect,
19135 val,
19136 decoder,
19137 _inner_offset,
19138 depth
19139 )?;
19140 } else {
19141 unreachable!()
19142 }
19143 }
19144 ordinal => panic!("unexpected ordinal {:?}", ordinal),
19145 }
19146 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19147 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19148 }
19149 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19150 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19151 }
19152 Ok(())
19153 }
19154 }
19155
19156 impl fidl::encoding::ResourceTypeMarker for OutgoingTransferable {
19157 type Borrowed<'a> = &'a mut Self;
19158 fn take_or_borrow<'a>(
19159 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19160 ) -> Self::Borrowed<'a> {
19161 value
19162 }
19163 }
19164
19165 unsafe impl fidl::encoding::TypeMarker for OutgoingTransferable {
19166 type Owned = Self;
19167
19168 #[inline(always)]
19169 fn inline_align(_context: fidl::encoding::Context) -> usize {
19170 8
19171 }
19172
19173 #[inline(always)]
19174 fn inline_size(_context: fidl::encoding::Context) -> usize {
19175 16
19176 }
19177 }
19178
19179 unsafe impl
19180 fidl::encoding::Encode<OutgoingTransferable, fidl::encoding::DefaultFuchsiaResourceDialect>
19181 for &mut OutgoingTransferable
19182 {
19183 #[inline]
19184 unsafe fn encode(
19185 self,
19186 encoder: &mut fidl::encoding::Encoder<
19187 '_,
19188 fidl::encoding::DefaultFuchsiaResourceDialect,
19189 >,
19190 offset: usize,
19191 _depth: fidl::encoding::Depth,
19192 ) -> fidl::Result<()> {
19193 encoder.debug_check_bounds::<OutgoingTransferable>(offset);
19194 encoder.write_num::<u64>(self.ordinal(), offset);
19195 match self {
19196 OutgoingTransferable::MessagePort(ref mut val) => {
19197 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
19198 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
19199 encoder, offset + 8, _depth
19200 )
19201 }
19202 OutgoingTransferable::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
19203 }
19204 }
19205 }
19206
19207 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19208 for OutgoingTransferable
19209 {
19210 #[inline(always)]
19211 fn new_empty() -> Self {
19212 Self::__SourceBreaking { unknown_ordinal: 0 }
19213 }
19214
19215 #[inline]
19216 unsafe fn decode(
19217 &mut self,
19218 decoder: &mut fidl::encoding::Decoder<
19219 '_,
19220 fidl::encoding::DefaultFuchsiaResourceDialect,
19221 >,
19222 offset: usize,
19223 mut depth: fidl::encoding::Depth,
19224 ) -> fidl::Result<()> {
19225 decoder.debug_check_bounds::<Self>(offset);
19226 #[allow(unused_variables)]
19227 let next_out_of_line = decoder.next_out_of_line();
19228 let handles_before = decoder.remaining_handles();
19229 let (ordinal, inlined, num_bytes, num_handles) =
19230 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19231
19232 let member_inline_size = match ordinal {
19233 1 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19234 0 => return Err(fidl::Error::UnknownUnionTag),
19235 _ => num_bytes as usize,
19236 };
19237
19238 if inlined != (member_inline_size <= 4) {
19239 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19240 }
19241 let _inner_offset;
19242 if inlined {
19243 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19244 _inner_offset = offset + 8;
19245 } else {
19246 depth.increment()?;
19247 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19248 }
19249 match ordinal {
19250 1 => {
19251 #[allow(irrefutable_let_patterns)]
19252 if let OutgoingTransferable::MessagePort(_) = self {
19253 } else {
19255 *self = OutgoingTransferable::MessagePort(fidl::new_empty!(
19257 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>>,
19258 fidl::encoding::DefaultFuchsiaResourceDialect
19259 ));
19260 }
19261 #[allow(irrefutable_let_patterns)]
19262 if let OutgoingTransferable::MessagePort(ref mut val) = self {
19263 fidl::decode!(
19264 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>>,
19265 fidl::encoding::DefaultFuchsiaResourceDialect,
19266 val,
19267 decoder,
19268 _inner_offset,
19269 depth
19270 )?;
19271 } else {
19272 unreachable!()
19273 }
19274 }
19275 #[allow(deprecated)]
19276 ordinal => {
19277 for _ in 0..num_handles {
19278 decoder.drop_next_handle()?;
19279 }
19280 *self = OutgoingTransferable::__SourceBreaking { unknown_ordinal: ordinal };
19281 }
19282 }
19283 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19284 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19285 }
19286 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19287 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19288 }
19289 Ok(())
19290 }
19291 }
19292}