Skip to main content

fidl_fuchsia_web/
fidl_fuchsia_web.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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/// Defines a provider which hosts resources from a [`fuchsia.io/Directory`]. Content can `GET`
331/// resource files via the provider, but not enumerate directories. Resources can be accessed by
332/// their URLs: `fuchsia-dir://<provider-name>/<path/to/resource>`
333///
334/// By default the MIME types of files are determined automatically by "sniffing" the contents of
335/// the files. No content encoding will be declared, which browsers will interpret as meaning
336/// `"text/plain"`.
337///
338/// Content type and encoding metadata may optionally be specified explicitly by metadata files,
339/// which reside alongside the file. Metadata is expressed in JSON files, named after the files
340/// they describe with a `"._metadata"` suffix.
341///
342/// For example, the file `"index.html"` would have the a metadata file called
343/// `"index.html._metadata"`, with the following contents:
344/// ```
345/// {
346///   "charset": "utf-8",
347///   "mime": "text/html"
348/// }
349/// ```
350#[derive(Debug, Default, PartialEq)]
351pub struct ContentDirectoryProvider {
352    /// Name of the provider. Must be non-empty and composed solely of alphanumerics, dots, and
353    /// dashes.
354    pub name: Option<String>,
355    /// Directory containing the files served by this provider.
356    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    /// A table with fields to identify a cookie.
366    pub id: Option<CookieId>,
367    /// The cookie value.
368    /// RFC6265 does not specify an upper limit on cookie size, but recommends
369    /// that at least 4096 bytes are supported.
370    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/// Parameters specifying the configuration for a new [`Context`].
378#[derive(Debug, Default, PartialEq)]
379pub struct CreateContextParams {
380    /// Service directory to be used by the context.
381    ///
382    /// The following services must be present in the service directory:
383    ///
384    /// - [`fuchsia.buildinfo/Provider`]
385    /// - [`fuchsia.device/NameProvider`]
386    /// - [`fuchsia.fonts/Provider`]
387    /// - [`fuchsia.hwinfo.Product`]
388    /// - [`fuchsia.intl/PropertyProvider`]
389    /// - [`fuchsia.kernel/VmexResource`] (unless [`ContextFeatureFlags.DISABLE_DYNAMIC_CODE_GENERATION`] is set)
390    /// - [`fuchsia.logger/LogSink`]
391    /// - [`fuchsia.memorypressure/Provider`]
392    /// - [`fuchsia.process/Launcher`]
393    /// - [`fuchsia.sysmem/Allocator`]
394    ///
395    /// The following services are recommended to be present in order to allow CPU scheduling
396    /// profiles to be applied to threads to tune their performance, especially for media rendering.
397    /// - [`fuchsia.media.ProfileProvider`] (requirement will be removed in 2025)
398    /// - [`fuchsia.scheduler.RoleManager`]
399    ///
400    /// The following services must be present in order to render web content in a Scenic view
401    /// using [`Frame.CreateView`], [`Frame.CreateViewWithViewRef`] or [`Frame.CreateView2`]]:
402    /// - [`fuchsia.accessibility.semantics/SemanticsManager`]
403    /// - [`fuchsia.ui.composition/Allocator`]
404    /// - [`fuchsia.ui.composition/Flatland`]
405    /// - [`fuchsia.ui.scenic/Scenic`]
406    ///
407    /// The following service must be present in order to collect diagnostic tracing data.
408    /// - [`fuchsia.tracing.perfetto.ProducerConnector`]
409    pub service_directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
410    /// Handle to the directory that will contain the [`Context`]'s persistent data. If it is left
411    /// unset, then the created [`Context`] will be stateless, with all of its data discarded upon
412    /// [`Context`] destruction.
413    ///
414    /// If set, `data_directory` must not be shared with any other [`Context`].
415    pub data_directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
416    /// Optional string describing the embedding product to append to the User-Agent string.
417    /// See the specification for the
418    /// [HTTP User-Agent header](https://tools.ietf.org/html/rfc7231#section-5.5.3).
419    /// Requires that `user_agent_version` is also specified.
420    pub user_agent_product: Option<String>,
421    /// Optional version for the embedding product to append to the User-Agent string.
422    ///
423    /// Requires that `user_agent_product` is also specified.
424    pub user_agent_version: Option<String>,
425    /// Enables Frames to be created with remote debugging enabled using the DevTools protocol. If
426    /// `port` is 0, then an ephemeral port will be used, which can be queried via the
427    /// [`Context.GetRemoteDebuggingPort`] API.
428    ///
429    /// Because remote debugging uses TCP, it is not valid to set a remote
430    /// debugging port without having also set [`ContextFeatureFlags.NETWORK`]
431    /// for the context.
432    pub remote_debugging_port: Option<u16>,
433    /// List of providers whose contents will be served by `fuchsia-dir://` URLs.
434    pub content_directories: Option<Vec<ContentDirectoryProvider>>,
435    /// Optional features that should be enabled for this context. Some features may also require
436    /// additional services in `service_directory`.
437    pub features: Option<ContextFeatureFlags>,
438    /// Enables PlayReady CDM for the Context using the specified string as a key system
439    /// string. The string should be a reverse domain name, as required by
440    /// [EME API](https://www.w3.org/TR/encrypted-media/#key-system).
441    ///
442    /// - Requires [`fuchsia.media.drm/PlayReady`] service.
443    /// - Requires that a `cdm_data_directory` be specified in [`CreateContextParams`].
444    pub playready_key_system: Option<String>,
445    /// Treat given insecure origins as secure origins. For the definition of secure contexts, see
446    /// [Secure Contexts](https://w3c.github.io/webappsec-secure-contexts/) and
447    /// [origin trustworthiness](https://www.w3.org/TR/powerful-features/#is-origin-trustworthy).
448    ///
449    /// Example value: `{"http://a.com", "http://b.com"}`.
450    pub unsafely_treat_insecure_origins_as_secure: Option<Vec<String>>,
451    /// Specifies a set of header names for which [Cross-Origin Resource Sharing
452    /// (CORS)](https://www.w3.org/TR/cors/) checks should not be enforced.
453    pub cors_exempt_headers: Option<Vec<Vec<u8>>>,
454    /// Specifies the storage to use to persistent content licensing related data (e.g.
455    /// provisioning data, persistent session data). By default these data will be placed under the
456    /// `data_directory`, if specified.
457    ///
458    /// If neither `data_directory` nor `cdm_data_directory` are specified, then content licensing
459    /// features requiring persistent storage (e.g. persistent licensing sessions) will not be
460    /// available to the [`Context`].
461    ///
462    /// Note that not all content licensing systems support persistent sessions, regardless of
463    /// whether persistent storage is provided.
464    pub cdm_data_directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
465    /// Specifies a target maximum size for `cdm_data_directory` contents, in bytes. If the amount
466    /// of persisted CDM data exceeds this threshold, then the [`Context`] will attempt to purge
467    /// some data to meet the specified quota.
468    pub cdm_data_quota_bytes: Option<u64>,
469    /// Specifies a target maximum size for `data_directory` contents, in bytes.
470    /// The [`Context`] will attempt to limit browsing state (e.g. cookies, LocalStorage) to
471    /// not exceed the specified size.
472    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/// Parameters specifying the configuration for a new [`Frame`].
480#[derive(Debug, Default, PartialEq)]
481pub struct CreateFrameParams {
482    /// Set to true to enable remote debugging. The [`Frame`] will be closed with
483    /// `ERR_INVALID_ARGS` if `remote_debugging_port` was not set in
484    /// [`CreateContextParams`].
485    pub enable_remote_debugging: Option<bool>,
486    /// Set to give the Frame a name to help distinguish it in debug contexts , such as system log
487    /// output. For example, the name may be added to messages from web content when they are logged
488    /// to the system logger. The name does not affect user- or web-visible behavior.
489    /// Popup Frames created by the Frame will have a name derived from the parent Frame's name.
490    pub debug_name: Option<String>,
491    /// Enables automatic blocking of navigations to explicit sites, and specifies the error page
492    /// content, in HTML, to be loaded in the Frame when a navigation is canceled by the filter.
493    /// Applies to navigations in all frames within the Frame.
494    /// When navigation of the main document is canceled, the Frame's [`NavigationState.PageType`]
495    /// is `ERROR`.
496    /// If set to an empty buffer, a default error message will be displayed.
497    /// If set and such filtering is not supported, the [`Frame`] will disconnect with
498    /// `ZX_ERR_NOT_SUPPORTED`.
499    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/// Args for Frame.CreateView2(), see above.
507#[derive(Debug, Default, PartialEq)]
508pub struct CreateView2Args {
509    /// Non-optional. This token is provided to attach the client's Flatland view to the parent's
510    /// viewport.
511    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/// Used to represent a favicon for a page. An empty table (all fields are unset) is used to indicate
519/// that the page doesn't have a favicon.
520#[derive(Debug, Default, PartialEq)]
521pub struct Favicon {
522    /// The image content encoded as an RGBA bitmap with premultiplied alpha channel. The data is
523    /// densely packed, so the stride is always `4 * width` and the total size is
524    /// `4 * width * height`.
525    pub data: Option<fidl_fuchsia_mem::Buffer>,
526    /// The width of the image.
527    pub width: Option<u32>,
528    /// The height of the image.
529    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/// Additional parameters for modifying the behavior of [`NavigationController.LoadUrl`].
537#[derive(Debug, Default, PartialEq)]
538pub struct LoadUrlParams {
539    /// Provides a hint to the browser UI about how [`NavigationController.LoadUrl`] was triggered.
540    pub type_: Option<LoadUrlReason>,
541    /// The URL that linked to the resource being requested.
542    pub referrer_url: Option<String>,
543    /// Should be set to true to propagate user activation to the frame. User activation implies
544    /// that the user is interacting with the web frame. It enables some web features that are not
545    /// available otherwise. For example, autoplay will work only when this flag is set to true.
546    pub was_user_activated: Option<bool>,
547    /// Custom HTTP headers. RFC7540 does not specify a limit on the number nor
548    /// size of headers.
549    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/// Contains information about the [`Frame`]'s navigation state.
557#[derive(Debug, Default, PartialEq)]
558pub struct NavigationState {
559    /// The page's URL.
560    pub url: Option<String>,
561    /// The user-visible page title. While W3C style recommendation is that HTML
562    /// TITLE tags not exceed 64 characters in length, there is no actual limit.
563    pub title: Option<String>,
564    /// Indicates whether this was a navigation to an error page.
565    pub page_type: Option<PageType>,
566    /// Indicates if there is a following navigation.
567    pub can_go_forward: Option<bool>,
568    /// Indicates if there is a previous navigation.
569    pub can_go_back: Option<bool>,
570    /// Indicates that the main document's statically declared resources have been loaded.
571    pub is_main_document_loaded: Option<bool>,
572    /// Current favicon for the page. The field is set only when the `FAVICON` flag is set for the
573    /// `NavigationEventListener` and the favicon has changed.
574    pub favicon: Option<Favicon>,
575    /// Indicates type of the error when `page_type` is set to `ERROR`.
576    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/// Specifies additional information about a newly created popup frame.
584#[derive(Debug, Default, PartialEq)]
585pub struct PopupFrameCreationInfo {
586    /// The URL to which the popup frame was initially navigated.
587    pub initial_url: Option<String>,
588    /// Set if the popup frame was created in response to UI interaction from the user (e.g. a
589    /// link was clicked).
590    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    /// The message payload, encoded as an UTF-8 string. This is a required property.
600    pub data: Option<fidl_fuchsia_mem::Buffer>,
601    /// Optional list of objects transferred into the [`MessagePort`] from the FIDL client.
602    pub incoming_transfer: Option<Vec<IncomingTransferable>>,
603    /// Optional list of objects transferred out of the [`MessagePort`] to the FIDL client.
604    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/// Pattern that matches an unknown `IncomingTransferable` member.
621#[macro_export]
622macro_rules! IncomingTransferableUnknown {
623    () => {
624        _
625    };
626}
627
628// Custom PartialEq so that unknown variants are not equal to themselves.
629impl 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/// Navigation action that should be taken in response to a navigation request. Returned from
664/// [`NavigationPolicyProvider.EvaluateRequestedNavigation`].
665#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
666pub enum NavigationDecision {
667    /// Navigation should proceed normally.
668    Proceed(NoArgumentsAction),
669    /// Navigation should be aborted. The frame should stay on the current page.
670    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
683impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NavigationDecision {}
684
685#[derive(Debug)]
686pub enum OutgoingTransferable {
687    MessagePort(fidl::endpoints::ServerEnd<MessagePortMarker>),
688    #[doc(hidden)]
689    __SourceBreaking {
690        unknown_ordinal: u64,
691    },
692}
693
694/// Pattern that matches an unknown `OutgoingTransferable` member.
695#[macro_export]
696macro_rules! OutgoingTransferableUnknown {
697    () => {
698        _
699    };
700}
701
702// Custom PartialEq so that unknown variants are not equal to themselves.
703impl PartialEq for OutgoingTransferable {
704    fn eq(&self, other: &Self) -> bool {
705        match (self, other) {
706            (Self::MessagePort(x), Self::MessagePort(y)) => *x == *y,
707            _ => false,
708        }
709    }
710}
711
712impl OutgoingTransferable {
713    #[inline]
714    pub fn ordinal(&self) -> u64 {
715        match *self {
716            Self::MessagePort(_) => 1,
717            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
718        }
719    }
720
721    #[inline]
722    pub fn unknown_variant_for_testing() -> Self {
723        Self::__SourceBreaking { unknown_ordinal: 0 }
724    }
725
726    #[inline]
727    pub fn is_unknown(&self) -> bool {
728        match self {
729            Self::__SourceBreaking { .. } => true,
730            _ => false,
731        }
732    }
733}
734
735impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for OutgoingTransferable {}
736
737#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
738pub struct ContextMarker;
739
740impl fidl::endpoints::ProtocolMarker for ContextMarker {
741    type Proxy = ContextProxy;
742    type RequestStream = ContextRequestStream;
743    #[cfg(target_os = "fuchsia")]
744    type SynchronousProxy = ContextSynchronousProxy;
745
746    const DEBUG_NAME: &'static str = "fuchsia.web.Context";
747}
748impl fidl::endpoints::DiscoverableProtocolMarker for ContextMarker {}
749pub type ContextGetRemoteDebuggingPortResult = Result<u16, ContextError>;
750
751pub trait ContextProxyInterface: Send + Sync {
752    fn r#create_frame(
753        &self,
754        frame: fidl::endpoints::ServerEnd<FrameMarker>,
755    ) -> Result<(), fidl::Error>;
756    fn r#create_frame_with_params(
757        &self,
758        params: CreateFrameParams,
759        frame: fidl::endpoints::ServerEnd<FrameMarker>,
760    ) -> Result<(), fidl::Error>;
761    fn r#get_cookie_manager(
762        &self,
763        manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
764    ) -> Result<(), fidl::Error>;
765    type GetRemoteDebuggingPortResponseFut: std::future::Future<Output = Result<ContextGetRemoteDebuggingPortResult, fidl::Error>>
766        + Send;
767    fn r#get_remote_debugging_port(&self) -> Self::GetRemoteDebuggingPortResponseFut;
768}
769#[derive(Debug)]
770#[cfg(target_os = "fuchsia")]
771pub struct ContextSynchronousProxy {
772    client: fidl::client::sync::Client,
773}
774
775#[cfg(target_os = "fuchsia")]
776impl fidl::endpoints::SynchronousProxy for ContextSynchronousProxy {
777    type Proxy = ContextProxy;
778    type Protocol = ContextMarker;
779
780    fn from_channel(inner: fidl::Channel) -> Self {
781        Self::new(inner)
782    }
783
784    fn into_channel(self) -> fidl::Channel {
785        self.client.into_channel()
786    }
787
788    fn as_channel(&self) -> &fidl::Channel {
789        self.client.as_channel()
790    }
791}
792
793#[cfg(target_os = "fuchsia")]
794impl ContextSynchronousProxy {
795    pub fn new(channel: fidl::Channel) -> Self {
796        Self { client: fidl::client::sync::Client::new(channel) }
797    }
798
799    pub fn into_channel(self) -> fidl::Channel {
800        self.client.into_channel()
801    }
802
803    /// Waits until an event arrives and returns it. It is safe for other
804    /// threads to make concurrent requests while waiting for an event.
805    pub fn wait_for_event(
806        &self,
807        deadline: zx::MonotonicInstant,
808    ) -> Result<ContextEvent, fidl::Error> {
809        ContextEvent::decode(self.client.wait_for_event::<ContextMarker>(deadline)?)
810    }
811
812    /// Creates a new [`Frame`] under this [`Context`]. Destruction of a [`Context`] triggers the
813    /// destruction of all of its associated [`Frame`]. [`Frame`] can be transferred to another
814    /// component but cannot be shared across multiple components.
815    ///
816    /// - `frame`: An interface request that will be bound to the created [`Frame`].
817    pub fn r#create_frame(
818        &self,
819        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
820    ) -> Result<(), fidl::Error> {
821        self.client.send::<ContextCreateFrameRequest>(
822            (frame,),
823            0x5440a38db7cd7d8f,
824            fidl::encoding::DynamicFlags::empty(),
825        )
826    }
827
828    /// Similar to [`Context.CreateFrame`], with extra parameters.
829    ///
830    /// - `params`: The configuration used to create the [`Frame`].
831    ///   This method will fail with `ZX_ERR_INVALID_ARGS` if the table is not clonable.
832    /// - `frame`: An interface request that will be bound to the created [`Frame`].
833    pub fn r#create_frame_with_params(
834        &self,
835        mut params: CreateFrameParams,
836        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
837    ) -> Result<(), fidl::Error> {
838        self.client.send::<ContextCreateFrameWithParamsRequest>(
839            (&mut params, frame),
840            0x2c968a330787be96,
841            fidl::encoding::DynamicFlags::empty(),
842        )
843    }
844
845    /// Used to observe cookies for sites hosted under this Context.
846    pub fn r#get_cookie_manager(
847        &self,
848        mut manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
849    ) -> Result<(), fidl::Error> {
850        self.client.send::<ContextGetCookieManagerRequest>(
851            (manager,),
852            0x7396cda568e3fca,
853            fidl::encoding::DynamicFlags::empty(),
854        )
855    }
856
857    /// Waits until debugging is available on one or more Frames, and returns the DevTools port
858    /// number. Multiple calls may be queued to received the port number.
859    ///
860    /// If an error occurred, the [`ContextError`] will be set to this value:
861    /// - `REMOTE_DEBUGGING_PORT_NOT_OPENED`: `remote_debugging_port` was not set in
862    ///   [`CreateContextParams`] or the remote debugging service failed to start.
863    pub fn r#get_remote_debugging_port(
864        &self,
865        ___deadline: zx::MonotonicInstant,
866    ) -> Result<ContextGetRemoteDebuggingPortResult, fidl::Error> {
867        let _response =
868            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
869                ContextGetRemoteDebuggingPortResponse,
870                ContextError,
871            >, ContextMarker>(
872                (),
873                0x4ac6a26fe972f29,
874                fidl::encoding::DynamicFlags::empty(),
875                ___deadline,
876            )?;
877        Ok(_response.map(|x| x.port))
878    }
879}
880
881#[cfg(target_os = "fuchsia")]
882impl From<ContextSynchronousProxy> for zx::NullableHandle {
883    fn from(value: ContextSynchronousProxy) -> Self {
884        value.into_channel().into()
885    }
886}
887
888#[cfg(target_os = "fuchsia")]
889impl From<fidl::Channel> for ContextSynchronousProxy {
890    fn from(value: fidl::Channel) -> Self {
891        Self::new(value)
892    }
893}
894
895#[cfg(target_os = "fuchsia")]
896impl fidl::endpoints::FromClient for ContextSynchronousProxy {
897    type Protocol = ContextMarker;
898
899    fn from_client(value: fidl::endpoints::ClientEnd<ContextMarker>) -> Self {
900        Self::new(value.into_channel())
901    }
902}
903
904#[derive(Debug, Clone)]
905pub struct ContextProxy {
906    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
907}
908
909impl fidl::endpoints::Proxy for ContextProxy {
910    type Protocol = ContextMarker;
911
912    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
913        Self::new(inner)
914    }
915
916    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
917        self.client.into_channel().map_err(|client| Self { client })
918    }
919
920    fn as_channel(&self) -> &::fidl::AsyncChannel {
921        self.client.as_channel()
922    }
923}
924
925impl ContextProxy {
926    /// Create a new Proxy for fuchsia.web/Context.
927    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
928        let protocol_name = <ContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
929        Self { client: fidl::client::Client::new(channel, protocol_name) }
930    }
931
932    /// Get a Stream of events from the remote end of the protocol.
933    ///
934    /// # Panics
935    ///
936    /// Panics if the event stream was already taken.
937    pub fn take_event_stream(&self) -> ContextEventStream {
938        ContextEventStream { event_receiver: self.client.take_event_receiver() }
939    }
940
941    /// Creates a new [`Frame`] under this [`Context`]. Destruction of a [`Context`] triggers the
942    /// destruction of all of its associated [`Frame`]. [`Frame`] can be transferred to another
943    /// component but cannot be shared across multiple components.
944    ///
945    /// - `frame`: An interface request that will be bound to the created [`Frame`].
946    pub fn r#create_frame(
947        &self,
948        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
949    ) -> Result<(), fidl::Error> {
950        ContextProxyInterface::r#create_frame(self, frame)
951    }
952
953    /// Similar to [`Context.CreateFrame`], with extra parameters.
954    ///
955    /// - `params`: The configuration used to create the [`Frame`].
956    ///   This method will fail with `ZX_ERR_INVALID_ARGS` if the table is not clonable.
957    /// - `frame`: An interface request that will be bound to the created [`Frame`].
958    pub fn r#create_frame_with_params(
959        &self,
960        mut params: CreateFrameParams,
961        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
962    ) -> Result<(), fidl::Error> {
963        ContextProxyInterface::r#create_frame_with_params(self, params, frame)
964    }
965
966    /// Used to observe cookies for sites hosted under this Context.
967    pub fn r#get_cookie_manager(
968        &self,
969        mut manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
970    ) -> Result<(), fidl::Error> {
971        ContextProxyInterface::r#get_cookie_manager(self, manager)
972    }
973
974    /// Waits until debugging is available on one or more Frames, and returns the DevTools port
975    /// number. Multiple calls may be queued to received the port number.
976    ///
977    /// If an error occurred, the [`ContextError`] will be set to this value:
978    /// - `REMOTE_DEBUGGING_PORT_NOT_OPENED`: `remote_debugging_port` was not set in
979    ///   [`CreateContextParams`] or the remote debugging service failed to start.
980    pub fn r#get_remote_debugging_port(
981        &self,
982    ) -> fidl::client::QueryResponseFut<
983        ContextGetRemoteDebuggingPortResult,
984        fidl::encoding::DefaultFuchsiaResourceDialect,
985    > {
986        ContextProxyInterface::r#get_remote_debugging_port(self)
987    }
988}
989
990impl ContextProxyInterface for ContextProxy {
991    fn r#create_frame(
992        &self,
993        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
994    ) -> Result<(), fidl::Error> {
995        self.client.send::<ContextCreateFrameRequest>(
996            (frame,),
997            0x5440a38db7cd7d8f,
998            fidl::encoding::DynamicFlags::empty(),
999        )
1000    }
1001
1002    fn r#create_frame_with_params(
1003        &self,
1004        mut params: CreateFrameParams,
1005        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
1006    ) -> Result<(), fidl::Error> {
1007        self.client.send::<ContextCreateFrameWithParamsRequest>(
1008            (&mut params, frame),
1009            0x2c968a330787be96,
1010            fidl::encoding::DynamicFlags::empty(),
1011        )
1012    }
1013
1014    fn r#get_cookie_manager(
1015        &self,
1016        mut manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
1017    ) -> Result<(), fidl::Error> {
1018        self.client.send::<ContextGetCookieManagerRequest>(
1019            (manager,),
1020            0x7396cda568e3fca,
1021            fidl::encoding::DynamicFlags::empty(),
1022        )
1023    }
1024
1025    type GetRemoteDebuggingPortResponseFut = fidl::client::QueryResponseFut<
1026        ContextGetRemoteDebuggingPortResult,
1027        fidl::encoding::DefaultFuchsiaResourceDialect,
1028    >;
1029    fn r#get_remote_debugging_port(&self) -> Self::GetRemoteDebuggingPortResponseFut {
1030        fn _decode(
1031            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1032        ) -> Result<ContextGetRemoteDebuggingPortResult, fidl::Error> {
1033            let _response = fidl::client::decode_transaction_body::<
1034                fidl::encoding::ResultType<ContextGetRemoteDebuggingPortResponse, ContextError>,
1035                fidl::encoding::DefaultFuchsiaResourceDialect,
1036                0x4ac6a26fe972f29,
1037            >(_buf?)?;
1038            Ok(_response.map(|x| x.port))
1039        }
1040        self.client.send_query_and_decode::<
1041            fidl::encoding::EmptyPayload,
1042            ContextGetRemoteDebuggingPortResult,
1043        >(
1044            (),
1045            0x4ac6a26fe972f29,
1046            fidl::encoding::DynamicFlags::empty(),
1047            _decode,
1048        )
1049    }
1050}
1051
1052pub struct ContextEventStream {
1053    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1054}
1055
1056impl std::marker::Unpin for ContextEventStream {}
1057
1058impl futures::stream::FusedStream for ContextEventStream {
1059    fn is_terminated(&self) -> bool {
1060        self.event_receiver.is_terminated()
1061    }
1062}
1063
1064impl futures::Stream for ContextEventStream {
1065    type Item = Result<ContextEvent, fidl::Error>;
1066
1067    fn poll_next(
1068        mut self: std::pin::Pin<&mut Self>,
1069        cx: &mut std::task::Context<'_>,
1070    ) -> std::task::Poll<Option<Self::Item>> {
1071        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1072            &mut self.event_receiver,
1073            cx
1074        )?) {
1075            Some(buf) => std::task::Poll::Ready(Some(ContextEvent::decode(buf))),
1076            None => std::task::Poll::Ready(None),
1077        }
1078    }
1079}
1080
1081#[derive(Debug)]
1082pub enum ContextEvent {}
1083
1084impl ContextEvent {
1085    /// Decodes a message buffer as a [`ContextEvent`].
1086    fn decode(
1087        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1088    ) -> Result<ContextEvent, fidl::Error> {
1089        let (bytes, _handles) = buf.split_mut();
1090        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1091        debug_assert_eq!(tx_header.tx_id, 0);
1092        match tx_header.ordinal {
1093            _ => Err(fidl::Error::UnknownOrdinal {
1094                ordinal: tx_header.ordinal,
1095                protocol_name: <ContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1096            }),
1097        }
1098    }
1099}
1100
1101/// A Stream of incoming requests for fuchsia.web/Context.
1102pub struct ContextRequestStream {
1103    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1104    is_terminated: bool,
1105}
1106
1107impl std::marker::Unpin for ContextRequestStream {}
1108
1109impl futures::stream::FusedStream for ContextRequestStream {
1110    fn is_terminated(&self) -> bool {
1111        self.is_terminated
1112    }
1113}
1114
1115impl fidl::endpoints::RequestStream for ContextRequestStream {
1116    type Protocol = ContextMarker;
1117    type ControlHandle = ContextControlHandle;
1118
1119    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1120        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1121    }
1122
1123    fn control_handle(&self) -> Self::ControlHandle {
1124        ContextControlHandle { inner: self.inner.clone() }
1125    }
1126
1127    fn into_inner(
1128        self,
1129    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1130    {
1131        (self.inner, self.is_terminated)
1132    }
1133
1134    fn from_inner(
1135        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1136        is_terminated: bool,
1137    ) -> Self {
1138        Self { inner, is_terminated }
1139    }
1140}
1141
1142impl futures::Stream for ContextRequestStream {
1143    type Item = Result<ContextRequest, fidl::Error>;
1144
1145    fn poll_next(
1146        mut self: std::pin::Pin<&mut Self>,
1147        cx: &mut std::task::Context<'_>,
1148    ) -> std::task::Poll<Option<Self::Item>> {
1149        let this = &mut *self;
1150        if this.inner.check_shutdown(cx) {
1151            this.is_terminated = true;
1152            return std::task::Poll::Ready(None);
1153        }
1154        if this.is_terminated {
1155            panic!("polled ContextRequestStream after completion");
1156        }
1157        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1158            |bytes, handles| {
1159                match this.inner.channel().read_etc(cx, bytes, handles) {
1160                    std::task::Poll::Ready(Ok(())) => {}
1161                    std::task::Poll::Pending => return std::task::Poll::Pending,
1162                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1163                        this.is_terminated = true;
1164                        return std::task::Poll::Ready(None);
1165                    }
1166                    std::task::Poll::Ready(Err(e)) => {
1167                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1168                            e.into(),
1169                        ))));
1170                    }
1171                }
1172
1173                // A message has been received from the channel
1174                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1175
1176                std::task::Poll::Ready(Some(match header.ordinal {
1177                    0x5440a38db7cd7d8f => {
1178                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1179                        let mut req = fidl::new_empty!(
1180                            ContextCreateFrameRequest,
1181                            fidl::encoding::DefaultFuchsiaResourceDialect
1182                        );
1183                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContextCreateFrameRequest>(&header, _body_bytes, handles, &mut req)?;
1184                        let control_handle = ContextControlHandle { inner: this.inner.clone() };
1185                        Ok(ContextRequest::CreateFrame { frame: req.frame, control_handle })
1186                    }
1187                    0x2c968a330787be96 => {
1188                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1189                        let mut req = fidl::new_empty!(
1190                            ContextCreateFrameWithParamsRequest,
1191                            fidl::encoding::DefaultFuchsiaResourceDialect
1192                        );
1193                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContextCreateFrameWithParamsRequest>(&header, _body_bytes, handles, &mut req)?;
1194                        let control_handle = ContextControlHandle { inner: this.inner.clone() };
1195                        Ok(ContextRequest::CreateFrameWithParams {
1196                            params: req.params,
1197                            frame: req.frame,
1198
1199                            control_handle,
1200                        })
1201                    }
1202                    0x7396cda568e3fca => {
1203                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1204                        let mut req = fidl::new_empty!(
1205                            ContextGetCookieManagerRequest,
1206                            fidl::encoding::DefaultFuchsiaResourceDialect
1207                        );
1208                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContextGetCookieManagerRequest>(&header, _body_bytes, handles, &mut req)?;
1209                        let control_handle = ContextControlHandle { inner: this.inner.clone() };
1210                        Ok(ContextRequest::GetCookieManager {
1211                            manager: req.manager,
1212
1213                            control_handle,
1214                        })
1215                    }
1216                    0x4ac6a26fe972f29 => {
1217                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1218                        let mut req = fidl::new_empty!(
1219                            fidl::encoding::EmptyPayload,
1220                            fidl::encoding::DefaultFuchsiaResourceDialect
1221                        );
1222                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1223                        let control_handle = ContextControlHandle { inner: this.inner.clone() };
1224                        Ok(ContextRequest::GetRemoteDebuggingPort {
1225                            responder: ContextGetRemoteDebuggingPortResponder {
1226                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1227                                tx_id: header.tx_id,
1228                            },
1229                        })
1230                    }
1231                    _ => Err(fidl::Error::UnknownOrdinal {
1232                        ordinal: header.ordinal,
1233                        protocol_name:
1234                            <ContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1235                    }),
1236                }))
1237            },
1238        )
1239    }
1240}
1241
1242/// Manages browsing state (e.g. LocalStorage, cookies, etc) associated with a set of [`Frame`].
1243#[derive(Debug)]
1244pub enum ContextRequest {
1245    /// Creates a new [`Frame`] under this [`Context`]. Destruction of a [`Context`] triggers the
1246    /// destruction of all of its associated [`Frame`]. [`Frame`] can be transferred to another
1247    /// component but cannot be shared across multiple components.
1248    ///
1249    /// - `frame`: An interface request that will be bound to the created [`Frame`].
1250    CreateFrame {
1251        frame: fidl::endpoints::ServerEnd<FrameMarker>,
1252        control_handle: ContextControlHandle,
1253    },
1254    /// Similar to [`Context.CreateFrame`], with extra parameters.
1255    ///
1256    /// - `params`: The configuration used to create the [`Frame`].
1257    ///   This method will fail with `ZX_ERR_INVALID_ARGS` if the table is not clonable.
1258    /// - `frame`: An interface request that will be bound to the created [`Frame`].
1259    CreateFrameWithParams {
1260        params: CreateFrameParams,
1261        frame: fidl::endpoints::ServerEnd<FrameMarker>,
1262        control_handle: ContextControlHandle,
1263    },
1264    /// Used to observe cookies for sites hosted under this Context.
1265    GetCookieManager {
1266        manager: fidl::endpoints::ServerEnd<CookieManagerMarker>,
1267        control_handle: ContextControlHandle,
1268    },
1269    /// Waits until debugging is available on one or more Frames, and returns the DevTools port
1270    /// number. Multiple calls may be queued to received the port number.
1271    ///
1272    /// If an error occurred, the [`ContextError`] will be set to this value:
1273    /// - `REMOTE_DEBUGGING_PORT_NOT_OPENED`: `remote_debugging_port` was not set in
1274    ///   [`CreateContextParams`] or the remote debugging service failed to start.
1275    GetRemoteDebuggingPort { responder: ContextGetRemoteDebuggingPortResponder },
1276}
1277
1278impl ContextRequest {
1279    #[allow(irrefutable_let_patterns)]
1280    pub fn into_create_frame(
1281        self,
1282    ) -> Option<(fidl::endpoints::ServerEnd<FrameMarker>, ContextControlHandle)> {
1283        if let ContextRequest::CreateFrame { frame, control_handle } = self {
1284            Some((frame, control_handle))
1285        } else {
1286            None
1287        }
1288    }
1289
1290    #[allow(irrefutable_let_patterns)]
1291    pub fn into_create_frame_with_params(
1292        self,
1293    ) -> Option<(CreateFrameParams, fidl::endpoints::ServerEnd<FrameMarker>, ContextControlHandle)>
1294    {
1295        if let ContextRequest::CreateFrameWithParams { params, frame, control_handle } = self {
1296            Some((params, frame, control_handle))
1297        } else {
1298            None
1299        }
1300    }
1301
1302    #[allow(irrefutable_let_patterns)]
1303    pub fn into_get_cookie_manager(
1304        self,
1305    ) -> Option<(fidl::endpoints::ServerEnd<CookieManagerMarker>, ContextControlHandle)> {
1306        if let ContextRequest::GetCookieManager { manager, control_handle } = self {
1307            Some((manager, control_handle))
1308        } else {
1309            None
1310        }
1311    }
1312
1313    #[allow(irrefutable_let_patterns)]
1314    pub fn into_get_remote_debugging_port(
1315        self,
1316    ) -> Option<(ContextGetRemoteDebuggingPortResponder)> {
1317        if let ContextRequest::GetRemoteDebuggingPort { responder } = self {
1318            Some((responder))
1319        } else {
1320            None
1321        }
1322    }
1323
1324    /// Name of the method defined in FIDL
1325    pub fn method_name(&self) -> &'static str {
1326        match *self {
1327            ContextRequest::CreateFrame { .. } => "create_frame",
1328            ContextRequest::CreateFrameWithParams { .. } => "create_frame_with_params",
1329            ContextRequest::GetCookieManager { .. } => "get_cookie_manager",
1330            ContextRequest::GetRemoteDebuggingPort { .. } => "get_remote_debugging_port",
1331        }
1332    }
1333}
1334
1335#[derive(Debug, Clone)]
1336pub struct ContextControlHandle {
1337    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1338}
1339
1340impl ContextControlHandle {
1341    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1342        self.inner.shutdown_with_epitaph(status.into())
1343    }
1344}
1345
1346impl fidl::endpoints::ControlHandle for ContextControlHandle {
1347    fn shutdown(&self) {
1348        self.inner.shutdown()
1349    }
1350
1351    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1352        self.inner.shutdown_with_epitaph(status)
1353    }
1354
1355    fn is_closed(&self) -> bool {
1356        self.inner.channel().is_closed()
1357    }
1358    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1359        self.inner.channel().on_closed()
1360    }
1361
1362    #[cfg(target_os = "fuchsia")]
1363    fn signal_peer(
1364        &self,
1365        clear_mask: zx::Signals,
1366        set_mask: zx::Signals,
1367    ) -> Result<(), zx_status::Status> {
1368        use fidl::Peered;
1369        self.inner.channel().signal_peer(clear_mask, set_mask)
1370    }
1371}
1372
1373impl ContextControlHandle {}
1374
1375#[must_use = "FIDL methods require a response to be sent"]
1376#[derive(Debug)]
1377pub struct ContextGetRemoteDebuggingPortResponder {
1378    control_handle: std::mem::ManuallyDrop<ContextControlHandle>,
1379    tx_id: u32,
1380}
1381
1382/// Set the the channel to be shutdown (see [`ContextControlHandle::shutdown`])
1383/// if the responder is dropped without sending a response, so that the client
1384/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1385impl std::ops::Drop for ContextGetRemoteDebuggingPortResponder {
1386    fn drop(&mut self) {
1387        self.control_handle.shutdown();
1388        // Safety: drops once, never accessed again
1389        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1390    }
1391}
1392
1393impl fidl::endpoints::Responder for ContextGetRemoteDebuggingPortResponder {
1394    type ControlHandle = ContextControlHandle;
1395
1396    fn control_handle(&self) -> &ContextControlHandle {
1397        &self.control_handle
1398    }
1399
1400    fn drop_without_shutdown(mut self) {
1401        // Safety: drops once, never accessed again due to mem::forget
1402        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1403        // Prevent Drop from running (which would shut down the channel)
1404        std::mem::forget(self);
1405    }
1406}
1407
1408impl ContextGetRemoteDebuggingPortResponder {
1409    /// Sends a response to the FIDL transaction.
1410    ///
1411    /// Sets the channel to shutdown if an error occurs.
1412    pub fn send(self, mut result: Result<u16, ContextError>) -> Result<(), fidl::Error> {
1413        let _result = self.send_raw(result);
1414        if _result.is_err() {
1415            self.control_handle.shutdown();
1416        }
1417        self.drop_without_shutdown();
1418        _result
1419    }
1420
1421    /// Similar to "send" but does not shutdown the channel if an error occurs.
1422    pub fn send_no_shutdown_on_err(
1423        self,
1424        mut result: Result<u16, ContextError>,
1425    ) -> Result<(), fidl::Error> {
1426        let _result = self.send_raw(result);
1427        self.drop_without_shutdown();
1428        _result
1429    }
1430
1431    fn send_raw(&self, mut result: Result<u16, ContextError>) -> Result<(), fidl::Error> {
1432        self.control_handle.inner.send::<fidl::encoding::ResultType<
1433            ContextGetRemoteDebuggingPortResponse,
1434            ContextError,
1435        >>(
1436            result.map(|port| (port,)),
1437            self.tx_id,
1438            0x4ac6a26fe972f29,
1439            fidl::encoding::DynamicFlags::empty(),
1440        )
1441    }
1442}
1443
1444#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1445pub struct ContextProviderMarker;
1446
1447impl fidl::endpoints::ProtocolMarker for ContextProviderMarker {
1448    type Proxy = ContextProviderProxy;
1449    type RequestStream = ContextProviderRequestStream;
1450    #[cfg(target_os = "fuchsia")]
1451    type SynchronousProxy = ContextProviderSynchronousProxy;
1452
1453    const DEBUG_NAME: &'static str = "fuchsia.web.ContextProvider";
1454}
1455impl fidl::endpoints::DiscoverableProtocolMarker for ContextProviderMarker {}
1456
1457pub trait ContextProviderProxyInterface: Send + Sync {
1458    fn r#create(
1459        &self,
1460        params: CreateContextParams,
1461        context: fidl::endpoints::ServerEnd<ContextMarker>,
1462    ) -> Result<(), fidl::Error>;
1463}
1464#[derive(Debug)]
1465#[cfg(target_os = "fuchsia")]
1466pub struct ContextProviderSynchronousProxy {
1467    client: fidl::client::sync::Client,
1468}
1469
1470#[cfg(target_os = "fuchsia")]
1471impl fidl::endpoints::SynchronousProxy for ContextProviderSynchronousProxy {
1472    type Proxy = ContextProviderProxy;
1473    type Protocol = ContextProviderMarker;
1474
1475    fn from_channel(inner: fidl::Channel) -> Self {
1476        Self::new(inner)
1477    }
1478
1479    fn into_channel(self) -> fidl::Channel {
1480        self.client.into_channel()
1481    }
1482
1483    fn as_channel(&self) -> &fidl::Channel {
1484        self.client.as_channel()
1485    }
1486}
1487
1488#[cfg(target_os = "fuchsia")]
1489impl ContextProviderSynchronousProxy {
1490    pub fn new(channel: fidl::Channel) -> Self {
1491        Self { client: fidl::client::sync::Client::new(channel) }
1492    }
1493
1494    pub fn into_channel(self) -> fidl::Channel {
1495        self.client.into_channel()
1496    }
1497
1498    /// Waits until an event arrives and returns it. It is safe for other
1499    /// threads to make concurrent requests while waiting for an event.
1500    pub fn wait_for_event(
1501        &self,
1502        deadline: zx::MonotonicInstant,
1503    ) -> Result<ContextProviderEvent, fidl::Error> {
1504        ContextProviderEvent::decode(self.client.wait_for_event::<ContextProviderMarker>(deadline)?)
1505    }
1506
1507    /// Creates a new browser [`Context`] whose state is wholly independent and isolated from other
1508    /// [`Context`](`Contexts`).
1509    ///
1510    /// - `params`: The configuration used to create the [`Context`].
1511    /// - `context`: An interface request which will receive a bound [`Context`]
1512    ///   service.
1513    pub fn r#create(
1514        &self,
1515        mut params: CreateContextParams,
1516        mut context: fidl::endpoints::ServerEnd<ContextMarker>,
1517    ) -> Result<(), fidl::Error> {
1518        self.client.send::<ContextProviderCreateRequest>(
1519            (&mut params, context),
1520            0x6ee6fa35978eb98d,
1521            fidl::encoding::DynamicFlags::empty(),
1522        )
1523    }
1524}
1525
1526#[cfg(target_os = "fuchsia")]
1527impl From<ContextProviderSynchronousProxy> for zx::NullableHandle {
1528    fn from(value: ContextProviderSynchronousProxy) -> Self {
1529        value.into_channel().into()
1530    }
1531}
1532
1533#[cfg(target_os = "fuchsia")]
1534impl From<fidl::Channel> for ContextProviderSynchronousProxy {
1535    fn from(value: fidl::Channel) -> Self {
1536        Self::new(value)
1537    }
1538}
1539
1540#[cfg(target_os = "fuchsia")]
1541impl fidl::endpoints::FromClient for ContextProviderSynchronousProxy {
1542    type Protocol = ContextProviderMarker;
1543
1544    fn from_client(value: fidl::endpoints::ClientEnd<ContextProviderMarker>) -> Self {
1545        Self::new(value.into_channel())
1546    }
1547}
1548
1549#[derive(Debug, Clone)]
1550pub struct ContextProviderProxy {
1551    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1552}
1553
1554impl fidl::endpoints::Proxy for ContextProviderProxy {
1555    type Protocol = ContextProviderMarker;
1556
1557    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1558        Self::new(inner)
1559    }
1560
1561    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1562        self.client.into_channel().map_err(|client| Self { client })
1563    }
1564
1565    fn as_channel(&self) -> &::fidl::AsyncChannel {
1566        self.client.as_channel()
1567    }
1568}
1569
1570impl ContextProviderProxy {
1571    /// Create a new Proxy for fuchsia.web/ContextProvider.
1572    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1573        let protocol_name = <ContextProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1574        Self { client: fidl::client::Client::new(channel, protocol_name) }
1575    }
1576
1577    /// Get a Stream of events from the remote end of the protocol.
1578    ///
1579    /// # Panics
1580    ///
1581    /// Panics if the event stream was already taken.
1582    pub fn take_event_stream(&self) -> ContextProviderEventStream {
1583        ContextProviderEventStream { event_receiver: self.client.take_event_receiver() }
1584    }
1585
1586    /// Creates a new browser [`Context`] whose state is wholly independent and isolated from other
1587    /// [`Context`](`Contexts`).
1588    ///
1589    /// - `params`: The configuration used to create the [`Context`].
1590    /// - `context`: An interface request which will receive a bound [`Context`]
1591    ///   service.
1592    pub fn r#create(
1593        &self,
1594        mut params: CreateContextParams,
1595        mut context: fidl::endpoints::ServerEnd<ContextMarker>,
1596    ) -> Result<(), fidl::Error> {
1597        ContextProviderProxyInterface::r#create(self, params, context)
1598    }
1599}
1600
1601impl ContextProviderProxyInterface for ContextProviderProxy {
1602    fn r#create(
1603        &self,
1604        mut params: CreateContextParams,
1605        mut context: fidl::endpoints::ServerEnd<ContextMarker>,
1606    ) -> Result<(), fidl::Error> {
1607        self.client.send::<ContextProviderCreateRequest>(
1608            (&mut params, context),
1609            0x6ee6fa35978eb98d,
1610            fidl::encoding::DynamicFlags::empty(),
1611        )
1612    }
1613}
1614
1615pub struct ContextProviderEventStream {
1616    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1617}
1618
1619impl std::marker::Unpin for ContextProviderEventStream {}
1620
1621impl futures::stream::FusedStream for ContextProviderEventStream {
1622    fn is_terminated(&self) -> bool {
1623        self.event_receiver.is_terminated()
1624    }
1625}
1626
1627impl futures::Stream for ContextProviderEventStream {
1628    type Item = Result<ContextProviderEvent, fidl::Error>;
1629
1630    fn poll_next(
1631        mut self: std::pin::Pin<&mut Self>,
1632        cx: &mut std::task::Context<'_>,
1633    ) -> std::task::Poll<Option<Self::Item>> {
1634        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1635            &mut self.event_receiver,
1636            cx
1637        )?) {
1638            Some(buf) => std::task::Poll::Ready(Some(ContextProviderEvent::decode(buf))),
1639            None => std::task::Poll::Ready(None),
1640        }
1641    }
1642}
1643
1644#[derive(Debug)]
1645pub enum ContextProviderEvent {}
1646
1647impl ContextProviderEvent {
1648    /// Decodes a message buffer as a [`ContextProviderEvent`].
1649    fn decode(
1650        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1651    ) -> Result<ContextProviderEvent, fidl::Error> {
1652        let (bytes, _handles) = buf.split_mut();
1653        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1654        debug_assert_eq!(tx_header.tx_id, 0);
1655        match tx_header.ordinal {
1656            _ => Err(fidl::Error::UnknownOrdinal {
1657                ordinal: tx_header.ordinal,
1658                protocol_name:
1659                    <ContextProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1660            }),
1661        }
1662    }
1663}
1664
1665/// A Stream of incoming requests for fuchsia.web/ContextProvider.
1666pub struct ContextProviderRequestStream {
1667    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1668    is_terminated: bool,
1669}
1670
1671impl std::marker::Unpin for ContextProviderRequestStream {}
1672
1673impl futures::stream::FusedStream for ContextProviderRequestStream {
1674    fn is_terminated(&self) -> bool {
1675        self.is_terminated
1676    }
1677}
1678
1679impl fidl::endpoints::RequestStream for ContextProviderRequestStream {
1680    type Protocol = ContextProviderMarker;
1681    type ControlHandle = ContextProviderControlHandle;
1682
1683    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1684        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1685    }
1686
1687    fn control_handle(&self) -> Self::ControlHandle {
1688        ContextProviderControlHandle { inner: self.inner.clone() }
1689    }
1690
1691    fn into_inner(
1692        self,
1693    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1694    {
1695        (self.inner, self.is_terminated)
1696    }
1697
1698    fn from_inner(
1699        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1700        is_terminated: bool,
1701    ) -> Self {
1702        Self { inner, is_terminated }
1703    }
1704}
1705
1706impl futures::Stream for ContextProviderRequestStream {
1707    type Item = Result<ContextProviderRequest, fidl::Error>;
1708
1709    fn poll_next(
1710        mut self: std::pin::Pin<&mut Self>,
1711        cx: &mut std::task::Context<'_>,
1712    ) -> std::task::Poll<Option<Self::Item>> {
1713        let this = &mut *self;
1714        if this.inner.check_shutdown(cx) {
1715            this.is_terminated = true;
1716            return std::task::Poll::Ready(None);
1717        }
1718        if this.is_terminated {
1719            panic!("polled ContextProviderRequestStream after completion");
1720        }
1721        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1722            |bytes, handles| {
1723                match this.inner.channel().read_etc(cx, bytes, handles) {
1724                    std::task::Poll::Ready(Ok(())) => {}
1725                    std::task::Poll::Pending => return std::task::Poll::Pending,
1726                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1727                        this.is_terminated = true;
1728                        return std::task::Poll::Ready(None);
1729                    }
1730                    std::task::Poll::Ready(Err(e)) => {
1731                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1732                            e.into(),
1733                        ))));
1734                    }
1735                }
1736
1737                // A message has been received from the channel
1738                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1739
1740                std::task::Poll::Ready(Some(match header.ordinal {
1741                    0x6ee6fa35978eb98d => {
1742                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1743                        let mut req = fidl::new_empty!(
1744                            ContextProviderCreateRequest,
1745                            fidl::encoding::DefaultFuchsiaResourceDialect
1746                        );
1747                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ContextProviderCreateRequest>(&header, _body_bytes, handles, &mut req)?;
1748                        let control_handle =
1749                            ContextProviderControlHandle { inner: this.inner.clone() };
1750                        Ok(ContextProviderRequest::Create {
1751                            params: req.params,
1752                            context: req.context,
1753
1754                            control_handle,
1755                        })
1756                    }
1757                    _ => Err(fidl::Error::UnknownOrdinal {
1758                        ordinal: header.ordinal,
1759                        protocol_name:
1760                            <ContextProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1761                    }),
1762                }))
1763            },
1764        )
1765    }
1766}
1767
1768/// The top-level service interface which allows for the creation of Context resources.
1769#[derive(Debug)]
1770pub enum ContextProviderRequest {
1771    /// Creates a new browser [`Context`] whose state is wholly independent and isolated from other
1772    /// [`Context`](`Contexts`).
1773    ///
1774    /// - `params`: The configuration used to create the [`Context`].
1775    /// - `context`: An interface request which will receive a bound [`Context`]
1776    ///   service.
1777    Create {
1778        params: CreateContextParams,
1779        context: fidl::endpoints::ServerEnd<ContextMarker>,
1780        control_handle: ContextProviderControlHandle,
1781    },
1782}
1783
1784impl ContextProviderRequest {
1785    #[allow(irrefutable_let_patterns)]
1786    pub fn into_create(
1787        self,
1788    ) -> Option<(
1789        CreateContextParams,
1790        fidl::endpoints::ServerEnd<ContextMarker>,
1791        ContextProviderControlHandle,
1792    )> {
1793        if let ContextProviderRequest::Create { params, context, control_handle } = self {
1794            Some((params, context, control_handle))
1795        } else {
1796            None
1797        }
1798    }
1799
1800    /// Name of the method defined in FIDL
1801    pub fn method_name(&self) -> &'static str {
1802        match *self {
1803            ContextProviderRequest::Create { .. } => "create",
1804        }
1805    }
1806}
1807
1808#[derive(Debug, Clone)]
1809pub struct ContextProviderControlHandle {
1810    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1811}
1812
1813impl ContextProviderControlHandle {
1814    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1815        self.inner.shutdown_with_epitaph(status.into())
1816    }
1817}
1818
1819impl fidl::endpoints::ControlHandle for ContextProviderControlHandle {
1820    fn shutdown(&self) {
1821        self.inner.shutdown()
1822    }
1823
1824    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1825        self.inner.shutdown_with_epitaph(status)
1826    }
1827
1828    fn is_closed(&self) -> bool {
1829        self.inner.channel().is_closed()
1830    }
1831    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1832        self.inner.channel().on_closed()
1833    }
1834
1835    #[cfg(target_os = "fuchsia")]
1836    fn signal_peer(
1837        &self,
1838        clear_mask: zx::Signals,
1839        set_mask: zx::Signals,
1840    ) -> Result<(), zx_status::Status> {
1841        use fidl::Peered;
1842        self.inner.channel().signal_peer(clear_mask, set_mask)
1843    }
1844}
1845
1846impl ContextProviderControlHandle {}
1847
1848#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1849pub struct CookieManagerMarker;
1850
1851impl fidl::endpoints::ProtocolMarker for CookieManagerMarker {
1852    type Proxy = CookieManagerProxy;
1853    type RequestStream = CookieManagerRequestStream;
1854    #[cfg(target_os = "fuchsia")]
1855    type SynchronousProxy = CookieManagerSynchronousProxy;
1856
1857    const DEBUG_NAME: &'static str = "(anonymous) CookieManager";
1858}
1859
1860pub trait CookieManagerProxyInterface: Send + Sync {
1861    fn r#observe_cookie_changes(
1862        &self,
1863        url: Option<&str>,
1864        name: Option<&str>,
1865        changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1866    ) -> Result<(), fidl::Error>;
1867    fn r#get_cookie_list(
1868        &self,
1869        url: Option<&str>,
1870        name: Option<&str>,
1871        cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1872    ) -> Result<(), fidl::Error>;
1873}
1874#[derive(Debug)]
1875#[cfg(target_os = "fuchsia")]
1876pub struct CookieManagerSynchronousProxy {
1877    client: fidl::client::sync::Client,
1878}
1879
1880#[cfg(target_os = "fuchsia")]
1881impl fidl::endpoints::SynchronousProxy for CookieManagerSynchronousProxy {
1882    type Proxy = CookieManagerProxy;
1883    type Protocol = CookieManagerMarker;
1884
1885    fn from_channel(inner: fidl::Channel) -> Self {
1886        Self::new(inner)
1887    }
1888
1889    fn into_channel(self) -> fidl::Channel {
1890        self.client.into_channel()
1891    }
1892
1893    fn as_channel(&self) -> &fidl::Channel {
1894        self.client.as_channel()
1895    }
1896}
1897
1898#[cfg(target_os = "fuchsia")]
1899impl CookieManagerSynchronousProxy {
1900    pub fn new(channel: fidl::Channel) -> Self {
1901        Self { client: fidl::client::sync::Client::new(channel) }
1902    }
1903
1904    pub fn into_channel(self) -> fidl::Channel {
1905        self.client.into_channel()
1906    }
1907
1908    /// Waits until an event arrives and returns it. It is safe for other
1909    /// threads to make concurrent requests while waiting for an event.
1910    pub fn wait_for_event(
1911        &self,
1912        deadline: zx::MonotonicInstant,
1913    ) -> Result<CookieManagerEvent, fidl::Error> {
1914        CookieManagerEvent::decode(self.client.wait_for_event::<CookieManagerMarker>(deadline)?)
1915    }
1916
1917    /// Observe changes to all cookies named `name` that would be sent in a request to `url`.
1918    ///
1919    /// If neither `url` nor `name` are set then all cookies are observed. If only `url` is set
1920    /// then all cookies for that URL are observed. If both are set then only cookies matching both
1921    /// fields are observed.
1922    ///
1923    /// `changes` iterates over a stream of cookie changes. Additions or updates are expressed as
1924    /// complete cookies, while deletions are expressed as cookies with no `value` set.
1925    pub fn r#observe_cookie_changes(
1926        &self,
1927        mut url: Option<&str>,
1928        mut name: Option<&str>,
1929        mut changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1930    ) -> Result<(), fidl::Error> {
1931        self.client.send::<CookieManagerObserveCookieChangesRequest>(
1932            (url, name, changes),
1933            0x49d8259726088b2,
1934            fidl::encoding::DynamicFlags::empty(),
1935        )
1936    }
1937
1938    /// Returns a list of Cookies, optionally limited to those matching `url`, and optionally
1939    /// `name`. `cookies` iterates over the matching cookies, including their `value`s.
1940    pub fn r#get_cookie_list(
1941        &self,
1942        mut url: Option<&str>,
1943        mut name: Option<&str>,
1944        mut cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
1945    ) -> Result<(), fidl::Error> {
1946        self.client.send::<CookieManagerGetCookieListRequest>(
1947            (url, name, cookies),
1948            0x391d79f54044f334,
1949            fidl::encoding::DynamicFlags::empty(),
1950        )
1951    }
1952}
1953
1954#[cfg(target_os = "fuchsia")]
1955impl From<CookieManagerSynchronousProxy> for zx::NullableHandle {
1956    fn from(value: CookieManagerSynchronousProxy) -> Self {
1957        value.into_channel().into()
1958    }
1959}
1960
1961#[cfg(target_os = "fuchsia")]
1962impl From<fidl::Channel> for CookieManagerSynchronousProxy {
1963    fn from(value: fidl::Channel) -> Self {
1964        Self::new(value)
1965    }
1966}
1967
1968#[cfg(target_os = "fuchsia")]
1969impl fidl::endpoints::FromClient for CookieManagerSynchronousProxy {
1970    type Protocol = CookieManagerMarker;
1971
1972    fn from_client(value: fidl::endpoints::ClientEnd<CookieManagerMarker>) -> Self {
1973        Self::new(value.into_channel())
1974    }
1975}
1976
1977#[derive(Debug, Clone)]
1978pub struct CookieManagerProxy {
1979    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1980}
1981
1982impl fidl::endpoints::Proxy for CookieManagerProxy {
1983    type Protocol = CookieManagerMarker;
1984
1985    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1986        Self::new(inner)
1987    }
1988
1989    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1990        self.client.into_channel().map_err(|client| Self { client })
1991    }
1992
1993    fn as_channel(&self) -> &::fidl::AsyncChannel {
1994        self.client.as_channel()
1995    }
1996}
1997
1998impl CookieManagerProxy {
1999    /// Create a new Proxy for fuchsia.web/CookieManager.
2000    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2001        let protocol_name = <CookieManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2002        Self { client: fidl::client::Client::new(channel, protocol_name) }
2003    }
2004
2005    /// Get a Stream of events from the remote end of the protocol.
2006    ///
2007    /// # Panics
2008    ///
2009    /// Panics if the event stream was already taken.
2010    pub fn take_event_stream(&self) -> CookieManagerEventStream {
2011        CookieManagerEventStream { event_receiver: self.client.take_event_receiver() }
2012    }
2013
2014    /// Observe changes to all cookies named `name` that would be sent in a request to `url`.
2015    ///
2016    /// If neither `url` nor `name` are set then all cookies are observed. If only `url` is set
2017    /// then all cookies for that URL are observed. If both are set then only cookies matching both
2018    /// fields are observed.
2019    ///
2020    /// `changes` iterates over a stream of cookie changes. Additions or updates are expressed as
2021    /// complete cookies, while deletions are expressed as cookies with no `value` set.
2022    pub fn r#observe_cookie_changes(
2023        &self,
2024        mut url: Option<&str>,
2025        mut name: Option<&str>,
2026        mut changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2027    ) -> Result<(), fidl::Error> {
2028        CookieManagerProxyInterface::r#observe_cookie_changes(self, url, name, changes)
2029    }
2030
2031    /// Returns a list of Cookies, optionally limited to those matching `url`, and optionally
2032    /// `name`. `cookies` iterates over the matching cookies, including their `value`s.
2033    pub fn r#get_cookie_list(
2034        &self,
2035        mut url: Option<&str>,
2036        mut name: Option<&str>,
2037        mut cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2038    ) -> Result<(), fidl::Error> {
2039        CookieManagerProxyInterface::r#get_cookie_list(self, url, name, cookies)
2040    }
2041}
2042
2043impl CookieManagerProxyInterface for CookieManagerProxy {
2044    fn r#observe_cookie_changes(
2045        &self,
2046        mut url: Option<&str>,
2047        mut name: Option<&str>,
2048        mut changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2049    ) -> Result<(), fidl::Error> {
2050        self.client.send::<CookieManagerObserveCookieChangesRequest>(
2051            (url, name, changes),
2052            0x49d8259726088b2,
2053            fidl::encoding::DynamicFlags::empty(),
2054        )
2055    }
2056
2057    fn r#get_cookie_list(
2058        &self,
2059        mut url: Option<&str>,
2060        mut name: Option<&str>,
2061        mut cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2062    ) -> Result<(), fidl::Error> {
2063        self.client.send::<CookieManagerGetCookieListRequest>(
2064            (url, name, cookies),
2065            0x391d79f54044f334,
2066            fidl::encoding::DynamicFlags::empty(),
2067        )
2068    }
2069}
2070
2071pub struct CookieManagerEventStream {
2072    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2073}
2074
2075impl std::marker::Unpin for CookieManagerEventStream {}
2076
2077impl futures::stream::FusedStream for CookieManagerEventStream {
2078    fn is_terminated(&self) -> bool {
2079        self.event_receiver.is_terminated()
2080    }
2081}
2082
2083impl futures::Stream for CookieManagerEventStream {
2084    type Item = Result<CookieManagerEvent, fidl::Error>;
2085
2086    fn poll_next(
2087        mut self: std::pin::Pin<&mut Self>,
2088        cx: &mut std::task::Context<'_>,
2089    ) -> std::task::Poll<Option<Self::Item>> {
2090        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2091            &mut self.event_receiver,
2092            cx
2093        )?) {
2094            Some(buf) => std::task::Poll::Ready(Some(CookieManagerEvent::decode(buf))),
2095            None => std::task::Poll::Ready(None),
2096        }
2097    }
2098}
2099
2100#[derive(Debug)]
2101pub enum CookieManagerEvent {}
2102
2103impl CookieManagerEvent {
2104    /// Decodes a message buffer as a [`CookieManagerEvent`].
2105    fn decode(
2106        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2107    ) -> Result<CookieManagerEvent, fidl::Error> {
2108        let (bytes, _handles) = buf.split_mut();
2109        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2110        debug_assert_eq!(tx_header.tx_id, 0);
2111        match tx_header.ordinal {
2112            _ => Err(fidl::Error::UnknownOrdinal {
2113                ordinal: tx_header.ordinal,
2114                protocol_name: <CookieManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2115            }),
2116        }
2117    }
2118}
2119
2120/// A Stream of incoming requests for fuchsia.web/CookieManager.
2121pub struct CookieManagerRequestStream {
2122    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2123    is_terminated: bool,
2124}
2125
2126impl std::marker::Unpin for CookieManagerRequestStream {}
2127
2128impl futures::stream::FusedStream for CookieManagerRequestStream {
2129    fn is_terminated(&self) -> bool {
2130        self.is_terminated
2131    }
2132}
2133
2134impl fidl::endpoints::RequestStream for CookieManagerRequestStream {
2135    type Protocol = CookieManagerMarker;
2136    type ControlHandle = CookieManagerControlHandle;
2137
2138    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2139        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2140    }
2141
2142    fn control_handle(&self) -> Self::ControlHandle {
2143        CookieManagerControlHandle { inner: self.inner.clone() }
2144    }
2145
2146    fn into_inner(
2147        self,
2148    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2149    {
2150        (self.inner, self.is_terminated)
2151    }
2152
2153    fn from_inner(
2154        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2155        is_terminated: bool,
2156    ) -> Self {
2157        Self { inner, is_terminated }
2158    }
2159}
2160
2161impl futures::Stream for CookieManagerRequestStream {
2162    type Item = Result<CookieManagerRequest, fidl::Error>;
2163
2164    fn poll_next(
2165        mut self: std::pin::Pin<&mut Self>,
2166        cx: &mut std::task::Context<'_>,
2167    ) -> std::task::Poll<Option<Self::Item>> {
2168        let this = &mut *self;
2169        if this.inner.check_shutdown(cx) {
2170            this.is_terminated = true;
2171            return std::task::Poll::Ready(None);
2172        }
2173        if this.is_terminated {
2174            panic!("polled CookieManagerRequestStream after completion");
2175        }
2176        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2177            |bytes, handles| {
2178                match this.inner.channel().read_etc(cx, bytes, handles) {
2179                    std::task::Poll::Ready(Ok(())) => {}
2180                    std::task::Poll::Pending => return std::task::Poll::Pending,
2181                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2182                        this.is_terminated = true;
2183                        return std::task::Poll::Ready(None);
2184                    }
2185                    std::task::Poll::Ready(Err(e)) => {
2186                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2187                            e.into(),
2188                        ))));
2189                    }
2190                }
2191
2192                // A message has been received from the channel
2193                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2194
2195                std::task::Poll::Ready(Some(match header.ordinal {
2196                    0x49d8259726088b2 => {
2197                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2198                        let mut req = fidl::new_empty!(
2199                            CookieManagerObserveCookieChangesRequest,
2200                            fidl::encoding::DefaultFuchsiaResourceDialect
2201                        );
2202                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CookieManagerObserveCookieChangesRequest>(&header, _body_bytes, handles, &mut req)?;
2203                        let control_handle =
2204                            CookieManagerControlHandle { inner: this.inner.clone() };
2205                        Ok(CookieManagerRequest::ObserveCookieChanges {
2206                            url: req.url,
2207                            name: req.name,
2208                            changes: req.changes,
2209
2210                            control_handle,
2211                        })
2212                    }
2213                    0x391d79f54044f334 => {
2214                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2215                        let mut req = fidl::new_empty!(
2216                            CookieManagerGetCookieListRequest,
2217                            fidl::encoding::DefaultFuchsiaResourceDialect
2218                        );
2219                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CookieManagerGetCookieListRequest>(&header, _body_bytes, handles, &mut req)?;
2220                        let control_handle =
2221                            CookieManagerControlHandle { inner: this.inner.clone() };
2222                        Ok(CookieManagerRequest::GetCookieList {
2223                            url: req.url,
2224                            name: req.name,
2225                            cookies: req.cookies,
2226
2227                            control_handle,
2228                        })
2229                    }
2230                    _ => Err(fidl::Error::UnknownOrdinal {
2231                        ordinal: header.ordinal,
2232                        protocol_name:
2233                            <CookieManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2234                    }),
2235                }))
2236            },
2237        )
2238    }
2239}
2240
2241/// Provides methods for monitoring and accessing browser cookie state.
2242#[derive(Debug)]
2243pub enum CookieManagerRequest {
2244    /// Observe changes to all cookies named `name` that would be sent in a request to `url`.
2245    ///
2246    /// If neither `url` nor `name` are set then all cookies are observed. If only `url` is set
2247    /// then all cookies for that URL are observed. If both are set then only cookies matching both
2248    /// fields are observed.
2249    ///
2250    /// `changes` iterates over a stream of cookie changes. Additions or updates are expressed as
2251    /// complete cookies, while deletions are expressed as cookies with no `value` set.
2252    ObserveCookieChanges {
2253        url: Option<String>,
2254        name: Option<String>,
2255        changes: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2256        control_handle: CookieManagerControlHandle,
2257    },
2258    /// Returns a list of Cookies, optionally limited to those matching `url`, and optionally
2259    /// `name`. `cookies` iterates over the matching cookies, including their `value`s.
2260    GetCookieList {
2261        url: Option<String>,
2262        name: Option<String>,
2263        cookies: fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2264        control_handle: CookieManagerControlHandle,
2265    },
2266}
2267
2268impl CookieManagerRequest {
2269    #[allow(irrefutable_let_patterns)]
2270    pub fn into_observe_cookie_changes(
2271        self,
2272    ) -> Option<(
2273        Option<String>,
2274        Option<String>,
2275        fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2276        CookieManagerControlHandle,
2277    )> {
2278        if let CookieManagerRequest::ObserveCookieChanges { url, name, changes, control_handle } =
2279            self
2280        {
2281            Some((url, name, changes, control_handle))
2282        } else {
2283            None
2284        }
2285    }
2286
2287    #[allow(irrefutable_let_patterns)]
2288    pub fn into_get_cookie_list(
2289        self,
2290    ) -> Option<(
2291        Option<String>,
2292        Option<String>,
2293        fidl::endpoints::ServerEnd<CookiesIteratorMarker>,
2294        CookieManagerControlHandle,
2295    )> {
2296        if let CookieManagerRequest::GetCookieList { url, name, cookies, control_handle } = self {
2297            Some((url, name, cookies, control_handle))
2298        } else {
2299            None
2300        }
2301    }
2302
2303    /// Name of the method defined in FIDL
2304    pub fn method_name(&self) -> &'static str {
2305        match *self {
2306            CookieManagerRequest::ObserveCookieChanges { .. } => "observe_cookie_changes",
2307            CookieManagerRequest::GetCookieList { .. } => "get_cookie_list",
2308        }
2309    }
2310}
2311
2312#[derive(Debug, Clone)]
2313pub struct CookieManagerControlHandle {
2314    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2315}
2316
2317impl CookieManagerControlHandle {
2318    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2319        self.inner.shutdown_with_epitaph(status.into())
2320    }
2321}
2322
2323impl fidl::endpoints::ControlHandle for CookieManagerControlHandle {
2324    fn shutdown(&self) {
2325        self.inner.shutdown()
2326    }
2327
2328    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2329        self.inner.shutdown_with_epitaph(status)
2330    }
2331
2332    fn is_closed(&self) -> bool {
2333        self.inner.channel().is_closed()
2334    }
2335    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2336        self.inner.channel().on_closed()
2337    }
2338
2339    #[cfg(target_os = "fuchsia")]
2340    fn signal_peer(
2341        &self,
2342        clear_mask: zx::Signals,
2343        set_mask: zx::Signals,
2344    ) -> Result<(), zx_status::Status> {
2345        use fidl::Peered;
2346        self.inner.channel().signal_peer(clear_mask, set_mask)
2347    }
2348}
2349
2350impl CookieManagerControlHandle {}
2351
2352#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2353pub struct CookiesIteratorMarker;
2354
2355impl fidl::endpoints::ProtocolMarker for CookiesIteratorMarker {
2356    type Proxy = CookiesIteratorProxy;
2357    type RequestStream = CookiesIteratorRequestStream;
2358    #[cfg(target_os = "fuchsia")]
2359    type SynchronousProxy = CookiesIteratorSynchronousProxy;
2360
2361    const DEBUG_NAME: &'static str = "(anonymous) CookiesIterator";
2362}
2363
2364pub trait CookiesIteratorProxyInterface: Send + Sync {
2365    type GetNextResponseFut: std::future::Future<Output = Result<Vec<Cookie>, fidl::Error>> + Send;
2366    fn r#get_next(&self) -> Self::GetNextResponseFut;
2367}
2368#[derive(Debug)]
2369#[cfg(target_os = "fuchsia")]
2370pub struct CookiesIteratorSynchronousProxy {
2371    client: fidl::client::sync::Client,
2372}
2373
2374#[cfg(target_os = "fuchsia")]
2375impl fidl::endpoints::SynchronousProxy for CookiesIteratorSynchronousProxy {
2376    type Proxy = CookiesIteratorProxy;
2377    type Protocol = CookiesIteratorMarker;
2378
2379    fn from_channel(inner: fidl::Channel) -> Self {
2380        Self::new(inner)
2381    }
2382
2383    fn into_channel(self) -> fidl::Channel {
2384        self.client.into_channel()
2385    }
2386
2387    fn as_channel(&self) -> &fidl::Channel {
2388        self.client.as_channel()
2389    }
2390}
2391
2392#[cfg(target_os = "fuchsia")]
2393impl CookiesIteratorSynchronousProxy {
2394    pub fn new(channel: fidl::Channel) -> Self {
2395        Self { client: fidl::client::sync::Client::new(channel) }
2396    }
2397
2398    pub fn into_channel(self) -> fidl::Channel {
2399        self.client.into_channel()
2400    }
2401
2402    /// Waits until an event arrives and returns it. It is safe for other
2403    /// threads to make concurrent requests while waiting for an event.
2404    pub fn wait_for_event(
2405        &self,
2406        deadline: zx::MonotonicInstant,
2407    ) -> Result<CookiesIteratorEvent, fidl::Error> {
2408        CookiesIteratorEvent::decode(self.client.wait_for_event::<CookiesIteratorMarker>(deadline)?)
2409    }
2410
2411    /// Fetches the next batch of cookies, or of changes to cookies.
2412    /// RFC6265 does not specify an upper-bound on the number of cookies which
2413    /// may be stored.
2414    pub fn r#get_next(
2415        &self,
2416        ___deadline: zx::MonotonicInstant,
2417    ) -> Result<Vec<Cookie>, fidl::Error> {
2418        let _response = self.client.send_query::<
2419            fidl::encoding::EmptyPayload,
2420            CookiesIteratorGetNextResponse,
2421            CookiesIteratorMarker,
2422        >(
2423            (),
2424            0x61b55ebf67ec457d,
2425            fidl::encoding::DynamicFlags::empty(),
2426            ___deadline,
2427        )?;
2428        Ok(_response.changed_cookies)
2429    }
2430}
2431
2432#[cfg(target_os = "fuchsia")]
2433impl From<CookiesIteratorSynchronousProxy> for zx::NullableHandle {
2434    fn from(value: CookiesIteratorSynchronousProxy) -> Self {
2435        value.into_channel().into()
2436    }
2437}
2438
2439#[cfg(target_os = "fuchsia")]
2440impl From<fidl::Channel> for CookiesIteratorSynchronousProxy {
2441    fn from(value: fidl::Channel) -> Self {
2442        Self::new(value)
2443    }
2444}
2445
2446#[cfg(target_os = "fuchsia")]
2447impl fidl::endpoints::FromClient for CookiesIteratorSynchronousProxy {
2448    type Protocol = CookiesIteratorMarker;
2449
2450    fn from_client(value: fidl::endpoints::ClientEnd<CookiesIteratorMarker>) -> Self {
2451        Self::new(value.into_channel())
2452    }
2453}
2454
2455#[derive(Debug, Clone)]
2456pub struct CookiesIteratorProxy {
2457    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2458}
2459
2460impl fidl::endpoints::Proxy for CookiesIteratorProxy {
2461    type Protocol = CookiesIteratorMarker;
2462
2463    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2464        Self::new(inner)
2465    }
2466
2467    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2468        self.client.into_channel().map_err(|client| Self { client })
2469    }
2470
2471    fn as_channel(&self) -> &::fidl::AsyncChannel {
2472        self.client.as_channel()
2473    }
2474}
2475
2476impl CookiesIteratorProxy {
2477    /// Create a new Proxy for fuchsia.web/CookiesIterator.
2478    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2479        let protocol_name = <CookiesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2480        Self { client: fidl::client::Client::new(channel, protocol_name) }
2481    }
2482
2483    /// Get a Stream of events from the remote end of the protocol.
2484    ///
2485    /// # Panics
2486    ///
2487    /// Panics if the event stream was already taken.
2488    pub fn take_event_stream(&self) -> CookiesIteratorEventStream {
2489        CookiesIteratorEventStream { event_receiver: self.client.take_event_receiver() }
2490    }
2491
2492    /// Fetches the next batch of cookies, or of changes to cookies.
2493    /// RFC6265 does not specify an upper-bound on the number of cookies which
2494    /// may be stored.
2495    pub fn r#get_next(
2496        &self,
2497    ) -> fidl::client::QueryResponseFut<Vec<Cookie>, fidl::encoding::DefaultFuchsiaResourceDialect>
2498    {
2499        CookiesIteratorProxyInterface::r#get_next(self)
2500    }
2501}
2502
2503impl CookiesIteratorProxyInterface for CookiesIteratorProxy {
2504    type GetNextResponseFut =
2505        fidl::client::QueryResponseFut<Vec<Cookie>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2506    fn r#get_next(&self) -> Self::GetNextResponseFut {
2507        fn _decode(
2508            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2509        ) -> Result<Vec<Cookie>, fidl::Error> {
2510            let _response = fidl::client::decode_transaction_body::<
2511                CookiesIteratorGetNextResponse,
2512                fidl::encoding::DefaultFuchsiaResourceDialect,
2513                0x61b55ebf67ec457d,
2514            >(_buf?)?;
2515            Ok(_response.changed_cookies)
2516        }
2517        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Cookie>>(
2518            (),
2519            0x61b55ebf67ec457d,
2520            fidl::encoding::DynamicFlags::empty(),
2521            _decode,
2522        )
2523    }
2524}
2525
2526pub struct CookiesIteratorEventStream {
2527    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2528}
2529
2530impl std::marker::Unpin for CookiesIteratorEventStream {}
2531
2532impl futures::stream::FusedStream for CookiesIteratorEventStream {
2533    fn is_terminated(&self) -> bool {
2534        self.event_receiver.is_terminated()
2535    }
2536}
2537
2538impl futures::Stream for CookiesIteratorEventStream {
2539    type Item = Result<CookiesIteratorEvent, fidl::Error>;
2540
2541    fn poll_next(
2542        mut self: std::pin::Pin<&mut Self>,
2543        cx: &mut std::task::Context<'_>,
2544    ) -> std::task::Poll<Option<Self::Item>> {
2545        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2546            &mut self.event_receiver,
2547            cx
2548        )?) {
2549            Some(buf) => std::task::Poll::Ready(Some(CookiesIteratorEvent::decode(buf))),
2550            None => std::task::Poll::Ready(None),
2551        }
2552    }
2553}
2554
2555#[derive(Debug)]
2556pub enum CookiesIteratorEvent {}
2557
2558impl CookiesIteratorEvent {
2559    /// Decodes a message buffer as a [`CookiesIteratorEvent`].
2560    fn decode(
2561        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2562    ) -> Result<CookiesIteratorEvent, fidl::Error> {
2563        let (bytes, _handles) = buf.split_mut();
2564        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2565        debug_assert_eq!(tx_header.tx_id, 0);
2566        match tx_header.ordinal {
2567            _ => Err(fidl::Error::UnknownOrdinal {
2568                ordinal: tx_header.ordinal,
2569                protocol_name:
2570                    <CookiesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2571            }),
2572        }
2573    }
2574}
2575
2576/// A Stream of incoming requests for fuchsia.web/CookiesIterator.
2577pub struct CookiesIteratorRequestStream {
2578    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2579    is_terminated: bool,
2580}
2581
2582impl std::marker::Unpin for CookiesIteratorRequestStream {}
2583
2584impl futures::stream::FusedStream for CookiesIteratorRequestStream {
2585    fn is_terminated(&self) -> bool {
2586        self.is_terminated
2587    }
2588}
2589
2590impl fidl::endpoints::RequestStream for CookiesIteratorRequestStream {
2591    type Protocol = CookiesIteratorMarker;
2592    type ControlHandle = CookiesIteratorControlHandle;
2593
2594    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2595        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2596    }
2597
2598    fn control_handle(&self) -> Self::ControlHandle {
2599        CookiesIteratorControlHandle { inner: self.inner.clone() }
2600    }
2601
2602    fn into_inner(
2603        self,
2604    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2605    {
2606        (self.inner, self.is_terminated)
2607    }
2608
2609    fn from_inner(
2610        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2611        is_terminated: bool,
2612    ) -> Self {
2613        Self { inner, is_terminated }
2614    }
2615}
2616
2617impl futures::Stream for CookiesIteratorRequestStream {
2618    type Item = Result<CookiesIteratorRequest, fidl::Error>;
2619
2620    fn poll_next(
2621        mut self: std::pin::Pin<&mut Self>,
2622        cx: &mut std::task::Context<'_>,
2623    ) -> std::task::Poll<Option<Self::Item>> {
2624        let this = &mut *self;
2625        if this.inner.check_shutdown(cx) {
2626            this.is_terminated = true;
2627            return std::task::Poll::Ready(None);
2628        }
2629        if this.is_terminated {
2630            panic!("polled CookiesIteratorRequestStream after completion");
2631        }
2632        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2633            |bytes, handles| {
2634                match this.inner.channel().read_etc(cx, bytes, handles) {
2635                    std::task::Poll::Ready(Ok(())) => {}
2636                    std::task::Poll::Pending => return std::task::Poll::Pending,
2637                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2638                        this.is_terminated = true;
2639                        return std::task::Poll::Ready(None);
2640                    }
2641                    std::task::Poll::Ready(Err(e)) => {
2642                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2643                            e.into(),
2644                        ))));
2645                    }
2646                }
2647
2648                // A message has been received from the channel
2649                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2650
2651                std::task::Poll::Ready(Some(match header.ordinal {
2652                    0x61b55ebf67ec457d => {
2653                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2654                        let mut req = fidl::new_empty!(
2655                            fidl::encoding::EmptyPayload,
2656                            fidl::encoding::DefaultFuchsiaResourceDialect
2657                        );
2658                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2659                        let control_handle =
2660                            CookiesIteratorControlHandle { inner: this.inner.clone() };
2661                        Ok(CookiesIteratorRequest::GetNext {
2662                            responder: CookiesIteratorGetNextResponder {
2663                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2664                                tx_id: header.tx_id,
2665                            },
2666                        })
2667                    }
2668                    _ => Err(fidl::Error::UnknownOrdinal {
2669                        ordinal: header.ordinal,
2670                        protocol_name:
2671                            <CookiesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2672                    }),
2673                }))
2674            },
2675        )
2676    }
2677}
2678
2679/// Used to iterator over a set of cookies, or a stream of changes to cookies.
2680#[derive(Debug)]
2681pub enum CookiesIteratorRequest {
2682    /// Fetches the next batch of cookies, or of changes to cookies.
2683    /// RFC6265 does not specify an upper-bound on the number of cookies which
2684    /// may be stored.
2685    GetNext { responder: CookiesIteratorGetNextResponder },
2686}
2687
2688impl CookiesIteratorRequest {
2689    #[allow(irrefutable_let_patterns)]
2690    pub fn into_get_next(self) -> Option<(CookiesIteratorGetNextResponder)> {
2691        if let CookiesIteratorRequest::GetNext { responder } = self {
2692            Some((responder))
2693        } else {
2694            None
2695        }
2696    }
2697
2698    /// Name of the method defined in FIDL
2699    pub fn method_name(&self) -> &'static str {
2700        match *self {
2701            CookiesIteratorRequest::GetNext { .. } => "get_next",
2702        }
2703    }
2704}
2705
2706#[derive(Debug, Clone)]
2707pub struct CookiesIteratorControlHandle {
2708    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2709}
2710
2711impl CookiesIteratorControlHandle {
2712    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2713        self.inner.shutdown_with_epitaph(status.into())
2714    }
2715}
2716
2717impl fidl::endpoints::ControlHandle for CookiesIteratorControlHandle {
2718    fn shutdown(&self) {
2719        self.inner.shutdown()
2720    }
2721
2722    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2723        self.inner.shutdown_with_epitaph(status)
2724    }
2725
2726    fn is_closed(&self) -> bool {
2727        self.inner.channel().is_closed()
2728    }
2729    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2730        self.inner.channel().on_closed()
2731    }
2732
2733    #[cfg(target_os = "fuchsia")]
2734    fn signal_peer(
2735        &self,
2736        clear_mask: zx::Signals,
2737        set_mask: zx::Signals,
2738    ) -> Result<(), zx_status::Status> {
2739        use fidl::Peered;
2740        self.inner.channel().signal_peer(clear_mask, set_mask)
2741    }
2742}
2743
2744impl CookiesIteratorControlHandle {}
2745
2746#[must_use = "FIDL methods require a response to be sent"]
2747#[derive(Debug)]
2748pub struct CookiesIteratorGetNextResponder {
2749    control_handle: std::mem::ManuallyDrop<CookiesIteratorControlHandle>,
2750    tx_id: u32,
2751}
2752
2753/// Set the the channel to be shutdown (see [`CookiesIteratorControlHandle::shutdown`])
2754/// if the responder is dropped without sending a response, so that the client
2755/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2756impl std::ops::Drop for CookiesIteratorGetNextResponder {
2757    fn drop(&mut self) {
2758        self.control_handle.shutdown();
2759        // Safety: drops once, never accessed again
2760        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2761    }
2762}
2763
2764impl fidl::endpoints::Responder for CookiesIteratorGetNextResponder {
2765    type ControlHandle = CookiesIteratorControlHandle;
2766
2767    fn control_handle(&self) -> &CookiesIteratorControlHandle {
2768        &self.control_handle
2769    }
2770
2771    fn drop_without_shutdown(mut self) {
2772        // Safety: drops once, never accessed again due to mem::forget
2773        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2774        // Prevent Drop from running (which would shut down the channel)
2775        std::mem::forget(self);
2776    }
2777}
2778
2779impl CookiesIteratorGetNextResponder {
2780    /// Sends a response to the FIDL transaction.
2781    ///
2782    /// Sets the channel to shutdown if an error occurs.
2783    pub fn send(self, mut changed_cookies: Vec<Cookie>) -> Result<(), fidl::Error> {
2784        let _result = self.send_raw(changed_cookies);
2785        if _result.is_err() {
2786            self.control_handle.shutdown();
2787        }
2788        self.drop_without_shutdown();
2789        _result
2790    }
2791
2792    /// Similar to "send" but does not shutdown the channel if an error occurs.
2793    pub fn send_no_shutdown_on_err(
2794        self,
2795        mut changed_cookies: Vec<Cookie>,
2796    ) -> Result<(), fidl::Error> {
2797        let _result = self.send_raw(changed_cookies);
2798        self.drop_without_shutdown();
2799        _result
2800    }
2801
2802    fn send_raw(&self, mut changed_cookies: Vec<Cookie>) -> Result<(), fidl::Error> {
2803        self.control_handle.inner.send::<CookiesIteratorGetNextResponse>(
2804            (changed_cookies.as_mut(),),
2805            self.tx_id,
2806            0x61b55ebf67ec457d,
2807            fidl::encoding::DynamicFlags::empty(),
2808        )
2809    }
2810}
2811
2812#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2813pub struct DebugMarker;
2814
2815impl fidl::endpoints::ProtocolMarker for DebugMarker {
2816    type Proxy = DebugProxy;
2817    type RequestStream = DebugRequestStream;
2818    #[cfg(target_os = "fuchsia")]
2819    type SynchronousProxy = DebugSynchronousProxy;
2820
2821    const DEBUG_NAME: &'static str = "fuchsia.web.Debug";
2822}
2823impl fidl::endpoints::DiscoverableProtocolMarker for DebugMarker {}
2824
2825pub trait DebugProxyInterface: Send + Sync {
2826    type EnableDevToolsResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2827    fn r#enable_dev_tools(
2828        &self,
2829        listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
2830    ) -> Self::EnableDevToolsResponseFut;
2831}
2832#[derive(Debug)]
2833#[cfg(target_os = "fuchsia")]
2834pub struct DebugSynchronousProxy {
2835    client: fidl::client::sync::Client,
2836}
2837
2838#[cfg(target_os = "fuchsia")]
2839impl fidl::endpoints::SynchronousProxy for DebugSynchronousProxy {
2840    type Proxy = DebugProxy;
2841    type Protocol = DebugMarker;
2842
2843    fn from_channel(inner: fidl::Channel) -> Self {
2844        Self::new(inner)
2845    }
2846
2847    fn into_channel(self) -> fidl::Channel {
2848        self.client.into_channel()
2849    }
2850
2851    fn as_channel(&self) -> &fidl::Channel {
2852        self.client.as_channel()
2853    }
2854}
2855
2856#[cfg(target_os = "fuchsia")]
2857impl DebugSynchronousProxy {
2858    pub fn new(channel: fidl::Channel) -> Self {
2859        Self { client: fidl::client::sync::Client::new(channel) }
2860    }
2861
2862    pub fn into_channel(self) -> fidl::Channel {
2863        self.client.into_channel()
2864    }
2865
2866    /// Waits until an event arrives and returns it. It is safe for other
2867    /// threads to make concurrent requests while waiting for an event.
2868    pub fn wait_for_event(
2869        &self,
2870        deadline: zx::MonotonicInstant,
2871    ) -> Result<DebugEvent, fidl::Error> {
2872        DebugEvent::decode(self.client.wait_for_event::<DebugMarker>(deadline)?)
2873    }
2874
2875    /// Enables the DevTools service on every subsequent [`Context`] creation and delivers
2876    /// subsequent DevTools events to the supplied `listener`. The callback indicates when the
2877    /// WebEngine is in a debuggable state. Events will be sent to every `listener` registered with
2878    /// this method.
2879    ///
2880    /// Because DevTools debugging is exposed using TCP as its transport, only
2881    /// [`Context`]s created with access to network capabilities will report
2882    /// themselves as available for debugging.
2883    pub fn r#enable_dev_tools(
2884        &self,
2885        mut listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
2886        ___deadline: zx::MonotonicInstant,
2887    ) -> Result<(), fidl::Error> {
2888        let _response = self
2889            .client
2890            .send_query::<DebugEnableDevToolsRequest, fidl::encoding::EmptyPayload, DebugMarker>(
2891                (listener,),
2892                0x44b5e1f4e4c548e4,
2893                fidl::encoding::DynamicFlags::empty(),
2894                ___deadline,
2895            )?;
2896        Ok(_response)
2897    }
2898}
2899
2900#[cfg(target_os = "fuchsia")]
2901impl From<DebugSynchronousProxy> for zx::NullableHandle {
2902    fn from(value: DebugSynchronousProxy) -> Self {
2903        value.into_channel().into()
2904    }
2905}
2906
2907#[cfg(target_os = "fuchsia")]
2908impl From<fidl::Channel> for DebugSynchronousProxy {
2909    fn from(value: fidl::Channel) -> Self {
2910        Self::new(value)
2911    }
2912}
2913
2914#[cfg(target_os = "fuchsia")]
2915impl fidl::endpoints::FromClient for DebugSynchronousProxy {
2916    type Protocol = DebugMarker;
2917
2918    fn from_client(value: fidl::endpoints::ClientEnd<DebugMarker>) -> Self {
2919        Self::new(value.into_channel())
2920    }
2921}
2922
2923#[derive(Debug, Clone)]
2924pub struct DebugProxy {
2925    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2926}
2927
2928impl fidl::endpoints::Proxy for DebugProxy {
2929    type Protocol = DebugMarker;
2930
2931    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2932        Self::new(inner)
2933    }
2934
2935    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2936        self.client.into_channel().map_err(|client| Self { client })
2937    }
2938
2939    fn as_channel(&self) -> &::fidl::AsyncChannel {
2940        self.client.as_channel()
2941    }
2942}
2943
2944impl DebugProxy {
2945    /// Create a new Proxy for fuchsia.web/Debug.
2946    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2947        let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2948        Self { client: fidl::client::Client::new(channel, protocol_name) }
2949    }
2950
2951    /// Get a Stream of events from the remote end of the protocol.
2952    ///
2953    /// # Panics
2954    ///
2955    /// Panics if the event stream was already taken.
2956    pub fn take_event_stream(&self) -> DebugEventStream {
2957        DebugEventStream { event_receiver: self.client.take_event_receiver() }
2958    }
2959
2960    /// Enables the DevTools service on every subsequent [`Context`] creation and delivers
2961    /// subsequent DevTools events to the supplied `listener`. The callback indicates when the
2962    /// WebEngine is in a debuggable state. Events will be sent to every `listener` registered with
2963    /// this method.
2964    ///
2965    /// Because DevTools debugging is exposed using TCP as its transport, only
2966    /// [`Context`]s created with access to network capabilities will report
2967    /// themselves as available for debugging.
2968    pub fn r#enable_dev_tools(
2969        &self,
2970        mut listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
2971    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2972        DebugProxyInterface::r#enable_dev_tools(self, listener)
2973    }
2974}
2975
2976impl DebugProxyInterface for DebugProxy {
2977    type EnableDevToolsResponseFut =
2978        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2979    fn r#enable_dev_tools(
2980        &self,
2981        mut listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
2982    ) -> Self::EnableDevToolsResponseFut {
2983        fn _decode(
2984            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2985        ) -> Result<(), fidl::Error> {
2986            let _response = fidl::client::decode_transaction_body::<
2987                fidl::encoding::EmptyPayload,
2988                fidl::encoding::DefaultFuchsiaResourceDialect,
2989                0x44b5e1f4e4c548e4,
2990            >(_buf?)?;
2991            Ok(_response)
2992        }
2993        self.client.send_query_and_decode::<DebugEnableDevToolsRequest, ()>(
2994            (listener,),
2995            0x44b5e1f4e4c548e4,
2996            fidl::encoding::DynamicFlags::empty(),
2997            _decode,
2998        )
2999    }
3000}
3001
3002pub struct DebugEventStream {
3003    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3004}
3005
3006impl std::marker::Unpin for DebugEventStream {}
3007
3008impl futures::stream::FusedStream for DebugEventStream {
3009    fn is_terminated(&self) -> bool {
3010        self.event_receiver.is_terminated()
3011    }
3012}
3013
3014impl futures::Stream for DebugEventStream {
3015    type Item = Result<DebugEvent, fidl::Error>;
3016
3017    fn poll_next(
3018        mut self: std::pin::Pin<&mut Self>,
3019        cx: &mut std::task::Context<'_>,
3020    ) -> std::task::Poll<Option<Self::Item>> {
3021        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3022            &mut self.event_receiver,
3023            cx
3024        )?) {
3025            Some(buf) => std::task::Poll::Ready(Some(DebugEvent::decode(buf))),
3026            None => std::task::Poll::Ready(None),
3027        }
3028    }
3029}
3030
3031#[derive(Debug)]
3032pub enum DebugEvent {}
3033
3034impl DebugEvent {
3035    /// Decodes a message buffer as a [`DebugEvent`].
3036    fn decode(
3037        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3038    ) -> Result<DebugEvent, fidl::Error> {
3039        let (bytes, _handles) = buf.split_mut();
3040        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3041        debug_assert_eq!(tx_header.tx_id, 0);
3042        match tx_header.ordinal {
3043            _ => Err(fidl::Error::UnknownOrdinal {
3044                ordinal: tx_header.ordinal,
3045                protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3046            }),
3047        }
3048    }
3049}
3050
3051/// A Stream of incoming requests for fuchsia.web/Debug.
3052pub struct DebugRequestStream {
3053    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3054    is_terminated: bool,
3055}
3056
3057impl std::marker::Unpin for DebugRequestStream {}
3058
3059impl futures::stream::FusedStream for DebugRequestStream {
3060    fn is_terminated(&self) -> bool {
3061        self.is_terminated
3062    }
3063}
3064
3065impl fidl::endpoints::RequestStream for DebugRequestStream {
3066    type Protocol = DebugMarker;
3067    type ControlHandle = DebugControlHandle;
3068
3069    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3070        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3071    }
3072
3073    fn control_handle(&self) -> Self::ControlHandle {
3074        DebugControlHandle { inner: self.inner.clone() }
3075    }
3076
3077    fn into_inner(
3078        self,
3079    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3080    {
3081        (self.inner, self.is_terminated)
3082    }
3083
3084    fn from_inner(
3085        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3086        is_terminated: bool,
3087    ) -> Self {
3088        Self { inner, is_terminated }
3089    }
3090}
3091
3092impl futures::Stream for DebugRequestStream {
3093    type Item = Result<DebugRequest, fidl::Error>;
3094
3095    fn poll_next(
3096        mut self: std::pin::Pin<&mut Self>,
3097        cx: &mut std::task::Context<'_>,
3098    ) -> std::task::Poll<Option<Self::Item>> {
3099        let this = &mut *self;
3100        if this.inner.check_shutdown(cx) {
3101            this.is_terminated = true;
3102            return std::task::Poll::Ready(None);
3103        }
3104        if this.is_terminated {
3105            panic!("polled DebugRequestStream after completion");
3106        }
3107        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3108            |bytes, handles| {
3109                match this.inner.channel().read_etc(cx, bytes, handles) {
3110                    std::task::Poll::Ready(Ok(())) => {}
3111                    std::task::Poll::Pending => return std::task::Poll::Pending,
3112                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3113                        this.is_terminated = true;
3114                        return std::task::Poll::Ready(None);
3115                    }
3116                    std::task::Poll::Ready(Err(e)) => {
3117                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3118                            e.into(),
3119                        ))));
3120                    }
3121                }
3122
3123                // A message has been received from the channel
3124                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3125
3126                std::task::Poll::Ready(Some(match header.ordinal {
3127                    0x44b5e1f4e4c548e4 => {
3128                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3129                        let mut req = fidl::new_empty!(
3130                            DebugEnableDevToolsRequest,
3131                            fidl::encoding::DefaultFuchsiaResourceDialect
3132                        );
3133                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugEnableDevToolsRequest>(&header, _body_bytes, handles, &mut req)?;
3134                        let control_handle = DebugControlHandle { inner: this.inner.clone() };
3135                        Ok(DebugRequest::EnableDevTools {
3136                            listener: req.listener,
3137
3138                            responder: DebugEnableDevToolsResponder {
3139                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3140                                tx_id: header.tx_id,
3141                            },
3142                        })
3143                    }
3144                    _ => Err(fidl::Error::UnknownOrdinal {
3145                        ordinal: header.ordinal,
3146                        protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3147                    }),
3148                }))
3149            },
3150        )
3151    }
3152}
3153
3154/// The debug service which allows to enable the DevTools service on Contexts.
3155#[derive(Debug)]
3156pub enum DebugRequest {
3157    /// Enables the DevTools service on every subsequent [`Context`] creation and delivers
3158    /// subsequent DevTools events to the supplied `listener`. The callback indicates when the
3159    /// WebEngine is in a debuggable state. Events will be sent to every `listener` registered with
3160    /// this method.
3161    ///
3162    /// Because DevTools debugging is exposed using TCP as its transport, only
3163    /// [`Context`]s created with access to network capabilities will report
3164    /// themselves as available for debugging.
3165    EnableDevTools {
3166        listener: fidl::endpoints::ClientEnd<DevToolsListenerMarker>,
3167        responder: DebugEnableDevToolsResponder,
3168    },
3169}
3170
3171impl DebugRequest {
3172    #[allow(irrefutable_let_patterns)]
3173    pub fn into_enable_dev_tools(
3174        self,
3175    ) -> Option<(fidl::endpoints::ClientEnd<DevToolsListenerMarker>, DebugEnableDevToolsResponder)>
3176    {
3177        if let DebugRequest::EnableDevTools { listener, responder } = self {
3178            Some((listener, responder))
3179        } else {
3180            None
3181        }
3182    }
3183
3184    /// Name of the method defined in FIDL
3185    pub fn method_name(&self) -> &'static str {
3186        match *self {
3187            DebugRequest::EnableDevTools { .. } => "enable_dev_tools",
3188        }
3189    }
3190}
3191
3192#[derive(Debug, Clone)]
3193pub struct DebugControlHandle {
3194    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3195}
3196
3197impl DebugControlHandle {
3198    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3199        self.inner.shutdown_with_epitaph(status.into())
3200    }
3201}
3202
3203impl fidl::endpoints::ControlHandle for DebugControlHandle {
3204    fn shutdown(&self) {
3205        self.inner.shutdown()
3206    }
3207
3208    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3209        self.inner.shutdown_with_epitaph(status)
3210    }
3211
3212    fn is_closed(&self) -> bool {
3213        self.inner.channel().is_closed()
3214    }
3215    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3216        self.inner.channel().on_closed()
3217    }
3218
3219    #[cfg(target_os = "fuchsia")]
3220    fn signal_peer(
3221        &self,
3222        clear_mask: zx::Signals,
3223        set_mask: zx::Signals,
3224    ) -> Result<(), zx_status::Status> {
3225        use fidl::Peered;
3226        self.inner.channel().signal_peer(clear_mask, set_mask)
3227    }
3228}
3229
3230impl DebugControlHandle {}
3231
3232#[must_use = "FIDL methods require a response to be sent"]
3233#[derive(Debug)]
3234pub struct DebugEnableDevToolsResponder {
3235    control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
3236    tx_id: u32,
3237}
3238
3239/// Set the the channel to be shutdown (see [`DebugControlHandle::shutdown`])
3240/// if the responder is dropped without sending a response, so that the client
3241/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3242impl std::ops::Drop for DebugEnableDevToolsResponder {
3243    fn drop(&mut self) {
3244        self.control_handle.shutdown();
3245        // Safety: drops once, never accessed again
3246        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3247    }
3248}
3249
3250impl fidl::endpoints::Responder for DebugEnableDevToolsResponder {
3251    type ControlHandle = DebugControlHandle;
3252
3253    fn control_handle(&self) -> &DebugControlHandle {
3254        &self.control_handle
3255    }
3256
3257    fn drop_without_shutdown(mut self) {
3258        // Safety: drops once, never accessed again due to mem::forget
3259        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3260        // Prevent Drop from running (which would shut down the channel)
3261        std::mem::forget(self);
3262    }
3263}
3264
3265impl DebugEnableDevToolsResponder {
3266    /// Sends a response to the FIDL transaction.
3267    ///
3268    /// Sets the channel to shutdown if an error occurs.
3269    pub fn send(self) -> Result<(), fidl::Error> {
3270        let _result = self.send_raw();
3271        if _result.is_err() {
3272            self.control_handle.shutdown();
3273        }
3274        self.drop_without_shutdown();
3275        _result
3276    }
3277
3278    /// Similar to "send" but does not shutdown the channel if an error occurs.
3279    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3280        let _result = self.send_raw();
3281        self.drop_without_shutdown();
3282        _result
3283    }
3284
3285    fn send_raw(&self) -> Result<(), fidl::Error> {
3286        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3287            (),
3288            self.tx_id,
3289            0x44b5e1f4e4c548e4,
3290            fidl::encoding::DynamicFlags::empty(),
3291        )
3292    }
3293}
3294
3295#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3296pub struct DevToolsListenerMarker;
3297
3298impl fidl::endpoints::ProtocolMarker for DevToolsListenerMarker {
3299    type Proxy = DevToolsListenerProxy;
3300    type RequestStream = DevToolsListenerRequestStream;
3301    #[cfg(target_os = "fuchsia")]
3302    type SynchronousProxy = DevToolsListenerSynchronousProxy;
3303
3304    const DEBUG_NAME: &'static str = "(anonymous) DevToolsListener";
3305}
3306
3307pub trait DevToolsListenerProxyInterface: Send + Sync {
3308    fn r#on_context_dev_tools_available(
3309        &self,
3310        listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3311    ) -> Result<(), fidl::Error>;
3312}
3313#[derive(Debug)]
3314#[cfg(target_os = "fuchsia")]
3315pub struct DevToolsListenerSynchronousProxy {
3316    client: fidl::client::sync::Client,
3317}
3318
3319#[cfg(target_os = "fuchsia")]
3320impl fidl::endpoints::SynchronousProxy for DevToolsListenerSynchronousProxy {
3321    type Proxy = DevToolsListenerProxy;
3322    type Protocol = DevToolsListenerMarker;
3323
3324    fn from_channel(inner: fidl::Channel) -> Self {
3325        Self::new(inner)
3326    }
3327
3328    fn into_channel(self) -> fidl::Channel {
3329        self.client.into_channel()
3330    }
3331
3332    fn as_channel(&self) -> &fidl::Channel {
3333        self.client.as_channel()
3334    }
3335}
3336
3337#[cfg(target_os = "fuchsia")]
3338impl DevToolsListenerSynchronousProxy {
3339    pub fn new(channel: fidl::Channel) -> Self {
3340        Self { client: fidl::client::sync::Client::new(channel) }
3341    }
3342
3343    pub fn into_channel(self) -> fidl::Channel {
3344        self.client.into_channel()
3345    }
3346
3347    /// Waits until an event arrives and returns it. It is safe for other
3348    /// threads to make concurrent requests while waiting for an event.
3349    pub fn wait_for_event(
3350        &self,
3351        deadline: zx::MonotonicInstant,
3352    ) -> Result<DevToolsListenerEvent, fidl::Error> {
3353        DevToolsListenerEvent::decode(
3354            self.client.wait_for_event::<DevToolsListenerMarker>(deadline)?,
3355        )
3356    }
3357
3358    /// Called when the DevTools service is available on a new [`Context`].
3359    ///
3360    /// - `listener`: Channel over which DevTools events for the new [`Context`] will
3361    ///   be delivered. This channel will disconnect when the [`Context`] is destroyed.
3362    pub fn r#on_context_dev_tools_available(
3363        &self,
3364        mut listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3365    ) -> Result<(), fidl::Error> {
3366        self.client.send::<DevToolsListenerOnContextDevToolsAvailableRequest>(
3367            (listener,),
3368            0x4b259fb4d7e49e87,
3369            fidl::encoding::DynamicFlags::empty(),
3370        )
3371    }
3372}
3373
3374#[cfg(target_os = "fuchsia")]
3375impl From<DevToolsListenerSynchronousProxy> for zx::NullableHandle {
3376    fn from(value: DevToolsListenerSynchronousProxy) -> Self {
3377        value.into_channel().into()
3378    }
3379}
3380
3381#[cfg(target_os = "fuchsia")]
3382impl From<fidl::Channel> for DevToolsListenerSynchronousProxy {
3383    fn from(value: fidl::Channel) -> Self {
3384        Self::new(value)
3385    }
3386}
3387
3388#[cfg(target_os = "fuchsia")]
3389impl fidl::endpoints::FromClient for DevToolsListenerSynchronousProxy {
3390    type Protocol = DevToolsListenerMarker;
3391
3392    fn from_client(value: fidl::endpoints::ClientEnd<DevToolsListenerMarker>) -> Self {
3393        Self::new(value.into_channel())
3394    }
3395}
3396
3397#[derive(Debug, Clone)]
3398pub struct DevToolsListenerProxy {
3399    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3400}
3401
3402impl fidl::endpoints::Proxy for DevToolsListenerProxy {
3403    type Protocol = DevToolsListenerMarker;
3404
3405    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3406        Self::new(inner)
3407    }
3408
3409    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3410        self.client.into_channel().map_err(|client| Self { client })
3411    }
3412
3413    fn as_channel(&self) -> &::fidl::AsyncChannel {
3414        self.client.as_channel()
3415    }
3416}
3417
3418impl DevToolsListenerProxy {
3419    /// Create a new Proxy for fuchsia.web/DevToolsListener.
3420    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3421        let protocol_name = <DevToolsListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3422        Self { client: fidl::client::Client::new(channel, protocol_name) }
3423    }
3424
3425    /// Get a Stream of events from the remote end of the protocol.
3426    ///
3427    /// # Panics
3428    ///
3429    /// Panics if the event stream was already taken.
3430    pub fn take_event_stream(&self) -> DevToolsListenerEventStream {
3431        DevToolsListenerEventStream { event_receiver: self.client.take_event_receiver() }
3432    }
3433
3434    /// Called when the DevTools service is available on a new [`Context`].
3435    ///
3436    /// - `listener`: Channel over which DevTools events for the new [`Context`] will
3437    ///   be delivered. This channel will disconnect when the [`Context`] is destroyed.
3438    pub fn r#on_context_dev_tools_available(
3439        &self,
3440        mut listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3441    ) -> Result<(), fidl::Error> {
3442        DevToolsListenerProxyInterface::r#on_context_dev_tools_available(self, listener)
3443    }
3444}
3445
3446impl DevToolsListenerProxyInterface for DevToolsListenerProxy {
3447    fn r#on_context_dev_tools_available(
3448        &self,
3449        mut listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3450    ) -> Result<(), fidl::Error> {
3451        self.client.send::<DevToolsListenerOnContextDevToolsAvailableRequest>(
3452            (listener,),
3453            0x4b259fb4d7e49e87,
3454            fidl::encoding::DynamicFlags::empty(),
3455        )
3456    }
3457}
3458
3459pub struct DevToolsListenerEventStream {
3460    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3461}
3462
3463impl std::marker::Unpin for DevToolsListenerEventStream {}
3464
3465impl futures::stream::FusedStream for DevToolsListenerEventStream {
3466    fn is_terminated(&self) -> bool {
3467        self.event_receiver.is_terminated()
3468    }
3469}
3470
3471impl futures::Stream for DevToolsListenerEventStream {
3472    type Item = Result<DevToolsListenerEvent, fidl::Error>;
3473
3474    fn poll_next(
3475        mut self: std::pin::Pin<&mut Self>,
3476        cx: &mut std::task::Context<'_>,
3477    ) -> std::task::Poll<Option<Self::Item>> {
3478        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3479            &mut self.event_receiver,
3480            cx
3481        )?) {
3482            Some(buf) => std::task::Poll::Ready(Some(DevToolsListenerEvent::decode(buf))),
3483            None => std::task::Poll::Ready(None),
3484        }
3485    }
3486}
3487
3488#[derive(Debug)]
3489pub enum DevToolsListenerEvent {}
3490
3491impl DevToolsListenerEvent {
3492    /// Decodes a message buffer as a [`DevToolsListenerEvent`].
3493    fn decode(
3494        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3495    ) -> Result<DevToolsListenerEvent, fidl::Error> {
3496        let (bytes, _handles) = buf.split_mut();
3497        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3498        debug_assert_eq!(tx_header.tx_id, 0);
3499        match tx_header.ordinal {
3500            _ => Err(fidl::Error::UnknownOrdinal {
3501                ordinal: tx_header.ordinal,
3502                protocol_name:
3503                    <DevToolsListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3504            }),
3505        }
3506    }
3507}
3508
3509/// A Stream of incoming requests for fuchsia.web/DevToolsListener.
3510pub struct DevToolsListenerRequestStream {
3511    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3512    is_terminated: bool,
3513}
3514
3515impl std::marker::Unpin for DevToolsListenerRequestStream {}
3516
3517impl futures::stream::FusedStream for DevToolsListenerRequestStream {
3518    fn is_terminated(&self) -> bool {
3519        self.is_terminated
3520    }
3521}
3522
3523impl fidl::endpoints::RequestStream for DevToolsListenerRequestStream {
3524    type Protocol = DevToolsListenerMarker;
3525    type ControlHandle = DevToolsListenerControlHandle;
3526
3527    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3528        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3529    }
3530
3531    fn control_handle(&self) -> Self::ControlHandle {
3532        DevToolsListenerControlHandle { inner: self.inner.clone() }
3533    }
3534
3535    fn into_inner(
3536        self,
3537    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3538    {
3539        (self.inner, self.is_terminated)
3540    }
3541
3542    fn from_inner(
3543        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3544        is_terminated: bool,
3545    ) -> Self {
3546        Self { inner, is_terminated }
3547    }
3548}
3549
3550impl futures::Stream for DevToolsListenerRequestStream {
3551    type Item = Result<DevToolsListenerRequest, fidl::Error>;
3552
3553    fn poll_next(
3554        mut self: std::pin::Pin<&mut Self>,
3555        cx: &mut std::task::Context<'_>,
3556    ) -> std::task::Poll<Option<Self::Item>> {
3557        let this = &mut *self;
3558        if this.inner.check_shutdown(cx) {
3559            this.is_terminated = true;
3560            return std::task::Poll::Ready(None);
3561        }
3562        if this.is_terminated {
3563            panic!("polled DevToolsListenerRequestStream after completion");
3564        }
3565        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3566            |bytes, handles| {
3567                match this.inner.channel().read_etc(cx, bytes, handles) {
3568                    std::task::Poll::Ready(Ok(())) => {}
3569                    std::task::Poll::Pending => return std::task::Poll::Pending,
3570                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3571                        this.is_terminated = true;
3572                        return std::task::Poll::Ready(None);
3573                    }
3574                    std::task::Poll::Ready(Err(e)) => {
3575                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3576                            e.into(),
3577                        ))));
3578                    }
3579                }
3580
3581                // A message has been received from the channel
3582                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3583
3584                std::task::Poll::Ready(Some(match header.ordinal {
3585                    0x4b259fb4d7e49e87 => {
3586                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3587                        let mut req = fidl::new_empty!(
3588                            DevToolsListenerOnContextDevToolsAvailableRequest,
3589                            fidl::encoding::DefaultFuchsiaResourceDialect
3590                        );
3591                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevToolsListenerOnContextDevToolsAvailableRequest>(&header, _body_bytes, handles, &mut req)?;
3592                        let control_handle =
3593                            DevToolsListenerControlHandle { inner: this.inner.clone() };
3594                        Ok(DevToolsListenerRequest::OnContextDevToolsAvailable {
3595                            listener: req.listener,
3596
3597                            control_handle,
3598                        })
3599                    }
3600                    _ => Err(fidl::Error::UnknownOrdinal {
3601                        ordinal: header.ordinal,
3602                        protocol_name:
3603                            <DevToolsListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3604                    }),
3605                }))
3606            },
3607        )
3608    }
3609}
3610
3611/// Interface used to observe DevTools service availability events.
3612#[derive(Debug)]
3613pub enum DevToolsListenerRequest {
3614    /// Called when the DevTools service is available on a new [`Context`].
3615    ///
3616    /// - `listener`: Channel over which DevTools events for the new [`Context`] will
3617    ///   be delivered. This channel will disconnect when the [`Context`] is destroyed.
3618    OnContextDevToolsAvailable {
3619        listener: fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3620        control_handle: DevToolsListenerControlHandle,
3621    },
3622}
3623
3624impl DevToolsListenerRequest {
3625    #[allow(irrefutable_let_patterns)]
3626    pub fn into_on_context_dev_tools_available(
3627        self,
3628    ) -> Option<(
3629        fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
3630        DevToolsListenerControlHandle,
3631    )> {
3632        if let DevToolsListenerRequest::OnContextDevToolsAvailable { listener, control_handle } =
3633            self
3634        {
3635            Some((listener, control_handle))
3636        } else {
3637            None
3638        }
3639    }
3640
3641    /// Name of the method defined in FIDL
3642    pub fn method_name(&self) -> &'static str {
3643        match *self {
3644            DevToolsListenerRequest::OnContextDevToolsAvailable { .. } => {
3645                "on_context_dev_tools_available"
3646            }
3647        }
3648    }
3649}
3650
3651#[derive(Debug, Clone)]
3652pub struct DevToolsListenerControlHandle {
3653    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3654}
3655
3656impl DevToolsListenerControlHandle {
3657    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3658        self.inner.shutdown_with_epitaph(status.into())
3659    }
3660}
3661
3662impl fidl::endpoints::ControlHandle for DevToolsListenerControlHandle {
3663    fn shutdown(&self) {
3664        self.inner.shutdown()
3665    }
3666
3667    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3668        self.inner.shutdown_with_epitaph(status)
3669    }
3670
3671    fn is_closed(&self) -> bool {
3672        self.inner.channel().is_closed()
3673    }
3674    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3675        self.inner.channel().on_closed()
3676    }
3677
3678    #[cfg(target_os = "fuchsia")]
3679    fn signal_peer(
3680        &self,
3681        clear_mask: zx::Signals,
3682        set_mask: zx::Signals,
3683    ) -> Result<(), zx_status::Status> {
3684        use fidl::Peered;
3685        self.inner.channel().signal_peer(clear_mask, set_mask)
3686    }
3687}
3688
3689impl DevToolsListenerControlHandle {}
3690
3691#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3692pub struct DevToolsPerContextListenerMarker;
3693
3694impl fidl::endpoints::ProtocolMarker for DevToolsPerContextListenerMarker {
3695    type Proxy = DevToolsPerContextListenerProxy;
3696    type RequestStream = DevToolsPerContextListenerRequestStream;
3697    #[cfg(target_os = "fuchsia")]
3698    type SynchronousProxy = DevToolsPerContextListenerSynchronousProxy;
3699
3700    const DEBUG_NAME: &'static str = "(anonymous) DevToolsPerContextListener";
3701}
3702
3703pub trait DevToolsPerContextListenerProxyInterface: Send + Sync {
3704    fn r#on_http_port_open(&self, port: u16) -> Result<(), fidl::Error>;
3705}
3706#[derive(Debug)]
3707#[cfg(target_os = "fuchsia")]
3708pub struct DevToolsPerContextListenerSynchronousProxy {
3709    client: fidl::client::sync::Client,
3710}
3711
3712#[cfg(target_os = "fuchsia")]
3713impl fidl::endpoints::SynchronousProxy for DevToolsPerContextListenerSynchronousProxy {
3714    type Proxy = DevToolsPerContextListenerProxy;
3715    type Protocol = DevToolsPerContextListenerMarker;
3716
3717    fn from_channel(inner: fidl::Channel) -> Self {
3718        Self::new(inner)
3719    }
3720
3721    fn into_channel(self) -> fidl::Channel {
3722        self.client.into_channel()
3723    }
3724
3725    fn as_channel(&self) -> &fidl::Channel {
3726        self.client.as_channel()
3727    }
3728}
3729
3730#[cfg(target_os = "fuchsia")]
3731impl DevToolsPerContextListenerSynchronousProxy {
3732    pub fn new(channel: fidl::Channel) -> Self {
3733        Self { client: fidl::client::sync::Client::new(channel) }
3734    }
3735
3736    pub fn into_channel(self) -> fidl::Channel {
3737        self.client.into_channel()
3738    }
3739
3740    /// Waits until an event arrives and returns it. It is safe for other
3741    /// threads to make concurrent requests while waiting for an event.
3742    pub fn wait_for_event(
3743        &self,
3744        deadline: zx::MonotonicInstant,
3745    ) -> Result<DevToolsPerContextListenerEvent, fidl::Error> {
3746        DevToolsPerContextListenerEvent::decode(
3747            self.client.wait_for_event::<DevToolsPerContextListenerMarker>(deadline)?,
3748        )
3749    }
3750
3751    /// Called when the DevTools service starts accepting TCP connections on `port`. `port` will
3752    /// remain open until the [`Context`] is destroyed.
3753    ///
3754    /// - `port`: The port used by the service.
3755    pub fn r#on_http_port_open(&self, mut port: u16) -> Result<(), fidl::Error> {
3756        self.client.send::<DevToolsPerContextListenerOnHttpPortOpenRequest>(
3757            (port,),
3758            0x5e330939b035553b,
3759            fidl::encoding::DynamicFlags::empty(),
3760        )
3761    }
3762}
3763
3764#[cfg(target_os = "fuchsia")]
3765impl From<DevToolsPerContextListenerSynchronousProxy> for zx::NullableHandle {
3766    fn from(value: DevToolsPerContextListenerSynchronousProxy) -> Self {
3767        value.into_channel().into()
3768    }
3769}
3770
3771#[cfg(target_os = "fuchsia")]
3772impl From<fidl::Channel> for DevToolsPerContextListenerSynchronousProxy {
3773    fn from(value: fidl::Channel) -> Self {
3774        Self::new(value)
3775    }
3776}
3777
3778#[cfg(target_os = "fuchsia")]
3779impl fidl::endpoints::FromClient for DevToolsPerContextListenerSynchronousProxy {
3780    type Protocol = DevToolsPerContextListenerMarker;
3781
3782    fn from_client(value: fidl::endpoints::ClientEnd<DevToolsPerContextListenerMarker>) -> Self {
3783        Self::new(value.into_channel())
3784    }
3785}
3786
3787#[derive(Debug, Clone)]
3788pub struct DevToolsPerContextListenerProxy {
3789    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3790}
3791
3792impl fidl::endpoints::Proxy for DevToolsPerContextListenerProxy {
3793    type Protocol = DevToolsPerContextListenerMarker;
3794
3795    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3796        Self::new(inner)
3797    }
3798
3799    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3800        self.client.into_channel().map_err(|client| Self { client })
3801    }
3802
3803    fn as_channel(&self) -> &::fidl::AsyncChannel {
3804        self.client.as_channel()
3805    }
3806}
3807
3808impl DevToolsPerContextListenerProxy {
3809    /// Create a new Proxy for fuchsia.web/DevToolsPerContextListener.
3810    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3811        let protocol_name =
3812            <DevToolsPerContextListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3813        Self { client: fidl::client::Client::new(channel, protocol_name) }
3814    }
3815
3816    /// Get a Stream of events from the remote end of the protocol.
3817    ///
3818    /// # Panics
3819    ///
3820    /// Panics if the event stream was already taken.
3821    pub fn take_event_stream(&self) -> DevToolsPerContextListenerEventStream {
3822        DevToolsPerContextListenerEventStream { event_receiver: self.client.take_event_receiver() }
3823    }
3824
3825    /// Called when the DevTools service starts accepting TCP connections on `port`. `port` will
3826    /// remain open until the [`Context`] is destroyed.
3827    ///
3828    /// - `port`: The port used by the service.
3829    pub fn r#on_http_port_open(&self, mut port: u16) -> Result<(), fidl::Error> {
3830        DevToolsPerContextListenerProxyInterface::r#on_http_port_open(self, port)
3831    }
3832}
3833
3834impl DevToolsPerContextListenerProxyInterface for DevToolsPerContextListenerProxy {
3835    fn r#on_http_port_open(&self, mut port: u16) -> Result<(), fidl::Error> {
3836        self.client.send::<DevToolsPerContextListenerOnHttpPortOpenRequest>(
3837            (port,),
3838            0x5e330939b035553b,
3839            fidl::encoding::DynamicFlags::empty(),
3840        )
3841    }
3842}
3843
3844pub struct DevToolsPerContextListenerEventStream {
3845    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3846}
3847
3848impl std::marker::Unpin for DevToolsPerContextListenerEventStream {}
3849
3850impl futures::stream::FusedStream for DevToolsPerContextListenerEventStream {
3851    fn is_terminated(&self) -> bool {
3852        self.event_receiver.is_terminated()
3853    }
3854}
3855
3856impl futures::Stream for DevToolsPerContextListenerEventStream {
3857    type Item = Result<DevToolsPerContextListenerEvent, fidl::Error>;
3858
3859    fn poll_next(
3860        mut self: std::pin::Pin<&mut Self>,
3861        cx: &mut std::task::Context<'_>,
3862    ) -> std::task::Poll<Option<Self::Item>> {
3863        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3864            &mut self.event_receiver,
3865            cx
3866        )?) {
3867            Some(buf) => std::task::Poll::Ready(Some(DevToolsPerContextListenerEvent::decode(buf))),
3868            None => std::task::Poll::Ready(None),
3869        }
3870    }
3871}
3872
3873#[derive(Debug)]
3874pub enum DevToolsPerContextListenerEvent {}
3875
3876impl DevToolsPerContextListenerEvent {
3877    /// Decodes a message buffer as a [`DevToolsPerContextListenerEvent`].
3878    fn decode(
3879        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3880    ) -> Result<DevToolsPerContextListenerEvent, fidl::Error> {
3881        let (bytes, _handles) = buf.split_mut();
3882        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3883        debug_assert_eq!(tx_header.tx_id, 0);
3884        match tx_header.ordinal {
3885            _ => Err(fidl::Error::UnknownOrdinal {
3886                ordinal: tx_header.ordinal,
3887                protocol_name: <DevToolsPerContextListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3888            })
3889        }
3890    }
3891}
3892
3893/// A Stream of incoming requests for fuchsia.web/DevToolsPerContextListener.
3894pub struct DevToolsPerContextListenerRequestStream {
3895    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3896    is_terminated: bool,
3897}
3898
3899impl std::marker::Unpin for DevToolsPerContextListenerRequestStream {}
3900
3901impl futures::stream::FusedStream for DevToolsPerContextListenerRequestStream {
3902    fn is_terminated(&self) -> bool {
3903        self.is_terminated
3904    }
3905}
3906
3907impl fidl::endpoints::RequestStream for DevToolsPerContextListenerRequestStream {
3908    type Protocol = DevToolsPerContextListenerMarker;
3909    type ControlHandle = DevToolsPerContextListenerControlHandle;
3910
3911    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3912        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3913    }
3914
3915    fn control_handle(&self) -> Self::ControlHandle {
3916        DevToolsPerContextListenerControlHandle { inner: self.inner.clone() }
3917    }
3918
3919    fn into_inner(
3920        self,
3921    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3922    {
3923        (self.inner, self.is_terminated)
3924    }
3925
3926    fn from_inner(
3927        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3928        is_terminated: bool,
3929    ) -> Self {
3930        Self { inner, is_terminated }
3931    }
3932}
3933
3934impl futures::Stream for DevToolsPerContextListenerRequestStream {
3935    type Item = Result<DevToolsPerContextListenerRequest, fidl::Error>;
3936
3937    fn poll_next(
3938        mut self: std::pin::Pin<&mut Self>,
3939        cx: &mut std::task::Context<'_>,
3940    ) -> std::task::Poll<Option<Self::Item>> {
3941        let this = &mut *self;
3942        if this.inner.check_shutdown(cx) {
3943            this.is_terminated = true;
3944            return std::task::Poll::Ready(None);
3945        }
3946        if this.is_terminated {
3947            panic!("polled DevToolsPerContextListenerRequestStream after completion");
3948        }
3949        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3950            |bytes, handles| {
3951                match this.inner.channel().read_etc(cx, bytes, handles) {
3952                    std::task::Poll::Ready(Ok(())) => {}
3953                    std::task::Poll::Pending => return std::task::Poll::Pending,
3954                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3955                        this.is_terminated = true;
3956                        return std::task::Poll::Ready(None);
3957                    }
3958                    std::task::Poll::Ready(Err(e)) => {
3959                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3960                            e.into(),
3961                        ))));
3962                    }
3963                }
3964
3965                // A message has been received from the channel
3966                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3967
3968                std::task::Poll::Ready(Some(match header.ordinal {
3969                0x5e330939b035553b => {
3970                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3971                    let mut req = fidl::new_empty!(DevToolsPerContextListenerOnHttpPortOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3972                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevToolsPerContextListenerOnHttpPortOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3973                    let control_handle = DevToolsPerContextListenerControlHandle {
3974                        inner: this.inner.clone(),
3975                    };
3976                    Ok(DevToolsPerContextListenerRequest::OnHttpPortOpen {port: req.port,
3977
3978                        control_handle,
3979                    })
3980                }
3981                _ => Err(fidl::Error::UnknownOrdinal {
3982                    ordinal: header.ordinal,
3983                    protocol_name: <DevToolsPerContextListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3984                }),
3985            }))
3986            },
3987        )
3988    }
3989}
3990
3991/// Interface supplied by the debugging component to observe the DevTools service opening event.
3992#[derive(Debug)]
3993pub enum DevToolsPerContextListenerRequest {
3994    /// Called when the DevTools service starts accepting TCP connections on `port`. `port` will
3995    /// remain open until the [`Context`] is destroyed.
3996    ///
3997    /// - `port`: The port used by the service.
3998    OnHttpPortOpen { port: u16, control_handle: DevToolsPerContextListenerControlHandle },
3999}
4000
4001impl DevToolsPerContextListenerRequest {
4002    #[allow(irrefutable_let_patterns)]
4003    pub fn into_on_http_port_open(self) -> Option<(u16, DevToolsPerContextListenerControlHandle)> {
4004        if let DevToolsPerContextListenerRequest::OnHttpPortOpen { port, control_handle } = self {
4005            Some((port, control_handle))
4006        } else {
4007            None
4008        }
4009    }
4010
4011    /// Name of the method defined in FIDL
4012    pub fn method_name(&self) -> &'static str {
4013        match *self {
4014            DevToolsPerContextListenerRequest::OnHttpPortOpen { .. } => "on_http_port_open",
4015        }
4016    }
4017}
4018
4019#[derive(Debug, Clone)]
4020pub struct DevToolsPerContextListenerControlHandle {
4021    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4022}
4023
4024impl DevToolsPerContextListenerControlHandle {
4025    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4026        self.inner.shutdown_with_epitaph(status.into())
4027    }
4028}
4029
4030impl fidl::endpoints::ControlHandle for DevToolsPerContextListenerControlHandle {
4031    fn shutdown(&self) {
4032        self.inner.shutdown()
4033    }
4034
4035    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4036        self.inner.shutdown_with_epitaph(status)
4037    }
4038
4039    fn is_closed(&self) -> bool {
4040        self.inner.channel().is_closed()
4041    }
4042    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4043        self.inner.channel().on_closed()
4044    }
4045
4046    #[cfg(target_os = "fuchsia")]
4047    fn signal_peer(
4048        &self,
4049        clear_mask: zx::Signals,
4050        set_mask: zx::Signals,
4051    ) -> Result<(), zx_status::Status> {
4052        use fidl::Peered;
4053        self.inner.channel().signal_peer(clear_mask, set_mask)
4054    }
4055}
4056
4057impl DevToolsPerContextListenerControlHandle {}
4058
4059#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4060pub struct FrameMarker;
4061
4062impl fidl::endpoints::ProtocolMarker for FrameMarker {
4063    type Proxy = FrameProxy;
4064    type RequestStream = FrameRequestStream;
4065    #[cfg(target_os = "fuchsia")]
4066    type SynchronousProxy = FrameSynchronousProxy;
4067
4068    const DEBUG_NAME: &'static str = "(anonymous) Frame";
4069}
4070pub type FrameExecuteJavaScriptResult = Result<fidl_fuchsia_mem::Buffer, FrameError>;
4071pub type FrameExecuteJavaScriptNoResultResult = Result<(), FrameError>;
4072pub type FrameAddBeforeLoadJavaScriptResult = Result<(), FrameError>;
4073pub type FramePostMessageResult = Result<(), FrameError>;
4074
4075pub trait FrameProxyInterface: Send + Sync {
4076    fn r#create_view(
4077        &self,
4078        view_token: fidl_fuchsia_ui_views::ViewToken,
4079    ) -> Result<(), fidl::Error>;
4080    fn r#create_view_with_view_ref(
4081        &self,
4082        view_token: fidl_fuchsia_ui_views::ViewToken,
4083        view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
4084        view_ref: fidl_fuchsia_ui_views::ViewRef,
4085    ) -> Result<(), fidl::Error>;
4086    fn r#create_view2(&self, args: CreateView2Args) -> Result<(), fidl::Error>;
4087    fn r#enable_headless_rendering(&self) -> Result<(), fidl::Error>;
4088    fn r#disable_headless_rendering(&self) -> Result<(), fidl::Error>;
4089    fn r#get_media_player(
4090        &self,
4091        player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
4092    ) -> Result<(), fidl::Error>;
4093    fn r#get_navigation_controller(
4094        &self,
4095        controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
4096    ) -> Result<(), fidl::Error>;
4097    type ExecuteJavaScriptResponseFut: std::future::Future<Output = Result<FrameExecuteJavaScriptResult, fidl::Error>>
4098        + Send;
4099    fn r#execute_java_script(
4100        &self,
4101        origins: &[String],
4102        script: fidl_fuchsia_mem::Buffer,
4103    ) -> Self::ExecuteJavaScriptResponseFut;
4104    type ExecuteJavaScriptNoResultResponseFut: std::future::Future<Output = Result<FrameExecuteJavaScriptNoResultResult, fidl::Error>>
4105        + Send;
4106    fn r#execute_java_script_no_result(
4107        &self,
4108        origins: &[String],
4109        script: fidl_fuchsia_mem::Buffer,
4110    ) -> Self::ExecuteJavaScriptNoResultResponseFut;
4111    type AddBeforeLoadJavaScriptResponseFut: std::future::Future<Output = Result<FrameAddBeforeLoadJavaScriptResult, fidl::Error>>
4112        + Send;
4113    fn r#add_before_load_java_script(
4114        &self,
4115        id: u64,
4116        origins: &[String],
4117        script: fidl_fuchsia_mem::Buffer,
4118    ) -> Self::AddBeforeLoadJavaScriptResponseFut;
4119    fn r#remove_before_load_java_script(&self, id: u64) -> Result<(), fidl::Error>;
4120    type PostMessageResponseFut: std::future::Future<Output = Result<FramePostMessageResult, fidl::Error>>
4121        + Send;
4122    fn r#post_message(
4123        &self,
4124        target_origin: &str,
4125        message: WebMessage,
4126    ) -> Self::PostMessageResponseFut;
4127    fn r#set_navigation_event_listener(
4128        &self,
4129        listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4130    ) -> Result<(), fidl::Error>;
4131    fn r#set_navigation_event_listener2(
4132        &self,
4133        listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4134        flags: NavigationEventListenerFlags,
4135    ) -> Result<(), fidl::Error>;
4136    fn r#set_java_script_log_level(&self, level: ConsoleLogLevel) -> Result<(), fidl::Error>;
4137    fn r#set_console_log_sink(
4138        &self,
4139        sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
4140    ) -> Result<(), fidl::Error>;
4141    fn r#configure_input_types(
4142        &self,
4143        types: InputTypes,
4144        allow: AllowInputState,
4145    ) -> Result<(), fidl::Error>;
4146    fn r#set_popup_frame_creation_listener(
4147        &self,
4148        listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
4149    ) -> Result<(), fidl::Error>;
4150    type SetUrlRequestRewriteRulesResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
4151        + Send;
4152    fn r#set_url_request_rewrite_rules(
4153        &self,
4154        rules: &[UrlRequestRewriteRule],
4155    ) -> Self::SetUrlRequestRewriteRulesResponseFut;
4156    fn r#set_media_settings(&self, settings: &FrameMediaSettings) -> Result<(), fidl::Error>;
4157    fn r#force_content_dimensions(
4158        &self,
4159        web_dips: Option<&fidl_fuchsia_ui_gfx::Vec2>,
4160    ) -> Result<(), fidl::Error>;
4161    fn r#set_permission_state(
4162        &self,
4163        permission: &PermissionDescriptor,
4164        web_origin: &str,
4165        state: PermissionState,
4166    ) -> Result<(), fidl::Error>;
4167    fn r#set_block_media_loading(&self, blocked: bool) -> Result<(), fidl::Error>;
4168    type GetPrivateMemorySizeResponseFut: std::future::Future<Output = Result<u64, fidl::Error>>
4169        + Send;
4170    fn r#get_private_memory_size(&self) -> Self::GetPrivateMemorySizeResponseFut;
4171    fn r#set_navigation_policy_provider(
4172        &self,
4173        params: &NavigationPolicyProviderParams,
4174        provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
4175    ) -> Result<(), fidl::Error>;
4176    fn r#set_content_area_settings(
4177        &self,
4178        settings: &ContentAreaSettings,
4179    ) -> Result<(), fidl::Error>;
4180    fn r#reset_content_area_settings(&self) -> Result<(), fidl::Error>;
4181    fn r#close(&self, payload: &FrameCloseRequest) -> Result<(), fidl::Error>;
4182}
4183#[derive(Debug)]
4184#[cfg(target_os = "fuchsia")]
4185pub struct FrameSynchronousProxy {
4186    client: fidl::client::sync::Client,
4187}
4188
4189#[cfg(target_os = "fuchsia")]
4190impl fidl::endpoints::SynchronousProxy for FrameSynchronousProxy {
4191    type Proxy = FrameProxy;
4192    type Protocol = FrameMarker;
4193
4194    fn from_channel(inner: fidl::Channel) -> Self {
4195        Self::new(inner)
4196    }
4197
4198    fn into_channel(self) -> fidl::Channel {
4199        self.client.into_channel()
4200    }
4201
4202    fn as_channel(&self) -> &fidl::Channel {
4203        self.client.as_channel()
4204    }
4205}
4206
4207#[cfg(target_os = "fuchsia")]
4208impl FrameSynchronousProxy {
4209    pub fn new(channel: fidl::Channel) -> Self {
4210        Self { client: fidl::client::sync::Client::new(channel) }
4211    }
4212
4213    pub fn into_channel(self) -> fidl::Channel {
4214        self.client.into_channel()
4215    }
4216
4217    /// Waits until an event arrives and returns it. It is safe for other
4218    /// threads to make concurrent requests while waiting for an event.
4219    pub fn wait_for_event(
4220        &self,
4221        deadline: zx::MonotonicInstant,
4222    ) -> Result<FrameEvent, fidl::Error> {
4223        FrameEvent::decode(self.client.wait_for_event::<FrameMarker>(deadline)?)
4224    }
4225
4226    /// Creates a new view using the specified `view_token`. Caller should pass the other end of
4227    /// the token to [`fuchsia.ui.gfx/ViewHolderArgs`] to attach the new view to a view tree.
4228    ///
4229    /// See the description of [`CreateContextParams.service_directory`] for additional services
4230    /// that must be present when using this method.
4231    pub fn r#create_view(
4232        &self,
4233        mut view_token: fidl_fuchsia_ui_views::ViewToken,
4234    ) -> Result<(), fidl::Error> {
4235        self.client.send::<FrameCreateViewRequest>(
4236            (&mut view_token,),
4237            0x6a27859439133264,
4238            fidl::encoding::DynamicFlags::empty(),
4239        )
4240    }
4241
4242    /// Creates a new view using the specified `view_token`. Caller should pass the other end of
4243    /// the token to [`fuchsia.ui.gfx/ViewHolderArgs`] to attach the new view to a view tree.
4244    /// `view_ref` can be cloned before passing it to this method, which will allow clients to
4245    /// track the view.
4246    ///
4247    /// `view_ref_control` must not have the `ZX_RIGHT_DUPLICATE` set, or view creation will fail
4248    /// and `view_token` will be closed.
4249    ///
4250    /// See the description of [`CreateContextParams.service_directory`] for additional services
4251    /// that must be present when using this method.
4252    pub fn r#create_view_with_view_ref(
4253        &self,
4254        mut view_token: fidl_fuchsia_ui_views::ViewToken,
4255        mut view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
4256        mut view_ref: fidl_fuchsia_ui_views::ViewRef,
4257    ) -> Result<(), fidl::Error> {
4258        self.client.send::<FrameCreateViewWithViewRefRequest>(
4259            (&mut view_token, &mut view_ref_control, &mut view_ref),
4260            0x1eb17ab2442326ac,
4261            fidl::encoding::DynamicFlags::empty(),
4262        )
4263    }
4264
4265    /// Creates a new Flatland view using the specified `view_creation_token` defined under `args`.
4266    /// Caller should pass the other end of the token to
4267    /// [`fuchsia.ui.composition/Flatland.CreateViewport`] to attach the new Flatland view to its
4268    /// graph.
4269    pub fn r#create_view2(&self, mut args: CreateView2Args) -> Result<(), fidl::Error> {
4270        self.client.send::<FrameCreateView2Request>(
4271            (&mut args,),
4272            0x1be7e9512962eb37,
4273            fidl::encoding::DynamicFlags::empty(),
4274        )
4275    }
4276
4277    /// Enables headless rendering of the Frame.
4278    ///
4279    /// This is used when content depends on layout and/or animation events firing normally.
4280    /// May only be used on a Context created with [`ContextFeatureFlags.HEADLESS`].
4281    pub fn r#enable_headless_rendering(&self) -> Result<(), fidl::Error> {
4282        self.client.send::<fidl::encoding::EmptyPayload>(
4283            (),
4284            0x72a81aaae7a80d2b,
4285            fidl::encoding::DynamicFlags::empty(),
4286        )
4287    }
4288
4289    /// Stops headless rendering of the Frame.
4290    ///
4291    /// May only be used on a Context created with [`ContextFeatureFlags.HEADLESS`].
4292    pub fn r#disable_headless_rendering(&self) -> Result<(), fidl::Error> {
4293        self.client.send::<fidl::encoding::EmptyPayload>(
4294            (),
4295            0x5ca38a3d1f7f543a,
4296            fidl::encoding::DynamicFlags::empty(),
4297        )
4298    }
4299
4300    /// Returns a [`fuchsia.media.sessions2/Player`] interface through which media (i.e.
4301    /// video/audio) playback in the frame may be observed, and/or controlled. Only one
4302    /// [`fuchsia.media.sessions2/Player`] may be active at a time, for each [`Frame`].
4303    pub fn r#get_media_player(
4304        &self,
4305        mut player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
4306    ) -> Result<(), fidl::Error> {
4307        self.client.send::<FrameGetMediaPlayerRequest>(
4308            (player,),
4309            0xaafb639fc0b9eb9,
4310            fidl::encoding::DynamicFlags::empty(),
4311        )
4312    }
4313
4314    /// Returns an interface through which the [`Frame`] may be navigated to a desired URL,
4315    /// reloaded, etc.
4316    ///
4317    /// - `controller`: An asynchronous interface request for the [`Frame`]'s
4318    ///   [`NavigationController`].
4319    pub fn r#get_navigation_controller(
4320        &self,
4321        mut controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
4322    ) -> Result<(), fidl::Error> {
4323        self.client.send::<FrameGetNavigationControllerRequest>(
4324            (controller,),
4325            0x4521cfe95217a688,
4326            fidl::encoding::DynamicFlags::empty(),
4327        )
4328    }
4329
4330    /// Executes a UTF-8 encoded `script` in the [`Frame`] if the [`Frame`]'s URL has an origin
4331    /// which matches entries in `origins`.
4332    ///
4333    /// At least one `origins` entry must be specified. If a wildcard `"*"` is specified in
4334    /// `origins`, then the script will be evaluated unconditionally.
4335    ///
4336    /// Returns the result of executing `script`, as a JSON-encoded string.
4337    ///
4338    /// Note that scripts share the same execution context as the document,
4339    /// meaning that document may modify variables, classes, or objects set by
4340    /// the script in arbitrary or unpredictable ways.
4341    ///
4342    /// If an error occurred, the FrameError will be set to one of these values:
4343    /// - `BUFFER_NOT_UTF8`: `script` is not UTF-8 encoded.
4344    /// - `INVALID_ORIGIN`: The [`Frame`]'s current URL does not match any of the values in
4345    ///   `origins` or `origins` is an empty vector.
4346    pub fn r#execute_java_script(
4347        &self,
4348        mut origins: &[String],
4349        mut script: fidl_fuchsia_mem::Buffer,
4350        ___deadline: zx::MonotonicInstant,
4351    ) -> Result<FrameExecuteJavaScriptResult, fidl::Error> {
4352        let _response = self.client.send_query::<
4353            FrameExecuteJavaScriptRequest,
4354            fidl::encoding::ResultType<FrameExecuteJavaScriptResponse, FrameError>,
4355            FrameMarker,
4356        >(
4357            (origins, &mut script,),
4358            0x79abdd4907000542,
4359            fidl::encoding::DynamicFlags::empty(),
4360            ___deadline,
4361        )?;
4362        Ok(_response.map(|x| x.result))
4363    }
4364
4365    /// Variant of [`Frame.ExecuteJavaScript`] which executes the supplied script without returning
4366    /// a result.
4367    pub fn r#execute_java_script_no_result(
4368        &self,
4369        mut origins: &[String],
4370        mut script: fidl_fuchsia_mem::Buffer,
4371        ___deadline: zx::MonotonicInstant,
4372    ) -> Result<FrameExecuteJavaScriptNoResultResult, fidl::Error> {
4373        let _response = self.client.send_query::<
4374            FrameExecuteJavaScriptNoResultRequest,
4375            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
4376            FrameMarker,
4377        >(
4378            (origins, &mut script,),
4379            0x16b8491520cbcd63,
4380            fidl::encoding::DynamicFlags::empty(),
4381            ___deadline,
4382        )?;
4383        Ok(_response.map(|x| x))
4384    }
4385
4386    /// Executes a UTF-8 encoded `script` for every subsequent page load where the [`Frame`]'s URL
4387    /// has an origin reflected in `origins`. The script is executed early, prior to the execution
4388    /// of the document's scripts.
4389    ///
4390    /// Scripts are identified by a client-managed identifier `id`. Any script previously injected
4391    /// using the same `id` will be replaced.
4392    ///
4393    /// The order in which multiple bindings are executed is the same as the order in which the
4394    /// bindings were added. If a script is added which clobbers an existing script of the same
4395    /// `id`, the previous script's precedence in the injection order will be preserved.
4396    ///
4397    /// At least one `origins` entry must be specified. If a wildcard `"*"` is specified in
4398    /// `origins`, then the script will be evaluated unconditionally.
4399    ///
4400    /// If an error occurred, the [`FrameError`] will be set to one of these values:
4401    /// - `BUFFER_NOT_UTF8`: `script` is not UTF-8 encoded.
4402    /// - `INVALID_ORIGIN`: `origins` is an empty vector.
4403    pub fn r#add_before_load_java_script(
4404        &self,
4405        mut id: u64,
4406        mut origins: &[String],
4407        mut script: fidl_fuchsia_mem::Buffer,
4408        ___deadline: zx::MonotonicInstant,
4409    ) -> Result<FrameAddBeforeLoadJavaScriptResult, fidl::Error> {
4410        let _response = self.client.send_query::<
4411            FrameAddBeforeLoadJavaScriptRequest,
4412            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
4413            FrameMarker,
4414        >(
4415            (id, origins, &mut script,),
4416            0x540ac0da59d823e,
4417            fidl::encoding::DynamicFlags::empty(),
4418            ___deadline,
4419        )?;
4420        Ok(_response.map(|x| x))
4421    }
4422
4423    /// Removes a previously added JavaScript snippet identified by `id`. This is a no-op if there
4424    /// is no JavaScript snippet identified by `id`.
4425    pub fn r#remove_before_load_java_script(&self, mut id: u64) -> Result<(), fidl::Error> {
4426        self.client.send::<FrameRemoveBeforeLoadJavaScriptRequest>(
4427            (id,),
4428            0x17d92b855b61d23a,
4429            fidl::encoding::DynamicFlags::empty(),
4430        )
4431    }
4432
4433    /// Posts a message to the frame's onMessage handler.
4434    ///
4435    /// `target_origin` restricts message delivery to the specified origin. If `target_origin` is
4436    /// `"*"`, then the message will be sent to the document regardless of its origin.
4437    /// See the
4438    /// [HTML spec](https://html.spec.whatwg.org/multipage/web-messaging.html#posting-messages)
4439    /// section 9.4.3 for more details on how the target origin policy is applied.
4440    ///
4441    /// If an error occurred, the [`FrameError`] will be set to one of these values:
4442    /// - `INTERNAL_ERROR`: The WebEngine failed to create a message pipe.
4443    /// - `BUFFER_NOT_UTF8`: The script in `message`'s `data` property is not UTF-8 encoded.
4444    /// - `INVALID_ORIGIN`: `origins` is an empty vector.
4445    /// - `NO_DATA_IN_MESSAGE`: The `data` property is missing in `message`.
4446    pub fn r#post_message(
4447        &self,
4448        mut target_origin: &str,
4449        mut message: WebMessage,
4450        ___deadline: zx::MonotonicInstant,
4451    ) -> Result<FramePostMessageResult, fidl::Error> {
4452        let _response = self.client.send_query::<
4453            FramePostMessageRequest,
4454            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
4455            FrameMarker,
4456        >(
4457            (target_origin, &mut message,),
4458            0x751d686eb7caa341,
4459            fidl::encoding::DynamicFlags::empty(),
4460            ___deadline,
4461        )?;
4462        Ok(_response.map(|x| x))
4463    }
4464
4465    /// Sets the listener for handling page navigation events.
4466    ///
4467    /// - `listener`: The observer to use. Unregisters any existing listener if null.
4468    pub fn r#set_navigation_event_listener(
4469        &self,
4470        mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4471    ) -> Result<(), fidl::Error> {
4472        self.client.send::<FrameSetNavigationEventListenerRequest>(
4473            (listener,),
4474            0x965ba0fa20e0a56,
4475            fidl::encoding::DynamicFlags::empty(),
4476        )
4477    }
4478
4479    /// Sets the listener for handling page navigation events. The listener will receive the
4480    /// current navigation state immediately. After that, it's notified whenever the state changes.
4481    ///
4482    /// - `listener`: The observer to use. Unregisters any existing listener if null.
4483    /// - `flags`: Flags for optional features that should be enabled for the listener.
4484    pub fn r#set_navigation_event_listener2(
4485        &self,
4486        mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
4487        mut flags: NavigationEventListenerFlags,
4488    ) -> Result<(), fidl::Error> {
4489        self.client.send::<FrameSetNavigationEventListener2Request>(
4490            (listener, flags),
4491            0x5f8b40607f1f578f,
4492            fidl::encoding::DynamicFlags::empty(),
4493        )
4494    }
4495
4496    /// If set to a value other than [`ConsoleLogLevel.NONE`], allows web content to log messages
4497    /// to the [`fuchsia.logger/LogSink`] configured for this [`Frame`], via the
4498    /// `console` object (e.g. using `debug()`, `log()`, `info()`, `warn()` and
4499    /// `error()`).
4500    /// The default value is [`ConsoleLogLevel.NONE`].
4501    ///
4502    /// As the system log may be persisted, it is recommended that [`ConsoleLogLevel.NONE`] be used
4503    /// in Incognito and other private browsing modes.
4504    ///
4505    /// Log lines are written to the [`fuchsia.logger/LogsSink`] configured
4506    /// for this [`fuchsia.web/Frame`], with severities mapped as follows:
4507    /// - `debug()`, `log()` and `info()` are logged at [`fuchsia.logger/LogLevelFilter.INFO`]
4508    ///   severity.
4509    /// - `warn()` is logged at [`fuchsia.logger/LogLevelFilter.WARN`] severity.
4510    /// - `error()` is logged at [`fuchsia.logger/LogLevelFilter.ERROR`] severity.
4511    pub fn r#set_java_script_log_level(
4512        &self,
4513        mut level: ConsoleLogLevel,
4514    ) -> Result<(), fidl::Error> {
4515        self.client.send::<FrameSetJavaScriptLogLevelRequest>(
4516            (level,),
4517            0x74824b11a71c4b5b,
4518            fidl::encoding::DynamicFlags::empty(),
4519        )
4520    }
4521
4522    /// Specifies where to emit `console` log output to. By default log output will be routed to a
4523    /// [`fuchsia.logger/LogSink`] obtained via the [`fuchsia.web/Context`]'s service directory.
4524    ///
4525    /// - `sink`: The [`fuchsia.logger/LogSink`] to use to emit logs. Passing a `null` handle
4526    ///   resets logging to use the default [`fuchsia.logger/LogSink`].
4527    pub fn r#set_console_log_sink(
4528        &self,
4529        mut sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
4530    ) -> Result<(), fidl::Error> {
4531        self.client.send::<FrameSetConsoleLogSinkRequest>(
4532            (sink,),
4533            0x18f5cbc19fa4687b,
4534            fidl::encoding::DynamicFlags::empty(),
4535        )
4536    }
4537
4538    /// Enables or disables the processing of the specified `types` of user inputs.
4539    /// `allow` specifies whether to enable or disable the specified `types`.
4540    /// All input types are enabled by default.
4541    pub fn r#configure_input_types(
4542        &self,
4543        mut types: InputTypes,
4544        mut allow: AllowInputState,
4545    ) -> Result<(), fidl::Error> {
4546        self.client.send::<FrameConfigureInputTypesRequest>(
4547            (types, allow),
4548            0x38e08fe763c6bef6,
4549            fidl::encoding::DynamicFlags::empty(),
4550        )
4551    }
4552
4553    /// Sets the listener for handling popup frame opened by web content. If no listener is
4554    /// present, then any new popup frame will be blocked.
4555    ///
4556    /// - `listener`: The listener to use. Unregisters any existing listener if null.
4557    pub fn r#set_popup_frame_creation_listener(
4558        &self,
4559        mut listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
4560    ) -> Result<(), fidl::Error> {
4561        self.client.send::<FrameSetPopupFrameCreationListenerRequest>(
4562            (listener,),
4563            0x34ddec4e9f11e2aa,
4564            fidl::encoding::DynamicFlags::empty(),
4565        )
4566    }
4567
4568    /// Supplies a set of [`UrlRequestRewriteRule`] to apply on every subsequent URL request.
4569    /// - `rules` are cumulative and applied in order.
4570    /// - `rules` are only applied on the first URL request in a redirect chain.
4571    /// - `rules` will be validated before being applied. If `rules` are invalid, the [`Frame`]
4572    ///   will be closed with `ERR_INVALID_ARGS`.
4573    /// - [`Frame.SetUrlRequestRewriteRules`] must not be called again until its acknowledgement
4574    ///   callback has been processed. If this happens, the [`Frame`] will be closed with
4575    ///   `ERR_BAD_STATE`.
4576    pub fn r#set_url_request_rewrite_rules(
4577        &self,
4578        mut rules: &[UrlRequestRewriteRule],
4579        ___deadline: zx::MonotonicInstant,
4580    ) -> Result<(), fidl::Error> {
4581        let _response = self.client.send_query::<
4582            FrameSetUrlRequestRewriteRulesRequest,
4583            fidl::encoding::EmptyPayload,
4584            FrameMarker,
4585        >(
4586            (rules,),
4587            0x2e3f797350ab3281,
4588            fidl::encoding::DynamicFlags::empty(),
4589            ___deadline,
4590        )?;
4591        Ok(_response)
4592    }
4593
4594    /// Sets [`fuchsia.media/FrameMediaSettings`] for the frame. The specified parameters are
4595    /// applied to audio streams that started after this message is processed. Should be called
4596    /// before the Frame is navigated to content in order to ensure that the settings applied to
4597    /// all media streams. Due to request pipelining, this means doing so before calling
4598    /// [`Frame.GetNavigationController()`] and [`NavigationController.LoadUrl()`].
4599    pub fn r#set_media_settings(
4600        &self,
4601        mut settings: &FrameMediaSettings,
4602    ) -> Result<(), fidl::Error> {
4603        self.client.send::<FrameSetMediaSettingsRequest>(
4604            (settings,),
4605            0x7da879b6d284c143,
4606            fidl::encoding::DynamicFlags::empty(),
4607        )
4608    }
4609
4610    /// Overrides the dimensions reported to web content. The devicePixelRatio reported to
4611    /// web content will be adjusted in response to changes in the pixel size of the View,
4612    /// rather than changing the size reported to the content. Call with null `web_dips` to
4613    /// remove any prior forced content dimensions.
4614    pub fn r#force_content_dimensions(
4615        &self,
4616        mut web_dips: Option<&fidl_fuchsia_ui_gfx::Vec2>,
4617    ) -> Result<(), fidl::Error> {
4618        self.client.send::<FrameForceContentDimensionsRequest>(
4619            (web_dips,),
4620            0x8c7024c7149c901,
4621            fidl::encoding::DynamicFlags::empty(),
4622        )
4623    }
4624
4625    /// Sets the permission state for the specified `permission` and `web_origin`. By default, all
4626    /// permissions are denied.
4627    pub fn r#set_permission_state(
4628        &self,
4629        mut permission: &PermissionDescriptor,
4630        mut web_origin: &str,
4631        mut state: PermissionState,
4632    ) -> Result<(), fidl::Error> {
4633        self.client.send::<FrameSetPermissionStateRequest>(
4634            (permission, web_origin, state),
4635            0x19574e92a7033f4f,
4636            fidl::encoding::DynamicFlags::empty(),
4637        )
4638    }
4639
4640    /// Sets whether to block all HTMLMediaElements in the frame from fetching and loading media
4641    /// resources.
4642    ///
4643    /// May be used, for example, to prevent loading media in frames that are not visible.
4644    ///
4645    /// While media loading is blocked, elements with `autoplay` set to `true` will not start
4646    /// playback. The promises returned by calls to `play()` will remain unresolved until loading is
4647    /// unblocked by a call to this method.
4648    ///
4649    /// When media loading is unblocked, elements will begin fetching, resource, loading, and
4650    /// playing as appropriate.
4651    ///
4652    /// Any elements that have begun fetching or loading media resources for the current source
4653    /// before media loading was blocked will continue to fetch, load, and start playback as
4654    /// appropriate. This includes calls to `play()` even after media loading is blocked.
4655    pub fn r#set_block_media_loading(&self, mut blocked: bool) -> Result<(), fidl::Error> {
4656        self.client.send::<FrameSetBlockMediaLoadingRequest>(
4657            (blocked,),
4658            0x211071458fc9cf4f,
4659            fidl::encoding::DynamicFlags::empty(),
4660        )
4661    }
4662
4663    /// Returns the amount of private (non-shared) physical memory used by the Frame's main
4664    /// document. The returned size might not reflect the memory usage of embedded iframes.
4665    pub fn r#get_private_memory_size(
4666        &self,
4667        ___deadline: zx::MonotonicInstant,
4668    ) -> Result<u64, fidl::Error> {
4669        let _response = self.client.send_query::<
4670            fidl::encoding::EmptyPayload,
4671            FrameGetPrivateMemorySizeResponse,
4672            FrameMarker,
4673        >(
4674            (),
4675            0x6ad4d43da6c129b0,
4676            fidl::encoding::DynamicFlags::empty(),
4677            ___deadline,
4678        )?;
4679        Ok(_response.size_bytes)
4680    }
4681
4682    /// Sets the navigation policy provider for the [`Frame`]. When set, the [`Frame`] sends
4683    /// [`NavigationPolicyProvider.EvaluateRequestedNavigation`] when processing navigation
4684    /// requests. `params` defines when the message is sent. After sending the
4685    /// `EvaluateRequestedNavigation` message, the [`Frame`] blocks the corresponding navigation
4686    /// until it receives a response.
4687    ///
4688    /// Should be called before `GetNavigationController` to ensure that it is applied to all
4689    /// navigations including the first [`NavigationController.LoadURL`] request.
4690    pub fn r#set_navigation_policy_provider(
4691        &self,
4692        mut params: &NavigationPolicyProviderParams,
4693        mut provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
4694    ) -> Result<(), fidl::Error> {
4695        self.client.send::<FrameSetNavigationPolicyProviderRequest>(
4696            (params, provider),
4697            0x602ce35195d66654,
4698            fidl::encoding::DynamicFlags::empty(),
4699        )
4700    }
4701
4702    /// Sets various settings for how web content should be run in the Frame. May be called at any
4703    /// time, including after the URL has loaded. Each call changes only the specified fields,
4704    /// overwriting any prior value.
4705    ///
4706    /// This method will fail with `ZX_ERR_NOT_SUPPORTED` if any value in [`ContentAreaSettings`]
4707    /// is not supported by the Frame.
4708    pub fn r#set_content_area_settings(
4709        &self,
4710        mut settings: &ContentAreaSettings,
4711    ) -> Result<(), fidl::Error> {
4712        self.client.send::<FrameSetContentAreaSettingsRequest>(
4713            (settings,),
4714            0x851f4de50c3c27e,
4715            fidl::encoding::DynamicFlags::empty(),
4716        )
4717    }
4718
4719    /// Reset the Frame's [`ContentAreaSettings`] to default values.
4720    pub fn r#reset_content_area_settings(&self) -> Result<(), fidl::Error> {
4721        self.client.send::<fidl::encoding::EmptyPayload>(
4722            (),
4723            0x6807e04f16f8ee5d,
4724            fidl::encoding::DynamicFlags::empty(),
4725        )
4726    }
4727
4728    /// Request graceful or immediate teardown of the Frame content and notification of completion
4729    /// via Frame epitaph.
4730    ///
4731    /// Graceful teardown allows unload and cleanup tasks in the implementation and web content
4732    /// (e.g., `unload` event handlers) to run for up to the specified period of time. Immediate
4733    /// teardown only runs the minimum cleanup tasks in the implementation and does not allow web
4734    /// content to run event handlers.
4735    ///
4736    /// * If `timeout` is zero, an immediate teardown is initiated. The channel will close with
4737    ///   `ZX_OK`. This is equivalent to the caller closing the Frame channel.
4738    ///
4739    /// * If `timeout` is non-zero, a graceful teardown is initiated. The channel will close with
4740    ///   `ZX_OK` if the Frame closes within the specified `timeout` and with `ZX_ERR_TIMED_OUT`
4741    ///   otherwise.
4742    ///
4743    /// * If `timeout` is not specified, a reasonable implementation-specific timeout is applied.
4744    ///
4745    /// Subsequent calls to `Close()` will override any previously specified `Close()` timeout.
4746    pub fn r#close(&self, mut payload: &FrameCloseRequest) -> Result<(), fidl::Error> {
4747        self.client.send::<FrameCloseRequest>(
4748            payload,
4749            0x442e84138e65351,
4750            fidl::encoding::DynamicFlags::empty(),
4751        )
4752    }
4753}
4754
4755#[cfg(target_os = "fuchsia")]
4756impl From<FrameSynchronousProxy> for zx::NullableHandle {
4757    fn from(value: FrameSynchronousProxy) -> Self {
4758        value.into_channel().into()
4759    }
4760}
4761
4762#[cfg(target_os = "fuchsia")]
4763impl From<fidl::Channel> for FrameSynchronousProxy {
4764    fn from(value: fidl::Channel) -> Self {
4765        Self::new(value)
4766    }
4767}
4768
4769#[cfg(target_os = "fuchsia")]
4770impl fidl::endpoints::FromClient for FrameSynchronousProxy {
4771    type Protocol = FrameMarker;
4772
4773    fn from_client(value: fidl::endpoints::ClientEnd<FrameMarker>) -> Self {
4774        Self::new(value.into_channel())
4775    }
4776}
4777
4778#[derive(Debug, Clone)]
4779pub struct FrameProxy {
4780    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4781}
4782
4783impl fidl::endpoints::Proxy for FrameProxy {
4784    type Protocol = FrameMarker;
4785
4786    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4787        Self::new(inner)
4788    }
4789
4790    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4791        self.client.into_channel().map_err(|client| Self { client })
4792    }
4793
4794    fn as_channel(&self) -> &::fidl::AsyncChannel {
4795        self.client.as_channel()
4796    }
4797}
4798
4799impl FrameProxy {
4800    /// Create a new Proxy for fuchsia.web/Frame.
4801    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4802        let protocol_name = <FrameMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4803        Self { client: fidl::client::Client::new(channel, protocol_name) }
4804    }
4805
4806    /// Get a Stream of events from the remote end of the protocol.
4807    ///
4808    /// # Panics
4809    ///
4810    /// Panics if the event stream was already taken.
4811    pub fn take_event_stream(&self) -> FrameEventStream {
4812        FrameEventStream { event_receiver: self.client.take_event_receiver() }
4813    }
4814
4815    /// Creates a new view using the specified `view_token`. Caller should pass the other end of
4816    /// the token to [`fuchsia.ui.gfx/ViewHolderArgs`] to attach the new view to a view tree.
4817    ///
4818    /// See the description of [`CreateContextParams.service_directory`] for additional services
4819    /// that must be present when using this method.
4820    pub fn r#create_view(
4821        &self,
4822        mut view_token: fidl_fuchsia_ui_views::ViewToken,
4823    ) -> Result<(), fidl::Error> {
4824        FrameProxyInterface::r#create_view(self, view_token)
4825    }
4826
4827    /// Creates a new view using the specified `view_token`. Caller should pass the other end of
4828    /// the token to [`fuchsia.ui.gfx/ViewHolderArgs`] to attach the new view to a view tree.
4829    /// `view_ref` can be cloned before passing it to this method, which will allow clients to
4830    /// track the view.
4831    ///
4832    /// `view_ref_control` must not have the `ZX_RIGHT_DUPLICATE` set, or view creation will fail
4833    /// and `view_token` will be closed.
4834    ///
4835    /// See the description of [`CreateContextParams.service_directory`] for additional services
4836    /// that must be present when using this method.
4837    pub fn r#create_view_with_view_ref(
4838        &self,
4839        mut view_token: fidl_fuchsia_ui_views::ViewToken,
4840        mut view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
4841        mut view_ref: fidl_fuchsia_ui_views::ViewRef,
4842    ) -> Result<(), fidl::Error> {
4843        FrameProxyInterface::r#create_view_with_view_ref(
4844            self,
4845            view_token,
4846            view_ref_control,
4847            view_ref,
4848        )
4849    }
4850
4851    /// Creates a new Flatland view using the specified `view_creation_token` defined under `args`.
4852    /// Caller should pass the other end of the token to
4853    /// [`fuchsia.ui.composition/Flatland.CreateViewport`] to attach the new Flatland view to its
4854    /// graph.
4855    pub fn r#create_view2(&self, mut args: CreateView2Args) -> Result<(), fidl::Error> {
4856        FrameProxyInterface::r#create_view2(self, args)
4857    }
4858
4859    /// Enables headless rendering of the Frame.
4860    ///
4861    /// This is used when content depends on layout and/or animation events firing normally.
4862    /// May only be used on a Context created with [`ContextFeatureFlags.HEADLESS`].
4863    pub fn r#enable_headless_rendering(&self) -> Result<(), fidl::Error> {
4864        FrameProxyInterface::r#enable_headless_rendering(self)
4865    }
4866
4867    /// Stops headless rendering of the Frame.
4868    ///
4869    /// May only be used on a Context created with [`ContextFeatureFlags.HEADLESS`].
4870    pub fn r#disable_headless_rendering(&self) -> Result<(), fidl::Error> {
4871        FrameProxyInterface::r#disable_headless_rendering(self)
4872    }
4873
4874    /// Returns a [`fuchsia.media.sessions2/Player`] interface through which media (i.e.
4875    /// video/audio) playback in the frame may be observed, and/or controlled. Only one
4876    /// [`fuchsia.media.sessions2/Player`] may be active at a time, for each [`Frame`].
4877    pub fn r#get_media_player(
4878        &self,
4879        mut player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
4880    ) -> Result<(), fidl::Error> {
4881        FrameProxyInterface::r#get_media_player(self, player)
4882    }
4883
4884    /// Returns an interface through which the [`Frame`] may be navigated to a desired URL,
4885    /// reloaded, etc.
4886    ///
4887    /// - `controller`: An asynchronous interface request for the [`Frame`]'s
4888    ///   [`NavigationController`].
4889    pub fn r#get_navigation_controller(
4890        &self,
4891        mut controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
4892    ) -> Result<(), fidl::Error> {
4893        FrameProxyInterface::r#get_navigation_controller(self, controller)
4894    }
4895
4896    /// Executes a UTF-8 encoded `script` in the [`Frame`] if the [`Frame`]'s URL has an origin
4897    /// which matches entries in `origins`.
4898    ///
4899    /// At least one `origins` entry must be specified. If a wildcard `"*"` is specified in
4900    /// `origins`, then the script will be evaluated unconditionally.
4901    ///
4902    /// Returns the result of executing `script`, as a JSON-encoded string.
4903    ///
4904    /// Note that scripts share the same execution context as the document,
4905    /// meaning that document may modify variables, classes, or objects set by
4906    /// the script in arbitrary or unpredictable ways.
4907    ///
4908    /// If an error occurred, the FrameError will be set to one of these values:
4909    /// - `BUFFER_NOT_UTF8`: `script` is not UTF-8 encoded.
4910    /// - `INVALID_ORIGIN`: The [`Frame`]'s current URL does not match any of the values in
4911    ///   `origins` or `origins` is an empty vector.
4912    pub fn r#execute_java_script(
4913        &self,
4914        mut origins: &[String],
4915        mut script: fidl_fuchsia_mem::Buffer,
4916    ) -> fidl::client::QueryResponseFut<
4917        FrameExecuteJavaScriptResult,
4918        fidl::encoding::DefaultFuchsiaResourceDialect,
4919    > {
4920        FrameProxyInterface::r#execute_java_script(self, origins, script)
4921    }
4922
4923    /// Variant of [`Frame.ExecuteJavaScript`] which executes the supplied script without returning
4924    /// a result.
4925    pub fn r#execute_java_script_no_result(
4926        &self,
4927        mut origins: &[String],
4928        mut script: fidl_fuchsia_mem::Buffer,
4929    ) -> fidl::client::QueryResponseFut<
4930        FrameExecuteJavaScriptNoResultResult,
4931        fidl::encoding::DefaultFuchsiaResourceDialect,
4932    > {
4933        FrameProxyInterface::r#execute_java_script_no_result(self, origins, script)
4934    }
4935
4936    /// Executes a UTF-8 encoded `script` for every subsequent page load where the [`Frame`]'s URL
4937    /// has an origin reflected in `origins`. The script is executed early, prior to the execution
4938    /// of the document's scripts.
4939    ///
4940    /// Scripts are identified by a client-managed identifier `id`. Any script previously injected
4941    /// using the same `id` will be replaced.
4942    ///
4943    /// The order in which multiple bindings are executed is the same as the order in which the
4944    /// bindings were added. If a script is added which clobbers an existing script of the same
4945    /// `id`, the previous script's precedence in the injection order will be preserved.
4946    ///
4947    /// At least one `origins` entry must be specified. If a wildcard `"*"` is specified in
4948    /// `origins`, then the script will be evaluated unconditionally.
4949    ///
4950    /// If an error occurred, the [`FrameError`] will be set to one of these values:
4951    /// - `BUFFER_NOT_UTF8`: `script` is not UTF-8 encoded.
4952    /// - `INVALID_ORIGIN`: `origins` is an empty vector.
4953    pub fn r#add_before_load_java_script(
4954        &self,
4955        mut id: u64,
4956        mut origins: &[String],
4957        mut script: fidl_fuchsia_mem::Buffer,
4958    ) -> fidl::client::QueryResponseFut<
4959        FrameAddBeforeLoadJavaScriptResult,
4960        fidl::encoding::DefaultFuchsiaResourceDialect,
4961    > {
4962        FrameProxyInterface::r#add_before_load_java_script(self, id, origins, script)
4963    }
4964
4965    /// Removes a previously added JavaScript snippet identified by `id`. This is a no-op if there
4966    /// is no JavaScript snippet identified by `id`.
4967    pub fn r#remove_before_load_java_script(&self, mut id: u64) -> Result<(), fidl::Error> {
4968        FrameProxyInterface::r#remove_before_load_java_script(self, id)
4969    }
4970
4971    /// Posts a message to the frame's onMessage handler.
4972    ///
4973    /// `target_origin` restricts message delivery to the specified origin. If `target_origin` is
4974    /// `"*"`, then the message will be sent to the document regardless of its origin.
4975    /// See the
4976    /// [HTML spec](https://html.spec.whatwg.org/multipage/web-messaging.html#posting-messages)
4977    /// section 9.4.3 for more details on how the target origin policy is applied.
4978    ///
4979    /// If an error occurred, the [`FrameError`] will be set to one of these values:
4980    /// - `INTERNAL_ERROR`: The WebEngine failed to create a message pipe.
4981    /// - `BUFFER_NOT_UTF8`: The script in `message`'s `data` property is not UTF-8 encoded.
4982    /// - `INVALID_ORIGIN`: `origins` is an empty vector.
4983    /// - `NO_DATA_IN_MESSAGE`: The `data` property is missing in `message`.
4984    pub fn r#post_message(
4985        &self,
4986        mut target_origin: &str,
4987        mut message: WebMessage,
4988    ) -> fidl::client::QueryResponseFut<
4989        FramePostMessageResult,
4990        fidl::encoding::DefaultFuchsiaResourceDialect,
4991    > {
4992        FrameProxyInterface::r#post_message(self, target_origin, message)
4993    }
4994
4995    /// Sets the listener for handling page navigation events.
4996    ///
4997    /// - `listener`: The observer to use. Unregisters any existing listener if null.
4998    pub fn r#set_navigation_event_listener(
4999        &self,
5000        mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
5001    ) -> Result<(), fidl::Error> {
5002        FrameProxyInterface::r#set_navigation_event_listener(self, listener)
5003    }
5004
5005    /// Sets the listener for handling page navigation events. The listener will receive the
5006    /// current navigation state immediately. After that, it's notified whenever the state changes.
5007    ///
5008    /// - `listener`: The observer to use. Unregisters any existing listener if null.
5009    /// - `flags`: Flags for optional features that should be enabled for the listener.
5010    pub fn r#set_navigation_event_listener2(
5011        &self,
5012        mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
5013        mut flags: NavigationEventListenerFlags,
5014    ) -> Result<(), fidl::Error> {
5015        FrameProxyInterface::r#set_navigation_event_listener2(self, listener, flags)
5016    }
5017
5018    /// If set to a value other than [`ConsoleLogLevel.NONE`], allows web content to log messages
5019    /// to the [`fuchsia.logger/LogSink`] configured for this [`Frame`], via the
5020    /// `console` object (e.g. using `debug()`, `log()`, `info()`, `warn()` and
5021    /// `error()`).
5022    /// The default value is [`ConsoleLogLevel.NONE`].
5023    ///
5024    /// As the system log may be persisted, it is recommended that [`ConsoleLogLevel.NONE`] be used
5025    /// in Incognito and other private browsing modes.
5026    ///
5027    /// Log lines are written to the [`fuchsia.logger/LogsSink`] configured
5028    /// for this [`fuchsia.web/Frame`], with severities mapped as follows:
5029    /// - `debug()`, `log()` and `info()` are logged at [`fuchsia.logger/LogLevelFilter.INFO`]
5030    ///   severity.
5031    /// - `warn()` is logged at [`fuchsia.logger/LogLevelFilter.WARN`] severity.
5032    /// - `error()` is logged at [`fuchsia.logger/LogLevelFilter.ERROR`] severity.
5033    pub fn r#set_java_script_log_level(
5034        &self,
5035        mut level: ConsoleLogLevel,
5036    ) -> Result<(), fidl::Error> {
5037        FrameProxyInterface::r#set_java_script_log_level(self, level)
5038    }
5039
5040    /// Specifies where to emit `console` log output to. By default log output will be routed to a
5041    /// [`fuchsia.logger/LogSink`] obtained via the [`fuchsia.web/Context`]'s service directory.
5042    ///
5043    /// - `sink`: The [`fuchsia.logger/LogSink`] to use to emit logs. Passing a `null` handle
5044    ///   resets logging to use the default [`fuchsia.logger/LogSink`].
5045    pub fn r#set_console_log_sink(
5046        &self,
5047        mut sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
5048    ) -> Result<(), fidl::Error> {
5049        FrameProxyInterface::r#set_console_log_sink(self, sink)
5050    }
5051
5052    /// Enables or disables the processing of the specified `types` of user inputs.
5053    /// `allow` specifies whether to enable or disable the specified `types`.
5054    /// All input types are enabled by default.
5055    pub fn r#configure_input_types(
5056        &self,
5057        mut types: InputTypes,
5058        mut allow: AllowInputState,
5059    ) -> Result<(), fidl::Error> {
5060        FrameProxyInterface::r#configure_input_types(self, types, allow)
5061    }
5062
5063    /// Sets the listener for handling popup frame opened by web content. If no listener is
5064    /// present, then any new popup frame will be blocked.
5065    ///
5066    /// - `listener`: The listener to use. Unregisters any existing listener if null.
5067    pub fn r#set_popup_frame_creation_listener(
5068        &self,
5069        mut listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
5070    ) -> Result<(), fidl::Error> {
5071        FrameProxyInterface::r#set_popup_frame_creation_listener(self, listener)
5072    }
5073
5074    /// Supplies a set of [`UrlRequestRewriteRule`] to apply on every subsequent URL request.
5075    /// - `rules` are cumulative and applied in order.
5076    /// - `rules` are only applied on the first URL request in a redirect chain.
5077    /// - `rules` will be validated before being applied. If `rules` are invalid, the [`Frame`]
5078    ///   will be closed with `ERR_INVALID_ARGS`.
5079    /// - [`Frame.SetUrlRequestRewriteRules`] must not be called again until its acknowledgement
5080    ///   callback has been processed. If this happens, the [`Frame`] will be closed with
5081    ///   `ERR_BAD_STATE`.
5082    pub fn r#set_url_request_rewrite_rules(
5083        &self,
5084        mut rules: &[UrlRequestRewriteRule],
5085    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5086        FrameProxyInterface::r#set_url_request_rewrite_rules(self, rules)
5087    }
5088
5089    /// Sets [`fuchsia.media/FrameMediaSettings`] for the frame. The specified parameters are
5090    /// applied to audio streams that started after this message is processed. Should be called
5091    /// before the Frame is navigated to content in order to ensure that the settings applied to
5092    /// all media streams. Due to request pipelining, this means doing so before calling
5093    /// [`Frame.GetNavigationController()`] and [`NavigationController.LoadUrl()`].
5094    pub fn r#set_media_settings(
5095        &self,
5096        mut settings: &FrameMediaSettings,
5097    ) -> Result<(), fidl::Error> {
5098        FrameProxyInterface::r#set_media_settings(self, settings)
5099    }
5100
5101    /// Overrides the dimensions reported to web content. The devicePixelRatio reported to
5102    /// web content will be adjusted in response to changes in the pixel size of the View,
5103    /// rather than changing the size reported to the content. Call with null `web_dips` to
5104    /// remove any prior forced content dimensions.
5105    pub fn r#force_content_dimensions(
5106        &self,
5107        mut web_dips: Option<&fidl_fuchsia_ui_gfx::Vec2>,
5108    ) -> Result<(), fidl::Error> {
5109        FrameProxyInterface::r#force_content_dimensions(self, web_dips)
5110    }
5111
5112    /// Sets the permission state for the specified `permission` and `web_origin`. By default, all
5113    /// permissions are denied.
5114    pub fn r#set_permission_state(
5115        &self,
5116        mut permission: &PermissionDescriptor,
5117        mut web_origin: &str,
5118        mut state: PermissionState,
5119    ) -> Result<(), fidl::Error> {
5120        FrameProxyInterface::r#set_permission_state(self, permission, web_origin, state)
5121    }
5122
5123    /// Sets whether to block all HTMLMediaElements in the frame from fetching and loading media
5124    /// resources.
5125    ///
5126    /// May be used, for example, to prevent loading media in frames that are not visible.
5127    ///
5128    /// While media loading is blocked, elements with `autoplay` set to `true` will not start
5129    /// playback. The promises returned by calls to `play()` will remain unresolved until loading is
5130    /// unblocked by a call to this method.
5131    ///
5132    /// When media loading is unblocked, elements will begin fetching, resource, loading, and
5133    /// playing as appropriate.
5134    ///
5135    /// Any elements that have begun fetching or loading media resources for the current source
5136    /// before media loading was blocked will continue to fetch, load, and start playback as
5137    /// appropriate. This includes calls to `play()` even after media loading is blocked.
5138    pub fn r#set_block_media_loading(&self, mut blocked: bool) -> Result<(), fidl::Error> {
5139        FrameProxyInterface::r#set_block_media_loading(self, blocked)
5140    }
5141
5142    /// Returns the amount of private (non-shared) physical memory used by the Frame's main
5143    /// document. The returned size might not reflect the memory usage of embedded iframes.
5144    pub fn r#get_private_memory_size(
5145        &self,
5146    ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
5147        FrameProxyInterface::r#get_private_memory_size(self)
5148    }
5149
5150    /// Sets the navigation policy provider for the [`Frame`]. When set, the [`Frame`] sends
5151    /// [`NavigationPolicyProvider.EvaluateRequestedNavigation`] when processing navigation
5152    /// requests. `params` defines when the message is sent. After sending the
5153    /// `EvaluateRequestedNavigation` message, the [`Frame`] blocks the corresponding navigation
5154    /// until it receives a response.
5155    ///
5156    /// Should be called before `GetNavigationController` to ensure that it is applied to all
5157    /// navigations including the first [`NavigationController.LoadURL`] request.
5158    pub fn r#set_navigation_policy_provider(
5159        &self,
5160        mut params: &NavigationPolicyProviderParams,
5161        mut provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
5162    ) -> Result<(), fidl::Error> {
5163        FrameProxyInterface::r#set_navigation_policy_provider(self, params, provider)
5164    }
5165
5166    /// Sets various settings for how web content should be run in the Frame. May be called at any
5167    /// time, including after the URL has loaded. Each call changes only the specified fields,
5168    /// overwriting any prior value.
5169    ///
5170    /// This method will fail with `ZX_ERR_NOT_SUPPORTED` if any value in [`ContentAreaSettings`]
5171    /// is not supported by the Frame.
5172    pub fn r#set_content_area_settings(
5173        &self,
5174        mut settings: &ContentAreaSettings,
5175    ) -> Result<(), fidl::Error> {
5176        FrameProxyInterface::r#set_content_area_settings(self, settings)
5177    }
5178
5179    /// Reset the Frame's [`ContentAreaSettings`] to default values.
5180    pub fn r#reset_content_area_settings(&self) -> Result<(), fidl::Error> {
5181        FrameProxyInterface::r#reset_content_area_settings(self)
5182    }
5183
5184    /// Request graceful or immediate teardown of the Frame content and notification of completion
5185    /// via Frame epitaph.
5186    ///
5187    /// Graceful teardown allows unload and cleanup tasks in the implementation and web content
5188    /// (e.g., `unload` event handlers) to run for up to the specified period of time. Immediate
5189    /// teardown only runs the minimum cleanup tasks in the implementation and does not allow web
5190    /// content to run event handlers.
5191    ///
5192    /// * If `timeout` is zero, an immediate teardown is initiated. The channel will close with
5193    ///   `ZX_OK`. This is equivalent to the caller closing the Frame channel.
5194    ///
5195    /// * If `timeout` is non-zero, a graceful teardown is initiated. The channel will close with
5196    ///   `ZX_OK` if the Frame closes within the specified `timeout` and with `ZX_ERR_TIMED_OUT`
5197    ///   otherwise.
5198    ///
5199    /// * If `timeout` is not specified, a reasonable implementation-specific timeout is applied.
5200    ///
5201    /// Subsequent calls to `Close()` will override any previously specified `Close()` timeout.
5202    pub fn r#close(&self, mut payload: &FrameCloseRequest) -> Result<(), fidl::Error> {
5203        FrameProxyInterface::r#close(self, payload)
5204    }
5205}
5206
5207impl FrameProxyInterface for FrameProxy {
5208    fn r#create_view(
5209        &self,
5210        mut view_token: fidl_fuchsia_ui_views::ViewToken,
5211    ) -> Result<(), fidl::Error> {
5212        self.client.send::<FrameCreateViewRequest>(
5213            (&mut view_token,),
5214            0x6a27859439133264,
5215            fidl::encoding::DynamicFlags::empty(),
5216        )
5217    }
5218
5219    fn r#create_view_with_view_ref(
5220        &self,
5221        mut view_token: fidl_fuchsia_ui_views::ViewToken,
5222        mut view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
5223        mut view_ref: fidl_fuchsia_ui_views::ViewRef,
5224    ) -> Result<(), fidl::Error> {
5225        self.client.send::<FrameCreateViewWithViewRefRequest>(
5226            (&mut view_token, &mut view_ref_control, &mut view_ref),
5227            0x1eb17ab2442326ac,
5228            fidl::encoding::DynamicFlags::empty(),
5229        )
5230    }
5231
5232    fn r#create_view2(&self, mut args: CreateView2Args) -> Result<(), fidl::Error> {
5233        self.client.send::<FrameCreateView2Request>(
5234            (&mut args,),
5235            0x1be7e9512962eb37,
5236            fidl::encoding::DynamicFlags::empty(),
5237        )
5238    }
5239
5240    fn r#enable_headless_rendering(&self) -> Result<(), fidl::Error> {
5241        self.client.send::<fidl::encoding::EmptyPayload>(
5242            (),
5243            0x72a81aaae7a80d2b,
5244            fidl::encoding::DynamicFlags::empty(),
5245        )
5246    }
5247
5248    fn r#disable_headless_rendering(&self) -> Result<(), fidl::Error> {
5249        self.client.send::<fidl::encoding::EmptyPayload>(
5250            (),
5251            0x5ca38a3d1f7f543a,
5252            fidl::encoding::DynamicFlags::empty(),
5253        )
5254    }
5255
5256    fn r#get_media_player(
5257        &self,
5258        mut player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
5259    ) -> Result<(), fidl::Error> {
5260        self.client.send::<FrameGetMediaPlayerRequest>(
5261            (player,),
5262            0xaafb639fc0b9eb9,
5263            fidl::encoding::DynamicFlags::empty(),
5264        )
5265    }
5266
5267    fn r#get_navigation_controller(
5268        &self,
5269        mut controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
5270    ) -> Result<(), fidl::Error> {
5271        self.client.send::<FrameGetNavigationControllerRequest>(
5272            (controller,),
5273            0x4521cfe95217a688,
5274            fidl::encoding::DynamicFlags::empty(),
5275        )
5276    }
5277
5278    type ExecuteJavaScriptResponseFut = fidl::client::QueryResponseFut<
5279        FrameExecuteJavaScriptResult,
5280        fidl::encoding::DefaultFuchsiaResourceDialect,
5281    >;
5282    fn r#execute_java_script(
5283        &self,
5284        mut origins: &[String],
5285        mut script: fidl_fuchsia_mem::Buffer,
5286    ) -> Self::ExecuteJavaScriptResponseFut {
5287        fn _decode(
5288            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5289        ) -> Result<FrameExecuteJavaScriptResult, fidl::Error> {
5290            let _response = fidl::client::decode_transaction_body::<
5291                fidl::encoding::ResultType<FrameExecuteJavaScriptResponse, FrameError>,
5292                fidl::encoding::DefaultFuchsiaResourceDialect,
5293                0x79abdd4907000542,
5294            >(_buf?)?;
5295            Ok(_response.map(|x| x.result))
5296        }
5297        self.client
5298            .send_query_and_decode::<FrameExecuteJavaScriptRequest, FrameExecuteJavaScriptResult>(
5299                (origins, &mut script),
5300                0x79abdd4907000542,
5301                fidl::encoding::DynamicFlags::empty(),
5302                _decode,
5303            )
5304    }
5305
5306    type ExecuteJavaScriptNoResultResponseFut = fidl::client::QueryResponseFut<
5307        FrameExecuteJavaScriptNoResultResult,
5308        fidl::encoding::DefaultFuchsiaResourceDialect,
5309    >;
5310    fn r#execute_java_script_no_result(
5311        &self,
5312        mut origins: &[String],
5313        mut script: fidl_fuchsia_mem::Buffer,
5314    ) -> Self::ExecuteJavaScriptNoResultResponseFut {
5315        fn _decode(
5316            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5317        ) -> Result<FrameExecuteJavaScriptNoResultResult, fidl::Error> {
5318            let _response = fidl::client::decode_transaction_body::<
5319                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
5320                fidl::encoding::DefaultFuchsiaResourceDialect,
5321                0x16b8491520cbcd63,
5322            >(_buf?)?;
5323            Ok(_response.map(|x| x))
5324        }
5325        self.client.send_query_and_decode::<
5326            FrameExecuteJavaScriptNoResultRequest,
5327            FrameExecuteJavaScriptNoResultResult,
5328        >(
5329            (origins, &mut script,),
5330            0x16b8491520cbcd63,
5331            fidl::encoding::DynamicFlags::empty(),
5332            _decode,
5333        )
5334    }
5335
5336    type AddBeforeLoadJavaScriptResponseFut = fidl::client::QueryResponseFut<
5337        FrameAddBeforeLoadJavaScriptResult,
5338        fidl::encoding::DefaultFuchsiaResourceDialect,
5339    >;
5340    fn r#add_before_load_java_script(
5341        &self,
5342        mut id: u64,
5343        mut origins: &[String],
5344        mut script: fidl_fuchsia_mem::Buffer,
5345    ) -> Self::AddBeforeLoadJavaScriptResponseFut {
5346        fn _decode(
5347            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5348        ) -> Result<FrameAddBeforeLoadJavaScriptResult, fidl::Error> {
5349            let _response = fidl::client::decode_transaction_body::<
5350                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
5351                fidl::encoding::DefaultFuchsiaResourceDialect,
5352                0x540ac0da59d823e,
5353            >(_buf?)?;
5354            Ok(_response.map(|x| x))
5355        }
5356        self.client.send_query_and_decode::<
5357            FrameAddBeforeLoadJavaScriptRequest,
5358            FrameAddBeforeLoadJavaScriptResult,
5359        >(
5360            (id, origins, &mut script,),
5361            0x540ac0da59d823e,
5362            fidl::encoding::DynamicFlags::empty(),
5363            _decode,
5364        )
5365    }
5366
5367    fn r#remove_before_load_java_script(&self, mut id: u64) -> Result<(), fidl::Error> {
5368        self.client.send::<FrameRemoveBeforeLoadJavaScriptRequest>(
5369            (id,),
5370            0x17d92b855b61d23a,
5371            fidl::encoding::DynamicFlags::empty(),
5372        )
5373    }
5374
5375    type PostMessageResponseFut = fidl::client::QueryResponseFut<
5376        FramePostMessageResult,
5377        fidl::encoding::DefaultFuchsiaResourceDialect,
5378    >;
5379    fn r#post_message(
5380        &self,
5381        mut target_origin: &str,
5382        mut message: WebMessage,
5383    ) -> Self::PostMessageResponseFut {
5384        fn _decode(
5385            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5386        ) -> Result<FramePostMessageResult, fidl::Error> {
5387            let _response = fidl::client::decode_transaction_body::<
5388                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
5389                fidl::encoding::DefaultFuchsiaResourceDialect,
5390                0x751d686eb7caa341,
5391            >(_buf?)?;
5392            Ok(_response.map(|x| x))
5393        }
5394        self.client.send_query_and_decode::<FramePostMessageRequest, FramePostMessageResult>(
5395            (target_origin, &mut message),
5396            0x751d686eb7caa341,
5397            fidl::encoding::DynamicFlags::empty(),
5398            _decode,
5399        )
5400    }
5401
5402    fn r#set_navigation_event_listener(
5403        &self,
5404        mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
5405    ) -> Result<(), fidl::Error> {
5406        self.client.send::<FrameSetNavigationEventListenerRequest>(
5407            (listener,),
5408            0x965ba0fa20e0a56,
5409            fidl::encoding::DynamicFlags::empty(),
5410        )
5411    }
5412
5413    fn r#set_navigation_event_listener2(
5414        &self,
5415        mut listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
5416        mut flags: NavigationEventListenerFlags,
5417    ) -> Result<(), fidl::Error> {
5418        self.client.send::<FrameSetNavigationEventListener2Request>(
5419            (listener, flags),
5420            0x5f8b40607f1f578f,
5421            fidl::encoding::DynamicFlags::empty(),
5422        )
5423    }
5424
5425    fn r#set_java_script_log_level(&self, mut level: ConsoleLogLevel) -> Result<(), fidl::Error> {
5426        self.client.send::<FrameSetJavaScriptLogLevelRequest>(
5427            (level,),
5428            0x74824b11a71c4b5b,
5429            fidl::encoding::DynamicFlags::empty(),
5430        )
5431    }
5432
5433    fn r#set_console_log_sink(
5434        &self,
5435        mut sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
5436    ) -> Result<(), fidl::Error> {
5437        self.client.send::<FrameSetConsoleLogSinkRequest>(
5438            (sink,),
5439            0x18f5cbc19fa4687b,
5440            fidl::encoding::DynamicFlags::empty(),
5441        )
5442    }
5443
5444    fn r#configure_input_types(
5445        &self,
5446        mut types: InputTypes,
5447        mut allow: AllowInputState,
5448    ) -> Result<(), fidl::Error> {
5449        self.client.send::<FrameConfigureInputTypesRequest>(
5450            (types, allow),
5451            0x38e08fe763c6bef6,
5452            fidl::encoding::DynamicFlags::empty(),
5453        )
5454    }
5455
5456    fn r#set_popup_frame_creation_listener(
5457        &self,
5458        mut listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
5459    ) -> Result<(), fidl::Error> {
5460        self.client.send::<FrameSetPopupFrameCreationListenerRequest>(
5461            (listener,),
5462            0x34ddec4e9f11e2aa,
5463            fidl::encoding::DynamicFlags::empty(),
5464        )
5465    }
5466
5467    type SetUrlRequestRewriteRulesResponseFut =
5468        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5469    fn r#set_url_request_rewrite_rules(
5470        &self,
5471        mut rules: &[UrlRequestRewriteRule],
5472    ) -> Self::SetUrlRequestRewriteRulesResponseFut {
5473        fn _decode(
5474            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5475        ) -> Result<(), fidl::Error> {
5476            let _response = fidl::client::decode_transaction_body::<
5477                fidl::encoding::EmptyPayload,
5478                fidl::encoding::DefaultFuchsiaResourceDialect,
5479                0x2e3f797350ab3281,
5480            >(_buf?)?;
5481            Ok(_response)
5482        }
5483        self.client.send_query_and_decode::<FrameSetUrlRequestRewriteRulesRequest, ()>(
5484            (rules,),
5485            0x2e3f797350ab3281,
5486            fidl::encoding::DynamicFlags::empty(),
5487            _decode,
5488        )
5489    }
5490
5491    fn r#set_media_settings(&self, mut settings: &FrameMediaSettings) -> Result<(), fidl::Error> {
5492        self.client.send::<FrameSetMediaSettingsRequest>(
5493            (settings,),
5494            0x7da879b6d284c143,
5495            fidl::encoding::DynamicFlags::empty(),
5496        )
5497    }
5498
5499    fn r#force_content_dimensions(
5500        &self,
5501        mut web_dips: Option<&fidl_fuchsia_ui_gfx::Vec2>,
5502    ) -> Result<(), fidl::Error> {
5503        self.client.send::<FrameForceContentDimensionsRequest>(
5504            (web_dips,),
5505            0x8c7024c7149c901,
5506            fidl::encoding::DynamicFlags::empty(),
5507        )
5508    }
5509
5510    fn r#set_permission_state(
5511        &self,
5512        mut permission: &PermissionDescriptor,
5513        mut web_origin: &str,
5514        mut state: PermissionState,
5515    ) -> Result<(), fidl::Error> {
5516        self.client.send::<FrameSetPermissionStateRequest>(
5517            (permission, web_origin, state),
5518            0x19574e92a7033f4f,
5519            fidl::encoding::DynamicFlags::empty(),
5520        )
5521    }
5522
5523    fn r#set_block_media_loading(&self, mut blocked: bool) -> Result<(), fidl::Error> {
5524        self.client.send::<FrameSetBlockMediaLoadingRequest>(
5525            (blocked,),
5526            0x211071458fc9cf4f,
5527            fidl::encoding::DynamicFlags::empty(),
5528        )
5529    }
5530
5531    type GetPrivateMemorySizeResponseFut =
5532        fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
5533    fn r#get_private_memory_size(&self) -> Self::GetPrivateMemorySizeResponseFut {
5534        fn _decode(
5535            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5536        ) -> Result<u64, fidl::Error> {
5537            let _response = fidl::client::decode_transaction_body::<
5538                FrameGetPrivateMemorySizeResponse,
5539                fidl::encoding::DefaultFuchsiaResourceDialect,
5540                0x6ad4d43da6c129b0,
5541            >(_buf?)?;
5542            Ok(_response.size_bytes)
5543        }
5544        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
5545            (),
5546            0x6ad4d43da6c129b0,
5547            fidl::encoding::DynamicFlags::empty(),
5548            _decode,
5549        )
5550    }
5551
5552    fn r#set_navigation_policy_provider(
5553        &self,
5554        mut params: &NavigationPolicyProviderParams,
5555        mut provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
5556    ) -> Result<(), fidl::Error> {
5557        self.client.send::<FrameSetNavigationPolicyProviderRequest>(
5558            (params, provider),
5559            0x602ce35195d66654,
5560            fidl::encoding::DynamicFlags::empty(),
5561        )
5562    }
5563
5564    fn r#set_content_area_settings(
5565        &self,
5566        mut settings: &ContentAreaSettings,
5567    ) -> Result<(), fidl::Error> {
5568        self.client.send::<FrameSetContentAreaSettingsRequest>(
5569            (settings,),
5570            0x851f4de50c3c27e,
5571            fidl::encoding::DynamicFlags::empty(),
5572        )
5573    }
5574
5575    fn r#reset_content_area_settings(&self) -> Result<(), fidl::Error> {
5576        self.client.send::<fidl::encoding::EmptyPayload>(
5577            (),
5578            0x6807e04f16f8ee5d,
5579            fidl::encoding::DynamicFlags::empty(),
5580        )
5581    }
5582
5583    fn r#close(&self, mut payload: &FrameCloseRequest) -> Result<(), fidl::Error> {
5584        self.client.send::<FrameCloseRequest>(
5585            payload,
5586            0x442e84138e65351,
5587            fidl::encoding::DynamicFlags::empty(),
5588        )
5589    }
5590}
5591
5592pub struct FrameEventStream {
5593    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5594}
5595
5596impl std::marker::Unpin for FrameEventStream {}
5597
5598impl futures::stream::FusedStream for FrameEventStream {
5599    fn is_terminated(&self) -> bool {
5600        self.event_receiver.is_terminated()
5601    }
5602}
5603
5604impl futures::Stream for FrameEventStream {
5605    type Item = Result<FrameEvent, fidl::Error>;
5606
5607    fn poll_next(
5608        mut self: std::pin::Pin<&mut Self>,
5609        cx: &mut std::task::Context<'_>,
5610    ) -> std::task::Poll<Option<Self::Item>> {
5611        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5612            &mut self.event_receiver,
5613            cx
5614        )?) {
5615            Some(buf) => std::task::Poll::Ready(Some(FrameEvent::decode(buf))),
5616            None => std::task::Poll::Ready(None),
5617        }
5618    }
5619}
5620
5621#[derive(Debug)]
5622pub enum FrameEvent {}
5623
5624impl FrameEvent {
5625    /// Decodes a message buffer as a [`FrameEvent`].
5626    fn decode(
5627        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5628    ) -> Result<FrameEvent, fidl::Error> {
5629        let (bytes, _handles) = buf.split_mut();
5630        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5631        debug_assert_eq!(tx_header.tx_id, 0);
5632        match tx_header.ordinal {
5633            _ => Err(fidl::Error::UnknownOrdinal {
5634                ordinal: tx_header.ordinal,
5635                protocol_name: <FrameMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5636            }),
5637        }
5638    }
5639}
5640
5641/// A Stream of incoming requests for fuchsia.web/Frame.
5642pub struct FrameRequestStream {
5643    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5644    is_terminated: bool,
5645}
5646
5647impl std::marker::Unpin for FrameRequestStream {}
5648
5649impl futures::stream::FusedStream for FrameRequestStream {
5650    fn is_terminated(&self) -> bool {
5651        self.is_terminated
5652    }
5653}
5654
5655impl fidl::endpoints::RequestStream for FrameRequestStream {
5656    type Protocol = FrameMarker;
5657    type ControlHandle = FrameControlHandle;
5658
5659    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5660        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5661    }
5662
5663    fn control_handle(&self) -> Self::ControlHandle {
5664        FrameControlHandle { inner: self.inner.clone() }
5665    }
5666
5667    fn into_inner(
5668        self,
5669    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5670    {
5671        (self.inner, self.is_terminated)
5672    }
5673
5674    fn from_inner(
5675        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5676        is_terminated: bool,
5677    ) -> Self {
5678        Self { inner, is_terminated }
5679    }
5680}
5681
5682impl futures::Stream for FrameRequestStream {
5683    type Item = Result<FrameRequest, fidl::Error>;
5684
5685    fn poll_next(
5686        mut self: std::pin::Pin<&mut Self>,
5687        cx: &mut std::task::Context<'_>,
5688    ) -> std::task::Poll<Option<Self::Item>> {
5689        let this = &mut *self;
5690        if this.inner.check_shutdown(cx) {
5691            this.is_terminated = true;
5692            return std::task::Poll::Ready(None);
5693        }
5694        if this.is_terminated {
5695            panic!("polled FrameRequestStream after completion");
5696        }
5697        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5698            |bytes, handles| {
5699                match this.inner.channel().read_etc(cx, bytes, handles) {
5700                    std::task::Poll::Ready(Ok(())) => {}
5701                    std::task::Poll::Pending => return std::task::Poll::Pending,
5702                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5703                        this.is_terminated = true;
5704                        return std::task::Poll::Ready(None);
5705                    }
5706                    std::task::Poll::Ready(Err(e)) => {
5707                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5708                            e.into(),
5709                        ))));
5710                    }
5711                }
5712
5713                // A message has been received from the channel
5714                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5715
5716                std::task::Poll::Ready(Some(match header.ordinal {
5717                    0x6a27859439133264 => {
5718                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5719                        let mut req = fidl::new_empty!(
5720                            FrameCreateViewRequest,
5721                            fidl::encoding::DefaultFuchsiaResourceDialect
5722                        );
5723                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameCreateViewRequest>(&header, _body_bytes, handles, &mut req)?;
5724                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5725                        Ok(FrameRequest::CreateView { view_token: req.view_token, control_handle })
5726                    }
5727                    0x1eb17ab2442326ac => {
5728                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5729                        let mut req = fidl::new_empty!(
5730                            FrameCreateViewWithViewRefRequest,
5731                            fidl::encoding::DefaultFuchsiaResourceDialect
5732                        );
5733                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameCreateViewWithViewRefRequest>(&header, _body_bytes, handles, &mut req)?;
5734                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5735                        Ok(FrameRequest::CreateViewWithViewRef {
5736                            view_token: req.view_token,
5737                            view_ref_control: req.view_ref_control,
5738                            view_ref: req.view_ref,
5739
5740                            control_handle,
5741                        })
5742                    }
5743                    0x1be7e9512962eb37 => {
5744                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5745                        let mut req = fidl::new_empty!(
5746                            FrameCreateView2Request,
5747                            fidl::encoding::DefaultFuchsiaResourceDialect
5748                        );
5749                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameCreateView2Request>(&header, _body_bytes, handles, &mut req)?;
5750                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5751                        Ok(FrameRequest::CreateView2 { args: req.args, control_handle })
5752                    }
5753                    0x72a81aaae7a80d2b => {
5754                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5755                        let mut req = fidl::new_empty!(
5756                            fidl::encoding::EmptyPayload,
5757                            fidl::encoding::DefaultFuchsiaResourceDialect
5758                        );
5759                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5760                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5761                        Ok(FrameRequest::EnableHeadlessRendering { control_handle })
5762                    }
5763                    0x5ca38a3d1f7f543a => {
5764                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5765                        let mut req = fidl::new_empty!(
5766                            fidl::encoding::EmptyPayload,
5767                            fidl::encoding::DefaultFuchsiaResourceDialect
5768                        );
5769                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5770                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5771                        Ok(FrameRequest::DisableHeadlessRendering { control_handle })
5772                    }
5773                    0xaafb639fc0b9eb9 => {
5774                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5775                        let mut req = fidl::new_empty!(
5776                            FrameGetMediaPlayerRequest,
5777                            fidl::encoding::DefaultFuchsiaResourceDialect
5778                        );
5779                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameGetMediaPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
5780                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5781                        Ok(FrameRequest::GetMediaPlayer { player: req.player, control_handle })
5782                    }
5783                    0x4521cfe95217a688 => {
5784                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5785                        let mut req = fidl::new_empty!(
5786                            FrameGetNavigationControllerRequest,
5787                            fidl::encoding::DefaultFuchsiaResourceDialect
5788                        );
5789                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameGetNavigationControllerRequest>(&header, _body_bytes, handles, &mut req)?;
5790                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5791                        Ok(FrameRequest::GetNavigationController {
5792                            controller: req.controller,
5793
5794                            control_handle,
5795                        })
5796                    }
5797                    0x79abdd4907000542 => {
5798                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5799                        let mut req = fidl::new_empty!(
5800                            FrameExecuteJavaScriptRequest,
5801                            fidl::encoding::DefaultFuchsiaResourceDialect
5802                        );
5803                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameExecuteJavaScriptRequest>(&header, _body_bytes, handles, &mut req)?;
5804                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5805                        Ok(FrameRequest::ExecuteJavaScript {
5806                            origins: req.origins,
5807                            script: req.script,
5808
5809                            responder: FrameExecuteJavaScriptResponder {
5810                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5811                                tx_id: header.tx_id,
5812                            },
5813                        })
5814                    }
5815                    0x16b8491520cbcd63 => {
5816                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5817                        let mut req = fidl::new_empty!(
5818                            FrameExecuteJavaScriptNoResultRequest,
5819                            fidl::encoding::DefaultFuchsiaResourceDialect
5820                        );
5821                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameExecuteJavaScriptNoResultRequest>(&header, _body_bytes, handles, &mut req)?;
5822                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5823                        Ok(FrameRequest::ExecuteJavaScriptNoResult {
5824                            origins: req.origins,
5825                            script: req.script,
5826
5827                            responder: FrameExecuteJavaScriptNoResultResponder {
5828                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5829                                tx_id: header.tx_id,
5830                            },
5831                        })
5832                    }
5833                    0x540ac0da59d823e => {
5834                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5835                        let mut req = fidl::new_empty!(
5836                            FrameAddBeforeLoadJavaScriptRequest,
5837                            fidl::encoding::DefaultFuchsiaResourceDialect
5838                        );
5839                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameAddBeforeLoadJavaScriptRequest>(&header, _body_bytes, handles, &mut req)?;
5840                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5841                        Ok(FrameRequest::AddBeforeLoadJavaScript {
5842                            id: req.id,
5843                            origins: req.origins,
5844                            script: req.script,
5845
5846                            responder: FrameAddBeforeLoadJavaScriptResponder {
5847                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5848                                tx_id: header.tx_id,
5849                            },
5850                        })
5851                    }
5852                    0x17d92b855b61d23a => {
5853                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5854                        let mut req = fidl::new_empty!(
5855                            FrameRemoveBeforeLoadJavaScriptRequest,
5856                            fidl::encoding::DefaultFuchsiaResourceDialect
5857                        );
5858                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameRemoveBeforeLoadJavaScriptRequest>(&header, _body_bytes, handles, &mut req)?;
5859                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5860                        Ok(FrameRequest::RemoveBeforeLoadJavaScript { id: req.id, control_handle })
5861                    }
5862                    0x751d686eb7caa341 => {
5863                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5864                        let mut req = fidl::new_empty!(
5865                            FramePostMessageRequest,
5866                            fidl::encoding::DefaultFuchsiaResourceDialect
5867                        );
5868                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FramePostMessageRequest>(&header, _body_bytes, handles, &mut req)?;
5869                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5870                        Ok(FrameRequest::PostMessage {
5871                            target_origin: req.target_origin,
5872                            message: req.message,
5873
5874                            responder: FramePostMessageResponder {
5875                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5876                                tx_id: header.tx_id,
5877                            },
5878                        })
5879                    }
5880                    0x965ba0fa20e0a56 => {
5881                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5882                        let mut req = fidl::new_empty!(
5883                            FrameSetNavigationEventListenerRequest,
5884                            fidl::encoding::DefaultFuchsiaResourceDialect
5885                        );
5886                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetNavigationEventListenerRequest>(&header, _body_bytes, handles, &mut req)?;
5887                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5888                        Ok(FrameRequest::SetNavigationEventListener {
5889                            listener: req.listener,
5890
5891                            control_handle,
5892                        })
5893                    }
5894                    0x5f8b40607f1f578f => {
5895                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5896                        let mut req = fidl::new_empty!(
5897                            FrameSetNavigationEventListener2Request,
5898                            fidl::encoding::DefaultFuchsiaResourceDialect
5899                        );
5900                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetNavigationEventListener2Request>(&header, _body_bytes, handles, &mut req)?;
5901                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5902                        Ok(FrameRequest::SetNavigationEventListener2 {
5903                            listener: req.listener,
5904                            flags: req.flags,
5905
5906                            control_handle,
5907                        })
5908                    }
5909                    0x74824b11a71c4b5b => {
5910                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5911                        let mut req = fidl::new_empty!(
5912                            FrameSetJavaScriptLogLevelRequest,
5913                            fidl::encoding::DefaultFuchsiaResourceDialect
5914                        );
5915                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetJavaScriptLogLevelRequest>(&header, _body_bytes, handles, &mut req)?;
5916                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5917                        Ok(FrameRequest::SetJavaScriptLogLevel { level: req.level, control_handle })
5918                    }
5919                    0x18f5cbc19fa4687b => {
5920                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5921                        let mut req = fidl::new_empty!(
5922                            FrameSetConsoleLogSinkRequest,
5923                            fidl::encoding::DefaultFuchsiaResourceDialect
5924                        );
5925                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetConsoleLogSinkRequest>(&header, _body_bytes, handles, &mut req)?;
5926                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5927                        Ok(FrameRequest::SetConsoleLogSink { sink: req.sink, control_handle })
5928                    }
5929                    0x38e08fe763c6bef6 => {
5930                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5931                        let mut req = fidl::new_empty!(
5932                            FrameConfigureInputTypesRequest,
5933                            fidl::encoding::DefaultFuchsiaResourceDialect
5934                        );
5935                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameConfigureInputTypesRequest>(&header, _body_bytes, handles, &mut req)?;
5936                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5937                        Ok(FrameRequest::ConfigureInputTypes {
5938                            types: req.types,
5939                            allow: req.allow,
5940
5941                            control_handle,
5942                        })
5943                    }
5944                    0x34ddec4e9f11e2aa => {
5945                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5946                        let mut req = fidl::new_empty!(
5947                            FrameSetPopupFrameCreationListenerRequest,
5948                            fidl::encoding::DefaultFuchsiaResourceDialect
5949                        );
5950                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetPopupFrameCreationListenerRequest>(&header, _body_bytes, handles, &mut req)?;
5951                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5952                        Ok(FrameRequest::SetPopupFrameCreationListener {
5953                            listener: req.listener,
5954
5955                            control_handle,
5956                        })
5957                    }
5958                    0x2e3f797350ab3281 => {
5959                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5960                        let mut req = fidl::new_empty!(
5961                            FrameSetUrlRequestRewriteRulesRequest,
5962                            fidl::encoding::DefaultFuchsiaResourceDialect
5963                        );
5964                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetUrlRequestRewriteRulesRequest>(&header, _body_bytes, handles, &mut req)?;
5965                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5966                        Ok(FrameRequest::SetUrlRequestRewriteRules {
5967                            rules: req.rules,
5968
5969                            responder: FrameSetUrlRequestRewriteRulesResponder {
5970                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5971                                tx_id: header.tx_id,
5972                            },
5973                        })
5974                    }
5975                    0x7da879b6d284c143 => {
5976                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5977                        let mut req = fidl::new_empty!(
5978                            FrameSetMediaSettingsRequest,
5979                            fidl::encoding::DefaultFuchsiaResourceDialect
5980                        );
5981                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetMediaSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
5982                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5983                        Ok(FrameRequest::SetMediaSettings {
5984                            settings: req.settings,
5985
5986                            control_handle,
5987                        })
5988                    }
5989                    0x8c7024c7149c901 => {
5990                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5991                        let mut req = fidl::new_empty!(
5992                            FrameForceContentDimensionsRequest,
5993                            fidl::encoding::DefaultFuchsiaResourceDialect
5994                        );
5995                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameForceContentDimensionsRequest>(&header, _body_bytes, handles, &mut req)?;
5996                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
5997                        Ok(FrameRequest::ForceContentDimensions {
5998                            web_dips: req.web_dips,
5999
6000                            control_handle,
6001                        })
6002                    }
6003                    0x19574e92a7033f4f => {
6004                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6005                        let mut req = fidl::new_empty!(
6006                            FrameSetPermissionStateRequest,
6007                            fidl::encoding::DefaultFuchsiaResourceDialect
6008                        );
6009                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetPermissionStateRequest>(&header, _body_bytes, handles, &mut req)?;
6010                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
6011                        Ok(FrameRequest::SetPermissionState {
6012                            permission: req.permission,
6013                            web_origin: req.web_origin,
6014                            state: req.state,
6015
6016                            control_handle,
6017                        })
6018                    }
6019                    0x211071458fc9cf4f => {
6020                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6021                        let mut req = fidl::new_empty!(
6022                            FrameSetBlockMediaLoadingRequest,
6023                            fidl::encoding::DefaultFuchsiaResourceDialect
6024                        );
6025                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetBlockMediaLoadingRequest>(&header, _body_bytes, handles, &mut req)?;
6026                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
6027                        Ok(FrameRequest::SetBlockMediaLoading {
6028                            blocked: req.blocked,
6029
6030                            control_handle,
6031                        })
6032                    }
6033                    0x6ad4d43da6c129b0 => {
6034                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6035                        let mut req = fidl::new_empty!(
6036                            fidl::encoding::EmptyPayload,
6037                            fidl::encoding::DefaultFuchsiaResourceDialect
6038                        );
6039                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6040                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
6041                        Ok(FrameRequest::GetPrivateMemorySize {
6042                            responder: FrameGetPrivateMemorySizeResponder {
6043                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6044                                tx_id: header.tx_id,
6045                            },
6046                        })
6047                    }
6048                    0x602ce35195d66654 => {
6049                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6050                        let mut req = fidl::new_empty!(
6051                            FrameSetNavigationPolicyProviderRequest,
6052                            fidl::encoding::DefaultFuchsiaResourceDialect
6053                        );
6054                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetNavigationPolicyProviderRequest>(&header, _body_bytes, handles, &mut req)?;
6055                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
6056                        Ok(FrameRequest::SetNavigationPolicyProvider {
6057                            params: req.params,
6058                            provider: req.provider,
6059
6060                            control_handle,
6061                        })
6062                    }
6063                    0x851f4de50c3c27e => {
6064                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6065                        let mut req = fidl::new_empty!(
6066                            FrameSetContentAreaSettingsRequest,
6067                            fidl::encoding::DefaultFuchsiaResourceDialect
6068                        );
6069                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameSetContentAreaSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
6070                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
6071                        Ok(FrameRequest::SetContentAreaSettings {
6072                            settings: req.settings,
6073
6074                            control_handle,
6075                        })
6076                    }
6077                    0x6807e04f16f8ee5d => {
6078                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6079                        let mut req = fidl::new_empty!(
6080                            fidl::encoding::EmptyPayload,
6081                            fidl::encoding::DefaultFuchsiaResourceDialect
6082                        );
6083                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6084                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
6085                        Ok(FrameRequest::ResetContentAreaSettings { control_handle })
6086                    }
6087                    0x442e84138e65351 => {
6088                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6089                        let mut req = fidl::new_empty!(
6090                            FrameCloseRequest,
6091                            fidl::encoding::DefaultFuchsiaResourceDialect
6092                        );
6093                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameCloseRequest>(&header, _body_bytes, handles, &mut req)?;
6094                        let control_handle = FrameControlHandle { inner: this.inner.clone() };
6095                        Ok(FrameRequest::Close { payload: req, control_handle })
6096                    }
6097                    _ => Err(fidl::Error::UnknownOrdinal {
6098                        ordinal: header.ordinal,
6099                        protocol_name: <FrameMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6100                    }),
6101                }))
6102            },
6103        )
6104    }
6105}
6106
6107#[derive(Debug)]
6108pub enum FrameRequest {
6109    /// Creates a new view using the specified `view_token`. Caller should pass the other end of
6110    /// the token to [`fuchsia.ui.gfx/ViewHolderArgs`] to attach the new view to a view tree.
6111    ///
6112    /// See the description of [`CreateContextParams.service_directory`] for additional services
6113    /// that must be present when using this method.
6114    CreateView { view_token: fidl_fuchsia_ui_views::ViewToken, control_handle: FrameControlHandle },
6115    /// Creates a new view using the specified `view_token`. Caller should pass the other end of
6116    /// the token to [`fuchsia.ui.gfx/ViewHolderArgs`] to attach the new view to a view tree.
6117    /// `view_ref` can be cloned before passing it to this method, which will allow clients to
6118    /// track the view.
6119    ///
6120    /// `view_ref_control` must not have the `ZX_RIGHT_DUPLICATE` set, or view creation will fail
6121    /// and `view_token` will be closed.
6122    ///
6123    /// See the description of [`CreateContextParams.service_directory`] for additional services
6124    /// that must be present when using this method.
6125    CreateViewWithViewRef {
6126        view_token: fidl_fuchsia_ui_views::ViewToken,
6127        view_ref_control: fidl_fuchsia_ui_views::ViewRefControl,
6128        view_ref: fidl_fuchsia_ui_views::ViewRef,
6129        control_handle: FrameControlHandle,
6130    },
6131    /// Creates a new Flatland view using the specified `view_creation_token` defined under `args`.
6132    /// Caller should pass the other end of the token to
6133    /// [`fuchsia.ui.composition/Flatland.CreateViewport`] to attach the new Flatland view to its
6134    /// graph.
6135    CreateView2 { args: CreateView2Args, control_handle: FrameControlHandle },
6136    /// Enables headless rendering of the Frame.
6137    ///
6138    /// This is used when content depends on layout and/or animation events firing normally.
6139    /// May only be used on a Context created with [`ContextFeatureFlags.HEADLESS`].
6140    EnableHeadlessRendering { control_handle: FrameControlHandle },
6141    /// Stops headless rendering of the Frame.
6142    ///
6143    /// May only be used on a Context created with [`ContextFeatureFlags.HEADLESS`].
6144    DisableHeadlessRendering { control_handle: FrameControlHandle },
6145    /// Returns a [`fuchsia.media.sessions2/Player`] interface through which media (i.e.
6146    /// video/audio) playback in the frame may be observed, and/or controlled. Only one
6147    /// [`fuchsia.media.sessions2/Player`] may be active at a time, for each [`Frame`].
6148    GetMediaPlayer {
6149        player: fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
6150        control_handle: FrameControlHandle,
6151    },
6152    /// Returns an interface through which the [`Frame`] may be navigated to a desired URL,
6153    /// reloaded, etc.
6154    ///
6155    /// - `controller`: An asynchronous interface request for the [`Frame`]'s
6156    ///   [`NavigationController`].
6157    GetNavigationController {
6158        controller: fidl::endpoints::ServerEnd<NavigationControllerMarker>,
6159        control_handle: FrameControlHandle,
6160    },
6161    /// Executes a UTF-8 encoded `script` in the [`Frame`] if the [`Frame`]'s URL has an origin
6162    /// which matches entries in `origins`.
6163    ///
6164    /// At least one `origins` entry must be specified. If a wildcard `"*"` is specified in
6165    /// `origins`, then the script will be evaluated unconditionally.
6166    ///
6167    /// Returns the result of executing `script`, as a JSON-encoded string.
6168    ///
6169    /// Note that scripts share the same execution context as the document,
6170    /// meaning that document may modify variables, classes, or objects set by
6171    /// the script in arbitrary or unpredictable ways.
6172    ///
6173    /// If an error occurred, the FrameError will be set to one of these values:
6174    /// - `BUFFER_NOT_UTF8`: `script` is not UTF-8 encoded.
6175    /// - `INVALID_ORIGIN`: The [`Frame`]'s current URL does not match any of the values in
6176    ///   `origins` or `origins` is an empty vector.
6177    ExecuteJavaScript {
6178        origins: Vec<String>,
6179        script: fidl_fuchsia_mem::Buffer,
6180        responder: FrameExecuteJavaScriptResponder,
6181    },
6182    /// Variant of [`Frame.ExecuteJavaScript`] which executes the supplied script without returning
6183    /// a result.
6184    ExecuteJavaScriptNoResult {
6185        origins: Vec<String>,
6186        script: fidl_fuchsia_mem::Buffer,
6187        responder: FrameExecuteJavaScriptNoResultResponder,
6188    },
6189    /// Executes a UTF-8 encoded `script` for every subsequent page load where the [`Frame`]'s URL
6190    /// has an origin reflected in `origins`. The script is executed early, prior to the execution
6191    /// of the document's scripts.
6192    ///
6193    /// Scripts are identified by a client-managed identifier `id`. Any script previously injected
6194    /// using the same `id` will be replaced.
6195    ///
6196    /// The order in which multiple bindings are executed is the same as the order in which the
6197    /// bindings were added. If a script is added which clobbers an existing script of the same
6198    /// `id`, the previous script's precedence in the injection order will be preserved.
6199    ///
6200    /// At least one `origins` entry must be specified. If a wildcard `"*"` is specified in
6201    /// `origins`, then the script will be evaluated unconditionally.
6202    ///
6203    /// If an error occurred, the [`FrameError`] will be set to one of these values:
6204    /// - `BUFFER_NOT_UTF8`: `script` is not UTF-8 encoded.
6205    /// - `INVALID_ORIGIN`: `origins` is an empty vector.
6206    AddBeforeLoadJavaScript {
6207        id: u64,
6208        origins: Vec<String>,
6209        script: fidl_fuchsia_mem::Buffer,
6210        responder: FrameAddBeforeLoadJavaScriptResponder,
6211    },
6212    /// Removes a previously added JavaScript snippet identified by `id`. This is a no-op if there
6213    /// is no JavaScript snippet identified by `id`.
6214    RemoveBeforeLoadJavaScript { id: u64, control_handle: FrameControlHandle },
6215    /// Posts a message to the frame's onMessage handler.
6216    ///
6217    /// `target_origin` restricts message delivery to the specified origin. If `target_origin` is
6218    /// `"*"`, then the message will be sent to the document regardless of its origin.
6219    /// See the
6220    /// [HTML spec](https://html.spec.whatwg.org/multipage/web-messaging.html#posting-messages)
6221    /// section 9.4.3 for more details on how the target origin policy is applied.
6222    ///
6223    /// If an error occurred, the [`FrameError`] will be set to one of these values:
6224    /// - `INTERNAL_ERROR`: The WebEngine failed to create a message pipe.
6225    /// - `BUFFER_NOT_UTF8`: The script in `message`'s `data` property is not UTF-8 encoded.
6226    /// - `INVALID_ORIGIN`: `origins` is an empty vector.
6227    /// - `NO_DATA_IN_MESSAGE`: The `data` property is missing in `message`.
6228    PostMessage { target_origin: String, message: WebMessage, responder: FramePostMessageResponder },
6229    /// Sets the listener for handling page navigation events.
6230    ///
6231    /// - `listener`: The observer to use. Unregisters any existing listener if null.
6232    SetNavigationEventListener {
6233        listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
6234        control_handle: FrameControlHandle,
6235    },
6236    /// Sets the listener for handling page navigation events. The listener will receive the
6237    /// current navigation state immediately. After that, it's notified whenever the state changes.
6238    ///
6239    /// - `listener`: The observer to use. Unregisters any existing listener if null.
6240    /// - `flags`: Flags for optional features that should be enabled for the listener.
6241    SetNavigationEventListener2 {
6242        listener: Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
6243        flags: NavigationEventListenerFlags,
6244        control_handle: FrameControlHandle,
6245    },
6246    /// If set to a value other than [`ConsoleLogLevel.NONE`], allows web content to log messages
6247    /// to the [`fuchsia.logger/LogSink`] configured for this [`Frame`], via the
6248    /// `console` object (e.g. using `debug()`, `log()`, `info()`, `warn()` and
6249    /// `error()`).
6250    /// The default value is [`ConsoleLogLevel.NONE`].
6251    ///
6252    /// As the system log may be persisted, it is recommended that [`ConsoleLogLevel.NONE`] be used
6253    /// in Incognito and other private browsing modes.
6254    ///
6255    /// Log lines are written to the [`fuchsia.logger/LogsSink`] configured
6256    /// for this [`fuchsia.web/Frame`], with severities mapped as follows:
6257    /// - `debug()`, `log()` and `info()` are logged at [`fuchsia.logger/LogLevelFilter.INFO`]
6258    ///   severity.
6259    /// - `warn()` is logged at [`fuchsia.logger/LogLevelFilter.WARN`] severity.
6260    /// - `error()` is logged at [`fuchsia.logger/LogLevelFilter.ERROR`] severity.
6261    SetJavaScriptLogLevel { level: ConsoleLogLevel, control_handle: FrameControlHandle },
6262    /// Specifies where to emit `console` log output to. By default log output will be routed to a
6263    /// [`fuchsia.logger/LogSink`] obtained via the [`fuchsia.web/Context`]'s service directory.
6264    ///
6265    /// - `sink`: The [`fuchsia.logger/LogSink`] to use to emit logs. Passing a `null` handle
6266    ///   resets logging to use the default [`fuchsia.logger/LogSink`].
6267    SetConsoleLogSink {
6268        sink: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
6269        control_handle: FrameControlHandle,
6270    },
6271    /// Enables or disables the processing of the specified `types` of user inputs.
6272    /// `allow` specifies whether to enable or disable the specified `types`.
6273    /// All input types are enabled by default.
6274    ConfigureInputTypes {
6275        types: InputTypes,
6276        allow: AllowInputState,
6277        control_handle: FrameControlHandle,
6278    },
6279    /// Sets the listener for handling popup frame opened by web content. If no listener is
6280    /// present, then any new popup frame will be blocked.
6281    ///
6282    /// - `listener`: The listener to use. Unregisters any existing listener if null.
6283    SetPopupFrameCreationListener {
6284        listener: Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
6285        control_handle: FrameControlHandle,
6286    },
6287    /// Supplies a set of [`UrlRequestRewriteRule`] to apply on every subsequent URL request.
6288    /// - `rules` are cumulative and applied in order.
6289    /// - `rules` are only applied on the first URL request in a redirect chain.
6290    /// - `rules` will be validated before being applied. If `rules` are invalid, the [`Frame`]
6291    ///   will be closed with `ERR_INVALID_ARGS`.
6292    /// - [`Frame.SetUrlRequestRewriteRules`] must not be called again until its acknowledgement
6293    ///   callback has been processed. If this happens, the [`Frame`] will be closed with
6294    ///   `ERR_BAD_STATE`.
6295    SetUrlRequestRewriteRules {
6296        rules: Vec<UrlRequestRewriteRule>,
6297        responder: FrameSetUrlRequestRewriteRulesResponder,
6298    },
6299    /// Sets [`fuchsia.media/FrameMediaSettings`] for the frame. The specified parameters are
6300    /// applied to audio streams that started after this message is processed. Should be called
6301    /// before the Frame is navigated to content in order to ensure that the settings applied to
6302    /// all media streams. Due to request pipelining, this means doing so before calling
6303    /// [`Frame.GetNavigationController()`] and [`NavigationController.LoadUrl()`].
6304    SetMediaSettings { settings: FrameMediaSettings, control_handle: FrameControlHandle },
6305    /// Overrides the dimensions reported to web content. The devicePixelRatio reported to
6306    /// web content will be adjusted in response to changes in the pixel size of the View,
6307    /// rather than changing the size reported to the content. Call with null `web_dips` to
6308    /// remove any prior forced content dimensions.
6309    ForceContentDimensions {
6310        web_dips: Option<Box<fidl_fuchsia_ui_gfx::Vec2>>,
6311        control_handle: FrameControlHandle,
6312    },
6313    /// Sets the permission state for the specified `permission` and `web_origin`. By default, all
6314    /// permissions are denied.
6315    SetPermissionState {
6316        permission: PermissionDescriptor,
6317        web_origin: String,
6318        state: PermissionState,
6319        control_handle: FrameControlHandle,
6320    },
6321    /// Sets whether to block all HTMLMediaElements in the frame from fetching and loading media
6322    /// resources.
6323    ///
6324    /// May be used, for example, to prevent loading media in frames that are not visible.
6325    ///
6326    /// While media loading is blocked, elements with `autoplay` set to `true` will not start
6327    /// playback. The promises returned by calls to `play()` will remain unresolved until loading is
6328    /// unblocked by a call to this method.
6329    ///
6330    /// When media loading is unblocked, elements will begin fetching, resource, loading, and
6331    /// playing as appropriate.
6332    ///
6333    /// Any elements that have begun fetching or loading media resources for the current source
6334    /// before media loading was blocked will continue to fetch, load, and start playback as
6335    /// appropriate. This includes calls to `play()` even after media loading is blocked.
6336    SetBlockMediaLoading { blocked: bool, control_handle: FrameControlHandle },
6337    /// Returns the amount of private (non-shared) physical memory used by the Frame's main
6338    /// document. The returned size might not reflect the memory usage of embedded iframes.
6339    GetPrivateMemorySize { responder: FrameGetPrivateMemorySizeResponder },
6340    /// Sets the navigation policy provider for the [`Frame`]. When set, the [`Frame`] sends
6341    /// [`NavigationPolicyProvider.EvaluateRequestedNavigation`] when processing navigation
6342    /// requests. `params` defines when the message is sent. After sending the
6343    /// `EvaluateRequestedNavigation` message, the [`Frame`] blocks the corresponding navigation
6344    /// until it receives a response.
6345    ///
6346    /// Should be called before `GetNavigationController` to ensure that it is applied to all
6347    /// navigations including the first [`NavigationController.LoadURL`] request.
6348    SetNavigationPolicyProvider {
6349        params: NavigationPolicyProviderParams,
6350        provider: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
6351        control_handle: FrameControlHandle,
6352    },
6353    /// Sets various settings for how web content should be run in the Frame. May be called at any
6354    /// time, including after the URL has loaded. Each call changes only the specified fields,
6355    /// overwriting any prior value.
6356    ///
6357    /// This method will fail with `ZX_ERR_NOT_SUPPORTED` if any value in [`ContentAreaSettings`]
6358    /// is not supported by the Frame.
6359    SetContentAreaSettings { settings: ContentAreaSettings, control_handle: FrameControlHandle },
6360    /// Reset the Frame's [`ContentAreaSettings`] to default values.
6361    ResetContentAreaSettings { control_handle: FrameControlHandle },
6362    /// Request graceful or immediate teardown of the Frame content and notification of completion
6363    /// via Frame epitaph.
6364    ///
6365    /// Graceful teardown allows unload and cleanup tasks in the implementation and web content
6366    /// (e.g., `unload` event handlers) to run for up to the specified period of time. Immediate
6367    /// teardown only runs the minimum cleanup tasks in the implementation and does not allow web
6368    /// content to run event handlers.
6369    ///
6370    /// * If `timeout` is zero, an immediate teardown is initiated. The channel will close with
6371    ///   `ZX_OK`. This is equivalent to the caller closing the Frame channel.
6372    ///
6373    /// * If `timeout` is non-zero, a graceful teardown is initiated. The channel will close with
6374    ///   `ZX_OK` if the Frame closes within the specified `timeout` and with `ZX_ERR_TIMED_OUT`
6375    ///   otherwise.
6376    ///
6377    /// * If `timeout` is not specified, a reasonable implementation-specific timeout is applied.
6378    ///
6379    /// Subsequent calls to `Close()` will override any previously specified `Close()` timeout.
6380    Close { payload: FrameCloseRequest, control_handle: FrameControlHandle },
6381}
6382
6383impl FrameRequest {
6384    #[allow(irrefutable_let_patterns)]
6385    pub fn into_create_view(
6386        self,
6387    ) -> Option<(fidl_fuchsia_ui_views::ViewToken, FrameControlHandle)> {
6388        if let FrameRequest::CreateView { view_token, control_handle } = self {
6389            Some((view_token, control_handle))
6390        } else {
6391            None
6392        }
6393    }
6394
6395    #[allow(irrefutable_let_patterns)]
6396    pub fn into_create_view_with_view_ref(
6397        self,
6398    ) -> Option<(
6399        fidl_fuchsia_ui_views::ViewToken,
6400        fidl_fuchsia_ui_views::ViewRefControl,
6401        fidl_fuchsia_ui_views::ViewRef,
6402        FrameControlHandle,
6403    )> {
6404        if let FrameRequest::CreateViewWithViewRef {
6405            view_token,
6406            view_ref_control,
6407            view_ref,
6408            control_handle,
6409        } = self
6410        {
6411            Some((view_token, view_ref_control, view_ref, control_handle))
6412        } else {
6413            None
6414        }
6415    }
6416
6417    #[allow(irrefutable_let_patterns)]
6418    pub fn into_create_view2(self) -> Option<(CreateView2Args, FrameControlHandle)> {
6419        if let FrameRequest::CreateView2 { args, control_handle } = self {
6420            Some((args, control_handle))
6421        } else {
6422            None
6423        }
6424    }
6425
6426    #[allow(irrefutable_let_patterns)]
6427    pub fn into_enable_headless_rendering(self) -> Option<(FrameControlHandle)> {
6428        if let FrameRequest::EnableHeadlessRendering { control_handle } = self {
6429            Some((control_handle))
6430        } else {
6431            None
6432        }
6433    }
6434
6435    #[allow(irrefutable_let_patterns)]
6436    pub fn into_disable_headless_rendering(self) -> Option<(FrameControlHandle)> {
6437        if let FrameRequest::DisableHeadlessRendering { control_handle } = self {
6438            Some((control_handle))
6439        } else {
6440            None
6441        }
6442    }
6443
6444    #[allow(irrefutable_let_patterns)]
6445    pub fn into_get_media_player(
6446        self,
6447    ) -> Option<(
6448        fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
6449        FrameControlHandle,
6450    )> {
6451        if let FrameRequest::GetMediaPlayer { player, control_handle } = self {
6452            Some((player, control_handle))
6453        } else {
6454            None
6455        }
6456    }
6457
6458    #[allow(irrefutable_let_patterns)]
6459    pub fn into_get_navigation_controller(
6460        self,
6461    ) -> Option<(fidl::endpoints::ServerEnd<NavigationControllerMarker>, FrameControlHandle)> {
6462        if let FrameRequest::GetNavigationController { controller, control_handle } = self {
6463            Some((controller, control_handle))
6464        } else {
6465            None
6466        }
6467    }
6468
6469    #[allow(irrefutable_let_patterns)]
6470    pub fn into_execute_java_script(
6471        self,
6472    ) -> Option<(Vec<String>, fidl_fuchsia_mem::Buffer, FrameExecuteJavaScriptResponder)> {
6473        if let FrameRequest::ExecuteJavaScript { origins, script, responder } = self {
6474            Some((origins, script, responder))
6475        } else {
6476            None
6477        }
6478    }
6479
6480    #[allow(irrefutable_let_patterns)]
6481    pub fn into_execute_java_script_no_result(
6482        self,
6483    ) -> Option<(Vec<String>, fidl_fuchsia_mem::Buffer, FrameExecuteJavaScriptNoResultResponder)>
6484    {
6485        if let FrameRequest::ExecuteJavaScriptNoResult { origins, script, responder } = self {
6486            Some((origins, script, responder))
6487        } else {
6488            None
6489        }
6490    }
6491
6492    #[allow(irrefutable_let_patterns)]
6493    pub fn into_add_before_load_java_script(
6494        self,
6495    ) -> Option<(u64, Vec<String>, fidl_fuchsia_mem::Buffer, FrameAddBeforeLoadJavaScriptResponder)>
6496    {
6497        if let FrameRequest::AddBeforeLoadJavaScript { id, origins, script, responder } = self {
6498            Some((id, origins, script, responder))
6499        } else {
6500            None
6501        }
6502    }
6503
6504    #[allow(irrefutable_let_patterns)]
6505    pub fn into_remove_before_load_java_script(self) -> Option<(u64, FrameControlHandle)> {
6506        if let FrameRequest::RemoveBeforeLoadJavaScript { id, control_handle } = self {
6507            Some((id, control_handle))
6508        } else {
6509            None
6510        }
6511    }
6512
6513    #[allow(irrefutable_let_patterns)]
6514    pub fn into_post_message(self) -> Option<(String, WebMessage, FramePostMessageResponder)> {
6515        if let FrameRequest::PostMessage { target_origin, message, responder } = self {
6516            Some((target_origin, message, responder))
6517        } else {
6518            None
6519        }
6520    }
6521
6522    #[allow(irrefutable_let_patterns)]
6523    pub fn into_set_navigation_event_listener(
6524        self,
6525    ) -> Option<(
6526        Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
6527        FrameControlHandle,
6528    )> {
6529        if let FrameRequest::SetNavigationEventListener { listener, control_handle } = self {
6530            Some((listener, control_handle))
6531        } else {
6532            None
6533        }
6534    }
6535
6536    #[allow(irrefutable_let_patterns)]
6537    pub fn into_set_navigation_event_listener2(
6538        self,
6539    ) -> Option<(
6540        Option<fidl::endpoints::ClientEnd<NavigationEventListenerMarker>>,
6541        NavigationEventListenerFlags,
6542        FrameControlHandle,
6543    )> {
6544        if let FrameRequest::SetNavigationEventListener2 { listener, flags, control_handle } = self
6545        {
6546            Some((listener, flags, control_handle))
6547        } else {
6548            None
6549        }
6550    }
6551
6552    #[allow(irrefutable_let_patterns)]
6553    pub fn into_set_java_script_log_level(self) -> Option<(ConsoleLogLevel, FrameControlHandle)> {
6554        if let FrameRequest::SetJavaScriptLogLevel { level, control_handle } = self {
6555            Some((level, control_handle))
6556        } else {
6557            None
6558        }
6559    }
6560
6561    #[allow(irrefutable_let_patterns)]
6562    pub fn into_set_console_log_sink(
6563        self,
6564    ) -> Option<(
6565        Option<fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>>,
6566        FrameControlHandle,
6567    )> {
6568        if let FrameRequest::SetConsoleLogSink { sink, control_handle } = self {
6569            Some((sink, control_handle))
6570        } else {
6571            None
6572        }
6573    }
6574
6575    #[allow(irrefutable_let_patterns)]
6576    pub fn into_configure_input_types(
6577        self,
6578    ) -> Option<(InputTypes, AllowInputState, FrameControlHandle)> {
6579        if let FrameRequest::ConfigureInputTypes { types, allow, control_handle } = self {
6580            Some((types, allow, control_handle))
6581        } else {
6582            None
6583        }
6584    }
6585
6586    #[allow(irrefutable_let_patterns)]
6587    pub fn into_set_popup_frame_creation_listener(
6588        self,
6589    ) -> Option<(
6590        Option<fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>>,
6591        FrameControlHandle,
6592    )> {
6593        if let FrameRequest::SetPopupFrameCreationListener { listener, control_handle } = self {
6594            Some((listener, control_handle))
6595        } else {
6596            None
6597        }
6598    }
6599
6600    #[allow(irrefutable_let_patterns)]
6601    pub fn into_set_url_request_rewrite_rules(
6602        self,
6603    ) -> Option<(Vec<UrlRequestRewriteRule>, FrameSetUrlRequestRewriteRulesResponder)> {
6604        if let FrameRequest::SetUrlRequestRewriteRules { rules, responder } = self {
6605            Some((rules, responder))
6606        } else {
6607            None
6608        }
6609    }
6610
6611    #[allow(irrefutable_let_patterns)]
6612    pub fn into_set_media_settings(self) -> Option<(FrameMediaSettings, FrameControlHandle)> {
6613        if let FrameRequest::SetMediaSettings { settings, control_handle } = self {
6614            Some((settings, control_handle))
6615        } else {
6616            None
6617        }
6618    }
6619
6620    #[allow(irrefutable_let_patterns)]
6621    pub fn into_force_content_dimensions(
6622        self,
6623    ) -> Option<(Option<Box<fidl_fuchsia_ui_gfx::Vec2>>, FrameControlHandle)> {
6624        if let FrameRequest::ForceContentDimensions { web_dips, control_handle } = self {
6625            Some((web_dips, control_handle))
6626        } else {
6627            None
6628        }
6629    }
6630
6631    #[allow(irrefutable_let_patterns)]
6632    pub fn into_set_permission_state(
6633        self,
6634    ) -> Option<(PermissionDescriptor, String, PermissionState, FrameControlHandle)> {
6635        if let FrameRequest::SetPermissionState { permission, web_origin, state, control_handle } =
6636            self
6637        {
6638            Some((permission, web_origin, state, control_handle))
6639        } else {
6640            None
6641        }
6642    }
6643
6644    #[allow(irrefutable_let_patterns)]
6645    pub fn into_set_block_media_loading(self) -> Option<(bool, FrameControlHandle)> {
6646        if let FrameRequest::SetBlockMediaLoading { blocked, control_handle } = self {
6647            Some((blocked, control_handle))
6648        } else {
6649            None
6650        }
6651    }
6652
6653    #[allow(irrefutable_let_patterns)]
6654    pub fn into_get_private_memory_size(self) -> Option<(FrameGetPrivateMemorySizeResponder)> {
6655        if let FrameRequest::GetPrivateMemorySize { responder } = self {
6656            Some((responder))
6657        } else {
6658            None
6659        }
6660    }
6661
6662    #[allow(irrefutable_let_patterns)]
6663    pub fn into_set_navigation_policy_provider(
6664        self,
6665    ) -> Option<(
6666        NavigationPolicyProviderParams,
6667        fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
6668        FrameControlHandle,
6669    )> {
6670        if let FrameRequest::SetNavigationPolicyProvider { params, provider, control_handle } = self
6671        {
6672            Some((params, provider, control_handle))
6673        } else {
6674            None
6675        }
6676    }
6677
6678    #[allow(irrefutable_let_patterns)]
6679    pub fn into_set_content_area_settings(
6680        self,
6681    ) -> Option<(ContentAreaSettings, FrameControlHandle)> {
6682        if let FrameRequest::SetContentAreaSettings { settings, control_handle } = self {
6683            Some((settings, control_handle))
6684        } else {
6685            None
6686        }
6687    }
6688
6689    #[allow(irrefutable_let_patterns)]
6690    pub fn into_reset_content_area_settings(self) -> Option<(FrameControlHandle)> {
6691        if let FrameRequest::ResetContentAreaSettings { control_handle } = self {
6692            Some((control_handle))
6693        } else {
6694            None
6695        }
6696    }
6697
6698    #[allow(irrefutable_let_patterns)]
6699    pub fn into_close(self) -> Option<(FrameCloseRequest, FrameControlHandle)> {
6700        if let FrameRequest::Close { payload, control_handle } = self {
6701            Some((payload, control_handle))
6702        } else {
6703            None
6704        }
6705    }
6706
6707    /// Name of the method defined in FIDL
6708    pub fn method_name(&self) -> &'static str {
6709        match *self {
6710            FrameRequest::CreateView { .. } => "create_view",
6711            FrameRequest::CreateViewWithViewRef { .. } => "create_view_with_view_ref",
6712            FrameRequest::CreateView2 { .. } => "create_view2",
6713            FrameRequest::EnableHeadlessRendering { .. } => "enable_headless_rendering",
6714            FrameRequest::DisableHeadlessRendering { .. } => "disable_headless_rendering",
6715            FrameRequest::GetMediaPlayer { .. } => "get_media_player",
6716            FrameRequest::GetNavigationController { .. } => "get_navigation_controller",
6717            FrameRequest::ExecuteJavaScript { .. } => "execute_java_script",
6718            FrameRequest::ExecuteJavaScriptNoResult { .. } => "execute_java_script_no_result",
6719            FrameRequest::AddBeforeLoadJavaScript { .. } => "add_before_load_java_script",
6720            FrameRequest::RemoveBeforeLoadJavaScript { .. } => "remove_before_load_java_script",
6721            FrameRequest::PostMessage { .. } => "post_message",
6722            FrameRequest::SetNavigationEventListener { .. } => "set_navigation_event_listener",
6723            FrameRequest::SetNavigationEventListener2 { .. } => "set_navigation_event_listener2",
6724            FrameRequest::SetJavaScriptLogLevel { .. } => "set_java_script_log_level",
6725            FrameRequest::SetConsoleLogSink { .. } => "set_console_log_sink",
6726            FrameRequest::ConfigureInputTypes { .. } => "configure_input_types",
6727            FrameRequest::SetPopupFrameCreationListener { .. } => {
6728                "set_popup_frame_creation_listener"
6729            }
6730            FrameRequest::SetUrlRequestRewriteRules { .. } => "set_url_request_rewrite_rules",
6731            FrameRequest::SetMediaSettings { .. } => "set_media_settings",
6732            FrameRequest::ForceContentDimensions { .. } => "force_content_dimensions",
6733            FrameRequest::SetPermissionState { .. } => "set_permission_state",
6734            FrameRequest::SetBlockMediaLoading { .. } => "set_block_media_loading",
6735            FrameRequest::GetPrivateMemorySize { .. } => "get_private_memory_size",
6736            FrameRequest::SetNavigationPolicyProvider { .. } => "set_navigation_policy_provider",
6737            FrameRequest::SetContentAreaSettings { .. } => "set_content_area_settings",
6738            FrameRequest::ResetContentAreaSettings { .. } => "reset_content_area_settings",
6739            FrameRequest::Close { .. } => "close",
6740        }
6741    }
6742}
6743
6744#[derive(Debug, Clone)]
6745pub struct FrameControlHandle {
6746    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6747}
6748
6749impl FrameControlHandle {
6750    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6751        self.inner.shutdown_with_epitaph(status.into())
6752    }
6753}
6754
6755impl fidl::endpoints::ControlHandle for FrameControlHandle {
6756    fn shutdown(&self) {
6757        self.inner.shutdown()
6758    }
6759
6760    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6761        self.inner.shutdown_with_epitaph(status)
6762    }
6763
6764    fn is_closed(&self) -> bool {
6765        self.inner.channel().is_closed()
6766    }
6767    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6768        self.inner.channel().on_closed()
6769    }
6770
6771    #[cfg(target_os = "fuchsia")]
6772    fn signal_peer(
6773        &self,
6774        clear_mask: zx::Signals,
6775        set_mask: zx::Signals,
6776    ) -> Result<(), zx_status::Status> {
6777        use fidl::Peered;
6778        self.inner.channel().signal_peer(clear_mask, set_mask)
6779    }
6780}
6781
6782impl FrameControlHandle {}
6783
6784#[must_use = "FIDL methods require a response to be sent"]
6785#[derive(Debug)]
6786pub struct FrameExecuteJavaScriptResponder {
6787    control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6788    tx_id: u32,
6789}
6790
6791/// Set the the channel to be shutdown (see [`FrameControlHandle::shutdown`])
6792/// if the responder is dropped without sending a response, so that the client
6793/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6794impl std::ops::Drop for FrameExecuteJavaScriptResponder {
6795    fn drop(&mut self) {
6796        self.control_handle.shutdown();
6797        // Safety: drops once, never accessed again
6798        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6799    }
6800}
6801
6802impl fidl::endpoints::Responder for FrameExecuteJavaScriptResponder {
6803    type ControlHandle = FrameControlHandle;
6804
6805    fn control_handle(&self) -> &FrameControlHandle {
6806        &self.control_handle
6807    }
6808
6809    fn drop_without_shutdown(mut self) {
6810        // Safety: drops once, never accessed again due to mem::forget
6811        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6812        // Prevent Drop from running (which would shut down the channel)
6813        std::mem::forget(self);
6814    }
6815}
6816
6817impl FrameExecuteJavaScriptResponder {
6818    /// Sends a response to the FIDL transaction.
6819    ///
6820    /// Sets the channel to shutdown if an error occurs.
6821    pub fn send(
6822        self,
6823        mut result: Result<fidl_fuchsia_mem::Buffer, FrameError>,
6824    ) -> Result<(), fidl::Error> {
6825        let _result = self.send_raw(result);
6826        if _result.is_err() {
6827            self.control_handle.shutdown();
6828        }
6829        self.drop_without_shutdown();
6830        _result
6831    }
6832
6833    /// Similar to "send" but does not shutdown the channel if an error occurs.
6834    pub fn send_no_shutdown_on_err(
6835        self,
6836        mut result: Result<fidl_fuchsia_mem::Buffer, FrameError>,
6837    ) -> Result<(), fidl::Error> {
6838        let _result = self.send_raw(result);
6839        self.drop_without_shutdown();
6840        _result
6841    }
6842
6843    fn send_raw(
6844        &self,
6845        mut result: Result<fidl_fuchsia_mem::Buffer, FrameError>,
6846    ) -> Result<(), fidl::Error> {
6847        self.control_handle.inner.send::<fidl::encoding::ResultType<
6848            FrameExecuteJavaScriptResponse,
6849            FrameError,
6850        >>(
6851            result.as_mut().map_err(|e| *e).map(|result| (result,)),
6852            self.tx_id,
6853            0x79abdd4907000542,
6854            fidl::encoding::DynamicFlags::empty(),
6855        )
6856    }
6857}
6858
6859#[must_use = "FIDL methods require a response to be sent"]
6860#[derive(Debug)]
6861pub struct FrameExecuteJavaScriptNoResultResponder {
6862    control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6863    tx_id: u32,
6864}
6865
6866/// Set the the channel to be shutdown (see [`FrameControlHandle::shutdown`])
6867/// if the responder is dropped without sending a response, so that the client
6868/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6869impl std::ops::Drop for FrameExecuteJavaScriptNoResultResponder {
6870    fn drop(&mut self) {
6871        self.control_handle.shutdown();
6872        // Safety: drops once, never accessed again
6873        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6874    }
6875}
6876
6877impl fidl::endpoints::Responder for FrameExecuteJavaScriptNoResultResponder {
6878    type ControlHandle = FrameControlHandle;
6879
6880    fn control_handle(&self) -> &FrameControlHandle {
6881        &self.control_handle
6882    }
6883
6884    fn drop_without_shutdown(mut self) {
6885        // Safety: drops once, never accessed again due to mem::forget
6886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6887        // Prevent Drop from running (which would shut down the channel)
6888        std::mem::forget(self);
6889    }
6890}
6891
6892impl FrameExecuteJavaScriptNoResultResponder {
6893    /// Sends a response to the FIDL transaction.
6894    ///
6895    /// Sets the channel to shutdown if an error occurs.
6896    pub fn send(self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6897        let _result = self.send_raw(result);
6898        if _result.is_err() {
6899            self.control_handle.shutdown();
6900        }
6901        self.drop_without_shutdown();
6902        _result
6903    }
6904
6905    /// Similar to "send" but does not shutdown the channel if an error occurs.
6906    pub fn send_no_shutdown_on_err(
6907        self,
6908        mut result: Result<(), FrameError>,
6909    ) -> Result<(), fidl::Error> {
6910        let _result = self.send_raw(result);
6911        self.drop_without_shutdown();
6912        _result
6913    }
6914
6915    fn send_raw(&self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6916        self.control_handle
6917            .inner
6918            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>>(
6919                result,
6920                self.tx_id,
6921                0x16b8491520cbcd63,
6922                fidl::encoding::DynamicFlags::empty(),
6923            )
6924    }
6925}
6926
6927#[must_use = "FIDL methods require a response to be sent"]
6928#[derive(Debug)]
6929pub struct FrameAddBeforeLoadJavaScriptResponder {
6930    control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6931    tx_id: u32,
6932}
6933
6934/// Set the the channel to be shutdown (see [`FrameControlHandle::shutdown`])
6935/// if the responder is dropped without sending a response, so that the client
6936/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6937impl std::ops::Drop for FrameAddBeforeLoadJavaScriptResponder {
6938    fn drop(&mut self) {
6939        self.control_handle.shutdown();
6940        // Safety: drops once, never accessed again
6941        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6942    }
6943}
6944
6945impl fidl::endpoints::Responder for FrameAddBeforeLoadJavaScriptResponder {
6946    type ControlHandle = FrameControlHandle;
6947
6948    fn control_handle(&self) -> &FrameControlHandle {
6949        &self.control_handle
6950    }
6951
6952    fn drop_without_shutdown(mut self) {
6953        // Safety: drops once, never accessed again due to mem::forget
6954        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6955        // Prevent Drop from running (which would shut down the channel)
6956        std::mem::forget(self);
6957    }
6958}
6959
6960impl FrameAddBeforeLoadJavaScriptResponder {
6961    /// Sends a response to the FIDL transaction.
6962    ///
6963    /// Sets the channel to shutdown if an error occurs.
6964    pub fn send(self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6965        let _result = self.send_raw(result);
6966        if _result.is_err() {
6967            self.control_handle.shutdown();
6968        }
6969        self.drop_without_shutdown();
6970        _result
6971    }
6972
6973    /// Similar to "send" but does not shutdown the channel if an error occurs.
6974    pub fn send_no_shutdown_on_err(
6975        self,
6976        mut result: Result<(), FrameError>,
6977    ) -> Result<(), fidl::Error> {
6978        let _result = self.send_raw(result);
6979        self.drop_without_shutdown();
6980        _result
6981    }
6982
6983    fn send_raw(&self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
6984        self.control_handle
6985            .inner
6986            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>>(
6987                result,
6988                self.tx_id,
6989                0x540ac0da59d823e,
6990                fidl::encoding::DynamicFlags::empty(),
6991            )
6992    }
6993}
6994
6995#[must_use = "FIDL methods require a response to be sent"]
6996#[derive(Debug)]
6997pub struct FramePostMessageResponder {
6998    control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
6999    tx_id: u32,
7000}
7001
7002/// Set the the channel to be shutdown (see [`FrameControlHandle::shutdown`])
7003/// if the responder is dropped without sending a response, so that the client
7004/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7005impl std::ops::Drop for FramePostMessageResponder {
7006    fn drop(&mut self) {
7007        self.control_handle.shutdown();
7008        // Safety: drops once, never accessed again
7009        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7010    }
7011}
7012
7013impl fidl::endpoints::Responder for FramePostMessageResponder {
7014    type ControlHandle = FrameControlHandle;
7015
7016    fn control_handle(&self) -> &FrameControlHandle {
7017        &self.control_handle
7018    }
7019
7020    fn drop_without_shutdown(mut self) {
7021        // Safety: drops once, never accessed again due to mem::forget
7022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7023        // Prevent Drop from running (which would shut down the channel)
7024        std::mem::forget(self);
7025    }
7026}
7027
7028impl FramePostMessageResponder {
7029    /// Sends a response to the FIDL transaction.
7030    ///
7031    /// Sets the channel to shutdown if an error occurs.
7032    pub fn send(self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
7033        let _result = self.send_raw(result);
7034        if _result.is_err() {
7035            self.control_handle.shutdown();
7036        }
7037        self.drop_without_shutdown();
7038        _result
7039    }
7040
7041    /// Similar to "send" but does not shutdown the channel if an error occurs.
7042    pub fn send_no_shutdown_on_err(
7043        self,
7044        mut result: Result<(), FrameError>,
7045    ) -> Result<(), fidl::Error> {
7046        let _result = self.send_raw(result);
7047        self.drop_without_shutdown();
7048        _result
7049    }
7050
7051    fn send_raw(&self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
7052        self.control_handle
7053            .inner
7054            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>>(
7055                result,
7056                self.tx_id,
7057                0x751d686eb7caa341,
7058                fidl::encoding::DynamicFlags::empty(),
7059            )
7060    }
7061}
7062
7063#[must_use = "FIDL methods require a response to be sent"]
7064#[derive(Debug)]
7065pub struct FrameSetUrlRequestRewriteRulesResponder {
7066    control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
7067    tx_id: u32,
7068}
7069
7070/// Set the the channel to be shutdown (see [`FrameControlHandle::shutdown`])
7071/// if the responder is dropped without sending a response, so that the client
7072/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7073impl std::ops::Drop for FrameSetUrlRequestRewriteRulesResponder {
7074    fn drop(&mut self) {
7075        self.control_handle.shutdown();
7076        // Safety: drops once, never accessed again
7077        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7078    }
7079}
7080
7081impl fidl::endpoints::Responder for FrameSetUrlRequestRewriteRulesResponder {
7082    type ControlHandle = FrameControlHandle;
7083
7084    fn control_handle(&self) -> &FrameControlHandle {
7085        &self.control_handle
7086    }
7087
7088    fn drop_without_shutdown(mut self) {
7089        // Safety: drops once, never accessed again due to mem::forget
7090        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7091        // Prevent Drop from running (which would shut down the channel)
7092        std::mem::forget(self);
7093    }
7094}
7095
7096impl FrameSetUrlRequestRewriteRulesResponder {
7097    /// Sends a response to the FIDL transaction.
7098    ///
7099    /// Sets the channel to shutdown if an error occurs.
7100    pub fn send(self) -> Result<(), fidl::Error> {
7101        let _result = self.send_raw();
7102        if _result.is_err() {
7103            self.control_handle.shutdown();
7104        }
7105        self.drop_without_shutdown();
7106        _result
7107    }
7108
7109    /// Similar to "send" but does not shutdown the channel if an error occurs.
7110    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
7111        let _result = self.send_raw();
7112        self.drop_without_shutdown();
7113        _result
7114    }
7115
7116    fn send_raw(&self) -> Result<(), fidl::Error> {
7117        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
7118            (),
7119            self.tx_id,
7120            0x2e3f797350ab3281,
7121            fidl::encoding::DynamicFlags::empty(),
7122        )
7123    }
7124}
7125
7126#[must_use = "FIDL methods require a response to be sent"]
7127#[derive(Debug)]
7128pub struct FrameGetPrivateMemorySizeResponder {
7129    control_handle: std::mem::ManuallyDrop<FrameControlHandle>,
7130    tx_id: u32,
7131}
7132
7133/// Set the the channel to be shutdown (see [`FrameControlHandle::shutdown`])
7134/// if the responder is dropped without sending a response, so that the client
7135/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7136impl std::ops::Drop for FrameGetPrivateMemorySizeResponder {
7137    fn drop(&mut self) {
7138        self.control_handle.shutdown();
7139        // Safety: drops once, never accessed again
7140        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7141    }
7142}
7143
7144impl fidl::endpoints::Responder for FrameGetPrivateMemorySizeResponder {
7145    type ControlHandle = FrameControlHandle;
7146
7147    fn control_handle(&self) -> &FrameControlHandle {
7148        &self.control_handle
7149    }
7150
7151    fn drop_without_shutdown(mut self) {
7152        // Safety: drops once, never accessed again due to mem::forget
7153        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7154        // Prevent Drop from running (which would shut down the channel)
7155        std::mem::forget(self);
7156    }
7157}
7158
7159impl FrameGetPrivateMemorySizeResponder {
7160    /// Sends a response to the FIDL transaction.
7161    ///
7162    /// Sets the channel to shutdown if an error occurs.
7163    pub fn send(self, mut size_bytes: u64) -> Result<(), fidl::Error> {
7164        let _result = self.send_raw(size_bytes);
7165        if _result.is_err() {
7166            self.control_handle.shutdown();
7167        }
7168        self.drop_without_shutdown();
7169        _result
7170    }
7171
7172    /// Similar to "send" but does not shutdown the channel if an error occurs.
7173    pub fn send_no_shutdown_on_err(self, mut size_bytes: u64) -> Result<(), fidl::Error> {
7174        let _result = self.send_raw(size_bytes);
7175        self.drop_without_shutdown();
7176        _result
7177    }
7178
7179    fn send_raw(&self, mut size_bytes: u64) -> Result<(), fidl::Error> {
7180        self.control_handle.inner.send::<FrameGetPrivateMemorySizeResponse>(
7181            (size_bytes,),
7182            self.tx_id,
7183            0x6ad4d43da6c129b0,
7184            fidl::encoding::DynamicFlags::empty(),
7185        )
7186    }
7187}
7188
7189#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7190pub struct FrameHostMarker;
7191
7192impl fidl::endpoints::ProtocolMarker for FrameHostMarker {
7193    type Proxy = FrameHostProxy;
7194    type RequestStream = FrameHostRequestStream;
7195    #[cfg(target_os = "fuchsia")]
7196    type SynchronousProxy = FrameHostSynchronousProxy;
7197
7198    const DEBUG_NAME: &'static str = "fuchsia.web.FrameHost";
7199}
7200impl fidl::endpoints::DiscoverableProtocolMarker for FrameHostMarker {}
7201
7202pub trait FrameHostProxyInterface: Send + Sync {
7203    fn r#create_frame_with_params(
7204        &self,
7205        params: CreateFrameParams,
7206        frame: fidl::endpoints::ServerEnd<FrameMarker>,
7207    ) -> Result<(), fidl::Error>;
7208}
7209#[derive(Debug)]
7210#[cfg(target_os = "fuchsia")]
7211pub struct FrameHostSynchronousProxy {
7212    client: fidl::client::sync::Client,
7213}
7214
7215#[cfg(target_os = "fuchsia")]
7216impl fidl::endpoints::SynchronousProxy for FrameHostSynchronousProxy {
7217    type Proxy = FrameHostProxy;
7218    type Protocol = FrameHostMarker;
7219
7220    fn from_channel(inner: fidl::Channel) -> Self {
7221        Self::new(inner)
7222    }
7223
7224    fn into_channel(self) -> fidl::Channel {
7225        self.client.into_channel()
7226    }
7227
7228    fn as_channel(&self) -> &fidl::Channel {
7229        self.client.as_channel()
7230    }
7231}
7232
7233#[cfg(target_os = "fuchsia")]
7234impl FrameHostSynchronousProxy {
7235    pub fn new(channel: fidl::Channel) -> Self {
7236        Self { client: fidl::client::sync::Client::new(channel) }
7237    }
7238
7239    pub fn into_channel(self) -> fidl::Channel {
7240        self.client.into_channel()
7241    }
7242
7243    /// Waits until an event arrives and returns it. It is safe for other
7244    /// threads to make concurrent requests while waiting for an event.
7245    pub fn wait_for_event(
7246        &self,
7247        deadline: zx::MonotonicInstant,
7248    ) -> Result<FrameHostEvent, fidl::Error> {
7249        FrameHostEvent::decode(self.client.wait_for_event::<FrameHostMarker>(deadline)?)
7250    }
7251
7252    /// Behaves identically to [`Context.CreateFrameWithParams`].
7253    pub fn r#create_frame_with_params(
7254        &self,
7255        mut params: CreateFrameParams,
7256        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
7257    ) -> Result<(), fidl::Error> {
7258        self.client.send::<FrameHostCreateFrameWithParamsRequest>(
7259            (&mut params, frame),
7260            0x670186c3a1b3f28,
7261            fidl::encoding::DynamicFlags::empty(),
7262        )
7263    }
7264}
7265
7266#[cfg(target_os = "fuchsia")]
7267impl From<FrameHostSynchronousProxy> for zx::NullableHandle {
7268    fn from(value: FrameHostSynchronousProxy) -> Self {
7269        value.into_channel().into()
7270    }
7271}
7272
7273#[cfg(target_os = "fuchsia")]
7274impl From<fidl::Channel> for FrameHostSynchronousProxy {
7275    fn from(value: fidl::Channel) -> Self {
7276        Self::new(value)
7277    }
7278}
7279
7280#[cfg(target_os = "fuchsia")]
7281impl fidl::endpoints::FromClient for FrameHostSynchronousProxy {
7282    type Protocol = FrameHostMarker;
7283
7284    fn from_client(value: fidl::endpoints::ClientEnd<FrameHostMarker>) -> Self {
7285        Self::new(value.into_channel())
7286    }
7287}
7288
7289#[derive(Debug, Clone)]
7290pub struct FrameHostProxy {
7291    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7292}
7293
7294impl fidl::endpoints::Proxy for FrameHostProxy {
7295    type Protocol = FrameHostMarker;
7296
7297    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7298        Self::new(inner)
7299    }
7300
7301    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7302        self.client.into_channel().map_err(|client| Self { client })
7303    }
7304
7305    fn as_channel(&self) -> &::fidl::AsyncChannel {
7306        self.client.as_channel()
7307    }
7308}
7309
7310impl FrameHostProxy {
7311    /// Create a new Proxy for fuchsia.web/FrameHost.
7312    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7313        let protocol_name = <FrameHostMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7314        Self { client: fidl::client::Client::new(channel, protocol_name) }
7315    }
7316
7317    /// Get a Stream of events from the remote end of the protocol.
7318    ///
7319    /// # Panics
7320    ///
7321    /// Panics if the event stream was already taken.
7322    pub fn take_event_stream(&self) -> FrameHostEventStream {
7323        FrameHostEventStream { event_receiver: self.client.take_event_receiver() }
7324    }
7325
7326    /// Behaves identically to [`Context.CreateFrameWithParams`].
7327    pub fn r#create_frame_with_params(
7328        &self,
7329        mut params: CreateFrameParams,
7330        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
7331    ) -> Result<(), fidl::Error> {
7332        FrameHostProxyInterface::r#create_frame_with_params(self, params, frame)
7333    }
7334}
7335
7336impl FrameHostProxyInterface for FrameHostProxy {
7337    fn r#create_frame_with_params(
7338        &self,
7339        mut params: CreateFrameParams,
7340        mut frame: fidl::endpoints::ServerEnd<FrameMarker>,
7341    ) -> Result<(), fidl::Error> {
7342        self.client.send::<FrameHostCreateFrameWithParamsRequest>(
7343            (&mut params, frame),
7344            0x670186c3a1b3f28,
7345            fidl::encoding::DynamicFlags::empty(),
7346        )
7347    }
7348}
7349
7350pub struct FrameHostEventStream {
7351    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7352}
7353
7354impl std::marker::Unpin for FrameHostEventStream {}
7355
7356impl futures::stream::FusedStream for FrameHostEventStream {
7357    fn is_terminated(&self) -> bool {
7358        self.event_receiver.is_terminated()
7359    }
7360}
7361
7362impl futures::Stream for FrameHostEventStream {
7363    type Item = Result<FrameHostEvent, fidl::Error>;
7364
7365    fn poll_next(
7366        mut self: std::pin::Pin<&mut Self>,
7367        cx: &mut std::task::Context<'_>,
7368    ) -> std::task::Poll<Option<Self::Item>> {
7369        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7370            &mut self.event_receiver,
7371            cx
7372        )?) {
7373            Some(buf) => std::task::Poll::Ready(Some(FrameHostEvent::decode(buf))),
7374            None => std::task::Poll::Ready(None),
7375        }
7376    }
7377}
7378
7379#[derive(Debug)]
7380pub enum FrameHostEvent {}
7381
7382impl FrameHostEvent {
7383    /// Decodes a message buffer as a [`FrameHostEvent`].
7384    fn decode(
7385        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7386    ) -> Result<FrameHostEvent, fidl::Error> {
7387        let (bytes, _handles) = buf.split_mut();
7388        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7389        debug_assert_eq!(tx_header.tx_id, 0);
7390        match tx_header.ordinal {
7391            _ => Err(fidl::Error::UnknownOrdinal {
7392                ordinal: tx_header.ordinal,
7393                protocol_name: <FrameHostMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7394            }),
7395        }
7396    }
7397}
7398
7399/// A Stream of incoming requests for fuchsia.web/FrameHost.
7400pub struct FrameHostRequestStream {
7401    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7402    is_terminated: bool,
7403}
7404
7405impl std::marker::Unpin for FrameHostRequestStream {}
7406
7407impl futures::stream::FusedStream for FrameHostRequestStream {
7408    fn is_terminated(&self) -> bool {
7409        self.is_terminated
7410    }
7411}
7412
7413impl fidl::endpoints::RequestStream for FrameHostRequestStream {
7414    type Protocol = FrameHostMarker;
7415    type ControlHandle = FrameHostControlHandle;
7416
7417    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7418        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7419    }
7420
7421    fn control_handle(&self) -> Self::ControlHandle {
7422        FrameHostControlHandle { inner: self.inner.clone() }
7423    }
7424
7425    fn into_inner(
7426        self,
7427    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7428    {
7429        (self.inner, self.is_terminated)
7430    }
7431
7432    fn from_inner(
7433        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7434        is_terminated: bool,
7435    ) -> Self {
7436        Self { inner, is_terminated }
7437    }
7438}
7439
7440impl futures::Stream for FrameHostRequestStream {
7441    type Item = Result<FrameHostRequest, fidl::Error>;
7442
7443    fn poll_next(
7444        mut self: std::pin::Pin<&mut Self>,
7445        cx: &mut std::task::Context<'_>,
7446    ) -> std::task::Poll<Option<Self::Item>> {
7447        let this = &mut *self;
7448        if this.inner.check_shutdown(cx) {
7449            this.is_terminated = true;
7450            return std::task::Poll::Ready(None);
7451        }
7452        if this.is_terminated {
7453            panic!("polled FrameHostRequestStream after completion");
7454        }
7455        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7456            |bytes, handles| {
7457                match this.inner.channel().read_etc(cx, bytes, handles) {
7458                    std::task::Poll::Ready(Ok(())) => {}
7459                    std::task::Poll::Pending => return std::task::Poll::Pending,
7460                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7461                        this.is_terminated = true;
7462                        return std::task::Poll::Ready(None);
7463                    }
7464                    std::task::Poll::Ready(Err(e)) => {
7465                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7466                            e.into(),
7467                        ))));
7468                    }
7469                }
7470
7471                // A message has been received from the channel
7472                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7473
7474                std::task::Poll::Ready(Some(match header.ordinal {
7475                    0x670186c3a1b3f28 => {
7476                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7477                        let mut req = fidl::new_empty!(
7478                            FrameHostCreateFrameWithParamsRequest,
7479                            fidl::encoding::DefaultFuchsiaResourceDialect
7480                        );
7481                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FrameHostCreateFrameWithParamsRequest>(&header, _body_bytes, handles, &mut req)?;
7482                        let control_handle = FrameHostControlHandle { inner: this.inner.clone() };
7483                        Ok(FrameHostRequest::CreateFrameWithParams {
7484                            params: req.params,
7485                            frame: req.frame,
7486
7487                            control_handle,
7488                        })
7489                    }
7490                    _ => Err(fidl::Error::UnknownOrdinal {
7491                        ordinal: header.ordinal,
7492                        protocol_name:
7493                            <FrameHostMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7494                    }),
7495                }))
7496            },
7497        )
7498    }
7499}
7500
7501/// Used by [`Context`] clients to delegate [`Frame`] hosting capabilities to selected peers.
7502#[derive(Debug)]
7503pub enum FrameHostRequest {
7504    /// Behaves identically to [`Context.CreateFrameWithParams`].
7505    CreateFrameWithParams {
7506        params: CreateFrameParams,
7507        frame: fidl::endpoints::ServerEnd<FrameMarker>,
7508        control_handle: FrameHostControlHandle,
7509    },
7510}
7511
7512impl FrameHostRequest {
7513    #[allow(irrefutable_let_patterns)]
7514    pub fn into_create_frame_with_params(
7515        self,
7516    ) -> Option<(CreateFrameParams, fidl::endpoints::ServerEnd<FrameMarker>, FrameHostControlHandle)>
7517    {
7518        if let FrameHostRequest::CreateFrameWithParams { params, frame, control_handle } = self {
7519            Some((params, frame, control_handle))
7520        } else {
7521            None
7522        }
7523    }
7524
7525    /// Name of the method defined in FIDL
7526    pub fn method_name(&self) -> &'static str {
7527        match *self {
7528            FrameHostRequest::CreateFrameWithParams { .. } => "create_frame_with_params",
7529        }
7530    }
7531}
7532
7533#[derive(Debug, Clone)]
7534pub struct FrameHostControlHandle {
7535    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7536}
7537
7538impl FrameHostControlHandle {
7539    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7540        self.inner.shutdown_with_epitaph(status.into())
7541    }
7542}
7543
7544impl fidl::endpoints::ControlHandle for FrameHostControlHandle {
7545    fn shutdown(&self) {
7546        self.inner.shutdown()
7547    }
7548
7549    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7550        self.inner.shutdown_with_epitaph(status)
7551    }
7552
7553    fn is_closed(&self) -> bool {
7554        self.inner.channel().is_closed()
7555    }
7556    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7557        self.inner.channel().on_closed()
7558    }
7559
7560    #[cfg(target_os = "fuchsia")]
7561    fn signal_peer(
7562        &self,
7563        clear_mask: zx::Signals,
7564        set_mask: zx::Signals,
7565    ) -> Result<(), zx_status::Status> {
7566        use fidl::Peered;
7567        self.inner.channel().signal_peer(clear_mask, set_mask)
7568    }
7569}
7570
7571impl FrameHostControlHandle {}
7572
7573#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7574pub struct MessagePortMarker;
7575
7576impl fidl::endpoints::ProtocolMarker for MessagePortMarker {
7577    type Proxy = MessagePortProxy;
7578    type RequestStream = MessagePortRequestStream;
7579    #[cfg(target_os = "fuchsia")]
7580    type SynchronousProxy = MessagePortSynchronousProxy;
7581
7582    const DEBUG_NAME: &'static str = "(anonymous) MessagePort";
7583}
7584pub type MessagePortPostMessageResult = Result<(), FrameError>;
7585
7586pub trait MessagePortProxyInterface: Send + Sync {
7587    type PostMessageResponseFut: std::future::Future<Output = Result<MessagePortPostMessageResult, fidl::Error>>
7588        + Send;
7589    fn r#post_message(&self, message: WebMessage) -> Self::PostMessageResponseFut;
7590    type ReceiveMessageResponseFut: std::future::Future<Output = Result<WebMessage, fidl::Error>>
7591        + Send;
7592    fn r#receive_message(&self) -> Self::ReceiveMessageResponseFut;
7593}
7594#[derive(Debug)]
7595#[cfg(target_os = "fuchsia")]
7596pub struct MessagePortSynchronousProxy {
7597    client: fidl::client::sync::Client,
7598}
7599
7600#[cfg(target_os = "fuchsia")]
7601impl fidl::endpoints::SynchronousProxy for MessagePortSynchronousProxy {
7602    type Proxy = MessagePortProxy;
7603    type Protocol = MessagePortMarker;
7604
7605    fn from_channel(inner: fidl::Channel) -> Self {
7606        Self::new(inner)
7607    }
7608
7609    fn into_channel(self) -> fidl::Channel {
7610        self.client.into_channel()
7611    }
7612
7613    fn as_channel(&self) -> &fidl::Channel {
7614        self.client.as_channel()
7615    }
7616}
7617
7618#[cfg(target_os = "fuchsia")]
7619impl MessagePortSynchronousProxy {
7620    pub fn new(channel: fidl::Channel) -> Self {
7621        Self { client: fidl::client::sync::Client::new(channel) }
7622    }
7623
7624    pub fn into_channel(self) -> fidl::Channel {
7625        self.client.into_channel()
7626    }
7627
7628    /// Waits until an event arrives and returns it. It is safe for other
7629    /// threads to make concurrent requests while waiting for an event.
7630    pub fn wait_for_event(
7631        &self,
7632        deadline: zx::MonotonicInstant,
7633    ) -> Result<MessagePortEvent, fidl::Error> {
7634        MessagePortEvent::decode(self.client.wait_for_event::<MessagePortMarker>(deadline)?)
7635    }
7636
7637    /// Sends a [`WebMessage`] to the peer. These are processed in order, one at a
7638    /// time. It is not necessary for the caller to wait for the completion callback before calling
7639    /// [`MessagePort.PostMessage`] again.
7640    ///
7641    /// If an error occurred, the [`FrameError`] will be set to one of these value:
7642    /// - `BUFFER_NOT_UTF8`: The script in `message`'s `data` property is not UTF-8 encoded.
7643    /// - `NO_DATA_IN_MESSAGE`: The `data` property is missing in `message`.
7644    pub fn r#post_message(
7645        &self,
7646        mut message: WebMessage,
7647        ___deadline: zx::MonotonicInstant,
7648    ) -> Result<MessagePortPostMessageResult, fidl::Error> {
7649        let _response = self.client.send_query::<
7650            MessagePortPostMessageRequest,
7651            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
7652            MessagePortMarker,
7653        >(
7654            (&mut message,),
7655            0x2bcf0a6ed30ffd1f,
7656            fidl::encoding::DynamicFlags::empty(),
7657            ___deadline,
7658        )?;
7659        Ok(_response.map(|x| x))
7660    }
7661
7662    /// Asynchronously reads the next message from the channel. The client should invoke the
7663    /// callback when it is ready to process another message. Unreceived messages are buffered
7664    /// on the sender's side and bounded by its available resources.
7665    pub fn r#receive_message(
7666        &self,
7667        ___deadline: zx::MonotonicInstant,
7668    ) -> Result<WebMessage, fidl::Error> {
7669        let _response = self.client.send_query::<
7670            fidl::encoding::EmptyPayload,
7671            MessagePortReceiveMessageResponse,
7672            MessagePortMarker,
7673        >(
7674            (),
7675            0x6c8a6051690be58d,
7676            fidl::encoding::DynamicFlags::empty(),
7677            ___deadline,
7678        )?;
7679        Ok(_response.message)
7680    }
7681}
7682
7683#[cfg(target_os = "fuchsia")]
7684impl From<MessagePortSynchronousProxy> for zx::NullableHandle {
7685    fn from(value: MessagePortSynchronousProxy) -> Self {
7686        value.into_channel().into()
7687    }
7688}
7689
7690#[cfg(target_os = "fuchsia")]
7691impl From<fidl::Channel> for MessagePortSynchronousProxy {
7692    fn from(value: fidl::Channel) -> Self {
7693        Self::new(value)
7694    }
7695}
7696
7697#[cfg(target_os = "fuchsia")]
7698impl fidl::endpoints::FromClient for MessagePortSynchronousProxy {
7699    type Protocol = MessagePortMarker;
7700
7701    fn from_client(value: fidl::endpoints::ClientEnd<MessagePortMarker>) -> Self {
7702        Self::new(value.into_channel())
7703    }
7704}
7705
7706#[derive(Debug, Clone)]
7707pub struct MessagePortProxy {
7708    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7709}
7710
7711impl fidl::endpoints::Proxy for MessagePortProxy {
7712    type Protocol = MessagePortMarker;
7713
7714    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7715        Self::new(inner)
7716    }
7717
7718    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7719        self.client.into_channel().map_err(|client| Self { client })
7720    }
7721
7722    fn as_channel(&self) -> &::fidl::AsyncChannel {
7723        self.client.as_channel()
7724    }
7725}
7726
7727impl MessagePortProxy {
7728    /// Create a new Proxy for fuchsia.web/MessagePort.
7729    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7730        let protocol_name = <MessagePortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7731        Self { client: fidl::client::Client::new(channel, protocol_name) }
7732    }
7733
7734    /// Get a Stream of events from the remote end of the protocol.
7735    ///
7736    /// # Panics
7737    ///
7738    /// Panics if the event stream was already taken.
7739    pub fn take_event_stream(&self) -> MessagePortEventStream {
7740        MessagePortEventStream { event_receiver: self.client.take_event_receiver() }
7741    }
7742
7743    /// Sends a [`WebMessage`] to the peer. These are processed in order, one at a
7744    /// time. It is not necessary for the caller to wait for the completion callback before calling
7745    /// [`MessagePort.PostMessage`] again.
7746    ///
7747    /// If an error occurred, the [`FrameError`] will be set to one of these value:
7748    /// - `BUFFER_NOT_UTF8`: The script in `message`'s `data` property is not UTF-8 encoded.
7749    /// - `NO_DATA_IN_MESSAGE`: The `data` property is missing in `message`.
7750    pub fn r#post_message(
7751        &self,
7752        mut message: WebMessage,
7753    ) -> fidl::client::QueryResponseFut<
7754        MessagePortPostMessageResult,
7755        fidl::encoding::DefaultFuchsiaResourceDialect,
7756    > {
7757        MessagePortProxyInterface::r#post_message(self, message)
7758    }
7759
7760    /// Asynchronously reads the next message from the channel. The client should invoke the
7761    /// callback when it is ready to process another message. Unreceived messages are buffered
7762    /// on the sender's side and bounded by its available resources.
7763    pub fn r#receive_message(
7764        &self,
7765    ) -> fidl::client::QueryResponseFut<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>
7766    {
7767        MessagePortProxyInterface::r#receive_message(self)
7768    }
7769}
7770
7771impl MessagePortProxyInterface for MessagePortProxy {
7772    type PostMessageResponseFut = fidl::client::QueryResponseFut<
7773        MessagePortPostMessageResult,
7774        fidl::encoding::DefaultFuchsiaResourceDialect,
7775    >;
7776    fn r#post_message(&self, mut message: WebMessage) -> Self::PostMessageResponseFut {
7777        fn _decode(
7778            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7779        ) -> Result<MessagePortPostMessageResult, fidl::Error> {
7780            let _response = fidl::client::decode_transaction_body::<
7781                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>,
7782                fidl::encoding::DefaultFuchsiaResourceDialect,
7783                0x2bcf0a6ed30ffd1f,
7784            >(_buf?)?;
7785            Ok(_response.map(|x| x))
7786        }
7787        self.client
7788            .send_query_and_decode::<MessagePortPostMessageRequest, MessagePortPostMessageResult>(
7789                (&mut message,),
7790                0x2bcf0a6ed30ffd1f,
7791                fidl::encoding::DynamicFlags::empty(),
7792                _decode,
7793            )
7794    }
7795
7796    type ReceiveMessageResponseFut =
7797        fidl::client::QueryResponseFut<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>;
7798    fn r#receive_message(&self) -> Self::ReceiveMessageResponseFut {
7799        fn _decode(
7800            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7801        ) -> Result<WebMessage, fidl::Error> {
7802            let _response = fidl::client::decode_transaction_body::<
7803                MessagePortReceiveMessageResponse,
7804                fidl::encoding::DefaultFuchsiaResourceDialect,
7805                0x6c8a6051690be58d,
7806            >(_buf?)?;
7807            Ok(_response.message)
7808        }
7809        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WebMessage>(
7810            (),
7811            0x6c8a6051690be58d,
7812            fidl::encoding::DynamicFlags::empty(),
7813            _decode,
7814        )
7815    }
7816}
7817
7818pub struct MessagePortEventStream {
7819    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7820}
7821
7822impl std::marker::Unpin for MessagePortEventStream {}
7823
7824impl futures::stream::FusedStream for MessagePortEventStream {
7825    fn is_terminated(&self) -> bool {
7826        self.event_receiver.is_terminated()
7827    }
7828}
7829
7830impl futures::Stream for MessagePortEventStream {
7831    type Item = Result<MessagePortEvent, fidl::Error>;
7832
7833    fn poll_next(
7834        mut self: std::pin::Pin<&mut Self>,
7835        cx: &mut std::task::Context<'_>,
7836    ) -> std::task::Poll<Option<Self::Item>> {
7837        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7838            &mut self.event_receiver,
7839            cx
7840        )?) {
7841            Some(buf) => std::task::Poll::Ready(Some(MessagePortEvent::decode(buf))),
7842            None => std::task::Poll::Ready(None),
7843        }
7844    }
7845}
7846
7847#[derive(Debug)]
7848pub enum MessagePortEvent {}
7849
7850impl MessagePortEvent {
7851    /// Decodes a message buffer as a [`MessagePortEvent`].
7852    fn decode(
7853        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7854    ) -> Result<MessagePortEvent, fidl::Error> {
7855        let (bytes, _handles) = buf.split_mut();
7856        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7857        debug_assert_eq!(tx_header.tx_id, 0);
7858        match tx_header.ordinal {
7859            _ => Err(fidl::Error::UnknownOrdinal {
7860                ordinal: tx_header.ordinal,
7861                protocol_name: <MessagePortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7862            }),
7863        }
7864    }
7865}
7866
7867/// A Stream of incoming requests for fuchsia.web/MessagePort.
7868pub struct MessagePortRequestStream {
7869    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7870    is_terminated: bool,
7871}
7872
7873impl std::marker::Unpin for MessagePortRequestStream {}
7874
7875impl futures::stream::FusedStream for MessagePortRequestStream {
7876    fn is_terminated(&self) -> bool {
7877        self.is_terminated
7878    }
7879}
7880
7881impl fidl::endpoints::RequestStream for MessagePortRequestStream {
7882    type Protocol = MessagePortMarker;
7883    type ControlHandle = MessagePortControlHandle;
7884
7885    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7886        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7887    }
7888
7889    fn control_handle(&self) -> Self::ControlHandle {
7890        MessagePortControlHandle { inner: self.inner.clone() }
7891    }
7892
7893    fn into_inner(
7894        self,
7895    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7896    {
7897        (self.inner, self.is_terminated)
7898    }
7899
7900    fn from_inner(
7901        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7902        is_terminated: bool,
7903    ) -> Self {
7904        Self { inner, is_terminated }
7905    }
7906}
7907
7908impl futures::Stream for MessagePortRequestStream {
7909    type Item = Result<MessagePortRequest, fidl::Error>;
7910
7911    fn poll_next(
7912        mut self: std::pin::Pin<&mut Self>,
7913        cx: &mut std::task::Context<'_>,
7914    ) -> std::task::Poll<Option<Self::Item>> {
7915        let this = &mut *self;
7916        if this.inner.check_shutdown(cx) {
7917            this.is_terminated = true;
7918            return std::task::Poll::Ready(None);
7919        }
7920        if this.is_terminated {
7921            panic!("polled MessagePortRequestStream after completion");
7922        }
7923        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7924            |bytes, handles| {
7925                match this.inner.channel().read_etc(cx, bytes, handles) {
7926                    std::task::Poll::Ready(Ok(())) => {}
7927                    std::task::Poll::Pending => return std::task::Poll::Pending,
7928                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7929                        this.is_terminated = true;
7930                        return std::task::Poll::Ready(None);
7931                    }
7932                    std::task::Poll::Ready(Err(e)) => {
7933                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7934                            e.into(),
7935                        ))));
7936                    }
7937                }
7938
7939                // A message has been received from the channel
7940                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7941
7942                std::task::Poll::Ready(Some(match header.ordinal {
7943                    0x2bcf0a6ed30ffd1f => {
7944                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7945                        let mut req = fidl::new_empty!(
7946                            MessagePortPostMessageRequest,
7947                            fidl::encoding::DefaultFuchsiaResourceDialect
7948                        );
7949                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MessagePortPostMessageRequest>(&header, _body_bytes, handles, &mut req)?;
7950                        let control_handle = MessagePortControlHandle { inner: this.inner.clone() };
7951                        Ok(MessagePortRequest::PostMessage {
7952                            message: req.message,
7953
7954                            responder: MessagePortPostMessageResponder {
7955                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7956                                tx_id: header.tx_id,
7957                            },
7958                        })
7959                    }
7960                    0x6c8a6051690be58d => {
7961                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7962                        let mut req = fidl::new_empty!(
7963                            fidl::encoding::EmptyPayload,
7964                            fidl::encoding::DefaultFuchsiaResourceDialect
7965                        );
7966                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7967                        let control_handle = MessagePortControlHandle { inner: this.inner.clone() };
7968                        Ok(MessagePortRequest::ReceiveMessage {
7969                            responder: MessagePortReceiveMessageResponder {
7970                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7971                                tx_id: header.tx_id,
7972                            },
7973                        })
7974                    }
7975                    _ => Err(fidl::Error::UnknownOrdinal {
7976                        ordinal: header.ordinal,
7977                        protocol_name:
7978                            <MessagePortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7979                    }),
7980                }))
7981            },
7982        )
7983    }
7984}
7985
7986/// Represents one end of an HTML5 MessageChannel. Can be used to send and exchange Messages with
7987/// the peered MessagePort in the Frame's script context. The port is destroyed when either end of
7988/// the MessagePort channel is torn down.
7989#[derive(Debug)]
7990pub enum MessagePortRequest {
7991    /// Sends a [`WebMessage`] to the peer. These are processed in order, one at a
7992    /// time. It is not necessary for the caller to wait for the completion callback before calling
7993    /// [`MessagePort.PostMessage`] again.
7994    ///
7995    /// If an error occurred, the [`FrameError`] will be set to one of these value:
7996    /// - `BUFFER_NOT_UTF8`: The script in `message`'s `data` property is not UTF-8 encoded.
7997    /// - `NO_DATA_IN_MESSAGE`: The `data` property is missing in `message`.
7998    PostMessage { message: WebMessage, responder: MessagePortPostMessageResponder },
7999    /// Asynchronously reads the next message from the channel. The client should invoke the
8000    /// callback when it is ready to process another message. Unreceived messages are buffered
8001    /// on the sender's side and bounded by its available resources.
8002    ReceiveMessage { responder: MessagePortReceiveMessageResponder },
8003}
8004
8005impl MessagePortRequest {
8006    #[allow(irrefutable_let_patterns)]
8007    pub fn into_post_message(self) -> Option<(WebMessage, MessagePortPostMessageResponder)> {
8008        if let MessagePortRequest::PostMessage { message, responder } = self {
8009            Some((message, responder))
8010        } else {
8011            None
8012        }
8013    }
8014
8015    #[allow(irrefutable_let_patterns)]
8016    pub fn into_receive_message(self) -> Option<(MessagePortReceiveMessageResponder)> {
8017        if let MessagePortRequest::ReceiveMessage { responder } = self {
8018            Some((responder))
8019        } else {
8020            None
8021        }
8022    }
8023
8024    /// Name of the method defined in FIDL
8025    pub fn method_name(&self) -> &'static str {
8026        match *self {
8027            MessagePortRequest::PostMessage { .. } => "post_message",
8028            MessagePortRequest::ReceiveMessage { .. } => "receive_message",
8029        }
8030    }
8031}
8032
8033#[derive(Debug, Clone)]
8034pub struct MessagePortControlHandle {
8035    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8036}
8037
8038impl MessagePortControlHandle {
8039    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8040        self.inner.shutdown_with_epitaph(status.into())
8041    }
8042}
8043
8044impl fidl::endpoints::ControlHandle for MessagePortControlHandle {
8045    fn shutdown(&self) {
8046        self.inner.shutdown()
8047    }
8048
8049    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8050        self.inner.shutdown_with_epitaph(status)
8051    }
8052
8053    fn is_closed(&self) -> bool {
8054        self.inner.channel().is_closed()
8055    }
8056    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8057        self.inner.channel().on_closed()
8058    }
8059
8060    #[cfg(target_os = "fuchsia")]
8061    fn signal_peer(
8062        &self,
8063        clear_mask: zx::Signals,
8064        set_mask: zx::Signals,
8065    ) -> Result<(), zx_status::Status> {
8066        use fidl::Peered;
8067        self.inner.channel().signal_peer(clear_mask, set_mask)
8068    }
8069}
8070
8071impl MessagePortControlHandle {}
8072
8073#[must_use = "FIDL methods require a response to be sent"]
8074#[derive(Debug)]
8075pub struct MessagePortPostMessageResponder {
8076    control_handle: std::mem::ManuallyDrop<MessagePortControlHandle>,
8077    tx_id: u32,
8078}
8079
8080/// Set the the channel to be shutdown (see [`MessagePortControlHandle::shutdown`])
8081/// if the responder is dropped without sending a response, so that the client
8082/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8083impl std::ops::Drop for MessagePortPostMessageResponder {
8084    fn drop(&mut self) {
8085        self.control_handle.shutdown();
8086        // Safety: drops once, never accessed again
8087        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8088    }
8089}
8090
8091impl fidl::endpoints::Responder for MessagePortPostMessageResponder {
8092    type ControlHandle = MessagePortControlHandle;
8093
8094    fn control_handle(&self) -> &MessagePortControlHandle {
8095        &self.control_handle
8096    }
8097
8098    fn drop_without_shutdown(mut self) {
8099        // Safety: drops once, never accessed again due to mem::forget
8100        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8101        // Prevent Drop from running (which would shut down the channel)
8102        std::mem::forget(self);
8103    }
8104}
8105
8106impl MessagePortPostMessageResponder {
8107    /// Sends a response to the FIDL transaction.
8108    ///
8109    /// Sets the channel to shutdown if an error occurs.
8110    pub fn send(self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
8111        let _result = self.send_raw(result);
8112        if _result.is_err() {
8113            self.control_handle.shutdown();
8114        }
8115        self.drop_without_shutdown();
8116        _result
8117    }
8118
8119    /// Similar to "send" but does not shutdown the channel if an error occurs.
8120    pub fn send_no_shutdown_on_err(
8121        self,
8122        mut result: Result<(), FrameError>,
8123    ) -> Result<(), fidl::Error> {
8124        let _result = self.send_raw(result);
8125        self.drop_without_shutdown();
8126        _result
8127    }
8128
8129    fn send_raw(&self, mut result: Result<(), FrameError>) -> Result<(), fidl::Error> {
8130        self.control_handle
8131            .inner
8132            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FrameError>>(
8133                result,
8134                self.tx_id,
8135                0x2bcf0a6ed30ffd1f,
8136                fidl::encoding::DynamicFlags::empty(),
8137            )
8138    }
8139}
8140
8141#[must_use = "FIDL methods require a response to be sent"]
8142#[derive(Debug)]
8143pub struct MessagePortReceiveMessageResponder {
8144    control_handle: std::mem::ManuallyDrop<MessagePortControlHandle>,
8145    tx_id: u32,
8146}
8147
8148/// Set the the channel to be shutdown (see [`MessagePortControlHandle::shutdown`])
8149/// if the responder is dropped without sending a response, so that the client
8150/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8151impl std::ops::Drop for MessagePortReceiveMessageResponder {
8152    fn drop(&mut self) {
8153        self.control_handle.shutdown();
8154        // Safety: drops once, never accessed again
8155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8156    }
8157}
8158
8159impl fidl::endpoints::Responder for MessagePortReceiveMessageResponder {
8160    type ControlHandle = MessagePortControlHandle;
8161
8162    fn control_handle(&self) -> &MessagePortControlHandle {
8163        &self.control_handle
8164    }
8165
8166    fn drop_without_shutdown(mut self) {
8167        // Safety: drops once, never accessed again due to mem::forget
8168        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8169        // Prevent Drop from running (which would shut down the channel)
8170        std::mem::forget(self);
8171    }
8172}
8173
8174impl MessagePortReceiveMessageResponder {
8175    /// Sends a response to the FIDL transaction.
8176    ///
8177    /// Sets the channel to shutdown if an error occurs.
8178    pub fn send(self, mut message: WebMessage) -> Result<(), fidl::Error> {
8179        let _result = self.send_raw(message);
8180        if _result.is_err() {
8181            self.control_handle.shutdown();
8182        }
8183        self.drop_without_shutdown();
8184        _result
8185    }
8186
8187    /// Similar to "send" but does not shutdown the channel if an error occurs.
8188    pub fn send_no_shutdown_on_err(self, mut message: WebMessage) -> Result<(), fidl::Error> {
8189        let _result = self.send_raw(message);
8190        self.drop_without_shutdown();
8191        _result
8192    }
8193
8194    fn send_raw(&self, mut message: WebMessage) -> Result<(), fidl::Error> {
8195        self.control_handle.inner.send::<MessagePortReceiveMessageResponse>(
8196            (&mut message,),
8197            self.tx_id,
8198            0x6c8a6051690be58d,
8199            fidl::encoding::DynamicFlags::empty(),
8200        )
8201    }
8202}
8203
8204#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8205pub struct NavigationControllerMarker;
8206
8207impl fidl::endpoints::ProtocolMarker for NavigationControllerMarker {
8208    type Proxy = NavigationControllerProxy;
8209    type RequestStream = NavigationControllerRequestStream;
8210    #[cfg(target_os = "fuchsia")]
8211    type SynchronousProxy = NavigationControllerSynchronousProxy;
8212
8213    const DEBUG_NAME: &'static str = "(anonymous) NavigationController";
8214}
8215pub type NavigationControllerLoadUrlResult = Result<(), NavigationControllerError>;
8216
8217pub trait NavigationControllerProxyInterface: Send + Sync {
8218    type LoadUrlResponseFut: std::future::Future<Output = Result<NavigationControllerLoadUrlResult, fidl::Error>>
8219        + Send;
8220    fn r#load_url(&self, url: &str, params: LoadUrlParams) -> Self::LoadUrlResponseFut;
8221    fn r#go_back(&self) -> Result<(), fidl::Error>;
8222    fn r#go_forward(&self) -> Result<(), fidl::Error>;
8223    fn r#stop(&self) -> Result<(), fidl::Error>;
8224    fn r#reload(&self, type_: ReloadType) -> Result<(), fidl::Error>;
8225}
8226#[derive(Debug)]
8227#[cfg(target_os = "fuchsia")]
8228pub struct NavigationControllerSynchronousProxy {
8229    client: fidl::client::sync::Client,
8230}
8231
8232#[cfg(target_os = "fuchsia")]
8233impl fidl::endpoints::SynchronousProxy for NavigationControllerSynchronousProxy {
8234    type Proxy = NavigationControllerProxy;
8235    type Protocol = NavigationControllerMarker;
8236
8237    fn from_channel(inner: fidl::Channel) -> Self {
8238        Self::new(inner)
8239    }
8240
8241    fn into_channel(self) -> fidl::Channel {
8242        self.client.into_channel()
8243    }
8244
8245    fn as_channel(&self) -> &fidl::Channel {
8246        self.client.as_channel()
8247    }
8248}
8249
8250#[cfg(target_os = "fuchsia")]
8251impl NavigationControllerSynchronousProxy {
8252    pub fn new(channel: fidl::Channel) -> Self {
8253        Self { client: fidl::client::sync::Client::new(channel) }
8254    }
8255
8256    pub fn into_channel(self) -> fidl::Channel {
8257        self.client.into_channel()
8258    }
8259
8260    /// Waits until an event arrives and returns it. It is safe for other
8261    /// threads to make concurrent requests while waiting for an event.
8262    pub fn wait_for_event(
8263        &self,
8264        deadline: zx::MonotonicInstant,
8265    ) -> Result<NavigationControllerEvent, fidl::Error> {
8266        NavigationControllerEvent::decode(
8267            self.client.wait_for_event::<NavigationControllerMarker>(deadline)?,
8268        )
8269    }
8270
8271    /// Tells the [`Frame`] to navigate to a `url`.
8272    ///
8273    /// - `url`: The address to navigate to.
8274    /// - `params`: Additional parameters that affect how the resource will be  loaded (e.g.
8275    ///   cookies, HTTP headers, etc.)
8276    ///
8277    /// If an error occurred, the [`NavigationControllerError`] will be set to one of these values:
8278    /// - `INVALID_URL`: The `url` parameter is invalid.
8279    /// - `INVALID_HEADER`: At least one of the headers in [`LoadUrlParams.headers`] is invalid.
8280    pub fn r#load_url(
8281        &self,
8282        mut url: &str,
8283        mut params: LoadUrlParams,
8284        ___deadline: zx::MonotonicInstant,
8285    ) -> Result<NavigationControllerLoadUrlResult, fidl::Error> {
8286        let _response =
8287            self.client
8288                .send_query::<NavigationControllerLoadUrlRequest, fidl::encoding::ResultType<
8289                    fidl::encoding::EmptyStruct,
8290                    NavigationControllerError,
8291                >, NavigationControllerMarker>(
8292                    (url, &mut params),
8293                    0x78f2ab0a480d0182,
8294                    fidl::encoding::DynamicFlags::empty(),
8295                    ___deadline,
8296                )?;
8297        Ok(_response.map(|x| x))
8298    }
8299
8300    /// Tells the [`Frame`] to navigate to the previous page in its history, if any.
8301    pub fn r#go_back(&self) -> Result<(), fidl::Error> {
8302        self.client.send::<fidl::encoding::EmptyPayload>(
8303            (),
8304            0x2accdd8d87d89c38,
8305            fidl::encoding::DynamicFlags::empty(),
8306        )
8307    }
8308
8309    /// Tells the [`Frame`] to navigate to the next page in its history, if any.
8310    pub fn r#go_forward(&self) -> Result<(), fidl::Error> {
8311        self.client.send::<fidl::encoding::EmptyPayload>(
8312            (),
8313            0x39e4ac955ade2781,
8314            fidl::encoding::DynamicFlags::empty(),
8315        )
8316    }
8317
8318    /// Tells the [`Frame`] to stop the current navigation if a navigation is ongoing.
8319    pub fn r#stop(&self) -> Result<(), fidl::Error> {
8320        self.client.send::<fidl::encoding::EmptyPayload>(
8321            (),
8322            0x2383078ffbe6fea,
8323            fidl::encoding::DynamicFlags::empty(),
8324        )
8325    }
8326
8327    /// Tells the [`Frame`] to reload the current page.
8328    pub fn r#reload(&self, mut type_: ReloadType) -> Result<(), fidl::Error> {
8329        self.client.send::<NavigationControllerReloadRequest>(
8330            (type_,),
8331            0x33faedfe67d6f00,
8332            fidl::encoding::DynamicFlags::empty(),
8333        )
8334    }
8335}
8336
8337#[cfg(target_os = "fuchsia")]
8338impl From<NavigationControllerSynchronousProxy> for zx::NullableHandle {
8339    fn from(value: NavigationControllerSynchronousProxy) -> Self {
8340        value.into_channel().into()
8341    }
8342}
8343
8344#[cfg(target_os = "fuchsia")]
8345impl From<fidl::Channel> for NavigationControllerSynchronousProxy {
8346    fn from(value: fidl::Channel) -> Self {
8347        Self::new(value)
8348    }
8349}
8350
8351#[cfg(target_os = "fuchsia")]
8352impl fidl::endpoints::FromClient for NavigationControllerSynchronousProxy {
8353    type Protocol = NavigationControllerMarker;
8354
8355    fn from_client(value: fidl::endpoints::ClientEnd<NavigationControllerMarker>) -> Self {
8356        Self::new(value.into_channel())
8357    }
8358}
8359
8360#[derive(Debug, Clone)]
8361pub struct NavigationControllerProxy {
8362    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8363}
8364
8365impl fidl::endpoints::Proxy for NavigationControllerProxy {
8366    type Protocol = NavigationControllerMarker;
8367
8368    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8369        Self::new(inner)
8370    }
8371
8372    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8373        self.client.into_channel().map_err(|client| Self { client })
8374    }
8375
8376    fn as_channel(&self) -> &::fidl::AsyncChannel {
8377        self.client.as_channel()
8378    }
8379}
8380
8381impl NavigationControllerProxy {
8382    /// Create a new Proxy for fuchsia.web/NavigationController.
8383    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8384        let protocol_name =
8385            <NavigationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8386        Self { client: fidl::client::Client::new(channel, protocol_name) }
8387    }
8388
8389    /// Get a Stream of events from the remote end of the protocol.
8390    ///
8391    /// # Panics
8392    ///
8393    /// Panics if the event stream was already taken.
8394    pub fn take_event_stream(&self) -> NavigationControllerEventStream {
8395        NavigationControllerEventStream { event_receiver: self.client.take_event_receiver() }
8396    }
8397
8398    /// Tells the [`Frame`] to navigate to a `url`.
8399    ///
8400    /// - `url`: The address to navigate to.
8401    /// - `params`: Additional parameters that affect how the resource will be  loaded (e.g.
8402    ///   cookies, HTTP headers, etc.)
8403    ///
8404    /// If an error occurred, the [`NavigationControllerError`] will be set to one of these values:
8405    /// - `INVALID_URL`: The `url` parameter is invalid.
8406    /// - `INVALID_HEADER`: At least one of the headers in [`LoadUrlParams.headers`] is invalid.
8407    pub fn r#load_url(
8408        &self,
8409        mut url: &str,
8410        mut params: LoadUrlParams,
8411    ) -> fidl::client::QueryResponseFut<
8412        NavigationControllerLoadUrlResult,
8413        fidl::encoding::DefaultFuchsiaResourceDialect,
8414    > {
8415        NavigationControllerProxyInterface::r#load_url(self, url, params)
8416    }
8417
8418    /// Tells the [`Frame`] to navigate to the previous page in its history, if any.
8419    pub fn r#go_back(&self) -> Result<(), fidl::Error> {
8420        NavigationControllerProxyInterface::r#go_back(self)
8421    }
8422
8423    /// Tells the [`Frame`] to navigate to the next page in its history, if any.
8424    pub fn r#go_forward(&self) -> Result<(), fidl::Error> {
8425        NavigationControllerProxyInterface::r#go_forward(self)
8426    }
8427
8428    /// Tells the [`Frame`] to stop the current navigation if a navigation is ongoing.
8429    pub fn r#stop(&self) -> Result<(), fidl::Error> {
8430        NavigationControllerProxyInterface::r#stop(self)
8431    }
8432
8433    /// Tells the [`Frame`] to reload the current page.
8434    pub fn r#reload(&self, mut type_: ReloadType) -> Result<(), fidl::Error> {
8435        NavigationControllerProxyInterface::r#reload(self, type_)
8436    }
8437}
8438
8439impl NavigationControllerProxyInterface for NavigationControllerProxy {
8440    type LoadUrlResponseFut = fidl::client::QueryResponseFut<
8441        NavigationControllerLoadUrlResult,
8442        fidl::encoding::DefaultFuchsiaResourceDialect,
8443    >;
8444    fn r#load_url(&self, mut url: &str, mut params: LoadUrlParams) -> Self::LoadUrlResponseFut {
8445        fn _decode(
8446            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8447        ) -> Result<NavigationControllerLoadUrlResult, fidl::Error> {
8448            let _response = fidl::client::decode_transaction_body::<
8449                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, NavigationControllerError>,
8450                fidl::encoding::DefaultFuchsiaResourceDialect,
8451                0x78f2ab0a480d0182,
8452            >(_buf?)?;
8453            Ok(_response.map(|x| x))
8454        }
8455        self.client.send_query_and_decode::<
8456            NavigationControllerLoadUrlRequest,
8457            NavigationControllerLoadUrlResult,
8458        >(
8459            (url, &mut params,),
8460            0x78f2ab0a480d0182,
8461            fidl::encoding::DynamicFlags::empty(),
8462            _decode,
8463        )
8464    }
8465
8466    fn r#go_back(&self) -> Result<(), fidl::Error> {
8467        self.client.send::<fidl::encoding::EmptyPayload>(
8468            (),
8469            0x2accdd8d87d89c38,
8470            fidl::encoding::DynamicFlags::empty(),
8471        )
8472    }
8473
8474    fn r#go_forward(&self) -> Result<(), fidl::Error> {
8475        self.client.send::<fidl::encoding::EmptyPayload>(
8476            (),
8477            0x39e4ac955ade2781,
8478            fidl::encoding::DynamicFlags::empty(),
8479        )
8480    }
8481
8482    fn r#stop(&self) -> Result<(), fidl::Error> {
8483        self.client.send::<fidl::encoding::EmptyPayload>(
8484            (),
8485            0x2383078ffbe6fea,
8486            fidl::encoding::DynamicFlags::empty(),
8487        )
8488    }
8489
8490    fn r#reload(&self, mut type_: ReloadType) -> Result<(), fidl::Error> {
8491        self.client.send::<NavigationControllerReloadRequest>(
8492            (type_,),
8493            0x33faedfe67d6f00,
8494            fidl::encoding::DynamicFlags::empty(),
8495        )
8496    }
8497}
8498
8499pub struct NavigationControllerEventStream {
8500    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8501}
8502
8503impl std::marker::Unpin for NavigationControllerEventStream {}
8504
8505impl futures::stream::FusedStream for NavigationControllerEventStream {
8506    fn is_terminated(&self) -> bool {
8507        self.event_receiver.is_terminated()
8508    }
8509}
8510
8511impl futures::Stream for NavigationControllerEventStream {
8512    type Item = Result<NavigationControllerEvent, fidl::Error>;
8513
8514    fn poll_next(
8515        mut self: std::pin::Pin<&mut Self>,
8516        cx: &mut std::task::Context<'_>,
8517    ) -> std::task::Poll<Option<Self::Item>> {
8518        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8519            &mut self.event_receiver,
8520            cx
8521        )?) {
8522            Some(buf) => std::task::Poll::Ready(Some(NavigationControllerEvent::decode(buf))),
8523            None => std::task::Poll::Ready(None),
8524        }
8525    }
8526}
8527
8528#[derive(Debug)]
8529pub enum NavigationControllerEvent {}
8530
8531impl NavigationControllerEvent {
8532    /// Decodes a message buffer as a [`NavigationControllerEvent`].
8533    fn decode(
8534        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8535    ) -> Result<NavigationControllerEvent, fidl::Error> {
8536        let (bytes, _handles) = buf.split_mut();
8537        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8538        debug_assert_eq!(tx_header.tx_id, 0);
8539        match tx_header.ordinal {
8540            _ => Err(fidl::Error::UnknownOrdinal {
8541                ordinal: tx_header.ordinal,
8542                protocol_name:
8543                    <NavigationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8544            }),
8545        }
8546    }
8547}
8548
8549/// A Stream of incoming requests for fuchsia.web/NavigationController.
8550pub struct NavigationControllerRequestStream {
8551    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8552    is_terminated: bool,
8553}
8554
8555impl std::marker::Unpin for NavigationControllerRequestStream {}
8556
8557impl futures::stream::FusedStream for NavigationControllerRequestStream {
8558    fn is_terminated(&self) -> bool {
8559        self.is_terminated
8560    }
8561}
8562
8563impl fidl::endpoints::RequestStream for NavigationControllerRequestStream {
8564    type Protocol = NavigationControllerMarker;
8565    type ControlHandle = NavigationControllerControlHandle;
8566
8567    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8568        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8569    }
8570
8571    fn control_handle(&self) -> Self::ControlHandle {
8572        NavigationControllerControlHandle { inner: self.inner.clone() }
8573    }
8574
8575    fn into_inner(
8576        self,
8577    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8578    {
8579        (self.inner, self.is_terminated)
8580    }
8581
8582    fn from_inner(
8583        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8584        is_terminated: bool,
8585    ) -> Self {
8586        Self { inner, is_terminated }
8587    }
8588}
8589
8590impl futures::Stream for NavigationControllerRequestStream {
8591    type Item = Result<NavigationControllerRequest, fidl::Error>;
8592
8593    fn poll_next(
8594        mut self: std::pin::Pin<&mut Self>,
8595        cx: &mut std::task::Context<'_>,
8596    ) -> std::task::Poll<Option<Self::Item>> {
8597        let this = &mut *self;
8598        if this.inner.check_shutdown(cx) {
8599            this.is_terminated = true;
8600            return std::task::Poll::Ready(None);
8601        }
8602        if this.is_terminated {
8603            panic!("polled NavigationControllerRequestStream after completion");
8604        }
8605        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8606            |bytes, handles| {
8607                match this.inner.channel().read_etc(cx, bytes, handles) {
8608                    std::task::Poll::Ready(Ok(())) => {}
8609                    std::task::Poll::Pending => return std::task::Poll::Pending,
8610                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8611                        this.is_terminated = true;
8612                        return std::task::Poll::Ready(None);
8613                    }
8614                    std::task::Poll::Ready(Err(e)) => {
8615                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8616                            e.into(),
8617                        ))));
8618                    }
8619                }
8620
8621                // A message has been received from the channel
8622                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8623
8624                std::task::Poll::Ready(Some(match header.ordinal {
8625                0x78f2ab0a480d0182 => {
8626                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8627                    let mut req = fidl::new_empty!(NavigationControllerLoadUrlRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8628                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NavigationControllerLoadUrlRequest>(&header, _body_bytes, handles, &mut req)?;
8629                    let control_handle = NavigationControllerControlHandle {
8630                        inner: this.inner.clone(),
8631                    };
8632                    Ok(NavigationControllerRequest::LoadUrl {url: req.url,
8633params: req.params,
8634
8635                        responder: NavigationControllerLoadUrlResponder {
8636                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8637                            tx_id: header.tx_id,
8638                        },
8639                    })
8640                }
8641                0x2accdd8d87d89c38 => {
8642                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8643                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
8644                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8645                    let control_handle = NavigationControllerControlHandle {
8646                        inner: this.inner.clone(),
8647                    };
8648                    Ok(NavigationControllerRequest::GoBack {
8649                        control_handle,
8650                    })
8651                }
8652                0x39e4ac955ade2781 => {
8653                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8654                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
8655                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8656                    let control_handle = NavigationControllerControlHandle {
8657                        inner: this.inner.clone(),
8658                    };
8659                    Ok(NavigationControllerRequest::GoForward {
8660                        control_handle,
8661                    })
8662                }
8663                0x2383078ffbe6fea => {
8664                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8665                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
8666                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8667                    let control_handle = NavigationControllerControlHandle {
8668                        inner: this.inner.clone(),
8669                    };
8670                    Ok(NavigationControllerRequest::Stop {
8671                        control_handle,
8672                    })
8673                }
8674                0x33faedfe67d6f00 => {
8675                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8676                    let mut req = fidl::new_empty!(NavigationControllerReloadRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8677                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NavigationControllerReloadRequest>(&header, _body_bytes, handles, &mut req)?;
8678                    let control_handle = NavigationControllerControlHandle {
8679                        inner: this.inner.clone(),
8680                    };
8681                    Ok(NavigationControllerRequest::Reload {type_: req.type_,
8682
8683                        control_handle,
8684                    })
8685                }
8686                _ => Err(fidl::Error::UnknownOrdinal {
8687                    ordinal: header.ordinal,
8688                    protocol_name: <NavigationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8689                }),
8690            }))
8691            },
8692        )
8693    }
8694}
8695
8696/// Provides methods for controlling and querying the navigation state of a [`Frame`].
8697#[derive(Debug)]
8698pub enum NavigationControllerRequest {
8699    /// Tells the [`Frame`] to navigate to a `url`.
8700    ///
8701    /// - `url`: The address to navigate to.
8702    /// - `params`: Additional parameters that affect how the resource will be  loaded (e.g.
8703    ///   cookies, HTTP headers, etc.)
8704    ///
8705    /// If an error occurred, the [`NavigationControllerError`] will be set to one of these values:
8706    /// - `INVALID_URL`: The `url` parameter is invalid.
8707    /// - `INVALID_HEADER`: At least one of the headers in [`LoadUrlParams.headers`] is invalid.
8708    LoadUrl { url: String, params: LoadUrlParams, responder: NavigationControllerLoadUrlResponder },
8709    /// Tells the [`Frame`] to navigate to the previous page in its history, if any.
8710    GoBack { control_handle: NavigationControllerControlHandle },
8711    /// Tells the [`Frame`] to navigate to the next page in its history, if any.
8712    GoForward { control_handle: NavigationControllerControlHandle },
8713    /// Tells the [`Frame`] to stop the current navigation if a navigation is ongoing.
8714    Stop { control_handle: NavigationControllerControlHandle },
8715    /// Tells the [`Frame`] to reload the current page.
8716    Reload { type_: ReloadType, control_handle: NavigationControllerControlHandle },
8717}
8718
8719impl NavigationControllerRequest {
8720    #[allow(irrefutable_let_patterns)]
8721    pub fn into_load_url(
8722        self,
8723    ) -> Option<(String, LoadUrlParams, NavigationControllerLoadUrlResponder)> {
8724        if let NavigationControllerRequest::LoadUrl { url, params, responder } = self {
8725            Some((url, params, responder))
8726        } else {
8727            None
8728        }
8729    }
8730
8731    #[allow(irrefutable_let_patterns)]
8732    pub fn into_go_back(self) -> Option<(NavigationControllerControlHandle)> {
8733        if let NavigationControllerRequest::GoBack { control_handle } = self {
8734            Some((control_handle))
8735        } else {
8736            None
8737        }
8738    }
8739
8740    #[allow(irrefutable_let_patterns)]
8741    pub fn into_go_forward(self) -> Option<(NavigationControllerControlHandle)> {
8742        if let NavigationControllerRequest::GoForward { control_handle } = self {
8743            Some((control_handle))
8744        } else {
8745            None
8746        }
8747    }
8748
8749    #[allow(irrefutable_let_patterns)]
8750    pub fn into_stop(self) -> Option<(NavigationControllerControlHandle)> {
8751        if let NavigationControllerRequest::Stop { control_handle } = self {
8752            Some((control_handle))
8753        } else {
8754            None
8755        }
8756    }
8757
8758    #[allow(irrefutable_let_patterns)]
8759    pub fn into_reload(self) -> Option<(ReloadType, NavigationControllerControlHandle)> {
8760        if let NavigationControllerRequest::Reload { type_, control_handle } = self {
8761            Some((type_, control_handle))
8762        } else {
8763            None
8764        }
8765    }
8766
8767    /// Name of the method defined in FIDL
8768    pub fn method_name(&self) -> &'static str {
8769        match *self {
8770            NavigationControllerRequest::LoadUrl { .. } => "load_url",
8771            NavigationControllerRequest::GoBack { .. } => "go_back",
8772            NavigationControllerRequest::GoForward { .. } => "go_forward",
8773            NavigationControllerRequest::Stop { .. } => "stop",
8774            NavigationControllerRequest::Reload { .. } => "reload",
8775        }
8776    }
8777}
8778
8779#[derive(Debug, Clone)]
8780pub struct NavigationControllerControlHandle {
8781    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8782}
8783
8784impl NavigationControllerControlHandle {
8785    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8786        self.inner.shutdown_with_epitaph(status.into())
8787    }
8788}
8789
8790impl fidl::endpoints::ControlHandle for NavigationControllerControlHandle {
8791    fn shutdown(&self) {
8792        self.inner.shutdown()
8793    }
8794
8795    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8796        self.inner.shutdown_with_epitaph(status)
8797    }
8798
8799    fn is_closed(&self) -> bool {
8800        self.inner.channel().is_closed()
8801    }
8802    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8803        self.inner.channel().on_closed()
8804    }
8805
8806    #[cfg(target_os = "fuchsia")]
8807    fn signal_peer(
8808        &self,
8809        clear_mask: zx::Signals,
8810        set_mask: zx::Signals,
8811    ) -> Result<(), zx_status::Status> {
8812        use fidl::Peered;
8813        self.inner.channel().signal_peer(clear_mask, set_mask)
8814    }
8815}
8816
8817impl NavigationControllerControlHandle {}
8818
8819#[must_use = "FIDL methods require a response to be sent"]
8820#[derive(Debug)]
8821pub struct NavigationControllerLoadUrlResponder {
8822    control_handle: std::mem::ManuallyDrop<NavigationControllerControlHandle>,
8823    tx_id: u32,
8824}
8825
8826/// Set the the channel to be shutdown (see [`NavigationControllerControlHandle::shutdown`])
8827/// if the responder is dropped without sending a response, so that the client
8828/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8829impl std::ops::Drop for NavigationControllerLoadUrlResponder {
8830    fn drop(&mut self) {
8831        self.control_handle.shutdown();
8832        // Safety: drops once, never accessed again
8833        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8834    }
8835}
8836
8837impl fidl::endpoints::Responder for NavigationControllerLoadUrlResponder {
8838    type ControlHandle = NavigationControllerControlHandle;
8839
8840    fn control_handle(&self) -> &NavigationControllerControlHandle {
8841        &self.control_handle
8842    }
8843
8844    fn drop_without_shutdown(mut self) {
8845        // Safety: drops once, never accessed again due to mem::forget
8846        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8847        // Prevent Drop from running (which would shut down the channel)
8848        std::mem::forget(self);
8849    }
8850}
8851
8852impl NavigationControllerLoadUrlResponder {
8853    /// Sends a response to the FIDL transaction.
8854    ///
8855    /// Sets the channel to shutdown if an error occurs.
8856    pub fn send(
8857        self,
8858        mut result: Result<(), NavigationControllerError>,
8859    ) -> Result<(), fidl::Error> {
8860        let _result = self.send_raw(result);
8861        if _result.is_err() {
8862            self.control_handle.shutdown();
8863        }
8864        self.drop_without_shutdown();
8865        _result
8866    }
8867
8868    /// Similar to "send" but does not shutdown the channel if an error occurs.
8869    pub fn send_no_shutdown_on_err(
8870        self,
8871        mut result: Result<(), NavigationControllerError>,
8872    ) -> Result<(), fidl::Error> {
8873        let _result = self.send_raw(result);
8874        self.drop_without_shutdown();
8875        _result
8876    }
8877
8878    fn send_raw(
8879        &self,
8880        mut result: Result<(), NavigationControllerError>,
8881    ) -> Result<(), fidl::Error> {
8882        self.control_handle.inner.send::<fidl::encoding::ResultType<
8883            fidl::encoding::EmptyStruct,
8884            NavigationControllerError,
8885        >>(
8886            result,
8887            self.tx_id,
8888            0x78f2ab0a480d0182,
8889            fidl::encoding::DynamicFlags::empty(),
8890        )
8891    }
8892}
8893
8894#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8895pub struct NavigationEventListenerMarker;
8896
8897impl fidl::endpoints::ProtocolMarker for NavigationEventListenerMarker {
8898    type Proxy = NavigationEventListenerProxy;
8899    type RequestStream = NavigationEventListenerRequestStream;
8900    #[cfg(target_os = "fuchsia")]
8901    type SynchronousProxy = NavigationEventListenerSynchronousProxy;
8902
8903    const DEBUG_NAME: &'static str = "(anonymous) NavigationEventListener";
8904}
8905
8906pub trait NavigationEventListenerProxyInterface: Send + Sync {
8907    type OnNavigationStateChangedResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
8908        + Send;
8909    fn r#on_navigation_state_changed(
8910        &self,
8911        change: NavigationState,
8912    ) -> Self::OnNavigationStateChangedResponseFut;
8913}
8914#[derive(Debug)]
8915#[cfg(target_os = "fuchsia")]
8916pub struct NavigationEventListenerSynchronousProxy {
8917    client: fidl::client::sync::Client,
8918}
8919
8920#[cfg(target_os = "fuchsia")]
8921impl fidl::endpoints::SynchronousProxy for NavigationEventListenerSynchronousProxy {
8922    type Proxy = NavigationEventListenerProxy;
8923    type Protocol = NavigationEventListenerMarker;
8924
8925    fn from_channel(inner: fidl::Channel) -> Self {
8926        Self::new(inner)
8927    }
8928
8929    fn into_channel(self) -> fidl::Channel {
8930        self.client.into_channel()
8931    }
8932
8933    fn as_channel(&self) -> &fidl::Channel {
8934        self.client.as_channel()
8935    }
8936}
8937
8938#[cfg(target_os = "fuchsia")]
8939impl NavigationEventListenerSynchronousProxy {
8940    pub fn new(channel: fidl::Channel) -> Self {
8941        Self { client: fidl::client::sync::Client::new(channel) }
8942    }
8943
8944    pub fn into_channel(self) -> fidl::Channel {
8945        self.client.into_channel()
8946    }
8947
8948    /// Waits until an event arrives and returns it. It is safe for other
8949    /// threads to make concurrent requests while waiting for an event.
8950    pub fn wait_for_event(
8951        &self,
8952        deadline: zx::MonotonicInstant,
8953    ) -> Result<NavigationEventListenerEvent, fidl::Error> {
8954        NavigationEventListenerEvent::decode(
8955            self.client.wait_for_event::<NavigationEventListenerMarker>(deadline)?,
8956        )
8957    }
8958
8959    /// Called immediately after [`Frame.SetNavigationEventListener`] and every time user-visible
8960    /// navigation state has changed. In the first call, `change` contains the current navigation
8961    /// state (empty before the first navigation request). In every following call, `change` will
8962    /// have values set for all fields that have changed at any time since the previous
8963    /// notification. This means that some fields may have the same value as was previously
8964    /// reported, for example, if they changed to some other value and back again. If a field is
8965    /// unset, then its value has not changed at any time since the previous notification.
8966    ///
8967    /// Implementer must call the acknowledgement callback to receive new navigation events.
8968    pub fn r#on_navigation_state_changed(
8969        &self,
8970        mut change: NavigationState,
8971        ___deadline: zx::MonotonicInstant,
8972    ) -> Result<(), fidl::Error> {
8973        let _response = self.client.send_query::<
8974            NavigationEventListenerOnNavigationStateChangedRequest,
8975            fidl::encoding::EmptyPayload,
8976            NavigationEventListenerMarker,
8977        >(
8978            (&mut change,),
8979            0x453ac6bcbc82fbb6,
8980            fidl::encoding::DynamicFlags::empty(),
8981            ___deadline,
8982        )?;
8983        Ok(_response)
8984    }
8985}
8986
8987#[cfg(target_os = "fuchsia")]
8988impl From<NavigationEventListenerSynchronousProxy> for zx::NullableHandle {
8989    fn from(value: NavigationEventListenerSynchronousProxy) -> Self {
8990        value.into_channel().into()
8991    }
8992}
8993
8994#[cfg(target_os = "fuchsia")]
8995impl From<fidl::Channel> for NavigationEventListenerSynchronousProxy {
8996    fn from(value: fidl::Channel) -> Self {
8997        Self::new(value)
8998    }
8999}
9000
9001#[cfg(target_os = "fuchsia")]
9002impl fidl::endpoints::FromClient for NavigationEventListenerSynchronousProxy {
9003    type Protocol = NavigationEventListenerMarker;
9004
9005    fn from_client(value: fidl::endpoints::ClientEnd<NavigationEventListenerMarker>) -> Self {
9006        Self::new(value.into_channel())
9007    }
9008}
9009
9010#[derive(Debug, Clone)]
9011pub struct NavigationEventListenerProxy {
9012    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9013}
9014
9015impl fidl::endpoints::Proxy for NavigationEventListenerProxy {
9016    type Protocol = NavigationEventListenerMarker;
9017
9018    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9019        Self::new(inner)
9020    }
9021
9022    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9023        self.client.into_channel().map_err(|client| Self { client })
9024    }
9025
9026    fn as_channel(&self) -> &::fidl::AsyncChannel {
9027        self.client.as_channel()
9028    }
9029}
9030
9031impl NavigationEventListenerProxy {
9032    /// Create a new Proxy for fuchsia.web/NavigationEventListener.
9033    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9034        let protocol_name =
9035            <NavigationEventListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9036        Self { client: fidl::client::Client::new(channel, protocol_name) }
9037    }
9038
9039    /// Get a Stream of events from the remote end of the protocol.
9040    ///
9041    /// # Panics
9042    ///
9043    /// Panics if the event stream was already taken.
9044    pub fn take_event_stream(&self) -> NavigationEventListenerEventStream {
9045        NavigationEventListenerEventStream { event_receiver: self.client.take_event_receiver() }
9046    }
9047
9048    /// Called immediately after [`Frame.SetNavigationEventListener`] and every time user-visible
9049    /// navigation state has changed. In the first call, `change` contains the current navigation
9050    /// state (empty before the first navigation request). In every following call, `change` will
9051    /// have values set for all fields that have changed at any time since the previous
9052    /// notification. This means that some fields may have the same value as was previously
9053    /// reported, for example, if they changed to some other value and back again. If a field is
9054    /// unset, then its value has not changed at any time since the previous notification.
9055    ///
9056    /// Implementer must call the acknowledgement callback to receive new navigation events.
9057    pub fn r#on_navigation_state_changed(
9058        &self,
9059        mut change: NavigationState,
9060    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9061        NavigationEventListenerProxyInterface::r#on_navigation_state_changed(self, change)
9062    }
9063}
9064
9065impl NavigationEventListenerProxyInterface for NavigationEventListenerProxy {
9066    type OnNavigationStateChangedResponseFut =
9067        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9068    fn r#on_navigation_state_changed(
9069        &self,
9070        mut change: NavigationState,
9071    ) -> Self::OnNavigationStateChangedResponseFut {
9072        fn _decode(
9073            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9074        ) -> Result<(), fidl::Error> {
9075            let _response = fidl::client::decode_transaction_body::<
9076                fidl::encoding::EmptyPayload,
9077                fidl::encoding::DefaultFuchsiaResourceDialect,
9078                0x453ac6bcbc82fbb6,
9079            >(_buf?)?;
9080            Ok(_response)
9081        }
9082        self.client
9083            .send_query_and_decode::<NavigationEventListenerOnNavigationStateChangedRequest, ()>(
9084                (&mut change,),
9085                0x453ac6bcbc82fbb6,
9086                fidl::encoding::DynamicFlags::empty(),
9087                _decode,
9088            )
9089    }
9090}
9091
9092pub struct NavigationEventListenerEventStream {
9093    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9094}
9095
9096impl std::marker::Unpin for NavigationEventListenerEventStream {}
9097
9098impl futures::stream::FusedStream for NavigationEventListenerEventStream {
9099    fn is_terminated(&self) -> bool {
9100        self.event_receiver.is_terminated()
9101    }
9102}
9103
9104impl futures::Stream for NavigationEventListenerEventStream {
9105    type Item = Result<NavigationEventListenerEvent, fidl::Error>;
9106
9107    fn poll_next(
9108        mut self: std::pin::Pin<&mut Self>,
9109        cx: &mut std::task::Context<'_>,
9110    ) -> std::task::Poll<Option<Self::Item>> {
9111        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9112            &mut self.event_receiver,
9113            cx
9114        )?) {
9115            Some(buf) => std::task::Poll::Ready(Some(NavigationEventListenerEvent::decode(buf))),
9116            None => std::task::Poll::Ready(None),
9117        }
9118    }
9119}
9120
9121#[derive(Debug)]
9122pub enum NavigationEventListenerEvent {}
9123
9124impl NavigationEventListenerEvent {
9125    /// Decodes a message buffer as a [`NavigationEventListenerEvent`].
9126    fn decode(
9127        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9128    ) -> Result<NavigationEventListenerEvent, fidl::Error> {
9129        let (bytes, _handles) = buf.split_mut();
9130        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9131        debug_assert_eq!(tx_header.tx_id, 0);
9132        match tx_header.ordinal {
9133            _ => Err(fidl::Error::UnknownOrdinal {
9134                ordinal: tx_header.ordinal,
9135                protocol_name:
9136                    <NavigationEventListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9137            }),
9138        }
9139    }
9140}
9141
9142/// A Stream of incoming requests for fuchsia.web/NavigationEventListener.
9143pub struct NavigationEventListenerRequestStream {
9144    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9145    is_terminated: bool,
9146}
9147
9148impl std::marker::Unpin for NavigationEventListenerRequestStream {}
9149
9150impl futures::stream::FusedStream for NavigationEventListenerRequestStream {
9151    fn is_terminated(&self) -> bool {
9152        self.is_terminated
9153    }
9154}
9155
9156impl fidl::endpoints::RequestStream for NavigationEventListenerRequestStream {
9157    type Protocol = NavigationEventListenerMarker;
9158    type ControlHandle = NavigationEventListenerControlHandle;
9159
9160    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9161        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9162    }
9163
9164    fn control_handle(&self) -> Self::ControlHandle {
9165        NavigationEventListenerControlHandle { inner: self.inner.clone() }
9166    }
9167
9168    fn into_inner(
9169        self,
9170    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9171    {
9172        (self.inner, self.is_terminated)
9173    }
9174
9175    fn from_inner(
9176        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9177        is_terminated: bool,
9178    ) -> Self {
9179        Self { inner, is_terminated }
9180    }
9181}
9182
9183impl futures::Stream for NavigationEventListenerRequestStream {
9184    type Item = Result<NavigationEventListenerRequest, fidl::Error>;
9185
9186    fn poll_next(
9187        mut self: std::pin::Pin<&mut Self>,
9188        cx: &mut std::task::Context<'_>,
9189    ) -> std::task::Poll<Option<Self::Item>> {
9190        let this = &mut *self;
9191        if this.inner.check_shutdown(cx) {
9192            this.is_terminated = true;
9193            return std::task::Poll::Ready(None);
9194        }
9195        if this.is_terminated {
9196            panic!("polled NavigationEventListenerRequestStream after completion");
9197        }
9198        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9199            |bytes, handles| {
9200                match this.inner.channel().read_etc(cx, bytes, handles) {
9201                    std::task::Poll::Ready(Ok(())) => {}
9202                    std::task::Poll::Pending => return std::task::Poll::Pending,
9203                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9204                        this.is_terminated = true;
9205                        return std::task::Poll::Ready(None);
9206                    }
9207                    std::task::Poll::Ready(Err(e)) => {
9208                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9209                            e.into(),
9210                        ))));
9211                    }
9212                }
9213
9214                // A message has been received from the channel
9215                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9216
9217                std::task::Poll::Ready(Some(match header.ordinal {
9218                0x453ac6bcbc82fbb6 => {
9219                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9220                    let mut req = fidl::new_empty!(NavigationEventListenerOnNavigationStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9221                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NavigationEventListenerOnNavigationStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
9222                    let control_handle = NavigationEventListenerControlHandle {
9223                        inner: this.inner.clone(),
9224                    };
9225                    Ok(NavigationEventListenerRequest::OnNavigationStateChanged {change: req.change,
9226
9227                        responder: NavigationEventListenerOnNavigationStateChangedResponder {
9228                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9229                            tx_id: header.tx_id,
9230                        },
9231                    })
9232                }
9233                _ => Err(fidl::Error::UnknownOrdinal {
9234                    ordinal: header.ordinal,
9235                    protocol_name: <NavigationEventListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9236                }),
9237            }))
9238            },
9239        )
9240    }
9241}
9242
9243/// Interface supplied by the embedder for receiving notifications about navigation events in a
9244/// [`Frame`].
9245#[derive(Debug)]
9246pub enum NavigationEventListenerRequest {
9247    /// Called immediately after [`Frame.SetNavigationEventListener`] and every time user-visible
9248    /// navigation state has changed. In the first call, `change` contains the current navigation
9249    /// state (empty before the first navigation request). In every following call, `change` will
9250    /// have values set for all fields that have changed at any time since the previous
9251    /// notification. This means that some fields may have the same value as was previously
9252    /// reported, for example, if they changed to some other value and back again. If a field is
9253    /// unset, then its value has not changed at any time since the previous notification.
9254    ///
9255    /// Implementer must call the acknowledgement callback to receive new navigation events.
9256    OnNavigationStateChanged {
9257        change: NavigationState,
9258        responder: NavigationEventListenerOnNavigationStateChangedResponder,
9259    },
9260}
9261
9262impl NavigationEventListenerRequest {
9263    #[allow(irrefutable_let_patterns)]
9264    pub fn into_on_navigation_state_changed(
9265        self,
9266    ) -> Option<(NavigationState, NavigationEventListenerOnNavigationStateChangedResponder)> {
9267        if let NavigationEventListenerRequest::OnNavigationStateChanged { change, responder } = self
9268        {
9269            Some((change, responder))
9270        } else {
9271            None
9272        }
9273    }
9274
9275    /// Name of the method defined in FIDL
9276    pub fn method_name(&self) -> &'static str {
9277        match *self {
9278            NavigationEventListenerRequest::OnNavigationStateChanged { .. } => {
9279                "on_navigation_state_changed"
9280            }
9281        }
9282    }
9283}
9284
9285#[derive(Debug, Clone)]
9286pub struct NavigationEventListenerControlHandle {
9287    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9288}
9289
9290impl NavigationEventListenerControlHandle {
9291    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
9292        self.inner.shutdown_with_epitaph(status.into())
9293    }
9294}
9295
9296impl fidl::endpoints::ControlHandle for NavigationEventListenerControlHandle {
9297    fn shutdown(&self) {
9298        self.inner.shutdown()
9299    }
9300
9301    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
9302        self.inner.shutdown_with_epitaph(status)
9303    }
9304
9305    fn is_closed(&self) -> bool {
9306        self.inner.channel().is_closed()
9307    }
9308    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9309        self.inner.channel().on_closed()
9310    }
9311
9312    #[cfg(target_os = "fuchsia")]
9313    fn signal_peer(
9314        &self,
9315        clear_mask: zx::Signals,
9316        set_mask: zx::Signals,
9317    ) -> Result<(), zx_status::Status> {
9318        use fidl::Peered;
9319        self.inner.channel().signal_peer(clear_mask, set_mask)
9320    }
9321}
9322
9323impl NavigationEventListenerControlHandle {}
9324
9325#[must_use = "FIDL methods require a response to be sent"]
9326#[derive(Debug)]
9327pub struct NavigationEventListenerOnNavigationStateChangedResponder {
9328    control_handle: std::mem::ManuallyDrop<NavigationEventListenerControlHandle>,
9329    tx_id: u32,
9330}
9331
9332/// Set the the channel to be shutdown (see [`NavigationEventListenerControlHandle::shutdown`])
9333/// if the responder is dropped without sending a response, so that the client
9334/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9335impl std::ops::Drop for NavigationEventListenerOnNavigationStateChangedResponder {
9336    fn drop(&mut self) {
9337        self.control_handle.shutdown();
9338        // Safety: drops once, never accessed again
9339        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9340    }
9341}
9342
9343impl fidl::endpoints::Responder for NavigationEventListenerOnNavigationStateChangedResponder {
9344    type ControlHandle = NavigationEventListenerControlHandle;
9345
9346    fn control_handle(&self) -> &NavigationEventListenerControlHandle {
9347        &self.control_handle
9348    }
9349
9350    fn drop_without_shutdown(mut self) {
9351        // Safety: drops once, never accessed again due to mem::forget
9352        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9353        // Prevent Drop from running (which would shut down the channel)
9354        std::mem::forget(self);
9355    }
9356}
9357
9358impl NavigationEventListenerOnNavigationStateChangedResponder {
9359    /// Sends a response to the FIDL transaction.
9360    ///
9361    /// Sets the channel to shutdown if an error occurs.
9362    pub fn send(self) -> Result<(), fidl::Error> {
9363        let _result = self.send_raw();
9364        if _result.is_err() {
9365            self.control_handle.shutdown();
9366        }
9367        self.drop_without_shutdown();
9368        _result
9369    }
9370
9371    /// Similar to "send" but does not shutdown the channel if an error occurs.
9372    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9373        let _result = self.send_raw();
9374        self.drop_without_shutdown();
9375        _result
9376    }
9377
9378    fn send_raw(&self) -> Result<(), fidl::Error> {
9379        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9380            (),
9381            self.tx_id,
9382            0x453ac6bcbc82fbb6,
9383            fidl::encoding::DynamicFlags::empty(),
9384        )
9385    }
9386}
9387
9388#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9389pub struct NavigationPolicyProviderMarker;
9390
9391impl fidl::endpoints::ProtocolMarker for NavigationPolicyProviderMarker {
9392    type Proxy = NavigationPolicyProviderProxy;
9393    type RequestStream = NavigationPolicyProviderRequestStream;
9394    #[cfg(target_os = "fuchsia")]
9395    type SynchronousProxy = NavigationPolicyProviderSynchronousProxy;
9396
9397    const DEBUG_NAME: &'static str = "(anonymous) NavigationPolicyProvider";
9398}
9399
9400pub trait NavigationPolicyProviderProxyInterface: Send + Sync {
9401    type EvaluateRequestedNavigationResponseFut: std::future::Future<Output = Result<NavigationDecision, fidl::Error>>
9402        + Send;
9403    fn r#evaluate_requested_navigation(
9404        &self,
9405        requested_navigation: &RequestedNavigation,
9406    ) -> Self::EvaluateRequestedNavigationResponseFut;
9407}
9408#[derive(Debug)]
9409#[cfg(target_os = "fuchsia")]
9410pub struct NavigationPolicyProviderSynchronousProxy {
9411    client: fidl::client::sync::Client,
9412}
9413
9414#[cfg(target_os = "fuchsia")]
9415impl fidl::endpoints::SynchronousProxy for NavigationPolicyProviderSynchronousProxy {
9416    type Proxy = NavigationPolicyProviderProxy;
9417    type Protocol = NavigationPolicyProviderMarker;
9418
9419    fn from_channel(inner: fidl::Channel) -> Self {
9420        Self::new(inner)
9421    }
9422
9423    fn into_channel(self) -> fidl::Channel {
9424        self.client.into_channel()
9425    }
9426
9427    fn as_channel(&self) -> &fidl::Channel {
9428        self.client.as_channel()
9429    }
9430}
9431
9432#[cfg(target_os = "fuchsia")]
9433impl NavigationPolicyProviderSynchronousProxy {
9434    pub fn new(channel: fidl::Channel) -> Self {
9435        Self { client: fidl::client::sync::Client::new(channel) }
9436    }
9437
9438    pub fn into_channel(self) -> fidl::Channel {
9439        self.client.into_channel()
9440    }
9441
9442    /// Waits until an event arrives and returns it. It is safe for other
9443    /// threads to make concurrent requests while waiting for an event.
9444    pub fn wait_for_event(
9445        &self,
9446        deadline: zx::MonotonicInstant,
9447    ) -> Result<NavigationPolicyProviderEvent, fidl::Error> {
9448        NavigationPolicyProviderEvent::decode(
9449            self.client.wait_for_event::<NavigationPolicyProviderMarker>(deadline)?,
9450        )
9451    }
9452
9453    /// Called when the [`Frame`] is processing a navigation request in one of the phase(s)
9454    /// specified in [`NavigationPolicyProviderParams`]. Navigation is paused until the result is
9455    /// received. The returned [`NavigationDecision`] defines how the navigation should proceed.
9456    pub fn r#evaluate_requested_navigation(
9457        &self,
9458        mut requested_navigation: &RequestedNavigation,
9459        ___deadline: zx::MonotonicInstant,
9460    ) -> Result<NavigationDecision, fidl::Error> {
9461        let _response = self.client.send_query::<
9462            NavigationPolicyProviderEvaluateRequestedNavigationRequest,
9463            NavigationPolicyProviderEvaluateRequestedNavigationResponse,
9464            NavigationPolicyProviderMarker,
9465        >(
9466            (requested_navigation,),
9467            0x54446b50cf3512b6,
9468            fidl::encoding::DynamicFlags::empty(),
9469            ___deadline,
9470        )?;
9471        Ok(_response.decision)
9472    }
9473}
9474
9475#[cfg(target_os = "fuchsia")]
9476impl From<NavigationPolicyProviderSynchronousProxy> for zx::NullableHandle {
9477    fn from(value: NavigationPolicyProviderSynchronousProxy) -> Self {
9478        value.into_channel().into()
9479    }
9480}
9481
9482#[cfg(target_os = "fuchsia")]
9483impl From<fidl::Channel> for NavigationPolicyProviderSynchronousProxy {
9484    fn from(value: fidl::Channel) -> Self {
9485        Self::new(value)
9486    }
9487}
9488
9489#[cfg(target_os = "fuchsia")]
9490impl fidl::endpoints::FromClient for NavigationPolicyProviderSynchronousProxy {
9491    type Protocol = NavigationPolicyProviderMarker;
9492
9493    fn from_client(value: fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>) -> Self {
9494        Self::new(value.into_channel())
9495    }
9496}
9497
9498#[derive(Debug, Clone)]
9499pub struct NavigationPolicyProviderProxy {
9500    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9501}
9502
9503impl fidl::endpoints::Proxy for NavigationPolicyProviderProxy {
9504    type Protocol = NavigationPolicyProviderMarker;
9505
9506    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9507        Self::new(inner)
9508    }
9509
9510    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9511        self.client.into_channel().map_err(|client| Self { client })
9512    }
9513
9514    fn as_channel(&self) -> &::fidl::AsyncChannel {
9515        self.client.as_channel()
9516    }
9517}
9518
9519impl NavigationPolicyProviderProxy {
9520    /// Create a new Proxy for fuchsia.web/NavigationPolicyProvider.
9521    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9522        let protocol_name =
9523            <NavigationPolicyProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9524        Self { client: fidl::client::Client::new(channel, protocol_name) }
9525    }
9526
9527    /// Get a Stream of events from the remote end of the protocol.
9528    ///
9529    /// # Panics
9530    ///
9531    /// Panics if the event stream was already taken.
9532    pub fn take_event_stream(&self) -> NavigationPolicyProviderEventStream {
9533        NavigationPolicyProviderEventStream { event_receiver: self.client.take_event_receiver() }
9534    }
9535
9536    /// Called when the [`Frame`] is processing a navigation request in one of the phase(s)
9537    /// specified in [`NavigationPolicyProviderParams`]. Navigation is paused until the result is
9538    /// received. The returned [`NavigationDecision`] defines how the navigation should proceed.
9539    pub fn r#evaluate_requested_navigation(
9540        &self,
9541        mut requested_navigation: &RequestedNavigation,
9542    ) -> fidl::client::QueryResponseFut<
9543        NavigationDecision,
9544        fidl::encoding::DefaultFuchsiaResourceDialect,
9545    > {
9546        NavigationPolicyProviderProxyInterface::r#evaluate_requested_navigation(
9547            self,
9548            requested_navigation,
9549        )
9550    }
9551}
9552
9553impl NavigationPolicyProviderProxyInterface for NavigationPolicyProviderProxy {
9554    type EvaluateRequestedNavigationResponseFut = fidl::client::QueryResponseFut<
9555        NavigationDecision,
9556        fidl::encoding::DefaultFuchsiaResourceDialect,
9557    >;
9558    fn r#evaluate_requested_navigation(
9559        &self,
9560        mut requested_navigation: &RequestedNavigation,
9561    ) -> Self::EvaluateRequestedNavigationResponseFut {
9562        fn _decode(
9563            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9564        ) -> Result<NavigationDecision, fidl::Error> {
9565            let _response = fidl::client::decode_transaction_body::<
9566                NavigationPolicyProviderEvaluateRequestedNavigationResponse,
9567                fidl::encoding::DefaultFuchsiaResourceDialect,
9568                0x54446b50cf3512b6,
9569            >(_buf?)?;
9570            Ok(_response.decision)
9571        }
9572        self.client.send_query_and_decode::<
9573            NavigationPolicyProviderEvaluateRequestedNavigationRequest,
9574            NavigationDecision,
9575        >(
9576            (requested_navigation,),
9577            0x54446b50cf3512b6,
9578            fidl::encoding::DynamicFlags::empty(),
9579            _decode,
9580        )
9581    }
9582}
9583
9584pub struct NavigationPolicyProviderEventStream {
9585    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9586}
9587
9588impl std::marker::Unpin for NavigationPolicyProviderEventStream {}
9589
9590impl futures::stream::FusedStream for NavigationPolicyProviderEventStream {
9591    fn is_terminated(&self) -> bool {
9592        self.event_receiver.is_terminated()
9593    }
9594}
9595
9596impl futures::Stream for NavigationPolicyProviderEventStream {
9597    type Item = Result<NavigationPolicyProviderEvent, fidl::Error>;
9598
9599    fn poll_next(
9600        mut self: std::pin::Pin<&mut Self>,
9601        cx: &mut std::task::Context<'_>,
9602    ) -> std::task::Poll<Option<Self::Item>> {
9603        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9604            &mut self.event_receiver,
9605            cx
9606        )?) {
9607            Some(buf) => std::task::Poll::Ready(Some(NavigationPolicyProviderEvent::decode(buf))),
9608            None => std::task::Poll::Ready(None),
9609        }
9610    }
9611}
9612
9613#[derive(Debug)]
9614pub enum NavigationPolicyProviderEvent {}
9615
9616impl NavigationPolicyProviderEvent {
9617    /// Decodes a message buffer as a [`NavigationPolicyProviderEvent`].
9618    fn decode(
9619        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9620    ) -> Result<NavigationPolicyProviderEvent, fidl::Error> {
9621        let (bytes, _handles) = buf.split_mut();
9622        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9623        debug_assert_eq!(tx_header.tx_id, 0);
9624        match tx_header.ordinal {
9625            _ => Err(fidl::Error::UnknownOrdinal {
9626                ordinal: tx_header.ordinal,
9627                protocol_name:
9628                    <NavigationPolicyProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9629            }),
9630        }
9631    }
9632}
9633
9634/// A Stream of incoming requests for fuchsia.web/NavigationPolicyProvider.
9635pub struct NavigationPolicyProviderRequestStream {
9636    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9637    is_terminated: bool,
9638}
9639
9640impl std::marker::Unpin for NavigationPolicyProviderRequestStream {}
9641
9642impl futures::stream::FusedStream for NavigationPolicyProviderRequestStream {
9643    fn is_terminated(&self) -> bool {
9644        self.is_terminated
9645    }
9646}
9647
9648impl fidl::endpoints::RequestStream for NavigationPolicyProviderRequestStream {
9649    type Protocol = NavigationPolicyProviderMarker;
9650    type ControlHandle = NavigationPolicyProviderControlHandle;
9651
9652    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9653        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9654    }
9655
9656    fn control_handle(&self) -> Self::ControlHandle {
9657        NavigationPolicyProviderControlHandle { inner: self.inner.clone() }
9658    }
9659
9660    fn into_inner(
9661        self,
9662    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9663    {
9664        (self.inner, self.is_terminated)
9665    }
9666
9667    fn from_inner(
9668        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9669        is_terminated: bool,
9670    ) -> Self {
9671        Self { inner, is_terminated }
9672    }
9673}
9674
9675impl futures::Stream for NavigationPolicyProviderRequestStream {
9676    type Item = Result<NavigationPolicyProviderRequest, fidl::Error>;
9677
9678    fn poll_next(
9679        mut self: std::pin::Pin<&mut Self>,
9680        cx: &mut std::task::Context<'_>,
9681    ) -> std::task::Poll<Option<Self::Item>> {
9682        let this = &mut *self;
9683        if this.inner.check_shutdown(cx) {
9684            this.is_terminated = true;
9685            return std::task::Poll::Ready(None);
9686        }
9687        if this.is_terminated {
9688            panic!("polled NavigationPolicyProviderRequestStream after completion");
9689        }
9690        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9691            |bytes, handles| {
9692                match this.inner.channel().read_etc(cx, bytes, handles) {
9693                    std::task::Poll::Ready(Ok(())) => {}
9694                    std::task::Poll::Pending => return std::task::Poll::Pending,
9695                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9696                        this.is_terminated = true;
9697                        return std::task::Poll::Ready(None);
9698                    }
9699                    std::task::Poll::Ready(Err(e)) => {
9700                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9701                            e.into(),
9702                        ))));
9703                    }
9704                }
9705
9706                // A message has been received from the channel
9707                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9708
9709                std::task::Poll::Ready(Some(match header.ordinal {
9710                0x54446b50cf3512b6 => {
9711                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9712                    let mut req = fidl::new_empty!(NavigationPolicyProviderEvaluateRequestedNavigationRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9713                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NavigationPolicyProviderEvaluateRequestedNavigationRequest>(&header, _body_bytes, handles, &mut req)?;
9714                    let control_handle = NavigationPolicyProviderControlHandle {
9715                        inner: this.inner.clone(),
9716                    };
9717                    Ok(NavigationPolicyProviderRequest::EvaluateRequestedNavigation {requested_navigation: req.requested_navigation,
9718
9719                        responder: NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9720                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9721                            tx_id: header.tx_id,
9722                        },
9723                    })
9724                }
9725                _ => Err(fidl::Error::UnknownOrdinal {
9726                    ordinal: header.ordinal,
9727                    protocol_name: <NavigationPolicyProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9728                }),
9729            }))
9730            },
9731        )
9732    }
9733}
9734
9735#[derive(Debug)]
9736pub enum NavigationPolicyProviderRequest {
9737    /// Called when the [`Frame`] is processing a navigation request in one of the phase(s)
9738    /// specified in [`NavigationPolicyProviderParams`]. Navigation is paused until the result is
9739    /// received. The returned [`NavigationDecision`] defines how the navigation should proceed.
9740    EvaluateRequestedNavigation {
9741        requested_navigation: RequestedNavigation,
9742        responder: NavigationPolicyProviderEvaluateRequestedNavigationResponder,
9743    },
9744}
9745
9746impl NavigationPolicyProviderRequest {
9747    #[allow(irrefutable_let_patterns)]
9748    pub fn into_evaluate_requested_navigation(
9749        self,
9750    ) -> Option<(RequestedNavigation, NavigationPolicyProviderEvaluateRequestedNavigationResponder)>
9751    {
9752        if let NavigationPolicyProviderRequest::EvaluateRequestedNavigation {
9753            requested_navigation,
9754            responder,
9755        } = self
9756        {
9757            Some((requested_navigation, responder))
9758        } else {
9759            None
9760        }
9761    }
9762
9763    /// Name of the method defined in FIDL
9764    pub fn method_name(&self) -> &'static str {
9765        match *self {
9766            NavigationPolicyProviderRequest::EvaluateRequestedNavigation { .. } => {
9767                "evaluate_requested_navigation"
9768            }
9769        }
9770    }
9771}
9772
9773#[derive(Debug, Clone)]
9774pub struct NavigationPolicyProviderControlHandle {
9775    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9776}
9777
9778impl NavigationPolicyProviderControlHandle {
9779    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
9780        self.inner.shutdown_with_epitaph(status.into())
9781    }
9782}
9783
9784impl fidl::endpoints::ControlHandle for NavigationPolicyProviderControlHandle {
9785    fn shutdown(&self) {
9786        self.inner.shutdown()
9787    }
9788
9789    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
9790        self.inner.shutdown_with_epitaph(status)
9791    }
9792
9793    fn is_closed(&self) -> bool {
9794        self.inner.channel().is_closed()
9795    }
9796    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9797        self.inner.channel().on_closed()
9798    }
9799
9800    #[cfg(target_os = "fuchsia")]
9801    fn signal_peer(
9802        &self,
9803        clear_mask: zx::Signals,
9804        set_mask: zx::Signals,
9805    ) -> Result<(), zx_status::Status> {
9806        use fidl::Peered;
9807        self.inner.channel().signal_peer(clear_mask, set_mask)
9808    }
9809}
9810
9811impl NavigationPolicyProviderControlHandle {}
9812
9813#[must_use = "FIDL methods require a response to be sent"]
9814#[derive(Debug)]
9815pub struct NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9816    control_handle: std::mem::ManuallyDrop<NavigationPolicyProviderControlHandle>,
9817    tx_id: u32,
9818}
9819
9820/// Set the the channel to be shutdown (see [`NavigationPolicyProviderControlHandle::shutdown`])
9821/// if the responder is dropped without sending a response, so that the client
9822/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9823impl std::ops::Drop for NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9824    fn drop(&mut self) {
9825        self.control_handle.shutdown();
9826        // Safety: drops once, never accessed again
9827        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9828    }
9829}
9830
9831impl fidl::endpoints::Responder for NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9832    type ControlHandle = NavigationPolicyProviderControlHandle;
9833
9834    fn control_handle(&self) -> &NavigationPolicyProviderControlHandle {
9835        &self.control_handle
9836    }
9837
9838    fn drop_without_shutdown(mut self) {
9839        // Safety: drops once, never accessed again due to mem::forget
9840        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9841        // Prevent Drop from running (which would shut down the channel)
9842        std::mem::forget(self);
9843    }
9844}
9845
9846impl NavigationPolicyProviderEvaluateRequestedNavigationResponder {
9847    /// Sends a response to the FIDL transaction.
9848    ///
9849    /// Sets the channel to shutdown if an error occurs.
9850    pub fn send(self, mut decision: NavigationDecision) -> Result<(), fidl::Error> {
9851        let _result = self.send_raw(decision);
9852        if _result.is_err() {
9853            self.control_handle.shutdown();
9854        }
9855        self.drop_without_shutdown();
9856        _result
9857    }
9858
9859    /// Similar to "send" but does not shutdown the channel if an error occurs.
9860    pub fn send_no_shutdown_on_err(
9861        self,
9862        mut decision: NavigationDecision,
9863    ) -> Result<(), fidl::Error> {
9864        let _result = self.send_raw(decision);
9865        self.drop_without_shutdown();
9866        _result
9867    }
9868
9869    fn send_raw(&self, mut decision: NavigationDecision) -> Result<(), fidl::Error> {
9870        self.control_handle
9871            .inner
9872            .send::<NavigationPolicyProviderEvaluateRequestedNavigationResponse>(
9873                (&mut decision,),
9874                self.tx_id,
9875                0x54446b50cf3512b6,
9876                fidl::encoding::DynamicFlags::empty(),
9877            )
9878    }
9879}
9880
9881#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9882pub struct PopupFrameCreationListenerMarker;
9883
9884impl fidl::endpoints::ProtocolMarker for PopupFrameCreationListenerMarker {
9885    type Proxy = PopupFrameCreationListenerProxy;
9886    type RequestStream = PopupFrameCreationListenerRequestStream;
9887    #[cfg(target_os = "fuchsia")]
9888    type SynchronousProxy = PopupFrameCreationListenerSynchronousProxy;
9889
9890    const DEBUG_NAME: &'static str = "(anonymous) PopupFrameCreationListener";
9891}
9892
9893pub trait PopupFrameCreationListenerProxyInterface: Send + Sync {
9894    type OnPopupFrameCreatedResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
9895        + Send;
9896    fn r#on_popup_frame_created(
9897        &self,
9898        frame: fidl::endpoints::ClientEnd<FrameMarker>,
9899        info: PopupFrameCreationInfo,
9900    ) -> Self::OnPopupFrameCreatedResponseFut;
9901}
9902#[derive(Debug)]
9903#[cfg(target_os = "fuchsia")]
9904pub struct PopupFrameCreationListenerSynchronousProxy {
9905    client: fidl::client::sync::Client,
9906}
9907
9908#[cfg(target_os = "fuchsia")]
9909impl fidl::endpoints::SynchronousProxy for PopupFrameCreationListenerSynchronousProxy {
9910    type Proxy = PopupFrameCreationListenerProxy;
9911    type Protocol = PopupFrameCreationListenerMarker;
9912
9913    fn from_channel(inner: fidl::Channel) -> Self {
9914        Self::new(inner)
9915    }
9916
9917    fn into_channel(self) -> fidl::Channel {
9918        self.client.into_channel()
9919    }
9920
9921    fn as_channel(&self) -> &fidl::Channel {
9922        self.client.as_channel()
9923    }
9924}
9925
9926#[cfg(target_os = "fuchsia")]
9927impl PopupFrameCreationListenerSynchronousProxy {
9928    pub fn new(channel: fidl::Channel) -> Self {
9929        Self { client: fidl::client::sync::Client::new(channel) }
9930    }
9931
9932    pub fn into_channel(self) -> fidl::Channel {
9933        self.client.into_channel()
9934    }
9935
9936    /// Waits until an event arrives and returns it. It is safe for other
9937    /// threads to make concurrent requests while waiting for an event.
9938    pub fn wait_for_event(
9939        &self,
9940        deadline: zx::MonotonicInstant,
9941    ) -> Result<PopupFrameCreationListenerEvent, fidl::Error> {
9942        PopupFrameCreationListenerEvent::decode(
9943            self.client.wait_for_event::<PopupFrameCreationListenerMarker>(deadline)?,
9944        )
9945    }
9946
9947    /// Called when a [`Frame`] has created a new popup `frame`. Information about the popup frame,
9948    /// and how it was created, is provided via `info`. Additional popup frames are delivered after
9949    /// the acknowledgement callback is invoked.
9950    pub fn r#on_popup_frame_created(
9951        &self,
9952        mut frame: fidl::endpoints::ClientEnd<FrameMarker>,
9953        mut info: PopupFrameCreationInfo,
9954        ___deadline: zx::MonotonicInstant,
9955    ) -> Result<(), fidl::Error> {
9956        let _response = self.client.send_query::<
9957            PopupFrameCreationListenerOnPopupFrameCreatedRequest,
9958            fidl::encoding::EmptyPayload,
9959            PopupFrameCreationListenerMarker,
9960        >(
9961            (frame, &mut info,),
9962            0x19b212672dc41d51,
9963            fidl::encoding::DynamicFlags::empty(),
9964            ___deadline,
9965        )?;
9966        Ok(_response)
9967    }
9968}
9969
9970#[cfg(target_os = "fuchsia")]
9971impl From<PopupFrameCreationListenerSynchronousProxy> for zx::NullableHandle {
9972    fn from(value: PopupFrameCreationListenerSynchronousProxy) -> Self {
9973        value.into_channel().into()
9974    }
9975}
9976
9977#[cfg(target_os = "fuchsia")]
9978impl From<fidl::Channel> for PopupFrameCreationListenerSynchronousProxy {
9979    fn from(value: fidl::Channel) -> Self {
9980        Self::new(value)
9981    }
9982}
9983
9984#[cfg(target_os = "fuchsia")]
9985impl fidl::endpoints::FromClient for PopupFrameCreationListenerSynchronousProxy {
9986    type Protocol = PopupFrameCreationListenerMarker;
9987
9988    fn from_client(value: fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>) -> Self {
9989        Self::new(value.into_channel())
9990    }
9991}
9992
9993#[derive(Debug, Clone)]
9994pub struct PopupFrameCreationListenerProxy {
9995    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9996}
9997
9998impl fidl::endpoints::Proxy for PopupFrameCreationListenerProxy {
9999    type Protocol = PopupFrameCreationListenerMarker;
10000
10001    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10002        Self::new(inner)
10003    }
10004
10005    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10006        self.client.into_channel().map_err(|client| Self { client })
10007    }
10008
10009    fn as_channel(&self) -> &::fidl::AsyncChannel {
10010        self.client.as_channel()
10011    }
10012}
10013
10014impl PopupFrameCreationListenerProxy {
10015    /// Create a new Proxy for fuchsia.web/PopupFrameCreationListener.
10016    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10017        let protocol_name =
10018            <PopupFrameCreationListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10019        Self { client: fidl::client::Client::new(channel, protocol_name) }
10020    }
10021
10022    /// Get a Stream of events from the remote end of the protocol.
10023    ///
10024    /// # Panics
10025    ///
10026    /// Panics if the event stream was already taken.
10027    pub fn take_event_stream(&self) -> PopupFrameCreationListenerEventStream {
10028        PopupFrameCreationListenerEventStream { event_receiver: self.client.take_event_receiver() }
10029    }
10030
10031    /// Called when a [`Frame`] has created a new popup `frame`. Information about the popup frame,
10032    /// and how it was created, is provided via `info`. Additional popup frames are delivered after
10033    /// the acknowledgement callback is invoked.
10034    pub fn r#on_popup_frame_created(
10035        &self,
10036        mut frame: fidl::endpoints::ClientEnd<FrameMarker>,
10037        mut info: PopupFrameCreationInfo,
10038    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
10039        PopupFrameCreationListenerProxyInterface::r#on_popup_frame_created(self, frame, info)
10040    }
10041}
10042
10043impl PopupFrameCreationListenerProxyInterface for PopupFrameCreationListenerProxy {
10044    type OnPopupFrameCreatedResponseFut =
10045        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
10046    fn r#on_popup_frame_created(
10047        &self,
10048        mut frame: fidl::endpoints::ClientEnd<FrameMarker>,
10049        mut info: PopupFrameCreationInfo,
10050    ) -> Self::OnPopupFrameCreatedResponseFut {
10051        fn _decode(
10052            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10053        ) -> Result<(), fidl::Error> {
10054            let _response = fidl::client::decode_transaction_body::<
10055                fidl::encoding::EmptyPayload,
10056                fidl::encoding::DefaultFuchsiaResourceDialect,
10057                0x19b212672dc41d51,
10058            >(_buf?)?;
10059            Ok(_response)
10060        }
10061        self.client
10062            .send_query_and_decode::<PopupFrameCreationListenerOnPopupFrameCreatedRequest, ()>(
10063                (frame, &mut info),
10064                0x19b212672dc41d51,
10065                fidl::encoding::DynamicFlags::empty(),
10066                _decode,
10067            )
10068    }
10069}
10070
10071pub struct PopupFrameCreationListenerEventStream {
10072    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10073}
10074
10075impl std::marker::Unpin for PopupFrameCreationListenerEventStream {}
10076
10077impl futures::stream::FusedStream for PopupFrameCreationListenerEventStream {
10078    fn is_terminated(&self) -> bool {
10079        self.event_receiver.is_terminated()
10080    }
10081}
10082
10083impl futures::Stream for PopupFrameCreationListenerEventStream {
10084    type Item = Result<PopupFrameCreationListenerEvent, fidl::Error>;
10085
10086    fn poll_next(
10087        mut self: std::pin::Pin<&mut Self>,
10088        cx: &mut std::task::Context<'_>,
10089    ) -> std::task::Poll<Option<Self::Item>> {
10090        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10091            &mut self.event_receiver,
10092            cx
10093        )?) {
10094            Some(buf) => std::task::Poll::Ready(Some(PopupFrameCreationListenerEvent::decode(buf))),
10095            None => std::task::Poll::Ready(None),
10096        }
10097    }
10098}
10099
10100#[derive(Debug)]
10101pub enum PopupFrameCreationListenerEvent {}
10102
10103impl PopupFrameCreationListenerEvent {
10104    /// Decodes a message buffer as a [`PopupFrameCreationListenerEvent`].
10105    fn decode(
10106        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10107    ) -> Result<PopupFrameCreationListenerEvent, fidl::Error> {
10108        let (bytes, _handles) = buf.split_mut();
10109        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10110        debug_assert_eq!(tx_header.tx_id, 0);
10111        match tx_header.ordinal {
10112            _ => Err(fidl::Error::UnknownOrdinal {
10113                ordinal: tx_header.ordinal,
10114                protocol_name: <PopupFrameCreationListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10115            })
10116        }
10117    }
10118}
10119
10120/// A Stream of incoming requests for fuchsia.web/PopupFrameCreationListener.
10121pub struct PopupFrameCreationListenerRequestStream {
10122    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10123    is_terminated: bool,
10124}
10125
10126impl std::marker::Unpin for PopupFrameCreationListenerRequestStream {}
10127
10128impl futures::stream::FusedStream for PopupFrameCreationListenerRequestStream {
10129    fn is_terminated(&self) -> bool {
10130        self.is_terminated
10131    }
10132}
10133
10134impl fidl::endpoints::RequestStream for PopupFrameCreationListenerRequestStream {
10135    type Protocol = PopupFrameCreationListenerMarker;
10136    type ControlHandle = PopupFrameCreationListenerControlHandle;
10137
10138    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10139        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10140    }
10141
10142    fn control_handle(&self) -> Self::ControlHandle {
10143        PopupFrameCreationListenerControlHandle { inner: self.inner.clone() }
10144    }
10145
10146    fn into_inner(
10147        self,
10148    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10149    {
10150        (self.inner, self.is_terminated)
10151    }
10152
10153    fn from_inner(
10154        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10155        is_terminated: bool,
10156    ) -> Self {
10157        Self { inner, is_terminated }
10158    }
10159}
10160
10161impl futures::Stream for PopupFrameCreationListenerRequestStream {
10162    type Item = Result<PopupFrameCreationListenerRequest, fidl::Error>;
10163
10164    fn poll_next(
10165        mut self: std::pin::Pin<&mut Self>,
10166        cx: &mut std::task::Context<'_>,
10167    ) -> std::task::Poll<Option<Self::Item>> {
10168        let this = &mut *self;
10169        if this.inner.check_shutdown(cx) {
10170            this.is_terminated = true;
10171            return std::task::Poll::Ready(None);
10172        }
10173        if this.is_terminated {
10174            panic!("polled PopupFrameCreationListenerRequestStream after completion");
10175        }
10176        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10177            |bytes, handles| {
10178                match this.inner.channel().read_etc(cx, bytes, handles) {
10179                    std::task::Poll::Ready(Ok(())) => {}
10180                    std::task::Poll::Pending => return std::task::Poll::Pending,
10181                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10182                        this.is_terminated = true;
10183                        return std::task::Poll::Ready(None);
10184                    }
10185                    std::task::Poll::Ready(Err(e)) => {
10186                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10187                            e.into(),
10188                        ))));
10189                    }
10190                }
10191
10192                // A message has been received from the channel
10193                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10194
10195                std::task::Poll::Ready(Some(match header.ordinal {
10196                0x19b212672dc41d51 => {
10197                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10198                    let mut req = fidl::new_empty!(PopupFrameCreationListenerOnPopupFrameCreatedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
10199                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PopupFrameCreationListenerOnPopupFrameCreatedRequest>(&header, _body_bytes, handles, &mut req)?;
10200                    let control_handle = PopupFrameCreationListenerControlHandle {
10201                        inner: this.inner.clone(),
10202                    };
10203                    Ok(PopupFrameCreationListenerRequest::OnPopupFrameCreated {frame: req.frame,
10204info: req.info,
10205
10206                        responder: PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10207                            control_handle: std::mem::ManuallyDrop::new(control_handle),
10208                            tx_id: header.tx_id,
10209                        },
10210                    })
10211                }
10212                _ => Err(fidl::Error::UnknownOrdinal {
10213                    ordinal: header.ordinal,
10214                    protocol_name: <PopupFrameCreationListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10215                }),
10216            }))
10217            },
10218        )
10219    }
10220}
10221
10222#[derive(Debug)]
10223pub enum PopupFrameCreationListenerRequest {
10224    /// Called when a [`Frame`] has created a new popup `frame`. Information about the popup frame,
10225    /// and how it was created, is provided via `info`. Additional popup frames are delivered after
10226    /// the acknowledgement callback is invoked.
10227    OnPopupFrameCreated {
10228        frame: fidl::endpoints::ClientEnd<FrameMarker>,
10229        info: PopupFrameCreationInfo,
10230        responder: PopupFrameCreationListenerOnPopupFrameCreatedResponder,
10231    },
10232}
10233
10234impl PopupFrameCreationListenerRequest {
10235    #[allow(irrefutable_let_patterns)]
10236    pub fn into_on_popup_frame_created(
10237        self,
10238    ) -> Option<(
10239        fidl::endpoints::ClientEnd<FrameMarker>,
10240        PopupFrameCreationInfo,
10241        PopupFrameCreationListenerOnPopupFrameCreatedResponder,
10242    )> {
10243        if let PopupFrameCreationListenerRequest::OnPopupFrameCreated { frame, info, responder } =
10244            self
10245        {
10246            Some((frame, info, responder))
10247        } else {
10248            None
10249        }
10250    }
10251
10252    /// Name of the method defined in FIDL
10253    pub fn method_name(&self) -> &'static str {
10254        match *self {
10255            PopupFrameCreationListenerRequest::OnPopupFrameCreated { .. } => {
10256                "on_popup_frame_created"
10257            }
10258        }
10259    }
10260}
10261
10262#[derive(Debug, Clone)]
10263pub struct PopupFrameCreationListenerControlHandle {
10264    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10265}
10266
10267impl PopupFrameCreationListenerControlHandle {
10268    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10269        self.inner.shutdown_with_epitaph(status.into())
10270    }
10271}
10272
10273impl fidl::endpoints::ControlHandle for PopupFrameCreationListenerControlHandle {
10274    fn shutdown(&self) {
10275        self.inner.shutdown()
10276    }
10277
10278    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10279        self.inner.shutdown_with_epitaph(status)
10280    }
10281
10282    fn is_closed(&self) -> bool {
10283        self.inner.channel().is_closed()
10284    }
10285    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10286        self.inner.channel().on_closed()
10287    }
10288
10289    #[cfg(target_os = "fuchsia")]
10290    fn signal_peer(
10291        &self,
10292        clear_mask: zx::Signals,
10293        set_mask: zx::Signals,
10294    ) -> Result<(), zx_status::Status> {
10295        use fidl::Peered;
10296        self.inner.channel().signal_peer(clear_mask, set_mask)
10297    }
10298}
10299
10300impl PopupFrameCreationListenerControlHandle {}
10301
10302#[must_use = "FIDL methods require a response to be sent"]
10303#[derive(Debug)]
10304pub struct PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10305    control_handle: std::mem::ManuallyDrop<PopupFrameCreationListenerControlHandle>,
10306    tx_id: u32,
10307}
10308
10309/// Set the the channel to be shutdown (see [`PopupFrameCreationListenerControlHandle::shutdown`])
10310/// if the responder is dropped without sending a response, so that the client
10311/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10312impl std::ops::Drop for PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10313    fn drop(&mut self) {
10314        self.control_handle.shutdown();
10315        // Safety: drops once, never accessed again
10316        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10317    }
10318}
10319
10320impl fidl::endpoints::Responder for PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10321    type ControlHandle = PopupFrameCreationListenerControlHandle;
10322
10323    fn control_handle(&self) -> &PopupFrameCreationListenerControlHandle {
10324        &self.control_handle
10325    }
10326
10327    fn drop_without_shutdown(mut self) {
10328        // Safety: drops once, never accessed again due to mem::forget
10329        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10330        // Prevent Drop from running (which would shut down the channel)
10331        std::mem::forget(self);
10332    }
10333}
10334
10335impl PopupFrameCreationListenerOnPopupFrameCreatedResponder {
10336    /// Sends a response to the FIDL transaction.
10337    ///
10338    /// Sets the channel to shutdown if an error occurs.
10339    pub fn send(self) -> Result<(), fidl::Error> {
10340        let _result = self.send_raw();
10341        if _result.is_err() {
10342            self.control_handle.shutdown();
10343        }
10344        self.drop_without_shutdown();
10345        _result
10346    }
10347
10348    /// Similar to "send" but does not shutdown the channel if an error occurs.
10349    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
10350        let _result = self.send_raw();
10351        self.drop_without_shutdown();
10352        _result
10353    }
10354
10355    fn send_raw(&self) -> Result<(), fidl::Error> {
10356        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
10357            (),
10358            self.tx_id,
10359            0x19b212672dc41d51,
10360            fidl::encoding::DynamicFlags::empty(),
10361        )
10362    }
10363}
10364
10365mod internal {
10366    use super::*;
10367
10368    impl fidl::encoding::ResourceTypeMarker for ContextCreateFrameRequest {
10369        type Borrowed<'a> = &'a mut Self;
10370        fn take_or_borrow<'a>(
10371            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10372        ) -> Self::Borrowed<'a> {
10373            value
10374        }
10375    }
10376
10377    unsafe impl fidl::encoding::TypeMarker for ContextCreateFrameRequest {
10378        type Owned = Self;
10379
10380        #[inline(always)]
10381        fn inline_align(_context: fidl::encoding::Context) -> usize {
10382            4
10383        }
10384
10385        #[inline(always)]
10386        fn inline_size(_context: fidl::encoding::Context) -> usize {
10387            4
10388        }
10389    }
10390
10391    unsafe impl
10392        fidl::encoding::Encode<
10393            ContextCreateFrameRequest,
10394            fidl::encoding::DefaultFuchsiaResourceDialect,
10395        > for &mut ContextCreateFrameRequest
10396    {
10397        #[inline]
10398        unsafe fn encode(
10399            self,
10400            encoder: &mut fidl::encoding::Encoder<
10401                '_,
10402                fidl::encoding::DefaultFuchsiaResourceDialect,
10403            >,
10404            offset: usize,
10405            _depth: fidl::encoding::Depth,
10406        ) -> fidl::Result<()> {
10407            encoder.debug_check_bounds::<ContextCreateFrameRequest>(offset);
10408            // Delegate to tuple encoding.
10409            fidl::encoding::Encode::<ContextCreateFrameRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10410                (
10411                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.frame),
10412                ),
10413                encoder, offset, _depth
10414            )
10415        }
10416    }
10417    unsafe impl<
10418        T0: fidl::encoding::Encode<
10419                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10420                fidl::encoding::DefaultFuchsiaResourceDialect,
10421            >,
10422    >
10423        fidl::encoding::Encode<
10424            ContextCreateFrameRequest,
10425            fidl::encoding::DefaultFuchsiaResourceDialect,
10426        > for (T0,)
10427    {
10428        #[inline]
10429        unsafe fn encode(
10430            self,
10431            encoder: &mut fidl::encoding::Encoder<
10432                '_,
10433                fidl::encoding::DefaultFuchsiaResourceDialect,
10434            >,
10435            offset: usize,
10436            depth: fidl::encoding::Depth,
10437        ) -> fidl::Result<()> {
10438            encoder.debug_check_bounds::<ContextCreateFrameRequest>(offset);
10439            // Zero out padding regions. There's no need to apply masks
10440            // because the unmasked parts will be overwritten by fields.
10441            // Write the fields.
10442            self.0.encode(encoder, offset + 0, depth)?;
10443            Ok(())
10444        }
10445    }
10446
10447    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10448        for ContextCreateFrameRequest
10449    {
10450        #[inline(always)]
10451        fn new_empty() -> Self {
10452            Self {
10453                frame: fidl::new_empty!(
10454                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10455                    fidl::encoding::DefaultFuchsiaResourceDialect
10456                ),
10457            }
10458        }
10459
10460        #[inline]
10461        unsafe fn decode(
10462            &mut self,
10463            decoder: &mut fidl::encoding::Decoder<
10464                '_,
10465                fidl::encoding::DefaultFuchsiaResourceDialect,
10466            >,
10467            offset: usize,
10468            _depth: fidl::encoding::Depth,
10469        ) -> fidl::Result<()> {
10470            decoder.debug_check_bounds::<Self>(offset);
10471            // Verify that padding bytes are zero.
10472            fidl::decode!(
10473                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10474                fidl::encoding::DefaultFuchsiaResourceDialect,
10475                &mut self.frame,
10476                decoder,
10477                offset + 0,
10478                _depth
10479            )?;
10480            Ok(())
10481        }
10482    }
10483
10484    impl fidl::encoding::ResourceTypeMarker for ContextCreateFrameWithParamsRequest {
10485        type Borrowed<'a> = &'a mut Self;
10486        fn take_or_borrow<'a>(
10487            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10488        ) -> Self::Borrowed<'a> {
10489            value
10490        }
10491    }
10492
10493    unsafe impl fidl::encoding::TypeMarker for ContextCreateFrameWithParamsRequest {
10494        type Owned = Self;
10495
10496        #[inline(always)]
10497        fn inline_align(_context: fidl::encoding::Context) -> usize {
10498            8
10499        }
10500
10501        #[inline(always)]
10502        fn inline_size(_context: fidl::encoding::Context) -> usize {
10503            24
10504        }
10505    }
10506
10507    unsafe impl
10508        fidl::encoding::Encode<
10509            ContextCreateFrameWithParamsRequest,
10510            fidl::encoding::DefaultFuchsiaResourceDialect,
10511        > for &mut ContextCreateFrameWithParamsRequest
10512    {
10513        #[inline]
10514        unsafe fn encode(
10515            self,
10516            encoder: &mut fidl::encoding::Encoder<
10517                '_,
10518                fidl::encoding::DefaultFuchsiaResourceDialect,
10519            >,
10520            offset: usize,
10521            _depth: fidl::encoding::Depth,
10522        ) -> fidl::Result<()> {
10523            encoder.debug_check_bounds::<ContextCreateFrameWithParamsRequest>(offset);
10524            // Delegate to tuple encoding.
10525            fidl::encoding::Encode::<ContextCreateFrameWithParamsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10526                (
10527                    <CreateFrameParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.params),
10528                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.frame),
10529                ),
10530                encoder, offset, _depth
10531            )
10532        }
10533    }
10534    unsafe impl<
10535        T0: fidl::encoding::Encode<CreateFrameParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
10536        T1: fidl::encoding::Encode<
10537                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10538                fidl::encoding::DefaultFuchsiaResourceDialect,
10539            >,
10540    >
10541        fidl::encoding::Encode<
10542            ContextCreateFrameWithParamsRequest,
10543            fidl::encoding::DefaultFuchsiaResourceDialect,
10544        > for (T0, T1)
10545    {
10546        #[inline]
10547        unsafe fn encode(
10548            self,
10549            encoder: &mut fidl::encoding::Encoder<
10550                '_,
10551                fidl::encoding::DefaultFuchsiaResourceDialect,
10552            >,
10553            offset: usize,
10554            depth: fidl::encoding::Depth,
10555        ) -> fidl::Result<()> {
10556            encoder.debug_check_bounds::<ContextCreateFrameWithParamsRequest>(offset);
10557            // Zero out padding regions. There's no need to apply masks
10558            // because the unmasked parts will be overwritten by fields.
10559            unsafe {
10560                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10561                (ptr as *mut u64).write_unaligned(0);
10562            }
10563            // Write the fields.
10564            self.0.encode(encoder, offset + 0, depth)?;
10565            self.1.encode(encoder, offset + 16, depth)?;
10566            Ok(())
10567        }
10568    }
10569
10570    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10571        for ContextCreateFrameWithParamsRequest
10572    {
10573        #[inline(always)]
10574        fn new_empty() -> Self {
10575            Self {
10576                params: fidl::new_empty!(
10577                    CreateFrameParams,
10578                    fidl::encoding::DefaultFuchsiaResourceDialect
10579                ),
10580                frame: fidl::new_empty!(
10581                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10582                    fidl::encoding::DefaultFuchsiaResourceDialect
10583                ),
10584            }
10585        }
10586
10587        #[inline]
10588        unsafe fn decode(
10589            &mut self,
10590            decoder: &mut fidl::encoding::Decoder<
10591                '_,
10592                fidl::encoding::DefaultFuchsiaResourceDialect,
10593            >,
10594            offset: usize,
10595            _depth: fidl::encoding::Depth,
10596        ) -> fidl::Result<()> {
10597            decoder.debug_check_bounds::<Self>(offset);
10598            // Verify that padding bytes are zero.
10599            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10600            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10601            let mask = 0xffffffff00000000u64;
10602            let maskedval = padval & mask;
10603            if maskedval != 0 {
10604                return Err(fidl::Error::NonZeroPadding {
10605                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10606                });
10607            }
10608            fidl::decode!(
10609                CreateFrameParams,
10610                fidl::encoding::DefaultFuchsiaResourceDialect,
10611                &mut self.params,
10612                decoder,
10613                offset + 0,
10614                _depth
10615            )?;
10616            fidl::decode!(
10617                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
10618                fidl::encoding::DefaultFuchsiaResourceDialect,
10619                &mut self.frame,
10620                decoder,
10621                offset + 16,
10622                _depth
10623            )?;
10624            Ok(())
10625        }
10626    }
10627
10628    impl fidl::encoding::ResourceTypeMarker for ContextGetCookieManagerRequest {
10629        type Borrowed<'a> = &'a mut Self;
10630        fn take_or_borrow<'a>(
10631            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10632        ) -> Self::Borrowed<'a> {
10633            value
10634        }
10635    }
10636
10637    unsafe impl fidl::encoding::TypeMarker for ContextGetCookieManagerRequest {
10638        type Owned = Self;
10639
10640        #[inline(always)]
10641        fn inline_align(_context: fidl::encoding::Context) -> usize {
10642            4
10643        }
10644
10645        #[inline(always)]
10646        fn inline_size(_context: fidl::encoding::Context) -> usize {
10647            4
10648        }
10649    }
10650
10651    unsafe impl
10652        fidl::encoding::Encode<
10653            ContextGetCookieManagerRequest,
10654            fidl::encoding::DefaultFuchsiaResourceDialect,
10655        > for &mut ContextGetCookieManagerRequest
10656    {
10657        #[inline]
10658        unsafe fn encode(
10659            self,
10660            encoder: &mut fidl::encoding::Encoder<
10661                '_,
10662                fidl::encoding::DefaultFuchsiaResourceDialect,
10663            >,
10664            offset: usize,
10665            _depth: fidl::encoding::Depth,
10666        ) -> fidl::Result<()> {
10667            encoder.debug_check_bounds::<ContextGetCookieManagerRequest>(offset);
10668            // Delegate to tuple encoding.
10669            fidl::encoding::Encode::<ContextGetCookieManagerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10670                (
10671                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookieManagerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.manager),
10672                ),
10673                encoder, offset, _depth
10674            )
10675        }
10676    }
10677    unsafe impl<
10678        T0: fidl::encoding::Encode<
10679                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookieManagerMarker>>,
10680                fidl::encoding::DefaultFuchsiaResourceDialect,
10681            >,
10682    >
10683        fidl::encoding::Encode<
10684            ContextGetCookieManagerRequest,
10685            fidl::encoding::DefaultFuchsiaResourceDialect,
10686        > for (T0,)
10687    {
10688        #[inline]
10689        unsafe fn encode(
10690            self,
10691            encoder: &mut fidl::encoding::Encoder<
10692                '_,
10693                fidl::encoding::DefaultFuchsiaResourceDialect,
10694            >,
10695            offset: usize,
10696            depth: fidl::encoding::Depth,
10697        ) -> fidl::Result<()> {
10698            encoder.debug_check_bounds::<ContextGetCookieManagerRequest>(offset);
10699            // Zero out padding regions. There's no need to apply masks
10700            // because the unmasked parts will be overwritten by fields.
10701            // Write the fields.
10702            self.0.encode(encoder, offset + 0, depth)?;
10703            Ok(())
10704        }
10705    }
10706
10707    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10708        for ContextGetCookieManagerRequest
10709    {
10710        #[inline(always)]
10711        fn new_empty() -> Self {
10712            Self {
10713                manager: fidl::new_empty!(
10714                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookieManagerMarker>>,
10715                    fidl::encoding::DefaultFuchsiaResourceDialect
10716                ),
10717            }
10718        }
10719
10720        #[inline]
10721        unsafe fn decode(
10722            &mut self,
10723            decoder: &mut fidl::encoding::Decoder<
10724                '_,
10725                fidl::encoding::DefaultFuchsiaResourceDialect,
10726            >,
10727            offset: usize,
10728            _depth: fidl::encoding::Depth,
10729        ) -> fidl::Result<()> {
10730            decoder.debug_check_bounds::<Self>(offset);
10731            // Verify that padding bytes are zero.
10732            fidl::decode!(
10733                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookieManagerMarker>>,
10734                fidl::encoding::DefaultFuchsiaResourceDialect,
10735                &mut self.manager,
10736                decoder,
10737                offset + 0,
10738                _depth
10739            )?;
10740            Ok(())
10741        }
10742    }
10743
10744    impl fidl::encoding::ResourceTypeMarker for ContextProviderCreateRequest {
10745        type Borrowed<'a> = &'a mut Self;
10746        fn take_or_borrow<'a>(
10747            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10748        ) -> Self::Borrowed<'a> {
10749            value
10750        }
10751    }
10752
10753    unsafe impl fidl::encoding::TypeMarker for ContextProviderCreateRequest {
10754        type Owned = Self;
10755
10756        #[inline(always)]
10757        fn inline_align(_context: fidl::encoding::Context) -> usize {
10758            8
10759        }
10760
10761        #[inline(always)]
10762        fn inline_size(_context: fidl::encoding::Context) -> usize {
10763            24
10764        }
10765    }
10766
10767    unsafe impl
10768        fidl::encoding::Encode<
10769            ContextProviderCreateRequest,
10770            fidl::encoding::DefaultFuchsiaResourceDialect,
10771        > for &mut ContextProviderCreateRequest
10772    {
10773        #[inline]
10774        unsafe fn encode(
10775            self,
10776            encoder: &mut fidl::encoding::Encoder<
10777                '_,
10778                fidl::encoding::DefaultFuchsiaResourceDialect,
10779            >,
10780            offset: usize,
10781            _depth: fidl::encoding::Depth,
10782        ) -> fidl::Result<()> {
10783            encoder.debug_check_bounds::<ContextProviderCreateRequest>(offset);
10784            // Delegate to tuple encoding.
10785            fidl::encoding::Encode::<ContextProviderCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10786                (
10787                    <CreateContextParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.params),
10788                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ContextMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.context),
10789                ),
10790                encoder, offset, _depth
10791            )
10792        }
10793    }
10794    unsafe impl<
10795        T0: fidl::encoding::Encode<CreateContextParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
10796        T1: fidl::encoding::Encode<
10797                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ContextMarker>>,
10798                fidl::encoding::DefaultFuchsiaResourceDialect,
10799            >,
10800    >
10801        fidl::encoding::Encode<
10802            ContextProviderCreateRequest,
10803            fidl::encoding::DefaultFuchsiaResourceDialect,
10804        > for (T0, T1)
10805    {
10806        #[inline]
10807        unsafe fn encode(
10808            self,
10809            encoder: &mut fidl::encoding::Encoder<
10810                '_,
10811                fidl::encoding::DefaultFuchsiaResourceDialect,
10812            >,
10813            offset: usize,
10814            depth: fidl::encoding::Depth,
10815        ) -> fidl::Result<()> {
10816            encoder.debug_check_bounds::<ContextProviderCreateRequest>(offset);
10817            // Zero out padding regions. There's no need to apply masks
10818            // because the unmasked parts will be overwritten by fields.
10819            unsafe {
10820                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10821                (ptr as *mut u64).write_unaligned(0);
10822            }
10823            // Write the fields.
10824            self.0.encode(encoder, offset + 0, depth)?;
10825            self.1.encode(encoder, offset + 16, depth)?;
10826            Ok(())
10827        }
10828    }
10829
10830    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10831        for ContextProviderCreateRequest
10832    {
10833        #[inline(always)]
10834        fn new_empty() -> Self {
10835            Self {
10836                params: fidl::new_empty!(
10837                    CreateContextParams,
10838                    fidl::encoding::DefaultFuchsiaResourceDialect
10839                ),
10840                context: fidl::new_empty!(
10841                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ContextMarker>>,
10842                    fidl::encoding::DefaultFuchsiaResourceDialect
10843                ),
10844            }
10845        }
10846
10847        #[inline]
10848        unsafe fn decode(
10849            &mut self,
10850            decoder: &mut fidl::encoding::Decoder<
10851                '_,
10852                fidl::encoding::DefaultFuchsiaResourceDialect,
10853            >,
10854            offset: usize,
10855            _depth: fidl::encoding::Depth,
10856        ) -> fidl::Result<()> {
10857            decoder.debug_check_bounds::<Self>(offset);
10858            // Verify that padding bytes are zero.
10859            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10860            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10861            let mask = 0xffffffff00000000u64;
10862            let maskedval = padval & mask;
10863            if maskedval != 0 {
10864                return Err(fidl::Error::NonZeroPadding {
10865                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10866                });
10867            }
10868            fidl::decode!(
10869                CreateContextParams,
10870                fidl::encoding::DefaultFuchsiaResourceDialect,
10871                &mut self.params,
10872                decoder,
10873                offset + 0,
10874                _depth
10875            )?;
10876            fidl::decode!(
10877                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ContextMarker>>,
10878                fidl::encoding::DefaultFuchsiaResourceDialect,
10879                &mut self.context,
10880                decoder,
10881                offset + 16,
10882                _depth
10883            )?;
10884            Ok(())
10885        }
10886    }
10887
10888    impl fidl::encoding::ResourceTypeMarker for CookieManagerGetCookieListRequest {
10889        type Borrowed<'a> = &'a mut Self;
10890        fn take_or_borrow<'a>(
10891            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10892        ) -> Self::Borrowed<'a> {
10893            value
10894        }
10895    }
10896
10897    unsafe impl fidl::encoding::TypeMarker for CookieManagerGetCookieListRequest {
10898        type Owned = Self;
10899
10900        #[inline(always)]
10901        fn inline_align(_context: fidl::encoding::Context) -> usize {
10902            8
10903        }
10904
10905        #[inline(always)]
10906        fn inline_size(_context: fidl::encoding::Context) -> usize {
10907            40
10908        }
10909    }
10910
10911    unsafe impl
10912        fidl::encoding::Encode<
10913            CookieManagerGetCookieListRequest,
10914            fidl::encoding::DefaultFuchsiaResourceDialect,
10915        > for &mut CookieManagerGetCookieListRequest
10916    {
10917        #[inline]
10918        unsafe fn encode(
10919            self,
10920            encoder: &mut fidl::encoding::Encoder<
10921                '_,
10922                fidl::encoding::DefaultFuchsiaResourceDialect,
10923            >,
10924            offset: usize,
10925            _depth: fidl::encoding::Depth,
10926        ) -> fidl::Result<()> {
10927            encoder.debug_check_bounds::<CookieManagerGetCookieListRequest>(offset);
10928            // Delegate to tuple encoding.
10929            fidl::encoding::Encode::<CookieManagerGetCookieListRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10930                (
10931                    <fidl::encoding::Optional<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
10932                    <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
10933                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.cookies),
10934                ),
10935                encoder, offset, _depth
10936            )
10937        }
10938    }
10939    unsafe impl<
10940        T0: fidl::encoding::Encode<
10941                fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
10942                fidl::encoding::DefaultFuchsiaResourceDialect,
10943            >,
10944        T1: fidl::encoding::Encode<
10945                fidl::encoding::Optional<fidl::encoding::UnboundedString>,
10946                fidl::encoding::DefaultFuchsiaResourceDialect,
10947            >,
10948        T2: fidl::encoding::Encode<
10949                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
10950                fidl::encoding::DefaultFuchsiaResourceDialect,
10951            >,
10952    >
10953        fidl::encoding::Encode<
10954            CookieManagerGetCookieListRequest,
10955            fidl::encoding::DefaultFuchsiaResourceDialect,
10956        > for (T0, T1, T2)
10957    {
10958        #[inline]
10959        unsafe fn encode(
10960            self,
10961            encoder: &mut fidl::encoding::Encoder<
10962                '_,
10963                fidl::encoding::DefaultFuchsiaResourceDialect,
10964            >,
10965            offset: usize,
10966            depth: fidl::encoding::Depth,
10967        ) -> fidl::Result<()> {
10968            encoder.debug_check_bounds::<CookieManagerGetCookieListRequest>(offset);
10969            // Zero out padding regions. There's no need to apply masks
10970            // because the unmasked parts will be overwritten by fields.
10971            unsafe {
10972                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
10973                (ptr as *mut u64).write_unaligned(0);
10974            }
10975            // Write the fields.
10976            self.0.encode(encoder, offset + 0, depth)?;
10977            self.1.encode(encoder, offset + 16, depth)?;
10978            self.2.encode(encoder, offset + 32, depth)?;
10979            Ok(())
10980        }
10981    }
10982
10983    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10984        for CookieManagerGetCookieListRequest
10985    {
10986        #[inline(always)]
10987        fn new_empty() -> Self {
10988            Self {
10989                url: fidl::new_empty!(
10990                    fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
10991                    fidl::encoding::DefaultFuchsiaResourceDialect
10992                ),
10993                name: fidl::new_empty!(
10994                    fidl::encoding::Optional<fidl::encoding::UnboundedString>,
10995                    fidl::encoding::DefaultFuchsiaResourceDialect
10996                ),
10997                cookies: fidl::new_empty!(
10998                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
10999                    fidl::encoding::DefaultFuchsiaResourceDialect
11000                ),
11001            }
11002        }
11003
11004        #[inline]
11005        unsafe fn decode(
11006            &mut self,
11007            decoder: &mut fidl::encoding::Decoder<
11008                '_,
11009                fidl::encoding::DefaultFuchsiaResourceDialect,
11010            >,
11011            offset: usize,
11012            _depth: fidl::encoding::Depth,
11013        ) -> fidl::Result<()> {
11014            decoder.debug_check_bounds::<Self>(offset);
11015            // Verify that padding bytes are zero.
11016            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
11017            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11018            let mask = 0xffffffff00000000u64;
11019            let maskedval = padval & mask;
11020            if maskedval != 0 {
11021                return Err(fidl::Error::NonZeroPadding {
11022                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
11023                });
11024            }
11025            fidl::decode!(
11026                fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
11027                fidl::encoding::DefaultFuchsiaResourceDialect,
11028                &mut self.url,
11029                decoder,
11030                offset + 0,
11031                _depth
11032            )?;
11033            fidl::decode!(
11034                fidl::encoding::Optional<fidl::encoding::UnboundedString>,
11035                fidl::encoding::DefaultFuchsiaResourceDialect,
11036                &mut self.name,
11037                decoder,
11038                offset + 16,
11039                _depth
11040            )?;
11041            fidl::decode!(
11042                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
11043                fidl::encoding::DefaultFuchsiaResourceDialect,
11044                &mut self.cookies,
11045                decoder,
11046                offset + 32,
11047                _depth
11048            )?;
11049            Ok(())
11050        }
11051    }
11052
11053    impl fidl::encoding::ResourceTypeMarker for CookieManagerObserveCookieChangesRequest {
11054        type Borrowed<'a> = &'a mut Self;
11055        fn take_or_borrow<'a>(
11056            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11057        ) -> Self::Borrowed<'a> {
11058            value
11059        }
11060    }
11061
11062    unsafe impl fidl::encoding::TypeMarker for CookieManagerObserveCookieChangesRequest {
11063        type Owned = Self;
11064
11065        #[inline(always)]
11066        fn inline_align(_context: fidl::encoding::Context) -> usize {
11067            8
11068        }
11069
11070        #[inline(always)]
11071        fn inline_size(_context: fidl::encoding::Context) -> usize {
11072            40
11073        }
11074    }
11075
11076    unsafe impl
11077        fidl::encoding::Encode<
11078            CookieManagerObserveCookieChangesRequest,
11079            fidl::encoding::DefaultFuchsiaResourceDialect,
11080        > for &mut CookieManagerObserveCookieChangesRequest
11081    {
11082        #[inline]
11083        unsafe fn encode(
11084            self,
11085            encoder: &mut fidl::encoding::Encoder<
11086                '_,
11087                fidl::encoding::DefaultFuchsiaResourceDialect,
11088            >,
11089            offset: usize,
11090            _depth: fidl::encoding::Depth,
11091        ) -> fidl::Result<()> {
11092            encoder.debug_check_bounds::<CookieManagerObserveCookieChangesRequest>(offset);
11093            // Delegate to tuple encoding.
11094            fidl::encoding::Encode::<CookieManagerObserveCookieChangesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11095                (
11096                    <fidl::encoding::Optional<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
11097                    <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
11098                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.changes),
11099                ),
11100                encoder, offset, _depth
11101            )
11102        }
11103    }
11104    unsafe impl<
11105        T0: fidl::encoding::Encode<
11106                fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
11107                fidl::encoding::DefaultFuchsiaResourceDialect,
11108            >,
11109        T1: fidl::encoding::Encode<
11110                fidl::encoding::Optional<fidl::encoding::UnboundedString>,
11111                fidl::encoding::DefaultFuchsiaResourceDialect,
11112            >,
11113        T2: fidl::encoding::Encode<
11114                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
11115                fidl::encoding::DefaultFuchsiaResourceDialect,
11116            >,
11117    >
11118        fidl::encoding::Encode<
11119            CookieManagerObserveCookieChangesRequest,
11120            fidl::encoding::DefaultFuchsiaResourceDialect,
11121        > for (T0, T1, T2)
11122    {
11123        #[inline]
11124        unsafe fn encode(
11125            self,
11126            encoder: &mut fidl::encoding::Encoder<
11127                '_,
11128                fidl::encoding::DefaultFuchsiaResourceDialect,
11129            >,
11130            offset: usize,
11131            depth: fidl::encoding::Depth,
11132        ) -> fidl::Result<()> {
11133            encoder.debug_check_bounds::<CookieManagerObserveCookieChangesRequest>(offset);
11134            // Zero out padding regions. There's no need to apply masks
11135            // because the unmasked parts will be overwritten by fields.
11136            unsafe {
11137                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
11138                (ptr as *mut u64).write_unaligned(0);
11139            }
11140            // Write the fields.
11141            self.0.encode(encoder, offset + 0, depth)?;
11142            self.1.encode(encoder, offset + 16, depth)?;
11143            self.2.encode(encoder, offset + 32, depth)?;
11144            Ok(())
11145        }
11146    }
11147
11148    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11149        for CookieManagerObserveCookieChangesRequest
11150    {
11151        #[inline(always)]
11152        fn new_empty() -> Self {
11153            Self {
11154                url: fidl::new_empty!(
11155                    fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
11156                    fidl::encoding::DefaultFuchsiaResourceDialect
11157                ),
11158                name: fidl::new_empty!(
11159                    fidl::encoding::Optional<fidl::encoding::UnboundedString>,
11160                    fidl::encoding::DefaultFuchsiaResourceDialect
11161                ),
11162                changes: fidl::new_empty!(
11163                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
11164                    fidl::encoding::DefaultFuchsiaResourceDialect
11165                ),
11166            }
11167        }
11168
11169        #[inline]
11170        unsafe fn decode(
11171            &mut self,
11172            decoder: &mut fidl::encoding::Decoder<
11173                '_,
11174                fidl::encoding::DefaultFuchsiaResourceDialect,
11175            >,
11176            offset: usize,
11177            _depth: fidl::encoding::Depth,
11178        ) -> fidl::Result<()> {
11179            decoder.debug_check_bounds::<Self>(offset);
11180            // Verify that padding bytes are zero.
11181            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
11182            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11183            let mask = 0xffffffff00000000u64;
11184            let maskedval = padval & mask;
11185            if maskedval != 0 {
11186                return Err(fidl::Error::NonZeroPadding {
11187                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
11188                });
11189            }
11190            fidl::decode!(
11191                fidl::encoding::Optional<fidl::encoding::BoundedString<65536>>,
11192                fidl::encoding::DefaultFuchsiaResourceDialect,
11193                &mut self.url,
11194                decoder,
11195                offset + 0,
11196                _depth
11197            )?;
11198            fidl::decode!(
11199                fidl::encoding::Optional<fidl::encoding::UnboundedString>,
11200                fidl::encoding::DefaultFuchsiaResourceDialect,
11201                &mut self.name,
11202                decoder,
11203                offset + 16,
11204                _depth
11205            )?;
11206            fidl::decode!(
11207                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CookiesIteratorMarker>>,
11208                fidl::encoding::DefaultFuchsiaResourceDialect,
11209                &mut self.changes,
11210                decoder,
11211                offset + 32,
11212                _depth
11213            )?;
11214            Ok(())
11215        }
11216    }
11217
11218    impl fidl::encoding::ResourceTypeMarker for CookiesIteratorGetNextResponse {
11219        type Borrowed<'a> = &'a mut Self;
11220        fn take_or_borrow<'a>(
11221            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11222        ) -> Self::Borrowed<'a> {
11223            value
11224        }
11225    }
11226
11227    unsafe impl fidl::encoding::TypeMarker for CookiesIteratorGetNextResponse {
11228        type Owned = Self;
11229
11230        #[inline(always)]
11231        fn inline_align(_context: fidl::encoding::Context) -> usize {
11232            8
11233        }
11234
11235        #[inline(always)]
11236        fn inline_size(_context: fidl::encoding::Context) -> usize {
11237            16
11238        }
11239    }
11240
11241    unsafe impl
11242        fidl::encoding::Encode<
11243            CookiesIteratorGetNextResponse,
11244            fidl::encoding::DefaultFuchsiaResourceDialect,
11245        > for &mut CookiesIteratorGetNextResponse
11246    {
11247        #[inline]
11248        unsafe fn encode(
11249            self,
11250            encoder: &mut fidl::encoding::Encoder<
11251                '_,
11252                fidl::encoding::DefaultFuchsiaResourceDialect,
11253            >,
11254            offset: usize,
11255            _depth: fidl::encoding::Depth,
11256        ) -> fidl::Result<()> {
11257            encoder.debug_check_bounds::<CookiesIteratorGetNextResponse>(offset);
11258            // Delegate to tuple encoding.
11259            fidl::encoding::Encode::<CookiesIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11260                (
11261                    <fidl::encoding::UnboundedVector<Cookie> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.changed_cookies),
11262                ),
11263                encoder, offset, _depth
11264            )
11265        }
11266    }
11267    unsafe impl<
11268        T0: fidl::encoding::Encode<
11269                fidl::encoding::UnboundedVector<Cookie>,
11270                fidl::encoding::DefaultFuchsiaResourceDialect,
11271            >,
11272    >
11273        fidl::encoding::Encode<
11274            CookiesIteratorGetNextResponse,
11275            fidl::encoding::DefaultFuchsiaResourceDialect,
11276        > for (T0,)
11277    {
11278        #[inline]
11279        unsafe fn encode(
11280            self,
11281            encoder: &mut fidl::encoding::Encoder<
11282                '_,
11283                fidl::encoding::DefaultFuchsiaResourceDialect,
11284            >,
11285            offset: usize,
11286            depth: fidl::encoding::Depth,
11287        ) -> fidl::Result<()> {
11288            encoder.debug_check_bounds::<CookiesIteratorGetNextResponse>(offset);
11289            // Zero out padding regions. There's no need to apply masks
11290            // because the unmasked parts will be overwritten by fields.
11291            // Write the fields.
11292            self.0.encode(encoder, offset + 0, depth)?;
11293            Ok(())
11294        }
11295    }
11296
11297    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11298        for CookiesIteratorGetNextResponse
11299    {
11300        #[inline(always)]
11301        fn new_empty() -> Self {
11302            Self {
11303                changed_cookies: fidl::new_empty!(
11304                    fidl::encoding::UnboundedVector<Cookie>,
11305                    fidl::encoding::DefaultFuchsiaResourceDialect
11306                ),
11307            }
11308        }
11309
11310        #[inline]
11311        unsafe fn decode(
11312            &mut self,
11313            decoder: &mut fidl::encoding::Decoder<
11314                '_,
11315                fidl::encoding::DefaultFuchsiaResourceDialect,
11316            >,
11317            offset: usize,
11318            _depth: fidl::encoding::Depth,
11319        ) -> fidl::Result<()> {
11320            decoder.debug_check_bounds::<Self>(offset);
11321            // Verify that padding bytes are zero.
11322            fidl::decode!(
11323                fidl::encoding::UnboundedVector<Cookie>,
11324                fidl::encoding::DefaultFuchsiaResourceDialect,
11325                &mut self.changed_cookies,
11326                decoder,
11327                offset + 0,
11328                _depth
11329            )?;
11330            Ok(())
11331        }
11332    }
11333
11334    impl fidl::encoding::ResourceTypeMarker for DebugEnableDevToolsRequest {
11335        type Borrowed<'a> = &'a mut Self;
11336        fn take_or_borrow<'a>(
11337            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11338        ) -> Self::Borrowed<'a> {
11339            value
11340        }
11341    }
11342
11343    unsafe impl fidl::encoding::TypeMarker for DebugEnableDevToolsRequest {
11344        type Owned = Self;
11345
11346        #[inline(always)]
11347        fn inline_align(_context: fidl::encoding::Context) -> usize {
11348            4
11349        }
11350
11351        #[inline(always)]
11352        fn inline_size(_context: fidl::encoding::Context) -> usize {
11353            4
11354        }
11355    }
11356
11357    unsafe impl
11358        fidl::encoding::Encode<
11359            DebugEnableDevToolsRequest,
11360            fidl::encoding::DefaultFuchsiaResourceDialect,
11361        > for &mut DebugEnableDevToolsRequest
11362    {
11363        #[inline]
11364        unsafe fn encode(
11365            self,
11366            encoder: &mut fidl::encoding::Encoder<
11367                '_,
11368                fidl::encoding::DefaultFuchsiaResourceDialect,
11369            >,
11370            offset: usize,
11371            _depth: fidl::encoding::Depth,
11372        ) -> fidl::Result<()> {
11373            encoder.debug_check_bounds::<DebugEnableDevToolsRequest>(offset);
11374            // Delegate to tuple encoding.
11375            fidl::encoding::Encode::<DebugEnableDevToolsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11376                (
11377                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevToolsListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.listener),
11378                ),
11379                encoder, offset, _depth
11380            )
11381        }
11382    }
11383    unsafe impl<
11384        T0: fidl::encoding::Encode<
11385                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevToolsListenerMarker>>,
11386                fidl::encoding::DefaultFuchsiaResourceDialect,
11387            >,
11388    >
11389        fidl::encoding::Encode<
11390            DebugEnableDevToolsRequest,
11391            fidl::encoding::DefaultFuchsiaResourceDialect,
11392        > for (T0,)
11393    {
11394        #[inline]
11395        unsafe fn encode(
11396            self,
11397            encoder: &mut fidl::encoding::Encoder<
11398                '_,
11399                fidl::encoding::DefaultFuchsiaResourceDialect,
11400            >,
11401            offset: usize,
11402            depth: fidl::encoding::Depth,
11403        ) -> fidl::Result<()> {
11404            encoder.debug_check_bounds::<DebugEnableDevToolsRequest>(offset);
11405            // Zero out padding regions. There's no need to apply masks
11406            // because the unmasked parts will be overwritten by fields.
11407            // Write the fields.
11408            self.0.encode(encoder, offset + 0, depth)?;
11409            Ok(())
11410        }
11411    }
11412
11413    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11414        for DebugEnableDevToolsRequest
11415    {
11416        #[inline(always)]
11417        fn new_empty() -> Self {
11418            Self {
11419                listener: fidl::new_empty!(
11420                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevToolsListenerMarker>>,
11421                    fidl::encoding::DefaultFuchsiaResourceDialect
11422                ),
11423            }
11424        }
11425
11426        #[inline]
11427        unsafe fn decode(
11428            &mut self,
11429            decoder: &mut fidl::encoding::Decoder<
11430                '_,
11431                fidl::encoding::DefaultFuchsiaResourceDialect,
11432            >,
11433            offset: usize,
11434            _depth: fidl::encoding::Depth,
11435        ) -> fidl::Result<()> {
11436            decoder.debug_check_bounds::<Self>(offset);
11437            // Verify that padding bytes are zero.
11438            fidl::decode!(
11439                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DevToolsListenerMarker>>,
11440                fidl::encoding::DefaultFuchsiaResourceDialect,
11441                &mut self.listener,
11442                decoder,
11443                offset + 0,
11444                _depth
11445            )?;
11446            Ok(())
11447        }
11448    }
11449
11450    impl fidl::encoding::ResourceTypeMarker for DevToolsListenerOnContextDevToolsAvailableRequest {
11451        type Borrowed<'a> = &'a mut Self;
11452        fn take_or_borrow<'a>(
11453            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11454        ) -> Self::Borrowed<'a> {
11455            value
11456        }
11457    }
11458
11459    unsafe impl fidl::encoding::TypeMarker for DevToolsListenerOnContextDevToolsAvailableRequest {
11460        type Owned = Self;
11461
11462        #[inline(always)]
11463        fn inline_align(_context: fidl::encoding::Context) -> usize {
11464            4
11465        }
11466
11467        #[inline(always)]
11468        fn inline_size(_context: fidl::encoding::Context) -> usize {
11469            4
11470        }
11471    }
11472
11473    unsafe impl
11474        fidl::encoding::Encode<
11475            DevToolsListenerOnContextDevToolsAvailableRequest,
11476            fidl::encoding::DefaultFuchsiaResourceDialect,
11477        > for &mut DevToolsListenerOnContextDevToolsAvailableRequest
11478    {
11479        #[inline]
11480        unsafe fn encode(
11481            self,
11482            encoder: &mut fidl::encoding::Encoder<
11483                '_,
11484                fidl::encoding::DefaultFuchsiaResourceDialect,
11485            >,
11486            offset: usize,
11487            _depth: fidl::encoding::Depth,
11488        ) -> fidl::Result<()> {
11489            encoder.debug_check_bounds::<DevToolsListenerOnContextDevToolsAvailableRequest>(offset);
11490            // Delegate to tuple encoding.
11491            fidl::encoding::Encode::<
11492                DevToolsListenerOnContextDevToolsAvailableRequest,
11493                fidl::encoding::DefaultFuchsiaResourceDialect,
11494            >::encode(
11495                (<fidl::encoding::Endpoint<
11496                    fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
11497                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11498                    &mut self.listener
11499                ),),
11500                encoder,
11501                offset,
11502                _depth,
11503            )
11504        }
11505    }
11506    unsafe impl<
11507        T0: fidl::encoding::Encode<
11508                fidl::encoding::Endpoint<
11509                    fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
11510                >,
11511                fidl::encoding::DefaultFuchsiaResourceDialect,
11512            >,
11513    >
11514        fidl::encoding::Encode<
11515            DevToolsListenerOnContextDevToolsAvailableRequest,
11516            fidl::encoding::DefaultFuchsiaResourceDialect,
11517        > for (T0,)
11518    {
11519        #[inline]
11520        unsafe fn encode(
11521            self,
11522            encoder: &mut fidl::encoding::Encoder<
11523                '_,
11524                fidl::encoding::DefaultFuchsiaResourceDialect,
11525            >,
11526            offset: usize,
11527            depth: fidl::encoding::Depth,
11528        ) -> fidl::Result<()> {
11529            encoder.debug_check_bounds::<DevToolsListenerOnContextDevToolsAvailableRequest>(offset);
11530            // Zero out padding regions. There's no need to apply masks
11531            // because the unmasked parts will be overwritten by fields.
11532            // Write the fields.
11533            self.0.encode(encoder, offset + 0, depth)?;
11534            Ok(())
11535        }
11536    }
11537
11538    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11539        for DevToolsListenerOnContextDevToolsAvailableRequest
11540    {
11541        #[inline(always)]
11542        fn new_empty() -> Self {
11543            Self {
11544                listener: fidl::new_empty!(
11545                    fidl::encoding::Endpoint<
11546                        fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
11547                    >,
11548                    fidl::encoding::DefaultFuchsiaResourceDialect
11549                ),
11550            }
11551        }
11552
11553        #[inline]
11554        unsafe fn decode(
11555            &mut self,
11556            decoder: &mut fidl::encoding::Decoder<
11557                '_,
11558                fidl::encoding::DefaultFuchsiaResourceDialect,
11559            >,
11560            offset: usize,
11561            _depth: fidl::encoding::Depth,
11562        ) -> fidl::Result<()> {
11563            decoder.debug_check_bounds::<Self>(offset);
11564            // Verify that padding bytes are zero.
11565            fidl::decode!(
11566                fidl::encoding::Endpoint<
11567                    fidl::endpoints::ServerEnd<DevToolsPerContextListenerMarker>,
11568                >,
11569                fidl::encoding::DefaultFuchsiaResourceDialect,
11570                &mut self.listener,
11571                decoder,
11572                offset + 0,
11573                _depth
11574            )?;
11575            Ok(())
11576        }
11577    }
11578
11579    impl fidl::encoding::ResourceTypeMarker for FrameAddBeforeLoadJavaScriptRequest {
11580        type Borrowed<'a> = &'a mut Self;
11581        fn take_or_borrow<'a>(
11582            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11583        ) -> Self::Borrowed<'a> {
11584            value
11585        }
11586    }
11587
11588    unsafe impl fidl::encoding::TypeMarker for FrameAddBeforeLoadJavaScriptRequest {
11589        type Owned = Self;
11590
11591        #[inline(always)]
11592        fn inline_align(_context: fidl::encoding::Context) -> usize {
11593            8
11594        }
11595
11596        #[inline(always)]
11597        fn inline_size(_context: fidl::encoding::Context) -> usize {
11598            40
11599        }
11600    }
11601
11602    unsafe impl
11603        fidl::encoding::Encode<
11604            FrameAddBeforeLoadJavaScriptRequest,
11605            fidl::encoding::DefaultFuchsiaResourceDialect,
11606        > for &mut FrameAddBeforeLoadJavaScriptRequest
11607    {
11608        #[inline]
11609        unsafe fn encode(
11610            self,
11611            encoder: &mut fidl::encoding::Encoder<
11612                '_,
11613                fidl::encoding::DefaultFuchsiaResourceDialect,
11614            >,
11615            offset: usize,
11616            _depth: fidl::encoding::Depth,
11617        ) -> fidl::Result<()> {
11618            encoder.debug_check_bounds::<FrameAddBeforeLoadJavaScriptRequest>(offset);
11619            // Delegate to tuple encoding.
11620            fidl::encoding::Encode::<FrameAddBeforeLoadJavaScriptRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11621                (
11622                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11623                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.origins),
11624                    <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.script),
11625                ),
11626                encoder, offset, _depth
11627            )
11628        }
11629    }
11630    unsafe impl<
11631        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11632        T1: fidl::encoding::Encode<
11633                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
11634                fidl::encoding::DefaultFuchsiaResourceDialect,
11635            >,
11636        T2: fidl::encoding::Encode<
11637                fidl_fuchsia_mem::Buffer,
11638                fidl::encoding::DefaultFuchsiaResourceDialect,
11639            >,
11640    >
11641        fidl::encoding::Encode<
11642            FrameAddBeforeLoadJavaScriptRequest,
11643            fidl::encoding::DefaultFuchsiaResourceDialect,
11644        > for (T0, T1, T2)
11645    {
11646        #[inline]
11647        unsafe fn encode(
11648            self,
11649            encoder: &mut fidl::encoding::Encoder<
11650                '_,
11651                fidl::encoding::DefaultFuchsiaResourceDialect,
11652            >,
11653            offset: usize,
11654            depth: fidl::encoding::Depth,
11655        ) -> fidl::Result<()> {
11656            encoder.debug_check_bounds::<FrameAddBeforeLoadJavaScriptRequest>(offset);
11657            // Zero out padding regions. There's no need to apply masks
11658            // because the unmasked parts will be overwritten by fields.
11659            // Write the fields.
11660            self.0.encode(encoder, offset + 0, depth)?;
11661            self.1.encode(encoder, offset + 8, depth)?;
11662            self.2.encode(encoder, offset + 24, depth)?;
11663            Ok(())
11664        }
11665    }
11666
11667    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11668        for FrameAddBeforeLoadJavaScriptRequest
11669    {
11670        #[inline(always)]
11671        fn new_empty() -> Self {
11672            Self {
11673                id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11674                origins: fidl::new_empty!(
11675                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
11676                    fidl::encoding::DefaultFuchsiaResourceDialect
11677                ),
11678                script: fidl::new_empty!(
11679                    fidl_fuchsia_mem::Buffer,
11680                    fidl::encoding::DefaultFuchsiaResourceDialect
11681                ),
11682            }
11683        }
11684
11685        #[inline]
11686        unsafe fn decode(
11687            &mut self,
11688            decoder: &mut fidl::encoding::Decoder<
11689                '_,
11690                fidl::encoding::DefaultFuchsiaResourceDialect,
11691            >,
11692            offset: usize,
11693            _depth: fidl::encoding::Depth,
11694        ) -> fidl::Result<()> {
11695            decoder.debug_check_bounds::<Self>(offset);
11696            // Verify that padding bytes are zero.
11697            fidl::decode!(
11698                u64,
11699                fidl::encoding::DefaultFuchsiaResourceDialect,
11700                &mut self.id,
11701                decoder,
11702                offset + 0,
11703                _depth
11704            )?;
11705            fidl::decode!(
11706                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
11707                fidl::encoding::DefaultFuchsiaResourceDialect,
11708                &mut self.origins,
11709                decoder,
11710                offset + 8,
11711                _depth
11712            )?;
11713            fidl::decode!(
11714                fidl_fuchsia_mem::Buffer,
11715                fidl::encoding::DefaultFuchsiaResourceDialect,
11716                &mut self.script,
11717                decoder,
11718                offset + 24,
11719                _depth
11720            )?;
11721            Ok(())
11722        }
11723    }
11724
11725    impl fidl::encoding::ResourceTypeMarker for FrameCreateView2Request {
11726        type Borrowed<'a> = &'a mut Self;
11727        fn take_or_borrow<'a>(
11728            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11729        ) -> Self::Borrowed<'a> {
11730            value
11731        }
11732    }
11733
11734    unsafe impl fidl::encoding::TypeMarker for FrameCreateView2Request {
11735        type Owned = Self;
11736
11737        #[inline(always)]
11738        fn inline_align(_context: fidl::encoding::Context) -> usize {
11739            8
11740        }
11741
11742        #[inline(always)]
11743        fn inline_size(_context: fidl::encoding::Context) -> usize {
11744            16
11745        }
11746    }
11747
11748    unsafe impl
11749        fidl::encoding::Encode<
11750            FrameCreateView2Request,
11751            fidl::encoding::DefaultFuchsiaResourceDialect,
11752        > for &mut FrameCreateView2Request
11753    {
11754        #[inline]
11755        unsafe fn encode(
11756            self,
11757            encoder: &mut fidl::encoding::Encoder<
11758                '_,
11759                fidl::encoding::DefaultFuchsiaResourceDialect,
11760            >,
11761            offset: usize,
11762            _depth: fidl::encoding::Depth,
11763        ) -> fidl::Result<()> {
11764            encoder.debug_check_bounds::<FrameCreateView2Request>(offset);
11765            // Delegate to tuple encoding.
11766            fidl::encoding::Encode::<
11767                FrameCreateView2Request,
11768                fidl::encoding::DefaultFuchsiaResourceDialect,
11769            >::encode(
11770                (<CreateView2Args as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11771                    &mut self.args,
11772                ),),
11773                encoder,
11774                offset,
11775                _depth,
11776            )
11777        }
11778    }
11779    unsafe impl<
11780        T0: fidl::encoding::Encode<CreateView2Args, fidl::encoding::DefaultFuchsiaResourceDialect>,
11781    >
11782        fidl::encoding::Encode<
11783            FrameCreateView2Request,
11784            fidl::encoding::DefaultFuchsiaResourceDialect,
11785        > for (T0,)
11786    {
11787        #[inline]
11788        unsafe fn encode(
11789            self,
11790            encoder: &mut fidl::encoding::Encoder<
11791                '_,
11792                fidl::encoding::DefaultFuchsiaResourceDialect,
11793            >,
11794            offset: usize,
11795            depth: fidl::encoding::Depth,
11796        ) -> fidl::Result<()> {
11797            encoder.debug_check_bounds::<FrameCreateView2Request>(offset);
11798            // Zero out padding regions. There's no need to apply masks
11799            // because the unmasked parts will be overwritten by fields.
11800            // Write the fields.
11801            self.0.encode(encoder, offset + 0, depth)?;
11802            Ok(())
11803        }
11804    }
11805
11806    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11807        for FrameCreateView2Request
11808    {
11809        #[inline(always)]
11810        fn new_empty() -> Self {
11811            Self {
11812                args: fidl::new_empty!(
11813                    CreateView2Args,
11814                    fidl::encoding::DefaultFuchsiaResourceDialect
11815                ),
11816            }
11817        }
11818
11819        #[inline]
11820        unsafe fn decode(
11821            &mut self,
11822            decoder: &mut fidl::encoding::Decoder<
11823                '_,
11824                fidl::encoding::DefaultFuchsiaResourceDialect,
11825            >,
11826            offset: usize,
11827            _depth: fidl::encoding::Depth,
11828        ) -> fidl::Result<()> {
11829            decoder.debug_check_bounds::<Self>(offset);
11830            // Verify that padding bytes are zero.
11831            fidl::decode!(
11832                CreateView2Args,
11833                fidl::encoding::DefaultFuchsiaResourceDialect,
11834                &mut self.args,
11835                decoder,
11836                offset + 0,
11837                _depth
11838            )?;
11839            Ok(())
11840        }
11841    }
11842
11843    impl fidl::encoding::ResourceTypeMarker for FrameCreateViewRequest {
11844        type Borrowed<'a> = &'a mut Self;
11845        fn take_or_borrow<'a>(
11846            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11847        ) -> Self::Borrowed<'a> {
11848            value
11849        }
11850    }
11851
11852    unsafe impl fidl::encoding::TypeMarker for FrameCreateViewRequest {
11853        type Owned = Self;
11854
11855        #[inline(always)]
11856        fn inline_align(_context: fidl::encoding::Context) -> usize {
11857            4
11858        }
11859
11860        #[inline(always)]
11861        fn inline_size(_context: fidl::encoding::Context) -> usize {
11862            4
11863        }
11864    }
11865
11866    unsafe impl
11867        fidl::encoding::Encode<
11868            FrameCreateViewRequest,
11869            fidl::encoding::DefaultFuchsiaResourceDialect,
11870        > for &mut FrameCreateViewRequest
11871    {
11872        #[inline]
11873        unsafe fn encode(
11874            self,
11875            encoder: &mut fidl::encoding::Encoder<
11876                '_,
11877                fidl::encoding::DefaultFuchsiaResourceDialect,
11878            >,
11879            offset: usize,
11880            _depth: fidl::encoding::Depth,
11881        ) -> fidl::Result<()> {
11882            encoder.debug_check_bounds::<FrameCreateViewRequest>(offset);
11883            // Delegate to tuple encoding.
11884            fidl::encoding::Encode::<FrameCreateViewRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11885                (
11886                    <fidl_fuchsia_ui_views::ViewToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_token),
11887                ),
11888                encoder, offset, _depth
11889            )
11890        }
11891    }
11892    unsafe impl<
11893        T0: fidl::encoding::Encode<
11894                fidl_fuchsia_ui_views::ViewToken,
11895                fidl::encoding::DefaultFuchsiaResourceDialect,
11896            >,
11897    >
11898        fidl::encoding::Encode<
11899            FrameCreateViewRequest,
11900            fidl::encoding::DefaultFuchsiaResourceDialect,
11901        > for (T0,)
11902    {
11903        #[inline]
11904        unsafe fn encode(
11905            self,
11906            encoder: &mut fidl::encoding::Encoder<
11907                '_,
11908                fidl::encoding::DefaultFuchsiaResourceDialect,
11909            >,
11910            offset: usize,
11911            depth: fidl::encoding::Depth,
11912        ) -> fidl::Result<()> {
11913            encoder.debug_check_bounds::<FrameCreateViewRequest>(offset);
11914            // Zero out padding regions. There's no need to apply masks
11915            // because the unmasked parts will be overwritten by fields.
11916            // Write the fields.
11917            self.0.encode(encoder, offset + 0, depth)?;
11918            Ok(())
11919        }
11920    }
11921
11922    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11923        for FrameCreateViewRequest
11924    {
11925        #[inline(always)]
11926        fn new_empty() -> Self {
11927            Self {
11928                view_token: fidl::new_empty!(
11929                    fidl_fuchsia_ui_views::ViewToken,
11930                    fidl::encoding::DefaultFuchsiaResourceDialect
11931                ),
11932            }
11933        }
11934
11935        #[inline]
11936        unsafe fn decode(
11937            &mut self,
11938            decoder: &mut fidl::encoding::Decoder<
11939                '_,
11940                fidl::encoding::DefaultFuchsiaResourceDialect,
11941            >,
11942            offset: usize,
11943            _depth: fidl::encoding::Depth,
11944        ) -> fidl::Result<()> {
11945            decoder.debug_check_bounds::<Self>(offset);
11946            // Verify that padding bytes are zero.
11947            fidl::decode!(
11948                fidl_fuchsia_ui_views::ViewToken,
11949                fidl::encoding::DefaultFuchsiaResourceDialect,
11950                &mut self.view_token,
11951                decoder,
11952                offset + 0,
11953                _depth
11954            )?;
11955            Ok(())
11956        }
11957    }
11958
11959    impl fidl::encoding::ResourceTypeMarker for FrameCreateViewWithViewRefRequest {
11960        type Borrowed<'a> = &'a mut Self;
11961        fn take_or_borrow<'a>(
11962            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11963        ) -> Self::Borrowed<'a> {
11964            value
11965        }
11966    }
11967
11968    unsafe impl fidl::encoding::TypeMarker for FrameCreateViewWithViewRefRequest {
11969        type Owned = Self;
11970
11971        #[inline(always)]
11972        fn inline_align(_context: fidl::encoding::Context) -> usize {
11973            4
11974        }
11975
11976        #[inline(always)]
11977        fn inline_size(_context: fidl::encoding::Context) -> usize {
11978            12
11979        }
11980    }
11981
11982    unsafe impl
11983        fidl::encoding::Encode<
11984            FrameCreateViewWithViewRefRequest,
11985            fidl::encoding::DefaultFuchsiaResourceDialect,
11986        > for &mut FrameCreateViewWithViewRefRequest
11987    {
11988        #[inline]
11989        unsafe fn encode(
11990            self,
11991            encoder: &mut fidl::encoding::Encoder<
11992                '_,
11993                fidl::encoding::DefaultFuchsiaResourceDialect,
11994            >,
11995            offset: usize,
11996            _depth: fidl::encoding::Depth,
11997        ) -> fidl::Result<()> {
11998            encoder.debug_check_bounds::<FrameCreateViewWithViewRefRequest>(offset);
11999            // Delegate to tuple encoding.
12000            fidl::encoding::Encode::<FrameCreateViewWithViewRefRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12001                (
12002                    <fidl_fuchsia_ui_views::ViewToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_token),
12003                    <fidl_fuchsia_ui_views::ViewRefControl as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_ref_control),
12004                    <fidl_fuchsia_ui_views::ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_ref),
12005                ),
12006                encoder, offset, _depth
12007            )
12008        }
12009    }
12010    unsafe impl<
12011        T0: fidl::encoding::Encode<
12012                fidl_fuchsia_ui_views::ViewToken,
12013                fidl::encoding::DefaultFuchsiaResourceDialect,
12014            >,
12015        T1: fidl::encoding::Encode<
12016                fidl_fuchsia_ui_views::ViewRefControl,
12017                fidl::encoding::DefaultFuchsiaResourceDialect,
12018            >,
12019        T2: fidl::encoding::Encode<
12020                fidl_fuchsia_ui_views::ViewRef,
12021                fidl::encoding::DefaultFuchsiaResourceDialect,
12022            >,
12023    >
12024        fidl::encoding::Encode<
12025            FrameCreateViewWithViewRefRequest,
12026            fidl::encoding::DefaultFuchsiaResourceDialect,
12027        > for (T0, T1, T2)
12028    {
12029        #[inline]
12030        unsafe fn encode(
12031            self,
12032            encoder: &mut fidl::encoding::Encoder<
12033                '_,
12034                fidl::encoding::DefaultFuchsiaResourceDialect,
12035            >,
12036            offset: usize,
12037            depth: fidl::encoding::Depth,
12038        ) -> fidl::Result<()> {
12039            encoder.debug_check_bounds::<FrameCreateViewWithViewRefRequest>(offset);
12040            // Zero out padding regions. There's no need to apply masks
12041            // because the unmasked parts will be overwritten by fields.
12042            // Write the fields.
12043            self.0.encode(encoder, offset + 0, depth)?;
12044            self.1.encode(encoder, offset + 4, depth)?;
12045            self.2.encode(encoder, offset + 8, depth)?;
12046            Ok(())
12047        }
12048    }
12049
12050    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12051        for FrameCreateViewWithViewRefRequest
12052    {
12053        #[inline(always)]
12054        fn new_empty() -> Self {
12055            Self {
12056                view_token: fidl::new_empty!(
12057                    fidl_fuchsia_ui_views::ViewToken,
12058                    fidl::encoding::DefaultFuchsiaResourceDialect
12059                ),
12060                view_ref_control: fidl::new_empty!(
12061                    fidl_fuchsia_ui_views::ViewRefControl,
12062                    fidl::encoding::DefaultFuchsiaResourceDialect
12063                ),
12064                view_ref: fidl::new_empty!(
12065                    fidl_fuchsia_ui_views::ViewRef,
12066                    fidl::encoding::DefaultFuchsiaResourceDialect
12067                ),
12068            }
12069        }
12070
12071        #[inline]
12072        unsafe fn decode(
12073            &mut self,
12074            decoder: &mut fidl::encoding::Decoder<
12075                '_,
12076                fidl::encoding::DefaultFuchsiaResourceDialect,
12077            >,
12078            offset: usize,
12079            _depth: fidl::encoding::Depth,
12080        ) -> fidl::Result<()> {
12081            decoder.debug_check_bounds::<Self>(offset);
12082            // Verify that padding bytes are zero.
12083            fidl::decode!(
12084                fidl_fuchsia_ui_views::ViewToken,
12085                fidl::encoding::DefaultFuchsiaResourceDialect,
12086                &mut self.view_token,
12087                decoder,
12088                offset + 0,
12089                _depth
12090            )?;
12091            fidl::decode!(
12092                fidl_fuchsia_ui_views::ViewRefControl,
12093                fidl::encoding::DefaultFuchsiaResourceDialect,
12094                &mut self.view_ref_control,
12095                decoder,
12096                offset + 4,
12097                _depth
12098            )?;
12099            fidl::decode!(
12100                fidl_fuchsia_ui_views::ViewRef,
12101                fidl::encoding::DefaultFuchsiaResourceDialect,
12102                &mut self.view_ref,
12103                decoder,
12104                offset + 8,
12105                _depth
12106            )?;
12107            Ok(())
12108        }
12109    }
12110
12111    impl fidl::encoding::ResourceTypeMarker for FrameExecuteJavaScriptNoResultRequest {
12112        type Borrowed<'a> = &'a mut Self;
12113        fn take_or_borrow<'a>(
12114            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12115        ) -> Self::Borrowed<'a> {
12116            value
12117        }
12118    }
12119
12120    unsafe impl fidl::encoding::TypeMarker for FrameExecuteJavaScriptNoResultRequest {
12121        type Owned = Self;
12122
12123        #[inline(always)]
12124        fn inline_align(_context: fidl::encoding::Context) -> usize {
12125            8
12126        }
12127
12128        #[inline(always)]
12129        fn inline_size(_context: fidl::encoding::Context) -> usize {
12130            32
12131        }
12132    }
12133
12134    unsafe impl
12135        fidl::encoding::Encode<
12136            FrameExecuteJavaScriptNoResultRequest,
12137            fidl::encoding::DefaultFuchsiaResourceDialect,
12138        > for &mut FrameExecuteJavaScriptNoResultRequest
12139    {
12140        #[inline]
12141        unsafe fn encode(
12142            self,
12143            encoder: &mut fidl::encoding::Encoder<
12144                '_,
12145                fidl::encoding::DefaultFuchsiaResourceDialect,
12146            >,
12147            offset: usize,
12148            _depth: fidl::encoding::Depth,
12149        ) -> fidl::Result<()> {
12150            encoder.debug_check_bounds::<FrameExecuteJavaScriptNoResultRequest>(offset);
12151            // Delegate to tuple encoding.
12152            fidl::encoding::Encode::<FrameExecuteJavaScriptNoResultRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12153                (
12154                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.origins),
12155                    <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.script),
12156                ),
12157                encoder, offset, _depth
12158            )
12159        }
12160    }
12161    unsafe impl<
12162        T0: fidl::encoding::Encode<
12163                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12164                fidl::encoding::DefaultFuchsiaResourceDialect,
12165            >,
12166        T1: fidl::encoding::Encode<
12167                fidl_fuchsia_mem::Buffer,
12168                fidl::encoding::DefaultFuchsiaResourceDialect,
12169            >,
12170    >
12171        fidl::encoding::Encode<
12172            FrameExecuteJavaScriptNoResultRequest,
12173            fidl::encoding::DefaultFuchsiaResourceDialect,
12174        > for (T0, T1)
12175    {
12176        #[inline]
12177        unsafe fn encode(
12178            self,
12179            encoder: &mut fidl::encoding::Encoder<
12180                '_,
12181                fidl::encoding::DefaultFuchsiaResourceDialect,
12182            >,
12183            offset: usize,
12184            depth: fidl::encoding::Depth,
12185        ) -> fidl::Result<()> {
12186            encoder.debug_check_bounds::<FrameExecuteJavaScriptNoResultRequest>(offset);
12187            // Zero out padding regions. There's no need to apply masks
12188            // because the unmasked parts will be overwritten by fields.
12189            // Write the fields.
12190            self.0.encode(encoder, offset + 0, depth)?;
12191            self.1.encode(encoder, offset + 16, depth)?;
12192            Ok(())
12193        }
12194    }
12195
12196    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12197        for FrameExecuteJavaScriptNoResultRequest
12198    {
12199        #[inline(always)]
12200        fn new_empty() -> Self {
12201            Self {
12202                origins: fidl::new_empty!(
12203                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12204                    fidl::encoding::DefaultFuchsiaResourceDialect
12205                ),
12206                script: fidl::new_empty!(
12207                    fidl_fuchsia_mem::Buffer,
12208                    fidl::encoding::DefaultFuchsiaResourceDialect
12209                ),
12210            }
12211        }
12212
12213        #[inline]
12214        unsafe fn decode(
12215            &mut self,
12216            decoder: &mut fidl::encoding::Decoder<
12217                '_,
12218                fidl::encoding::DefaultFuchsiaResourceDialect,
12219            >,
12220            offset: usize,
12221            _depth: fidl::encoding::Depth,
12222        ) -> fidl::Result<()> {
12223            decoder.debug_check_bounds::<Self>(offset);
12224            // Verify that padding bytes are zero.
12225            fidl::decode!(
12226                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12227                fidl::encoding::DefaultFuchsiaResourceDialect,
12228                &mut self.origins,
12229                decoder,
12230                offset + 0,
12231                _depth
12232            )?;
12233            fidl::decode!(
12234                fidl_fuchsia_mem::Buffer,
12235                fidl::encoding::DefaultFuchsiaResourceDialect,
12236                &mut self.script,
12237                decoder,
12238                offset + 16,
12239                _depth
12240            )?;
12241            Ok(())
12242        }
12243    }
12244
12245    impl fidl::encoding::ResourceTypeMarker for FrameExecuteJavaScriptRequest {
12246        type Borrowed<'a> = &'a mut Self;
12247        fn take_or_borrow<'a>(
12248            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12249        ) -> Self::Borrowed<'a> {
12250            value
12251        }
12252    }
12253
12254    unsafe impl fidl::encoding::TypeMarker for FrameExecuteJavaScriptRequest {
12255        type Owned = Self;
12256
12257        #[inline(always)]
12258        fn inline_align(_context: fidl::encoding::Context) -> usize {
12259            8
12260        }
12261
12262        #[inline(always)]
12263        fn inline_size(_context: fidl::encoding::Context) -> usize {
12264            32
12265        }
12266    }
12267
12268    unsafe impl
12269        fidl::encoding::Encode<
12270            FrameExecuteJavaScriptRequest,
12271            fidl::encoding::DefaultFuchsiaResourceDialect,
12272        > for &mut FrameExecuteJavaScriptRequest
12273    {
12274        #[inline]
12275        unsafe fn encode(
12276            self,
12277            encoder: &mut fidl::encoding::Encoder<
12278                '_,
12279                fidl::encoding::DefaultFuchsiaResourceDialect,
12280            >,
12281            offset: usize,
12282            _depth: fidl::encoding::Depth,
12283        ) -> fidl::Result<()> {
12284            encoder.debug_check_bounds::<FrameExecuteJavaScriptRequest>(offset);
12285            // Delegate to tuple encoding.
12286            fidl::encoding::Encode::<FrameExecuteJavaScriptRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12287                (
12288                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>> as fidl::encoding::ValueTypeMarker>::borrow(&self.origins),
12289                    <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.script),
12290                ),
12291                encoder, offset, _depth
12292            )
12293        }
12294    }
12295    unsafe impl<
12296        T0: fidl::encoding::Encode<
12297                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12298                fidl::encoding::DefaultFuchsiaResourceDialect,
12299            >,
12300        T1: fidl::encoding::Encode<
12301                fidl_fuchsia_mem::Buffer,
12302                fidl::encoding::DefaultFuchsiaResourceDialect,
12303            >,
12304    >
12305        fidl::encoding::Encode<
12306            FrameExecuteJavaScriptRequest,
12307            fidl::encoding::DefaultFuchsiaResourceDialect,
12308        > for (T0, T1)
12309    {
12310        #[inline]
12311        unsafe fn encode(
12312            self,
12313            encoder: &mut fidl::encoding::Encoder<
12314                '_,
12315                fidl::encoding::DefaultFuchsiaResourceDialect,
12316            >,
12317            offset: usize,
12318            depth: fidl::encoding::Depth,
12319        ) -> fidl::Result<()> {
12320            encoder.debug_check_bounds::<FrameExecuteJavaScriptRequest>(offset);
12321            // Zero out padding regions. There's no need to apply masks
12322            // because the unmasked parts will be overwritten by fields.
12323            // Write the fields.
12324            self.0.encode(encoder, offset + 0, depth)?;
12325            self.1.encode(encoder, offset + 16, depth)?;
12326            Ok(())
12327        }
12328    }
12329
12330    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12331        for FrameExecuteJavaScriptRequest
12332    {
12333        #[inline(always)]
12334        fn new_empty() -> Self {
12335            Self {
12336                origins: fidl::new_empty!(
12337                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12338                    fidl::encoding::DefaultFuchsiaResourceDialect
12339                ),
12340                script: fidl::new_empty!(
12341                    fidl_fuchsia_mem::Buffer,
12342                    fidl::encoding::DefaultFuchsiaResourceDialect
12343                ),
12344            }
12345        }
12346
12347        #[inline]
12348        unsafe fn decode(
12349            &mut self,
12350            decoder: &mut fidl::encoding::Decoder<
12351                '_,
12352                fidl::encoding::DefaultFuchsiaResourceDialect,
12353            >,
12354            offset: usize,
12355            _depth: fidl::encoding::Depth,
12356        ) -> fidl::Result<()> {
12357            decoder.debug_check_bounds::<Self>(offset);
12358            // Verify that padding bytes are zero.
12359            fidl::decode!(
12360                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<65536>>,
12361                fidl::encoding::DefaultFuchsiaResourceDialect,
12362                &mut self.origins,
12363                decoder,
12364                offset + 0,
12365                _depth
12366            )?;
12367            fidl::decode!(
12368                fidl_fuchsia_mem::Buffer,
12369                fidl::encoding::DefaultFuchsiaResourceDialect,
12370                &mut self.script,
12371                decoder,
12372                offset + 16,
12373                _depth
12374            )?;
12375            Ok(())
12376        }
12377    }
12378
12379    impl fidl::encoding::ResourceTypeMarker for FrameGetMediaPlayerRequest {
12380        type Borrowed<'a> = &'a mut Self;
12381        fn take_or_borrow<'a>(
12382            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12383        ) -> Self::Borrowed<'a> {
12384            value
12385        }
12386    }
12387
12388    unsafe impl fidl::encoding::TypeMarker for FrameGetMediaPlayerRequest {
12389        type Owned = Self;
12390
12391        #[inline(always)]
12392        fn inline_align(_context: fidl::encoding::Context) -> usize {
12393            4
12394        }
12395
12396        #[inline(always)]
12397        fn inline_size(_context: fidl::encoding::Context) -> usize {
12398            4
12399        }
12400    }
12401
12402    unsafe impl
12403        fidl::encoding::Encode<
12404            FrameGetMediaPlayerRequest,
12405            fidl::encoding::DefaultFuchsiaResourceDialect,
12406        > for &mut FrameGetMediaPlayerRequest
12407    {
12408        #[inline]
12409        unsafe fn encode(
12410            self,
12411            encoder: &mut fidl::encoding::Encoder<
12412                '_,
12413                fidl::encoding::DefaultFuchsiaResourceDialect,
12414            >,
12415            offset: usize,
12416            _depth: fidl::encoding::Depth,
12417        ) -> fidl::Result<()> {
12418            encoder.debug_check_bounds::<FrameGetMediaPlayerRequest>(offset);
12419            // Delegate to tuple encoding.
12420            fidl::encoding::Encode::<
12421                FrameGetMediaPlayerRequest,
12422                fidl::encoding::DefaultFuchsiaResourceDialect,
12423            >::encode(
12424                (<fidl::encoding::Endpoint<
12425                    fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
12426                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12427                    &mut self.player
12428                ),),
12429                encoder,
12430                offset,
12431                _depth,
12432            )
12433        }
12434    }
12435    unsafe impl<
12436        T0: fidl::encoding::Encode<
12437                fidl::encoding::Endpoint<
12438                    fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
12439                >,
12440                fidl::encoding::DefaultFuchsiaResourceDialect,
12441            >,
12442    >
12443        fidl::encoding::Encode<
12444            FrameGetMediaPlayerRequest,
12445            fidl::encoding::DefaultFuchsiaResourceDialect,
12446        > for (T0,)
12447    {
12448        #[inline]
12449        unsafe fn encode(
12450            self,
12451            encoder: &mut fidl::encoding::Encoder<
12452                '_,
12453                fidl::encoding::DefaultFuchsiaResourceDialect,
12454            >,
12455            offset: usize,
12456            depth: fidl::encoding::Depth,
12457        ) -> fidl::Result<()> {
12458            encoder.debug_check_bounds::<FrameGetMediaPlayerRequest>(offset);
12459            // Zero out padding regions. There's no need to apply masks
12460            // because the unmasked parts will be overwritten by fields.
12461            // Write the fields.
12462            self.0.encode(encoder, offset + 0, depth)?;
12463            Ok(())
12464        }
12465    }
12466
12467    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12468        for FrameGetMediaPlayerRequest
12469    {
12470        #[inline(always)]
12471        fn new_empty() -> Self {
12472            Self {
12473                player: fidl::new_empty!(
12474                    fidl::encoding::Endpoint<
12475                        fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
12476                    >,
12477                    fidl::encoding::DefaultFuchsiaResourceDialect
12478                ),
12479            }
12480        }
12481
12482        #[inline]
12483        unsafe fn decode(
12484            &mut self,
12485            decoder: &mut fidl::encoding::Decoder<
12486                '_,
12487                fidl::encoding::DefaultFuchsiaResourceDialect,
12488            >,
12489            offset: usize,
12490            _depth: fidl::encoding::Depth,
12491        ) -> fidl::Result<()> {
12492            decoder.debug_check_bounds::<Self>(offset);
12493            // Verify that padding bytes are zero.
12494            fidl::decode!(
12495                fidl::encoding::Endpoint<
12496                    fidl::endpoints::ServerEnd<fidl_fuchsia_media_sessions2::PlayerMarker>,
12497                >,
12498                fidl::encoding::DefaultFuchsiaResourceDialect,
12499                &mut self.player,
12500                decoder,
12501                offset + 0,
12502                _depth
12503            )?;
12504            Ok(())
12505        }
12506    }
12507
12508    impl fidl::encoding::ResourceTypeMarker for FrameGetNavigationControllerRequest {
12509        type Borrowed<'a> = &'a mut Self;
12510        fn take_or_borrow<'a>(
12511            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12512        ) -> Self::Borrowed<'a> {
12513            value
12514        }
12515    }
12516
12517    unsafe impl fidl::encoding::TypeMarker for FrameGetNavigationControllerRequest {
12518        type Owned = Self;
12519
12520        #[inline(always)]
12521        fn inline_align(_context: fidl::encoding::Context) -> usize {
12522            4
12523        }
12524
12525        #[inline(always)]
12526        fn inline_size(_context: fidl::encoding::Context) -> usize {
12527            4
12528        }
12529    }
12530
12531    unsafe impl
12532        fidl::encoding::Encode<
12533            FrameGetNavigationControllerRequest,
12534            fidl::encoding::DefaultFuchsiaResourceDialect,
12535        > for &mut FrameGetNavigationControllerRequest
12536    {
12537        #[inline]
12538        unsafe fn encode(
12539            self,
12540            encoder: &mut fidl::encoding::Encoder<
12541                '_,
12542                fidl::encoding::DefaultFuchsiaResourceDialect,
12543            >,
12544            offset: usize,
12545            _depth: fidl::encoding::Depth,
12546        ) -> fidl::Result<()> {
12547            encoder.debug_check_bounds::<FrameGetNavigationControllerRequest>(offset);
12548            // Delegate to tuple encoding.
12549            fidl::encoding::Encode::<
12550                FrameGetNavigationControllerRequest,
12551                fidl::encoding::DefaultFuchsiaResourceDialect,
12552            >::encode(
12553                (
12554                    <fidl::encoding::Endpoint<
12555                        fidl::endpoints::ServerEnd<NavigationControllerMarker>,
12556                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12557                        &mut self.controller
12558                    ),
12559                ),
12560                encoder,
12561                offset,
12562                _depth,
12563            )
12564        }
12565    }
12566    unsafe impl<
12567        T0: fidl::encoding::Encode<
12568                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NavigationControllerMarker>>,
12569                fidl::encoding::DefaultFuchsiaResourceDialect,
12570            >,
12571    >
12572        fidl::encoding::Encode<
12573            FrameGetNavigationControllerRequest,
12574            fidl::encoding::DefaultFuchsiaResourceDialect,
12575        > for (T0,)
12576    {
12577        #[inline]
12578        unsafe fn encode(
12579            self,
12580            encoder: &mut fidl::encoding::Encoder<
12581                '_,
12582                fidl::encoding::DefaultFuchsiaResourceDialect,
12583            >,
12584            offset: usize,
12585            depth: fidl::encoding::Depth,
12586        ) -> fidl::Result<()> {
12587            encoder.debug_check_bounds::<FrameGetNavigationControllerRequest>(offset);
12588            // Zero out padding regions. There's no need to apply masks
12589            // because the unmasked parts will be overwritten by fields.
12590            // Write the fields.
12591            self.0.encode(encoder, offset + 0, depth)?;
12592            Ok(())
12593        }
12594    }
12595
12596    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12597        for FrameGetNavigationControllerRequest
12598    {
12599        #[inline(always)]
12600        fn new_empty() -> Self {
12601            Self {
12602                controller: fidl::new_empty!(
12603                    fidl::encoding::Endpoint<
12604                        fidl::endpoints::ServerEnd<NavigationControllerMarker>,
12605                    >,
12606                    fidl::encoding::DefaultFuchsiaResourceDialect
12607                ),
12608            }
12609        }
12610
12611        #[inline]
12612        unsafe fn decode(
12613            &mut self,
12614            decoder: &mut fidl::encoding::Decoder<
12615                '_,
12616                fidl::encoding::DefaultFuchsiaResourceDialect,
12617            >,
12618            offset: usize,
12619            _depth: fidl::encoding::Depth,
12620        ) -> fidl::Result<()> {
12621            decoder.debug_check_bounds::<Self>(offset);
12622            // Verify that padding bytes are zero.
12623            fidl::decode!(
12624                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NavigationControllerMarker>>,
12625                fidl::encoding::DefaultFuchsiaResourceDialect,
12626                &mut self.controller,
12627                decoder,
12628                offset + 0,
12629                _depth
12630            )?;
12631            Ok(())
12632        }
12633    }
12634
12635    impl fidl::encoding::ResourceTypeMarker for FrameHostCreateFrameWithParamsRequest {
12636        type Borrowed<'a> = &'a mut Self;
12637        fn take_or_borrow<'a>(
12638            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12639        ) -> Self::Borrowed<'a> {
12640            value
12641        }
12642    }
12643
12644    unsafe impl fidl::encoding::TypeMarker for FrameHostCreateFrameWithParamsRequest {
12645        type Owned = Self;
12646
12647        #[inline(always)]
12648        fn inline_align(_context: fidl::encoding::Context) -> usize {
12649            8
12650        }
12651
12652        #[inline(always)]
12653        fn inline_size(_context: fidl::encoding::Context) -> usize {
12654            24
12655        }
12656    }
12657
12658    unsafe impl
12659        fidl::encoding::Encode<
12660            FrameHostCreateFrameWithParamsRequest,
12661            fidl::encoding::DefaultFuchsiaResourceDialect,
12662        > for &mut FrameHostCreateFrameWithParamsRequest
12663    {
12664        #[inline]
12665        unsafe fn encode(
12666            self,
12667            encoder: &mut fidl::encoding::Encoder<
12668                '_,
12669                fidl::encoding::DefaultFuchsiaResourceDialect,
12670            >,
12671            offset: usize,
12672            _depth: fidl::encoding::Depth,
12673        ) -> fidl::Result<()> {
12674            encoder.debug_check_bounds::<FrameHostCreateFrameWithParamsRequest>(offset);
12675            // Delegate to tuple encoding.
12676            fidl::encoding::Encode::<FrameHostCreateFrameWithParamsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12677                (
12678                    <CreateFrameParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.params),
12679                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.frame),
12680                ),
12681                encoder, offset, _depth
12682            )
12683        }
12684    }
12685    unsafe impl<
12686        T0: fidl::encoding::Encode<CreateFrameParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
12687        T1: fidl::encoding::Encode<
12688                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
12689                fidl::encoding::DefaultFuchsiaResourceDialect,
12690            >,
12691    >
12692        fidl::encoding::Encode<
12693            FrameHostCreateFrameWithParamsRequest,
12694            fidl::encoding::DefaultFuchsiaResourceDialect,
12695        > for (T0, T1)
12696    {
12697        #[inline]
12698        unsafe fn encode(
12699            self,
12700            encoder: &mut fidl::encoding::Encoder<
12701                '_,
12702                fidl::encoding::DefaultFuchsiaResourceDialect,
12703            >,
12704            offset: usize,
12705            depth: fidl::encoding::Depth,
12706        ) -> fidl::Result<()> {
12707            encoder.debug_check_bounds::<FrameHostCreateFrameWithParamsRequest>(offset);
12708            // Zero out padding regions. There's no need to apply masks
12709            // because the unmasked parts will be overwritten by fields.
12710            unsafe {
12711                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
12712                (ptr as *mut u64).write_unaligned(0);
12713            }
12714            // Write the fields.
12715            self.0.encode(encoder, offset + 0, depth)?;
12716            self.1.encode(encoder, offset + 16, depth)?;
12717            Ok(())
12718        }
12719    }
12720
12721    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12722        for FrameHostCreateFrameWithParamsRequest
12723    {
12724        #[inline(always)]
12725        fn new_empty() -> Self {
12726            Self {
12727                params: fidl::new_empty!(
12728                    CreateFrameParams,
12729                    fidl::encoding::DefaultFuchsiaResourceDialect
12730                ),
12731                frame: fidl::new_empty!(
12732                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
12733                    fidl::encoding::DefaultFuchsiaResourceDialect
12734                ),
12735            }
12736        }
12737
12738        #[inline]
12739        unsafe fn decode(
12740            &mut self,
12741            decoder: &mut fidl::encoding::Decoder<
12742                '_,
12743                fidl::encoding::DefaultFuchsiaResourceDialect,
12744            >,
12745            offset: usize,
12746            _depth: fidl::encoding::Depth,
12747        ) -> fidl::Result<()> {
12748            decoder.debug_check_bounds::<Self>(offset);
12749            // Verify that padding bytes are zero.
12750            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
12751            let padval = unsafe { (ptr as *const u64).read_unaligned() };
12752            let mask = 0xffffffff00000000u64;
12753            let maskedval = padval & mask;
12754            if maskedval != 0 {
12755                return Err(fidl::Error::NonZeroPadding {
12756                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
12757                });
12758            }
12759            fidl::decode!(
12760                CreateFrameParams,
12761                fidl::encoding::DefaultFuchsiaResourceDialect,
12762                &mut self.params,
12763                decoder,
12764                offset + 0,
12765                _depth
12766            )?;
12767            fidl::decode!(
12768                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FrameMarker>>,
12769                fidl::encoding::DefaultFuchsiaResourceDialect,
12770                &mut self.frame,
12771                decoder,
12772                offset + 16,
12773                _depth
12774            )?;
12775            Ok(())
12776        }
12777    }
12778
12779    impl fidl::encoding::ResourceTypeMarker for FramePostMessageRequest {
12780        type Borrowed<'a> = &'a mut Self;
12781        fn take_or_borrow<'a>(
12782            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12783        ) -> Self::Borrowed<'a> {
12784            value
12785        }
12786    }
12787
12788    unsafe impl fidl::encoding::TypeMarker for FramePostMessageRequest {
12789        type Owned = Self;
12790
12791        #[inline(always)]
12792        fn inline_align(_context: fidl::encoding::Context) -> usize {
12793            8
12794        }
12795
12796        #[inline(always)]
12797        fn inline_size(_context: fidl::encoding::Context) -> usize {
12798            32
12799        }
12800    }
12801
12802    unsafe impl
12803        fidl::encoding::Encode<
12804            FramePostMessageRequest,
12805            fidl::encoding::DefaultFuchsiaResourceDialect,
12806        > for &mut FramePostMessageRequest
12807    {
12808        #[inline]
12809        unsafe fn encode(
12810            self,
12811            encoder: &mut fidl::encoding::Encoder<
12812                '_,
12813                fidl::encoding::DefaultFuchsiaResourceDialect,
12814            >,
12815            offset: usize,
12816            _depth: fidl::encoding::Depth,
12817        ) -> fidl::Result<()> {
12818            encoder.debug_check_bounds::<FramePostMessageRequest>(offset);
12819            // Delegate to tuple encoding.
12820            fidl::encoding::Encode::<FramePostMessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12821                (
12822                    <fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow(&self.target_origin),
12823                    <WebMessage as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.message),
12824                ),
12825                encoder, offset, _depth
12826            )
12827        }
12828    }
12829    unsafe impl<
12830        T0: fidl::encoding::Encode<
12831                fidl::encoding::BoundedString<65536>,
12832                fidl::encoding::DefaultFuchsiaResourceDialect,
12833            >,
12834        T1: fidl::encoding::Encode<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>,
12835    >
12836        fidl::encoding::Encode<
12837            FramePostMessageRequest,
12838            fidl::encoding::DefaultFuchsiaResourceDialect,
12839        > for (T0, T1)
12840    {
12841        #[inline]
12842        unsafe fn encode(
12843            self,
12844            encoder: &mut fidl::encoding::Encoder<
12845                '_,
12846                fidl::encoding::DefaultFuchsiaResourceDialect,
12847            >,
12848            offset: usize,
12849            depth: fidl::encoding::Depth,
12850        ) -> fidl::Result<()> {
12851            encoder.debug_check_bounds::<FramePostMessageRequest>(offset);
12852            // Zero out padding regions. There's no need to apply masks
12853            // because the unmasked parts will be overwritten by fields.
12854            // Write the fields.
12855            self.0.encode(encoder, offset + 0, depth)?;
12856            self.1.encode(encoder, offset + 16, depth)?;
12857            Ok(())
12858        }
12859    }
12860
12861    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12862        for FramePostMessageRequest
12863    {
12864        #[inline(always)]
12865        fn new_empty() -> Self {
12866            Self {
12867                target_origin: fidl::new_empty!(
12868                    fidl::encoding::BoundedString<65536>,
12869                    fidl::encoding::DefaultFuchsiaResourceDialect
12870                ),
12871                message: fidl::new_empty!(
12872                    WebMessage,
12873                    fidl::encoding::DefaultFuchsiaResourceDialect
12874                ),
12875            }
12876        }
12877
12878        #[inline]
12879        unsafe fn decode(
12880            &mut self,
12881            decoder: &mut fidl::encoding::Decoder<
12882                '_,
12883                fidl::encoding::DefaultFuchsiaResourceDialect,
12884            >,
12885            offset: usize,
12886            _depth: fidl::encoding::Depth,
12887        ) -> fidl::Result<()> {
12888            decoder.debug_check_bounds::<Self>(offset);
12889            // Verify that padding bytes are zero.
12890            fidl::decode!(
12891                fidl::encoding::BoundedString<65536>,
12892                fidl::encoding::DefaultFuchsiaResourceDialect,
12893                &mut self.target_origin,
12894                decoder,
12895                offset + 0,
12896                _depth
12897            )?;
12898            fidl::decode!(
12899                WebMessage,
12900                fidl::encoding::DefaultFuchsiaResourceDialect,
12901                &mut self.message,
12902                decoder,
12903                offset + 16,
12904                _depth
12905            )?;
12906            Ok(())
12907        }
12908    }
12909
12910    impl fidl::encoding::ResourceTypeMarker for FrameSetConsoleLogSinkRequest {
12911        type Borrowed<'a> = &'a mut Self;
12912        fn take_or_borrow<'a>(
12913            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12914        ) -> Self::Borrowed<'a> {
12915            value
12916        }
12917    }
12918
12919    unsafe impl fidl::encoding::TypeMarker for FrameSetConsoleLogSinkRequest {
12920        type Owned = Self;
12921
12922        #[inline(always)]
12923        fn inline_align(_context: fidl::encoding::Context) -> usize {
12924            4
12925        }
12926
12927        #[inline(always)]
12928        fn inline_size(_context: fidl::encoding::Context) -> usize {
12929            4
12930        }
12931    }
12932
12933    unsafe impl
12934        fidl::encoding::Encode<
12935            FrameSetConsoleLogSinkRequest,
12936            fidl::encoding::DefaultFuchsiaResourceDialect,
12937        > for &mut FrameSetConsoleLogSinkRequest
12938    {
12939        #[inline]
12940        unsafe fn encode(
12941            self,
12942            encoder: &mut fidl::encoding::Encoder<
12943                '_,
12944                fidl::encoding::DefaultFuchsiaResourceDialect,
12945            >,
12946            offset: usize,
12947            _depth: fidl::encoding::Depth,
12948        ) -> fidl::Result<()> {
12949            encoder.debug_check_bounds::<FrameSetConsoleLogSinkRequest>(offset);
12950            // Delegate to tuple encoding.
12951            fidl::encoding::Encode::<
12952                FrameSetConsoleLogSinkRequest,
12953                fidl::encoding::DefaultFuchsiaResourceDialect,
12954            >::encode(
12955                (<fidl::encoding::Optional<
12956                    fidl::encoding::Endpoint<
12957                        fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>,
12958                    >,
12959                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12960                    &mut self.sink
12961                ),),
12962                encoder,
12963                offset,
12964                _depth,
12965            )
12966        }
12967    }
12968    unsafe impl<
12969        T0: fidl::encoding::Encode<
12970                fidl::encoding::Optional<
12971                    fidl::encoding::Endpoint<
12972                        fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>,
12973                    >,
12974                >,
12975                fidl::encoding::DefaultFuchsiaResourceDialect,
12976            >,
12977    >
12978        fidl::encoding::Encode<
12979            FrameSetConsoleLogSinkRequest,
12980            fidl::encoding::DefaultFuchsiaResourceDialect,
12981        > for (T0,)
12982    {
12983        #[inline]
12984        unsafe fn encode(
12985            self,
12986            encoder: &mut fidl::encoding::Encoder<
12987                '_,
12988                fidl::encoding::DefaultFuchsiaResourceDialect,
12989            >,
12990            offset: usize,
12991            depth: fidl::encoding::Depth,
12992        ) -> fidl::Result<()> {
12993            encoder.debug_check_bounds::<FrameSetConsoleLogSinkRequest>(offset);
12994            // Zero out padding regions. There's no need to apply masks
12995            // because the unmasked parts will be overwritten by fields.
12996            // Write the fields.
12997            self.0.encode(encoder, offset + 0, depth)?;
12998            Ok(())
12999        }
13000    }
13001
13002    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13003        for FrameSetConsoleLogSinkRequest
13004    {
13005        #[inline(always)]
13006        fn new_empty() -> Self {
13007            Self {
13008                sink: fidl::new_empty!(
13009                    fidl::encoding::Optional<
13010                        fidl::encoding::Endpoint<
13011                            fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>,
13012                        >,
13013                    >,
13014                    fidl::encoding::DefaultFuchsiaResourceDialect
13015                ),
13016            }
13017        }
13018
13019        #[inline]
13020        unsafe fn decode(
13021            &mut self,
13022            decoder: &mut fidl::encoding::Decoder<
13023                '_,
13024                fidl::encoding::DefaultFuchsiaResourceDialect,
13025            >,
13026            offset: usize,
13027            _depth: fidl::encoding::Depth,
13028        ) -> fidl::Result<()> {
13029            decoder.debug_check_bounds::<Self>(offset);
13030            // Verify that padding bytes are zero.
13031            fidl::decode!(
13032                fidl::encoding::Optional<
13033                    fidl::encoding::Endpoint<
13034                        fidl::endpoints::ClientEnd<fidl_fuchsia_logger::LogSinkMarker>,
13035                    >,
13036                >,
13037                fidl::encoding::DefaultFuchsiaResourceDialect,
13038                &mut self.sink,
13039                decoder,
13040                offset + 0,
13041                _depth
13042            )?;
13043            Ok(())
13044        }
13045    }
13046
13047    impl fidl::encoding::ResourceTypeMarker for FrameSetNavigationEventListener2Request {
13048        type Borrowed<'a> = &'a mut Self;
13049        fn take_or_borrow<'a>(
13050            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13051        ) -> Self::Borrowed<'a> {
13052            value
13053        }
13054    }
13055
13056    unsafe impl fidl::encoding::TypeMarker for FrameSetNavigationEventListener2Request {
13057        type Owned = Self;
13058
13059        #[inline(always)]
13060        fn inline_align(_context: fidl::encoding::Context) -> usize {
13061            8
13062        }
13063
13064        #[inline(always)]
13065        fn inline_size(_context: fidl::encoding::Context) -> usize {
13066            16
13067        }
13068    }
13069
13070    unsafe impl
13071        fidl::encoding::Encode<
13072            FrameSetNavigationEventListener2Request,
13073            fidl::encoding::DefaultFuchsiaResourceDialect,
13074        > for &mut FrameSetNavigationEventListener2Request
13075    {
13076        #[inline]
13077        unsafe fn encode(
13078            self,
13079            encoder: &mut fidl::encoding::Encoder<
13080                '_,
13081                fidl::encoding::DefaultFuchsiaResourceDialect,
13082            >,
13083            offset: usize,
13084            _depth: fidl::encoding::Depth,
13085        ) -> fidl::Result<()> {
13086            encoder.debug_check_bounds::<FrameSetNavigationEventListener2Request>(offset);
13087            // Delegate to tuple encoding.
13088            fidl::encoding::Encode::<
13089                FrameSetNavigationEventListener2Request,
13090                fidl::encoding::DefaultFuchsiaResourceDialect,
13091            >::encode(
13092                (
13093                    <fidl::encoding::Optional<
13094                        fidl::encoding::Endpoint<
13095                            fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13096                        >,
13097                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13098                        &mut self.listener
13099                    ),
13100                    <NavigationEventListenerFlags as fidl::encoding::ValueTypeMarker>::borrow(
13101                        &self.flags,
13102                    ),
13103                ),
13104                encoder,
13105                offset,
13106                _depth,
13107            )
13108        }
13109    }
13110    unsafe impl<
13111        T0: fidl::encoding::Encode<
13112                fidl::encoding::Optional<
13113                    fidl::encoding::Endpoint<
13114                        fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13115                    >,
13116                >,
13117                fidl::encoding::DefaultFuchsiaResourceDialect,
13118            >,
13119        T1: fidl::encoding::Encode<
13120                NavigationEventListenerFlags,
13121                fidl::encoding::DefaultFuchsiaResourceDialect,
13122            >,
13123    >
13124        fidl::encoding::Encode<
13125            FrameSetNavigationEventListener2Request,
13126            fidl::encoding::DefaultFuchsiaResourceDialect,
13127        > for (T0, T1)
13128    {
13129        #[inline]
13130        unsafe fn encode(
13131            self,
13132            encoder: &mut fidl::encoding::Encoder<
13133                '_,
13134                fidl::encoding::DefaultFuchsiaResourceDialect,
13135            >,
13136            offset: usize,
13137            depth: fidl::encoding::Depth,
13138        ) -> fidl::Result<()> {
13139            encoder.debug_check_bounds::<FrameSetNavigationEventListener2Request>(offset);
13140            // Zero out padding regions. There's no need to apply masks
13141            // because the unmasked parts will be overwritten by fields.
13142            unsafe {
13143                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
13144                (ptr as *mut u64).write_unaligned(0);
13145            }
13146            // Write the fields.
13147            self.0.encode(encoder, offset + 0, depth)?;
13148            self.1.encode(encoder, offset + 8, depth)?;
13149            Ok(())
13150        }
13151    }
13152
13153    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13154        for FrameSetNavigationEventListener2Request
13155    {
13156        #[inline(always)]
13157        fn new_empty() -> Self {
13158            Self {
13159                listener: fidl::new_empty!(
13160                    fidl::encoding::Optional<
13161                        fidl::encoding::Endpoint<
13162                            fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13163                        >,
13164                    >,
13165                    fidl::encoding::DefaultFuchsiaResourceDialect
13166                ),
13167                flags: fidl::new_empty!(
13168                    NavigationEventListenerFlags,
13169                    fidl::encoding::DefaultFuchsiaResourceDialect
13170                ),
13171            }
13172        }
13173
13174        #[inline]
13175        unsafe fn decode(
13176            &mut self,
13177            decoder: &mut fidl::encoding::Decoder<
13178                '_,
13179                fidl::encoding::DefaultFuchsiaResourceDialect,
13180            >,
13181            offset: usize,
13182            _depth: fidl::encoding::Depth,
13183        ) -> fidl::Result<()> {
13184            decoder.debug_check_bounds::<Self>(offset);
13185            // Verify that padding bytes are zero.
13186            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
13187            let padval = unsafe { (ptr as *const u64).read_unaligned() };
13188            let mask = 0xffffffff00000000u64;
13189            let maskedval = padval & mask;
13190            if maskedval != 0 {
13191                return Err(fidl::Error::NonZeroPadding {
13192                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
13193                });
13194            }
13195            fidl::decode!(
13196                fidl::encoding::Optional<
13197                    fidl::encoding::Endpoint<
13198                        fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13199                    >,
13200                >,
13201                fidl::encoding::DefaultFuchsiaResourceDialect,
13202                &mut self.listener,
13203                decoder,
13204                offset + 0,
13205                _depth
13206            )?;
13207            fidl::decode!(
13208                NavigationEventListenerFlags,
13209                fidl::encoding::DefaultFuchsiaResourceDialect,
13210                &mut self.flags,
13211                decoder,
13212                offset + 8,
13213                _depth
13214            )?;
13215            Ok(())
13216        }
13217    }
13218
13219    impl fidl::encoding::ResourceTypeMarker for FrameSetNavigationEventListenerRequest {
13220        type Borrowed<'a> = &'a mut Self;
13221        fn take_or_borrow<'a>(
13222            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13223        ) -> Self::Borrowed<'a> {
13224            value
13225        }
13226    }
13227
13228    unsafe impl fidl::encoding::TypeMarker for FrameSetNavigationEventListenerRequest {
13229        type Owned = Self;
13230
13231        #[inline(always)]
13232        fn inline_align(_context: fidl::encoding::Context) -> usize {
13233            4
13234        }
13235
13236        #[inline(always)]
13237        fn inline_size(_context: fidl::encoding::Context) -> usize {
13238            4
13239        }
13240    }
13241
13242    unsafe impl
13243        fidl::encoding::Encode<
13244            FrameSetNavigationEventListenerRequest,
13245            fidl::encoding::DefaultFuchsiaResourceDialect,
13246        > for &mut FrameSetNavigationEventListenerRequest
13247    {
13248        #[inline]
13249        unsafe fn encode(
13250            self,
13251            encoder: &mut fidl::encoding::Encoder<
13252                '_,
13253                fidl::encoding::DefaultFuchsiaResourceDialect,
13254            >,
13255            offset: usize,
13256            _depth: fidl::encoding::Depth,
13257        ) -> fidl::Result<()> {
13258            encoder.debug_check_bounds::<FrameSetNavigationEventListenerRequest>(offset);
13259            // Delegate to tuple encoding.
13260            fidl::encoding::Encode::<
13261                FrameSetNavigationEventListenerRequest,
13262                fidl::encoding::DefaultFuchsiaResourceDialect,
13263            >::encode(
13264                (<fidl::encoding::Optional<
13265                    fidl::encoding::Endpoint<
13266                        fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13267                    >,
13268                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13269                    &mut self.listener
13270                ),),
13271                encoder,
13272                offset,
13273                _depth,
13274            )
13275        }
13276    }
13277    unsafe impl<
13278        T0: fidl::encoding::Encode<
13279                fidl::encoding::Optional<
13280                    fidl::encoding::Endpoint<
13281                        fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13282                    >,
13283                >,
13284                fidl::encoding::DefaultFuchsiaResourceDialect,
13285            >,
13286    >
13287        fidl::encoding::Encode<
13288            FrameSetNavigationEventListenerRequest,
13289            fidl::encoding::DefaultFuchsiaResourceDialect,
13290        > for (T0,)
13291    {
13292        #[inline]
13293        unsafe fn encode(
13294            self,
13295            encoder: &mut fidl::encoding::Encoder<
13296                '_,
13297                fidl::encoding::DefaultFuchsiaResourceDialect,
13298            >,
13299            offset: usize,
13300            depth: fidl::encoding::Depth,
13301        ) -> fidl::Result<()> {
13302            encoder.debug_check_bounds::<FrameSetNavigationEventListenerRequest>(offset);
13303            // Zero out padding regions. There's no need to apply masks
13304            // because the unmasked parts will be overwritten by fields.
13305            // Write the fields.
13306            self.0.encode(encoder, offset + 0, depth)?;
13307            Ok(())
13308        }
13309    }
13310
13311    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13312        for FrameSetNavigationEventListenerRequest
13313    {
13314        #[inline(always)]
13315        fn new_empty() -> Self {
13316            Self {
13317                listener: fidl::new_empty!(
13318                    fidl::encoding::Optional<
13319                        fidl::encoding::Endpoint<
13320                            fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13321                        >,
13322                    >,
13323                    fidl::encoding::DefaultFuchsiaResourceDialect
13324                ),
13325            }
13326        }
13327
13328        #[inline]
13329        unsafe fn decode(
13330            &mut self,
13331            decoder: &mut fidl::encoding::Decoder<
13332                '_,
13333                fidl::encoding::DefaultFuchsiaResourceDialect,
13334            >,
13335            offset: usize,
13336            _depth: fidl::encoding::Depth,
13337        ) -> fidl::Result<()> {
13338            decoder.debug_check_bounds::<Self>(offset);
13339            // Verify that padding bytes are zero.
13340            fidl::decode!(
13341                fidl::encoding::Optional<
13342                    fidl::encoding::Endpoint<
13343                        fidl::endpoints::ClientEnd<NavigationEventListenerMarker>,
13344                    >,
13345                >,
13346                fidl::encoding::DefaultFuchsiaResourceDialect,
13347                &mut self.listener,
13348                decoder,
13349                offset + 0,
13350                _depth
13351            )?;
13352            Ok(())
13353        }
13354    }
13355
13356    impl fidl::encoding::ResourceTypeMarker for FrameSetNavigationPolicyProviderRequest {
13357        type Borrowed<'a> = &'a mut Self;
13358        fn take_or_borrow<'a>(
13359            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13360        ) -> Self::Borrowed<'a> {
13361            value
13362        }
13363    }
13364
13365    unsafe impl fidl::encoding::TypeMarker for FrameSetNavigationPolicyProviderRequest {
13366        type Owned = Self;
13367
13368        #[inline(always)]
13369        fn inline_align(_context: fidl::encoding::Context) -> usize {
13370            8
13371        }
13372
13373        #[inline(always)]
13374        fn inline_size(_context: fidl::encoding::Context) -> usize {
13375            24
13376        }
13377    }
13378
13379    unsafe impl
13380        fidl::encoding::Encode<
13381            FrameSetNavigationPolicyProviderRequest,
13382            fidl::encoding::DefaultFuchsiaResourceDialect,
13383        > for &mut FrameSetNavigationPolicyProviderRequest
13384    {
13385        #[inline]
13386        unsafe fn encode(
13387            self,
13388            encoder: &mut fidl::encoding::Encoder<
13389                '_,
13390                fidl::encoding::DefaultFuchsiaResourceDialect,
13391            >,
13392            offset: usize,
13393            _depth: fidl::encoding::Depth,
13394        ) -> fidl::Result<()> {
13395            encoder.debug_check_bounds::<FrameSetNavigationPolicyProviderRequest>(offset);
13396            // Delegate to tuple encoding.
13397            fidl::encoding::Encode::<
13398                FrameSetNavigationPolicyProviderRequest,
13399                fidl::encoding::DefaultFuchsiaResourceDialect,
13400            >::encode(
13401                (
13402                    <NavigationPolicyProviderParams as fidl::encoding::ValueTypeMarker>::borrow(
13403                        &self.params,
13404                    ),
13405                    <fidl::encoding::Endpoint<
13406                        fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
13407                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13408                        &mut self.provider
13409                    ),
13410                ),
13411                encoder,
13412                offset,
13413                _depth,
13414            )
13415        }
13416    }
13417    unsafe impl<
13418        T0: fidl::encoding::Encode<
13419                NavigationPolicyProviderParams,
13420                fidl::encoding::DefaultFuchsiaResourceDialect,
13421            >,
13422        T1: fidl::encoding::Encode<
13423                fidl::encoding::Endpoint<
13424                    fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
13425                >,
13426                fidl::encoding::DefaultFuchsiaResourceDialect,
13427            >,
13428    >
13429        fidl::encoding::Encode<
13430            FrameSetNavigationPolicyProviderRequest,
13431            fidl::encoding::DefaultFuchsiaResourceDialect,
13432        > for (T0, T1)
13433    {
13434        #[inline]
13435        unsafe fn encode(
13436            self,
13437            encoder: &mut fidl::encoding::Encoder<
13438                '_,
13439                fidl::encoding::DefaultFuchsiaResourceDialect,
13440            >,
13441            offset: usize,
13442            depth: fidl::encoding::Depth,
13443        ) -> fidl::Result<()> {
13444            encoder.debug_check_bounds::<FrameSetNavigationPolicyProviderRequest>(offset);
13445            // Zero out padding regions. There's no need to apply masks
13446            // because the unmasked parts will be overwritten by fields.
13447            unsafe {
13448                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
13449                (ptr as *mut u64).write_unaligned(0);
13450            }
13451            // Write the fields.
13452            self.0.encode(encoder, offset + 0, depth)?;
13453            self.1.encode(encoder, offset + 16, depth)?;
13454            Ok(())
13455        }
13456    }
13457
13458    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13459        for FrameSetNavigationPolicyProviderRequest
13460    {
13461        #[inline(always)]
13462        fn new_empty() -> Self {
13463            Self {
13464                params: fidl::new_empty!(
13465                    NavigationPolicyProviderParams,
13466                    fidl::encoding::DefaultFuchsiaResourceDialect
13467                ),
13468                provider: fidl::new_empty!(
13469                    fidl::encoding::Endpoint<
13470                        fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
13471                    >,
13472                    fidl::encoding::DefaultFuchsiaResourceDialect
13473                ),
13474            }
13475        }
13476
13477        #[inline]
13478        unsafe fn decode(
13479            &mut self,
13480            decoder: &mut fidl::encoding::Decoder<
13481                '_,
13482                fidl::encoding::DefaultFuchsiaResourceDialect,
13483            >,
13484            offset: usize,
13485            _depth: fidl::encoding::Depth,
13486        ) -> fidl::Result<()> {
13487            decoder.debug_check_bounds::<Self>(offset);
13488            // Verify that padding bytes are zero.
13489            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
13490            let padval = unsafe { (ptr as *const u64).read_unaligned() };
13491            let mask = 0xffffffff00000000u64;
13492            let maskedval = padval & mask;
13493            if maskedval != 0 {
13494                return Err(fidl::Error::NonZeroPadding {
13495                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
13496                });
13497            }
13498            fidl::decode!(
13499                NavigationPolicyProviderParams,
13500                fidl::encoding::DefaultFuchsiaResourceDialect,
13501                &mut self.params,
13502                decoder,
13503                offset + 0,
13504                _depth
13505            )?;
13506            fidl::decode!(
13507                fidl::encoding::Endpoint<
13508                    fidl::endpoints::ClientEnd<NavigationPolicyProviderMarker>,
13509                >,
13510                fidl::encoding::DefaultFuchsiaResourceDialect,
13511                &mut self.provider,
13512                decoder,
13513                offset + 16,
13514                _depth
13515            )?;
13516            Ok(())
13517        }
13518    }
13519
13520    impl fidl::encoding::ResourceTypeMarker for FrameSetPopupFrameCreationListenerRequest {
13521        type Borrowed<'a> = &'a mut Self;
13522        fn take_or_borrow<'a>(
13523            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13524        ) -> Self::Borrowed<'a> {
13525            value
13526        }
13527    }
13528
13529    unsafe impl fidl::encoding::TypeMarker for FrameSetPopupFrameCreationListenerRequest {
13530        type Owned = Self;
13531
13532        #[inline(always)]
13533        fn inline_align(_context: fidl::encoding::Context) -> usize {
13534            4
13535        }
13536
13537        #[inline(always)]
13538        fn inline_size(_context: fidl::encoding::Context) -> usize {
13539            4
13540        }
13541    }
13542
13543    unsafe impl
13544        fidl::encoding::Encode<
13545            FrameSetPopupFrameCreationListenerRequest,
13546            fidl::encoding::DefaultFuchsiaResourceDialect,
13547        > for &mut FrameSetPopupFrameCreationListenerRequest
13548    {
13549        #[inline]
13550        unsafe fn encode(
13551            self,
13552            encoder: &mut fidl::encoding::Encoder<
13553                '_,
13554                fidl::encoding::DefaultFuchsiaResourceDialect,
13555            >,
13556            offset: usize,
13557            _depth: fidl::encoding::Depth,
13558        ) -> fidl::Result<()> {
13559            encoder.debug_check_bounds::<FrameSetPopupFrameCreationListenerRequest>(offset);
13560            // Delegate to tuple encoding.
13561            fidl::encoding::Encode::<
13562                FrameSetPopupFrameCreationListenerRequest,
13563                fidl::encoding::DefaultFuchsiaResourceDialect,
13564            >::encode(
13565                (<fidl::encoding::Optional<
13566                    fidl::encoding::Endpoint<
13567                        fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>,
13568                    >,
13569                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13570                    &mut self.listener
13571                ),),
13572                encoder,
13573                offset,
13574                _depth,
13575            )
13576        }
13577    }
13578    unsafe impl<
13579        T0: fidl::encoding::Encode<
13580                fidl::encoding::Optional<
13581                    fidl::encoding::Endpoint<
13582                        fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>,
13583                    >,
13584                >,
13585                fidl::encoding::DefaultFuchsiaResourceDialect,
13586            >,
13587    >
13588        fidl::encoding::Encode<
13589            FrameSetPopupFrameCreationListenerRequest,
13590            fidl::encoding::DefaultFuchsiaResourceDialect,
13591        > for (T0,)
13592    {
13593        #[inline]
13594        unsafe fn encode(
13595            self,
13596            encoder: &mut fidl::encoding::Encoder<
13597                '_,
13598                fidl::encoding::DefaultFuchsiaResourceDialect,
13599            >,
13600            offset: usize,
13601            depth: fidl::encoding::Depth,
13602        ) -> fidl::Result<()> {
13603            encoder.debug_check_bounds::<FrameSetPopupFrameCreationListenerRequest>(offset);
13604            // Zero out padding regions. There's no need to apply masks
13605            // because the unmasked parts will be overwritten by fields.
13606            // Write the fields.
13607            self.0.encode(encoder, offset + 0, depth)?;
13608            Ok(())
13609        }
13610    }
13611
13612    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13613        for FrameSetPopupFrameCreationListenerRequest
13614    {
13615        #[inline(always)]
13616        fn new_empty() -> Self {
13617            Self {
13618                listener: fidl::new_empty!(
13619                    fidl::encoding::Optional<
13620                        fidl::encoding::Endpoint<
13621                            fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>,
13622                        >,
13623                    >,
13624                    fidl::encoding::DefaultFuchsiaResourceDialect
13625                ),
13626            }
13627        }
13628
13629        #[inline]
13630        unsafe fn decode(
13631            &mut self,
13632            decoder: &mut fidl::encoding::Decoder<
13633                '_,
13634                fidl::encoding::DefaultFuchsiaResourceDialect,
13635            >,
13636            offset: usize,
13637            _depth: fidl::encoding::Depth,
13638        ) -> fidl::Result<()> {
13639            decoder.debug_check_bounds::<Self>(offset);
13640            // Verify that padding bytes are zero.
13641            fidl::decode!(
13642                fidl::encoding::Optional<
13643                    fidl::encoding::Endpoint<
13644                        fidl::endpoints::ClientEnd<PopupFrameCreationListenerMarker>,
13645                    >,
13646                >,
13647                fidl::encoding::DefaultFuchsiaResourceDialect,
13648                &mut self.listener,
13649                decoder,
13650                offset + 0,
13651                _depth
13652            )?;
13653            Ok(())
13654        }
13655    }
13656
13657    impl fidl::encoding::ResourceTypeMarker for FrameExecuteJavaScriptResponse {
13658        type Borrowed<'a> = &'a mut Self;
13659        fn take_or_borrow<'a>(
13660            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13661        ) -> Self::Borrowed<'a> {
13662            value
13663        }
13664    }
13665
13666    unsafe impl fidl::encoding::TypeMarker for FrameExecuteJavaScriptResponse {
13667        type Owned = Self;
13668
13669        #[inline(always)]
13670        fn inline_align(_context: fidl::encoding::Context) -> usize {
13671            8
13672        }
13673
13674        #[inline(always)]
13675        fn inline_size(_context: fidl::encoding::Context) -> usize {
13676            16
13677        }
13678    }
13679
13680    unsafe impl
13681        fidl::encoding::Encode<
13682            FrameExecuteJavaScriptResponse,
13683            fidl::encoding::DefaultFuchsiaResourceDialect,
13684        > for &mut FrameExecuteJavaScriptResponse
13685    {
13686        #[inline]
13687        unsafe fn encode(
13688            self,
13689            encoder: &mut fidl::encoding::Encoder<
13690                '_,
13691                fidl::encoding::DefaultFuchsiaResourceDialect,
13692            >,
13693            offset: usize,
13694            _depth: fidl::encoding::Depth,
13695        ) -> fidl::Result<()> {
13696            encoder.debug_check_bounds::<FrameExecuteJavaScriptResponse>(offset);
13697            // Delegate to tuple encoding.
13698            fidl::encoding::Encode::<
13699                FrameExecuteJavaScriptResponse,
13700                fidl::encoding::DefaultFuchsiaResourceDialect,
13701            >::encode(
13702                (<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13703                    &mut self.result,
13704                ),),
13705                encoder,
13706                offset,
13707                _depth,
13708            )
13709        }
13710    }
13711    unsafe impl<
13712        T0: fidl::encoding::Encode<
13713                fidl_fuchsia_mem::Buffer,
13714                fidl::encoding::DefaultFuchsiaResourceDialect,
13715            >,
13716    >
13717        fidl::encoding::Encode<
13718            FrameExecuteJavaScriptResponse,
13719            fidl::encoding::DefaultFuchsiaResourceDialect,
13720        > for (T0,)
13721    {
13722        #[inline]
13723        unsafe fn encode(
13724            self,
13725            encoder: &mut fidl::encoding::Encoder<
13726                '_,
13727                fidl::encoding::DefaultFuchsiaResourceDialect,
13728            >,
13729            offset: usize,
13730            depth: fidl::encoding::Depth,
13731        ) -> fidl::Result<()> {
13732            encoder.debug_check_bounds::<FrameExecuteJavaScriptResponse>(offset);
13733            // Zero out padding regions. There's no need to apply masks
13734            // because the unmasked parts will be overwritten by fields.
13735            // Write the fields.
13736            self.0.encode(encoder, offset + 0, depth)?;
13737            Ok(())
13738        }
13739    }
13740
13741    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13742        for FrameExecuteJavaScriptResponse
13743    {
13744        #[inline(always)]
13745        fn new_empty() -> Self {
13746            Self {
13747                result: fidl::new_empty!(
13748                    fidl_fuchsia_mem::Buffer,
13749                    fidl::encoding::DefaultFuchsiaResourceDialect
13750                ),
13751            }
13752        }
13753
13754        #[inline]
13755        unsafe fn decode(
13756            &mut self,
13757            decoder: &mut fidl::encoding::Decoder<
13758                '_,
13759                fidl::encoding::DefaultFuchsiaResourceDialect,
13760            >,
13761            offset: usize,
13762            _depth: fidl::encoding::Depth,
13763        ) -> fidl::Result<()> {
13764            decoder.debug_check_bounds::<Self>(offset);
13765            // Verify that padding bytes are zero.
13766            fidl::decode!(
13767                fidl_fuchsia_mem::Buffer,
13768                fidl::encoding::DefaultFuchsiaResourceDialect,
13769                &mut self.result,
13770                decoder,
13771                offset + 0,
13772                _depth
13773            )?;
13774            Ok(())
13775        }
13776    }
13777
13778    impl fidl::encoding::ResourceTypeMarker for MessagePortPostMessageRequest {
13779        type Borrowed<'a> = &'a mut Self;
13780        fn take_or_borrow<'a>(
13781            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13782        ) -> Self::Borrowed<'a> {
13783            value
13784        }
13785    }
13786
13787    unsafe impl fidl::encoding::TypeMarker for MessagePortPostMessageRequest {
13788        type Owned = Self;
13789
13790        #[inline(always)]
13791        fn inline_align(_context: fidl::encoding::Context) -> usize {
13792            8
13793        }
13794
13795        #[inline(always)]
13796        fn inline_size(_context: fidl::encoding::Context) -> usize {
13797            16
13798        }
13799    }
13800
13801    unsafe impl
13802        fidl::encoding::Encode<
13803            MessagePortPostMessageRequest,
13804            fidl::encoding::DefaultFuchsiaResourceDialect,
13805        > for &mut MessagePortPostMessageRequest
13806    {
13807        #[inline]
13808        unsafe fn encode(
13809            self,
13810            encoder: &mut fidl::encoding::Encoder<
13811                '_,
13812                fidl::encoding::DefaultFuchsiaResourceDialect,
13813            >,
13814            offset: usize,
13815            _depth: fidl::encoding::Depth,
13816        ) -> fidl::Result<()> {
13817            encoder.debug_check_bounds::<MessagePortPostMessageRequest>(offset);
13818            // Delegate to tuple encoding.
13819            fidl::encoding::Encode::<
13820                MessagePortPostMessageRequest,
13821                fidl::encoding::DefaultFuchsiaResourceDialect,
13822            >::encode(
13823                (<WebMessage as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13824                    &mut self.message,
13825                ),),
13826                encoder,
13827                offset,
13828                _depth,
13829            )
13830        }
13831    }
13832    unsafe impl<
13833        T0: fidl::encoding::Encode<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>,
13834    >
13835        fidl::encoding::Encode<
13836            MessagePortPostMessageRequest,
13837            fidl::encoding::DefaultFuchsiaResourceDialect,
13838        > for (T0,)
13839    {
13840        #[inline]
13841        unsafe fn encode(
13842            self,
13843            encoder: &mut fidl::encoding::Encoder<
13844                '_,
13845                fidl::encoding::DefaultFuchsiaResourceDialect,
13846            >,
13847            offset: usize,
13848            depth: fidl::encoding::Depth,
13849        ) -> fidl::Result<()> {
13850            encoder.debug_check_bounds::<MessagePortPostMessageRequest>(offset);
13851            // Zero out padding regions. There's no need to apply masks
13852            // because the unmasked parts will be overwritten by fields.
13853            // Write the fields.
13854            self.0.encode(encoder, offset + 0, depth)?;
13855            Ok(())
13856        }
13857    }
13858
13859    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13860        for MessagePortPostMessageRequest
13861    {
13862        #[inline(always)]
13863        fn new_empty() -> Self {
13864            Self {
13865                message: fidl::new_empty!(
13866                    WebMessage,
13867                    fidl::encoding::DefaultFuchsiaResourceDialect
13868                ),
13869            }
13870        }
13871
13872        #[inline]
13873        unsafe fn decode(
13874            &mut self,
13875            decoder: &mut fidl::encoding::Decoder<
13876                '_,
13877                fidl::encoding::DefaultFuchsiaResourceDialect,
13878            >,
13879            offset: usize,
13880            _depth: fidl::encoding::Depth,
13881        ) -> fidl::Result<()> {
13882            decoder.debug_check_bounds::<Self>(offset);
13883            // Verify that padding bytes are zero.
13884            fidl::decode!(
13885                WebMessage,
13886                fidl::encoding::DefaultFuchsiaResourceDialect,
13887                &mut self.message,
13888                decoder,
13889                offset + 0,
13890                _depth
13891            )?;
13892            Ok(())
13893        }
13894    }
13895
13896    impl fidl::encoding::ResourceTypeMarker for MessagePortReceiveMessageResponse {
13897        type Borrowed<'a> = &'a mut Self;
13898        fn take_or_borrow<'a>(
13899            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13900        ) -> Self::Borrowed<'a> {
13901            value
13902        }
13903    }
13904
13905    unsafe impl fidl::encoding::TypeMarker for MessagePortReceiveMessageResponse {
13906        type Owned = Self;
13907
13908        #[inline(always)]
13909        fn inline_align(_context: fidl::encoding::Context) -> usize {
13910            8
13911        }
13912
13913        #[inline(always)]
13914        fn inline_size(_context: fidl::encoding::Context) -> usize {
13915            16
13916        }
13917    }
13918
13919    unsafe impl
13920        fidl::encoding::Encode<
13921            MessagePortReceiveMessageResponse,
13922            fidl::encoding::DefaultFuchsiaResourceDialect,
13923        > for &mut MessagePortReceiveMessageResponse
13924    {
13925        #[inline]
13926        unsafe fn encode(
13927            self,
13928            encoder: &mut fidl::encoding::Encoder<
13929                '_,
13930                fidl::encoding::DefaultFuchsiaResourceDialect,
13931            >,
13932            offset: usize,
13933            _depth: fidl::encoding::Depth,
13934        ) -> fidl::Result<()> {
13935            encoder.debug_check_bounds::<MessagePortReceiveMessageResponse>(offset);
13936            // Delegate to tuple encoding.
13937            fidl::encoding::Encode::<
13938                MessagePortReceiveMessageResponse,
13939                fidl::encoding::DefaultFuchsiaResourceDialect,
13940            >::encode(
13941                (<WebMessage as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13942                    &mut self.message,
13943                ),),
13944                encoder,
13945                offset,
13946                _depth,
13947            )
13948        }
13949    }
13950    unsafe impl<
13951        T0: fidl::encoding::Encode<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>,
13952    >
13953        fidl::encoding::Encode<
13954            MessagePortReceiveMessageResponse,
13955            fidl::encoding::DefaultFuchsiaResourceDialect,
13956        > for (T0,)
13957    {
13958        #[inline]
13959        unsafe fn encode(
13960            self,
13961            encoder: &mut fidl::encoding::Encoder<
13962                '_,
13963                fidl::encoding::DefaultFuchsiaResourceDialect,
13964            >,
13965            offset: usize,
13966            depth: fidl::encoding::Depth,
13967        ) -> fidl::Result<()> {
13968            encoder.debug_check_bounds::<MessagePortReceiveMessageResponse>(offset);
13969            // Zero out padding regions. There's no need to apply masks
13970            // because the unmasked parts will be overwritten by fields.
13971            // Write the fields.
13972            self.0.encode(encoder, offset + 0, depth)?;
13973            Ok(())
13974        }
13975    }
13976
13977    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13978        for MessagePortReceiveMessageResponse
13979    {
13980        #[inline(always)]
13981        fn new_empty() -> Self {
13982            Self {
13983                message: fidl::new_empty!(
13984                    WebMessage,
13985                    fidl::encoding::DefaultFuchsiaResourceDialect
13986                ),
13987            }
13988        }
13989
13990        #[inline]
13991        unsafe fn decode(
13992            &mut self,
13993            decoder: &mut fidl::encoding::Decoder<
13994                '_,
13995                fidl::encoding::DefaultFuchsiaResourceDialect,
13996            >,
13997            offset: usize,
13998            _depth: fidl::encoding::Depth,
13999        ) -> fidl::Result<()> {
14000            decoder.debug_check_bounds::<Self>(offset);
14001            // Verify that padding bytes are zero.
14002            fidl::decode!(
14003                WebMessage,
14004                fidl::encoding::DefaultFuchsiaResourceDialect,
14005                &mut self.message,
14006                decoder,
14007                offset + 0,
14008                _depth
14009            )?;
14010            Ok(())
14011        }
14012    }
14013
14014    impl fidl::encoding::ResourceTypeMarker for NavigationControllerLoadUrlRequest {
14015        type Borrowed<'a> = &'a mut Self;
14016        fn take_or_borrow<'a>(
14017            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14018        ) -> Self::Borrowed<'a> {
14019            value
14020        }
14021    }
14022
14023    unsafe impl fidl::encoding::TypeMarker for NavigationControllerLoadUrlRequest {
14024        type Owned = Self;
14025
14026        #[inline(always)]
14027        fn inline_align(_context: fidl::encoding::Context) -> usize {
14028            8
14029        }
14030
14031        #[inline(always)]
14032        fn inline_size(_context: fidl::encoding::Context) -> usize {
14033            32
14034        }
14035    }
14036
14037    unsafe impl
14038        fidl::encoding::Encode<
14039            NavigationControllerLoadUrlRequest,
14040            fidl::encoding::DefaultFuchsiaResourceDialect,
14041        > for &mut NavigationControllerLoadUrlRequest
14042    {
14043        #[inline]
14044        unsafe fn encode(
14045            self,
14046            encoder: &mut fidl::encoding::Encoder<
14047                '_,
14048                fidl::encoding::DefaultFuchsiaResourceDialect,
14049            >,
14050            offset: usize,
14051            _depth: fidl::encoding::Depth,
14052        ) -> fidl::Result<()> {
14053            encoder.debug_check_bounds::<NavigationControllerLoadUrlRequest>(offset);
14054            // Delegate to tuple encoding.
14055            fidl::encoding::Encode::<NavigationControllerLoadUrlRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
14056                (
14057                    <fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
14058                    <LoadUrlParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.params),
14059                ),
14060                encoder, offset, _depth
14061            )
14062        }
14063    }
14064    unsafe impl<
14065        T0: fidl::encoding::Encode<
14066                fidl::encoding::BoundedString<65536>,
14067                fidl::encoding::DefaultFuchsiaResourceDialect,
14068            >,
14069        T1: fidl::encoding::Encode<LoadUrlParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
14070    >
14071        fidl::encoding::Encode<
14072            NavigationControllerLoadUrlRequest,
14073            fidl::encoding::DefaultFuchsiaResourceDialect,
14074        > for (T0, T1)
14075    {
14076        #[inline]
14077        unsafe fn encode(
14078            self,
14079            encoder: &mut fidl::encoding::Encoder<
14080                '_,
14081                fidl::encoding::DefaultFuchsiaResourceDialect,
14082            >,
14083            offset: usize,
14084            depth: fidl::encoding::Depth,
14085        ) -> fidl::Result<()> {
14086            encoder.debug_check_bounds::<NavigationControllerLoadUrlRequest>(offset);
14087            // Zero out padding regions. There's no need to apply masks
14088            // because the unmasked parts will be overwritten by fields.
14089            // Write the fields.
14090            self.0.encode(encoder, offset + 0, depth)?;
14091            self.1.encode(encoder, offset + 16, depth)?;
14092            Ok(())
14093        }
14094    }
14095
14096    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14097        for NavigationControllerLoadUrlRequest
14098    {
14099        #[inline(always)]
14100        fn new_empty() -> Self {
14101            Self {
14102                url: fidl::new_empty!(
14103                    fidl::encoding::BoundedString<65536>,
14104                    fidl::encoding::DefaultFuchsiaResourceDialect
14105                ),
14106                params: fidl::new_empty!(
14107                    LoadUrlParams,
14108                    fidl::encoding::DefaultFuchsiaResourceDialect
14109                ),
14110            }
14111        }
14112
14113        #[inline]
14114        unsafe fn decode(
14115            &mut self,
14116            decoder: &mut fidl::encoding::Decoder<
14117                '_,
14118                fidl::encoding::DefaultFuchsiaResourceDialect,
14119            >,
14120            offset: usize,
14121            _depth: fidl::encoding::Depth,
14122        ) -> fidl::Result<()> {
14123            decoder.debug_check_bounds::<Self>(offset);
14124            // Verify that padding bytes are zero.
14125            fidl::decode!(
14126                fidl::encoding::BoundedString<65536>,
14127                fidl::encoding::DefaultFuchsiaResourceDialect,
14128                &mut self.url,
14129                decoder,
14130                offset + 0,
14131                _depth
14132            )?;
14133            fidl::decode!(
14134                LoadUrlParams,
14135                fidl::encoding::DefaultFuchsiaResourceDialect,
14136                &mut self.params,
14137                decoder,
14138                offset + 16,
14139                _depth
14140            )?;
14141            Ok(())
14142        }
14143    }
14144
14145    impl fidl::encoding::ResourceTypeMarker for NavigationEventListenerOnNavigationStateChangedRequest {
14146        type Borrowed<'a> = &'a mut Self;
14147        fn take_or_borrow<'a>(
14148            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14149        ) -> Self::Borrowed<'a> {
14150            value
14151        }
14152    }
14153
14154    unsafe impl fidl::encoding::TypeMarker for NavigationEventListenerOnNavigationStateChangedRequest {
14155        type Owned = Self;
14156
14157        #[inline(always)]
14158        fn inline_align(_context: fidl::encoding::Context) -> usize {
14159            8
14160        }
14161
14162        #[inline(always)]
14163        fn inline_size(_context: fidl::encoding::Context) -> usize {
14164            16
14165        }
14166    }
14167
14168    unsafe impl
14169        fidl::encoding::Encode<
14170            NavigationEventListenerOnNavigationStateChangedRequest,
14171            fidl::encoding::DefaultFuchsiaResourceDialect,
14172        > for &mut NavigationEventListenerOnNavigationStateChangedRequest
14173    {
14174        #[inline]
14175        unsafe fn encode(
14176            self,
14177            encoder: &mut fidl::encoding::Encoder<
14178                '_,
14179                fidl::encoding::DefaultFuchsiaResourceDialect,
14180            >,
14181            offset: usize,
14182            _depth: fidl::encoding::Depth,
14183        ) -> fidl::Result<()> {
14184            encoder.debug_check_bounds::<NavigationEventListenerOnNavigationStateChangedRequest>(
14185                offset,
14186            );
14187            // Delegate to tuple encoding.
14188            fidl::encoding::Encode::<
14189                NavigationEventListenerOnNavigationStateChangedRequest,
14190                fidl::encoding::DefaultFuchsiaResourceDialect,
14191            >::encode(
14192                (<NavigationState as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14193                    &mut self.change,
14194                ),),
14195                encoder,
14196                offset,
14197                _depth,
14198            )
14199        }
14200    }
14201    unsafe impl<
14202        T0: fidl::encoding::Encode<NavigationState, fidl::encoding::DefaultFuchsiaResourceDialect>,
14203    >
14204        fidl::encoding::Encode<
14205            NavigationEventListenerOnNavigationStateChangedRequest,
14206            fidl::encoding::DefaultFuchsiaResourceDialect,
14207        > for (T0,)
14208    {
14209        #[inline]
14210        unsafe fn encode(
14211            self,
14212            encoder: &mut fidl::encoding::Encoder<
14213                '_,
14214                fidl::encoding::DefaultFuchsiaResourceDialect,
14215            >,
14216            offset: usize,
14217            depth: fidl::encoding::Depth,
14218        ) -> fidl::Result<()> {
14219            encoder.debug_check_bounds::<NavigationEventListenerOnNavigationStateChangedRequest>(
14220                offset,
14221            );
14222            // Zero out padding regions. There's no need to apply masks
14223            // because the unmasked parts will be overwritten by fields.
14224            // Write the fields.
14225            self.0.encode(encoder, offset + 0, depth)?;
14226            Ok(())
14227        }
14228    }
14229
14230    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14231        for NavigationEventListenerOnNavigationStateChangedRequest
14232    {
14233        #[inline(always)]
14234        fn new_empty() -> Self {
14235            Self {
14236                change: fidl::new_empty!(
14237                    NavigationState,
14238                    fidl::encoding::DefaultFuchsiaResourceDialect
14239                ),
14240            }
14241        }
14242
14243        #[inline]
14244        unsafe fn decode(
14245            &mut self,
14246            decoder: &mut fidl::encoding::Decoder<
14247                '_,
14248                fidl::encoding::DefaultFuchsiaResourceDialect,
14249            >,
14250            offset: usize,
14251            _depth: fidl::encoding::Depth,
14252        ) -> fidl::Result<()> {
14253            decoder.debug_check_bounds::<Self>(offset);
14254            // Verify that padding bytes are zero.
14255            fidl::decode!(
14256                NavigationState,
14257                fidl::encoding::DefaultFuchsiaResourceDialect,
14258                &mut self.change,
14259                decoder,
14260                offset + 0,
14261                _depth
14262            )?;
14263            Ok(())
14264        }
14265    }
14266
14267    impl fidl::encoding::ResourceTypeMarker
14268        for NavigationPolicyProviderEvaluateRequestedNavigationResponse
14269    {
14270        type Borrowed<'a> = &'a mut Self;
14271        fn take_or_borrow<'a>(
14272            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14273        ) -> Self::Borrowed<'a> {
14274            value
14275        }
14276    }
14277
14278    unsafe impl fidl::encoding::TypeMarker
14279        for NavigationPolicyProviderEvaluateRequestedNavigationResponse
14280    {
14281        type Owned = Self;
14282
14283        #[inline(always)]
14284        fn inline_align(_context: fidl::encoding::Context) -> usize {
14285            8
14286        }
14287
14288        #[inline(always)]
14289        fn inline_size(_context: fidl::encoding::Context) -> usize {
14290            16
14291        }
14292    }
14293
14294    unsafe impl
14295        fidl::encoding::Encode<
14296            NavigationPolicyProviderEvaluateRequestedNavigationResponse,
14297            fidl::encoding::DefaultFuchsiaResourceDialect,
14298        > for &mut NavigationPolicyProviderEvaluateRequestedNavigationResponse
14299    {
14300        #[inline]
14301        unsafe fn encode(
14302            self,
14303            encoder: &mut fidl::encoding::Encoder<
14304                '_,
14305                fidl::encoding::DefaultFuchsiaResourceDialect,
14306            >,
14307            offset: usize,
14308            _depth: fidl::encoding::Depth,
14309        ) -> fidl::Result<()> {
14310            encoder
14311                .debug_check_bounds::<NavigationPolicyProviderEvaluateRequestedNavigationResponse>(
14312                    offset,
14313                );
14314            // Delegate to tuple encoding.
14315            fidl::encoding::Encode::<
14316                NavigationPolicyProviderEvaluateRequestedNavigationResponse,
14317                fidl::encoding::DefaultFuchsiaResourceDialect,
14318            >::encode(
14319                (<NavigationDecision as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14320                    &mut self.decision,
14321                ),),
14322                encoder,
14323                offset,
14324                _depth,
14325            )
14326        }
14327    }
14328    unsafe impl<
14329        T0: fidl::encoding::Encode<NavigationDecision, fidl::encoding::DefaultFuchsiaResourceDialect>,
14330    >
14331        fidl::encoding::Encode<
14332            NavigationPolicyProviderEvaluateRequestedNavigationResponse,
14333            fidl::encoding::DefaultFuchsiaResourceDialect,
14334        > for (T0,)
14335    {
14336        #[inline]
14337        unsafe fn encode(
14338            self,
14339            encoder: &mut fidl::encoding::Encoder<
14340                '_,
14341                fidl::encoding::DefaultFuchsiaResourceDialect,
14342            >,
14343            offset: usize,
14344            depth: fidl::encoding::Depth,
14345        ) -> fidl::Result<()> {
14346            encoder
14347                .debug_check_bounds::<NavigationPolicyProviderEvaluateRequestedNavigationResponse>(
14348                    offset,
14349                );
14350            // Zero out padding regions. There's no need to apply masks
14351            // because the unmasked parts will be overwritten by fields.
14352            // Write the fields.
14353            self.0.encode(encoder, offset + 0, depth)?;
14354            Ok(())
14355        }
14356    }
14357
14358    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14359        for NavigationPolicyProviderEvaluateRequestedNavigationResponse
14360    {
14361        #[inline(always)]
14362        fn new_empty() -> Self {
14363            Self {
14364                decision: fidl::new_empty!(
14365                    NavigationDecision,
14366                    fidl::encoding::DefaultFuchsiaResourceDialect
14367                ),
14368            }
14369        }
14370
14371        #[inline]
14372        unsafe fn decode(
14373            &mut self,
14374            decoder: &mut fidl::encoding::Decoder<
14375                '_,
14376                fidl::encoding::DefaultFuchsiaResourceDialect,
14377            >,
14378            offset: usize,
14379            _depth: fidl::encoding::Depth,
14380        ) -> fidl::Result<()> {
14381            decoder.debug_check_bounds::<Self>(offset);
14382            // Verify that padding bytes are zero.
14383            fidl::decode!(
14384                NavigationDecision,
14385                fidl::encoding::DefaultFuchsiaResourceDialect,
14386                &mut self.decision,
14387                decoder,
14388                offset + 0,
14389                _depth
14390            )?;
14391            Ok(())
14392        }
14393    }
14394
14395    impl fidl::encoding::ResourceTypeMarker for PopupFrameCreationListenerOnPopupFrameCreatedRequest {
14396        type Borrowed<'a> = &'a mut Self;
14397        fn take_or_borrow<'a>(
14398            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14399        ) -> Self::Borrowed<'a> {
14400            value
14401        }
14402    }
14403
14404    unsafe impl fidl::encoding::TypeMarker for PopupFrameCreationListenerOnPopupFrameCreatedRequest {
14405        type Owned = Self;
14406
14407        #[inline(always)]
14408        fn inline_align(_context: fidl::encoding::Context) -> usize {
14409            8
14410        }
14411
14412        #[inline(always)]
14413        fn inline_size(_context: fidl::encoding::Context) -> usize {
14414            24
14415        }
14416    }
14417
14418    unsafe impl
14419        fidl::encoding::Encode<
14420            PopupFrameCreationListenerOnPopupFrameCreatedRequest,
14421            fidl::encoding::DefaultFuchsiaResourceDialect,
14422        > for &mut PopupFrameCreationListenerOnPopupFrameCreatedRequest
14423    {
14424        #[inline]
14425        unsafe fn encode(
14426            self,
14427            encoder: &mut fidl::encoding::Encoder<
14428                '_,
14429                fidl::encoding::DefaultFuchsiaResourceDialect,
14430            >,
14431            offset: usize,
14432            _depth: fidl::encoding::Depth,
14433        ) -> fidl::Result<()> {
14434            encoder
14435                .debug_check_bounds::<PopupFrameCreationListenerOnPopupFrameCreatedRequest>(offset);
14436            // Delegate to tuple encoding.
14437            fidl::encoding::Encode::<PopupFrameCreationListenerOnPopupFrameCreatedRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
14438                (
14439                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<FrameMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.frame),
14440                    <PopupFrameCreationInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
14441                ),
14442                encoder, offset, _depth
14443            )
14444        }
14445    }
14446    unsafe impl<
14447        T0: fidl::encoding::Encode<
14448                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<FrameMarker>>,
14449                fidl::encoding::DefaultFuchsiaResourceDialect,
14450            >,
14451        T1: fidl::encoding::Encode<
14452                PopupFrameCreationInfo,
14453                fidl::encoding::DefaultFuchsiaResourceDialect,
14454            >,
14455    >
14456        fidl::encoding::Encode<
14457            PopupFrameCreationListenerOnPopupFrameCreatedRequest,
14458            fidl::encoding::DefaultFuchsiaResourceDialect,
14459        > for (T0, T1)
14460    {
14461        #[inline]
14462        unsafe fn encode(
14463            self,
14464            encoder: &mut fidl::encoding::Encoder<
14465                '_,
14466                fidl::encoding::DefaultFuchsiaResourceDialect,
14467            >,
14468            offset: usize,
14469            depth: fidl::encoding::Depth,
14470        ) -> fidl::Result<()> {
14471            encoder
14472                .debug_check_bounds::<PopupFrameCreationListenerOnPopupFrameCreatedRequest>(offset);
14473            // Zero out padding regions. There's no need to apply masks
14474            // because the unmasked parts will be overwritten by fields.
14475            unsafe {
14476                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14477                (ptr as *mut u64).write_unaligned(0);
14478            }
14479            // Write the fields.
14480            self.0.encode(encoder, offset + 0, depth)?;
14481            self.1.encode(encoder, offset + 8, depth)?;
14482            Ok(())
14483        }
14484    }
14485
14486    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14487        for PopupFrameCreationListenerOnPopupFrameCreatedRequest
14488    {
14489        #[inline(always)]
14490        fn new_empty() -> Self {
14491            Self {
14492                frame: fidl::new_empty!(
14493                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<FrameMarker>>,
14494                    fidl::encoding::DefaultFuchsiaResourceDialect
14495                ),
14496                info: fidl::new_empty!(
14497                    PopupFrameCreationInfo,
14498                    fidl::encoding::DefaultFuchsiaResourceDialect
14499                ),
14500            }
14501        }
14502
14503        #[inline]
14504        unsafe fn decode(
14505            &mut self,
14506            decoder: &mut fidl::encoding::Decoder<
14507                '_,
14508                fidl::encoding::DefaultFuchsiaResourceDialect,
14509            >,
14510            offset: usize,
14511            _depth: fidl::encoding::Depth,
14512        ) -> fidl::Result<()> {
14513            decoder.debug_check_bounds::<Self>(offset);
14514            // Verify that padding bytes are zero.
14515            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14516            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14517            let mask = 0xffffffff00000000u64;
14518            let maskedval = padval & mask;
14519            if maskedval != 0 {
14520                return Err(fidl::Error::NonZeroPadding {
14521                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14522                });
14523            }
14524            fidl::decode!(
14525                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<FrameMarker>>,
14526                fidl::encoding::DefaultFuchsiaResourceDialect,
14527                &mut self.frame,
14528                decoder,
14529                offset + 0,
14530                _depth
14531            )?;
14532            fidl::decode!(
14533                PopupFrameCreationInfo,
14534                fidl::encoding::DefaultFuchsiaResourceDialect,
14535                &mut self.info,
14536                decoder,
14537                offset + 8,
14538                _depth
14539            )?;
14540            Ok(())
14541        }
14542    }
14543
14544    impl ContentDirectoryProvider {
14545        #[inline(always)]
14546        fn max_ordinal_present(&self) -> u64 {
14547            if let Some(_) = self.directory {
14548                return 2;
14549            }
14550            if let Some(_) = self.name {
14551                return 1;
14552            }
14553            0
14554        }
14555    }
14556
14557    impl fidl::encoding::ResourceTypeMarker for ContentDirectoryProvider {
14558        type Borrowed<'a> = &'a mut Self;
14559        fn take_or_borrow<'a>(
14560            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14561        ) -> Self::Borrowed<'a> {
14562            value
14563        }
14564    }
14565
14566    unsafe impl fidl::encoding::TypeMarker for ContentDirectoryProvider {
14567        type Owned = Self;
14568
14569        #[inline(always)]
14570        fn inline_align(_context: fidl::encoding::Context) -> usize {
14571            8
14572        }
14573
14574        #[inline(always)]
14575        fn inline_size(_context: fidl::encoding::Context) -> usize {
14576            16
14577        }
14578    }
14579
14580    unsafe impl
14581        fidl::encoding::Encode<
14582            ContentDirectoryProvider,
14583            fidl::encoding::DefaultFuchsiaResourceDialect,
14584        > for &mut ContentDirectoryProvider
14585    {
14586        unsafe fn encode(
14587            self,
14588            encoder: &mut fidl::encoding::Encoder<
14589                '_,
14590                fidl::encoding::DefaultFuchsiaResourceDialect,
14591            >,
14592            offset: usize,
14593            mut depth: fidl::encoding::Depth,
14594        ) -> fidl::Result<()> {
14595            encoder.debug_check_bounds::<ContentDirectoryProvider>(offset);
14596            // Vector header
14597            let max_ordinal: u64 = self.max_ordinal_present();
14598            encoder.write_num(max_ordinal, offset);
14599            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14600            // Calling encoder.out_of_line_offset(0) is not allowed.
14601            if max_ordinal == 0 {
14602                return Ok(());
14603            }
14604            depth.increment()?;
14605            let envelope_size = 8;
14606            let bytes_len = max_ordinal as usize * envelope_size;
14607            #[allow(unused_variables)]
14608            let offset = encoder.out_of_line_offset(bytes_len);
14609            let mut _prev_end_offset: usize = 0;
14610            if 1 > max_ordinal {
14611                return Ok(());
14612            }
14613
14614            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14615            // are envelope_size bytes.
14616            let cur_offset: usize = (1 - 1) * envelope_size;
14617
14618            // Zero reserved fields.
14619            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14620
14621            // Safety:
14622            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14623            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14624            //   envelope_size bytes, there is always sufficient room.
14625            fidl::encoding::encode_in_envelope_optional::<
14626                fidl::encoding::BoundedString<255>,
14627                fidl::encoding::DefaultFuchsiaResourceDialect,
14628            >(
14629                self.name.as_ref().map(
14630                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
14631                ),
14632                encoder,
14633                offset + cur_offset,
14634                depth,
14635            )?;
14636
14637            _prev_end_offset = cur_offset + envelope_size;
14638            if 2 > max_ordinal {
14639                return Ok(());
14640            }
14641
14642            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14643            // are envelope_size bytes.
14644            let cur_offset: usize = (2 - 1) * envelope_size;
14645
14646            // Zero reserved fields.
14647            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14648
14649            // Safety:
14650            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14651            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14652            //   envelope_size bytes, there is always sufficient room.
14653            fidl::encoding::encode_in_envelope_optional::<
14654                fidl::encoding::Endpoint<
14655                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14656                >,
14657                fidl::encoding::DefaultFuchsiaResourceDialect,
14658            >(
14659                self.directory.as_mut().map(
14660                    <fidl::encoding::Endpoint<
14661                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14662                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
14663                ),
14664                encoder,
14665                offset + cur_offset,
14666                depth,
14667            )?;
14668
14669            _prev_end_offset = cur_offset + envelope_size;
14670
14671            Ok(())
14672        }
14673    }
14674
14675    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14676        for ContentDirectoryProvider
14677    {
14678        #[inline(always)]
14679        fn new_empty() -> Self {
14680            Self::default()
14681        }
14682
14683        unsafe fn decode(
14684            &mut self,
14685            decoder: &mut fidl::encoding::Decoder<
14686                '_,
14687                fidl::encoding::DefaultFuchsiaResourceDialect,
14688            >,
14689            offset: usize,
14690            mut depth: fidl::encoding::Depth,
14691        ) -> fidl::Result<()> {
14692            decoder.debug_check_bounds::<Self>(offset);
14693            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14694                None => return Err(fidl::Error::NotNullable),
14695                Some(len) => len,
14696            };
14697            // Calling decoder.out_of_line_offset(0) is not allowed.
14698            if len == 0 {
14699                return Ok(());
14700            };
14701            depth.increment()?;
14702            let envelope_size = 8;
14703            let bytes_len = len * envelope_size;
14704            let offset = decoder.out_of_line_offset(bytes_len)?;
14705            // Decode the envelope for each type.
14706            let mut _next_ordinal_to_read = 0;
14707            let mut next_offset = offset;
14708            let end_offset = offset + bytes_len;
14709            _next_ordinal_to_read += 1;
14710            if next_offset >= end_offset {
14711                return Ok(());
14712            }
14713
14714            // Decode unknown envelopes for gaps in ordinals.
14715            while _next_ordinal_to_read < 1 {
14716                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14717                _next_ordinal_to_read += 1;
14718                next_offset += envelope_size;
14719            }
14720
14721            let next_out_of_line = decoder.next_out_of_line();
14722            let handles_before = decoder.remaining_handles();
14723            if let Some((inlined, num_bytes, num_handles)) =
14724                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14725            {
14726                let member_inline_size =
14727                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
14728                        decoder.context,
14729                    );
14730                if inlined != (member_inline_size <= 4) {
14731                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14732                }
14733                let inner_offset;
14734                let mut inner_depth = depth.clone();
14735                if inlined {
14736                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14737                    inner_offset = next_offset;
14738                } else {
14739                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14740                    inner_depth.increment()?;
14741                }
14742                let val_ref = self.name.get_or_insert_with(|| {
14743                    fidl::new_empty!(
14744                        fidl::encoding::BoundedString<255>,
14745                        fidl::encoding::DefaultFuchsiaResourceDialect
14746                    )
14747                });
14748                fidl::decode!(
14749                    fidl::encoding::BoundedString<255>,
14750                    fidl::encoding::DefaultFuchsiaResourceDialect,
14751                    val_ref,
14752                    decoder,
14753                    inner_offset,
14754                    inner_depth
14755                )?;
14756                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14757                {
14758                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14759                }
14760                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14761                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14762                }
14763            }
14764
14765            next_offset += envelope_size;
14766            _next_ordinal_to_read += 1;
14767            if next_offset >= end_offset {
14768                return Ok(());
14769            }
14770
14771            // Decode unknown envelopes for gaps in ordinals.
14772            while _next_ordinal_to_read < 2 {
14773                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14774                _next_ordinal_to_read += 1;
14775                next_offset += envelope_size;
14776            }
14777
14778            let next_out_of_line = decoder.next_out_of_line();
14779            let handles_before = decoder.remaining_handles();
14780            if let Some((inlined, num_bytes, num_handles)) =
14781                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14782            {
14783                let member_inline_size = <fidl::encoding::Endpoint<
14784                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14785                > as fidl::encoding::TypeMarker>::inline_size(
14786                    decoder.context
14787                );
14788                if inlined != (member_inline_size <= 4) {
14789                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14790                }
14791                let inner_offset;
14792                let mut inner_depth = depth.clone();
14793                if inlined {
14794                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14795                    inner_offset = next_offset;
14796                } else {
14797                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14798                    inner_depth.increment()?;
14799                }
14800                let val_ref = self.directory.get_or_insert_with(|| {
14801                    fidl::new_empty!(
14802                        fidl::encoding::Endpoint<
14803                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14804                        >,
14805                        fidl::encoding::DefaultFuchsiaResourceDialect
14806                    )
14807                });
14808                fidl::decode!(
14809                    fidl::encoding::Endpoint<
14810                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14811                    >,
14812                    fidl::encoding::DefaultFuchsiaResourceDialect,
14813                    val_ref,
14814                    decoder,
14815                    inner_offset,
14816                    inner_depth
14817                )?;
14818                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14819                {
14820                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14821                }
14822                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14823                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14824                }
14825            }
14826
14827            next_offset += envelope_size;
14828
14829            // Decode the remaining unknown envelopes.
14830            while next_offset < end_offset {
14831                _next_ordinal_to_read += 1;
14832                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14833                next_offset += envelope_size;
14834            }
14835
14836            Ok(())
14837        }
14838    }
14839
14840    impl Cookie {
14841        #[inline(always)]
14842        fn max_ordinal_present(&self) -> u64 {
14843            if let Some(_) = self.value {
14844                return 2;
14845            }
14846            if let Some(_) = self.id {
14847                return 1;
14848            }
14849            0
14850        }
14851    }
14852
14853    impl fidl::encoding::ResourceTypeMarker for Cookie {
14854        type Borrowed<'a> = &'a mut Self;
14855        fn take_or_borrow<'a>(
14856            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14857        ) -> Self::Borrowed<'a> {
14858            value
14859        }
14860    }
14861
14862    unsafe impl fidl::encoding::TypeMarker for Cookie {
14863        type Owned = Self;
14864
14865        #[inline(always)]
14866        fn inline_align(_context: fidl::encoding::Context) -> usize {
14867            8
14868        }
14869
14870        #[inline(always)]
14871        fn inline_size(_context: fidl::encoding::Context) -> usize {
14872            16
14873        }
14874    }
14875
14876    unsafe impl fidl::encoding::Encode<Cookie, fidl::encoding::DefaultFuchsiaResourceDialect>
14877        for &mut Cookie
14878    {
14879        unsafe fn encode(
14880            self,
14881            encoder: &mut fidl::encoding::Encoder<
14882                '_,
14883                fidl::encoding::DefaultFuchsiaResourceDialect,
14884            >,
14885            offset: usize,
14886            mut depth: fidl::encoding::Depth,
14887        ) -> fidl::Result<()> {
14888            encoder.debug_check_bounds::<Cookie>(offset);
14889            // Vector header
14890            let max_ordinal: u64 = self.max_ordinal_present();
14891            encoder.write_num(max_ordinal, offset);
14892            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14893            // Calling encoder.out_of_line_offset(0) is not allowed.
14894            if max_ordinal == 0 {
14895                return Ok(());
14896            }
14897            depth.increment()?;
14898            let envelope_size = 8;
14899            let bytes_len = max_ordinal as usize * envelope_size;
14900            #[allow(unused_variables)]
14901            let offset = encoder.out_of_line_offset(bytes_len);
14902            let mut _prev_end_offset: usize = 0;
14903            if 1 > max_ordinal {
14904                return Ok(());
14905            }
14906
14907            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14908            // are envelope_size bytes.
14909            let cur_offset: usize = (1 - 1) * envelope_size;
14910
14911            // Zero reserved fields.
14912            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14913
14914            // Safety:
14915            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14916            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14917            //   envelope_size bytes, there is always sufficient room.
14918            fidl::encoding::encode_in_envelope_optional::<
14919                CookieId,
14920                fidl::encoding::DefaultFuchsiaResourceDialect,
14921            >(
14922                self.id.as_ref().map(<CookieId as fidl::encoding::ValueTypeMarker>::borrow),
14923                encoder,
14924                offset + cur_offset,
14925                depth,
14926            )?;
14927
14928            _prev_end_offset = cur_offset + envelope_size;
14929            if 2 > max_ordinal {
14930                return Ok(());
14931            }
14932
14933            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14934            // are envelope_size bytes.
14935            let cur_offset: usize = (2 - 1) * envelope_size;
14936
14937            // Zero reserved fields.
14938            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14939
14940            // Safety:
14941            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14942            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14943            //   envelope_size bytes, there is always sufficient room.
14944            fidl::encoding::encode_in_envelope_optional::<
14945                fidl::encoding::UnboundedString,
14946                fidl::encoding::DefaultFuchsiaResourceDialect,
14947            >(
14948                self.value.as_ref().map(
14949                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
14950                ),
14951                encoder,
14952                offset + cur_offset,
14953                depth,
14954            )?;
14955
14956            _prev_end_offset = cur_offset + envelope_size;
14957
14958            Ok(())
14959        }
14960    }
14961
14962    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Cookie {
14963        #[inline(always)]
14964        fn new_empty() -> Self {
14965            Self::default()
14966        }
14967
14968        unsafe fn decode(
14969            &mut self,
14970            decoder: &mut fidl::encoding::Decoder<
14971                '_,
14972                fidl::encoding::DefaultFuchsiaResourceDialect,
14973            >,
14974            offset: usize,
14975            mut depth: fidl::encoding::Depth,
14976        ) -> fidl::Result<()> {
14977            decoder.debug_check_bounds::<Self>(offset);
14978            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14979                None => return Err(fidl::Error::NotNullable),
14980                Some(len) => len,
14981            };
14982            // Calling decoder.out_of_line_offset(0) is not allowed.
14983            if len == 0 {
14984                return Ok(());
14985            };
14986            depth.increment()?;
14987            let envelope_size = 8;
14988            let bytes_len = len * envelope_size;
14989            let offset = decoder.out_of_line_offset(bytes_len)?;
14990            // Decode the envelope for each type.
14991            let mut _next_ordinal_to_read = 0;
14992            let mut next_offset = offset;
14993            let end_offset = offset + bytes_len;
14994            _next_ordinal_to_read += 1;
14995            if next_offset >= end_offset {
14996                return Ok(());
14997            }
14998
14999            // Decode unknown envelopes for gaps in ordinals.
15000            while _next_ordinal_to_read < 1 {
15001                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15002                _next_ordinal_to_read += 1;
15003                next_offset += envelope_size;
15004            }
15005
15006            let next_out_of_line = decoder.next_out_of_line();
15007            let handles_before = decoder.remaining_handles();
15008            if let Some((inlined, num_bytes, num_handles)) =
15009                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15010            {
15011                let member_inline_size =
15012                    <CookieId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15013                if inlined != (member_inline_size <= 4) {
15014                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15015                }
15016                let inner_offset;
15017                let mut inner_depth = depth.clone();
15018                if inlined {
15019                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15020                    inner_offset = next_offset;
15021                } else {
15022                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15023                    inner_depth.increment()?;
15024                }
15025                let val_ref = self.id.get_or_insert_with(|| {
15026                    fidl::new_empty!(CookieId, fidl::encoding::DefaultFuchsiaResourceDialect)
15027                });
15028                fidl::decode!(
15029                    CookieId,
15030                    fidl::encoding::DefaultFuchsiaResourceDialect,
15031                    val_ref,
15032                    decoder,
15033                    inner_offset,
15034                    inner_depth
15035                )?;
15036                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15037                {
15038                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15039                }
15040                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15041                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15042                }
15043            }
15044
15045            next_offset += envelope_size;
15046            _next_ordinal_to_read += 1;
15047            if next_offset >= end_offset {
15048                return Ok(());
15049            }
15050
15051            // Decode unknown envelopes for gaps in ordinals.
15052            while _next_ordinal_to_read < 2 {
15053                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15054                _next_ordinal_to_read += 1;
15055                next_offset += envelope_size;
15056            }
15057
15058            let next_out_of_line = decoder.next_out_of_line();
15059            let handles_before = decoder.remaining_handles();
15060            if let Some((inlined, num_bytes, num_handles)) =
15061                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15062            {
15063                let member_inline_size =
15064                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
15065                        decoder.context,
15066                    );
15067                if inlined != (member_inline_size <= 4) {
15068                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15069                }
15070                let inner_offset;
15071                let mut inner_depth = depth.clone();
15072                if inlined {
15073                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15074                    inner_offset = next_offset;
15075                } else {
15076                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15077                    inner_depth.increment()?;
15078                }
15079                let val_ref = self.value.get_or_insert_with(|| {
15080                    fidl::new_empty!(
15081                        fidl::encoding::UnboundedString,
15082                        fidl::encoding::DefaultFuchsiaResourceDialect
15083                    )
15084                });
15085                fidl::decode!(
15086                    fidl::encoding::UnboundedString,
15087                    fidl::encoding::DefaultFuchsiaResourceDialect,
15088                    val_ref,
15089                    decoder,
15090                    inner_offset,
15091                    inner_depth
15092                )?;
15093                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15094                {
15095                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15096                }
15097                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15098                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15099                }
15100            }
15101
15102            next_offset += envelope_size;
15103
15104            // Decode the remaining unknown envelopes.
15105            while next_offset < end_offset {
15106                _next_ordinal_to_read += 1;
15107                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15108                next_offset += envelope_size;
15109            }
15110
15111            Ok(())
15112        }
15113    }
15114
15115    impl CreateContextParams {
15116        #[inline(always)]
15117        fn max_ordinal_present(&self) -> u64 {
15118            if let Some(_) = self.data_quota_bytes {
15119                return 13;
15120            }
15121            if let Some(_) = self.cdm_data_quota_bytes {
15122                return 12;
15123            }
15124            if let Some(_) = self.cdm_data_directory {
15125                return 11;
15126            }
15127            if let Some(_) = self.cors_exempt_headers {
15128                return 10;
15129            }
15130            if let Some(_) = self.unsafely_treat_insecure_origins_as_secure {
15131                return 9;
15132            }
15133            if let Some(_) = self.playready_key_system {
15134                return 8;
15135            }
15136            if let Some(_) = self.features {
15137                return 7;
15138            }
15139            if let Some(_) = self.content_directories {
15140                return 6;
15141            }
15142            if let Some(_) = self.remote_debugging_port {
15143                return 5;
15144            }
15145            if let Some(_) = self.user_agent_version {
15146                return 4;
15147            }
15148            if let Some(_) = self.user_agent_product {
15149                return 3;
15150            }
15151            if let Some(_) = self.data_directory {
15152                return 2;
15153            }
15154            if let Some(_) = self.service_directory {
15155                return 1;
15156            }
15157            0
15158        }
15159    }
15160
15161    impl fidl::encoding::ResourceTypeMarker for CreateContextParams {
15162        type Borrowed<'a> = &'a mut Self;
15163        fn take_or_borrow<'a>(
15164            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15165        ) -> Self::Borrowed<'a> {
15166            value
15167        }
15168    }
15169
15170    unsafe impl fidl::encoding::TypeMarker for CreateContextParams {
15171        type Owned = Self;
15172
15173        #[inline(always)]
15174        fn inline_align(_context: fidl::encoding::Context) -> usize {
15175            8
15176        }
15177
15178        #[inline(always)]
15179        fn inline_size(_context: fidl::encoding::Context) -> usize {
15180            16
15181        }
15182    }
15183
15184    unsafe impl
15185        fidl::encoding::Encode<CreateContextParams, fidl::encoding::DefaultFuchsiaResourceDialect>
15186        for &mut CreateContextParams
15187    {
15188        unsafe fn encode(
15189            self,
15190            encoder: &mut fidl::encoding::Encoder<
15191                '_,
15192                fidl::encoding::DefaultFuchsiaResourceDialect,
15193            >,
15194            offset: usize,
15195            mut depth: fidl::encoding::Depth,
15196        ) -> fidl::Result<()> {
15197            encoder.debug_check_bounds::<CreateContextParams>(offset);
15198            // Vector header
15199            let max_ordinal: u64 = self.max_ordinal_present();
15200            encoder.write_num(max_ordinal, offset);
15201            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15202            // Calling encoder.out_of_line_offset(0) is not allowed.
15203            if max_ordinal == 0 {
15204                return Ok(());
15205            }
15206            depth.increment()?;
15207            let envelope_size = 8;
15208            let bytes_len = max_ordinal as usize * envelope_size;
15209            #[allow(unused_variables)]
15210            let offset = encoder.out_of_line_offset(bytes_len);
15211            let mut _prev_end_offset: usize = 0;
15212            if 1 > max_ordinal {
15213                return Ok(());
15214            }
15215
15216            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15217            // are envelope_size bytes.
15218            let cur_offset: usize = (1 - 1) * envelope_size;
15219
15220            // Zero reserved fields.
15221            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15222
15223            // Safety:
15224            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15225            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15226            //   envelope_size bytes, there is always sufficient room.
15227            fidl::encoding::encode_in_envelope_optional::<
15228                fidl::encoding::Endpoint<
15229                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15230                >,
15231                fidl::encoding::DefaultFuchsiaResourceDialect,
15232            >(
15233                self.service_directory.as_mut().map(
15234                    <fidl::encoding::Endpoint<
15235                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15236                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
15237                ),
15238                encoder,
15239                offset + cur_offset,
15240                depth,
15241            )?;
15242
15243            _prev_end_offset = cur_offset + envelope_size;
15244            if 2 > max_ordinal {
15245                return Ok(());
15246            }
15247
15248            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15249            // are envelope_size bytes.
15250            let cur_offset: usize = (2 - 1) * envelope_size;
15251
15252            // Zero reserved fields.
15253            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15254
15255            // Safety:
15256            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15257            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15258            //   envelope_size bytes, there is always sufficient room.
15259            fidl::encoding::encode_in_envelope_optional::<
15260                fidl::encoding::Endpoint<
15261                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15262                >,
15263                fidl::encoding::DefaultFuchsiaResourceDialect,
15264            >(
15265                self.data_directory.as_mut().map(
15266                    <fidl::encoding::Endpoint<
15267                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15268                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
15269                ),
15270                encoder,
15271                offset + cur_offset,
15272                depth,
15273            )?;
15274
15275            _prev_end_offset = cur_offset + envelope_size;
15276            if 3 > max_ordinal {
15277                return Ok(());
15278            }
15279
15280            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15281            // are envelope_size bytes.
15282            let cur_offset: usize = (3 - 1) * envelope_size;
15283
15284            // Zero reserved fields.
15285            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15286
15287            // Safety:
15288            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15289            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15290            //   envelope_size bytes, there is always sufficient room.
15291            fidl::encoding::encode_in_envelope_optional::<
15292                fidl::encoding::BoundedString<128>,
15293                fidl::encoding::DefaultFuchsiaResourceDialect,
15294            >(
15295                self.user_agent_product.as_ref().map(
15296                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
15297                ),
15298                encoder,
15299                offset + cur_offset,
15300                depth,
15301            )?;
15302
15303            _prev_end_offset = cur_offset + envelope_size;
15304            if 4 > max_ordinal {
15305                return Ok(());
15306            }
15307
15308            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15309            // are envelope_size bytes.
15310            let cur_offset: usize = (4 - 1) * envelope_size;
15311
15312            // Zero reserved fields.
15313            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15314
15315            // Safety:
15316            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15317            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15318            //   envelope_size bytes, there is always sufficient room.
15319            fidl::encoding::encode_in_envelope_optional::<
15320                fidl::encoding::BoundedString<128>,
15321                fidl::encoding::DefaultFuchsiaResourceDialect,
15322            >(
15323                self.user_agent_version.as_ref().map(
15324                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
15325                ),
15326                encoder,
15327                offset + cur_offset,
15328                depth,
15329            )?;
15330
15331            _prev_end_offset = cur_offset + envelope_size;
15332            if 5 > max_ordinal {
15333                return Ok(());
15334            }
15335
15336            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15337            // are envelope_size bytes.
15338            let cur_offset: usize = (5 - 1) * envelope_size;
15339
15340            // Zero reserved fields.
15341            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15342
15343            // Safety:
15344            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15345            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15346            //   envelope_size bytes, there is always sufficient room.
15347            fidl::encoding::encode_in_envelope_optional::<
15348                u16,
15349                fidl::encoding::DefaultFuchsiaResourceDialect,
15350            >(
15351                self.remote_debugging_port
15352                    .as_ref()
15353                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
15354                encoder,
15355                offset + cur_offset,
15356                depth,
15357            )?;
15358
15359            _prev_end_offset = cur_offset + envelope_size;
15360            if 6 > max_ordinal {
15361                return Ok(());
15362            }
15363
15364            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15365            // are envelope_size bytes.
15366            let cur_offset: usize = (6 - 1) * envelope_size;
15367
15368            // Zero reserved fields.
15369            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15370
15371            // Safety:
15372            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15373            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15374            //   envelope_size bytes, there is always sufficient room.
15375            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ContentDirectoryProvider, 100>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15376            self.content_directories.as_mut().map(<fidl::encoding::Vector<ContentDirectoryProvider, 100> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15377            encoder, offset + cur_offset, depth
15378        )?;
15379
15380            _prev_end_offset = cur_offset + envelope_size;
15381            if 7 > max_ordinal {
15382                return Ok(());
15383            }
15384
15385            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15386            // are envelope_size bytes.
15387            let cur_offset: usize = (7 - 1) * envelope_size;
15388
15389            // Zero reserved fields.
15390            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15391
15392            // Safety:
15393            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15394            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15395            //   envelope_size bytes, there is always sufficient room.
15396            fidl::encoding::encode_in_envelope_optional::<
15397                ContextFeatureFlags,
15398                fidl::encoding::DefaultFuchsiaResourceDialect,
15399            >(
15400                self.features
15401                    .as_ref()
15402                    .map(<ContextFeatureFlags as fidl::encoding::ValueTypeMarker>::borrow),
15403                encoder,
15404                offset + cur_offset,
15405                depth,
15406            )?;
15407
15408            _prev_end_offset = cur_offset + envelope_size;
15409            if 8 > max_ordinal {
15410                return Ok(());
15411            }
15412
15413            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15414            // are envelope_size bytes.
15415            let cur_offset: usize = (8 - 1) * envelope_size;
15416
15417            // Zero reserved fields.
15418            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15419
15420            // Safety:
15421            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15422            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15423            //   envelope_size bytes, there is always sufficient room.
15424            fidl::encoding::encode_in_envelope_optional::<
15425                fidl::encoding::BoundedString<128>,
15426                fidl::encoding::DefaultFuchsiaResourceDialect,
15427            >(
15428                self.playready_key_system.as_ref().map(
15429                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
15430                ),
15431                encoder,
15432                offset + cur_offset,
15433                depth,
15434            )?;
15435
15436            _prev_end_offset = cur_offset + envelope_size;
15437            if 9 > max_ordinal {
15438                return Ok(());
15439            }
15440
15441            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15442            // are envelope_size bytes.
15443            let cur_offset: usize = (9 - 1) * envelope_size;
15444
15445            // Zero reserved fields.
15446            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15447
15448            // Safety:
15449            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15450            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15451            //   envelope_size bytes, there is always sufficient room.
15452            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<513>, 100>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15453            self.unsafely_treat_insecure_origins_as_secure.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<513>, 100> as fidl::encoding::ValueTypeMarker>::borrow),
15454            encoder, offset + cur_offset, depth
15455        )?;
15456
15457            _prev_end_offset = cur_offset + envelope_size;
15458            if 10 > max_ordinal {
15459                return Ok(());
15460            }
15461
15462            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15463            // are envelope_size bytes.
15464            let cur_offset: usize = (10 - 1) * envelope_size;
15465
15466            // Zero reserved fields.
15467            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15468
15469            // Safety:
15470            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15471            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15472            //   envelope_size bytes, there is always sufficient room.
15473            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15474            self.cors_exempt_headers.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>> as fidl::encoding::ValueTypeMarker>::borrow),
15475            encoder, offset + cur_offset, depth
15476        )?;
15477
15478            _prev_end_offset = cur_offset + envelope_size;
15479            if 11 > max_ordinal {
15480                return Ok(());
15481            }
15482
15483            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15484            // are envelope_size bytes.
15485            let cur_offset: usize = (11 - 1) * envelope_size;
15486
15487            // Zero reserved fields.
15488            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15489
15490            // Safety:
15491            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15492            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15493            //   envelope_size bytes, there is always sufficient room.
15494            fidl::encoding::encode_in_envelope_optional::<
15495                fidl::encoding::Endpoint<
15496                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15497                >,
15498                fidl::encoding::DefaultFuchsiaResourceDialect,
15499            >(
15500                self.cdm_data_directory.as_mut().map(
15501                    <fidl::encoding::Endpoint<
15502                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15503                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
15504                ),
15505                encoder,
15506                offset + cur_offset,
15507                depth,
15508            )?;
15509
15510            _prev_end_offset = cur_offset + envelope_size;
15511            if 12 > max_ordinal {
15512                return Ok(());
15513            }
15514
15515            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15516            // are envelope_size bytes.
15517            let cur_offset: usize = (12 - 1) * envelope_size;
15518
15519            // Zero reserved fields.
15520            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15521
15522            // Safety:
15523            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15524            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15525            //   envelope_size bytes, there is always sufficient room.
15526            fidl::encoding::encode_in_envelope_optional::<
15527                u64,
15528                fidl::encoding::DefaultFuchsiaResourceDialect,
15529            >(
15530                self.cdm_data_quota_bytes
15531                    .as_ref()
15532                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15533                encoder,
15534                offset + cur_offset,
15535                depth,
15536            )?;
15537
15538            _prev_end_offset = cur_offset + envelope_size;
15539            if 13 > max_ordinal {
15540                return Ok(());
15541            }
15542
15543            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15544            // are envelope_size bytes.
15545            let cur_offset: usize = (13 - 1) * envelope_size;
15546
15547            // Zero reserved fields.
15548            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15549
15550            // Safety:
15551            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15552            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15553            //   envelope_size bytes, there is always sufficient room.
15554            fidl::encoding::encode_in_envelope_optional::<
15555                u64,
15556                fidl::encoding::DefaultFuchsiaResourceDialect,
15557            >(
15558                self.data_quota_bytes
15559                    .as_ref()
15560                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15561                encoder,
15562                offset + cur_offset,
15563                depth,
15564            )?;
15565
15566            _prev_end_offset = cur_offset + envelope_size;
15567
15568            Ok(())
15569        }
15570    }
15571
15572    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15573        for CreateContextParams
15574    {
15575        #[inline(always)]
15576        fn new_empty() -> Self {
15577            Self::default()
15578        }
15579
15580        unsafe fn decode(
15581            &mut self,
15582            decoder: &mut fidl::encoding::Decoder<
15583                '_,
15584                fidl::encoding::DefaultFuchsiaResourceDialect,
15585            >,
15586            offset: usize,
15587            mut depth: fidl::encoding::Depth,
15588        ) -> fidl::Result<()> {
15589            decoder.debug_check_bounds::<Self>(offset);
15590            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15591                None => return Err(fidl::Error::NotNullable),
15592                Some(len) => len,
15593            };
15594            // Calling decoder.out_of_line_offset(0) is not allowed.
15595            if len == 0 {
15596                return Ok(());
15597            };
15598            depth.increment()?;
15599            let envelope_size = 8;
15600            let bytes_len = len * envelope_size;
15601            let offset = decoder.out_of_line_offset(bytes_len)?;
15602            // Decode the envelope for each type.
15603            let mut _next_ordinal_to_read = 0;
15604            let mut next_offset = offset;
15605            let end_offset = offset + bytes_len;
15606            _next_ordinal_to_read += 1;
15607            if next_offset >= end_offset {
15608                return Ok(());
15609            }
15610
15611            // Decode unknown envelopes for gaps in ordinals.
15612            while _next_ordinal_to_read < 1 {
15613                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15614                _next_ordinal_to_read += 1;
15615                next_offset += envelope_size;
15616            }
15617
15618            let next_out_of_line = decoder.next_out_of_line();
15619            let handles_before = decoder.remaining_handles();
15620            if let Some((inlined, num_bytes, num_handles)) =
15621                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15622            {
15623                let member_inline_size = <fidl::encoding::Endpoint<
15624                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15625                > as fidl::encoding::TypeMarker>::inline_size(
15626                    decoder.context
15627                );
15628                if inlined != (member_inline_size <= 4) {
15629                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15630                }
15631                let inner_offset;
15632                let mut inner_depth = depth.clone();
15633                if inlined {
15634                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15635                    inner_offset = next_offset;
15636                } else {
15637                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15638                    inner_depth.increment()?;
15639                }
15640                let val_ref = self.service_directory.get_or_insert_with(|| {
15641                    fidl::new_empty!(
15642                        fidl::encoding::Endpoint<
15643                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15644                        >,
15645                        fidl::encoding::DefaultFuchsiaResourceDialect
15646                    )
15647                });
15648                fidl::decode!(
15649                    fidl::encoding::Endpoint<
15650                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15651                    >,
15652                    fidl::encoding::DefaultFuchsiaResourceDialect,
15653                    val_ref,
15654                    decoder,
15655                    inner_offset,
15656                    inner_depth
15657                )?;
15658                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15659                {
15660                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15661                }
15662                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15663                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15664                }
15665            }
15666
15667            next_offset += envelope_size;
15668            _next_ordinal_to_read += 1;
15669            if next_offset >= end_offset {
15670                return Ok(());
15671            }
15672
15673            // Decode unknown envelopes for gaps in ordinals.
15674            while _next_ordinal_to_read < 2 {
15675                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15676                _next_ordinal_to_read += 1;
15677                next_offset += envelope_size;
15678            }
15679
15680            let next_out_of_line = decoder.next_out_of_line();
15681            let handles_before = decoder.remaining_handles();
15682            if let Some((inlined, num_bytes, num_handles)) =
15683                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15684            {
15685                let member_inline_size = <fidl::encoding::Endpoint<
15686                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15687                > as fidl::encoding::TypeMarker>::inline_size(
15688                    decoder.context
15689                );
15690                if inlined != (member_inline_size <= 4) {
15691                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15692                }
15693                let inner_offset;
15694                let mut inner_depth = depth.clone();
15695                if inlined {
15696                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15697                    inner_offset = next_offset;
15698                } else {
15699                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15700                    inner_depth.increment()?;
15701                }
15702                let val_ref = self.data_directory.get_or_insert_with(|| {
15703                    fidl::new_empty!(
15704                        fidl::encoding::Endpoint<
15705                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15706                        >,
15707                        fidl::encoding::DefaultFuchsiaResourceDialect
15708                    )
15709                });
15710                fidl::decode!(
15711                    fidl::encoding::Endpoint<
15712                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15713                    >,
15714                    fidl::encoding::DefaultFuchsiaResourceDialect,
15715                    val_ref,
15716                    decoder,
15717                    inner_offset,
15718                    inner_depth
15719                )?;
15720                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15721                {
15722                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15723                }
15724                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15725                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15726                }
15727            }
15728
15729            next_offset += envelope_size;
15730            _next_ordinal_to_read += 1;
15731            if next_offset >= end_offset {
15732                return Ok(());
15733            }
15734
15735            // Decode unknown envelopes for gaps in ordinals.
15736            while _next_ordinal_to_read < 3 {
15737                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15738                _next_ordinal_to_read += 1;
15739                next_offset += envelope_size;
15740            }
15741
15742            let next_out_of_line = decoder.next_out_of_line();
15743            let handles_before = decoder.remaining_handles();
15744            if let Some((inlined, num_bytes, num_handles)) =
15745                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15746            {
15747                let member_inline_size =
15748                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
15749                        decoder.context,
15750                    );
15751                if inlined != (member_inline_size <= 4) {
15752                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15753                }
15754                let inner_offset;
15755                let mut inner_depth = depth.clone();
15756                if inlined {
15757                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15758                    inner_offset = next_offset;
15759                } else {
15760                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15761                    inner_depth.increment()?;
15762                }
15763                let val_ref = self.user_agent_product.get_or_insert_with(|| {
15764                    fidl::new_empty!(
15765                        fidl::encoding::BoundedString<128>,
15766                        fidl::encoding::DefaultFuchsiaResourceDialect
15767                    )
15768                });
15769                fidl::decode!(
15770                    fidl::encoding::BoundedString<128>,
15771                    fidl::encoding::DefaultFuchsiaResourceDialect,
15772                    val_ref,
15773                    decoder,
15774                    inner_offset,
15775                    inner_depth
15776                )?;
15777                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15778                {
15779                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15780                }
15781                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15782                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15783                }
15784            }
15785
15786            next_offset += envelope_size;
15787            _next_ordinal_to_read += 1;
15788            if next_offset >= end_offset {
15789                return Ok(());
15790            }
15791
15792            // Decode unknown envelopes for gaps in ordinals.
15793            while _next_ordinal_to_read < 4 {
15794                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15795                _next_ordinal_to_read += 1;
15796                next_offset += envelope_size;
15797            }
15798
15799            let next_out_of_line = decoder.next_out_of_line();
15800            let handles_before = decoder.remaining_handles();
15801            if let Some((inlined, num_bytes, num_handles)) =
15802                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15803            {
15804                let member_inline_size =
15805                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
15806                        decoder.context,
15807                    );
15808                if inlined != (member_inline_size <= 4) {
15809                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15810                }
15811                let inner_offset;
15812                let mut inner_depth = depth.clone();
15813                if inlined {
15814                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15815                    inner_offset = next_offset;
15816                } else {
15817                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15818                    inner_depth.increment()?;
15819                }
15820                let val_ref = self.user_agent_version.get_or_insert_with(|| {
15821                    fidl::new_empty!(
15822                        fidl::encoding::BoundedString<128>,
15823                        fidl::encoding::DefaultFuchsiaResourceDialect
15824                    )
15825                });
15826                fidl::decode!(
15827                    fidl::encoding::BoundedString<128>,
15828                    fidl::encoding::DefaultFuchsiaResourceDialect,
15829                    val_ref,
15830                    decoder,
15831                    inner_offset,
15832                    inner_depth
15833                )?;
15834                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15835                {
15836                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15837                }
15838                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15839                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15840                }
15841            }
15842
15843            next_offset += envelope_size;
15844            _next_ordinal_to_read += 1;
15845            if next_offset >= end_offset {
15846                return Ok(());
15847            }
15848
15849            // Decode unknown envelopes for gaps in ordinals.
15850            while _next_ordinal_to_read < 5 {
15851                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15852                _next_ordinal_to_read += 1;
15853                next_offset += envelope_size;
15854            }
15855
15856            let next_out_of_line = decoder.next_out_of_line();
15857            let handles_before = decoder.remaining_handles();
15858            if let Some((inlined, num_bytes, num_handles)) =
15859                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15860            {
15861                let member_inline_size =
15862                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15863                if inlined != (member_inline_size <= 4) {
15864                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15865                }
15866                let inner_offset;
15867                let mut inner_depth = depth.clone();
15868                if inlined {
15869                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15870                    inner_offset = next_offset;
15871                } else {
15872                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15873                    inner_depth.increment()?;
15874                }
15875                let val_ref = self.remote_debugging_port.get_or_insert_with(|| {
15876                    fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect)
15877                });
15878                fidl::decode!(
15879                    u16,
15880                    fidl::encoding::DefaultFuchsiaResourceDialect,
15881                    val_ref,
15882                    decoder,
15883                    inner_offset,
15884                    inner_depth
15885                )?;
15886                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15887                {
15888                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15889                }
15890                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15891                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15892                }
15893            }
15894
15895            next_offset += envelope_size;
15896            _next_ordinal_to_read += 1;
15897            if next_offset >= end_offset {
15898                return Ok(());
15899            }
15900
15901            // Decode unknown envelopes for gaps in ordinals.
15902            while _next_ordinal_to_read < 6 {
15903                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15904                _next_ordinal_to_read += 1;
15905                next_offset += envelope_size;
15906            }
15907
15908            let next_out_of_line = decoder.next_out_of_line();
15909            let handles_before = decoder.remaining_handles();
15910            if let Some((inlined, num_bytes, num_handles)) =
15911                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15912            {
15913                let member_inline_size = <fidl::encoding::Vector<ContentDirectoryProvider, 100> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15914                if inlined != (member_inline_size <= 4) {
15915                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15916                }
15917                let inner_offset;
15918                let mut inner_depth = depth.clone();
15919                if inlined {
15920                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15921                    inner_offset = next_offset;
15922                } else {
15923                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15924                    inner_depth.increment()?;
15925                }
15926                let val_ref =
15927                self.content_directories.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<ContentDirectoryProvider, 100>, fidl::encoding::DefaultFuchsiaResourceDialect));
15928                fidl::decode!(fidl::encoding::Vector<ContentDirectoryProvider, 100>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
15929                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15930                {
15931                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15932                }
15933                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15934                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15935                }
15936            }
15937
15938            next_offset += envelope_size;
15939            _next_ordinal_to_read += 1;
15940            if next_offset >= end_offset {
15941                return Ok(());
15942            }
15943
15944            // Decode unknown envelopes for gaps in ordinals.
15945            while _next_ordinal_to_read < 7 {
15946                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15947                _next_ordinal_to_read += 1;
15948                next_offset += envelope_size;
15949            }
15950
15951            let next_out_of_line = decoder.next_out_of_line();
15952            let handles_before = decoder.remaining_handles();
15953            if let Some((inlined, num_bytes, num_handles)) =
15954                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15955            {
15956                let member_inline_size =
15957                    <ContextFeatureFlags as fidl::encoding::TypeMarker>::inline_size(
15958                        decoder.context,
15959                    );
15960                if inlined != (member_inline_size <= 4) {
15961                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15962                }
15963                let inner_offset;
15964                let mut inner_depth = depth.clone();
15965                if inlined {
15966                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15967                    inner_offset = next_offset;
15968                } else {
15969                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15970                    inner_depth.increment()?;
15971                }
15972                let val_ref = self.features.get_or_insert_with(|| {
15973                    fidl::new_empty!(
15974                        ContextFeatureFlags,
15975                        fidl::encoding::DefaultFuchsiaResourceDialect
15976                    )
15977                });
15978                fidl::decode!(
15979                    ContextFeatureFlags,
15980                    fidl::encoding::DefaultFuchsiaResourceDialect,
15981                    val_ref,
15982                    decoder,
15983                    inner_offset,
15984                    inner_depth
15985                )?;
15986                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15987                {
15988                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15989                }
15990                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15991                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15992                }
15993            }
15994
15995            next_offset += envelope_size;
15996            _next_ordinal_to_read += 1;
15997            if next_offset >= end_offset {
15998                return Ok(());
15999            }
16000
16001            // Decode unknown envelopes for gaps in ordinals.
16002            while _next_ordinal_to_read < 8 {
16003                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16004                _next_ordinal_to_read += 1;
16005                next_offset += envelope_size;
16006            }
16007
16008            let next_out_of_line = decoder.next_out_of_line();
16009            let handles_before = decoder.remaining_handles();
16010            if let Some((inlined, num_bytes, num_handles)) =
16011                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16012            {
16013                let member_inline_size =
16014                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
16015                        decoder.context,
16016                    );
16017                if inlined != (member_inline_size <= 4) {
16018                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16019                }
16020                let inner_offset;
16021                let mut inner_depth = depth.clone();
16022                if inlined {
16023                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16024                    inner_offset = next_offset;
16025                } else {
16026                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16027                    inner_depth.increment()?;
16028                }
16029                let val_ref = self.playready_key_system.get_or_insert_with(|| {
16030                    fidl::new_empty!(
16031                        fidl::encoding::BoundedString<128>,
16032                        fidl::encoding::DefaultFuchsiaResourceDialect
16033                    )
16034                });
16035                fidl::decode!(
16036                    fidl::encoding::BoundedString<128>,
16037                    fidl::encoding::DefaultFuchsiaResourceDialect,
16038                    val_ref,
16039                    decoder,
16040                    inner_offset,
16041                    inner_depth
16042                )?;
16043                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16044                {
16045                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16046                }
16047                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16048                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16049                }
16050            }
16051
16052            next_offset += envelope_size;
16053            _next_ordinal_to_read += 1;
16054            if next_offset >= end_offset {
16055                return Ok(());
16056            }
16057
16058            // Decode unknown envelopes for gaps in ordinals.
16059            while _next_ordinal_to_read < 9 {
16060                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16061                _next_ordinal_to_read += 1;
16062                next_offset += envelope_size;
16063            }
16064
16065            let next_out_of_line = decoder.next_out_of_line();
16066            let handles_before = decoder.remaining_handles();
16067            if let Some((inlined, num_bytes, num_handles)) =
16068                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16069            {
16070                let member_inline_size = <fidl::encoding::Vector<
16071                    fidl::encoding::BoundedString<513>,
16072                    100,
16073                > as fidl::encoding::TypeMarker>::inline_size(
16074                    decoder.context
16075                );
16076                if inlined != (member_inline_size <= 4) {
16077                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16078                }
16079                let inner_offset;
16080                let mut inner_depth = depth.clone();
16081                if inlined {
16082                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16083                    inner_offset = next_offset;
16084                } else {
16085                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16086                    inner_depth.increment()?;
16087                }
16088                let val_ref =
16089                    self.unsafely_treat_insecure_origins_as_secure.get_or_insert_with(|| {
16090                        fidl::new_empty!(
16091                            fidl::encoding::Vector<fidl::encoding::BoundedString<513>, 100>,
16092                            fidl::encoding::DefaultFuchsiaResourceDialect
16093                        )
16094                    });
16095                fidl::decode!(
16096                    fidl::encoding::Vector<fidl::encoding::BoundedString<513>, 100>,
16097                    fidl::encoding::DefaultFuchsiaResourceDialect,
16098                    val_ref,
16099                    decoder,
16100                    inner_offset,
16101                    inner_depth
16102                )?;
16103                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16104                {
16105                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16106                }
16107                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16108                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16109                }
16110            }
16111
16112            next_offset += envelope_size;
16113            _next_ordinal_to_read += 1;
16114            if next_offset >= end_offset {
16115                return Ok(());
16116            }
16117
16118            // Decode unknown envelopes for gaps in ordinals.
16119            while _next_ordinal_to_read < 10 {
16120                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16121                _next_ordinal_to_read += 1;
16122                next_offset += envelope_size;
16123            }
16124
16125            let next_out_of_line = decoder.next_out_of_line();
16126            let handles_before = decoder.remaining_handles();
16127            if let Some((inlined, num_bytes, num_handles)) =
16128                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16129            {
16130                let member_inline_size = <fidl::encoding::UnboundedVector<
16131                    fidl::encoding::UnboundedVector<u8>,
16132                > as fidl::encoding::TypeMarker>::inline_size(
16133                    decoder.context
16134                );
16135                if inlined != (member_inline_size <= 4) {
16136                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16137                }
16138                let inner_offset;
16139                let mut inner_depth = depth.clone();
16140                if inlined {
16141                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16142                    inner_offset = next_offset;
16143                } else {
16144                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16145                    inner_depth.increment()?;
16146                }
16147                let val_ref = self.cors_exempt_headers.get_or_insert_with(|| {
16148                    fidl::new_empty!(
16149                        fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
16150                        fidl::encoding::DefaultFuchsiaResourceDialect
16151                    )
16152                });
16153                fidl::decode!(
16154                    fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
16155                    fidl::encoding::DefaultFuchsiaResourceDialect,
16156                    val_ref,
16157                    decoder,
16158                    inner_offset,
16159                    inner_depth
16160                )?;
16161                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16162                {
16163                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16164                }
16165                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16166                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16167                }
16168            }
16169
16170            next_offset += envelope_size;
16171            _next_ordinal_to_read += 1;
16172            if next_offset >= end_offset {
16173                return Ok(());
16174            }
16175
16176            // Decode unknown envelopes for gaps in ordinals.
16177            while _next_ordinal_to_read < 11 {
16178                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16179                _next_ordinal_to_read += 1;
16180                next_offset += envelope_size;
16181            }
16182
16183            let next_out_of_line = decoder.next_out_of_line();
16184            let handles_before = decoder.remaining_handles();
16185            if let Some((inlined, num_bytes, num_handles)) =
16186                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16187            {
16188                let member_inline_size = <fidl::encoding::Endpoint<
16189                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16190                > as fidl::encoding::TypeMarker>::inline_size(
16191                    decoder.context
16192                );
16193                if inlined != (member_inline_size <= 4) {
16194                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16195                }
16196                let inner_offset;
16197                let mut inner_depth = depth.clone();
16198                if inlined {
16199                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16200                    inner_offset = next_offset;
16201                } else {
16202                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16203                    inner_depth.increment()?;
16204                }
16205                let val_ref = self.cdm_data_directory.get_or_insert_with(|| {
16206                    fidl::new_empty!(
16207                        fidl::encoding::Endpoint<
16208                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16209                        >,
16210                        fidl::encoding::DefaultFuchsiaResourceDialect
16211                    )
16212                });
16213                fidl::decode!(
16214                    fidl::encoding::Endpoint<
16215                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
16216                    >,
16217                    fidl::encoding::DefaultFuchsiaResourceDialect,
16218                    val_ref,
16219                    decoder,
16220                    inner_offset,
16221                    inner_depth
16222                )?;
16223                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16224                {
16225                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16226                }
16227                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16228                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16229                }
16230            }
16231
16232            next_offset += envelope_size;
16233            _next_ordinal_to_read += 1;
16234            if next_offset >= end_offset {
16235                return Ok(());
16236            }
16237
16238            // Decode unknown envelopes for gaps in ordinals.
16239            while _next_ordinal_to_read < 12 {
16240                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16241                _next_ordinal_to_read += 1;
16242                next_offset += envelope_size;
16243            }
16244
16245            let next_out_of_line = decoder.next_out_of_line();
16246            let handles_before = decoder.remaining_handles();
16247            if let Some((inlined, num_bytes, num_handles)) =
16248                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16249            {
16250                let member_inline_size =
16251                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16252                if inlined != (member_inline_size <= 4) {
16253                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16254                }
16255                let inner_offset;
16256                let mut inner_depth = depth.clone();
16257                if inlined {
16258                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16259                    inner_offset = next_offset;
16260                } else {
16261                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16262                    inner_depth.increment()?;
16263                }
16264                let val_ref = self.cdm_data_quota_bytes.get_or_insert_with(|| {
16265                    fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
16266                });
16267                fidl::decode!(
16268                    u64,
16269                    fidl::encoding::DefaultFuchsiaResourceDialect,
16270                    val_ref,
16271                    decoder,
16272                    inner_offset,
16273                    inner_depth
16274                )?;
16275                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16276                {
16277                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16278                }
16279                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16280                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16281                }
16282            }
16283
16284            next_offset += envelope_size;
16285            _next_ordinal_to_read += 1;
16286            if next_offset >= end_offset {
16287                return Ok(());
16288            }
16289
16290            // Decode unknown envelopes for gaps in ordinals.
16291            while _next_ordinal_to_read < 13 {
16292                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16293                _next_ordinal_to_read += 1;
16294                next_offset += envelope_size;
16295            }
16296
16297            let next_out_of_line = decoder.next_out_of_line();
16298            let handles_before = decoder.remaining_handles();
16299            if let Some((inlined, num_bytes, num_handles)) =
16300                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16301            {
16302                let member_inline_size =
16303                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16304                if inlined != (member_inline_size <= 4) {
16305                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16306                }
16307                let inner_offset;
16308                let mut inner_depth = depth.clone();
16309                if inlined {
16310                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16311                    inner_offset = next_offset;
16312                } else {
16313                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16314                    inner_depth.increment()?;
16315                }
16316                let val_ref = self.data_quota_bytes.get_or_insert_with(|| {
16317                    fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
16318                });
16319                fidl::decode!(
16320                    u64,
16321                    fidl::encoding::DefaultFuchsiaResourceDialect,
16322                    val_ref,
16323                    decoder,
16324                    inner_offset,
16325                    inner_depth
16326                )?;
16327                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16328                {
16329                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16330                }
16331                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16332                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16333                }
16334            }
16335
16336            next_offset += envelope_size;
16337
16338            // Decode the remaining unknown envelopes.
16339            while next_offset < end_offset {
16340                _next_ordinal_to_read += 1;
16341                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16342                next_offset += envelope_size;
16343            }
16344
16345            Ok(())
16346        }
16347    }
16348
16349    impl CreateFrameParams {
16350        #[inline(always)]
16351        fn max_ordinal_present(&self) -> u64 {
16352            if let Some(_) = self.explicit_sites_filter_error_page {
16353                return 4;
16354            }
16355            if let Some(_) = self.debug_name {
16356                return 2;
16357            }
16358            if let Some(_) = self.enable_remote_debugging {
16359                return 1;
16360            }
16361            0
16362        }
16363    }
16364
16365    impl fidl::encoding::ResourceTypeMarker for CreateFrameParams {
16366        type Borrowed<'a> = &'a mut Self;
16367        fn take_or_borrow<'a>(
16368            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16369        ) -> Self::Borrowed<'a> {
16370            value
16371        }
16372    }
16373
16374    unsafe impl fidl::encoding::TypeMarker for CreateFrameParams {
16375        type Owned = Self;
16376
16377        #[inline(always)]
16378        fn inline_align(_context: fidl::encoding::Context) -> usize {
16379            8
16380        }
16381
16382        #[inline(always)]
16383        fn inline_size(_context: fidl::encoding::Context) -> usize {
16384            16
16385        }
16386    }
16387
16388    unsafe impl
16389        fidl::encoding::Encode<CreateFrameParams, fidl::encoding::DefaultFuchsiaResourceDialect>
16390        for &mut CreateFrameParams
16391    {
16392        unsafe fn encode(
16393            self,
16394            encoder: &mut fidl::encoding::Encoder<
16395                '_,
16396                fidl::encoding::DefaultFuchsiaResourceDialect,
16397            >,
16398            offset: usize,
16399            mut depth: fidl::encoding::Depth,
16400        ) -> fidl::Result<()> {
16401            encoder.debug_check_bounds::<CreateFrameParams>(offset);
16402            // Vector header
16403            let max_ordinal: u64 = self.max_ordinal_present();
16404            encoder.write_num(max_ordinal, offset);
16405            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16406            // Calling encoder.out_of_line_offset(0) is not allowed.
16407            if max_ordinal == 0 {
16408                return Ok(());
16409            }
16410            depth.increment()?;
16411            let envelope_size = 8;
16412            let bytes_len = max_ordinal as usize * envelope_size;
16413            #[allow(unused_variables)]
16414            let offset = encoder.out_of_line_offset(bytes_len);
16415            let mut _prev_end_offset: usize = 0;
16416            if 1 > max_ordinal {
16417                return Ok(());
16418            }
16419
16420            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16421            // are envelope_size bytes.
16422            let cur_offset: usize = (1 - 1) * envelope_size;
16423
16424            // Zero reserved fields.
16425            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16426
16427            // Safety:
16428            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16429            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16430            //   envelope_size bytes, there is always sufficient room.
16431            fidl::encoding::encode_in_envelope_optional::<
16432                bool,
16433                fidl::encoding::DefaultFuchsiaResourceDialect,
16434            >(
16435                self.enable_remote_debugging
16436                    .as_ref()
16437                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
16438                encoder,
16439                offset + cur_offset,
16440                depth,
16441            )?;
16442
16443            _prev_end_offset = cur_offset + envelope_size;
16444            if 2 > max_ordinal {
16445                return Ok(());
16446            }
16447
16448            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16449            // are envelope_size bytes.
16450            let cur_offset: usize = (2 - 1) * envelope_size;
16451
16452            // Zero reserved fields.
16453            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16454
16455            // Safety:
16456            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16457            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16458            //   envelope_size bytes, there is always sufficient room.
16459            fidl::encoding::encode_in_envelope_optional::<
16460                fidl::encoding::UnboundedString,
16461                fidl::encoding::DefaultFuchsiaResourceDialect,
16462            >(
16463                self.debug_name.as_ref().map(
16464                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
16465                ),
16466                encoder,
16467                offset + cur_offset,
16468                depth,
16469            )?;
16470
16471            _prev_end_offset = cur_offset + envelope_size;
16472            if 4 > max_ordinal {
16473                return Ok(());
16474            }
16475
16476            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16477            // are envelope_size bytes.
16478            let cur_offset: usize = (4 - 1) * envelope_size;
16479
16480            // Zero reserved fields.
16481            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16482
16483            // Safety:
16484            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16485            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16486            //   envelope_size bytes, there is always sufficient room.
16487            fidl::encoding::encode_in_envelope_optional::<
16488                fidl_fuchsia_mem::Data,
16489                fidl::encoding::DefaultFuchsiaResourceDialect,
16490            >(
16491                self.explicit_sites_filter_error_page.as_mut().map(
16492                    <fidl_fuchsia_mem::Data as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
16493                ),
16494                encoder,
16495                offset + cur_offset,
16496                depth,
16497            )?;
16498
16499            _prev_end_offset = cur_offset + envelope_size;
16500
16501            Ok(())
16502        }
16503    }
16504
16505    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16506        for CreateFrameParams
16507    {
16508        #[inline(always)]
16509        fn new_empty() -> Self {
16510            Self::default()
16511        }
16512
16513        unsafe fn decode(
16514            &mut self,
16515            decoder: &mut fidl::encoding::Decoder<
16516                '_,
16517                fidl::encoding::DefaultFuchsiaResourceDialect,
16518            >,
16519            offset: usize,
16520            mut depth: fidl::encoding::Depth,
16521        ) -> fidl::Result<()> {
16522            decoder.debug_check_bounds::<Self>(offset);
16523            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16524                None => return Err(fidl::Error::NotNullable),
16525                Some(len) => len,
16526            };
16527            // Calling decoder.out_of_line_offset(0) is not allowed.
16528            if len == 0 {
16529                return Ok(());
16530            };
16531            depth.increment()?;
16532            let envelope_size = 8;
16533            let bytes_len = len * envelope_size;
16534            let offset = decoder.out_of_line_offset(bytes_len)?;
16535            // Decode the envelope for each type.
16536            let mut _next_ordinal_to_read = 0;
16537            let mut next_offset = offset;
16538            let end_offset = offset + bytes_len;
16539            _next_ordinal_to_read += 1;
16540            if next_offset >= end_offset {
16541                return Ok(());
16542            }
16543
16544            // Decode unknown envelopes for gaps in ordinals.
16545            while _next_ordinal_to_read < 1 {
16546                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16547                _next_ordinal_to_read += 1;
16548                next_offset += envelope_size;
16549            }
16550
16551            let next_out_of_line = decoder.next_out_of_line();
16552            let handles_before = decoder.remaining_handles();
16553            if let Some((inlined, num_bytes, num_handles)) =
16554                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16555            {
16556                let member_inline_size =
16557                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16558                if inlined != (member_inline_size <= 4) {
16559                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16560                }
16561                let inner_offset;
16562                let mut inner_depth = depth.clone();
16563                if inlined {
16564                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16565                    inner_offset = next_offset;
16566                } else {
16567                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16568                    inner_depth.increment()?;
16569                }
16570                let val_ref = self.enable_remote_debugging.get_or_insert_with(|| {
16571                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
16572                });
16573                fidl::decode!(
16574                    bool,
16575                    fidl::encoding::DefaultFuchsiaResourceDialect,
16576                    val_ref,
16577                    decoder,
16578                    inner_offset,
16579                    inner_depth
16580                )?;
16581                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16582                {
16583                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16584                }
16585                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16586                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16587                }
16588            }
16589
16590            next_offset += envelope_size;
16591            _next_ordinal_to_read += 1;
16592            if next_offset >= end_offset {
16593                return Ok(());
16594            }
16595
16596            // Decode unknown envelopes for gaps in ordinals.
16597            while _next_ordinal_to_read < 2 {
16598                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16599                _next_ordinal_to_read += 1;
16600                next_offset += envelope_size;
16601            }
16602
16603            let next_out_of_line = decoder.next_out_of_line();
16604            let handles_before = decoder.remaining_handles();
16605            if let Some((inlined, num_bytes, num_handles)) =
16606                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16607            {
16608                let member_inline_size =
16609                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
16610                        decoder.context,
16611                    );
16612                if inlined != (member_inline_size <= 4) {
16613                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16614                }
16615                let inner_offset;
16616                let mut inner_depth = depth.clone();
16617                if inlined {
16618                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16619                    inner_offset = next_offset;
16620                } else {
16621                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16622                    inner_depth.increment()?;
16623                }
16624                let val_ref = self.debug_name.get_or_insert_with(|| {
16625                    fidl::new_empty!(
16626                        fidl::encoding::UnboundedString,
16627                        fidl::encoding::DefaultFuchsiaResourceDialect
16628                    )
16629                });
16630                fidl::decode!(
16631                    fidl::encoding::UnboundedString,
16632                    fidl::encoding::DefaultFuchsiaResourceDialect,
16633                    val_ref,
16634                    decoder,
16635                    inner_offset,
16636                    inner_depth
16637                )?;
16638                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16639                {
16640                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16641                }
16642                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16643                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16644                }
16645            }
16646
16647            next_offset += envelope_size;
16648            _next_ordinal_to_read += 1;
16649            if next_offset >= end_offset {
16650                return Ok(());
16651            }
16652
16653            // Decode unknown envelopes for gaps in ordinals.
16654            while _next_ordinal_to_read < 4 {
16655                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16656                _next_ordinal_to_read += 1;
16657                next_offset += envelope_size;
16658            }
16659
16660            let next_out_of_line = decoder.next_out_of_line();
16661            let handles_before = decoder.remaining_handles();
16662            if let Some((inlined, num_bytes, num_handles)) =
16663                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16664            {
16665                let member_inline_size =
16666                    <fidl_fuchsia_mem::Data as fidl::encoding::TypeMarker>::inline_size(
16667                        decoder.context,
16668                    );
16669                if inlined != (member_inline_size <= 4) {
16670                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16671                }
16672                let inner_offset;
16673                let mut inner_depth = depth.clone();
16674                if inlined {
16675                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16676                    inner_offset = next_offset;
16677                } else {
16678                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16679                    inner_depth.increment()?;
16680                }
16681                let val_ref = self.explicit_sites_filter_error_page.get_or_insert_with(|| {
16682                    fidl::new_empty!(
16683                        fidl_fuchsia_mem::Data,
16684                        fidl::encoding::DefaultFuchsiaResourceDialect
16685                    )
16686                });
16687                fidl::decode!(
16688                    fidl_fuchsia_mem::Data,
16689                    fidl::encoding::DefaultFuchsiaResourceDialect,
16690                    val_ref,
16691                    decoder,
16692                    inner_offset,
16693                    inner_depth
16694                )?;
16695                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16696                {
16697                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16698                }
16699                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16700                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16701                }
16702            }
16703
16704            next_offset += envelope_size;
16705
16706            // Decode the remaining unknown envelopes.
16707            while next_offset < end_offset {
16708                _next_ordinal_to_read += 1;
16709                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16710                next_offset += envelope_size;
16711            }
16712
16713            Ok(())
16714        }
16715    }
16716
16717    impl CreateView2Args {
16718        #[inline(always)]
16719        fn max_ordinal_present(&self) -> u64 {
16720            if let Some(_) = self.view_creation_token {
16721                return 1;
16722            }
16723            0
16724        }
16725    }
16726
16727    impl fidl::encoding::ResourceTypeMarker for CreateView2Args {
16728        type Borrowed<'a> = &'a mut Self;
16729        fn take_or_borrow<'a>(
16730            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16731        ) -> Self::Borrowed<'a> {
16732            value
16733        }
16734    }
16735
16736    unsafe impl fidl::encoding::TypeMarker for CreateView2Args {
16737        type Owned = Self;
16738
16739        #[inline(always)]
16740        fn inline_align(_context: fidl::encoding::Context) -> usize {
16741            8
16742        }
16743
16744        #[inline(always)]
16745        fn inline_size(_context: fidl::encoding::Context) -> usize {
16746            16
16747        }
16748    }
16749
16750    unsafe impl
16751        fidl::encoding::Encode<CreateView2Args, fidl::encoding::DefaultFuchsiaResourceDialect>
16752        for &mut CreateView2Args
16753    {
16754        unsafe fn encode(
16755            self,
16756            encoder: &mut fidl::encoding::Encoder<
16757                '_,
16758                fidl::encoding::DefaultFuchsiaResourceDialect,
16759            >,
16760            offset: usize,
16761            mut depth: fidl::encoding::Depth,
16762        ) -> fidl::Result<()> {
16763            encoder.debug_check_bounds::<CreateView2Args>(offset);
16764            // Vector header
16765            let max_ordinal: u64 = self.max_ordinal_present();
16766            encoder.write_num(max_ordinal, offset);
16767            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16768            // Calling encoder.out_of_line_offset(0) is not allowed.
16769            if max_ordinal == 0 {
16770                return Ok(());
16771            }
16772            depth.increment()?;
16773            let envelope_size = 8;
16774            let bytes_len = max_ordinal as usize * envelope_size;
16775            #[allow(unused_variables)]
16776            let offset = encoder.out_of_line_offset(bytes_len);
16777            let mut _prev_end_offset: usize = 0;
16778            if 1 > max_ordinal {
16779                return Ok(());
16780            }
16781
16782            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16783            // are envelope_size bytes.
16784            let cur_offset: usize = (1 - 1) * envelope_size;
16785
16786            // Zero reserved fields.
16787            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16788
16789            // Safety:
16790            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16791            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16792            //   envelope_size bytes, there is always sufficient room.
16793            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_views::ViewCreationToken, fidl::encoding::DefaultFuchsiaResourceDialect>(
16794            self.view_creation_token.as_mut().map(<fidl_fuchsia_ui_views::ViewCreationToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16795            encoder, offset + cur_offset, depth
16796        )?;
16797
16798            _prev_end_offset = cur_offset + envelope_size;
16799
16800            Ok(())
16801        }
16802    }
16803
16804    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16805        for CreateView2Args
16806    {
16807        #[inline(always)]
16808        fn new_empty() -> Self {
16809            Self::default()
16810        }
16811
16812        unsafe fn decode(
16813            &mut self,
16814            decoder: &mut fidl::encoding::Decoder<
16815                '_,
16816                fidl::encoding::DefaultFuchsiaResourceDialect,
16817            >,
16818            offset: usize,
16819            mut depth: fidl::encoding::Depth,
16820        ) -> fidl::Result<()> {
16821            decoder.debug_check_bounds::<Self>(offset);
16822            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16823                None => return Err(fidl::Error::NotNullable),
16824                Some(len) => len,
16825            };
16826            // Calling decoder.out_of_line_offset(0) is not allowed.
16827            if len == 0 {
16828                return Ok(());
16829            };
16830            depth.increment()?;
16831            let envelope_size = 8;
16832            let bytes_len = len * envelope_size;
16833            let offset = decoder.out_of_line_offset(bytes_len)?;
16834            // Decode the envelope for each type.
16835            let mut _next_ordinal_to_read = 0;
16836            let mut next_offset = offset;
16837            let end_offset = offset + bytes_len;
16838            _next_ordinal_to_read += 1;
16839            if next_offset >= end_offset {
16840                return Ok(());
16841            }
16842
16843            // Decode unknown envelopes for gaps in ordinals.
16844            while _next_ordinal_to_read < 1 {
16845                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16846                _next_ordinal_to_read += 1;
16847                next_offset += envelope_size;
16848            }
16849
16850            let next_out_of_line = decoder.next_out_of_line();
16851            let handles_before = decoder.remaining_handles();
16852            if let Some((inlined, num_bytes, num_handles)) =
16853                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16854            {
16855                let member_inline_size = <fidl_fuchsia_ui_views::ViewCreationToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16856                if inlined != (member_inline_size <= 4) {
16857                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16858                }
16859                let inner_offset;
16860                let mut inner_depth = depth.clone();
16861                if inlined {
16862                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16863                    inner_offset = next_offset;
16864                } else {
16865                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16866                    inner_depth.increment()?;
16867                }
16868                let val_ref = self.view_creation_token.get_or_insert_with(|| {
16869                    fidl::new_empty!(
16870                        fidl_fuchsia_ui_views::ViewCreationToken,
16871                        fidl::encoding::DefaultFuchsiaResourceDialect
16872                    )
16873                });
16874                fidl::decode!(
16875                    fidl_fuchsia_ui_views::ViewCreationToken,
16876                    fidl::encoding::DefaultFuchsiaResourceDialect,
16877                    val_ref,
16878                    decoder,
16879                    inner_offset,
16880                    inner_depth
16881                )?;
16882                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16883                {
16884                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16885                }
16886                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16887                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16888                }
16889            }
16890
16891            next_offset += envelope_size;
16892
16893            // Decode the remaining unknown envelopes.
16894            while next_offset < end_offset {
16895                _next_ordinal_to_read += 1;
16896                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16897                next_offset += envelope_size;
16898            }
16899
16900            Ok(())
16901        }
16902    }
16903
16904    impl Favicon {
16905        #[inline(always)]
16906        fn max_ordinal_present(&self) -> u64 {
16907            if let Some(_) = self.height {
16908                return 3;
16909            }
16910            if let Some(_) = self.width {
16911                return 2;
16912            }
16913            if let Some(_) = self.data {
16914                return 1;
16915            }
16916            0
16917        }
16918    }
16919
16920    impl fidl::encoding::ResourceTypeMarker for Favicon {
16921        type Borrowed<'a> = &'a mut Self;
16922        fn take_or_borrow<'a>(
16923            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16924        ) -> Self::Borrowed<'a> {
16925            value
16926        }
16927    }
16928
16929    unsafe impl fidl::encoding::TypeMarker for Favicon {
16930        type Owned = Self;
16931
16932        #[inline(always)]
16933        fn inline_align(_context: fidl::encoding::Context) -> usize {
16934            8
16935        }
16936
16937        #[inline(always)]
16938        fn inline_size(_context: fidl::encoding::Context) -> usize {
16939            16
16940        }
16941    }
16942
16943    unsafe impl fidl::encoding::Encode<Favicon, fidl::encoding::DefaultFuchsiaResourceDialect>
16944        for &mut Favicon
16945    {
16946        unsafe fn encode(
16947            self,
16948            encoder: &mut fidl::encoding::Encoder<
16949                '_,
16950                fidl::encoding::DefaultFuchsiaResourceDialect,
16951            >,
16952            offset: usize,
16953            mut depth: fidl::encoding::Depth,
16954        ) -> fidl::Result<()> {
16955            encoder.debug_check_bounds::<Favicon>(offset);
16956            // Vector header
16957            let max_ordinal: u64 = self.max_ordinal_present();
16958            encoder.write_num(max_ordinal, offset);
16959            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16960            // Calling encoder.out_of_line_offset(0) is not allowed.
16961            if max_ordinal == 0 {
16962                return Ok(());
16963            }
16964            depth.increment()?;
16965            let envelope_size = 8;
16966            let bytes_len = max_ordinal as usize * envelope_size;
16967            #[allow(unused_variables)]
16968            let offset = encoder.out_of_line_offset(bytes_len);
16969            let mut _prev_end_offset: usize = 0;
16970            if 1 > max_ordinal {
16971                return Ok(());
16972            }
16973
16974            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16975            // are envelope_size bytes.
16976            let cur_offset: usize = (1 - 1) * envelope_size;
16977
16978            // Zero reserved fields.
16979            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16980
16981            // Safety:
16982            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16983            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16984            //   envelope_size bytes, there is always sufficient room.
16985            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
16986            self.data.as_mut().map(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16987            encoder, offset + cur_offset, depth
16988        )?;
16989
16990            _prev_end_offset = cur_offset + envelope_size;
16991            if 2 > max_ordinal {
16992                return Ok(());
16993            }
16994
16995            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16996            // are envelope_size bytes.
16997            let cur_offset: usize = (2 - 1) * envelope_size;
16998
16999            // Zero reserved fields.
17000            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17001
17002            // Safety:
17003            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17004            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17005            //   envelope_size bytes, there is always sufficient room.
17006            fidl::encoding::encode_in_envelope_optional::<
17007                u32,
17008                fidl::encoding::DefaultFuchsiaResourceDialect,
17009            >(
17010                self.width.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17011                encoder,
17012                offset + cur_offset,
17013                depth,
17014            )?;
17015
17016            _prev_end_offset = cur_offset + envelope_size;
17017            if 3 > max_ordinal {
17018                return Ok(());
17019            }
17020
17021            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17022            // are envelope_size bytes.
17023            let cur_offset: usize = (3 - 1) * envelope_size;
17024
17025            // Zero reserved fields.
17026            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17027
17028            // Safety:
17029            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17030            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17031            //   envelope_size bytes, there is always sufficient room.
17032            fidl::encoding::encode_in_envelope_optional::<
17033                u32,
17034                fidl::encoding::DefaultFuchsiaResourceDialect,
17035            >(
17036                self.height.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17037                encoder,
17038                offset + cur_offset,
17039                depth,
17040            )?;
17041
17042            _prev_end_offset = cur_offset + envelope_size;
17043
17044            Ok(())
17045        }
17046    }
17047
17048    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Favicon {
17049        #[inline(always)]
17050        fn new_empty() -> Self {
17051            Self::default()
17052        }
17053
17054        unsafe fn decode(
17055            &mut self,
17056            decoder: &mut fidl::encoding::Decoder<
17057                '_,
17058                fidl::encoding::DefaultFuchsiaResourceDialect,
17059            >,
17060            offset: usize,
17061            mut depth: fidl::encoding::Depth,
17062        ) -> fidl::Result<()> {
17063            decoder.debug_check_bounds::<Self>(offset);
17064            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17065                None => return Err(fidl::Error::NotNullable),
17066                Some(len) => len,
17067            };
17068            // Calling decoder.out_of_line_offset(0) is not allowed.
17069            if len == 0 {
17070                return Ok(());
17071            };
17072            depth.increment()?;
17073            let envelope_size = 8;
17074            let bytes_len = len * envelope_size;
17075            let offset = decoder.out_of_line_offset(bytes_len)?;
17076            // Decode the envelope for each type.
17077            let mut _next_ordinal_to_read = 0;
17078            let mut next_offset = offset;
17079            let end_offset = offset + bytes_len;
17080            _next_ordinal_to_read += 1;
17081            if next_offset >= end_offset {
17082                return Ok(());
17083            }
17084
17085            // Decode unknown envelopes for gaps in ordinals.
17086            while _next_ordinal_to_read < 1 {
17087                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17088                _next_ordinal_to_read += 1;
17089                next_offset += envelope_size;
17090            }
17091
17092            let next_out_of_line = decoder.next_out_of_line();
17093            let handles_before = decoder.remaining_handles();
17094            if let Some((inlined, num_bytes, num_handles)) =
17095                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17096            {
17097                let member_inline_size =
17098                    <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
17099                        decoder.context,
17100                    );
17101                if inlined != (member_inline_size <= 4) {
17102                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17103                }
17104                let inner_offset;
17105                let mut inner_depth = depth.clone();
17106                if inlined {
17107                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17108                    inner_offset = next_offset;
17109                } else {
17110                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17111                    inner_depth.increment()?;
17112                }
17113                let val_ref = self.data.get_or_insert_with(|| {
17114                    fidl::new_empty!(
17115                        fidl_fuchsia_mem::Buffer,
17116                        fidl::encoding::DefaultFuchsiaResourceDialect
17117                    )
17118                });
17119                fidl::decode!(
17120                    fidl_fuchsia_mem::Buffer,
17121                    fidl::encoding::DefaultFuchsiaResourceDialect,
17122                    val_ref,
17123                    decoder,
17124                    inner_offset,
17125                    inner_depth
17126                )?;
17127                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17128                {
17129                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17130                }
17131                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17132                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17133                }
17134            }
17135
17136            next_offset += envelope_size;
17137            _next_ordinal_to_read += 1;
17138            if next_offset >= end_offset {
17139                return Ok(());
17140            }
17141
17142            // Decode unknown envelopes for gaps in ordinals.
17143            while _next_ordinal_to_read < 2 {
17144                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17145                _next_ordinal_to_read += 1;
17146                next_offset += envelope_size;
17147            }
17148
17149            let next_out_of_line = decoder.next_out_of_line();
17150            let handles_before = decoder.remaining_handles();
17151            if let Some((inlined, num_bytes, num_handles)) =
17152                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17153            {
17154                let member_inline_size =
17155                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17156                if inlined != (member_inline_size <= 4) {
17157                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17158                }
17159                let inner_offset;
17160                let mut inner_depth = depth.clone();
17161                if inlined {
17162                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17163                    inner_offset = next_offset;
17164                } else {
17165                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17166                    inner_depth.increment()?;
17167                }
17168                let val_ref = self.width.get_or_insert_with(|| {
17169                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
17170                });
17171                fidl::decode!(
17172                    u32,
17173                    fidl::encoding::DefaultFuchsiaResourceDialect,
17174                    val_ref,
17175                    decoder,
17176                    inner_offset,
17177                    inner_depth
17178                )?;
17179                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17180                {
17181                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17182                }
17183                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17184                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17185                }
17186            }
17187
17188            next_offset += envelope_size;
17189            _next_ordinal_to_read += 1;
17190            if next_offset >= end_offset {
17191                return Ok(());
17192            }
17193
17194            // Decode unknown envelopes for gaps in ordinals.
17195            while _next_ordinal_to_read < 3 {
17196                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17197                _next_ordinal_to_read += 1;
17198                next_offset += envelope_size;
17199            }
17200
17201            let next_out_of_line = decoder.next_out_of_line();
17202            let handles_before = decoder.remaining_handles();
17203            if let Some((inlined, num_bytes, num_handles)) =
17204                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17205            {
17206                let member_inline_size =
17207                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17208                if inlined != (member_inline_size <= 4) {
17209                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17210                }
17211                let inner_offset;
17212                let mut inner_depth = depth.clone();
17213                if inlined {
17214                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17215                    inner_offset = next_offset;
17216                } else {
17217                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17218                    inner_depth.increment()?;
17219                }
17220                let val_ref = self.height.get_or_insert_with(|| {
17221                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
17222                });
17223                fidl::decode!(
17224                    u32,
17225                    fidl::encoding::DefaultFuchsiaResourceDialect,
17226                    val_ref,
17227                    decoder,
17228                    inner_offset,
17229                    inner_depth
17230                )?;
17231                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17232                {
17233                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17234                }
17235                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17236                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17237                }
17238            }
17239
17240            next_offset += envelope_size;
17241
17242            // Decode the remaining unknown envelopes.
17243            while next_offset < end_offset {
17244                _next_ordinal_to_read += 1;
17245                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17246                next_offset += envelope_size;
17247            }
17248
17249            Ok(())
17250        }
17251    }
17252
17253    impl LoadUrlParams {
17254        #[inline(always)]
17255        fn max_ordinal_present(&self) -> u64 {
17256            if let Some(_) = self.headers {
17257                return 4;
17258            }
17259            if let Some(_) = self.was_user_activated {
17260                return 3;
17261            }
17262            if let Some(_) = self.referrer_url {
17263                return 2;
17264            }
17265            if let Some(_) = self.type_ {
17266                return 1;
17267            }
17268            0
17269        }
17270    }
17271
17272    impl fidl::encoding::ResourceTypeMarker for LoadUrlParams {
17273        type Borrowed<'a> = &'a mut Self;
17274        fn take_or_borrow<'a>(
17275            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17276        ) -> Self::Borrowed<'a> {
17277            value
17278        }
17279    }
17280
17281    unsafe impl fidl::encoding::TypeMarker for LoadUrlParams {
17282        type Owned = Self;
17283
17284        #[inline(always)]
17285        fn inline_align(_context: fidl::encoding::Context) -> usize {
17286            8
17287        }
17288
17289        #[inline(always)]
17290        fn inline_size(_context: fidl::encoding::Context) -> usize {
17291            16
17292        }
17293    }
17294
17295    unsafe impl fidl::encoding::Encode<LoadUrlParams, fidl::encoding::DefaultFuchsiaResourceDialect>
17296        for &mut LoadUrlParams
17297    {
17298        unsafe fn encode(
17299            self,
17300            encoder: &mut fidl::encoding::Encoder<
17301                '_,
17302                fidl::encoding::DefaultFuchsiaResourceDialect,
17303            >,
17304            offset: usize,
17305            mut depth: fidl::encoding::Depth,
17306        ) -> fidl::Result<()> {
17307            encoder.debug_check_bounds::<LoadUrlParams>(offset);
17308            // Vector header
17309            let max_ordinal: u64 = self.max_ordinal_present();
17310            encoder.write_num(max_ordinal, offset);
17311            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17312            // Calling encoder.out_of_line_offset(0) is not allowed.
17313            if max_ordinal == 0 {
17314                return Ok(());
17315            }
17316            depth.increment()?;
17317            let envelope_size = 8;
17318            let bytes_len = max_ordinal as usize * envelope_size;
17319            #[allow(unused_variables)]
17320            let offset = encoder.out_of_line_offset(bytes_len);
17321            let mut _prev_end_offset: usize = 0;
17322            if 1 > max_ordinal {
17323                return Ok(());
17324            }
17325
17326            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17327            // are envelope_size bytes.
17328            let cur_offset: usize = (1 - 1) * envelope_size;
17329
17330            // Zero reserved fields.
17331            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17332
17333            // Safety:
17334            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17335            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17336            //   envelope_size bytes, there is always sufficient room.
17337            fidl::encoding::encode_in_envelope_optional::<
17338                LoadUrlReason,
17339                fidl::encoding::DefaultFuchsiaResourceDialect,
17340            >(
17341                self.type_.as_ref().map(<LoadUrlReason as fidl::encoding::ValueTypeMarker>::borrow),
17342                encoder,
17343                offset + cur_offset,
17344                depth,
17345            )?;
17346
17347            _prev_end_offset = cur_offset + envelope_size;
17348            if 2 > max_ordinal {
17349                return Ok(());
17350            }
17351
17352            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17353            // are envelope_size bytes.
17354            let cur_offset: usize = (2 - 1) * envelope_size;
17355
17356            // Zero reserved fields.
17357            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17358
17359            // Safety:
17360            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17361            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17362            //   envelope_size bytes, there is always sufficient room.
17363            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65536>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17364            self.referrer_url.as_ref().map(<fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow),
17365            encoder, offset + cur_offset, depth
17366        )?;
17367
17368            _prev_end_offset = cur_offset + envelope_size;
17369            if 3 > max_ordinal {
17370                return Ok(());
17371            }
17372
17373            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17374            // are envelope_size bytes.
17375            let cur_offset: usize = (3 - 1) * envelope_size;
17376
17377            // Zero reserved fields.
17378            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17379
17380            // Safety:
17381            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17382            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17383            //   envelope_size bytes, there is always sufficient room.
17384            fidl::encoding::encode_in_envelope_optional::<
17385                bool,
17386                fidl::encoding::DefaultFuchsiaResourceDialect,
17387            >(
17388                self.was_user_activated
17389                    .as_ref()
17390                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17391                encoder,
17392                offset + cur_offset,
17393                depth,
17394            )?;
17395
17396            _prev_end_offset = cur_offset + envelope_size;
17397            if 4 > max_ordinal {
17398                return Ok(());
17399            }
17400
17401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17402            // are envelope_size bytes.
17403            let cur_offset: usize = (4 - 1) * envelope_size;
17404
17405            // Zero reserved fields.
17406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17407
17408            // Safety:
17409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17411            //   envelope_size bytes, there is always sufficient room.
17412            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net_http::Header>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17413            self.headers.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net_http::Header> as fidl::encoding::ValueTypeMarker>::borrow),
17414            encoder, offset + cur_offset, depth
17415        )?;
17416
17417            _prev_end_offset = cur_offset + envelope_size;
17418
17419            Ok(())
17420        }
17421    }
17422
17423    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for LoadUrlParams {
17424        #[inline(always)]
17425        fn new_empty() -> Self {
17426            Self::default()
17427        }
17428
17429        unsafe fn decode(
17430            &mut self,
17431            decoder: &mut fidl::encoding::Decoder<
17432                '_,
17433                fidl::encoding::DefaultFuchsiaResourceDialect,
17434            >,
17435            offset: usize,
17436            mut depth: fidl::encoding::Depth,
17437        ) -> fidl::Result<()> {
17438            decoder.debug_check_bounds::<Self>(offset);
17439            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17440                None => return Err(fidl::Error::NotNullable),
17441                Some(len) => len,
17442            };
17443            // Calling decoder.out_of_line_offset(0) is not allowed.
17444            if len == 0 {
17445                return Ok(());
17446            };
17447            depth.increment()?;
17448            let envelope_size = 8;
17449            let bytes_len = len * envelope_size;
17450            let offset = decoder.out_of_line_offset(bytes_len)?;
17451            // Decode the envelope for each type.
17452            let mut _next_ordinal_to_read = 0;
17453            let mut next_offset = offset;
17454            let end_offset = offset + bytes_len;
17455            _next_ordinal_to_read += 1;
17456            if next_offset >= end_offset {
17457                return Ok(());
17458            }
17459
17460            // Decode unknown envelopes for gaps in ordinals.
17461            while _next_ordinal_to_read < 1 {
17462                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17463                _next_ordinal_to_read += 1;
17464                next_offset += envelope_size;
17465            }
17466
17467            let next_out_of_line = decoder.next_out_of_line();
17468            let handles_before = decoder.remaining_handles();
17469            if let Some((inlined, num_bytes, num_handles)) =
17470                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17471            {
17472                let member_inline_size =
17473                    <LoadUrlReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17474                if inlined != (member_inline_size <= 4) {
17475                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17476                }
17477                let inner_offset;
17478                let mut inner_depth = depth.clone();
17479                if inlined {
17480                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17481                    inner_offset = next_offset;
17482                } else {
17483                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17484                    inner_depth.increment()?;
17485                }
17486                let val_ref = self.type_.get_or_insert_with(|| {
17487                    fidl::new_empty!(LoadUrlReason, fidl::encoding::DefaultFuchsiaResourceDialect)
17488                });
17489                fidl::decode!(
17490                    LoadUrlReason,
17491                    fidl::encoding::DefaultFuchsiaResourceDialect,
17492                    val_ref,
17493                    decoder,
17494                    inner_offset,
17495                    inner_depth
17496                )?;
17497                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17498                {
17499                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17500                }
17501                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17502                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17503                }
17504            }
17505
17506            next_offset += envelope_size;
17507            _next_ordinal_to_read += 1;
17508            if next_offset >= end_offset {
17509                return Ok(());
17510            }
17511
17512            // Decode unknown envelopes for gaps in ordinals.
17513            while _next_ordinal_to_read < 2 {
17514                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17515                _next_ordinal_to_read += 1;
17516                next_offset += envelope_size;
17517            }
17518
17519            let next_out_of_line = decoder.next_out_of_line();
17520            let handles_before = decoder.remaining_handles();
17521            if let Some((inlined, num_bytes, num_handles)) =
17522                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17523            {
17524                let member_inline_size = <fidl::encoding::BoundedString<65536> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17525                if inlined != (member_inline_size <= 4) {
17526                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17527                }
17528                let inner_offset;
17529                let mut inner_depth = depth.clone();
17530                if inlined {
17531                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17532                    inner_offset = next_offset;
17533                } else {
17534                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17535                    inner_depth.increment()?;
17536                }
17537                let val_ref = self.referrer_url.get_or_insert_with(|| {
17538                    fidl::new_empty!(
17539                        fidl::encoding::BoundedString<65536>,
17540                        fidl::encoding::DefaultFuchsiaResourceDialect
17541                    )
17542                });
17543                fidl::decode!(
17544                    fidl::encoding::BoundedString<65536>,
17545                    fidl::encoding::DefaultFuchsiaResourceDialect,
17546                    val_ref,
17547                    decoder,
17548                    inner_offset,
17549                    inner_depth
17550                )?;
17551                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17552                {
17553                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17554                }
17555                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17556                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17557                }
17558            }
17559
17560            next_offset += envelope_size;
17561            _next_ordinal_to_read += 1;
17562            if next_offset >= end_offset {
17563                return Ok(());
17564            }
17565
17566            // Decode unknown envelopes for gaps in ordinals.
17567            while _next_ordinal_to_read < 3 {
17568                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17569                _next_ordinal_to_read += 1;
17570                next_offset += envelope_size;
17571            }
17572
17573            let next_out_of_line = decoder.next_out_of_line();
17574            let handles_before = decoder.remaining_handles();
17575            if let Some((inlined, num_bytes, num_handles)) =
17576                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17577            {
17578                let member_inline_size =
17579                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17580                if inlined != (member_inline_size <= 4) {
17581                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17582                }
17583                let inner_offset;
17584                let mut inner_depth = depth.clone();
17585                if inlined {
17586                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17587                    inner_offset = next_offset;
17588                } else {
17589                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17590                    inner_depth.increment()?;
17591                }
17592                let val_ref = self.was_user_activated.get_or_insert_with(|| {
17593                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
17594                });
17595                fidl::decode!(
17596                    bool,
17597                    fidl::encoding::DefaultFuchsiaResourceDialect,
17598                    val_ref,
17599                    decoder,
17600                    inner_offset,
17601                    inner_depth
17602                )?;
17603                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17604                {
17605                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17606                }
17607                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17608                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17609                }
17610            }
17611
17612            next_offset += envelope_size;
17613            _next_ordinal_to_read += 1;
17614            if next_offset >= end_offset {
17615                return Ok(());
17616            }
17617
17618            // Decode unknown envelopes for gaps in ordinals.
17619            while _next_ordinal_to_read < 4 {
17620                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17621                _next_ordinal_to_read += 1;
17622                next_offset += envelope_size;
17623            }
17624
17625            let next_out_of_line = decoder.next_out_of_line();
17626            let handles_before = decoder.remaining_handles();
17627            if let Some((inlined, num_bytes, num_handles)) =
17628                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17629            {
17630                let member_inline_size = <fidl::encoding::UnboundedVector<
17631                    fidl_fuchsia_net_http::Header,
17632                > as fidl::encoding::TypeMarker>::inline_size(
17633                    decoder.context
17634                );
17635                if inlined != (member_inline_size <= 4) {
17636                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17637                }
17638                let inner_offset;
17639                let mut inner_depth = depth.clone();
17640                if inlined {
17641                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17642                    inner_offset = next_offset;
17643                } else {
17644                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17645                    inner_depth.increment()?;
17646                }
17647                let val_ref = self.headers.get_or_insert_with(|| {
17648                    fidl::new_empty!(
17649                        fidl::encoding::UnboundedVector<fidl_fuchsia_net_http::Header>,
17650                        fidl::encoding::DefaultFuchsiaResourceDialect
17651                    )
17652                });
17653                fidl::decode!(
17654                    fidl::encoding::UnboundedVector<fidl_fuchsia_net_http::Header>,
17655                    fidl::encoding::DefaultFuchsiaResourceDialect,
17656                    val_ref,
17657                    decoder,
17658                    inner_offset,
17659                    inner_depth
17660                )?;
17661                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17662                {
17663                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17664                }
17665                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17666                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17667                }
17668            }
17669
17670            next_offset += envelope_size;
17671
17672            // Decode the remaining unknown envelopes.
17673            while next_offset < end_offset {
17674                _next_ordinal_to_read += 1;
17675                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17676                next_offset += envelope_size;
17677            }
17678
17679            Ok(())
17680        }
17681    }
17682
17683    impl NavigationState {
17684        #[inline(always)]
17685        fn max_ordinal_present(&self) -> u64 {
17686            if let Some(_) = self.error_detail {
17687                return 8;
17688            }
17689            if let Some(_) = self.favicon {
17690                return 7;
17691            }
17692            if let Some(_) = self.is_main_document_loaded {
17693                return 6;
17694            }
17695            if let Some(_) = self.can_go_back {
17696                return 5;
17697            }
17698            if let Some(_) = self.can_go_forward {
17699                return 4;
17700            }
17701            if let Some(_) = self.page_type {
17702                return 3;
17703            }
17704            if let Some(_) = self.title {
17705                return 2;
17706            }
17707            if let Some(_) = self.url {
17708                return 1;
17709            }
17710            0
17711        }
17712    }
17713
17714    impl fidl::encoding::ResourceTypeMarker for NavigationState {
17715        type Borrowed<'a> = &'a mut Self;
17716        fn take_or_borrow<'a>(
17717            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17718        ) -> Self::Borrowed<'a> {
17719            value
17720        }
17721    }
17722
17723    unsafe impl fidl::encoding::TypeMarker for NavigationState {
17724        type Owned = Self;
17725
17726        #[inline(always)]
17727        fn inline_align(_context: fidl::encoding::Context) -> usize {
17728            8
17729        }
17730
17731        #[inline(always)]
17732        fn inline_size(_context: fidl::encoding::Context) -> usize {
17733            16
17734        }
17735    }
17736
17737    unsafe impl
17738        fidl::encoding::Encode<NavigationState, fidl::encoding::DefaultFuchsiaResourceDialect>
17739        for &mut NavigationState
17740    {
17741        unsafe fn encode(
17742            self,
17743            encoder: &mut fidl::encoding::Encoder<
17744                '_,
17745                fidl::encoding::DefaultFuchsiaResourceDialect,
17746            >,
17747            offset: usize,
17748            mut depth: fidl::encoding::Depth,
17749        ) -> fidl::Result<()> {
17750            encoder.debug_check_bounds::<NavigationState>(offset);
17751            // Vector header
17752            let max_ordinal: u64 = self.max_ordinal_present();
17753            encoder.write_num(max_ordinal, offset);
17754            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17755            // Calling encoder.out_of_line_offset(0) is not allowed.
17756            if max_ordinal == 0 {
17757                return Ok(());
17758            }
17759            depth.increment()?;
17760            let envelope_size = 8;
17761            let bytes_len = max_ordinal as usize * envelope_size;
17762            #[allow(unused_variables)]
17763            let offset = encoder.out_of_line_offset(bytes_len);
17764            let mut _prev_end_offset: usize = 0;
17765            if 1 > max_ordinal {
17766                return Ok(());
17767            }
17768
17769            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17770            // are envelope_size bytes.
17771            let cur_offset: usize = (1 - 1) * envelope_size;
17772
17773            // Zero reserved fields.
17774            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17775
17776            // Safety:
17777            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17778            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17779            //   envelope_size bytes, there is always sufficient room.
17780            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65536>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17781            self.url.as_ref().map(<fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow),
17782            encoder, offset + cur_offset, depth
17783        )?;
17784
17785            _prev_end_offset = cur_offset + envelope_size;
17786            if 2 > max_ordinal {
17787                return Ok(());
17788            }
17789
17790            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17791            // are envelope_size bytes.
17792            let cur_offset: usize = (2 - 1) * envelope_size;
17793
17794            // Zero reserved fields.
17795            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17796
17797            // Safety:
17798            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17799            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17800            //   envelope_size bytes, there is always sufficient room.
17801            fidl::encoding::encode_in_envelope_optional::<
17802                fidl::encoding::UnboundedString,
17803                fidl::encoding::DefaultFuchsiaResourceDialect,
17804            >(
17805                self.title.as_ref().map(
17806                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
17807                ),
17808                encoder,
17809                offset + cur_offset,
17810                depth,
17811            )?;
17812
17813            _prev_end_offset = cur_offset + envelope_size;
17814            if 3 > max_ordinal {
17815                return Ok(());
17816            }
17817
17818            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17819            // are envelope_size bytes.
17820            let cur_offset: usize = (3 - 1) * envelope_size;
17821
17822            // Zero reserved fields.
17823            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17824
17825            // Safety:
17826            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17827            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17828            //   envelope_size bytes, there is always sufficient room.
17829            fidl::encoding::encode_in_envelope_optional::<
17830                PageType,
17831                fidl::encoding::DefaultFuchsiaResourceDialect,
17832            >(
17833                self.page_type.as_ref().map(<PageType as fidl::encoding::ValueTypeMarker>::borrow),
17834                encoder,
17835                offset + cur_offset,
17836                depth,
17837            )?;
17838
17839            _prev_end_offset = cur_offset + envelope_size;
17840            if 4 > max_ordinal {
17841                return Ok(());
17842            }
17843
17844            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17845            // are envelope_size bytes.
17846            let cur_offset: usize = (4 - 1) * envelope_size;
17847
17848            // Zero reserved fields.
17849            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17850
17851            // Safety:
17852            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17853            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17854            //   envelope_size bytes, there is always sufficient room.
17855            fidl::encoding::encode_in_envelope_optional::<
17856                bool,
17857                fidl::encoding::DefaultFuchsiaResourceDialect,
17858            >(
17859                self.can_go_forward.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17860                encoder,
17861                offset + cur_offset,
17862                depth,
17863            )?;
17864
17865            _prev_end_offset = cur_offset + envelope_size;
17866            if 5 > max_ordinal {
17867                return Ok(());
17868            }
17869
17870            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17871            // are envelope_size bytes.
17872            let cur_offset: usize = (5 - 1) * envelope_size;
17873
17874            // Zero reserved fields.
17875            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17876
17877            // Safety:
17878            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17879            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17880            //   envelope_size bytes, there is always sufficient room.
17881            fidl::encoding::encode_in_envelope_optional::<
17882                bool,
17883                fidl::encoding::DefaultFuchsiaResourceDialect,
17884            >(
17885                self.can_go_back.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17886                encoder,
17887                offset + cur_offset,
17888                depth,
17889            )?;
17890
17891            _prev_end_offset = cur_offset + envelope_size;
17892            if 6 > max_ordinal {
17893                return Ok(());
17894            }
17895
17896            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17897            // are envelope_size bytes.
17898            let cur_offset: usize = (6 - 1) * envelope_size;
17899
17900            // Zero reserved fields.
17901            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17902
17903            // Safety:
17904            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17905            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17906            //   envelope_size bytes, there is always sufficient room.
17907            fidl::encoding::encode_in_envelope_optional::<
17908                bool,
17909                fidl::encoding::DefaultFuchsiaResourceDialect,
17910            >(
17911                self.is_main_document_loaded
17912                    .as_ref()
17913                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17914                encoder,
17915                offset + cur_offset,
17916                depth,
17917            )?;
17918
17919            _prev_end_offset = cur_offset + envelope_size;
17920            if 7 > max_ordinal {
17921                return Ok(());
17922            }
17923
17924            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17925            // are envelope_size bytes.
17926            let cur_offset: usize = (7 - 1) * envelope_size;
17927
17928            // Zero reserved fields.
17929            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17930
17931            // Safety:
17932            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17933            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17934            //   envelope_size bytes, there is always sufficient room.
17935            fidl::encoding::encode_in_envelope_optional::<
17936                Favicon,
17937                fidl::encoding::DefaultFuchsiaResourceDialect,
17938            >(
17939                self.favicon
17940                    .as_mut()
17941                    .map(<Favicon as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
17942                encoder,
17943                offset + cur_offset,
17944                depth,
17945            )?;
17946
17947            _prev_end_offset = cur_offset + envelope_size;
17948            if 8 > max_ordinal {
17949                return Ok(());
17950            }
17951
17952            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17953            // are envelope_size bytes.
17954            let cur_offset: usize = (8 - 1) * envelope_size;
17955
17956            // Zero reserved fields.
17957            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17958
17959            // Safety:
17960            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17961            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17962            //   envelope_size bytes, there is always sufficient room.
17963            fidl::encoding::encode_in_envelope_optional::<
17964                ErrorDetail,
17965                fidl::encoding::DefaultFuchsiaResourceDialect,
17966            >(
17967                self.error_detail
17968                    .as_ref()
17969                    .map(<ErrorDetail as fidl::encoding::ValueTypeMarker>::borrow),
17970                encoder,
17971                offset + cur_offset,
17972                depth,
17973            )?;
17974
17975            _prev_end_offset = cur_offset + envelope_size;
17976
17977            Ok(())
17978        }
17979    }
17980
17981    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17982        for NavigationState
17983    {
17984        #[inline(always)]
17985        fn new_empty() -> Self {
17986            Self::default()
17987        }
17988
17989        unsafe fn decode(
17990            &mut self,
17991            decoder: &mut fidl::encoding::Decoder<
17992                '_,
17993                fidl::encoding::DefaultFuchsiaResourceDialect,
17994            >,
17995            offset: usize,
17996            mut depth: fidl::encoding::Depth,
17997        ) -> fidl::Result<()> {
17998            decoder.debug_check_bounds::<Self>(offset);
17999            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18000                None => return Err(fidl::Error::NotNullable),
18001                Some(len) => len,
18002            };
18003            // Calling decoder.out_of_line_offset(0) is not allowed.
18004            if len == 0 {
18005                return Ok(());
18006            };
18007            depth.increment()?;
18008            let envelope_size = 8;
18009            let bytes_len = len * envelope_size;
18010            let offset = decoder.out_of_line_offset(bytes_len)?;
18011            // Decode the envelope for each type.
18012            let mut _next_ordinal_to_read = 0;
18013            let mut next_offset = offset;
18014            let end_offset = offset + bytes_len;
18015            _next_ordinal_to_read += 1;
18016            if next_offset >= end_offset {
18017                return Ok(());
18018            }
18019
18020            // Decode unknown envelopes for gaps in ordinals.
18021            while _next_ordinal_to_read < 1 {
18022                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18023                _next_ordinal_to_read += 1;
18024                next_offset += envelope_size;
18025            }
18026
18027            let next_out_of_line = decoder.next_out_of_line();
18028            let handles_before = decoder.remaining_handles();
18029            if let Some((inlined, num_bytes, num_handles)) =
18030                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18031            {
18032                let member_inline_size = <fidl::encoding::BoundedString<65536> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18033                if inlined != (member_inline_size <= 4) {
18034                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18035                }
18036                let inner_offset;
18037                let mut inner_depth = depth.clone();
18038                if inlined {
18039                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18040                    inner_offset = next_offset;
18041                } else {
18042                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18043                    inner_depth.increment()?;
18044                }
18045                let val_ref = self.url.get_or_insert_with(|| {
18046                    fidl::new_empty!(
18047                        fidl::encoding::BoundedString<65536>,
18048                        fidl::encoding::DefaultFuchsiaResourceDialect
18049                    )
18050                });
18051                fidl::decode!(
18052                    fidl::encoding::BoundedString<65536>,
18053                    fidl::encoding::DefaultFuchsiaResourceDialect,
18054                    val_ref,
18055                    decoder,
18056                    inner_offset,
18057                    inner_depth
18058                )?;
18059                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18060                {
18061                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18062                }
18063                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18064                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18065                }
18066            }
18067
18068            next_offset += envelope_size;
18069            _next_ordinal_to_read += 1;
18070            if next_offset >= end_offset {
18071                return Ok(());
18072            }
18073
18074            // Decode unknown envelopes for gaps in ordinals.
18075            while _next_ordinal_to_read < 2 {
18076                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18077                _next_ordinal_to_read += 1;
18078                next_offset += envelope_size;
18079            }
18080
18081            let next_out_of_line = decoder.next_out_of_line();
18082            let handles_before = decoder.remaining_handles();
18083            if let Some((inlined, num_bytes, num_handles)) =
18084                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18085            {
18086                let member_inline_size =
18087                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
18088                        decoder.context,
18089                    );
18090                if inlined != (member_inline_size <= 4) {
18091                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18092                }
18093                let inner_offset;
18094                let mut inner_depth = depth.clone();
18095                if inlined {
18096                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18097                    inner_offset = next_offset;
18098                } else {
18099                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18100                    inner_depth.increment()?;
18101                }
18102                let val_ref = self.title.get_or_insert_with(|| {
18103                    fidl::new_empty!(
18104                        fidl::encoding::UnboundedString,
18105                        fidl::encoding::DefaultFuchsiaResourceDialect
18106                    )
18107                });
18108                fidl::decode!(
18109                    fidl::encoding::UnboundedString,
18110                    fidl::encoding::DefaultFuchsiaResourceDialect,
18111                    val_ref,
18112                    decoder,
18113                    inner_offset,
18114                    inner_depth
18115                )?;
18116                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18117                {
18118                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18119                }
18120                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18121                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18122                }
18123            }
18124
18125            next_offset += envelope_size;
18126            _next_ordinal_to_read += 1;
18127            if next_offset >= end_offset {
18128                return Ok(());
18129            }
18130
18131            // Decode unknown envelopes for gaps in ordinals.
18132            while _next_ordinal_to_read < 3 {
18133                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18134                _next_ordinal_to_read += 1;
18135                next_offset += envelope_size;
18136            }
18137
18138            let next_out_of_line = decoder.next_out_of_line();
18139            let handles_before = decoder.remaining_handles();
18140            if let Some((inlined, num_bytes, num_handles)) =
18141                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18142            {
18143                let member_inline_size =
18144                    <PageType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18145                if inlined != (member_inline_size <= 4) {
18146                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18147                }
18148                let inner_offset;
18149                let mut inner_depth = depth.clone();
18150                if inlined {
18151                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18152                    inner_offset = next_offset;
18153                } else {
18154                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18155                    inner_depth.increment()?;
18156                }
18157                let val_ref = self.page_type.get_or_insert_with(|| {
18158                    fidl::new_empty!(PageType, fidl::encoding::DefaultFuchsiaResourceDialect)
18159                });
18160                fidl::decode!(
18161                    PageType,
18162                    fidl::encoding::DefaultFuchsiaResourceDialect,
18163                    val_ref,
18164                    decoder,
18165                    inner_offset,
18166                    inner_depth
18167                )?;
18168                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18169                {
18170                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18171                }
18172                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18173                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18174                }
18175            }
18176
18177            next_offset += envelope_size;
18178            _next_ordinal_to_read += 1;
18179            if next_offset >= end_offset {
18180                return Ok(());
18181            }
18182
18183            // Decode unknown envelopes for gaps in ordinals.
18184            while _next_ordinal_to_read < 4 {
18185                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18186                _next_ordinal_to_read += 1;
18187                next_offset += envelope_size;
18188            }
18189
18190            let next_out_of_line = decoder.next_out_of_line();
18191            let handles_before = decoder.remaining_handles();
18192            if let Some((inlined, num_bytes, num_handles)) =
18193                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18194            {
18195                let member_inline_size =
18196                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18197                if inlined != (member_inline_size <= 4) {
18198                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18199                }
18200                let inner_offset;
18201                let mut inner_depth = depth.clone();
18202                if inlined {
18203                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18204                    inner_offset = next_offset;
18205                } else {
18206                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18207                    inner_depth.increment()?;
18208                }
18209                let val_ref = self.can_go_forward.get_or_insert_with(|| {
18210                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
18211                });
18212                fidl::decode!(
18213                    bool,
18214                    fidl::encoding::DefaultFuchsiaResourceDialect,
18215                    val_ref,
18216                    decoder,
18217                    inner_offset,
18218                    inner_depth
18219                )?;
18220                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18221                {
18222                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18223                }
18224                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18225                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18226                }
18227            }
18228
18229            next_offset += envelope_size;
18230            _next_ordinal_to_read += 1;
18231            if next_offset >= end_offset {
18232                return Ok(());
18233            }
18234
18235            // Decode unknown envelopes for gaps in ordinals.
18236            while _next_ordinal_to_read < 5 {
18237                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18238                _next_ordinal_to_read += 1;
18239                next_offset += envelope_size;
18240            }
18241
18242            let next_out_of_line = decoder.next_out_of_line();
18243            let handles_before = decoder.remaining_handles();
18244            if let Some((inlined, num_bytes, num_handles)) =
18245                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18246            {
18247                let member_inline_size =
18248                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18249                if inlined != (member_inline_size <= 4) {
18250                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18251                }
18252                let inner_offset;
18253                let mut inner_depth = depth.clone();
18254                if inlined {
18255                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18256                    inner_offset = next_offset;
18257                } else {
18258                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18259                    inner_depth.increment()?;
18260                }
18261                let val_ref = self.can_go_back.get_or_insert_with(|| {
18262                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
18263                });
18264                fidl::decode!(
18265                    bool,
18266                    fidl::encoding::DefaultFuchsiaResourceDialect,
18267                    val_ref,
18268                    decoder,
18269                    inner_offset,
18270                    inner_depth
18271                )?;
18272                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18273                {
18274                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18275                }
18276                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18277                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18278                }
18279            }
18280
18281            next_offset += envelope_size;
18282            _next_ordinal_to_read += 1;
18283            if next_offset >= end_offset {
18284                return Ok(());
18285            }
18286
18287            // Decode unknown envelopes for gaps in ordinals.
18288            while _next_ordinal_to_read < 6 {
18289                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18290                _next_ordinal_to_read += 1;
18291                next_offset += envelope_size;
18292            }
18293
18294            let next_out_of_line = decoder.next_out_of_line();
18295            let handles_before = decoder.remaining_handles();
18296            if let Some((inlined, num_bytes, num_handles)) =
18297                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18298            {
18299                let member_inline_size =
18300                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18301                if inlined != (member_inline_size <= 4) {
18302                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18303                }
18304                let inner_offset;
18305                let mut inner_depth = depth.clone();
18306                if inlined {
18307                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18308                    inner_offset = next_offset;
18309                } else {
18310                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18311                    inner_depth.increment()?;
18312                }
18313                let val_ref = self.is_main_document_loaded.get_or_insert_with(|| {
18314                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
18315                });
18316                fidl::decode!(
18317                    bool,
18318                    fidl::encoding::DefaultFuchsiaResourceDialect,
18319                    val_ref,
18320                    decoder,
18321                    inner_offset,
18322                    inner_depth
18323                )?;
18324                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18325                {
18326                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18327                }
18328                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18329                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18330                }
18331            }
18332
18333            next_offset += envelope_size;
18334            _next_ordinal_to_read += 1;
18335            if next_offset >= end_offset {
18336                return Ok(());
18337            }
18338
18339            // Decode unknown envelopes for gaps in ordinals.
18340            while _next_ordinal_to_read < 7 {
18341                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18342                _next_ordinal_to_read += 1;
18343                next_offset += envelope_size;
18344            }
18345
18346            let next_out_of_line = decoder.next_out_of_line();
18347            let handles_before = decoder.remaining_handles();
18348            if let Some((inlined, num_bytes, num_handles)) =
18349                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18350            {
18351                let member_inline_size =
18352                    <Favicon as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18353                if inlined != (member_inline_size <= 4) {
18354                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18355                }
18356                let inner_offset;
18357                let mut inner_depth = depth.clone();
18358                if inlined {
18359                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18360                    inner_offset = next_offset;
18361                } else {
18362                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18363                    inner_depth.increment()?;
18364                }
18365                let val_ref = self.favicon.get_or_insert_with(|| {
18366                    fidl::new_empty!(Favicon, fidl::encoding::DefaultFuchsiaResourceDialect)
18367                });
18368                fidl::decode!(
18369                    Favicon,
18370                    fidl::encoding::DefaultFuchsiaResourceDialect,
18371                    val_ref,
18372                    decoder,
18373                    inner_offset,
18374                    inner_depth
18375                )?;
18376                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18377                {
18378                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18379                }
18380                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18381                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18382                }
18383            }
18384
18385            next_offset += envelope_size;
18386            _next_ordinal_to_read += 1;
18387            if next_offset >= end_offset {
18388                return Ok(());
18389            }
18390
18391            // Decode unknown envelopes for gaps in ordinals.
18392            while _next_ordinal_to_read < 8 {
18393                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18394                _next_ordinal_to_read += 1;
18395                next_offset += envelope_size;
18396            }
18397
18398            let next_out_of_line = decoder.next_out_of_line();
18399            let handles_before = decoder.remaining_handles();
18400            if let Some((inlined, num_bytes, num_handles)) =
18401                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18402            {
18403                let member_inline_size =
18404                    <ErrorDetail as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18405                if inlined != (member_inline_size <= 4) {
18406                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18407                }
18408                let inner_offset;
18409                let mut inner_depth = depth.clone();
18410                if inlined {
18411                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18412                    inner_offset = next_offset;
18413                } else {
18414                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18415                    inner_depth.increment()?;
18416                }
18417                let val_ref = self.error_detail.get_or_insert_with(|| {
18418                    fidl::new_empty!(ErrorDetail, fidl::encoding::DefaultFuchsiaResourceDialect)
18419                });
18420                fidl::decode!(
18421                    ErrorDetail,
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
18439            // Decode the remaining unknown envelopes.
18440            while next_offset < end_offset {
18441                _next_ordinal_to_read += 1;
18442                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18443                next_offset += envelope_size;
18444            }
18445
18446            Ok(())
18447        }
18448    }
18449
18450    impl PopupFrameCreationInfo {
18451        #[inline(always)]
18452        fn max_ordinal_present(&self) -> u64 {
18453            if let Some(_) = self.initiated_by_user {
18454                return 2;
18455            }
18456            if let Some(_) = self.initial_url {
18457                return 1;
18458            }
18459            0
18460        }
18461    }
18462
18463    impl fidl::encoding::ResourceTypeMarker for PopupFrameCreationInfo {
18464        type Borrowed<'a> = &'a mut Self;
18465        fn take_or_borrow<'a>(
18466            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18467        ) -> Self::Borrowed<'a> {
18468            value
18469        }
18470    }
18471
18472    unsafe impl fidl::encoding::TypeMarker for PopupFrameCreationInfo {
18473        type Owned = Self;
18474
18475        #[inline(always)]
18476        fn inline_align(_context: fidl::encoding::Context) -> usize {
18477            8
18478        }
18479
18480        #[inline(always)]
18481        fn inline_size(_context: fidl::encoding::Context) -> usize {
18482            16
18483        }
18484    }
18485
18486    unsafe impl
18487        fidl::encoding::Encode<
18488            PopupFrameCreationInfo,
18489            fidl::encoding::DefaultFuchsiaResourceDialect,
18490        > for &mut PopupFrameCreationInfo
18491    {
18492        unsafe fn encode(
18493            self,
18494            encoder: &mut fidl::encoding::Encoder<
18495                '_,
18496                fidl::encoding::DefaultFuchsiaResourceDialect,
18497            >,
18498            offset: usize,
18499            mut depth: fidl::encoding::Depth,
18500        ) -> fidl::Result<()> {
18501            encoder.debug_check_bounds::<PopupFrameCreationInfo>(offset);
18502            // Vector header
18503            let max_ordinal: u64 = self.max_ordinal_present();
18504            encoder.write_num(max_ordinal, offset);
18505            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18506            // Calling encoder.out_of_line_offset(0) is not allowed.
18507            if max_ordinal == 0 {
18508                return Ok(());
18509            }
18510            depth.increment()?;
18511            let envelope_size = 8;
18512            let bytes_len = max_ordinal as usize * envelope_size;
18513            #[allow(unused_variables)]
18514            let offset = encoder.out_of_line_offset(bytes_len);
18515            let mut _prev_end_offset: usize = 0;
18516            if 1 > max_ordinal {
18517                return Ok(());
18518            }
18519
18520            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18521            // are envelope_size bytes.
18522            let cur_offset: usize = (1 - 1) * envelope_size;
18523
18524            // Zero reserved fields.
18525            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18526
18527            // Safety:
18528            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18529            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18530            //   envelope_size bytes, there is always sufficient room.
18531            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65536>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18532            self.initial_url.as_ref().map(<fidl::encoding::BoundedString<65536> as fidl::encoding::ValueTypeMarker>::borrow),
18533            encoder, offset + cur_offset, depth
18534        )?;
18535
18536            _prev_end_offset = cur_offset + envelope_size;
18537            if 2 > max_ordinal {
18538                return Ok(());
18539            }
18540
18541            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18542            // are envelope_size bytes.
18543            let cur_offset: usize = (2 - 1) * envelope_size;
18544
18545            // Zero reserved fields.
18546            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18547
18548            // Safety:
18549            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18550            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18551            //   envelope_size bytes, there is always sufficient room.
18552            fidl::encoding::encode_in_envelope_optional::<
18553                bool,
18554                fidl::encoding::DefaultFuchsiaResourceDialect,
18555            >(
18556                self.initiated_by_user
18557                    .as_ref()
18558                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
18559                encoder,
18560                offset + cur_offset,
18561                depth,
18562            )?;
18563
18564            _prev_end_offset = cur_offset + envelope_size;
18565
18566            Ok(())
18567        }
18568    }
18569
18570    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18571        for PopupFrameCreationInfo
18572    {
18573        #[inline(always)]
18574        fn new_empty() -> Self {
18575            Self::default()
18576        }
18577
18578        unsafe fn decode(
18579            &mut self,
18580            decoder: &mut fidl::encoding::Decoder<
18581                '_,
18582                fidl::encoding::DefaultFuchsiaResourceDialect,
18583            >,
18584            offset: usize,
18585            mut depth: fidl::encoding::Depth,
18586        ) -> fidl::Result<()> {
18587            decoder.debug_check_bounds::<Self>(offset);
18588            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18589                None => return Err(fidl::Error::NotNullable),
18590                Some(len) => len,
18591            };
18592            // Calling decoder.out_of_line_offset(0) is not allowed.
18593            if len == 0 {
18594                return Ok(());
18595            };
18596            depth.increment()?;
18597            let envelope_size = 8;
18598            let bytes_len = len * envelope_size;
18599            let offset = decoder.out_of_line_offset(bytes_len)?;
18600            // Decode the envelope for each type.
18601            let mut _next_ordinal_to_read = 0;
18602            let mut next_offset = offset;
18603            let end_offset = offset + bytes_len;
18604            _next_ordinal_to_read += 1;
18605            if next_offset >= end_offset {
18606                return Ok(());
18607            }
18608
18609            // Decode unknown envelopes for gaps in ordinals.
18610            while _next_ordinal_to_read < 1 {
18611                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18612                _next_ordinal_to_read += 1;
18613                next_offset += envelope_size;
18614            }
18615
18616            let next_out_of_line = decoder.next_out_of_line();
18617            let handles_before = decoder.remaining_handles();
18618            if let Some((inlined, num_bytes, num_handles)) =
18619                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18620            {
18621                let member_inline_size = <fidl::encoding::BoundedString<65536> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18622                if inlined != (member_inline_size <= 4) {
18623                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18624                }
18625                let inner_offset;
18626                let mut inner_depth = depth.clone();
18627                if inlined {
18628                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18629                    inner_offset = next_offset;
18630                } else {
18631                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18632                    inner_depth.increment()?;
18633                }
18634                let val_ref = self.initial_url.get_or_insert_with(|| {
18635                    fidl::new_empty!(
18636                        fidl::encoding::BoundedString<65536>,
18637                        fidl::encoding::DefaultFuchsiaResourceDialect
18638                    )
18639                });
18640                fidl::decode!(
18641                    fidl::encoding::BoundedString<65536>,
18642                    fidl::encoding::DefaultFuchsiaResourceDialect,
18643                    val_ref,
18644                    decoder,
18645                    inner_offset,
18646                    inner_depth
18647                )?;
18648                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18649                {
18650                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18651                }
18652                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18653                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18654                }
18655            }
18656
18657            next_offset += envelope_size;
18658            _next_ordinal_to_read += 1;
18659            if next_offset >= end_offset {
18660                return Ok(());
18661            }
18662
18663            // Decode unknown envelopes for gaps in ordinals.
18664            while _next_ordinal_to_read < 2 {
18665                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18666                _next_ordinal_to_read += 1;
18667                next_offset += envelope_size;
18668            }
18669
18670            let next_out_of_line = decoder.next_out_of_line();
18671            let handles_before = decoder.remaining_handles();
18672            if let Some((inlined, num_bytes, num_handles)) =
18673                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18674            {
18675                let member_inline_size =
18676                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18677                if inlined != (member_inline_size <= 4) {
18678                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18679                }
18680                let inner_offset;
18681                let mut inner_depth = depth.clone();
18682                if inlined {
18683                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18684                    inner_offset = next_offset;
18685                } else {
18686                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18687                    inner_depth.increment()?;
18688                }
18689                let val_ref = self.initiated_by_user.get_or_insert_with(|| {
18690                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
18691                });
18692                fidl::decode!(
18693                    bool,
18694                    fidl::encoding::DefaultFuchsiaResourceDialect,
18695                    val_ref,
18696                    decoder,
18697                    inner_offset,
18698                    inner_depth
18699                )?;
18700                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18701                {
18702                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18703                }
18704                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18705                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18706                }
18707            }
18708
18709            next_offset += envelope_size;
18710
18711            // Decode the remaining unknown envelopes.
18712            while next_offset < end_offset {
18713                _next_ordinal_to_read += 1;
18714                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18715                next_offset += envelope_size;
18716            }
18717
18718            Ok(())
18719        }
18720    }
18721
18722    impl WebMessage {
18723        #[inline(always)]
18724        fn max_ordinal_present(&self) -> u64 {
18725            if let Some(_) = self.outgoing_transfer {
18726                return 3;
18727            }
18728            if let Some(_) = self.incoming_transfer {
18729                return 2;
18730            }
18731            if let Some(_) = self.data {
18732                return 1;
18733            }
18734            0
18735        }
18736    }
18737
18738    impl fidl::encoding::ResourceTypeMarker for WebMessage {
18739        type Borrowed<'a> = &'a mut Self;
18740        fn take_or_borrow<'a>(
18741            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18742        ) -> Self::Borrowed<'a> {
18743            value
18744        }
18745    }
18746
18747    unsafe impl fidl::encoding::TypeMarker for WebMessage {
18748        type Owned = Self;
18749
18750        #[inline(always)]
18751        fn inline_align(_context: fidl::encoding::Context) -> usize {
18752            8
18753        }
18754
18755        #[inline(always)]
18756        fn inline_size(_context: fidl::encoding::Context) -> usize {
18757            16
18758        }
18759    }
18760
18761    unsafe impl fidl::encoding::Encode<WebMessage, fidl::encoding::DefaultFuchsiaResourceDialect>
18762        for &mut WebMessage
18763    {
18764        unsafe fn encode(
18765            self,
18766            encoder: &mut fidl::encoding::Encoder<
18767                '_,
18768                fidl::encoding::DefaultFuchsiaResourceDialect,
18769            >,
18770            offset: usize,
18771            mut depth: fidl::encoding::Depth,
18772        ) -> fidl::Result<()> {
18773            encoder.debug_check_bounds::<WebMessage>(offset);
18774            // Vector header
18775            let max_ordinal: u64 = self.max_ordinal_present();
18776            encoder.write_num(max_ordinal, offset);
18777            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18778            // Calling encoder.out_of_line_offset(0) is not allowed.
18779            if max_ordinal == 0 {
18780                return Ok(());
18781            }
18782            depth.increment()?;
18783            let envelope_size = 8;
18784            let bytes_len = max_ordinal as usize * envelope_size;
18785            #[allow(unused_variables)]
18786            let offset = encoder.out_of_line_offset(bytes_len);
18787            let mut _prev_end_offset: usize = 0;
18788            if 1 > max_ordinal {
18789                return Ok(());
18790            }
18791
18792            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18793            // are envelope_size bytes.
18794            let cur_offset: usize = (1 - 1) * envelope_size;
18795
18796            // Zero reserved fields.
18797            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18798
18799            // Safety:
18800            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18801            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18802            //   envelope_size bytes, there is always sufficient room.
18803            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
18804            self.data.as_mut().map(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18805            encoder, offset + cur_offset, depth
18806        )?;
18807
18808            _prev_end_offset = cur_offset + envelope_size;
18809            if 2 > max_ordinal {
18810                return Ok(());
18811            }
18812
18813            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18814            // are envelope_size bytes.
18815            let cur_offset: usize = (2 - 1) * envelope_size;
18816
18817            // Zero reserved fields.
18818            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18819
18820            // Safety:
18821            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18822            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18823            //   envelope_size bytes, there is always sufficient room.
18824            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<IncomingTransferable>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18825            self.incoming_transfer.as_mut().map(<fidl::encoding::UnboundedVector<IncomingTransferable> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18826            encoder, offset + cur_offset, depth
18827        )?;
18828
18829            _prev_end_offset = cur_offset + envelope_size;
18830            if 3 > max_ordinal {
18831                return Ok(());
18832            }
18833
18834            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18835            // are envelope_size bytes.
18836            let cur_offset: usize = (3 - 1) * envelope_size;
18837
18838            // Zero reserved fields.
18839            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18840
18841            // Safety:
18842            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18843            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18844            //   envelope_size bytes, there is always sufficient room.
18845            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<OutgoingTransferable>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18846            self.outgoing_transfer.as_mut().map(<fidl::encoding::UnboundedVector<OutgoingTransferable> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18847            encoder, offset + cur_offset, depth
18848        )?;
18849
18850            _prev_end_offset = cur_offset + envelope_size;
18851
18852            Ok(())
18853        }
18854    }
18855
18856    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for WebMessage {
18857        #[inline(always)]
18858        fn new_empty() -> Self {
18859            Self::default()
18860        }
18861
18862        unsafe fn decode(
18863            &mut self,
18864            decoder: &mut fidl::encoding::Decoder<
18865                '_,
18866                fidl::encoding::DefaultFuchsiaResourceDialect,
18867            >,
18868            offset: usize,
18869            mut depth: fidl::encoding::Depth,
18870        ) -> fidl::Result<()> {
18871            decoder.debug_check_bounds::<Self>(offset);
18872            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18873                None => return Err(fidl::Error::NotNullable),
18874                Some(len) => len,
18875            };
18876            // Calling decoder.out_of_line_offset(0) is not allowed.
18877            if len == 0 {
18878                return Ok(());
18879            };
18880            depth.increment()?;
18881            let envelope_size = 8;
18882            let bytes_len = len * envelope_size;
18883            let offset = decoder.out_of_line_offset(bytes_len)?;
18884            // Decode the envelope for each type.
18885            let mut _next_ordinal_to_read = 0;
18886            let mut next_offset = offset;
18887            let end_offset = offset + bytes_len;
18888            _next_ordinal_to_read += 1;
18889            if next_offset >= end_offset {
18890                return Ok(());
18891            }
18892
18893            // Decode unknown envelopes for gaps in ordinals.
18894            while _next_ordinal_to_read < 1 {
18895                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18896                _next_ordinal_to_read += 1;
18897                next_offset += envelope_size;
18898            }
18899
18900            let next_out_of_line = decoder.next_out_of_line();
18901            let handles_before = decoder.remaining_handles();
18902            if let Some((inlined, num_bytes, num_handles)) =
18903                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18904            {
18905                let member_inline_size =
18906                    <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
18907                        decoder.context,
18908                    );
18909                if inlined != (member_inline_size <= 4) {
18910                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18911                }
18912                let inner_offset;
18913                let mut inner_depth = depth.clone();
18914                if inlined {
18915                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18916                    inner_offset = next_offset;
18917                } else {
18918                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18919                    inner_depth.increment()?;
18920                }
18921                let val_ref = self.data.get_or_insert_with(|| {
18922                    fidl::new_empty!(
18923                        fidl_fuchsia_mem::Buffer,
18924                        fidl::encoding::DefaultFuchsiaResourceDialect
18925                    )
18926                });
18927                fidl::decode!(
18928                    fidl_fuchsia_mem::Buffer,
18929                    fidl::encoding::DefaultFuchsiaResourceDialect,
18930                    val_ref,
18931                    decoder,
18932                    inner_offset,
18933                    inner_depth
18934                )?;
18935                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18936                {
18937                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18938                }
18939                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18940                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18941                }
18942            }
18943
18944            next_offset += envelope_size;
18945            _next_ordinal_to_read += 1;
18946            if next_offset >= end_offset {
18947                return Ok(());
18948            }
18949
18950            // Decode unknown envelopes for gaps in ordinals.
18951            while _next_ordinal_to_read < 2 {
18952                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18953                _next_ordinal_to_read += 1;
18954                next_offset += envelope_size;
18955            }
18956
18957            let next_out_of_line = decoder.next_out_of_line();
18958            let handles_before = decoder.remaining_handles();
18959            if let Some((inlined, num_bytes, num_handles)) =
18960                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18961            {
18962                let member_inline_size = <fidl::encoding::UnboundedVector<IncomingTransferable> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18963                if inlined != (member_inline_size <= 4) {
18964                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18965                }
18966                let inner_offset;
18967                let mut inner_depth = depth.clone();
18968                if inlined {
18969                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18970                    inner_offset = next_offset;
18971                } else {
18972                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18973                    inner_depth.increment()?;
18974                }
18975                let val_ref = self.incoming_transfer.get_or_insert_with(|| {
18976                    fidl::new_empty!(
18977                        fidl::encoding::UnboundedVector<IncomingTransferable>,
18978                        fidl::encoding::DefaultFuchsiaResourceDialect
18979                    )
18980                });
18981                fidl::decode!(
18982                    fidl::encoding::UnboundedVector<IncomingTransferable>,
18983                    fidl::encoding::DefaultFuchsiaResourceDialect,
18984                    val_ref,
18985                    decoder,
18986                    inner_offset,
18987                    inner_depth
18988                )?;
18989                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18990                {
18991                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18992                }
18993                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18994                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18995                }
18996            }
18997
18998            next_offset += envelope_size;
18999            _next_ordinal_to_read += 1;
19000            if next_offset >= end_offset {
19001                return Ok(());
19002            }
19003
19004            // Decode unknown envelopes for gaps in ordinals.
19005            while _next_ordinal_to_read < 3 {
19006                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19007                _next_ordinal_to_read += 1;
19008                next_offset += envelope_size;
19009            }
19010
19011            let next_out_of_line = decoder.next_out_of_line();
19012            let handles_before = decoder.remaining_handles();
19013            if let Some((inlined, num_bytes, num_handles)) =
19014                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19015            {
19016                let member_inline_size = <fidl::encoding::UnboundedVector<OutgoingTransferable> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19017                if inlined != (member_inline_size <= 4) {
19018                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19019                }
19020                let inner_offset;
19021                let mut inner_depth = depth.clone();
19022                if inlined {
19023                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19024                    inner_offset = next_offset;
19025                } else {
19026                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19027                    inner_depth.increment()?;
19028                }
19029                let val_ref = self.outgoing_transfer.get_or_insert_with(|| {
19030                    fidl::new_empty!(
19031                        fidl::encoding::UnboundedVector<OutgoingTransferable>,
19032                        fidl::encoding::DefaultFuchsiaResourceDialect
19033                    )
19034                });
19035                fidl::decode!(
19036                    fidl::encoding::UnboundedVector<OutgoingTransferable>,
19037                    fidl::encoding::DefaultFuchsiaResourceDialect,
19038                    val_ref,
19039                    decoder,
19040                    inner_offset,
19041                    inner_depth
19042                )?;
19043                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19044                {
19045                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19046                }
19047                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19048                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19049                }
19050            }
19051
19052            next_offset += envelope_size;
19053
19054            // Decode the remaining unknown envelopes.
19055            while next_offset < end_offset {
19056                _next_ordinal_to_read += 1;
19057                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19058                next_offset += envelope_size;
19059            }
19060
19061            Ok(())
19062        }
19063    }
19064
19065    impl fidl::encoding::ResourceTypeMarker for IncomingTransferable {
19066        type Borrowed<'a> = &'a mut Self;
19067        fn take_or_borrow<'a>(
19068            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19069        ) -> Self::Borrowed<'a> {
19070            value
19071        }
19072    }
19073
19074    unsafe impl fidl::encoding::TypeMarker for IncomingTransferable {
19075        type Owned = Self;
19076
19077        #[inline(always)]
19078        fn inline_align(_context: fidl::encoding::Context) -> usize {
19079            8
19080        }
19081
19082        #[inline(always)]
19083        fn inline_size(_context: fidl::encoding::Context) -> usize {
19084            16
19085        }
19086    }
19087
19088    unsafe impl
19089        fidl::encoding::Encode<IncomingTransferable, fidl::encoding::DefaultFuchsiaResourceDialect>
19090        for &mut IncomingTransferable
19091    {
19092        #[inline]
19093        unsafe fn encode(
19094            self,
19095            encoder: &mut fidl::encoding::Encoder<
19096                '_,
19097                fidl::encoding::DefaultFuchsiaResourceDialect,
19098            >,
19099            offset: usize,
19100            _depth: fidl::encoding::Depth,
19101        ) -> fidl::Result<()> {
19102            encoder.debug_check_bounds::<IncomingTransferable>(offset);
19103            encoder.write_num::<u64>(self.ordinal(), offset);
19104            match self {
19105            IncomingTransferable::MessagePort(ref mut val) => {
19106                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
19107                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
19108                    encoder, offset + 8, _depth
19109                )
19110            }
19111            IncomingTransferable::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
19112        }
19113        }
19114    }
19115
19116    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19117        for IncomingTransferable
19118    {
19119        #[inline(always)]
19120        fn new_empty() -> Self {
19121            Self::__SourceBreaking { unknown_ordinal: 0 }
19122        }
19123
19124        #[inline]
19125        unsafe fn decode(
19126            &mut self,
19127            decoder: &mut fidl::encoding::Decoder<
19128                '_,
19129                fidl::encoding::DefaultFuchsiaResourceDialect,
19130            >,
19131            offset: usize,
19132            mut depth: fidl::encoding::Depth,
19133        ) -> fidl::Result<()> {
19134            decoder.debug_check_bounds::<Self>(offset);
19135            #[allow(unused_variables)]
19136            let next_out_of_line = decoder.next_out_of_line();
19137            let handles_before = decoder.remaining_handles();
19138            let (ordinal, inlined, num_bytes, num_handles) =
19139                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19140
19141            let member_inline_size = match ordinal {
19142            1 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19143            0 => return Err(fidl::Error::UnknownUnionTag),
19144            _ => num_bytes as usize,
19145        };
19146
19147            if inlined != (member_inline_size <= 4) {
19148                return Err(fidl::Error::InvalidInlineBitInEnvelope);
19149            }
19150            let _inner_offset;
19151            if inlined {
19152                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19153                _inner_offset = offset + 8;
19154            } else {
19155                depth.increment()?;
19156                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19157            }
19158            match ordinal {
19159                1 => {
19160                    #[allow(irrefutable_let_patterns)]
19161                    if let IncomingTransferable::MessagePort(_) = self {
19162                        // Do nothing, read the value into the object
19163                    } else {
19164                        // Initialize `self` to the right variant
19165                        *self = IncomingTransferable::MessagePort(fidl::new_empty!(
19166                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>>,
19167                            fidl::encoding::DefaultFuchsiaResourceDialect
19168                        ));
19169                    }
19170                    #[allow(irrefutable_let_patterns)]
19171                    if let IncomingTransferable::MessagePort(ref mut val) = self {
19172                        fidl::decode!(
19173                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MessagePortMarker>>,
19174                            fidl::encoding::DefaultFuchsiaResourceDialect,
19175                            val,
19176                            decoder,
19177                            _inner_offset,
19178                            depth
19179                        )?;
19180                    } else {
19181                        unreachable!()
19182                    }
19183                }
19184                #[allow(deprecated)]
19185                ordinal => {
19186                    for _ in 0..num_handles {
19187                        decoder.drop_next_handle()?;
19188                    }
19189                    *self = IncomingTransferable::__SourceBreaking { unknown_ordinal: ordinal };
19190                }
19191            }
19192            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19193                return Err(fidl::Error::InvalidNumBytesInEnvelope);
19194            }
19195            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19196                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19197            }
19198            Ok(())
19199        }
19200    }
19201
19202    impl fidl::encoding::ResourceTypeMarker for NavigationDecision {
19203        type Borrowed<'a> = &'a mut Self;
19204        fn take_or_borrow<'a>(
19205            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19206        ) -> Self::Borrowed<'a> {
19207            value
19208        }
19209    }
19210
19211    unsafe impl fidl::encoding::TypeMarker for NavigationDecision {
19212        type Owned = Self;
19213
19214        #[inline(always)]
19215        fn inline_align(_context: fidl::encoding::Context) -> usize {
19216            8
19217        }
19218
19219        #[inline(always)]
19220        fn inline_size(_context: fidl::encoding::Context) -> usize {
19221            16
19222        }
19223    }
19224
19225    unsafe impl
19226        fidl::encoding::Encode<NavigationDecision, fidl::encoding::DefaultFuchsiaResourceDialect>
19227        for &mut NavigationDecision
19228    {
19229        #[inline]
19230        unsafe fn encode(
19231            self,
19232            encoder: &mut fidl::encoding::Encoder<
19233                '_,
19234                fidl::encoding::DefaultFuchsiaResourceDialect,
19235            >,
19236            offset: usize,
19237            _depth: fidl::encoding::Depth,
19238        ) -> fidl::Result<()> {
19239            encoder.debug_check_bounds::<NavigationDecision>(offset);
19240            encoder.write_num::<u64>(self.ordinal(), offset);
19241            match self {
19242                NavigationDecision::Proceed(ref val) => fidl::encoding::encode_in_envelope::<
19243                    NoArgumentsAction,
19244                    fidl::encoding::DefaultFuchsiaResourceDialect,
19245                >(
19246                    <NoArgumentsAction as fidl::encoding::ValueTypeMarker>::borrow(val),
19247                    encoder,
19248                    offset + 8,
19249                    _depth,
19250                ),
19251                NavigationDecision::Abort(ref val) => fidl::encoding::encode_in_envelope::<
19252                    NoArgumentsAction,
19253                    fidl::encoding::DefaultFuchsiaResourceDialect,
19254                >(
19255                    <NoArgumentsAction as fidl::encoding::ValueTypeMarker>::borrow(val),
19256                    encoder,
19257                    offset + 8,
19258                    _depth,
19259                ),
19260            }
19261        }
19262    }
19263
19264    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19265        for NavigationDecision
19266    {
19267        #[inline(always)]
19268        fn new_empty() -> Self {
19269            Self::Proceed(fidl::new_empty!(
19270                NoArgumentsAction,
19271                fidl::encoding::DefaultFuchsiaResourceDialect
19272            ))
19273        }
19274
19275        #[inline]
19276        unsafe fn decode(
19277            &mut self,
19278            decoder: &mut fidl::encoding::Decoder<
19279                '_,
19280                fidl::encoding::DefaultFuchsiaResourceDialect,
19281            >,
19282            offset: usize,
19283            mut depth: fidl::encoding::Depth,
19284        ) -> fidl::Result<()> {
19285            decoder.debug_check_bounds::<Self>(offset);
19286            #[allow(unused_variables)]
19287            let next_out_of_line = decoder.next_out_of_line();
19288            let handles_before = decoder.remaining_handles();
19289            let (ordinal, inlined, num_bytes, num_handles) =
19290                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19291
19292            let member_inline_size = match ordinal {
19293                1 => {
19294                    <NoArgumentsAction as fidl::encoding::TypeMarker>::inline_size(decoder.context)
19295                }
19296                2 => {
19297                    <NoArgumentsAction as fidl::encoding::TypeMarker>::inline_size(decoder.context)
19298                }
19299                _ => return Err(fidl::Error::UnknownUnionTag),
19300            };
19301
19302            if inlined != (member_inline_size <= 4) {
19303                return Err(fidl::Error::InvalidInlineBitInEnvelope);
19304            }
19305            let _inner_offset;
19306            if inlined {
19307                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19308                _inner_offset = offset + 8;
19309            } else {
19310                depth.increment()?;
19311                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19312            }
19313            match ordinal {
19314                1 => {
19315                    #[allow(irrefutable_let_patterns)]
19316                    if let NavigationDecision::Proceed(_) = self {
19317                        // Do nothing, read the value into the object
19318                    } else {
19319                        // Initialize `self` to the right variant
19320                        *self = NavigationDecision::Proceed(fidl::new_empty!(
19321                            NoArgumentsAction,
19322                            fidl::encoding::DefaultFuchsiaResourceDialect
19323                        ));
19324                    }
19325                    #[allow(irrefutable_let_patterns)]
19326                    if let NavigationDecision::Proceed(ref mut val) = self {
19327                        fidl::decode!(
19328                            NoArgumentsAction,
19329                            fidl::encoding::DefaultFuchsiaResourceDialect,
19330                            val,
19331                            decoder,
19332                            _inner_offset,
19333                            depth
19334                        )?;
19335                    } else {
19336                        unreachable!()
19337                    }
19338                }
19339                2 => {
19340                    #[allow(irrefutable_let_patterns)]
19341                    if let NavigationDecision::Abort(_) = self {
19342                        // Do nothing, read the value into the object
19343                    } else {
19344                        // Initialize `self` to the right variant
19345                        *self = NavigationDecision::Abort(fidl::new_empty!(
19346                            NoArgumentsAction,
19347                            fidl::encoding::DefaultFuchsiaResourceDialect
19348                        ));
19349                    }
19350                    #[allow(irrefutable_let_patterns)]
19351                    if let NavigationDecision::Abort(ref mut val) = self {
19352                        fidl::decode!(
19353                            NoArgumentsAction,
19354                            fidl::encoding::DefaultFuchsiaResourceDialect,
19355                            val,
19356                            decoder,
19357                            _inner_offset,
19358                            depth
19359                        )?;
19360                    } else {
19361                        unreachable!()
19362                    }
19363                }
19364                ordinal => panic!("unexpected ordinal {:?}", ordinal),
19365            }
19366            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19367                return Err(fidl::Error::InvalidNumBytesInEnvelope);
19368            }
19369            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19370                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19371            }
19372            Ok(())
19373        }
19374    }
19375
19376    impl fidl::encoding::ResourceTypeMarker for OutgoingTransferable {
19377        type Borrowed<'a> = &'a mut Self;
19378        fn take_or_borrow<'a>(
19379            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19380        ) -> Self::Borrowed<'a> {
19381            value
19382        }
19383    }
19384
19385    unsafe impl fidl::encoding::TypeMarker for OutgoingTransferable {
19386        type Owned = Self;
19387
19388        #[inline(always)]
19389        fn inline_align(_context: fidl::encoding::Context) -> usize {
19390            8
19391        }
19392
19393        #[inline(always)]
19394        fn inline_size(_context: fidl::encoding::Context) -> usize {
19395            16
19396        }
19397    }
19398
19399    unsafe impl
19400        fidl::encoding::Encode<OutgoingTransferable, fidl::encoding::DefaultFuchsiaResourceDialect>
19401        for &mut OutgoingTransferable
19402    {
19403        #[inline]
19404        unsafe fn encode(
19405            self,
19406            encoder: &mut fidl::encoding::Encoder<
19407                '_,
19408                fidl::encoding::DefaultFuchsiaResourceDialect,
19409            >,
19410            offset: usize,
19411            _depth: fidl::encoding::Depth,
19412        ) -> fidl::Result<()> {
19413            encoder.debug_check_bounds::<OutgoingTransferable>(offset);
19414            encoder.write_num::<u64>(self.ordinal(), offset);
19415            match self {
19416            OutgoingTransferable::MessagePort(ref mut val) => {
19417                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
19418                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
19419                    encoder, offset + 8, _depth
19420                )
19421            }
19422            OutgoingTransferable::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
19423        }
19424        }
19425    }
19426
19427    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19428        for OutgoingTransferable
19429    {
19430        #[inline(always)]
19431        fn new_empty() -> Self {
19432            Self::__SourceBreaking { unknown_ordinal: 0 }
19433        }
19434
19435        #[inline]
19436        unsafe fn decode(
19437            &mut self,
19438            decoder: &mut fidl::encoding::Decoder<
19439                '_,
19440                fidl::encoding::DefaultFuchsiaResourceDialect,
19441            >,
19442            offset: usize,
19443            mut depth: fidl::encoding::Depth,
19444        ) -> fidl::Result<()> {
19445            decoder.debug_check_bounds::<Self>(offset);
19446            #[allow(unused_variables)]
19447            let next_out_of_line = decoder.next_out_of_line();
19448            let handles_before = decoder.remaining_handles();
19449            let (ordinal, inlined, num_bytes, num_handles) =
19450                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19451
19452            let member_inline_size = match ordinal {
19453            1 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19454            0 => return Err(fidl::Error::UnknownUnionTag),
19455            _ => num_bytes as usize,
19456        };
19457
19458            if inlined != (member_inline_size <= 4) {
19459                return Err(fidl::Error::InvalidInlineBitInEnvelope);
19460            }
19461            let _inner_offset;
19462            if inlined {
19463                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19464                _inner_offset = offset + 8;
19465            } else {
19466                depth.increment()?;
19467                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19468            }
19469            match ordinal {
19470                1 => {
19471                    #[allow(irrefutable_let_patterns)]
19472                    if let OutgoingTransferable::MessagePort(_) = self {
19473                        // Do nothing, read the value into the object
19474                    } else {
19475                        // Initialize `self` to the right variant
19476                        *self = OutgoingTransferable::MessagePort(fidl::new_empty!(
19477                            fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>>,
19478                            fidl::encoding::DefaultFuchsiaResourceDialect
19479                        ));
19480                    }
19481                    #[allow(irrefutable_let_patterns)]
19482                    if let OutgoingTransferable::MessagePort(ref mut val) = self {
19483                        fidl::decode!(
19484                            fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MessagePortMarker>>,
19485                            fidl::encoding::DefaultFuchsiaResourceDialect,
19486                            val,
19487                            decoder,
19488                            _inner_offset,
19489                            depth
19490                        )?;
19491                    } else {
19492                        unreachable!()
19493                    }
19494                }
19495                #[allow(deprecated)]
19496                ordinal => {
19497                    for _ in 0..num_handles {
19498                        decoder.drop_next_handle()?;
19499                    }
19500                    *self = OutgoingTransferable::__SourceBreaking { unknown_ordinal: ordinal };
19501                }
19502            }
19503            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19504                return Err(fidl::Error::InvalidNumBytesInEnvelope);
19505            }
19506            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19507                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19508            }
19509            Ok(())
19510        }
19511    }
19512}