fidl_fuchsia_hardware_display/
fidl_fuchsia_hardware_display.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_hardware_display__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct CoordinatorImportBufferCollectionRequest {
16    pub buffer_collection_id: BufferCollectionId,
17    pub buffer_collection_token:
18        fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
19}
20
21impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
22    for CoordinatorImportBufferCollectionRequest
23{
24}
25
26#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27pub struct CoordinatorImportEventRequest {
28    pub event: fidl::Event,
29    pub id: EventId,
30}
31
32impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
33    for CoordinatorImportEventRequest
34{
35}
36
37#[derive(Debug, Default, PartialEq)]
38pub struct CoordinatorApplyConfig3Request {
39    /// Required. Must be valid and strictly monotonically-increasing.
40    pub stamp: Option<ConfigStamp>,
41    #[doc(hidden)]
42    pub __source_breaking: fidl::marker::SourceBreaking,
43}
44
45impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
46    for CoordinatorApplyConfig3Request
47{
48}
49
50#[derive(Debug, Default, PartialEq)]
51pub struct ProviderOpenCoordinatorWithListenerForPrimaryRequest {
52    /// Required.
53    pub coordinator: Option<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
54    /// Required.
55    pub coordinator_listener: Option<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
56    #[doc(hidden)]
57    pub __source_breaking: fidl::marker::SourceBreaking,
58}
59
60impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
61    for ProviderOpenCoordinatorWithListenerForPrimaryRequest
62{
63}
64
65#[derive(Debug, Default, PartialEq)]
66pub struct ProviderOpenCoordinatorWithListenerForVirtconRequest {
67    /// Required.
68    pub coordinator: Option<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
69    /// Required.
70    pub coordinator_listener: Option<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
71    #[doc(hidden)]
72    pub __source_breaking: fidl::marker::SourceBreaking,
73}
74
75impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
76    for ProviderOpenCoordinatorWithListenerForVirtconRequest
77{
78}
79
80#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
81pub struct CoordinatorMarker;
82
83impl fidl::endpoints::ProtocolMarker for CoordinatorMarker {
84    type Proxy = CoordinatorProxy;
85    type RequestStream = CoordinatorRequestStream;
86    #[cfg(target_os = "fuchsia")]
87    type SynchronousProxy = CoordinatorSynchronousProxy;
88
89    const DEBUG_NAME: &'static str = "(anonymous) Coordinator";
90}
91pub type CoordinatorImportImageResult = Result<(), i32>;
92pub type CoordinatorCreateLayerResult = Result<LayerId, i32>;
93pub type CoordinatorImportBufferCollectionResult = Result<(), i32>;
94pub type CoordinatorSetBufferCollectionConstraintsResult = Result<(), i32>;
95pub type CoordinatorIsCaptureSupportedResult = Result<bool, i32>;
96pub type CoordinatorStartCaptureResult = Result<(), i32>;
97pub type CoordinatorSetMinimumRgbResult = Result<(), i32>;
98pub type CoordinatorSetDisplayPowerResult = Result<(), i32>;
99
100pub trait CoordinatorProxyInterface: Send + Sync {
101    type ImportImageResponseFut: std::future::Future<Output = Result<CoordinatorImportImageResult, fidl::Error>>
102        + Send;
103    fn r#import_image(
104        &self,
105        image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
106        buffer_collection_id: &BufferCollectionId,
107        buffer_index: u32,
108        image_id: &ImageId,
109    ) -> Self::ImportImageResponseFut;
110    fn r#release_image(&self, image_id: &ImageId) -> Result<(), fidl::Error>;
111    fn r#import_event(&self, event: fidl::Event, id: &EventId) -> Result<(), fidl::Error>;
112    fn r#release_event(&self, id: &EventId) -> Result<(), fidl::Error>;
113    type CreateLayerResponseFut: std::future::Future<Output = Result<CoordinatorCreateLayerResult, fidl::Error>>
114        + Send;
115    fn r#create_layer(&self) -> Self::CreateLayerResponseFut;
116    fn r#destroy_layer(&self, layer_id: &LayerId) -> Result<(), fidl::Error>;
117    fn r#set_display_mode(
118        &self,
119        display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
120        mode: &fidl_fuchsia_hardware_display_types::Mode,
121    ) -> Result<(), fidl::Error>;
122    fn r#set_display_color_conversion(
123        &self,
124        display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
125        preoffsets: &[f32; 3],
126        coefficients: &[f32; 9],
127        postoffsets: &[f32; 3],
128    ) -> Result<(), fidl::Error>;
129    fn r#set_display_layers(
130        &self,
131        display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
132        layer_ids: &[LayerId],
133    ) -> Result<(), fidl::Error>;
134    fn r#set_layer_primary_config(
135        &self,
136        layer_id: &LayerId,
137        image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
138    ) -> Result<(), fidl::Error>;
139    fn r#set_layer_primary_position(
140        &self,
141        layer_id: &LayerId,
142        image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
143        image_source: &fidl_fuchsia_math::RectU,
144        display_destination: &fidl_fuchsia_math::RectU,
145    ) -> Result<(), fidl::Error>;
146    fn r#set_layer_primary_alpha(
147        &self,
148        layer_id: &LayerId,
149        mode: fidl_fuchsia_hardware_display_types::AlphaMode,
150        val: f32,
151    ) -> Result<(), fidl::Error>;
152    fn r#set_layer_color_config(
153        &self,
154        layer_id: &LayerId,
155        color: &fidl_fuchsia_hardware_display_types::Color,
156        display_destination: &fidl_fuchsia_math::RectU,
157    ) -> Result<(), fidl::Error>;
158    fn r#set_layer_image2(
159        &self,
160        layer_id: &LayerId,
161        image_id: &ImageId,
162        wait_event_id: &EventId,
163    ) -> Result<(), fidl::Error>;
164    type CheckConfigResponseFut: std::future::Future<
165            Output = Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error>,
166        > + Send;
167    fn r#check_config(&self) -> Self::CheckConfigResponseFut;
168    fn r#discard_config(&self) -> Result<(), fidl::Error>;
169    type GetLatestAppliedConfigStampResponseFut: std::future::Future<Output = Result<ConfigStamp, fidl::Error>>
170        + Send;
171    fn r#get_latest_applied_config_stamp(&self) -> Self::GetLatestAppliedConfigStampResponseFut;
172    fn r#apply_config3(&self, payload: CoordinatorApplyConfig3Request) -> Result<(), fidl::Error>;
173    fn r#acknowledge_vsync(&self, cookie: u64) -> Result<(), fidl::Error>;
174    fn r#set_virtcon_mode(&self, mode: VirtconMode) -> Result<(), fidl::Error>;
175    type ImportBufferCollectionResponseFut: std::future::Future<Output = Result<CoordinatorImportBufferCollectionResult, fidl::Error>>
176        + Send;
177    fn r#import_buffer_collection(
178        &self,
179        buffer_collection_id: &BufferCollectionId,
180        buffer_collection_token: fidl::endpoints::ClientEnd<
181            fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
182        >,
183    ) -> Self::ImportBufferCollectionResponseFut;
184    fn r#release_buffer_collection(
185        &self,
186        buffer_collection_id: &BufferCollectionId,
187    ) -> Result<(), fidl::Error>;
188    type SetBufferCollectionConstraintsResponseFut: std::future::Future<
189            Output = Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error>,
190        > + Send;
191    fn r#set_buffer_collection_constraints(
192        &self,
193        buffer_collection_id: &BufferCollectionId,
194        buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
195    ) -> Self::SetBufferCollectionConstraintsResponseFut;
196    type IsCaptureSupportedResponseFut: std::future::Future<Output = Result<CoordinatorIsCaptureSupportedResult, fidl::Error>>
197        + Send;
198    fn r#is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut;
199    type StartCaptureResponseFut: std::future::Future<Output = Result<CoordinatorStartCaptureResult, fidl::Error>>
200        + Send;
201    fn r#start_capture(
202        &self,
203        signal_event_id: &EventId,
204        image_id: &ImageId,
205    ) -> Self::StartCaptureResponseFut;
206    type SetMinimumRgbResponseFut: std::future::Future<Output = Result<CoordinatorSetMinimumRgbResult, fidl::Error>>
207        + Send;
208    fn r#set_minimum_rgb(&self, minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut;
209    type SetDisplayPowerResponseFut: std::future::Future<Output = Result<CoordinatorSetDisplayPowerResult, fidl::Error>>
210        + Send;
211    fn r#set_display_power(
212        &self,
213        display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
214        power_on: bool,
215    ) -> Self::SetDisplayPowerResponseFut;
216}
217#[derive(Debug)]
218#[cfg(target_os = "fuchsia")]
219pub struct CoordinatorSynchronousProxy {
220    client: fidl::client::sync::Client,
221}
222
223#[cfg(target_os = "fuchsia")]
224impl fidl::endpoints::SynchronousProxy for CoordinatorSynchronousProxy {
225    type Proxy = CoordinatorProxy;
226    type Protocol = CoordinatorMarker;
227
228    fn from_channel(inner: fidl::Channel) -> Self {
229        Self::new(inner)
230    }
231
232    fn into_channel(self) -> fidl::Channel {
233        self.client.into_channel()
234    }
235
236    fn as_channel(&self) -> &fidl::Channel {
237        self.client.as_channel()
238    }
239}
240
241#[cfg(target_os = "fuchsia")]
242impl CoordinatorSynchronousProxy {
243    pub fn new(channel: fidl::Channel) -> Self {
244        let protocol_name = <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
245        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
246    }
247
248    pub fn into_channel(self) -> fidl::Channel {
249        self.client.into_channel()
250    }
251
252    /// Waits until an event arrives and returns it. It is safe for other
253    /// threads to make concurrent requests while waiting for an event.
254    pub fn wait_for_event(
255        &self,
256        deadline: zx::MonotonicInstant,
257    ) -> Result<CoordinatorEvent, fidl::Error> {
258        CoordinatorEvent::decode(self.client.wait_for_event(deadline)?)
259    }
260
261    /// Imports a Buffer-Collection backed image.
262    ///
263    /// Returns `ZX_ERR_NOT_SUPPORTED` if the display hardware doesn't support
264    /// `image_metadata`.
265    /// Returns `ZX_ERR_ALREADY_EXISTS` if `image_id` was used in a successful
266    /// `ImportImage()` without a corresponding `ReleaseImage()`.
267    /// Returns `ZX_ERR_NO_MEMORY` if memory cannot be allocated for managing the image
268    /// Additionally, this method delegates internally to `fuchsia.hardware.display.engine/Engine`,
269    /// and will forward errors received from `ImportImage()` and `ImportImageForCapture()`.
270    pub fn r#import_image(
271        &self,
272        mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
273        mut buffer_collection_id: &BufferCollectionId,
274        mut buffer_index: u32,
275        mut image_id: &ImageId,
276        ___deadline: zx::MonotonicInstant,
277    ) -> Result<CoordinatorImportImageResult, fidl::Error> {
278        let _response = self.client.send_query::<
279            CoordinatorImportImageRequest,
280            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
281        >(
282            (image_metadata, buffer_collection_id, buffer_index, image_id,),
283            0x3a8636eb9656b4f4,
284            fidl::encoding::DynamicFlags::empty(),
285            ___deadline,
286        )?;
287        Ok(_response.map(|x| x))
288    }
289
290    /// Releases an imported image.
291    ///
292    /// `image_id` must be already imported by
293    /// [`fuchsia.hardware.display/Coordinator.ImportImage`].
294    ///
295    /// The image must not be the capture target of an ongoing capture specified
296    /// in [`fuchsia.hardware.display/Coordinator.StartCapture`].
297    ///
298    /// When an image is released, it is immediately removed from any draft
299    /// or active configurations, and any fences associated with the image are
300    /// dropped. The resources associated with the image will be released as
301    /// soon as the image is no longer in use.
302    pub fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
303        self.client.send::<CoordinatorReleaseImageRequest>(
304            (image_id,),
305            0x477192230517504,
306            fidl::encoding::DynamicFlags::empty(),
307        )
308    }
309
310    /// Imports an event into the driver and associates it with the given id.
311    ///
312    /// It is illegal for id to be equal to INVALID_DISP_ID, and it is undefined to
313    /// import one event with two different ids or to import two different events
314    /// with the same id (note that ids map well to koids).
315    ///
316    /// If a client is reusing events, they must clear the signal
317    /// before referencing the id again.
318    pub fn r#import_event(
319        &self,
320        mut event: fidl::Event,
321        mut id: &EventId,
322    ) -> Result<(), fidl::Error> {
323        self.client.send::<CoordinatorImportEventRequest>(
324            (event, id),
325            0x2864e5dc59390543,
326            fidl::encoding::DynamicFlags::empty(),
327        )
328    }
329
330    /// Releases the event imported with the given id.
331    ///
332    /// If any images are currently using the given event, the event
333    /// will still be waited up or signaled as appropriate before its
334    /// resources are released. It is an error to reuse an ID while the
335    /// active config has references to it.
336    pub fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
337        self.client.send::<CoordinatorReleaseEventRequest>(
338            (id,),
339            0x32508c2101606b87,
340            fidl::encoding::DynamicFlags::empty(),
341        )
342    }
343
344    /// Creates a new layer.
345    ///
346    /// Layers are not associated with a particular display, but they can only be
347    /// shown on at most one display at any given time.  A layer is considered in
348    /// use from the time it is passed to SetDisplayLayers until a subsequent
349    /// configuration is applied which does not include the layer or until its
350    /// display is removed.
351    pub fn r#create_layer(
352        &self,
353        ___deadline: zx::MonotonicInstant,
354    ) -> Result<CoordinatorCreateLayerResult, fidl::Error> {
355        let _response = self.client.send_query::<
356            fidl::encoding::EmptyPayload,
357            fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>,
358        >(
359            (),
360            0x2137cfd788a3496b,
361            fidl::encoding::DynamicFlags::empty(),
362            ___deadline,
363        )?;
364        Ok(_response.map(|x| x.layer_id))
365    }
366
367    /// Destroys the given layer.
368    ///
369    /// It is illegal to destroy a layer which does not exist or which is in use.
370    pub fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
371        self.client.send::<CoordinatorDestroyLayerRequest>(
372            (layer_id,),
373            0x386e12d092bea2f8,
374            fidl::encoding::DynamicFlags::empty(),
375        )
376    }
377
378    /// Sets the mode for a display.
379    pub fn r#set_display_mode(
380        &self,
381        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
382        mut mode: &fidl_fuchsia_hardware_display_types::Mode,
383    ) -> Result<(), fidl::Error> {
384        self.client.send::<CoordinatorSetDisplayModeRequest>(
385            (display_id, mode),
386            0xbde3c59ee9c1777,
387            fidl::encoding::DynamicFlags::empty(),
388        )
389    }
390
391    /// Set the color conversion applied to the display. The conversion is applied to
392    /// to each pixel according to the formula:
393    ///
394    /// (coefficients * (pixel + preoffsets)) + postoffsets
395    ///
396    /// where pixel is a column vector consisting of the pixel's 3 components.
397    ///
398    /// `coefficients` is passed in row-major order. If the first entry of an array is NaN, the
399    /// array is treated as the identity element for the relevant operation.
400    /// Hardware that support color correction generally accept a limited range of coefficient
401    /// values. Coefficients in the range of [-2, 2] inclusive will be accepted by most
402    /// hardware. The hardware driver will clamp values that are outside its acceptable range.
403    ///
404    /// `preoffsets`, `postoffsets`: Clients are encourged to produce color correction values that
405    /// do not depend on pre and post offsets since some hardware do not have support for that.
406    /// For cases where pre and post offset values need to be used, the range should be limited to
407    /// (-1, 1) exclusive as confirmed by CheckConfig API. Values outside this range will be
408    /// rejected.
409    ///
410    /// Clients are encouraged to use the CheckConfig API to confirm support for correction and to
411    /// validate their color correction input values.
412    ///
413    /// This a stateful call. Once color conversion values have been succesfully applied via a call
414    /// to ApplyConfig() they will remain in place until changed and another ApplyConfig() call is
415    /// successful. If SetDisplayColorConversion() is called and then the config is discarded, then
416    /// the last successfully applied state is restored.
417    pub fn r#set_display_color_conversion(
418        &self,
419        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
420        mut preoffsets: &[f32; 3],
421        mut coefficients: &[f32; 9],
422        mut postoffsets: &[f32; 3],
423    ) -> Result<(), fidl::Error> {
424        self.client.send::<CoordinatorSetDisplayColorConversionRequest>(
425            (display_id, preoffsets, coefficients, postoffsets),
426            0x2f18186a987d51aa,
427            fidl::encoding::DynamicFlags::empty(),
428        )
429    }
430
431    /// Assigns a list of layers to be composited on a display.
432    pub fn r#set_display_layers(
433        &self,
434        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
435        mut layer_ids: &[LayerId],
436    ) -> Result<(), fidl::Error> {
437        self.client.send::<CoordinatorSetDisplayLayersRequest>(
438            (display_id, layer_ids),
439            0x190e0f6f93be1d89,
440            fidl::encoding::DynamicFlags::empty(),
441        )
442    }
443
444    /// Configures the layer as a primary layer with no image and the default
445    /// config (no src_frame cropping, the identity transform, positioned in the
446    /// top-left corner of the composed output, and no scaling).
447    ///
448    /// See the documentation on SetLayerImage for details on how this method
449    /// affects the layer's contents.
450    ///
451    /// It is illegal to pass an invalid layer id.
452    pub fn r#set_layer_primary_config(
453        &self,
454        mut layer_id: &LayerId,
455        mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
456    ) -> Result<(), fidl::Error> {
457        self.client.send::<CoordinatorSetLayerPrimaryConfigRequest>(
458            (layer_id, image_metadata),
459            0x68d89ebd518b45b9,
460            fidl::encoding::DynamicFlags::empty(),
461        )
462    }
463
464    /// Sets the layer transform, scaling, and positioning.
465    ///
466    /// CheckConfig() will return INVALID_CONFIG if any of the configuration
467    /// validity conditions specified here is violated.
468    ///
469    /// Calling this on a non-primary layer or passing an invalid transform is
470    /// illegal.
471    pub fn r#set_layer_primary_position(
472        &self,
473        mut layer_id: &LayerId,
474        mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
475        mut image_source: &fidl_fuchsia_math::RectU,
476        mut display_destination: &fidl_fuchsia_math::RectU,
477    ) -> Result<(), fidl::Error> {
478        self.client.send::<CoordinatorSetLayerPrimaryPositionRequest>(
479            (layer_id, image_source_transformation, image_source, display_destination),
480            0x27b192b5a43851e2,
481            fidl::encoding::DynamicFlags::empty(),
482        )
483    }
484
485    /// Sets the alpha mode of the plane.
486    ///
487    /// If `mode` == DISABLED, the layer is opaque and `val` is ignored.
488    ///
489    /// If `mode` == PREMULTIPLIED or HW_MULTIPLY and `val` is NaN, the alpha
490    /// used when blending is determined by the per-pixel alpha channel.
491    ///
492    /// If `mode` == PREMULTIPLIED or HW_MULTIPLY and `val` is not NaN, the
493    /// alpha used when blending is the product of `val` and any per-pixel
494    /// alpha. Additionally, if `mode` == PREMULTIPLIED, then the hardware
495    /// premultiplies the color channel with `val` before blending.
496    ///
497    /// It is illegal to call this on a non-primary layer, to pass an
498    /// invalid mode, or to pass a value of `val` which is not NaN or
499    /// in the range [0, 1].
500    pub fn r#set_layer_primary_alpha(
501        &self,
502        mut layer_id: &LayerId,
503        mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
504        mut val: f32,
505    ) -> Result<(), fidl::Error> {
506        self.client.send::<CoordinatorSetLayerPrimaryAlphaRequest>(
507            (layer_id, mode, val),
508            0x104cf2b18b27296d,
509            fidl::encoding::DynamicFlags::empty(),
510        )
511    }
512
513    /// Configures the layer as a solid color fill layer.
514    ///
515    /// It is illegal to call this on an invalid layer.
516    pub fn r#set_layer_color_config(
517        &self,
518        mut layer_id: &LayerId,
519        mut color: &fidl_fuchsia_hardware_display_types::Color,
520        mut display_destination: &fidl_fuchsia_math::RectU,
521    ) -> Result<(), fidl::Error> {
522        self.client.send::<CoordinatorSetLayerColorConfigRequest>(
523            (layer_id, color, display_destination),
524            0x2fa91e9a2a01875f,
525            fidl::encoding::DynamicFlags::empty(),
526        )
527    }
528
529    /// Sets the image for the layer's draft configuration.
530    ///
531    /// If wait_event_id corresponds to an imported event, the driver will
532    /// wait for ZX_EVENT_SIGNALED on the object before presenting the image.
533    ///
534    /// A layer's applied image is the most recently applied image which either has
535    /// no wait event or whose wait event has been signaled. Whenever a new image
536    /// is applied, any older images which never got applied are dropped, and
537    /// their signal events will be fired as soon as their wait events are
538    /// signaled. The driver also does not have any concept like 'target vsync',
539    /// meaning that if multiple images are applied within one vsync period, then
540    /// only the last image will actually be displayed.
541    ///
542    /// By default, the driver retains an applied image until a new image is
543    /// applied. However, setting a layer's ImageConfig with SetLayerPrimaryConfig
544    /// resets the layer's applied and waiting images, even if the new ImageConfig
545    /// matches the old ImageConfig.
546    ///
547    /// An image cannot be used for multiple layers simultaneously, nor can an
548    /// image be given back to the display coordinator while it is still in use.
549    /// An image is considered in use when it is part of a draft configuration
550    /// or from when its configuration is applied until it is replaced by a
551    /// subsequent configuration that is *displayed* (not merely applied).
552    ///
553    /// It is illegal to call this with an invalid layer or image id, to
554    /// call it on a color layer, or to call it with an image and layer whose
555    /// ImageConfigs do not match. It is illegal to apply a configuration
556    /// with an image layer that has no image (note that is is not illegal to
557    /// validate such a configuration). It is illegal to reuse a wait event which
558    /// another layer that has not been presented is waiting on.
559    ///
560    /// Each layer can track a maximum of `MAX_WAITING_IMAGES_PER_LAYER` waiting images.
561    /// An image becomes "waiting" when it is the most recent image set to a layer that appears in
562    /// a config that is applied via `ApplyConfig()` or similar.  To avoid exceeding the maximum,
563    /// the client can infer that the image is no longer waiting by:
564    ///   - noting the config stamp when the config containing the layer/image is applied
565    ///   - watching for that same (or later) config stamp to be returned by
566    ///     `CoordinatorListener.OnVsync()`.
567    pub fn r#set_layer_image2(
568        &self,
569        mut layer_id: &LayerId,
570        mut image_id: &ImageId,
571        mut wait_event_id: &EventId,
572    ) -> Result<(), fidl::Error> {
573        self.client.send::<CoordinatorSetLayerImage2Request>(
574            (layer_id, image_id, wait_event_id),
575            0x53c6376dfc13a971,
576            fidl::encoding::DynamicFlags::empty(),
577        )
578    }
579
580    /// Validates the draft configuration.
581    ///
582    /// Validation entails checking that the draft configuration can be used
583    /// by the system's display hardware.
584    ///
585    /// Most SetX operations require verifying the draft configuration. The
586    /// following operations do not require revalidation.
587    /// * SetLayerImage2()
588    pub fn r#check_config(
589        &self,
590        ___deadline: zx::MonotonicInstant,
591    ) -> Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error> {
592        let _response = self
593            .client
594            .send_query::<fidl::encoding::EmptyPayload, CoordinatorCheckConfigResponse>(
595                (),
596                0x2bcfb4eb16878158,
597                fidl::encoding::DynamicFlags::empty(),
598                ___deadline,
599            )?;
600        Ok(_response.res)
601    }
602
603    /// Discard all draft configuration changes.
604    pub fn r#discard_config(&self) -> Result<(), fidl::Error> {
605        self.client.send::<fidl::encoding::EmptyPayload>(
606            (),
607            0x1673399e9231dedf,
608            fidl::encoding::DynamicFlags::empty(),
609        )
610    }
611
612    /// Gets the stamp provided with the latest configuration the client
613    /// submitted (by calling ApplyConfig()) and the display core driver
614    /// accepted; the display configuration may not have been rendered yet
615    /// because of pending image availability or draft layer changes.
616    /// If no configuration was applied before, returns `INVALID_CONFIG_STAMP_VALUE`.
617    pub fn r#get_latest_applied_config_stamp(
618        &self,
619        ___deadline: zx::MonotonicInstant,
620    ) -> Result<ConfigStamp, fidl::Error> {
621        let _response = self.client.send_query::<
622            fidl::encoding::EmptyPayload,
623            CoordinatorGetLatestAppliedConfigStampResponse,
624        >(
625            (),
626            0x76a50c0537265f65,
627            fidl::encoding::DynamicFlags::empty(),
628            ___deadline,
629        )?;
630        Ok(_response.stamp)
631    }
632
633    /// Applies any draft changes to the current configuration. This will
634    /// not apply draft changes to layers which are not on any display.
635    ///
636    /// If the draft configuration cannot be applied, this call will silently
637    /// fail, so the client should ensure its configuration is valid by
638    /// calling [`Coordinator.CheckConfig`].
639    pub fn r#apply_config3(
640        &self,
641        mut payload: CoordinatorApplyConfig3Request,
642    ) -> Result<(), fidl::Error> {
643        self.client.send::<CoordinatorApplyConfig3Request>(
644            &mut payload,
645            0x7f0fe0e4f062a67e,
646            fidl::encoding::DynamicFlags::empty(),
647        )
648    }
649
650    /// Acknowledges the receipt of one `OnVsync` message.
651    pub fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
652        self.client.send::<CoordinatorAcknowledgeVsyncRequest>(
653            (cookie,),
654            0x25e921d26107d6ef,
655            fidl::encoding::DynamicFlags::empty(),
656        )
657    }
658
659    /// Sets the visibility behavior of the virtcon.
660    ///
661    /// This must only be called from the Virtcon client.
662    pub fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
663        self.client.send::<CoordinatorSetVirtconModeRequest>(
664            (mode,),
665            0x4fe0721526068f00,
666            fidl::encoding::DynamicFlags::empty(),
667        )
668    }
669
670    /// Import a sysmem buffer collection token. `buffer_collection_id` must not
671    /// already be in use.
672    pub fn r#import_buffer_collection(
673        &self,
674        mut buffer_collection_id: &BufferCollectionId,
675        mut buffer_collection_token: fidl::endpoints::ClientEnd<
676            fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
677        >,
678        ___deadline: zx::MonotonicInstant,
679    ) -> Result<CoordinatorImportBufferCollectionResult, fidl::Error> {
680        let _response = self.client.send_query::<
681            CoordinatorImportBufferCollectionRequest,
682            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
683        >(
684            (buffer_collection_id, buffer_collection_token,),
685            0x30d06f510e7f4601,
686            fidl::encoding::DynamicFlags::empty(),
687            ___deadline,
688        )?;
689        Ok(_response.map(|x| x))
690    }
691
692    /// Release an imported buffer collection.
693    pub fn r#release_buffer_collection(
694        &self,
695        mut buffer_collection_id: &BufferCollectionId,
696    ) -> Result<(), fidl::Error> {
697        self.client.send::<CoordinatorReleaseBufferCollectionRequest>(
698            (buffer_collection_id,),
699            0x1c7dd5f8b0690be0,
700            fidl::encoding::DynamicFlags::empty(),
701        )
702    }
703
704    /// Takes an imported buffer collection and sets the constraints
705    /// on it so that it can be imported with a specific config.
706    pub fn r#set_buffer_collection_constraints(
707        &self,
708        mut buffer_collection_id: &BufferCollectionId,
709        mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
710        ___deadline: zx::MonotonicInstant,
711    ) -> Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error> {
712        let _response = self.client.send_query::<
713            CoordinatorSetBufferCollectionConstraintsRequest,
714            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
715        >(
716            (buffer_collection_id, buffer_usage,),
717            0x509a4ee9af6035df,
718            fidl::encoding::DynamicFlags::empty(),
719            ___deadline,
720        )?;
721        Ok(_response.map(|x| x))
722    }
723
724    /// Returns true if Capture is supported on the platform.
725    pub fn r#is_capture_supported(
726        &self,
727        ___deadline: zx::MonotonicInstant,
728    ) -> Result<CoordinatorIsCaptureSupportedResult, fidl::Error> {
729        let _response = self.client.send_query::<
730            fidl::encoding::EmptyPayload,
731            fidl::encoding::ResultType<CoordinatorIsCaptureSupportedResponse, i32>,
732        >(
733            (),
734            0x4ca407277277971b,
735            fidl::encoding::DynamicFlags::empty(),
736            ___deadline,
737        )?;
738        Ok(_response.map(|x| x.supported))
739    }
740
741    /// Starts capture. Client must provide a valid signal_event_id and
742    /// image_id. signal_event_id must have been imported into the driver
743    /// using ImportEvent FIDL API. Image_id is the id from ImportImageForCapture.
744    /// The client will get notified once capture is complete via signal_event_id.
745    /// Returns ZX_ERR_NOT_SUPPORTED if coordinator does not support capture
746    pub fn r#start_capture(
747        &self,
748        mut signal_event_id: &EventId,
749        mut image_id: &ImageId,
750        ___deadline: zx::MonotonicInstant,
751    ) -> Result<CoordinatorStartCaptureResult, fidl::Error> {
752        let _response = self.client.send_query::<
753            CoordinatorStartCaptureRequest,
754            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
755        >(
756            (signal_event_id, image_id,),
757            0x35cb38f19d96a8db,
758            fidl::encoding::DynamicFlags::empty(),
759            ___deadline,
760        )?;
761        Ok(_response.map(|x| x))
762    }
763
764    /// Set the minimum value of rgb channels. Valid range [0 255] inclusive. Returns
765    /// ZX_ERR_NOT_SUPPORTED when the display hardware does not support this feature.
766    /// This API is meant to address backlight bleeding that may occur on some hardware
767    /// that have a specific type of panel and hardware assembly. The evolution of this
768    /// API is highly hardware and product dependant and therefore as products evolve, this
769    /// API may change or support for this API may become non-existent. Therefore, this
770    /// API should be used with caution.
771    ///
772    /// Unlike other calls in this API, SetMiniumRgb is applied immediately, and does not
773    /// wait for ApplyConfig(). It is, however, still stateful.
774    pub fn r#set_minimum_rgb(
775        &self,
776        mut minimum_rgb: u8,
777        ___deadline: zx::MonotonicInstant,
778    ) -> Result<CoordinatorSetMinimumRgbResult, fidl::Error> {
779        let _response = self.client.send_query::<
780            CoordinatorSetMinimumRgbRequest,
781            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
782        >(
783            (minimum_rgb,),
784            0x1b49251437038b0b,
785            fidl::encoding::DynamicFlags::empty(),
786            ___deadline,
787        )?;
788        Ok(_response.map(|x| x))
789    }
790
791    /// Power off/on the display panel.
792    ///
793    /// This call takes effect immediately. Clients don't need to call
794    /// [`Coordinator.ApplyConfig`].
795    ///
796    /// Fails with ZX_ERR_NOT_FOUND if `display_id` does not belong to a display
797    /// known by the Coordinator. This can happen if a client issues a call to
798    /// [`Coordinator.SetDisplayPower`] before it receives a notification that
799    /// the display was removed.
800    ///
801    /// Fails with ZX_ERR_NOT_SUPPORTED if the display drivers or the hardware
802    /// don't support displays on and off.
803    pub fn r#set_display_power(
804        &self,
805        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
806        mut power_on: bool,
807        ___deadline: zx::MonotonicInstant,
808    ) -> Result<CoordinatorSetDisplayPowerResult, fidl::Error> {
809        let _response = self.client.send_query::<
810            CoordinatorSetDisplayPowerRequest,
811            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
812        >(
813            (display_id, power_on,),
814            0x10feb62d11d9e92b,
815            fidl::encoding::DynamicFlags::empty(),
816            ___deadline,
817        )?;
818        Ok(_response.map(|x| x))
819    }
820}
821
822#[cfg(target_os = "fuchsia")]
823impl From<CoordinatorSynchronousProxy> for zx::Handle {
824    fn from(value: CoordinatorSynchronousProxy) -> Self {
825        value.into_channel().into()
826    }
827}
828
829#[cfg(target_os = "fuchsia")]
830impl From<fidl::Channel> for CoordinatorSynchronousProxy {
831    fn from(value: fidl::Channel) -> Self {
832        Self::new(value)
833    }
834}
835
836#[cfg(target_os = "fuchsia")]
837impl fidl::endpoints::FromClient for CoordinatorSynchronousProxy {
838    type Protocol = CoordinatorMarker;
839
840    fn from_client(value: fidl::endpoints::ClientEnd<CoordinatorMarker>) -> Self {
841        Self::new(value.into_channel())
842    }
843}
844
845#[derive(Debug, Clone)]
846pub struct CoordinatorProxy {
847    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
848}
849
850impl fidl::endpoints::Proxy for CoordinatorProxy {
851    type Protocol = CoordinatorMarker;
852
853    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
854        Self::new(inner)
855    }
856
857    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
858        self.client.into_channel().map_err(|client| Self { client })
859    }
860
861    fn as_channel(&self) -> &::fidl::AsyncChannel {
862        self.client.as_channel()
863    }
864}
865
866impl CoordinatorProxy {
867    /// Create a new Proxy for fuchsia.hardware.display/Coordinator.
868    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
869        let protocol_name = <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
870        Self { client: fidl::client::Client::new(channel, protocol_name) }
871    }
872
873    /// Get a Stream of events from the remote end of the protocol.
874    ///
875    /// # Panics
876    ///
877    /// Panics if the event stream was already taken.
878    pub fn take_event_stream(&self) -> CoordinatorEventStream {
879        CoordinatorEventStream { event_receiver: self.client.take_event_receiver() }
880    }
881
882    /// Imports a Buffer-Collection backed image.
883    ///
884    /// Returns `ZX_ERR_NOT_SUPPORTED` if the display hardware doesn't support
885    /// `image_metadata`.
886    /// Returns `ZX_ERR_ALREADY_EXISTS` if `image_id` was used in a successful
887    /// `ImportImage()` without a corresponding `ReleaseImage()`.
888    /// Returns `ZX_ERR_NO_MEMORY` if memory cannot be allocated for managing the image
889    /// Additionally, this method delegates internally to `fuchsia.hardware.display.engine/Engine`,
890    /// and will forward errors received from `ImportImage()` and `ImportImageForCapture()`.
891    pub fn r#import_image(
892        &self,
893        mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
894        mut buffer_collection_id: &BufferCollectionId,
895        mut buffer_index: u32,
896        mut image_id: &ImageId,
897    ) -> fidl::client::QueryResponseFut<
898        CoordinatorImportImageResult,
899        fidl::encoding::DefaultFuchsiaResourceDialect,
900    > {
901        CoordinatorProxyInterface::r#import_image(
902            self,
903            image_metadata,
904            buffer_collection_id,
905            buffer_index,
906            image_id,
907        )
908    }
909
910    /// Releases an imported image.
911    ///
912    /// `image_id` must be already imported by
913    /// [`fuchsia.hardware.display/Coordinator.ImportImage`].
914    ///
915    /// The image must not be the capture target of an ongoing capture specified
916    /// in [`fuchsia.hardware.display/Coordinator.StartCapture`].
917    ///
918    /// When an image is released, it is immediately removed from any draft
919    /// or active configurations, and any fences associated with the image are
920    /// dropped. The resources associated with the image will be released as
921    /// soon as the image is no longer in use.
922    pub fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
923        CoordinatorProxyInterface::r#release_image(self, image_id)
924    }
925
926    /// Imports an event into the driver and associates it with the given id.
927    ///
928    /// It is illegal for id to be equal to INVALID_DISP_ID, and it is undefined to
929    /// import one event with two different ids or to import two different events
930    /// with the same id (note that ids map well to koids).
931    ///
932    /// If a client is reusing events, they must clear the signal
933    /// before referencing the id again.
934    pub fn r#import_event(
935        &self,
936        mut event: fidl::Event,
937        mut id: &EventId,
938    ) -> Result<(), fidl::Error> {
939        CoordinatorProxyInterface::r#import_event(self, event, id)
940    }
941
942    /// Releases the event imported with the given id.
943    ///
944    /// If any images are currently using the given event, the event
945    /// will still be waited up or signaled as appropriate before its
946    /// resources are released. It is an error to reuse an ID while the
947    /// active config has references to it.
948    pub fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
949        CoordinatorProxyInterface::r#release_event(self, id)
950    }
951
952    /// Creates a new layer.
953    ///
954    /// Layers are not associated with a particular display, but they can only be
955    /// shown on at most one display at any given time.  A layer is considered in
956    /// use from the time it is passed to SetDisplayLayers until a subsequent
957    /// configuration is applied which does not include the layer or until its
958    /// display is removed.
959    pub fn r#create_layer(
960        &self,
961    ) -> fidl::client::QueryResponseFut<
962        CoordinatorCreateLayerResult,
963        fidl::encoding::DefaultFuchsiaResourceDialect,
964    > {
965        CoordinatorProxyInterface::r#create_layer(self)
966    }
967
968    /// Destroys the given layer.
969    ///
970    /// It is illegal to destroy a layer which does not exist or which is in use.
971    pub fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
972        CoordinatorProxyInterface::r#destroy_layer(self, layer_id)
973    }
974
975    /// Sets the mode for a display.
976    pub fn r#set_display_mode(
977        &self,
978        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
979        mut mode: &fidl_fuchsia_hardware_display_types::Mode,
980    ) -> Result<(), fidl::Error> {
981        CoordinatorProxyInterface::r#set_display_mode(self, display_id, mode)
982    }
983
984    /// Set the color conversion applied to the display. The conversion is applied to
985    /// to each pixel according to the formula:
986    ///
987    /// (coefficients * (pixel + preoffsets)) + postoffsets
988    ///
989    /// where pixel is a column vector consisting of the pixel's 3 components.
990    ///
991    /// `coefficients` is passed in row-major order. If the first entry of an array is NaN, the
992    /// array is treated as the identity element for the relevant operation.
993    /// Hardware that support color correction generally accept a limited range of coefficient
994    /// values. Coefficients in the range of [-2, 2] inclusive will be accepted by most
995    /// hardware. The hardware driver will clamp values that are outside its acceptable range.
996    ///
997    /// `preoffsets`, `postoffsets`: Clients are encourged to produce color correction values that
998    /// do not depend on pre and post offsets since some hardware do not have support for that.
999    /// For cases where pre and post offset values need to be used, the range should be limited to
1000    /// (-1, 1) exclusive as confirmed by CheckConfig API. Values outside this range will be
1001    /// rejected.
1002    ///
1003    /// Clients are encouraged to use the CheckConfig API to confirm support for correction and to
1004    /// validate their color correction input values.
1005    ///
1006    /// This a stateful call. Once color conversion values have been succesfully applied via a call
1007    /// to ApplyConfig() they will remain in place until changed and another ApplyConfig() call is
1008    /// successful. If SetDisplayColorConversion() is called and then the config is discarded, then
1009    /// the last successfully applied state is restored.
1010    pub fn r#set_display_color_conversion(
1011        &self,
1012        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1013        mut preoffsets: &[f32; 3],
1014        mut coefficients: &[f32; 9],
1015        mut postoffsets: &[f32; 3],
1016    ) -> Result<(), fidl::Error> {
1017        CoordinatorProxyInterface::r#set_display_color_conversion(
1018            self,
1019            display_id,
1020            preoffsets,
1021            coefficients,
1022            postoffsets,
1023        )
1024    }
1025
1026    /// Assigns a list of layers to be composited on a display.
1027    pub fn r#set_display_layers(
1028        &self,
1029        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1030        mut layer_ids: &[LayerId],
1031    ) -> Result<(), fidl::Error> {
1032        CoordinatorProxyInterface::r#set_display_layers(self, display_id, layer_ids)
1033    }
1034
1035    /// Configures the layer as a primary layer with no image and the default
1036    /// config (no src_frame cropping, the identity transform, positioned in the
1037    /// top-left corner of the composed output, and no scaling).
1038    ///
1039    /// See the documentation on SetLayerImage for details on how this method
1040    /// affects the layer's contents.
1041    ///
1042    /// It is illegal to pass an invalid layer id.
1043    pub fn r#set_layer_primary_config(
1044        &self,
1045        mut layer_id: &LayerId,
1046        mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1047    ) -> Result<(), fidl::Error> {
1048        CoordinatorProxyInterface::r#set_layer_primary_config(self, layer_id, image_metadata)
1049    }
1050
1051    /// Sets the layer transform, scaling, and positioning.
1052    ///
1053    /// CheckConfig() will return INVALID_CONFIG if any of the configuration
1054    /// validity conditions specified here is violated.
1055    ///
1056    /// Calling this on a non-primary layer or passing an invalid transform is
1057    /// illegal.
1058    pub fn r#set_layer_primary_position(
1059        &self,
1060        mut layer_id: &LayerId,
1061        mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
1062        mut image_source: &fidl_fuchsia_math::RectU,
1063        mut display_destination: &fidl_fuchsia_math::RectU,
1064    ) -> Result<(), fidl::Error> {
1065        CoordinatorProxyInterface::r#set_layer_primary_position(
1066            self,
1067            layer_id,
1068            image_source_transformation,
1069            image_source,
1070            display_destination,
1071        )
1072    }
1073
1074    /// Sets the alpha mode of the plane.
1075    ///
1076    /// If `mode` == DISABLED, the layer is opaque and `val` is ignored.
1077    ///
1078    /// If `mode` == PREMULTIPLIED or HW_MULTIPLY and `val` is NaN, the alpha
1079    /// used when blending is determined by the per-pixel alpha channel.
1080    ///
1081    /// If `mode` == PREMULTIPLIED or HW_MULTIPLY and `val` is not NaN, the
1082    /// alpha used when blending is the product of `val` and any per-pixel
1083    /// alpha. Additionally, if `mode` == PREMULTIPLIED, then the hardware
1084    /// premultiplies the color channel with `val` before blending.
1085    ///
1086    /// It is illegal to call this on a non-primary layer, to pass an
1087    /// invalid mode, or to pass a value of `val` which is not NaN or
1088    /// in the range [0, 1].
1089    pub fn r#set_layer_primary_alpha(
1090        &self,
1091        mut layer_id: &LayerId,
1092        mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
1093        mut val: f32,
1094    ) -> Result<(), fidl::Error> {
1095        CoordinatorProxyInterface::r#set_layer_primary_alpha(self, layer_id, mode, val)
1096    }
1097
1098    /// Configures the layer as a solid color fill layer.
1099    ///
1100    /// It is illegal to call this on an invalid layer.
1101    pub fn r#set_layer_color_config(
1102        &self,
1103        mut layer_id: &LayerId,
1104        mut color: &fidl_fuchsia_hardware_display_types::Color,
1105        mut display_destination: &fidl_fuchsia_math::RectU,
1106    ) -> Result<(), fidl::Error> {
1107        CoordinatorProxyInterface::r#set_layer_color_config(
1108            self,
1109            layer_id,
1110            color,
1111            display_destination,
1112        )
1113    }
1114
1115    /// Sets the image for the layer's draft configuration.
1116    ///
1117    /// If wait_event_id corresponds to an imported event, the driver will
1118    /// wait for ZX_EVENT_SIGNALED on the object before presenting the image.
1119    ///
1120    /// A layer's applied image is the most recently applied image which either has
1121    /// no wait event or whose wait event has been signaled. Whenever a new image
1122    /// is applied, any older images which never got applied are dropped, and
1123    /// their signal events will be fired as soon as their wait events are
1124    /// signaled. The driver also does not have any concept like 'target vsync',
1125    /// meaning that if multiple images are applied within one vsync period, then
1126    /// only the last image will actually be displayed.
1127    ///
1128    /// By default, the driver retains an applied image until a new image is
1129    /// applied. However, setting a layer's ImageConfig with SetLayerPrimaryConfig
1130    /// resets the layer's applied and waiting images, even if the new ImageConfig
1131    /// matches the old ImageConfig.
1132    ///
1133    /// An image cannot be used for multiple layers simultaneously, nor can an
1134    /// image be given back to the display coordinator while it is still in use.
1135    /// An image is considered in use when it is part of a draft configuration
1136    /// or from when its configuration is applied until it is replaced by a
1137    /// subsequent configuration that is *displayed* (not merely applied).
1138    ///
1139    /// It is illegal to call this with an invalid layer or image id, to
1140    /// call it on a color layer, or to call it with an image and layer whose
1141    /// ImageConfigs do not match. It is illegal to apply a configuration
1142    /// with an image layer that has no image (note that is is not illegal to
1143    /// validate such a configuration). It is illegal to reuse a wait event which
1144    /// another layer that has not been presented is waiting on.
1145    ///
1146    /// Each layer can track a maximum of `MAX_WAITING_IMAGES_PER_LAYER` waiting images.
1147    /// An image becomes "waiting" when it is the most recent image set to a layer that appears in
1148    /// a config that is applied via `ApplyConfig()` or similar.  To avoid exceeding the maximum,
1149    /// the client can infer that the image is no longer waiting by:
1150    ///   - noting the config stamp when the config containing the layer/image is applied
1151    ///   - watching for that same (or later) config stamp to be returned by
1152    ///     `CoordinatorListener.OnVsync()`.
1153    pub fn r#set_layer_image2(
1154        &self,
1155        mut layer_id: &LayerId,
1156        mut image_id: &ImageId,
1157        mut wait_event_id: &EventId,
1158    ) -> Result<(), fidl::Error> {
1159        CoordinatorProxyInterface::r#set_layer_image2(self, layer_id, image_id, wait_event_id)
1160    }
1161
1162    /// Validates the draft configuration.
1163    ///
1164    /// Validation entails checking that the draft configuration can be used
1165    /// by the system's display hardware.
1166    ///
1167    /// Most SetX operations require verifying the draft configuration. The
1168    /// following operations do not require revalidation.
1169    /// * SetLayerImage2()
1170    pub fn r#check_config(
1171        &self,
1172    ) -> fidl::client::QueryResponseFut<
1173        fidl_fuchsia_hardware_display_types::ConfigResult,
1174        fidl::encoding::DefaultFuchsiaResourceDialect,
1175    > {
1176        CoordinatorProxyInterface::r#check_config(self)
1177    }
1178
1179    /// Discard all draft configuration changes.
1180    pub fn r#discard_config(&self) -> Result<(), fidl::Error> {
1181        CoordinatorProxyInterface::r#discard_config(self)
1182    }
1183
1184    /// Gets the stamp provided with the latest configuration the client
1185    /// submitted (by calling ApplyConfig()) and the display core driver
1186    /// accepted; the display configuration may not have been rendered yet
1187    /// because of pending image availability or draft layer changes.
1188    /// If no configuration was applied before, returns `INVALID_CONFIG_STAMP_VALUE`.
1189    pub fn r#get_latest_applied_config_stamp(
1190        &self,
1191    ) -> fidl::client::QueryResponseFut<ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect>
1192    {
1193        CoordinatorProxyInterface::r#get_latest_applied_config_stamp(self)
1194    }
1195
1196    /// Applies any draft changes to the current configuration. This will
1197    /// not apply draft changes to layers which are not on any display.
1198    ///
1199    /// If the draft configuration cannot be applied, this call will silently
1200    /// fail, so the client should ensure its configuration is valid by
1201    /// calling [`Coordinator.CheckConfig`].
1202    pub fn r#apply_config3(
1203        &self,
1204        mut payload: CoordinatorApplyConfig3Request,
1205    ) -> Result<(), fidl::Error> {
1206        CoordinatorProxyInterface::r#apply_config3(self, payload)
1207    }
1208
1209    /// Acknowledges the receipt of one `OnVsync` message.
1210    pub fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
1211        CoordinatorProxyInterface::r#acknowledge_vsync(self, cookie)
1212    }
1213
1214    /// Sets the visibility behavior of the virtcon.
1215    ///
1216    /// This must only be called from the Virtcon client.
1217    pub fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
1218        CoordinatorProxyInterface::r#set_virtcon_mode(self, mode)
1219    }
1220
1221    /// Import a sysmem buffer collection token. `buffer_collection_id` must not
1222    /// already be in use.
1223    pub fn r#import_buffer_collection(
1224        &self,
1225        mut buffer_collection_id: &BufferCollectionId,
1226        mut buffer_collection_token: fidl::endpoints::ClientEnd<
1227            fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
1228        >,
1229    ) -> fidl::client::QueryResponseFut<
1230        CoordinatorImportBufferCollectionResult,
1231        fidl::encoding::DefaultFuchsiaResourceDialect,
1232    > {
1233        CoordinatorProxyInterface::r#import_buffer_collection(
1234            self,
1235            buffer_collection_id,
1236            buffer_collection_token,
1237        )
1238    }
1239
1240    /// Release an imported buffer collection.
1241    pub fn r#release_buffer_collection(
1242        &self,
1243        mut buffer_collection_id: &BufferCollectionId,
1244    ) -> Result<(), fidl::Error> {
1245        CoordinatorProxyInterface::r#release_buffer_collection(self, buffer_collection_id)
1246    }
1247
1248    /// Takes an imported buffer collection and sets the constraints
1249    /// on it so that it can be imported with a specific config.
1250    pub fn r#set_buffer_collection_constraints(
1251        &self,
1252        mut buffer_collection_id: &BufferCollectionId,
1253        mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
1254    ) -> fidl::client::QueryResponseFut<
1255        CoordinatorSetBufferCollectionConstraintsResult,
1256        fidl::encoding::DefaultFuchsiaResourceDialect,
1257    > {
1258        CoordinatorProxyInterface::r#set_buffer_collection_constraints(
1259            self,
1260            buffer_collection_id,
1261            buffer_usage,
1262        )
1263    }
1264
1265    /// Returns true if Capture is supported on the platform.
1266    pub fn r#is_capture_supported(
1267        &self,
1268    ) -> fidl::client::QueryResponseFut<
1269        CoordinatorIsCaptureSupportedResult,
1270        fidl::encoding::DefaultFuchsiaResourceDialect,
1271    > {
1272        CoordinatorProxyInterface::r#is_capture_supported(self)
1273    }
1274
1275    /// Starts capture. Client must provide a valid signal_event_id and
1276    /// image_id. signal_event_id must have been imported into the driver
1277    /// using ImportEvent FIDL API. Image_id is the id from ImportImageForCapture.
1278    /// The client will get notified once capture is complete via signal_event_id.
1279    /// Returns ZX_ERR_NOT_SUPPORTED if coordinator does not support capture
1280    pub fn r#start_capture(
1281        &self,
1282        mut signal_event_id: &EventId,
1283        mut image_id: &ImageId,
1284    ) -> fidl::client::QueryResponseFut<
1285        CoordinatorStartCaptureResult,
1286        fidl::encoding::DefaultFuchsiaResourceDialect,
1287    > {
1288        CoordinatorProxyInterface::r#start_capture(self, signal_event_id, image_id)
1289    }
1290
1291    /// Set the minimum value of rgb channels. Valid range [0 255] inclusive. Returns
1292    /// ZX_ERR_NOT_SUPPORTED when the display hardware does not support this feature.
1293    /// This API is meant to address backlight bleeding that may occur on some hardware
1294    /// that have a specific type of panel and hardware assembly. The evolution of this
1295    /// API is highly hardware and product dependant and therefore as products evolve, this
1296    /// API may change or support for this API may become non-existent. Therefore, this
1297    /// API should be used with caution.
1298    ///
1299    /// Unlike other calls in this API, SetMiniumRgb is applied immediately, and does not
1300    /// wait for ApplyConfig(). It is, however, still stateful.
1301    pub fn r#set_minimum_rgb(
1302        &self,
1303        mut minimum_rgb: u8,
1304    ) -> fidl::client::QueryResponseFut<
1305        CoordinatorSetMinimumRgbResult,
1306        fidl::encoding::DefaultFuchsiaResourceDialect,
1307    > {
1308        CoordinatorProxyInterface::r#set_minimum_rgb(self, minimum_rgb)
1309    }
1310
1311    /// Power off/on the display panel.
1312    ///
1313    /// This call takes effect immediately. Clients don't need to call
1314    /// [`Coordinator.ApplyConfig`].
1315    ///
1316    /// Fails with ZX_ERR_NOT_FOUND if `display_id` does not belong to a display
1317    /// known by the Coordinator. This can happen if a client issues a call to
1318    /// [`Coordinator.SetDisplayPower`] before it receives a notification that
1319    /// the display was removed.
1320    ///
1321    /// Fails with ZX_ERR_NOT_SUPPORTED if the display drivers or the hardware
1322    /// don't support displays on and off.
1323    pub fn r#set_display_power(
1324        &self,
1325        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1326        mut power_on: bool,
1327    ) -> fidl::client::QueryResponseFut<
1328        CoordinatorSetDisplayPowerResult,
1329        fidl::encoding::DefaultFuchsiaResourceDialect,
1330    > {
1331        CoordinatorProxyInterface::r#set_display_power(self, display_id, power_on)
1332    }
1333}
1334
1335impl CoordinatorProxyInterface for CoordinatorProxy {
1336    type ImportImageResponseFut = fidl::client::QueryResponseFut<
1337        CoordinatorImportImageResult,
1338        fidl::encoding::DefaultFuchsiaResourceDialect,
1339    >;
1340    fn r#import_image(
1341        &self,
1342        mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1343        mut buffer_collection_id: &BufferCollectionId,
1344        mut buffer_index: u32,
1345        mut image_id: &ImageId,
1346    ) -> Self::ImportImageResponseFut {
1347        fn _decode(
1348            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1349        ) -> Result<CoordinatorImportImageResult, fidl::Error> {
1350            let _response = fidl::client::decode_transaction_body::<
1351                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1352                fidl::encoding::DefaultFuchsiaResourceDialect,
1353                0x3a8636eb9656b4f4,
1354            >(_buf?)?;
1355            Ok(_response.map(|x| x))
1356        }
1357        self.client
1358            .send_query_and_decode::<CoordinatorImportImageRequest, CoordinatorImportImageResult>(
1359                (image_metadata, buffer_collection_id, buffer_index, image_id),
1360                0x3a8636eb9656b4f4,
1361                fidl::encoding::DynamicFlags::empty(),
1362                _decode,
1363            )
1364    }
1365
1366    fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
1367        self.client.send::<CoordinatorReleaseImageRequest>(
1368            (image_id,),
1369            0x477192230517504,
1370            fidl::encoding::DynamicFlags::empty(),
1371        )
1372    }
1373
1374    fn r#import_event(&self, mut event: fidl::Event, mut id: &EventId) -> Result<(), fidl::Error> {
1375        self.client.send::<CoordinatorImportEventRequest>(
1376            (event, id),
1377            0x2864e5dc59390543,
1378            fidl::encoding::DynamicFlags::empty(),
1379        )
1380    }
1381
1382    fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
1383        self.client.send::<CoordinatorReleaseEventRequest>(
1384            (id,),
1385            0x32508c2101606b87,
1386            fidl::encoding::DynamicFlags::empty(),
1387        )
1388    }
1389
1390    type CreateLayerResponseFut = fidl::client::QueryResponseFut<
1391        CoordinatorCreateLayerResult,
1392        fidl::encoding::DefaultFuchsiaResourceDialect,
1393    >;
1394    fn r#create_layer(&self) -> Self::CreateLayerResponseFut {
1395        fn _decode(
1396            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1397        ) -> Result<CoordinatorCreateLayerResult, fidl::Error> {
1398            let _response = fidl::client::decode_transaction_body::<
1399                fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>,
1400                fidl::encoding::DefaultFuchsiaResourceDialect,
1401                0x2137cfd788a3496b,
1402            >(_buf?)?;
1403            Ok(_response.map(|x| x.layer_id))
1404        }
1405        self.client
1406            .send_query_and_decode::<fidl::encoding::EmptyPayload, CoordinatorCreateLayerResult>(
1407                (),
1408                0x2137cfd788a3496b,
1409                fidl::encoding::DynamicFlags::empty(),
1410                _decode,
1411            )
1412    }
1413
1414    fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
1415        self.client.send::<CoordinatorDestroyLayerRequest>(
1416            (layer_id,),
1417            0x386e12d092bea2f8,
1418            fidl::encoding::DynamicFlags::empty(),
1419        )
1420    }
1421
1422    fn r#set_display_mode(
1423        &self,
1424        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1425        mut mode: &fidl_fuchsia_hardware_display_types::Mode,
1426    ) -> Result<(), fidl::Error> {
1427        self.client.send::<CoordinatorSetDisplayModeRequest>(
1428            (display_id, mode),
1429            0xbde3c59ee9c1777,
1430            fidl::encoding::DynamicFlags::empty(),
1431        )
1432    }
1433
1434    fn r#set_display_color_conversion(
1435        &self,
1436        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1437        mut preoffsets: &[f32; 3],
1438        mut coefficients: &[f32; 9],
1439        mut postoffsets: &[f32; 3],
1440    ) -> Result<(), fidl::Error> {
1441        self.client.send::<CoordinatorSetDisplayColorConversionRequest>(
1442            (display_id, preoffsets, coefficients, postoffsets),
1443            0x2f18186a987d51aa,
1444            fidl::encoding::DynamicFlags::empty(),
1445        )
1446    }
1447
1448    fn r#set_display_layers(
1449        &self,
1450        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1451        mut layer_ids: &[LayerId],
1452    ) -> Result<(), fidl::Error> {
1453        self.client.send::<CoordinatorSetDisplayLayersRequest>(
1454            (display_id, layer_ids),
1455            0x190e0f6f93be1d89,
1456            fidl::encoding::DynamicFlags::empty(),
1457        )
1458    }
1459
1460    fn r#set_layer_primary_config(
1461        &self,
1462        mut layer_id: &LayerId,
1463        mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1464    ) -> Result<(), fidl::Error> {
1465        self.client.send::<CoordinatorSetLayerPrimaryConfigRequest>(
1466            (layer_id, image_metadata),
1467            0x68d89ebd518b45b9,
1468            fidl::encoding::DynamicFlags::empty(),
1469        )
1470    }
1471
1472    fn r#set_layer_primary_position(
1473        &self,
1474        mut layer_id: &LayerId,
1475        mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
1476        mut image_source: &fidl_fuchsia_math::RectU,
1477        mut display_destination: &fidl_fuchsia_math::RectU,
1478    ) -> Result<(), fidl::Error> {
1479        self.client.send::<CoordinatorSetLayerPrimaryPositionRequest>(
1480            (layer_id, image_source_transformation, image_source, display_destination),
1481            0x27b192b5a43851e2,
1482            fidl::encoding::DynamicFlags::empty(),
1483        )
1484    }
1485
1486    fn r#set_layer_primary_alpha(
1487        &self,
1488        mut layer_id: &LayerId,
1489        mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
1490        mut val: f32,
1491    ) -> Result<(), fidl::Error> {
1492        self.client.send::<CoordinatorSetLayerPrimaryAlphaRequest>(
1493            (layer_id, mode, val),
1494            0x104cf2b18b27296d,
1495            fidl::encoding::DynamicFlags::empty(),
1496        )
1497    }
1498
1499    fn r#set_layer_color_config(
1500        &self,
1501        mut layer_id: &LayerId,
1502        mut color: &fidl_fuchsia_hardware_display_types::Color,
1503        mut display_destination: &fidl_fuchsia_math::RectU,
1504    ) -> Result<(), fidl::Error> {
1505        self.client.send::<CoordinatorSetLayerColorConfigRequest>(
1506            (layer_id, color, display_destination),
1507            0x2fa91e9a2a01875f,
1508            fidl::encoding::DynamicFlags::empty(),
1509        )
1510    }
1511
1512    fn r#set_layer_image2(
1513        &self,
1514        mut layer_id: &LayerId,
1515        mut image_id: &ImageId,
1516        mut wait_event_id: &EventId,
1517    ) -> Result<(), fidl::Error> {
1518        self.client.send::<CoordinatorSetLayerImage2Request>(
1519            (layer_id, image_id, wait_event_id),
1520            0x53c6376dfc13a971,
1521            fidl::encoding::DynamicFlags::empty(),
1522        )
1523    }
1524
1525    type CheckConfigResponseFut = fidl::client::QueryResponseFut<
1526        fidl_fuchsia_hardware_display_types::ConfigResult,
1527        fidl::encoding::DefaultFuchsiaResourceDialect,
1528    >;
1529    fn r#check_config(&self) -> Self::CheckConfigResponseFut {
1530        fn _decode(
1531            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1532        ) -> Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error> {
1533            let _response = fidl::client::decode_transaction_body::<
1534                CoordinatorCheckConfigResponse,
1535                fidl::encoding::DefaultFuchsiaResourceDialect,
1536                0x2bcfb4eb16878158,
1537            >(_buf?)?;
1538            Ok(_response.res)
1539        }
1540        self.client.send_query_and_decode::<
1541            fidl::encoding::EmptyPayload,
1542            fidl_fuchsia_hardware_display_types::ConfigResult,
1543        >(
1544            (),
1545            0x2bcfb4eb16878158,
1546            fidl::encoding::DynamicFlags::empty(),
1547            _decode,
1548        )
1549    }
1550
1551    fn r#discard_config(&self) -> Result<(), fidl::Error> {
1552        self.client.send::<fidl::encoding::EmptyPayload>(
1553            (),
1554            0x1673399e9231dedf,
1555            fidl::encoding::DynamicFlags::empty(),
1556        )
1557    }
1558
1559    type GetLatestAppliedConfigStampResponseFut =
1560        fidl::client::QueryResponseFut<ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1561    fn r#get_latest_applied_config_stamp(&self) -> Self::GetLatestAppliedConfigStampResponseFut {
1562        fn _decode(
1563            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1564        ) -> Result<ConfigStamp, fidl::Error> {
1565            let _response = fidl::client::decode_transaction_body::<
1566                CoordinatorGetLatestAppliedConfigStampResponse,
1567                fidl::encoding::DefaultFuchsiaResourceDialect,
1568                0x76a50c0537265f65,
1569            >(_buf?)?;
1570            Ok(_response.stamp)
1571        }
1572        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConfigStamp>(
1573            (),
1574            0x76a50c0537265f65,
1575            fidl::encoding::DynamicFlags::empty(),
1576            _decode,
1577        )
1578    }
1579
1580    fn r#apply_config3(
1581        &self,
1582        mut payload: CoordinatorApplyConfig3Request,
1583    ) -> Result<(), fidl::Error> {
1584        self.client.send::<CoordinatorApplyConfig3Request>(
1585            &mut payload,
1586            0x7f0fe0e4f062a67e,
1587            fidl::encoding::DynamicFlags::empty(),
1588        )
1589    }
1590
1591    fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
1592        self.client.send::<CoordinatorAcknowledgeVsyncRequest>(
1593            (cookie,),
1594            0x25e921d26107d6ef,
1595            fidl::encoding::DynamicFlags::empty(),
1596        )
1597    }
1598
1599    fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
1600        self.client.send::<CoordinatorSetVirtconModeRequest>(
1601            (mode,),
1602            0x4fe0721526068f00,
1603            fidl::encoding::DynamicFlags::empty(),
1604        )
1605    }
1606
1607    type ImportBufferCollectionResponseFut = fidl::client::QueryResponseFut<
1608        CoordinatorImportBufferCollectionResult,
1609        fidl::encoding::DefaultFuchsiaResourceDialect,
1610    >;
1611    fn r#import_buffer_collection(
1612        &self,
1613        mut buffer_collection_id: &BufferCollectionId,
1614        mut buffer_collection_token: fidl::endpoints::ClientEnd<
1615            fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
1616        >,
1617    ) -> Self::ImportBufferCollectionResponseFut {
1618        fn _decode(
1619            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1620        ) -> Result<CoordinatorImportBufferCollectionResult, fidl::Error> {
1621            let _response = fidl::client::decode_transaction_body::<
1622                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1623                fidl::encoding::DefaultFuchsiaResourceDialect,
1624                0x30d06f510e7f4601,
1625            >(_buf?)?;
1626            Ok(_response.map(|x| x))
1627        }
1628        self.client.send_query_and_decode::<
1629            CoordinatorImportBufferCollectionRequest,
1630            CoordinatorImportBufferCollectionResult,
1631        >(
1632            (buffer_collection_id, buffer_collection_token,),
1633            0x30d06f510e7f4601,
1634            fidl::encoding::DynamicFlags::empty(),
1635            _decode,
1636        )
1637    }
1638
1639    fn r#release_buffer_collection(
1640        &self,
1641        mut buffer_collection_id: &BufferCollectionId,
1642    ) -> Result<(), fidl::Error> {
1643        self.client.send::<CoordinatorReleaseBufferCollectionRequest>(
1644            (buffer_collection_id,),
1645            0x1c7dd5f8b0690be0,
1646            fidl::encoding::DynamicFlags::empty(),
1647        )
1648    }
1649
1650    type SetBufferCollectionConstraintsResponseFut = fidl::client::QueryResponseFut<
1651        CoordinatorSetBufferCollectionConstraintsResult,
1652        fidl::encoding::DefaultFuchsiaResourceDialect,
1653    >;
1654    fn r#set_buffer_collection_constraints(
1655        &self,
1656        mut buffer_collection_id: &BufferCollectionId,
1657        mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
1658    ) -> Self::SetBufferCollectionConstraintsResponseFut {
1659        fn _decode(
1660            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1661        ) -> Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error> {
1662            let _response = fidl::client::decode_transaction_body::<
1663                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1664                fidl::encoding::DefaultFuchsiaResourceDialect,
1665                0x509a4ee9af6035df,
1666            >(_buf?)?;
1667            Ok(_response.map(|x| x))
1668        }
1669        self.client.send_query_and_decode::<
1670            CoordinatorSetBufferCollectionConstraintsRequest,
1671            CoordinatorSetBufferCollectionConstraintsResult,
1672        >(
1673            (buffer_collection_id, buffer_usage,),
1674            0x509a4ee9af6035df,
1675            fidl::encoding::DynamicFlags::empty(),
1676            _decode,
1677        )
1678    }
1679
1680    type IsCaptureSupportedResponseFut = fidl::client::QueryResponseFut<
1681        CoordinatorIsCaptureSupportedResult,
1682        fidl::encoding::DefaultFuchsiaResourceDialect,
1683    >;
1684    fn r#is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut {
1685        fn _decode(
1686            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1687        ) -> Result<CoordinatorIsCaptureSupportedResult, fidl::Error> {
1688            let _response = fidl::client::decode_transaction_body::<
1689                fidl::encoding::ResultType<CoordinatorIsCaptureSupportedResponse, i32>,
1690                fidl::encoding::DefaultFuchsiaResourceDialect,
1691                0x4ca407277277971b,
1692            >(_buf?)?;
1693            Ok(_response.map(|x| x.supported))
1694        }
1695        self.client.send_query_and_decode::<
1696            fidl::encoding::EmptyPayload,
1697            CoordinatorIsCaptureSupportedResult,
1698        >(
1699            (),
1700            0x4ca407277277971b,
1701            fidl::encoding::DynamicFlags::empty(),
1702            _decode,
1703        )
1704    }
1705
1706    type StartCaptureResponseFut = fidl::client::QueryResponseFut<
1707        CoordinatorStartCaptureResult,
1708        fidl::encoding::DefaultFuchsiaResourceDialect,
1709    >;
1710    fn r#start_capture(
1711        &self,
1712        mut signal_event_id: &EventId,
1713        mut image_id: &ImageId,
1714    ) -> Self::StartCaptureResponseFut {
1715        fn _decode(
1716            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1717        ) -> Result<CoordinatorStartCaptureResult, fidl::Error> {
1718            let _response = fidl::client::decode_transaction_body::<
1719                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1720                fidl::encoding::DefaultFuchsiaResourceDialect,
1721                0x35cb38f19d96a8db,
1722            >(_buf?)?;
1723            Ok(_response.map(|x| x))
1724        }
1725        self.client
1726            .send_query_and_decode::<CoordinatorStartCaptureRequest, CoordinatorStartCaptureResult>(
1727                (signal_event_id, image_id),
1728                0x35cb38f19d96a8db,
1729                fidl::encoding::DynamicFlags::empty(),
1730                _decode,
1731            )
1732    }
1733
1734    type SetMinimumRgbResponseFut = fidl::client::QueryResponseFut<
1735        CoordinatorSetMinimumRgbResult,
1736        fidl::encoding::DefaultFuchsiaResourceDialect,
1737    >;
1738    fn r#set_minimum_rgb(&self, mut minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut {
1739        fn _decode(
1740            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1741        ) -> Result<CoordinatorSetMinimumRgbResult, fidl::Error> {
1742            let _response = fidl::client::decode_transaction_body::<
1743                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1744                fidl::encoding::DefaultFuchsiaResourceDialect,
1745                0x1b49251437038b0b,
1746            >(_buf?)?;
1747            Ok(_response.map(|x| x))
1748        }
1749        self.client.send_query_and_decode::<
1750            CoordinatorSetMinimumRgbRequest,
1751            CoordinatorSetMinimumRgbResult,
1752        >(
1753            (minimum_rgb,),
1754            0x1b49251437038b0b,
1755            fidl::encoding::DynamicFlags::empty(),
1756            _decode,
1757        )
1758    }
1759
1760    type SetDisplayPowerResponseFut = fidl::client::QueryResponseFut<
1761        CoordinatorSetDisplayPowerResult,
1762        fidl::encoding::DefaultFuchsiaResourceDialect,
1763    >;
1764    fn r#set_display_power(
1765        &self,
1766        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1767        mut power_on: bool,
1768    ) -> Self::SetDisplayPowerResponseFut {
1769        fn _decode(
1770            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1771        ) -> Result<CoordinatorSetDisplayPowerResult, fidl::Error> {
1772            let _response = fidl::client::decode_transaction_body::<
1773                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1774                fidl::encoding::DefaultFuchsiaResourceDialect,
1775                0x10feb62d11d9e92b,
1776            >(_buf?)?;
1777            Ok(_response.map(|x| x))
1778        }
1779        self.client.send_query_and_decode::<
1780            CoordinatorSetDisplayPowerRequest,
1781            CoordinatorSetDisplayPowerResult,
1782        >(
1783            (display_id, power_on,),
1784            0x10feb62d11d9e92b,
1785            fidl::encoding::DynamicFlags::empty(),
1786            _decode,
1787        )
1788    }
1789}
1790
1791pub struct CoordinatorEventStream {
1792    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1793}
1794
1795impl std::marker::Unpin for CoordinatorEventStream {}
1796
1797impl futures::stream::FusedStream for CoordinatorEventStream {
1798    fn is_terminated(&self) -> bool {
1799        self.event_receiver.is_terminated()
1800    }
1801}
1802
1803impl futures::Stream for CoordinatorEventStream {
1804    type Item = Result<CoordinatorEvent, fidl::Error>;
1805
1806    fn poll_next(
1807        mut self: std::pin::Pin<&mut Self>,
1808        cx: &mut std::task::Context<'_>,
1809    ) -> std::task::Poll<Option<Self::Item>> {
1810        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1811            &mut self.event_receiver,
1812            cx
1813        )?) {
1814            Some(buf) => std::task::Poll::Ready(Some(CoordinatorEvent::decode(buf))),
1815            None => std::task::Poll::Ready(None),
1816        }
1817    }
1818}
1819
1820#[derive(Debug)]
1821pub enum CoordinatorEvent {}
1822
1823impl CoordinatorEvent {
1824    /// Decodes a message buffer as a [`CoordinatorEvent`].
1825    fn decode(
1826        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1827    ) -> Result<CoordinatorEvent, fidl::Error> {
1828        let (bytes, _handles) = buf.split_mut();
1829        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1830        debug_assert_eq!(tx_header.tx_id, 0);
1831        match tx_header.ordinal {
1832            _ => Err(fidl::Error::UnknownOrdinal {
1833                ordinal: tx_header.ordinal,
1834                protocol_name: <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1835            }),
1836        }
1837    }
1838}
1839
1840/// A Stream of incoming requests for fuchsia.hardware.display/Coordinator.
1841pub struct CoordinatorRequestStream {
1842    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1843    is_terminated: bool,
1844}
1845
1846impl std::marker::Unpin for CoordinatorRequestStream {}
1847
1848impl futures::stream::FusedStream for CoordinatorRequestStream {
1849    fn is_terminated(&self) -> bool {
1850        self.is_terminated
1851    }
1852}
1853
1854impl fidl::endpoints::RequestStream for CoordinatorRequestStream {
1855    type Protocol = CoordinatorMarker;
1856    type ControlHandle = CoordinatorControlHandle;
1857
1858    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1859        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1860    }
1861
1862    fn control_handle(&self) -> Self::ControlHandle {
1863        CoordinatorControlHandle { inner: self.inner.clone() }
1864    }
1865
1866    fn into_inner(
1867        self,
1868    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1869    {
1870        (self.inner, self.is_terminated)
1871    }
1872
1873    fn from_inner(
1874        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1875        is_terminated: bool,
1876    ) -> Self {
1877        Self { inner, is_terminated }
1878    }
1879}
1880
1881impl futures::Stream for CoordinatorRequestStream {
1882    type Item = Result<CoordinatorRequest, fidl::Error>;
1883
1884    fn poll_next(
1885        mut self: std::pin::Pin<&mut Self>,
1886        cx: &mut std::task::Context<'_>,
1887    ) -> std::task::Poll<Option<Self::Item>> {
1888        let this = &mut *self;
1889        if this.inner.check_shutdown(cx) {
1890            this.is_terminated = true;
1891            return std::task::Poll::Ready(None);
1892        }
1893        if this.is_terminated {
1894            panic!("polled CoordinatorRequestStream after completion");
1895        }
1896        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1897            |bytes, handles| {
1898                match this.inner.channel().read_etc(cx, bytes, handles) {
1899                    std::task::Poll::Ready(Ok(())) => {}
1900                    std::task::Poll::Pending => return std::task::Poll::Pending,
1901                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1902                        this.is_terminated = true;
1903                        return std::task::Poll::Ready(None);
1904                    }
1905                    std::task::Poll::Ready(Err(e)) => {
1906                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1907                            e.into(),
1908                        ))));
1909                    }
1910                }
1911
1912                // A message has been received from the channel
1913                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1914
1915                std::task::Poll::Ready(Some(match header.ordinal {
1916                    0x3a8636eb9656b4f4 => {
1917                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1918                        let mut req = fidl::new_empty!(
1919                            CoordinatorImportImageRequest,
1920                            fidl::encoding::DefaultFuchsiaResourceDialect
1921                        );
1922                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportImageRequest>(&header, _body_bytes, handles, &mut req)?;
1923                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1924                        Ok(CoordinatorRequest::ImportImage {
1925                            image_metadata: req.image_metadata,
1926                            buffer_collection_id: req.buffer_collection_id,
1927                            buffer_index: req.buffer_index,
1928                            image_id: req.image_id,
1929
1930                            responder: CoordinatorImportImageResponder {
1931                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1932                                tx_id: header.tx_id,
1933                            },
1934                        })
1935                    }
1936                    0x477192230517504 => {
1937                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1938                        let mut req = fidl::new_empty!(
1939                            CoordinatorReleaseImageRequest,
1940                            fidl::encoding::DefaultFuchsiaResourceDialect
1941                        );
1942                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseImageRequest>(&header, _body_bytes, handles, &mut req)?;
1943                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1944                        Ok(CoordinatorRequest::ReleaseImage {
1945                            image_id: req.image_id,
1946
1947                            control_handle,
1948                        })
1949                    }
1950                    0x2864e5dc59390543 => {
1951                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1952                        let mut req = fidl::new_empty!(
1953                            CoordinatorImportEventRequest,
1954                            fidl::encoding::DefaultFuchsiaResourceDialect
1955                        );
1956                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportEventRequest>(&header, _body_bytes, handles, &mut req)?;
1957                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1958                        Ok(CoordinatorRequest::ImportEvent {
1959                            event: req.event,
1960                            id: req.id,
1961
1962                            control_handle,
1963                        })
1964                    }
1965                    0x32508c2101606b87 => {
1966                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1967                        let mut req = fidl::new_empty!(
1968                            CoordinatorReleaseEventRequest,
1969                            fidl::encoding::DefaultFuchsiaResourceDialect
1970                        );
1971                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseEventRequest>(&header, _body_bytes, handles, &mut req)?;
1972                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1973                        Ok(CoordinatorRequest::ReleaseEvent { id: req.id, control_handle })
1974                    }
1975                    0x2137cfd788a3496b => {
1976                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1977                        let mut req = fidl::new_empty!(
1978                            fidl::encoding::EmptyPayload,
1979                            fidl::encoding::DefaultFuchsiaResourceDialect
1980                        );
1981                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1982                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1983                        Ok(CoordinatorRequest::CreateLayer {
1984                            responder: CoordinatorCreateLayerResponder {
1985                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1986                                tx_id: header.tx_id,
1987                            },
1988                        })
1989                    }
1990                    0x386e12d092bea2f8 => {
1991                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1992                        let mut req = fidl::new_empty!(
1993                            CoordinatorDestroyLayerRequest,
1994                            fidl::encoding::DefaultFuchsiaResourceDialect
1995                        );
1996                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorDestroyLayerRequest>(&header, _body_bytes, handles, &mut req)?;
1997                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1998                        Ok(CoordinatorRequest::DestroyLayer {
1999                            layer_id: req.layer_id,
2000
2001                            control_handle,
2002                        })
2003                    }
2004                    0xbde3c59ee9c1777 => {
2005                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2006                        let mut req = fidl::new_empty!(
2007                            CoordinatorSetDisplayModeRequest,
2008                            fidl::encoding::DefaultFuchsiaResourceDialect
2009                        );
2010                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayModeRequest>(&header, _body_bytes, handles, &mut req)?;
2011                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2012                        Ok(CoordinatorRequest::SetDisplayMode {
2013                            display_id: req.display_id,
2014                            mode: req.mode,
2015
2016                            control_handle,
2017                        })
2018                    }
2019                    0x2f18186a987d51aa => {
2020                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2021                        let mut req = fidl::new_empty!(
2022                            CoordinatorSetDisplayColorConversionRequest,
2023                            fidl::encoding::DefaultFuchsiaResourceDialect
2024                        );
2025                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayColorConversionRequest>(&header, _body_bytes, handles, &mut req)?;
2026                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2027                        Ok(CoordinatorRequest::SetDisplayColorConversion {
2028                            display_id: req.display_id,
2029                            preoffsets: req.preoffsets,
2030                            coefficients: req.coefficients,
2031                            postoffsets: req.postoffsets,
2032
2033                            control_handle,
2034                        })
2035                    }
2036                    0x190e0f6f93be1d89 => {
2037                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2038                        let mut req = fidl::new_empty!(
2039                            CoordinatorSetDisplayLayersRequest,
2040                            fidl::encoding::DefaultFuchsiaResourceDialect
2041                        );
2042                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayLayersRequest>(&header, _body_bytes, handles, &mut req)?;
2043                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2044                        Ok(CoordinatorRequest::SetDisplayLayers {
2045                            display_id: req.display_id,
2046                            layer_ids: req.layer_ids,
2047
2048                            control_handle,
2049                        })
2050                    }
2051                    0x68d89ebd518b45b9 => {
2052                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2053                        let mut req = fidl::new_empty!(
2054                            CoordinatorSetLayerPrimaryConfigRequest,
2055                            fidl::encoding::DefaultFuchsiaResourceDialect
2056                        );
2057                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2058                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2059                        Ok(CoordinatorRequest::SetLayerPrimaryConfig {
2060                            layer_id: req.layer_id,
2061                            image_metadata: req.image_metadata,
2062
2063                            control_handle,
2064                        })
2065                    }
2066                    0x27b192b5a43851e2 => {
2067                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2068                        let mut req = fidl::new_empty!(
2069                            CoordinatorSetLayerPrimaryPositionRequest,
2070                            fidl::encoding::DefaultFuchsiaResourceDialect
2071                        );
2072                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryPositionRequest>(&header, _body_bytes, handles, &mut req)?;
2073                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2074                        Ok(CoordinatorRequest::SetLayerPrimaryPosition {
2075                            layer_id: req.layer_id,
2076                            image_source_transformation: req.image_source_transformation,
2077                            image_source: req.image_source,
2078                            display_destination: req.display_destination,
2079
2080                            control_handle,
2081                        })
2082                    }
2083                    0x104cf2b18b27296d => {
2084                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2085                        let mut req = fidl::new_empty!(
2086                            CoordinatorSetLayerPrimaryAlphaRequest,
2087                            fidl::encoding::DefaultFuchsiaResourceDialect
2088                        );
2089                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryAlphaRequest>(&header, _body_bytes, handles, &mut req)?;
2090                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2091                        Ok(CoordinatorRequest::SetLayerPrimaryAlpha {
2092                            layer_id: req.layer_id,
2093                            mode: req.mode,
2094                            val: req.val,
2095
2096                            control_handle,
2097                        })
2098                    }
2099                    0x2fa91e9a2a01875f => {
2100                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2101                        let mut req = fidl::new_empty!(
2102                            CoordinatorSetLayerColorConfigRequest,
2103                            fidl::encoding::DefaultFuchsiaResourceDialect
2104                        );
2105                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerColorConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2106                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2107                        Ok(CoordinatorRequest::SetLayerColorConfig {
2108                            layer_id: req.layer_id,
2109                            color: req.color,
2110                            display_destination: req.display_destination,
2111
2112                            control_handle,
2113                        })
2114                    }
2115                    0x53c6376dfc13a971 => {
2116                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2117                        let mut req = fidl::new_empty!(
2118                            CoordinatorSetLayerImage2Request,
2119                            fidl::encoding::DefaultFuchsiaResourceDialect
2120                        );
2121                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerImage2Request>(&header, _body_bytes, handles, &mut req)?;
2122                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2123                        Ok(CoordinatorRequest::SetLayerImage2 {
2124                            layer_id: req.layer_id,
2125                            image_id: req.image_id,
2126                            wait_event_id: req.wait_event_id,
2127
2128                            control_handle,
2129                        })
2130                    }
2131                    0x2bcfb4eb16878158 => {
2132                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2133                        let mut req = fidl::new_empty!(
2134                            fidl::encoding::EmptyPayload,
2135                            fidl::encoding::DefaultFuchsiaResourceDialect
2136                        );
2137                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2138                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2139                        Ok(CoordinatorRequest::CheckConfig {
2140                            responder: CoordinatorCheckConfigResponder {
2141                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2142                                tx_id: header.tx_id,
2143                            },
2144                        })
2145                    }
2146                    0x1673399e9231dedf => {
2147                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2148                        let mut req = fidl::new_empty!(
2149                            fidl::encoding::EmptyPayload,
2150                            fidl::encoding::DefaultFuchsiaResourceDialect
2151                        );
2152                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2153                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2154                        Ok(CoordinatorRequest::DiscardConfig { control_handle })
2155                    }
2156                    0x76a50c0537265f65 => {
2157                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2158                        let mut req = fidl::new_empty!(
2159                            fidl::encoding::EmptyPayload,
2160                            fidl::encoding::DefaultFuchsiaResourceDialect
2161                        );
2162                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2163                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2164                        Ok(CoordinatorRequest::GetLatestAppliedConfigStamp {
2165                            responder: CoordinatorGetLatestAppliedConfigStampResponder {
2166                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2167                                tx_id: header.tx_id,
2168                            },
2169                        })
2170                    }
2171                    0x7f0fe0e4f062a67e => {
2172                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2173                        let mut req = fidl::new_empty!(
2174                            CoordinatorApplyConfig3Request,
2175                            fidl::encoding::DefaultFuchsiaResourceDialect
2176                        );
2177                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorApplyConfig3Request>(&header, _body_bytes, handles, &mut req)?;
2178                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2179                        Ok(CoordinatorRequest::ApplyConfig3 { payload: req, control_handle })
2180                    }
2181                    0x25e921d26107d6ef => {
2182                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2183                        let mut req = fidl::new_empty!(
2184                            CoordinatorAcknowledgeVsyncRequest,
2185                            fidl::encoding::DefaultFuchsiaResourceDialect
2186                        );
2187                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorAcknowledgeVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
2188                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2189                        Ok(CoordinatorRequest::AcknowledgeVsync {
2190                            cookie: req.cookie,
2191
2192                            control_handle,
2193                        })
2194                    }
2195                    0x4fe0721526068f00 => {
2196                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2197                        let mut req = fidl::new_empty!(
2198                            CoordinatorSetVirtconModeRequest,
2199                            fidl::encoding::DefaultFuchsiaResourceDialect
2200                        );
2201                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetVirtconModeRequest>(&header, _body_bytes, handles, &mut req)?;
2202                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2203                        Ok(CoordinatorRequest::SetVirtconMode { mode: req.mode, control_handle })
2204                    }
2205                    0x30d06f510e7f4601 => {
2206                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2207                        let mut req = fidl::new_empty!(
2208                            CoordinatorImportBufferCollectionRequest,
2209                            fidl::encoding::DefaultFuchsiaResourceDialect
2210                        );
2211                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
2212                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2213                        Ok(CoordinatorRequest::ImportBufferCollection {
2214                            buffer_collection_id: req.buffer_collection_id,
2215                            buffer_collection_token: req.buffer_collection_token,
2216
2217                            responder: CoordinatorImportBufferCollectionResponder {
2218                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2219                                tx_id: header.tx_id,
2220                            },
2221                        })
2222                    }
2223                    0x1c7dd5f8b0690be0 => {
2224                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2225                        let mut req = fidl::new_empty!(
2226                            CoordinatorReleaseBufferCollectionRequest,
2227                            fidl::encoding::DefaultFuchsiaResourceDialect
2228                        );
2229                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
2230                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2231                        Ok(CoordinatorRequest::ReleaseBufferCollection {
2232                            buffer_collection_id: req.buffer_collection_id,
2233
2234                            control_handle,
2235                        })
2236                    }
2237                    0x509a4ee9af6035df => {
2238                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2239                        let mut req = fidl::new_empty!(
2240                            CoordinatorSetBufferCollectionConstraintsRequest,
2241                            fidl::encoding::DefaultFuchsiaResourceDialect
2242                        );
2243                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetBufferCollectionConstraintsRequest>(&header, _body_bytes, handles, &mut req)?;
2244                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2245                        Ok(CoordinatorRequest::SetBufferCollectionConstraints {
2246                            buffer_collection_id: req.buffer_collection_id,
2247                            buffer_usage: req.buffer_usage,
2248
2249                            responder: CoordinatorSetBufferCollectionConstraintsResponder {
2250                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2251                                tx_id: header.tx_id,
2252                            },
2253                        })
2254                    }
2255                    0x4ca407277277971b => {
2256                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2257                        let mut req = fidl::new_empty!(
2258                            fidl::encoding::EmptyPayload,
2259                            fidl::encoding::DefaultFuchsiaResourceDialect
2260                        );
2261                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2262                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2263                        Ok(CoordinatorRequest::IsCaptureSupported {
2264                            responder: CoordinatorIsCaptureSupportedResponder {
2265                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2266                                tx_id: header.tx_id,
2267                            },
2268                        })
2269                    }
2270                    0x35cb38f19d96a8db => {
2271                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2272                        let mut req = fidl::new_empty!(
2273                            CoordinatorStartCaptureRequest,
2274                            fidl::encoding::DefaultFuchsiaResourceDialect
2275                        );
2276                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorStartCaptureRequest>(&header, _body_bytes, handles, &mut req)?;
2277                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2278                        Ok(CoordinatorRequest::StartCapture {
2279                            signal_event_id: req.signal_event_id,
2280                            image_id: req.image_id,
2281
2282                            responder: CoordinatorStartCaptureResponder {
2283                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2284                                tx_id: header.tx_id,
2285                            },
2286                        })
2287                    }
2288                    0x1b49251437038b0b => {
2289                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2290                        let mut req = fidl::new_empty!(
2291                            CoordinatorSetMinimumRgbRequest,
2292                            fidl::encoding::DefaultFuchsiaResourceDialect
2293                        );
2294                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetMinimumRgbRequest>(&header, _body_bytes, handles, &mut req)?;
2295                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2296                        Ok(CoordinatorRequest::SetMinimumRgb {
2297                            minimum_rgb: req.minimum_rgb,
2298
2299                            responder: CoordinatorSetMinimumRgbResponder {
2300                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2301                                tx_id: header.tx_id,
2302                            },
2303                        })
2304                    }
2305                    0x10feb62d11d9e92b => {
2306                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2307                        let mut req = fidl::new_empty!(
2308                            CoordinatorSetDisplayPowerRequest,
2309                            fidl::encoding::DefaultFuchsiaResourceDialect
2310                        );
2311                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayPowerRequest>(&header, _body_bytes, handles, &mut req)?;
2312                        let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2313                        Ok(CoordinatorRequest::SetDisplayPower {
2314                            display_id: req.display_id,
2315                            power_on: req.power_on,
2316
2317                            responder: CoordinatorSetDisplayPowerResponder {
2318                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2319                                tx_id: header.tx_id,
2320                            },
2321                        })
2322                    }
2323                    _ => Err(fidl::Error::UnknownOrdinal {
2324                        ordinal: header.ordinal,
2325                        protocol_name:
2326                            <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2327                    }),
2328                }))
2329            },
2330        )
2331    }
2332}
2333
2334/// Interface for accessing the display hardware.
2335///
2336/// A display configuration can be separated into two parts: the layer layout and
2337/// the layer contents. The layout includes all parts of a configuration other
2338/// than the image handles. The active configuration is composed of the most
2339/// recently applied layout and an active image from each layer - see
2340/// SetLayerImage for details on how the active image is defined. Note the
2341/// requirement that each layer has an active image. Whenever a new active
2342/// configuration is available, it is immediately given to the hardware. This
2343/// allows the layout and each layer's contents to advance independently when
2344/// possible.
2345///
2346/// Performing illegal actions on the interface will result in the interface
2347/// being closed.  The channel closure epitaph will return one of 4 values:
2348/// - ZX_ERR_INVALID_ARGS: for trivially-verifiable client errors, such as providing an ID for a
2349///       nonexistent image/layer/event, or a non-monotonically-increasing config stamp to
2350///       ApplyConfig, etc.
2351/// - ZX_ERR_BAD_STATE: indicates that the client has violated other API invariants, such as reusing
2352///       an event that hasn't been signaled yet.
2353/// - ZX_ERR_NO_MEMORY: memory could not be allocated to satisfy the requested operation.
2354/// - ZX_ERR_INTERNAL: catch-all used for any error that is not listed above.
2355#[derive(Debug)]
2356pub enum CoordinatorRequest {
2357    /// Imports a Buffer-Collection backed image.
2358    ///
2359    /// Returns `ZX_ERR_NOT_SUPPORTED` if the display hardware doesn't support
2360    /// `image_metadata`.
2361    /// Returns `ZX_ERR_ALREADY_EXISTS` if `image_id` was used in a successful
2362    /// `ImportImage()` without a corresponding `ReleaseImage()`.
2363    /// Returns `ZX_ERR_NO_MEMORY` if memory cannot be allocated for managing the image
2364    /// Additionally, this method delegates internally to `fuchsia.hardware.display.engine/Engine`,
2365    /// and will forward errors received from `ImportImage()` and `ImportImageForCapture()`.
2366    ImportImage {
2367        image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
2368        buffer_collection_id: BufferCollectionId,
2369        buffer_index: u32,
2370        image_id: ImageId,
2371        responder: CoordinatorImportImageResponder,
2372    },
2373    /// Releases an imported image.
2374    ///
2375    /// `image_id` must be already imported by
2376    /// [`fuchsia.hardware.display/Coordinator.ImportImage`].
2377    ///
2378    /// The image must not be the capture target of an ongoing capture specified
2379    /// in [`fuchsia.hardware.display/Coordinator.StartCapture`].
2380    ///
2381    /// When an image is released, it is immediately removed from any draft
2382    /// or active configurations, and any fences associated with the image are
2383    /// dropped. The resources associated with the image will be released as
2384    /// soon as the image is no longer in use.
2385    ReleaseImage { image_id: ImageId, control_handle: CoordinatorControlHandle },
2386    /// Imports an event into the driver and associates it with the given id.
2387    ///
2388    /// It is illegal for id to be equal to INVALID_DISP_ID, and it is undefined to
2389    /// import one event with two different ids or to import two different events
2390    /// with the same id (note that ids map well to koids).
2391    ///
2392    /// If a client is reusing events, they must clear the signal
2393    /// before referencing the id again.
2394    ImportEvent { event: fidl::Event, id: EventId, control_handle: CoordinatorControlHandle },
2395    /// Releases the event imported with the given id.
2396    ///
2397    /// If any images are currently using the given event, the event
2398    /// will still be waited up or signaled as appropriate before its
2399    /// resources are released. It is an error to reuse an ID while the
2400    /// active config has references to it.
2401    ReleaseEvent { id: EventId, control_handle: CoordinatorControlHandle },
2402    /// Creates a new layer.
2403    ///
2404    /// Layers are not associated with a particular display, but they can only be
2405    /// shown on at most one display at any given time.  A layer is considered in
2406    /// use from the time it is passed to SetDisplayLayers until a subsequent
2407    /// configuration is applied which does not include the layer or until its
2408    /// display is removed.
2409    CreateLayer { responder: CoordinatorCreateLayerResponder },
2410    /// Destroys the given layer.
2411    ///
2412    /// It is illegal to destroy a layer which does not exist or which is in use.
2413    DestroyLayer { layer_id: LayerId, control_handle: CoordinatorControlHandle },
2414    /// Sets the mode for a display.
2415    SetDisplayMode {
2416        display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2417        mode: fidl_fuchsia_hardware_display_types::Mode,
2418        control_handle: CoordinatorControlHandle,
2419    },
2420    /// Set the color conversion applied to the display. The conversion is applied to
2421    /// to each pixel according to the formula:
2422    ///
2423    /// (coefficients * (pixel + preoffsets)) + postoffsets
2424    ///
2425    /// where pixel is a column vector consisting of the pixel's 3 components.
2426    ///
2427    /// `coefficients` is passed in row-major order. If the first entry of an array is NaN, the
2428    /// array is treated as the identity element for the relevant operation.
2429    /// Hardware that support color correction generally accept a limited range of coefficient
2430    /// values. Coefficients in the range of [-2, 2] inclusive will be accepted by most
2431    /// hardware. The hardware driver will clamp values that are outside its acceptable range.
2432    ///
2433    /// `preoffsets`, `postoffsets`: Clients are encourged to produce color correction values that
2434    /// do not depend on pre and post offsets since some hardware do not have support for that.
2435    /// For cases where pre and post offset values need to be used, the range should be limited to
2436    /// (-1, 1) exclusive as confirmed by CheckConfig API. Values outside this range will be
2437    /// rejected.
2438    ///
2439    /// Clients are encouraged to use the CheckConfig API to confirm support for correction and to
2440    /// validate their color correction input values.
2441    ///
2442    /// This a stateful call. Once color conversion values have been succesfully applied via a call
2443    /// to ApplyConfig() they will remain in place until changed and another ApplyConfig() call is
2444    /// successful. If SetDisplayColorConversion() is called and then the config is discarded, then
2445    /// the last successfully applied state is restored.
2446    SetDisplayColorConversion {
2447        display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2448        preoffsets: [f32; 3],
2449        coefficients: [f32; 9],
2450        postoffsets: [f32; 3],
2451        control_handle: CoordinatorControlHandle,
2452    },
2453    /// Assigns a list of layers to be composited on a display.
2454    SetDisplayLayers {
2455        display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2456        layer_ids: Vec<LayerId>,
2457        control_handle: CoordinatorControlHandle,
2458    },
2459    /// Configures the layer as a primary layer with no image and the default
2460    /// config (no src_frame cropping, the identity transform, positioned in the
2461    /// top-left corner of the composed output, and no scaling).
2462    ///
2463    /// See the documentation on SetLayerImage for details on how this method
2464    /// affects the layer's contents.
2465    ///
2466    /// It is illegal to pass an invalid layer id.
2467    SetLayerPrimaryConfig {
2468        layer_id: LayerId,
2469        image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
2470        control_handle: CoordinatorControlHandle,
2471    },
2472    /// Sets the layer transform, scaling, and positioning.
2473    ///
2474    /// CheckConfig() will return INVALID_CONFIG if any of the configuration
2475    /// validity conditions specified here is violated.
2476    ///
2477    /// Calling this on a non-primary layer or passing an invalid transform is
2478    /// illegal.
2479    SetLayerPrimaryPosition {
2480        layer_id: LayerId,
2481        image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
2482        image_source: fidl_fuchsia_math::RectU,
2483        display_destination: fidl_fuchsia_math::RectU,
2484        control_handle: CoordinatorControlHandle,
2485    },
2486    /// Sets the alpha mode of the plane.
2487    ///
2488    /// If `mode` == DISABLED, the layer is opaque and `val` is ignored.
2489    ///
2490    /// If `mode` == PREMULTIPLIED or HW_MULTIPLY and `val` is NaN, the alpha
2491    /// used when blending is determined by the per-pixel alpha channel.
2492    ///
2493    /// If `mode` == PREMULTIPLIED or HW_MULTIPLY and `val` is not NaN, the
2494    /// alpha used when blending is the product of `val` and any per-pixel
2495    /// alpha. Additionally, if `mode` == PREMULTIPLIED, then the hardware
2496    /// premultiplies the color channel with `val` before blending.
2497    ///
2498    /// It is illegal to call this on a non-primary layer, to pass an
2499    /// invalid mode, or to pass a value of `val` which is not NaN or
2500    /// in the range [0, 1].
2501    SetLayerPrimaryAlpha {
2502        layer_id: LayerId,
2503        mode: fidl_fuchsia_hardware_display_types::AlphaMode,
2504        val: f32,
2505        control_handle: CoordinatorControlHandle,
2506    },
2507    /// Configures the layer as a solid color fill layer.
2508    ///
2509    /// It is illegal to call this on an invalid layer.
2510    SetLayerColorConfig {
2511        layer_id: LayerId,
2512        color: fidl_fuchsia_hardware_display_types::Color,
2513        display_destination: fidl_fuchsia_math::RectU,
2514        control_handle: CoordinatorControlHandle,
2515    },
2516    /// Sets the image for the layer's draft configuration.
2517    ///
2518    /// If wait_event_id corresponds to an imported event, the driver will
2519    /// wait for ZX_EVENT_SIGNALED on the object before presenting the image.
2520    ///
2521    /// A layer's applied image is the most recently applied image which either has
2522    /// no wait event or whose wait event has been signaled. Whenever a new image
2523    /// is applied, any older images which never got applied are dropped, and
2524    /// their signal events will be fired as soon as their wait events are
2525    /// signaled. The driver also does not have any concept like 'target vsync',
2526    /// meaning that if multiple images are applied within one vsync period, then
2527    /// only the last image will actually be displayed.
2528    ///
2529    /// By default, the driver retains an applied image until a new image is
2530    /// applied. However, setting a layer's ImageConfig with SetLayerPrimaryConfig
2531    /// resets the layer's applied and waiting images, even if the new ImageConfig
2532    /// matches the old ImageConfig.
2533    ///
2534    /// An image cannot be used for multiple layers simultaneously, nor can an
2535    /// image be given back to the display coordinator while it is still in use.
2536    /// An image is considered in use when it is part of a draft configuration
2537    /// or from when its configuration is applied until it is replaced by a
2538    /// subsequent configuration that is *displayed* (not merely applied).
2539    ///
2540    /// It is illegal to call this with an invalid layer or image id, to
2541    /// call it on a color layer, or to call it with an image and layer whose
2542    /// ImageConfigs do not match. It is illegal to apply a configuration
2543    /// with an image layer that has no image (note that is is not illegal to
2544    /// validate such a configuration). It is illegal to reuse a wait event which
2545    /// another layer that has not been presented is waiting on.
2546    ///
2547    /// Each layer can track a maximum of `MAX_WAITING_IMAGES_PER_LAYER` waiting images.
2548    /// An image becomes "waiting" when it is the most recent image set to a layer that appears in
2549    /// a config that is applied via `ApplyConfig()` or similar.  To avoid exceeding the maximum,
2550    /// the client can infer that the image is no longer waiting by:
2551    ///   - noting the config stamp when the config containing the layer/image is applied
2552    ///   - watching for that same (or later) config stamp to be returned by
2553    ///     `CoordinatorListener.OnVsync()`.
2554    SetLayerImage2 {
2555        layer_id: LayerId,
2556        image_id: ImageId,
2557        wait_event_id: EventId,
2558        control_handle: CoordinatorControlHandle,
2559    },
2560    /// Validates the draft configuration.
2561    ///
2562    /// Validation entails checking that the draft configuration can be used
2563    /// by the system's display hardware.
2564    ///
2565    /// Most SetX operations require verifying the draft configuration. The
2566    /// following operations do not require revalidation.
2567    /// * SetLayerImage2()
2568    CheckConfig { responder: CoordinatorCheckConfigResponder },
2569    /// Discard all draft configuration changes.
2570    DiscardConfig { control_handle: CoordinatorControlHandle },
2571    /// Gets the stamp provided with the latest configuration the client
2572    /// submitted (by calling ApplyConfig()) and the display core driver
2573    /// accepted; the display configuration may not have been rendered yet
2574    /// because of pending image availability or draft layer changes.
2575    /// If no configuration was applied before, returns `INVALID_CONFIG_STAMP_VALUE`.
2576    GetLatestAppliedConfigStamp { responder: CoordinatorGetLatestAppliedConfigStampResponder },
2577    /// Applies any draft changes to the current configuration. This will
2578    /// not apply draft changes to layers which are not on any display.
2579    ///
2580    /// If the draft configuration cannot be applied, this call will silently
2581    /// fail, so the client should ensure its configuration is valid by
2582    /// calling [`Coordinator.CheckConfig`].
2583    ApplyConfig3 {
2584        payload: CoordinatorApplyConfig3Request,
2585        control_handle: CoordinatorControlHandle,
2586    },
2587    /// Acknowledges the receipt of one `OnVsync` message.
2588    AcknowledgeVsync { cookie: u64, control_handle: CoordinatorControlHandle },
2589    /// Sets the visibility behavior of the virtcon.
2590    ///
2591    /// This must only be called from the Virtcon client.
2592    SetVirtconMode { mode: VirtconMode, control_handle: CoordinatorControlHandle },
2593    /// Import a sysmem buffer collection token. `buffer_collection_id` must not
2594    /// already be in use.
2595    ImportBufferCollection {
2596        buffer_collection_id: BufferCollectionId,
2597        buffer_collection_token:
2598            fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2599        responder: CoordinatorImportBufferCollectionResponder,
2600    },
2601    /// Release an imported buffer collection.
2602    ReleaseBufferCollection {
2603        buffer_collection_id: BufferCollectionId,
2604        control_handle: CoordinatorControlHandle,
2605    },
2606    /// Takes an imported buffer collection and sets the constraints
2607    /// on it so that it can be imported with a specific config.
2608    SetBufferCollectionConstraints {
2609        buffer_collection_id: BufferCollectionId,
2610        buffer_usage: fidl_fuchsia_hardware_display_types::ImageBufferUsage,
2611        responder: CoordinatorSetBufferCollectionConstraintsResponder,
2612    },
2613    /// Returns true if Capture is supported on the platform.
2614    IsCaptureSupported { responder: CoordinatorIsCaptureSupportedResponder },
2615    /// Starts capture. Client must provide a valid signal_event_id and
2616    /// image_id. signal_event_id must have been imported into the driver
2617    /// using ImportEvent FIDL API. Image_id is the id from ImportImageForCapture.
2618    /// The client will get notified once capture is complete via signal_event_id.
2619    /// Returns ZX_ERR_NOT_SUPPORTED if coordinator does not support capture
2620    StartCapture {
2621        signal_event_id: EventId,
2622        image_id: ImageId,
2623        responder: CoordinatorStartCaptureResponder,
2624    },
2625    /// Set the minimum value of rgb channels. Valid range [0 255] inclusive. Returns
2626    /// ZX_ERR_NOT_SUPPORTED when the display hardware does not support this feature.
2627    /// This API is meant to address backlight bleeding that may occur on some hardware
2628    /// that have a specific type of panel and hardware assembly. The evolution of this
2629    /// API is highly hardware and product dependant and therefore as products evolve, this
2630    /// API may change or support for this API may become non-existent. Therefore, this
2631    /// API should be used with caution.
2632    ///
2633    /// Unlike other calls in this API, SetMiniumRgb is applied immediately, and does not
2634    /// wait for ApplyConfig(). It is, however, still stateful.
2635    SetMinimumRgb { minimum_rgb: u8, responder: CoordinatorSetMinimumRgbResponder },
2636    /// Power off/on the display panel.
2637    ///
2638    /// This call takes effect immediately. Clients don't need to call
2639    /// [`Coordinator.ApplyConfig`].
2640    ///
2641    /// Fails with ZX_ERR_NOT_FOUND if `display_id` does not belong to a display
2642    /// known by the Coordinator. This can happen if a client issues a call to
2643    /// [`Coordinator.SetDisplayPower`] before it receives a notification that
2644    /// the display was removed.
2645    ///
2646    /// Fails with ZX_ERR_NOT_SUPPORTED if the display drivers or the hardware
2647    /// don't support displays on and off.
2648    SetDisplayPower {
2649        display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2650        power_on: bool,
2651        responder: CoordinatorSetDisplayPowerResponder,
2652    },
2653}
2654
2655impl CoordinatorRequest {
2656    #[allow(irrefutable_let_patterns)]
2657    pub fn into_import_image(
2658        self,
2659    ) -> Option<(
2660        fidl_fuchsia_hardware_display_types::ImageMetadata,
2661        BufferCollectionId,
2662        u32,
2663        ImageId,
2664        CoordinatorImportImageResponder,
2665    )> {
2666        if let CoordinatorRequest::ImportImage {
2667            image_metadata,
2668            buffer_collection_id,
2669            buffer_index,
2670            image_id,
2671            responder,
2672        } = self
2673        {
2674            Some((image_metadata, buffer_collection_id, buffer_index, image_id, responder))
2675        } else {
2676            None
2677        }
2678    }
2679
2680    #[allow(irrefutable_let_patterns)]
2681    pub fn into_release_image(self) -> Option<(ImageId, CoordinatorControlHandle)> {
2682        if let CoordinatorRequest::ReleaseImage { image_id, control_handle } = self {
2683            Some((image_id, control_handle))
2684        } else {
2685            None
2686        }
2687    }
2688
2689    #[allow(irrefutable_let_patterns)]
2690    pub fn into_import_event(self) -> Option<(fidl::Event, EventId, CoordinatorControlHandle)> {
2691        if let CoordinatorRequest::ImportEvent { event, id, control_handle } = self {
2692            Some((event, id, control_handle))
2693        } else {
2694            None
2695        }
2696    }
2697
2698    #[allow(irrefutable_let_patterns)]
2699    pub fn into_release_event(self) -> Option<(EventId, CoordinatorControlHandle)> {
2700        if let CoordinatorRequest::ReleaseEvent { id, control_handle } = self {
2701            Some((id, control_handle))
2702        } else {
2703            None
2704        }
2705    }
2706
2707    #[allow(irrefutable_let_patterns)]
2708    pub fn into_create_layer(self) -> Option<(CoordinatorCreateLayerResponder)> {
2709        if let CoordinatorRequest::CreateLayer { responder } = self {
2710            Some((responder))
2711        } else {
2712            None
2713        }
2714    }
2715
2716    #[allow(irrefutable_let_patterns)]
2717    pub fn into_destroy_layer(self) -> Option<(LayerId, CoordinatorControlHandle)> {
2718        if let CoordinatorRequest::DestroyLayer { layer_id, control_handle } = self {
2719            Some((layer_id, control_handle))
2720        } else {
2721            None
2722        }
2723    }
2724
2725    #[allow(irrefutable_let_patterns)]
2726    pub fn into_set_display_mode(
2727        self,
2728    ) -> Option<(
2729        fidl_fuchsia_hardware_display_types::DisplayId,
2730        fidl_fuchsia_hardware_display_types::Mode,
2731        CoordinatorControlHandle,
2732    )> {
2733        if let CoordinatorRequest::SetDisplayMode { display_id, mode, control_handle } = self {
2734            Some((display_id, mode, control_handle))
2735        } else {
2736            None
2737        }
2738    }
2739
2740    #[allow(irrefutable_let_patterns)]
2741    pub fn into_set_display_color_conversion(
2742        self,
2743    ) -> Option<(
2744        fidl_fuchsia_hardware_display_types::DisplayId,
2745        [f32; 3],
2746        [f32; 9],
2747        [f32; 3],
2748        CoordinatorControlHandle,
2749    )> {
2750        if let CoordinatorRequest::SetDisplayColorConversion {
2751            display_id,
2752            preoffsets,
2753            coefficients,
2754            postoffsets,
2755            control_handle,
2756        } = self
2757        {
2758            Some((display_id, preoffsets, coefficients, postoffsets, control_handle))
2759        } else {
2760            None
2761        }
2762    }
2763
2764    #[allow(irrefutable_let_patterns)]
2765    pub fn into_set_display_layers(
2766        self,
2767    ) -> Option<(
2768        fidl_fuchsia_hardware_display_types::DisplayId,
2769        Vec<LayerId>,
2770        CoordinatorControlHandle,
2771    )> {
2772        if let CoordinatorRequest::SetDisplayLayers { display_id, layer_ids, control_handle } = self
2773        {
2774            Some((display_id, layer_ids, control_handle))
2775        } else {
2776            None
2777        }
2778    }
2779
2780    #[allow(irrefutable_let_patterns)]
2781    pub fn into_set_layer_primary_config(
2782        self,
2783    ) -> Option<(
2784        LayerId,
2785        fidl_fuchsia_hardware_display_types::ImageMetadata,
2786        CoordinatorControlHandle,
2787    )> {
2788        if let CoordinatorRequest::SetLayerPrimaryConfig {
2789            layer_id,
2790            image_metadata,
2791            control_handle,
2792        } = self
2793        {
2794            Some((layer_id, image_metadata, control_handle))
2795        } else {
2796            None
2797        }
2798    }
2799
2800    #[allow(irrefutable_let_patterns)]
2801    pub fn into_set_layer_primary_position(
2802        self,
2803    ) -> Option<(
2804        LayerId,
2805        fidl_fuchsia_hardware_display_types::CoordinateTransformation,
2806        fidl_fuchsia_math::RectU,
2807        fidl_fuchsia_math::RectU,
2808        CoordinatorControlHandle,
2809    )> {
2810        if let CoordinatorRequest::SetLayerPrimaryPosition {
2811            layer_id,
2812            image_source_transformation,
2813            image_source,
2814            display_destination,
2815            control_handle,
2816        } = self
2817        {
2818            Some((
2819                layer_id,
2820                image_source_transformation,
2821                image_source,
2822                display_destination,
2823                control_handle,
2824            ))
2825        } else {
2826            None
2827        }
2828    }
2829
2830    #[allow(irrefutable_let_patterns)]
2831    pub fn into_set_layer_primary_alpha(
2832        self,
2833    ) -> Option<(
2834        LayerId,
2835        fidl_fuchsia_hardware_display_types::AlphaMode,
2836        f32,
2837        CoordinatorControlHandle,
2838    )> {
2839        if let CoordinatorRequest::SetLayerPrimaryAlpha { layer_id, mode, val, control_handle } =
2840            self
2841        {
2842            Some((layer_id, mode, val, control_handle))
2843        } else {
2844            None
2845        }
2846    }
2847
2848    #[allow(irrefutable_let_patterns)]
2849    pub fn into_set_layer_color_config(
2850        self,
2851    ) -> Option<(
2852        LayerId,
2853        fidl_fuchsia_hardware_display_types::Color,
2854        fidl_fuchsia_math::RectU,
2855        CoordinatorControlHandle,
2856    )> {
2857        if let CoordinatorRequest::SetLayerColorConfig {
2858            layer_id,
2859            color,
2860            display_destination,
2861            control_handle,
2862        } = self
2863        {
2864            Some((layer_id, color, display_destination, control_handle))
2865        } else {
2866            None
2867        }
2868    }
2869
2870    #[allow(irrefutable_let_patterns)]
2871    pub fn into_set_layer_image2(
2872        self,
2873    ) -> Option<(LayerId, ImageId, EventId, CoordinatorControlHandle)> {
2874        if let CoordinatorRequest::SetLayerImage2 {
2875            layer_id,
2876            image_id,
2877            wait_event_id,
2878            control_handle,
2879        } = self
2880        {
2881            Some((layer_id, image_id, wait_event_id, control_handle))
2882        } else {
2883            None
2884        }
2885    }
2886
2887    #[allow(irrefutable_let_patterns)]
2888    pub fn into_check_config(self) -> Option<(CoordinatorCheckConfigResponder)> {
2889        if let CoordinatorRequest::CheckConfig { responder } = self {
2890            Some((responder))
2891        } else {
2892            None
2893        }
2894    }
2895
2896    #[allow(irrefutable_let_patterns)]
2897    pub fn into_discard_config(self) -> Option<(CoordinatorControlHandle)> {
2898        if let CoordinatorRequest::DiscardConfig { control_handle } = self {
2899            Some((control_handle))
2900        } else {
2901            None
2902        }
2903    }
2904
2905    #[allow(irrefutable_let_patterns)]
2906    pub fn into_get_latest_applied_config_stamp(
2907        self,
2908    ) -> Option<(CoordinatorGetLatestAppliedConfigStampResponder)> {
2909        if let CoordinatorRequest::GetLatestAppliedConfigStamp { responder } = self {
2910            Some((responder))
2911        } else {
2912            None
2913        }
2914    }
2915
2916    #[allow(irrefutable_let_patterns)]
2917    pub fn into_apply_config3(
2918        self,
2919    ) -> Option<(CoordinatorApplyConfig3Request, CoordinatorControlHandle)> {
2920        if let CoordinatorRequest::ApplyConfig3 { payload, control_handle } = self {
2921            Some((payload, control_handle))
2922        } else {
2923            None
2924        }
2925    }
2926
2927    #[allow(irrefutable_let_patterns)]
2928    pub fn into_acknowledge_vsync(self) -> Option<(u64, CoordinatorControlHandle)> {
2929        if let CoordinatorRequest::AcknowledgeVsync { cookie, control_handle } = self {
2930            Some((cookie, control_handle))
2931        } else {
2932            None
2933        }
2934    }
2935
2936    #[allow(irrefutable_let_patterns)]
2937    pub fn into_set_virtcon_mode(self) -> Option<(VirtconMode, CoordinatorControlHandle)> {
2938        if let CoordinatorRequest::SetVirtconMode { mode, control_handle } = self {
2939            Some((mode, control_handle))
2940        } else {
2941            None
2942        }
2943    }
2944
2945    #[allow(irrefutable_let_patterns)]
2946    pub fn into_import_buffer_collection(
2947        self,
2948    ) -> Option<(
2949        BufferCollectionId,
2950        fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2951        CoordinatorImportBufferCollectionResponder,
2952    )> {
2953        if let CoordinatorRequest::ImportBufferCollection {
2954            buffer_collection_id,
2955            buffer_collection_token,
2956            responder,
2957        } = self
2958        {
2959            Some((buffer_collection_id, buffer_collection_token, responder))
2960        } else {
2961            None
2962        }
2963    }
2964
2965    #[allow(irrefutable_let_patterns)]
2966    pub fn into_release_buffer_collection(
2967        self,
2968    ) -> Option<(BufferCollectionId, CoordinatorControlHandle)> {
2969        if let CoordinatorRequest::ReleaseBufferCollection {
2970            buffer_collection_id,
2971            control_handle,
2972        } = self
2973        {
2974            Some((buffer_collection_id, control_handle))
2975        } else {
2976            None
2977        }
2978    }
2979
2980    #[allow(irrefutable_let_patterns)]
2981    pub fn into_set_buffer_collection_constraints(
2982        self,
2983    ) -> Option<(
2984        BufferCollectionId,
2985        fidl_fuchsia_hardware_display_types::ImageBufferUsage,
2986        CoordinatorSetBufferCollectionConstraintsResponder,
2987    )> {
2988        if let CoordinatorRequest::SetBufferCollectionConstraints {
2989            buffer_collection_id,
2990            buffer_usage,
2991            responder,
2992        } = self
2993        {
2994            Some((buffer_collection_id, buffer_usage, responder))
2995        } else {
2996            None
2997        }
2998    }
2999
3000    #[allow(irrefutable_let_patterns)]
3001    pub fn into_is_capture_supported(self) -> Option<(CoordinatorIsCaptureSupportedResponder)> {
3002        if let CoordinatorRequest::IsCaptureSupported { responder } = self {
3003            Some((responder))
3004        } else {
3005            None
3006        }
3007    }
3008
3009    #[allow(irrefutable_let_patterns)]
3010    pub fn into_start_capture(
3011        self,
3012    ) -> Option<(EventId, ImageId, CoordinatorStartCaptureResponder)> {
3013        if let CoordinatorRequest::StartCapture { signal_event_id, image_id, responder } = self {
3014            Some((signal_event_id, image_id, responder))
3015        } else {
3016            None
3017        }
3018    }
3019
3020    #[allow(irrefutable_let_patterns)]
3021    pub fn into_set_minimum_rgb(self) -> Option<(u8, CoordinatorSetMinimumRgbResponder)> {
3022        if let CoordinatorRequest::SetMinimumRgb { minimum_rgb, responder } = self {
3023            Some((minimum_rgb, responder))
3024        } else {
3025            None
3026        }
3027    }
3028
3029    #[allow(irrefutable_let_patterns)]
3030    pub fn into_set_display_power(
3031        self,
3032    ) -> Option<(
3033        fidl_fuchsia_hardware_display_types::DisplayId,
3034        bool,
3035        CoordinatorSetDisplayPowerResponder,
3036    )> {
3037        if let CoordinatorRequest::SetDisplayPower { display_id, power_on, responder } = self {
3038            Some((display_id, power_on, responder))
3039        } else {
3040            None
3041        }
3042    }
3043
3044    /// Name of the method defined in FIDL
3045    pub fn method_name(&self) -> &'static str {
3046        match *self {
3047            CoordinatorRequest::ImportImage { .. } => "import_image",
3048            CoordinatorRequest::ReleaseImage { .. } => "release_image",
3049            CoordinatorRequest::ImportEvent { .. } => "import_event",
3050            CoordinatorRequest::ReleaseEvent { .. } => "release_event",
3051            CoordinatorRequest::CreateLayer { .. } => "create_layer",
3052            CoordinatorRequest::DestroyLayer { .. } => "destroy_layer",
3053            CoordinatorRequest::SetDisplayMode { .. } => "set_display_mode",
3054            CoordinatorRequest::SetDisplayColorConversion { .. } => "set_display_color_conversion",
3055            CoordinatorRequest::SetDisplayLayers { .. } => "set_display_layers",
3056            CoordinatorRequest::SetLayerPrimaryConfig { .. } => "set_layer_primary_config",
3057            CoordinatorRequest::SetLayerPrimaryPosition { .. } => "set_layer_primary_position",
3058            CoordinatorRequest::SetLayerPrimaryAlpha { .. } => "set_layer_primary_alpha",
3059            CoordinatorRequest::SetLayerColorConfig { .. } => "set_layer_color_config",
3060            CoordinatorRequest::SetLayerImage2 { .. } => "set_layer_image2",
3061            CoordinatorRequest::CheckConfig { .. } => "check_config",
3062            CoordinatorRequest::DiscardConfig { .. } => "discard_config",
3063            CoordinatorRequest::GetLatestAppliedConfigStamp { .. } => {
3064                "get_latest_applied_config_stamp"
3065            }
3066            CoordinatorRequest::ApplyConfig3 { .. } => "apply_config3",
3067            CoordinatorRequest::AcknowledgeVsync { .. } => "acknowledge_vsync",
3068            CoordinatorRequest::SetVirtconMode { .. } => "set_virtcon_mode",
3069            CoordinatorRequest::ImportBufferCollection { .. } => "import_buffer_collection",
3070            CoordinatorRequest::ReleaseBufferCollection { .. } => "release_buffer_collection",
3071            CoordinatorRequest::SetBufferCollectionConstraints { .. } => {
3072                "set_buffer_collection_constraints"
3073            }
3074            CoordinatorRequest::IsCaptureSupported { .. } => "is_capture_supported",
3075            CoordinatorRequest::StartCapture { .. } => "start_capture",
3076            CoordinatorRequest::SetMinimumRgb { .. } => "set_minimum_rgb",
3077            CoordinatorRequest::SetDisplayPower { .. } => "set_display_power",
3078        }
3079    }
3080}
3081
3082#[derive(Debug, Clone)]
3083pub struct CoordinatorControlHandle {
3084    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3085}
3086
3087impl fidl::endpoints::ControlHandle for CoordinatorControlHandle {
3088    fn shutdown(&self) {
3089        self.inner.shutdown()
3090    }
3091    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3092        self.inner.shutdown_with_epitaph(status)
3093    }
3094
3095    fn is_closed(&self) -> bool {
3096        self.inner.channel().is_closed()
3097    }
3098    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3099        self.inner.channel().on_closed()
3100    }
3101
3102    #[cfg(target_os = "fuchsia")]
3103    fn signal_peer(
3104        &self,
3105        clear_mask: zx::Signals,
3106        set_mask: zx::Signals,
3107    ) -> Result<(), zx_status::Status> {
3108        use fidl::Peered;
3109        self.inner.channel().signal_peer(clear_mask, set_mask)
3110    }
3111}
3112
3113impl CoordinatorControlHandle {}
3114
3115#[must_use = "FIDL methods require a response to be sent"]
3116#[derive(Debug)]
3117pub struct CoordinatorImportImageResponder {
3118    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3119    tx_id: u32,
3120}
3121
3122/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3123/// if the responder is dropped without sending a response, so that the client
3124/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3125impl std::ops::Drop for CoordinatorImportImageResponder {
3126    fn drop(&mut self) {
3127        self.control_handle.shutdown();
3128        // Safety: drops once, never accessed again
3129        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3130    }
3131}
3132
3133impl fidl::endpoints::Responder for CoordinatorImportImageResponder {
3134    type ControlHandle = CoordinatorControlHandle;
3135
3136    fn control_handle(&self) -> &CoordinatorControlHandle {
3137        &self.control_handle
3138    }
3139
3140    fn drop_without_shutdown(mut self) {
3141        // Safety: drops once, never accessed again due to mem::forget
3142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3143        // Prevent Drop from running (which would shut down the channel)
3144        std::mem::forget(self);
3145    }
3146}
3147
3148impl CoordinatorImportImageResponder {
3149    /// Sends a response to the FIDL transaction.
3150    ///
3151    /// Sets the channel to shutdown if an error occurs.
3152    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3153        let _result = self.send_raw(result);
3154        if _result.is_err() {
3155            self.control_handle.shutdown();
3156        }
3157        self.drop_without_shutdown();
3158        _result
3159    }
3160
3161    /// Similar to "send" but does not shutdown the channel if an error occurs.
3162    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3163        let _result = self.send_raw(result);
3164        self.drop_without_shutdown();
3165        _result
3166    }
3167
3168    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3169        self.control_handle
3170            .inner
3171            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3172                result,
3173                self.tx_id,
3174                0x3a8636eb9656b4f4,
3175                fidl::encoding::DynamicFlags::empty(),
3176            )
3177    }
3178}
3179
3180#[must_use = "FIDL methods require a response to be sent"]
3181#[derive(Debug)]
3182pub struct CoordinatorCreateLayerResponder {
3183    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3184    tx_id: u32,
3185}
3186
3187/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3188/// if the responder is dropped without sending a response, so that the client
3189/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3190impl std::ops::Drop for CoordinatorCreateLayerResponder {
3191    fn drop(&mut self) {
3192        self.control_handle.shutdown();
3193        // Safety: drops once, never accessed again
3194        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3195    }
3196}
3197
3198impl fidl::endpoints::Responder for CoordinatorCreateLayerResponder {
3199    type ControlHandle = CoordinatorControlHandle;
3200
3201    fn control_handle(&self) -> &CoordinatorControlHandle {
3202        &self.control_handle
3203    }
3204
3205    fn drop_without_shutdown(mut self) {
3206        // Safety: drops once, never accessed again due to mem::forget
3207        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3208        // Prevent Drop from running (which would shut down the channel)
3209        std::mem::forget(self);
3210    }
3211}
3212
3213impl CoordinatorCreateLayerResponder {
3214    /// Sends a response to the FIDL transaction.
3215    ///
3216    /// Sets the channel to shutdown if an error occurs.
3217    pub fn send(self, mut result: Result<&LayerId, i32>) -> Result<(), fidl::Error> {
3218        let _result = self.send_raw(result);
3219        if _result.is_err() {
3220            self.control_handle.shutdown();
3221        }
3222        self.drop_without_shutdown();
3223        _result
3224    }
3225
3226    /// Similar to "send" but does not shutdown the channel if an error occurs.
3227    pub fn send_no_shutdown_on_err(
3228        self,
3229        mut result: Result<&LayerId, i32>,
3230    ) -> Result<(), fidl::Error> {
3231        let _result = self.send_raw(result);
3232        self.drop_without_shutdown();
3233        _result
3234    }
3235
3236    fn send_raw(&self, mut result: Result<&LayerId, i32>) -> Result<(), fidl::Error> {
3237        self.control_handle
3238            .inner
3239            .send::<fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>>(
3240                result.map(|layer_id| (layer_id,)),
3241                self.tx_id,
3242                0x2137cfd788a3496b,
3243                fidl::encoding::DynamicFlags::empty(),
3244            )
3245    }
3246}
3247
3248#[must_use = "FIDL methods require a response to be sent"]
3249#[derive(Debug)]
3250pub struct CoordinatorCheckConfigResponder {
3251    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3252    tx_id: u32,
3253}
3254
3255/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3256/// if the responder is dropped without sending a response, so that the client
3257/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3258impl std::ops::Drop for CoordinatorCheckConfigResponder {
3259    fn drop(&mut self) {
3260        self.control_handle.shutdown();
3261        // Safety: drops once, never accessed again
3262        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3263    }
3264}
3265
3266impl fidl::endpoints::Responder for CoordinatorCheckConfigResponder {
3267    type ControlHandle = CoordinatorControlHandle;
3268
3269    fn control_handle(&self) -> &CoordinatorControlHandle {
3270        &self.control_handle
3271    }
3272
3273    fn drop_without_shutdown(mut self) {
3274        // Safety: drops once, never accessed again due to mem::forget
3275        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3276        // Prevent Drop from running (which would shut down the channel)
3277        std::mem::forget(self);
3278    }
3279}
3280
3281impl CoordinatorCheckConfigResponder {
3282    /// Sends a response to the FIDL transaction.
3283    ///
3284    /// Sets the channel to shutdown if an error occurs.
3285    pub fn send(
3286        self,
3287        mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3288    ) -> Result<(), fidl::Error> {
3289        let _result = self.send_raw(res);
3290        if _result.is_err() {
3291            self.control_handle.shutdown();
3292        }
3293        self.drop_without_shutdown();
3294        _result
3295    }
3296
3297    /// Similar to "send" but does not shutdown the channel if an error occurs.
3298    pub fn send_no_shutdown_on_err(
3299        self,
3300        mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3301    ) -> Result<(), fidl::Error> {
3302        let _result = self.send_raw(res);
3303        self.drop_without_shutdown();
3304        _result
3305    }
3306
3307    fn send_raw(
3308        &self,
3309        mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3310    ) -> Result<(), fidl::Error> {
3311        self.control_handle.inner.send::<CoordinatorCheckConfigResponse>(
3312            (res,),
3313            self.tx_id,
3314            0x2bcfb4eb16878158,
3315            fidl::encoding::DynamicFlags::empty(),
3316        )
3317    }
3318}
3319
3320#[must_use = "FIDL methods require a response to be sent"]
3321#[derive(Debug)]
3322pub struct CoordinatorGetLatestAppliedConfigStampResponder {
3323    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3324    tx_id: u32,
3325}
3326
3327/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3328/// if the responder is dropped without sending a response, so that the client
3329/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3330impl std::ops::Drop for CoordinatorGetLatestAppliedConfigStampResponder {
3331    fn drop(&mut self) {
3332        self.control_handle.shutdown();
3333        // Safety: drops once, never accessed again
3334        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3335    }
3336}
3337
3338impl fidl::endpoints::Responder for CoordinatorGetLatestAppliedConfigStampResponder {
3339    type ControlHandle = CoordinatorControlHandle;
3340
3341    fn control_handle(&self) -> &CoordinatorControlHandle {
3342        &self.control_handle
3343    }
3344
3345    fn drop_without_shutdown(mut self) {
3346        // Safety: drops once, never accessed again due to mem::forget
3347        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3348        // Prevent Drop from running (which would shut down the channel)
3349        std::mem::forget(self);
3350    }
3351}
3352
3353impl CoordinatorGetLatestAppliedConfigStampResponder {
3354    /// Sends a response to the FIDL transaction.
3355    ///
3356    /// Sets the channel to shutdown if an error occurs.
3357    pub fn send(self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3358        let _result = self.send_raw(stamp);
3359        if _result.is_err() {
3360            self.control_handle.shutdown();
3361        }
3362        self.drop_without_shutdown();
3363        _result
3364    }
3365
3366    /// Similar to "send" but does not shutdown the channel if an error occurs.
3367    pub fn send_no_shutdown_on_err(self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3368        let _result = self.send_raw(stamp);
3369        self.drop_without_shutdown();
3370        _result
3371    }
3372
3373    fn send_raw(&self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3374        self.control_handle.inner.send::<CoordinatorGetLatestAppliedConfigStampResponse>(
3375            (stamp,),
3376            self.tx_id,
3377            0x76a50c0537265f65,
3378            fidl::encoding::DynamicFlags::empty(),
3379        )
3380    }
3381}
3382
3383#[must_use = "FIDL methods require a response to be sent"]
3384#[derive(Debug)]
3385pub struct CoordinatorImportBufferCollectionResponder {
3386    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3387    tx_id: u32,
3388}
3389
3390/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3391/// if the responder is dropped without sending a response, so that the client
3392/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3393impl std::ops::Drop for CoordinatorImportBufferCollectionResponder {
3394    fn drop(&mut self) {
3395        self.control_handle.shutdown();
3396        // Safety: drops once, never accessed again
3397        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3398    }
3399}
3400
3401impl fidl::endpoints::Responder for CoordinatorImportBufferCollectionResponder {
3402    type ControlHandle = CoordinatorControlHandle;
3403
3404    fn control_handle(&self) -> &CoordinatorControlHandle {
3405        &self.control_handle
3406    }
3407
3408    fn drop_without_shutdown(mut self) {
3409        // Safety: drops once, never accessed again due to mem::forget
3410        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3411        // Prevent Drop from running (which would shut down the channel)
3412        std::mem::forget(self);
3413    }
3414}
3415
3416impl CoordinatorImportBufferCollectionResponder {
3417    /// Sends a response to the FIDL transaction.
3418    ///
3419    /// Sets the channel to shutdown if an error occurs.
3420    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3421        let _result = self.send_raw(result);
3422        if _result.is_err() {
3423            self.control_handle.shutdown();
3424        }
3425        self.drop_without_shutdown();
3426        _result
3427    }
3428
3429    /// Similar to "send" but does not shutdown the channel if an error occurs.
3430    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3431        let _result = self.send_raw(result);
3432        self.drop_without_shutdown();
3433        _result
3434    }
3435
3436    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3437        self.control_handle
3438            .inner
3439            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3440                result,
3441                self.tx_id,
3442                0x30d06f510e7f4601,
3443                fidl::encoding::DynamicFlags::empty(),
3444            )
3445    }
3446}
3447
3448#[must_use = "FIDL methods require a response to be sent"]
3449#[derive(Debug)]
3450pub struct CoordinatorSetBufferCollectionConstraintsResponder {
3451    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3452    tx_id: u32,
3453}
3454
3455/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3456/// if the responder is dropped without sending a response, so that the client
3457/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3458impl std::ops::Drop for CoordinatorSetBufferCollectionConstraintsResponder {
3459    fn drop(&mut self) {
3460        self.control_handle.shutdown();
3461        // Safety: drops once, never accessed again
3462        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3463    }
3464}
3465
3466impl fidl::endpoints::Responder for CoordinatorSetBufferCollectionConstraintsResponder {
3467    type ControlHandle = CoordinatorControlHandle;
3468
3469    fn control_handle(&self) -> &CoordinatorControlHandle {
3470        &self.control_handle
3471    }
3472
3473    fn drop_without_shutdown(mut self) {
3474        // Safety: drops once, never accessed again due to mem::forget
3475        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3476        // Prevent Drop from running (which would shut down the channel)
3477        std::mem::forget(self);
3478    }
3479}
3480
3481impl CoordinatorSetBufferCollectionConstraintsResponder {
3482    /// Sends a response to the FIDL transaction.
3483    ///
3484    /// Sets the channel to shutdown if an error occurs.
3485    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3486        let _result = self.send_raw(result);
3487        if _result.is_err() {
3488            self.control_handle.shutdown();
3489        }
3490        self.drop_without_shutdown();
3491        _result
3492    }
3493
3494    /// Similar to "send" but does not shutdown the channel if an error occurs.
3495    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3496        let _result = self.send_raw(result);
3497        self.drop_without_shutdown();
3498        _result
3499    }
3500
3501    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3502        self.control_handle
3503            .inner
3504            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3505                result,
3506                self.tx_id,
3507                0x509a4ee9af6035df,
3508                fidl::encoding::DynamicFlags::empty(),
3509            )
3510    }
3511}
3512
3513#[must_use = "FIDL methods require a response to be sent"]
3514#[derive(Debug)]
3515pub struct CoordinatorIsCaptureSupportedResponder {
3516    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3517    tx_id: u32,
3518}
3519
3520/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3521/// if the responder is dropped without sending a response, so that the client
3522/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3523impl std::ops::Drop for CoordinatorIsCaptureSupportedResponder {
3524    fn drop(&mut self) {
3525        self.control_handle.shutdown();
3526        // Safety: drops once, never accessed again
3527        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3528    }
3529}
3530
3531impl fidl::endpoints::Responder for CoordinatorIsCaptureSupportedResponder {
3532    type ControlHandle = CoordinatorControlHandle;
3533
3534    fn control_handle(&self) -> &CoordinatorControlHandle {
3535        &self.control_handle
3536    }
3537
3538    fn drop_without_shutdown(mut self) {
3539        // Safety: drops once, never accessed again due to mem::forget
3540        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3541        // Prevent Drop from running (which would shut down the channel)
3542        std::mem::forget(self);
3543    }
3544}
3545
3546impl CoordinatorIsCaptureSupportedResponder {
3547    /// Sends a response to the FIDL transaction.
3548    ///
3549    /// Sets the channel to shutdown if an error occurs.
3550    pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3551        let _result = self.send_raw(result);
3552        if _result.is_err() {
3553            self.control_handle.shutdown();
3554        }
3555        self.drop_without_shutdown();
3556        _result
3557    }
3558
3559    /// Similar to "send" but does not shutdown the channel if an error occurs.
3560    pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3561        let _result = self.send_raw(result);
3562        self.drop_without_shutdown();
3563        _result
3564    }
3565
3566    fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3567        self.control_handle.inner.send::<fidl::encoding::ResultType<
3568            CoordinatorIsCaptureSupportedResponse,
3569            i32,
3570        >>(
3571            result.map(|supported| (supported,)),
3572            self.tx_id,
3573            0x4ca407277277971b,
3574            fidl::encoding::DynamicFlags::empty(),
3575        )
3576    }
3577}
3578
3579#[must_use = "FIDL methods require a response to be sent"]
3580#[derive(Debug)]
3581pub struct CoordinatorStartCaptureResponder {
3582    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3583    tx_id: u32,
3584}
3585
3586/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3587/// if the responder is dropped without sending a response, so that the client
3588/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3589impl std::ops::Drop for CoordinatorStartCaptureResponder {
3590    fn drop(&mut self) {
3591        self.control_handle.shutdown();
3592        // Safety: drops once, never accessed again
3593        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3594    }
3595}
3596
3597impl fidl::endpoints::Responder for CoordinatorStartCaptureResponder {
3598    type ControlHandle = CoordinatorControlHandle;
3599
3600    fn control_handle(&self) -> &CoordinatorControlHandle {
3601        &self.control_handle
3602    }
3603
3604    fn drop_without_shutdown(mut self) {
3605        // Safety: drops once, never accessed again due to mem::forget
3606        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3607        // Prevent Drop from running (which would shut down the channel)
3608        std::mem::forget(self);
3609    }
3610}
3611
3612impl CoordinatorStartCaptureResponder {
3613    /// Sends a response to the FIDL transaction.
3614    ///
3615    /// Sets the channel to shutdown if an error occurs.
3616    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3617        let _result = self.send_raw(result);
3618        if _result.is_err() {
3619            self.control_handle.shutdown();
3620        }
3621        self.drop_without_shutdown();
3622        _result
3623    }
3624
3625    /// Similar to "send" but does not shutdown the channel if an error occurs.
3626    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3627        let _result = self.send_raw(result);
3628        self.drop_without_shutdown();
3629        _result
3630    }
3631
3632    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3633        self.control_handle
3634            .inner
3635            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3636                result,
3637                self.tx_id,
3638                0x35cb38f19d96a8db,
3639                fidl::encoding::DynamicFlags::empty(),
3640            )
3641    }
3642}
3643
3644#[must_use = "FIDL methods require a response to be sent"]
3645#[derive(Debug)]
3646pub struct CoordinatorSetMinimumRgbResponder {
3647    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3648    tx_id: u32,
3649}
3650
3651/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3652/// if the responder is dropped without sending a response, so that the client
3653/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3654impl std::ops::Drop for CoordinatorSetMinimumRgbResponder {
3655    fn drop(&mut self) {
3656        self.control_handle.shutdown();
3657        // Safety: drops once, never accessed again
3658        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3659    }
3660}
3661
3662impl fidl::endpoints::Responder for CoordinatorSetMinimumRgbResponder {
3663    type ControlHandle = CoordinatorControlHandle;
3664
3665    fn control_handle(&self) -> &CoordinatorControlHandle {
3666        &self.control_handle
3667    }
3668
3669    fn drop_without_shutdown(mut self) {
3670        // Safety: drops once, never accessed again due to mem::forget
3671        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3672        // Prevent Drop from running (which would shut down the channel)
3673        std::mem::forget(self);
3674    }
3675}
3676
3677impl CoordinatorSetMinimumRgbResponder {
3678    /// Sends a response to the FIDL transaction.
3679    ///
3680    /// Sets the channel to shutdown if an error occurs.
3681    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3682        let _result = self.send_raw(result);
3683        if _result.is_err() {
3684            self.control_handle.shutdown();
3685        }
3686        self.drop_without_shutdown();
3687        _result
3688    }
3689
3690    /// Similar to "send" but does not shutdown the channel if an error occurs.
3691    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3692        let _result = self.send_raw(result);
3693        self.drop_without_shutdown();
3694        _result
3695    }
3696
3697    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3698        self.control_handle
3699            .inner
3700            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3701                result,
3702                self.tx_id,
3703                0x1b49251437038b0b,
3704                fidl::encoding::DynamicFlags::empty(),
3705            )
3706    }
3707}
3708
3709#[must_use = "FIDL methods require a response to be sent"]
3710#[derive(Debug)]
3711pub struct CoordinatorSetDisplayPowerResponder {
3712    control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3713    tx_id: u32,
3714}
3715
3716/// Set the the channel to be shutdown (see [`CoordinatorControlHandle::shutdown`])
3717/// if the responder is dropped without sending a response, so that the client
3718/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3719impl std::ops::Drop for CoordinatorSetDisplayPowerResponder {
3720    fn drop(&mut self) {
3721        self.control_handle.shutdown();
3722        // Safety: drops once, never accessed again
3723        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3724    }
3725}
3726
3727impl fidl::endpoints::Responder for CoordinatorSetDisplayPowerResponder {
3728    type ControlHandle = CoordinatorControlHandle;
3729
3730    fn control_handle(&self) -> &CoordinatorControlHandle {
3731        &self.control_handle
3732    }
3733
3734    fn drop_without_shutdown(mut self) {
3735        // Safety: drops once, never accessed again due to mem::forget
3736        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3737        // Prevent Drop from running (which would shut down the channel)
3738        std::mem::forget(self);
3739    }
3740}
3741
3742impl CoordinatorSetDisplayPowerResponder {
3743    /// Sends a response to the FIDL transaction.
3744    ///
3745    /// Sets the channel to shutdown if an error occurs.
3746    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3747        let _result = self.send_raw(result);
3748        if _result.is_err() {
3749            self.control_handle.shutdown();
3750        }
3751        self.drop_without_shutdown();
3752        _result
3753    }
3754
3755    /// Similar to "send" but does not shutdown the channel if an error occurs.
3756    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3757        let _result = self.send_raw(result);
3758        self.drop_without_shutdown();
3759        _result
3760    }
3761
3762    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3763        self.control_handle
3764            .inner
3765            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3766                result,
3767                self.tx_id,
3768                0x10feb62d11d9e92b,
3769                fidl::encoding::DynamicFlags::empty(),
3770            )
3771    }
3772}
3773
3774#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3775pub struct CoordinatorListenerMarker;
3776
3777impl fidl::endpoints::ProtocolMarker for CoordinatorListenerMarker {
3778    type Proxy = CoordinatorListenerProxy;
3779    type RequestStream = CoordinatorListenerRequestStream;
3780    #[cfg(target_os = "fuchsia")]
3781    type SynchronousProxy = CoordinatorListenerSynchronousProxy;
3782
3783    const DEBUG_NAME: &'static str = "(anonymous) CoordinatorListener";
3784}
3785
3786pub trait CoordinatorListenerProxyInterface: Send + Sync {
3787    fn r#on_displays_changed(
3788        &self,
3789        added: &[Info],
3790        removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
3791    ) -> Result<(), fidl::Error>;
3792    fn r#on_vsync(
3793        &self,
3794        display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
3795        timestamp: fidl::MonotonicInstant,
3796        applied_config_stamp: &ConfigStamp,
3797        cookie: &VsyncAckCookie,
3798    ) -> Result<(), fidl::Error>;
3799    fn r#on_client_ownership_change(&self, has_ownership: bool) -> Result<(), fidl::Error>;
3800}
3801#[derive(Debug)]
3802#[cfg(target_os = "fuchsia")]
3803pub struct CoordinatorListenerSynchronousProxy {
3804    client: fidl::client::sync::Client,
3805}
3806
3807#[cfg(target_os = "fuchsia")]
3808impl fidl::endpoints::SynchronousProxy for CoordinatorListenerSynchronousProxy {
3809    type Proxy = CoordinatorListenerProxy;
3810    type Protocol = CoordinatorListenerMarker;
3811
3812    fn from_channel(inner: fidl::Channel) -> Self {
3813        Self::new(inner)
3814    }
3815
3816    fn into_channel(self) -> fidl::Channel {
3817        self.client.into_channel()
3818    }
3819
3820    fn as_channel(&self) -> &fidl::Channel {
3821        self.client.as_channel()
3822    }
3823}
3824
3825#[cfg(target_os = "fuchsia")]
3826impl CoordinatorListenerSynchronousProxy {
3827    pub fn new(channel: fidl::Channel) -> Self {
3828        let protocol_name =
3829            <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3830        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3831    }
3832
3833    pub fn into_channel(self) -> fidl::Channel {
3834        self.client.into_channel()
3835    }
3836
3837    /// Waits until an event arrives and returns it. It is safe for other
3838    /// threads to make concurrent requests while waiting for an event.
3839    pub fn wait_for_event(
3840        &self,
3841        deadline: zx::MonotonicInstant,
3842    ) -> Result<CoordinatorListenerEvent, fidl::Error> {
3843        CoordinatorListenerEvent::decode(self.client.wait_for_event(deadline)?)
3844    }
3845
3846    /// Called when the set of connected displays changes.
3847    ///
3848    /// Also used to communicate the set of connected displays to a newly
3849    /// connected client.
3850    ///
3851    /// After this method is called, all applied and draft configurations may no
3852    /// longer be valid. The client must validate and apply a new configuration,
3853    /// by calling [`Coordinator.CheckConfig`] and [`Coordinator.ApplyConfig`].
3854    ///
3855    /// `added` and `removed` must not be both empty.
3856    pub fn r#on_displays_changed(
3857        &self,
3858        mut added: &[Info],
3859        mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
3860    ) -> Result<(), fidl::Error> {
3861        self.client.send::<CoordinatorListenerOnDisplaysChangedRequest>(
3862            (added, removed),
3863            0x248fbe90c338a94f,
3864            fidl::encoding::DynamicFlags::empty(),
3865        )
3866    }
3867
3868    /// Called on every display Vertical Synchronization (Vsync).
3869    ///
3870    /// Clients must acknowledge VSync events via the method
3871    /// [`Coordinator.AcknowledgeVsync`].  The coordinator may throttle a client
3872    /// that accumulates a certain number of unacknowledged VSync cookies.
3873    /// Throttled clients do not receive VSync events.
3874    ///
3875    /// After a the client catches up on acknowledging cookies, the coordinator
3876    /// will unthrottle it (resume sending VSync events). Throttled clients may
3877    /// miss some VSync events, as the coordinator is allowed to drop VSync
3878    /// event information for throttled clients.
3879    ///
3880    /// When dropping VSync event information for throttled clients, the
3881    /// coordinator should prioritize retaining the information for newer
3882    /// events. In other words, the oldest unreported events should be dropped
3883    /// first.
3884    pub fn r#on_vsync(
3885        &self,
3886        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
3887        mut timestamp: fidl::MonotonicInstant,
3888        mut applied_config_stamp: &ConfigStamp,
3889        mut cookie: &VsyncAckCookie,
3890    ) -> Result<(), fidl::Error> {
3891        self.client.send::<CoordinatorListenerOnVsyncRequest>(
3892            (display_id, timestamp, applied_config_stamp, cookie),
3893            0x249e9b8da7a7ac47,
3894            fidl::encoding::DynamicFlags::empty(),
3895        )
3896    }
3897
3898    /// Called when the corresponding `Coordinator` client gains or loses
3899    /// ownership of the displays.
3900    ///
3901    /// A `Coordinator` client's active config is displayed iff it holds the
3902    /// ownership of the displays.
3903    ///
3904    /// A new `Coordinator` client should assume they do not have ownership
3905    /// of the displays until this method informs them otherwise.
3906    pub fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
3907        self.client.send::<CoordinatorListenerOnClientOwnershipChangeRequest>(
3908            (has_ownership,),
3909            0x1acd2ae683153d5e,
3910            fidl::encoding::DynamicFlags::empty(),
3911        )
3912    }
3913}
3914
3915#[cfg(target_os = "fuchsia")]
3916impl From<CoordinatorListenerSynchronousProxy> for zx::Handle {
3917    fn from(value: CoordinatorListenerSynchronousProxy) -> Self {
3918        value.into_channel().into()
3919    }
3920}
3921
3922#[cfg(target_os = "fuchsia")]
3923impl From<fidl::Channel> for CoordinatorListenerSynchronousProxy {
3924    fn from(value: fidl::Channel) -> Self {
3925        Self::new(value)
3926    }
3927}
3928
3929#[cfg(target_os = "fuchsia")]
3930impl fidl::endpoints::FromClient for CoordinatorListenerSynchronousProxy {
3931    type Protocol = CoordinatorListenerMarker;
3932
3933    fn from_client(value: fidl::endpoints::ClientEnd<CoordinatorListenerMarker>) -> Self {
3934        Self::new(value.into_channel())
3935    }
3936}
3937
3938#[derive(Debug, Clone)]
3939pub struct CoordinatorListenerProxy {
3940    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3941}
3942
3943impl fidl::endpoints::Proxy for CoordinatorListenerProxy {
3944    type Protocol = CoordinatorListenerMarker;
3945
3946    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3947        Self::new(inner)
3948    }
3949
3950    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3951        self.client.into_channel().map_err(|client| Self { client })
3952    }
3953
3954    fn as_channel(&self) -> &::fidl::AsyncChannel {
3955        self.client.as_channel()
3956    }
3957}
3958
3959impl CoordinatorListenerProxy {
3960    /// Create a new Proxy for fuchsia.hardware.display/CoordinatorListener.
3961    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3962        let protocol_name =
3963            <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3964        Self { client: fidl::client::Client::new(channel, protocol_name) }
3965    }
3966
3967    /// Get a Stream of events from the remote end of the protocol.
3968    ///
3969    /// # Panics
3970    ///
3971    /// Panics if the event stream was already taken.
3972    pub fn take_event_stream(&self) -> CoordinatorListenerEventStream {
3973        CoordinatorListenerEventStream { event_receiver: self.client.take_event_receiver() }
3974    }
3975
3976    /// Called when the set of connected displays changes.
3977    ///
3978    /// Also used to communicate the set of connected displays to a newly
3979    /// connected client.
3980    ///
3981    /// After this method is called, all applied and draft configurations may no
3982    /// longer be valid. The client must validate and apply a new configuration,
3983    /// by calling [`Coordinator.CheckConfig`] and [`Coordinator.ApplyConfig`].
3984    ///
3985    /// `added` and `removed` must not be both empty.
3986    pub fn r#on_displays_changed(
3987        &self,
3988        mut added: &[Info],
3989        mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
3990    ) -> Result<(), fidl::Error> {
3991        CoordinatorListenerProxyInterface::r#on_displays_changed(self, added, removed)
3992    }
3993
3994    /// Called on every display Vertical Synchronization (Vsync).
3995    ///
3996    /// Clients must acknowledge VSync events via the method
3997    /// [`Coordinator.AcknowledgeVsync`].  The coordinator may throttle a client
3998    /// that accumulates a certain number of unacknowledged VSync cookies.
3999    /// Throttled clients do not receive VSync events.
4000    ///
4001    /// After a the client catches up on acknowledging cookies, the coordinator
4002    /// will unthrottle it (resume sending VSync events). Throttled clients may
4003    /// miss some VSync events, as the coordinator is allowed to drop VSync
4004    /// event information for throttled clients.
4005    ///
4006    /// When dropping VSync event information for throttled clients, the
4007    /// coordinator should prioritize retaining the information for newer
4008    /// events. In other words, the oldest unreported events should be dropped
4009    /// first.
4010    pub fn r#on_vsync(
4011        &self,
4012        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
4013        mut timestamp: fidl::MonotonicInstant,
4014        mut applied_config_stamp: &ConfigStamp,
4015        mut cookie: &VsyncAckCookie,
4016    ) -> Result<(), fidl::Error> {
4017        CoordinatorListenerProxyInterface::r#on_vsync(
4018            self,
4019            display_id,
4020            timestamp,
4021            applied_config_stamp,
4022            cookie,
4023        )
4024    }
4025
4026    /// Called when the corresponding `Coordinator` client gains or loses
4027    /// ownership of the displays.
4028    ///
4029    /// A `Coordinator` client's active config is displayed iff it holds the
4030    /// ownership of the displays.
4031    ///
4032    /// A new `Coordinator` client should assume they do not have ownership
4033    /// of the displays until this method informs them otherwise.
4034    pub fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
4035        CoordinatorListenerProxyInterface::r#on_client_ownership_change(self, has_ownership)
4036    }
4037}
4038
4039impl CoordinatorListenerProxyInterface for CoordinatorListenerProxy {
4040    fn r#on_displays_changed(
4041        &self,
4042        mut added: &[Info],
4043        mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
4044    ) -> Result<(), fidl::Error> {
4045        self.client.send::<CoordinatorListenerOnDisplaysChangedRequest>(
4046            (added, removed),
4047            0x248fbe90c338a94f,
4048            fidl::encoding::DynamicFlags::empty(),
4049        )
4050    }
4051
4052    fn r#on_vsync(
4053        &self,
4054        mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
4055        mut timestamp: fidl::MonotonicInstant,
4056        mut applied_config_stamp: &ConfigStamp,
4057        mut cookie: &VsyncAckCookie,
4058    ) -> Result<(), fidl::Error> {
4059        self.client.send::<CoordinatorListenerOnVsyncRequest>(
4060            (display_id, timestamp, applied_config_stamp, cookie),
4061            0x249e9b8da7a7ac47,
4062            fidl::encoding::DynamicFlags::empty(),
4063        )
4064    }
4065
4066    fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
4067        self.client.send::<CoordinatorListenerOnClientOwnershipChangeRequest>(
4068            (has_ownership,),
4069            0x1acd2ae683153d5e,
4070            fidl::encoding::DynamicFlags::empty(),
4071        )
4072    }
4073}
4074
4075pub struct CoordinatorListenerEventStream {
4076    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4077}
4078
4079impl std::marker::Unpin for CoordinatorListenerEventStream {}
4080
4081impl futures::stream::FusedStream for CoordinatorListenerEventStream {
4082    fn is_terminated(&self) -> bool {
4083        self.event_receiver.is_terminated()
4084    }
4085}
4086
4087impl futures::Stream for CoordinatorListenerEventStream {
4088    type Item = Result<CoordinatorListenerEvent, fidl::Error>;
4089
4090    fn poll_next(
4091        mut self: std::pin::Pin<&mut Self>,
4092        cx: &mut std::task::Context<'_>,
4093    ) -> std::task::Poll<Option<Self::Item>> {
4094        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4095            &mut self.event_receiver,
4096            cx
4097        )?) {
4098            Some(buf) => std::task::Poll::Ready(Some(CoordinatorListenerEvent::decode(buf))),
4099            None => std::task::Poll::Ready(None),
4100        }
4101    }
4102}
4103
4104#[derive(Debug)]
4105pub enum CoordinatorListenerEvent {
4106    #[non_exhaustive]
4107    _UnknownEvent {
4108        /// Ordinal of the event that was sent.
4109        ordinal: u64,
4110    },
4111}
4112
4113impl CoordinatorListenerEvent {
4114    /// Decodes a message buffer as a [`CoordinatorListenerEvent`].
4115    fn decode(
4116        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4117    ) -> Result<CoordinatorListenerEvent, fidl::Error> {
4118        let (bytes, _handles) = buf.split_mut();
4119        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4120        debug_assert_eq!(tx_header.tx_id, 0);
4121        match tx_header.ordinal {
4122            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4123                Ok(CoordinatorListenerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4124            }
4125            _ => Err(fidl::Error::UnknownOrdinal {
4126                ordinal: tx_header.ordinal,
4127                protocol_name:
4128                    <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4129            }),
4130        }
4131    }
4132}
4133
4134/// A Stream of incoming requests for fuchsia.hardware.display/CoordinatorListener.
4135pub struct CoordinatorListenerRequestStream {
4136    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4137    is_terminated: bool,
4138}
4139
4140impl std::marker::Unpin for CoordinatorListenerRequestStream {}
4141
4142impl futures::stream::FusedStream for CoordinatorListenerRequestStream {
4143    fn is_terminated(&self) -> bool {
4144        self.is_terminated
4145    }
4146}
4147
4148impl fidl::endpoints::RequestStream for CoordinatorListenerRequestStream {
4149    type Protocol = CoordinatorListenerMarker;
4150    type ControlHandle = CoordinatorListenerControlHandle;
4151
4152    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4153        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4154    }
4155
4156    fn control_handle(&self) -> Self::ControlHandle {
4157        CoordinatorListenerControlHandle { inner: self.inner.clone() }
4158    }
4159
4160    fn into_inner(
4161        self,
4162    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4163    {
4164        (self.inner, self.is_terminated)
4165    }
4166
4167    fn from_inner(
4168        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4169        is_terminated: bool,
4170    ) -> Self {
4171        Self { inner, is_terminated }
4172    }
4173}
4174
4175impl futures::Stream for CoordinatorListenerRequestStream {
4176    type Item = Result<CoordinatorListenerRequest, fidl::Error>;
4177
4178    fn poll_next(
4179        mut self: std::pin::Pin<&mut Self>,
4180        cx: &mut std::task::Context<'_>,
4181    ) -> std::task::Poll<Option<Self::Item>> {
4182        let this = &mut *self;
4183        if this.inner.check_shutdown(cx) {
4184            this.is_terminated = true;
4185            return std::task::Poll::Ready(None);
4186        }
4187        if this.is_terminated {
4188            panic!("polled CoordinatorListenerRequestStream after completion");
4189        }
4190        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4191            |bytes, handles| {
4192                match this.inner.channel().read_etc(cx, bytes, handles) {
4193                    std::task::Poll::Ready(Ok(())) => {}
4194                    std::task::Poll::Pending => return std::task::Poll::Pending,
4195                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4196                        this.is_terminated = true;
4197                        return std::task::Poll::Ready(None);
4198                    }
4199                    std::task::Poll::Ready(Err(e)) => {
4200                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4201                            e.into(),
4202                        ))));
4203                    }
4204                }
4205
4206                // A message has been received from the channel
4207                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4208
4209                std::task::Poll::Ready(Some(match header.ordinal {
4210                0x248fbe90c338a94f => {
4211                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4212                    let mut req = fidl::new_empty!(CoordinatorListenerOnDisplaysChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4213                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnDisplaysChangedRequest>(&header, _body_bytes, handles, &mut req)?;
4214                    let control_handle = CoordinatorListenerControlHandle {
4215                        inner: this.inner.clone(),
4216                    };
4217                    Ok(CoordinatorListenerRequest::OnDisplaysChanged {added: req.added,
4218removed: req.removed,
4219
4220                        control_handle,
4221                    })
4222                }
4223                0x249e9b8da7a7ac47 => {
4224                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4225                    let mut req = fidl::new_empty!(CoordinatorListenerOnVsyncRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4226                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
4227                    let control_handle = CoordinatorListenerControlHandle {
4228                        inner: this.inner.clone(),
4229                    };
4230                    Ok(CoordinatorListenerRequest::OnVsync {display_id: req.display_id,
4231timestamp: req.timestamp,
4232applied_config_stamp: req.applied_config_stamp,
4233cookie: req.cookie,
4234
4235                        control_handle,
4236                    })
4237                }
4238                0x1acd2ae683153d5e => {
4239                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4240                    let mut req = fidl::new_empty!(CoordinatorListenerOnClientOwnershipChangeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4241                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnClientOwnershipChangeRequest>(&header, _body_bytes, handles, &mut req)?;
4242                    let control_handle = CoordinatorListenerControlHandle {
4243                        inner: this.inner.clone(),
4244                    };
4245                    Ok(CoordinatorListenerRequest::OnClientOwnershipChange {has_ownership: req.has_ownership,
4246
4247                        control_handle,
4248                    })
4249                }
4250                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4251                    Ok(CoordinatorListenerRequest::_UnknownMethod {
4252                        ordinal: header.ordinal,
4253                        control_handle: CoordinatorListenerControlHandle { inner: this.inner.clone() },
4254                        method_type: fidl::MethodType::OneWay,
4255                    })
4256                }
4257                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4258                    this.inner.send_framework_err(
4259                        fidl::encoding::FrameworkErr::UnknownMethod,
4260                        header.tx_id,
4261                        header.ordinal,
4262                        header.dynamic_flags(),
4263                        (bytes, handles),
4264                    )?;
4265                    Ok(CoordinatorListenerRequest::_UnknownMethod {
4266                        ordinal: header.ordinal,
4267                        control_handle: CoordinatorListenerControlHandle { inner: this.inner.clone() },
4268                        method_type: fidl::MethodType::TwoWay,
4269                    })
4270                }
4271                _ => Err(fidl::Error::UnknownOrdinal {
4272                    ordinal: header.ordinal,
4273                    protocol_name: <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4274                }),
4275            }))
4276            },
4277        )
4278    }
4279}
4280
4281/// Provides updates from a `Coordinator` to one of its clients.
4282///
4283/// This protocol solely consists of one-way methods.
4284#[derive(Debug)]
4285pub enum CoordinatorListenerRequest {
4286    /// Called when the set of connected displays changes.
4287    ///
4288    /// Also used to communicate the set of connected displays to a newly
4289    /// connected client.
4290    ///
4291    /// After this method is called, all applied and draft configurations may no
4292    /// longer be valid. The client must validate and apply a new configuration,
4293    /// by calling [`Coordinator.CheckConfig`] and [`Coordinator.ApplyConfig`].
4294    ///
4295    /// `added` and `removed` must not be both empty.
4296    OnDisplaysChanged {
4297        added: Vec<Info>,
4298        removed: Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
4299        control_handle: CoordinatorListenerControlHandle,
4300    },
4301    /// Called on every display Vertical Synchronization (Vsync).
4302    ///
4303    /// Clients must acknowledge VSync events via the method
4304    /// [`Coordinator.AcknowledgeVsync`].  The coordinator may throttle a client
4305    /// that accumulates a certain number of unacknowledged VSync cookies.
4306    /// Throttled clients do not receive VSync events.
4307    ///
4308    /// After a the client catches up on acknowledging cookies, the coordinator
4309    /// will unthrottle it (resume sending VSync events). Throttled clients may
4310    /// miss some VSync events, as the coordinator is allowed to drop VSync
4311    /// event information for throttled clients.
4312    ///
4313    /// When dropping VSync event information for throttled clients, the
4314    /// coordinator should prioritize retaining the information for newer
4315    /// events. In other words, the oldest unreported events should be dropped
4316    /// first.
4317    OnVsync {
4318        display_id: fidl_fuchsia_hardware_display_types::DisplayId,
4319        timestamp: fidl::MonotonicInstant,
4320        applied_config_stamp: ConfigStamp,
4321        cookie: VsyncAckCookie,
4322        control_handle: CoordinatorListenerControlHandle,
4323    },
4324    /// Called when the corresponding `Coordinator` client gains or loses
4325    /// ownership of the displays.
4326    ///
4327    /// A `Coordinator` client's active config is displayed iff it holds the
4328    /// ownership of the displays.
4329    ///
4330    /// A new `Coordinator` client should assume they do not have ownership
4331    /// of the displays until this method informs them otherwise.
4332    OnClientOwnershipChange {
4333        has_ownership: bool,
4334        control_handle: CoordinatorListenerControlHandle,
4335    },
4336    /// An interaction was received which does not match any known method.
4337    #[non_exhaustive]
4338    _UnknownMethod {
4339        /// Ordinal of the method that was called.
4340        ordinal: u64,
4341        control_handle: CoordinatorListenerControlHandle,
4342        method_type: fidl::MethodType,
4343    },
4344}
4345
4346impl CoordinatorListenerRequest {
4347    #[allow(irrefutable_let_patterns)]
4348    pub fn into_on_displays_changed(
4349        self,
4350    ) -> Option<(
4351        Vec<Info>,
4352        Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
4353        CoordinatorListenerControlHandle,
4354    )> {
4355        if let CoordinatorListenerRequest::OnDisplaysChanged { added, removed, control_handle } =
4356            self
4357        {
4358            Some((added, removed, control_handle))
4359        } else {
4360            None
4361        }
4362    }
4363
4364    #[allow(irrefutable_let_patterns)]
4365    pub fn into_on_vsync(
4366        self,
4367    ) -> Option<(
4368        fidl_fuchsia_hardware_display_types::DisplayId,
4369        fidl::MonotonicInstant,
4370        ConfigStamp,
4371        VsyncAckCookie,
4372        CoordinatorListenerControlHandle,
4373    )> {
4374        if let CoordinatorListenerRequest::OnVsync {
4375            display_id,
4376            timestamp,
4377            applied_config_stamp,
4378            cookie,
4379            control_handle,
4380        } = self
4381        {
4382            Some((display_id, timestamp, applied_config_stamp, cookie, control_handle))
4383        } else {
4384            None
4385        }
4386    }
4387
4388    #[allow(irrefutable_let_patterns)]
4389    pub fn into_on_client_ownership_change(
4390        self,
4391    ) -> Option<(bool, CoordinatorListenerControlHandle)> {
4392        if let CoordinatorListenerRequest::OnClientOwnershipChange {
4393            has_ownership,
4394            control_handle,
4395        } = self
4396        {
4397            Some((has_ownership, control_handle))
4398        } else {
4399            None
4400        }
4401    }
4402
4403    /// Name of the method defined in FIDL
4404    pub fn method_name(&self) -> &'static str {
4405        match *self {
4406            CoordinatorListenerRequest::OnDisplaysChanged { .. } => "on_displays_changed",
4407            CoordinatorListenerRequest::OnVsync { .. } => "on_vsync",
4408            CoordinatorListenerRequest::OnClientOwnershipChange { .. } => {
4409                "on_client_ownership_change"
4410            }
4411            CoordinatorListenerRequest::_UnknownMethod {
4412                method_type: fidl::MethodType::OneWay,
4413                ..
4414            } => "unknown one-way method",
4415            CoordinatorListenerRequest::_UnknownMethod {
4416                method_type: fidl::MethodType::TwoWay,
4417                ..
4418            } => "unknown two-way method",
4419        }
4420    }
4421}
4422
4423#[derive(Debug, Clone)]
4424pub struct CoordinatorListenerControlHandle {
4425    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4426}
4427
4428impl fidl::endpoints::ControlHandle for CoordinatorListenerControlHandle {
4429    fn shutdown(&self) {
4430        self.inner.shutdown()
4431    }
4432    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4433        self.inner.shutdown_with_epitaph(status)
4434    }
4435
4436    fn is_closed(&self) -> bool {
4437        self.inner.channel().is_closed()
4438    }
4439    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4440        self.inner.channel().on_closed()
4441    }
4442
4443    #[cfg(target_os = "fuchsia")]
4444    fn signal_peer(
4445        &self,
4446        clear_mask: zx::Signals,
4447        set_mask: zx::Signals,
4448    ) -> Result<(), zx_status::Status> {
4449        use fidl::Peered;
4450        self.inner.channel().signal_peer(clear_mask, set_mask)
4451    }
4452}
4453
4454impl CoordinatorListenerControlHandle {}
4455
4456#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4457pub struct ProviderMarker;
4458
4459impl fidl::endpoints::ProtocolMarker for ProviderMarker {
4460    type Proxy = ProviderProxy;
4461    type RequestStream = ProviderRequestStream;
4462    #[cfg(target_os = "fuchsia")]
4463    type SynchronousProxy = ProviderSynchronousProxy;
4464
4465    const DEBUG_NAME: &'static str = "fuchsia.hardware.display.Provider";
4466}
4467impl fidl::endpoints::DiscoverableProtocolMarker for ProviderMarker {}
4468pub type ProviderOpenCoordinatorWithListenerForVirtconResult = Result<(), i32>;
4469pub type ProviderOpenCoordinatorWithListenerForPrimaryResult = Result<(), i32>;
4470
4471pub trait ProviderProxyInterface: Send + Sync {
4472    type OpenCoordinatorWithListenerForVirtconResponseFut: std::future::Future<
4473            Output = Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error>,
4474        > + Send;
4475    fn r#open_coordinator_with_listener_for_virtcon(
4476        &self,
4477        payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4478    ) -> Self::OpenCoordinatorWithListenerForVirtconResponseFut;
4479    type OpenCoordinatorWithListenerForPrimaryResponseFut: std::future::Future<
4480            Output = Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error>,
4481        > + Send;
4482    fn r#open_coordinator_with_listener_for_primary(
4483        &self,
4484        payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4485    ) -> Self::OpenCoordinatorWithListenerForPrimaryResponseFut;
4486}
4487#[derive(Debug)]
4488#[cfg(target_os = "fuchsia")]
4489pub struct ProviderSynchronousProxy {
4490    client: fidl::client::sync::Client,
4491}
4492
4493#[cfg(target_os = "fuchsia")]
4494impl fidl::endpoints::SynchronousProxy for ProviderSynchronousProxy {
4495    type Proxy = ProviderProxy;
4496    type Protocol = ProviderMarker;
4497
4498    fn from_channel(inner: fidl::Channel) -> Self {
4499        Self::new(inner)
4500    }
4501
4502    fn into_channel(self) -> fidl::Channel {
4503        self.client.into_channel()
4504    }
4505
4506    fn as_channel(&self) -> &fidl::Channel {
4507        self.client.as_channel()
4508    }
4509}
4510
4511#[cfg(target_os = "fuchsia")]
4512impl ProviderSynchronousProxy {
4513    pub fn new(channel: fidl::Channel) -> Self {
4514        let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4515        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4516    }
4517
4518    pub fn into_channel(self) -> fidl::Channel {
4519        self.client.into_channel()
4520    }
4521
4522    /// Waits until an event arrives and returns it. It is safe for other
4523    /// threads to make concurrent requests while waiting for an event.
4524    pub fn wait_for_event(
4525        &self,
4526        deadline: zx::MonotonicInstant,
4527    ) -> Result<ProviderEvent, fidl::Error> {
4528        ProviderEvent::decode(self.client.wait_for_event(deadline)?)
4529    }
4530
4531    /// Opens a Virtcon client connection to the display coordinator.
4532    ///
4533    /// On success, `coordinator` and `coordinator_listener` will be bound to
4534    /// the display coordinator, as the Virtcon client.
4535    ///
4536    /// No event will be dispatched to the `Coordinator` protocol.
4537    ///
4538    /// Returns `ZX_ERR_ALREADY_BOUND` if the display coordinator already has a
4539    /// connected Virtcon client.
4540    pub fn r#open_coordinator_with_listener_for_virtcon(
4541        &self,
4542        mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4543        ___deadline: zx::MonotonicInstant,
4544    ) -> Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error> {
4545        let _response = self.client.send_query::<
4546            ProviderOpenCoordinatorWithListenerForVirtconRequest,
4547            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4548        >(
4549            &mut payload,
4550            0x154ac672633d9ec7,
4551            fidl::encoding::DynamicFlags::empty(),
4552            ___deadline,
4553        )?;
4554        Ok(_response.map(|x| x))
4555    }
4556
4557    /// Opens a primary client connection to the display coordinator.
4558    ///
4559    /// On success, `coordinator` and `coordinator_listener` will be bound to
4560    /// the display coordinator, as the primary client.
4561    ///
4562    /// No event will be dispatched to the `Coordinator` protocol.
4563    ///
4564    /// Returns `ZX_ERR_ALREADY_BOUND` if the display coordinator already has a
4565    /// connected primary client.
4566    pub fn r#open_coordinator_with_listener_for_primary(
4567        &self,
4568        mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4569        ___deadline: zx::MonotonicInstant,
4570    ) -> Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error> {
4571        let _response = self.client.send_query::<
4572            ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4573            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4574        >(
4575            &mut payload,
4576            0x635b6087ce4f6bfa,
4577            fidl::encoding::DynamicFlags::empty(),
4578            ___deadline,
4579        )?;
4580        Ok(_response.map(|x| x))
4581    }
4582}
4583
4584#[cfg(target_os = "fuchsia")]
4585impl From<ProviderSynchronousProxy> for zx::Handle {
4586    fn from(value: ProviderSynchronousProxy) -> Self {
4587        value.into_channel().into()
4588    }
4589}
4590
4591#[cfg(target_os = "fuchsia")]
4592impl From<fidl::Channel> for ProviderSynchronousProxy {
4593    fn from(value: fidl::Channel) -> Self {
4594        Self::new(value)
4595    }
4596}
4597
4598#[cfg(target_os = "fuchsia")]
4599impl fidl::endpoints::FromClient for ProviderSynchronousProxy {
4600    type Protocol = ProviderMarker;
4601
4602    fn from_client(value: fidl::endpoints::ClientEnd<ProviderMarker>) -> Self {
4603        Self::new(value.into_channel())
4604    }
4605}
4606
4607#[derive(Debug, Clone)]
4608pub struct ProviderProxy {
4609    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4610}
4611
4612impl fidl::endpoints::Proxy for ProviderProxy {
4613    type Protocol = ProviderMarker;
4614
4615    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4616        Self::new(inner)
4617    }
4618
4619    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4620        self.client.into_channel().map_err(|client| Self { client })
4621    }
4622
4623    fn as_channel(&self) -> &::fidl::AsyncChannel {
4624        self.client.as_channel()
4625    }
4626}
4627
4628impl ProviderProxy {
4629    /// Create a new Proxy for fuchsia.hardware.display/Provider.
4630    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4631        let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4632        Self { client: fidl::client::Client::new(channel, protocol_name) }
4633    }
4634
4635    /// Get a Stream of events from the remote end of the protocol.
4636    ///
4637    /// # Panics
4638    ///
4639    /// Panics if the event stream was already taken.
4640    pub fn take_event_stream(&self) -> ProviderEventStream {
4641        ProviderEventStream { event_receiver: self.client.take_event_receiver() }
4642    }
4643
4644    /// Opens a Virtcon client connection to the display coordinator.
4645    ///
4646    /// On success, `coordinator` and `coordinator_listener` will be bound to
4647    /// the display coordinator, as the Virtcon client.
4648    ///
4649    /// No event will be dispatched to the `Coordinator` protocol.
4650    ///
4651    /// Returns `ZX_ERR_ALREADY_BOUND` if the display coordinator already has a
4652    /// connected Virtcon client.
4653    pub fn r#open_coordinator_with_listener_for_virtcon(
4654        &self,
4655        mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4656    ) -> fidl::client::QueryResponseFut<
4657        ProviderOpenCoordinatorWithListenerForVirtconResult,
4658        fidl::encoding::DefaultFuchsiaResourceDialect,
4659    > {
4660        ProviderProxyInterface::r#open_coordinator_with_listener_for_virtcon(self, payload)
4661    }
4662
4663    /// Opens a primary client connection to the display coordinator.
4664    ///
4665    /// On success, `coordinator` and `coordinator_listener` will be bound to
4666    /// the display coordinator, as the primary client.
4667    ///
4668    /// No event will be dispatched to the `Coordinator` protocol.
4669    ///
4670    /// Returns `ZX_ERR_ALREADY_BOUND` if the display coordinator already has a
4671    /// connected primary client.
4672    pub fn r#open_coordinator_with_listener_for_primary(
4673        &self,
4674        mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4675    ) -> fidl::client::QueryResponseFut<
4676        ProviderOpenCoordinatorWithListenerForPrimaryResult,
4677        fidl::encoding::DefaultFuchsiaResourceDialect,
4678    > {
4679        ProviderProxyInterface::r#open_coordinator_with_listener_for_primary(self, payload)
4680    }
4681}
4682
4683impl ProviderProxyInterface for ProviderProxy {
4684    type OpenCoordinatorWithListenerForVirtconResponseFut = fidl::client::QueryResponseFut<
4685        ProviderOpenCoordinatorWithListenerForVirtconResult,
4686        fidl::encoding::DefaultFuchsiaResourceDialect,
4687    >;
4688    fn r#open_coordinator_with_listener_for_virtcon(
4689        &self,
4690        mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4691    ) -> Self::OpenCoordinatorWithListenerForVirtconResponseFut {
4692        fn _decode(
4693            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4694        ) -> Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error> {
4695            let _response = fidl::client::decode_transaction_body::<
4696                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4697                fidl::encoding::DefaultFuchsiaResourceDialect,
4698                0x154ac672633d9ec7,
4699            >(_buf?)?;
4700            Ok(_response.map(|x| x))
4701        }
4702        self.client.send_query_and_decode::<
4703            ProviderOpenCoordinatorWithListenerForVirtconRequest,
4704            ProviderOpenCoordinatorWithListenerForVirtconResult,
4705        >(
4706            &mut payload,
4707            0x154ac672633d9ec7,
4708            fidl::encoding::DynamicFlags::empty(),
4709            _decode,
4710        )
4711    }
4712
4713    type OpenCoordinatorWithListenerForPrimaryResponseFut = fidl::client::QueryResponseFut<
4714        ProviderOpenCoordinatorWithListenerForPrimaryResult,
4715        fidl::encoding::DefaultFuchsiaResourceDialect,
4716    >;
4717    fn r#open_coordinator_with_listener_for_primary(
4718        &self,
4719        mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4720    ) -> Self::OpenCoordinatorWithListenerForPrimaryResponseFut {
4721        fn _decode(
4722            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4723        ) -> Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error> {
4724            let _response = fidl::client::decode_transaction_body::<
4725                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4726                fidl::encoding::DefaultFuchsiaResourceDialect,
4727                0x635b6087ce4f6bfa,
4728            >(_buf?)?;
4729            Ok(_response.map(|x| x))
4730        }
4731        self.client.send_query_and_decode::<
4732            ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4733            ProviderOpenCoordinatorWithListenerForPrimaryResult,
4734        >(
4735            &mut payload,
4736            0x635b6087ce4f6bfa,
4737            fidl::encoding::DynamicFlags::empty(),
4738            _decode,
4739        )
4740    }
4741}
4742
4743pub struct ProviderEventStream {
4744    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4745}
4746
4747impl std::marker::Unpin for ProviderEventStream {}
4748
4749impl futures::stream::FusedStream for ProviderEventStream {
4750    fn is_terminated(&self) -> bool {
4751        self.event_receiver.is_terminated()
4752    }
4753}
4754
4755impl futures::Stream for ProviderEventStream {
4756    type Item = Result<ProviderEvent, fidl::Error>;
4757
4758    fn poll_next(
4759        mut self: std::pin::Pin<&mut Self>,
4760        cx: &mut std::task::Context<'_>,
4761    ) -> std::task::Poll<Option<Self::Item>> {
4762        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4763            &mut self.event_receiver,
4764            cx
4765        )?) {
4766            Some(buf) => std::task::Poll::Ready(Some(ProviderEvent::decode(buf))),
4767            None => std::task::Poll::Ready(None),
4768        }
4769    }
4770}
4771
4772#[derive(Debug)]
4773pub enum ProviderEvent {}
4774
4775impl ProviderEvent {
4776    /// Decodes a message buffer as a [`ProviderEvent`].
4777    fn decode(
4778        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4779    ) -> Result<ProviderEvent, fidl::Error> {
4780        let (bytes, _handles) = buf.split_mut();
4781        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4782        debug_assert_eq!(tx_header.tx_id, 0);
4783        match tx_header.ordinal {
4784            _ => Err(fidl::Error::UnknownOrdinal {
4785                ordinal: tx_header.ordinal,
4786                protocol_name: <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4787            }),
4788        }
4789    }
4790}
4791
4792/// A Stream of incoming requests for fuchsia.hardware.display/Provider.
4793pub struct ProviderRequestStream {
4794    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4795    is_terminated: bool,
4796}
4797
4798impl std::marker::Unpin for ProviderRequestStream {}
4799
4800impl futures::stream::FusedStream for ProviderRequestStream {
4801    fn is_terminated(&self) -> bool {
4802        self.is_terminated
4803    }
4804}
4805
4806impl fidl::endpoints::RequestStream for ProviderRequestStream {
4807    type Protocol = ProviderMarker;
4808    type ControlHandle = ProviderControlHandle;
4809
4810    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4811        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4812    }
4813
4814    fn control_handle(&self) -> Self::ControlHandle {
4815        ProviderControlHandle { inner: self.inner.clone() }
4816    }
4817
4818    fn into_inner(
4819        self,
4820    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4821    {
4822        (self.inner, self.is_terminated)
4823    }
4824
4825    fn from_inner(
4826        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4827        is_terminated: bool,
4828    ) -> Self {
4829        Self { inner, is_terminated }
4830    }
4831}
4832
4833impl futures::Stream for ProviderRequestStream {
4834    type Item = Result<ProviderRequest, fidl::Error>;
4835
4836    fn poll_next(
4837        mut self: std::pin::Pin<&mut Self>,
4838        cx: &mut std::task::Context<'_>,
4839    ) -> std::task::Poll<Option<Self::Item>> {
4840        let this = &mut *self;
4841        if this.inner.check_shutdown(cx) {
4842            this.is_terminated = true;
4843            return std::task::Poll::Ready(None);
4844        }
4845        if this.is_terminated {
4846            panic!("polled ProviderRequestStream after completion");
4847        }
4848        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4849            |bytes, handles| {
4850                match this.inner.channel().read_etc(cx, bytes, handles) {
4851                    std::task::Poll::Ready(Ok(())) => {}
4852                    std::task::Poll::Pending => return std::task::Poll::Pending,
4853                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4854                        this.is_terminated = true;
4855                        return std::task::Poll::Ready(None);
4856                    }
4857                    std::task::Poll::Ready(Err(e)) => {
4858                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4859                            e.into(),
4860                        ))));
4861                    }
4862                }
4863
4864                // A message has been received from the channel
4865                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4866
4867                std::task::Poll::Ready(Some(match header.ordinal {
4868                    0x154ac672633d9ec7 => {
4869                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4870                        let mut req = fidl::new_empty!(
4871                            ProviderOpenCoordinatorWithListenerForVirtconRequest,
4872                            fidl::encoding::DefaultFuchsiaResourceDialect
4873                        );
4874                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderOpenCoordinatorWithListenerForVirtconRequest>(&header, _body_bytes, handles, &mut req)?;
4875                        let control_handle = ProviderControlHandle { inner: this.inner.clone() };
4876                        Ok(ProviderRequest::OpenCoordinatorWithListenerForVirtcon {
4877                            payload: req,
4878                            responder: ProviderOpenCoordinatorWithListenerForVirtconResponder {
4879                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4880                                tx_id: header.tx_id,
4881                            },
4882                        })
4883                    }
4884                    0x635b6087ce4f6bfa => {
4885                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4886                        let mut req = fidl::new_empty!(
4887                            ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4888                            fidl::encoding::DefaultFuchsiaResourceDialect
4889                        );
4890                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderOpenCoordinatorWithListenerForPrimaryRequest>(&header, _body_bytes, handles, &mut req)?;
4891                        let control_handle = ProviderControlHandle { inner: this.inner.clone() };
4892                        Ok(ProviderRequest::OpenCoordinatorWithListenerForPrimary {
4893                            payload: req,
4894                            responder: ProviderOpenCoordinatorWithListenerForPrimaryResponder {
4895                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4896                                tx_id: header.tx_id,
4897                            },
4898                        })
4899                    }
4900                    _ => Err(fidl::Error::UnknownOrdinal {
4901                        ordinal: header.ordinal,
4902                        protocol_name:
4903                            <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4904                    }),
4905                }))
4906            },
4907        )
4908    }
4909}
4910
4911/// Provider for display coordinators.
4912///
4913/// The driver supports two simultaneous clients - a main client and a virtcon
4914/// client.  In some cases, the provider service may provide access to only one or
4915/// the other; if the client tries to open the other then `ZX_ERR_NOT_SUPPORTED` will
4916/// be returned.
4917#[derive(Debug)]
4918pub enum ProviderRequest {
4919    /// Opens a Virtcon client connection to the display coordinator.
4920    ///
4921    /// On success, `coordinator` and `coordinator_listener` will be bound to
4922    /// the display coordinator, as the Virtcon client.
4923    ///
4924    /// No event will be dispatched to the `Coordinator` protocol.
4925    ///
4926    /// Returns `ZX_ERR_ALREADY_BOUND` if the display coordinator already has a
4927    /// connected Virtcon client.
4928    OpenCoordinatorWithListenerForVirtcon {
4929        payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4930        responder: ProviderOpenCoordinatorWithListenerForVirtconResponder,
4931    },
4932    /// Opens a primary client connection to the display coordinator.
4933    ///
4934    /// On success, `coordinator` and `coordinator_listener` will be bound to
4935    /// the display coordinator, as the primary client.
4936    ///
4937    /// No event will be dispatched to the `Coordinator` protocol.
4938    ///
4939    /// Returns `ZX_ERR_ALREADY_BOUND` if the display coordinator already has a
4940    /// connected primary client.
4941    OpenCoordinatorWithListenerForPrimary {
4942        payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4943        responder: ProviderOpenCoordinatorWithListenerForPrimaryResponder,
4944    },
4945}
4946
4947impl ProviderRequest {
4948    #[allow(irrefutable_let_patterns)]
4949    pub fn into_open_coordinator_with_listener_for_virtcon(
4950        self,
4951    ) -> Option<(
4952        ProviderOpenCoordinatorWithListenerForVirtconRequest,
4953        ProviderOpenCoordinatorWithListenerForVirtconResponder,
4954    )> {
4955        if let ProviderRequest::OpenCoordinatorWithListenerForVirtcon { payload, responder } = self
4956        {
4957            Some((payload, responder))
4958        } else {
4959            None
4960        }
4961    }
4962
4963    #[allow(irrefutable_let_patterns)]
4964    pub fn into_open_coordinator_with_listener_for_primary(
4965        self,
4966    ) -> Option<(
4967        ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4968        ProviderOpenCoordinatorWithListenerForPrimaryResponder,
4969    )> {
4970        if let ProviderRequest::OpenCoordinatorWithListenerForPrimary { payload, responder } = self
4971        {
4972            Some((payload, responder))
4973        } else {
4974            None
4975        }
4976    }
4977
4978    /// Name of the method defined in FIDL
4979    pub fn method_name(&self) -> &'static str {
4980        match *self {
4981            ProviderRequest::OpenCoordinatorWithListenerForVirtcon { .. } => {
4982                "open_coordinator_with_listener_for_virtcon"
4983            }
4984            ProviderRequest::OpenCoordinatorWithListenerForPrimary { .. } => {
4985                "open_coordinator_with_listener_for_primary"
4986            }
4987        }
4988    }
4989}
4990
4991#[derive(Debug, Clone)]
4992pub struct ProviderControlHandle {
4993    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4994}
4995
4996impl fidl::endpoints::ControlHandle for ProviderControlHandle {
4997    fn shutdown(&self) {
4998        self.inner.shutdown()
4999    }
5000    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5001        self.inner.shutdown_with_epitaph(status)
5002    }
5003
5004    fn is_closed(&self) -> bool {
5005        self.inner.channel().is_closed()
5006    }
5007    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5008        self.inner.channel().on_closed()
5009    }
5010
5011    #[cfg(target_os = "fuchsia")]
5012    fn signal_peer(
5013        &self,
5014        clear_mask: zx::Signals,
5015        set_mask: zx::Signals,
5016    ) -> Result<(), zx_status::Status> {
5017        use fidl::Peered;
5018        self.inner.channel().signal_peer(clear_mask, set_mask)
5019    }
5020}
5021
5022impl ProviderControlHandle {}
5023
5024#[must_use = "FIDL methods require a response to be sent"]
5025#[derive(Debug)]
5026pub struct ProviderOpenCoordinatorWithListenerForVirtconResponder {
5027    control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
5028    tx_id: u32,
5029}
5030
5031/// Set the the channel to be shutdown (see [`ProviderControlHandle::shutdown`])
5032/// if the responder is dropped without sending a response, so that the client
5033/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5034impl std::ops::Drop for ProviderOpenCoordinatorWithListenerForVirtconResponder {
5035    fn drop(&mut self) {
5036        self.control_handle.shutdown();
5037        // Safety: drops once, never accessed again
5038        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5039    }
5040}
5041
5042impl fidl::endpoints::Responder for ProviderOpenCoordinatorWithListenerForVirtconResponder {
5043    type ControlHandle = ProviderControlHandle;
5044
5045    fn control_handle(&self) -> &ProviderControlHandle {
5046        &self.control_handle
5047    }
5048
5049    fn drop_without_shutdown(mut self) {
5050        // Safety: drops once, never accessed again due to mem::forget
5051        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5052        // Prevent Drop from running (which would shut down the channel)
5053        std::mem::forget(self);
5054    }
5055}
5056
5057impl ProviderOpenCoordinatorWithListenerForVirtconResponder {
5058    /// Sends a response to the FIDL transaction.
5059    ///
5060    /// Sets the channel to shutdown if an error occurs.
5061    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5062        let _result = self.send_raw(result);
5063        if _result.is_err() {
5064            self.control_handle.shutdown();
5065        }
5066        self.drop_without_shutdown();
5067        _result
5068    }
5069
5070    /// Similar to "send" but does not shutdown the channel if an error occurs.
5071    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5072        let _result = self.send_raw(result);
5073        self.drop_without_shutdown();
5074        _result
5075    }
5076
5077    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5078        self.control_handle
5079            .inner
5080            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5081                result,
5082                self.tx_id,
5083                0x154ac672633d9ec7,
5084                fidl::encoding::DynamicFlags::empty(),
5085            )
5086    }
5087}
5088
5089#[must_use = "FIDL methods require a response to be sent"]
5090#[derive(Debug)]
5091pub struct ProviderOpenCoordinatorWithListenerForPrimaryResponder {
5092    control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
5093    tx_id: u32,
5094}
5095
5096/// Set the the channel to be shutdown (see [`ProviderControlHandle::shutdown`])
5097/// if the responder is dropped without sending a response, so that the client
5098/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5099impl std::ops::Drop for ProviderOpenCoordinatorWithListenerForPrimaryResponder {
5100    fn drop(&mut self) {
5101        self.control_handle.shutdown();
5102        // Safety: drops once, never accessed again
5103        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5104    }
5105}
5106
5107impl fidl::endpoints::Responder for ProviderOpenCoordinatorWithListenerForPrimaryResponder {
5108    type ControlHandle = ProviderControlHandle;
5109
5110    fn control_handle(&self) -> &ProviderControlHandle {
5111        &self.control_handle
5112    }
5113
5114    fn drop_without_shutdown(mut self) {
5115        // Safety: drops once, never accessed again due to mem::forget
5116        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5117        // Prevent Drop from running (which would shut down the channel)
5118        std::mem::forget(self);
5119    }
5120}
5121
5122impl ProviderOpenCoordinatorWithListenerForPrimaryResponder {
5123    /// Sends a response to the FIDL transaction.
5124    ///
5125    /// Sets the channel to shutdown if an error occurs.
5126    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5127        let _result = self.send_raw(result);
5128        if _result.is_err() {
5129            self.control_handle.shutdown();
5130        }
5131        self.drop_without_shutdown();
5132        _result
5133    }
5134
5135    /// Similar to "send" but does not shutdown the channel if an error occurs.
5136    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5137        let _result = self.send_raw(result);
5138        self.drop_without_shutdown();
5139        _result
5140    }
5141
5142    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5143        self.control_handle
5144            .inner
5145            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5146                result,
5147                self.tx_id,
5148                0x635b6087ce4f6bfa,
5149                fidl::encoding::DynamicFlags::empty(),
5150            )
5151    }
5152}
5153
5154#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5155pub struct ServiceMarker;
5156
5157#[cfg(target_os = "fuchsia")]
5158impl fidl::endpoints::ServiceMarker for ServiceMarker {
5159    type Proxy = ServiceProxy;
5160    type Request = ServiceRequest;
5161    const SERVICE_NAME: &'static str = "fuchsia.hardware.display.Service";
5162}
5163
5164/// A request for one of the member protocols of Service.
5165///
5166#[cfg(target_os = "fuchsia")]
5167pub enum ServiceRequest {
5168    Provider(ProviderRequestStream),
5169}
5170
5171#[cfg(target_os = "fuchsia")]
5172impl fidl::endpoints::ServiceRequest for ServiceRequest {
5173    type Service = ServiceMarker;
5174
5175    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
5176        match name {
5177            "provider" => Self::Provider(
5178                <ProviderRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
5179            ),
5180            _ => panic!("no such member protocol name for service Service"),
5181        }
5182    }
5183
5184    fn member_names() -> &'static [&'static str] {
5185        &["provider"]
5186    }
5187}
5188#[cfg(target_os = "fuchsia")]
5189pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
5190
5191#[cfg(target_os = "fuchsia")]
5192impl fidl::endpoints::ServiceProxy for ServiceProxy {
5193    type Service = ServiceMarker;
5194
5195    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
5196        Self(opener)
5197    }
5198}
5199
5200#[cfg(target_os = "fuchsia")]
5201impl ServiceProxy {
5202    pub fn connect_to_provider(&self) -> Result<ProviderProxy, fidl::Error> {
5203        let (proxy, server_end) = fidl::endpoints::create_proxy::<ProviderMarker>();
5204        self.connect_channel_to_provider(server_end)?;
5205        Ok(proxy)
5206    }
5207
5208    /// Like `connect_to_provider`, but returns a sync proxy.
5209    /// See [`Self::connect_to_provider`] for more details.
5210    pub fn connect_to_provider_sync(&self) -> Result<ProviderSynchronousProxy, fidl::Error> {
5211        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ProviderMarker>();
5212        self.connect_channel_to_provider(server_end)?;
5213        Ok(proxy)
5214    }
5215
5216    /// Like `connect_to_provider`, but accepts a server end.
5217    /// See [`Self::connect_to_provider`] for more details.
5218    pub fn connect_channel_to_provider(
5219        &self,
5220        server_end: fidl::endpoints::ServerEnd<ProviderMarker>,
5221    ) -> Result<(), fidl::Error> {
5222        self.0.open_member("provider", server_end.into_channel())
5223    }
5224
5225    pub fn instance_name(&self) -> &str {
5226        self.0.instance_name()
5227    }
5228}
5229
5230mod internal {
5231    use super::*;
5232
5233    impl fidl::encoding::ResourceTypeMarker for CoordinatorImportBufferCollectionRequest {
5234        type Borrowed<'a> = &'a mut Self;
5235        fn take_or_borrow<'a>(
5236            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5237        ) -> Self::Borrowed<'a> {
5238            value
5239        }
5240    }
5241
5242    unsafe impl fidl::encoding::TypeMarker for CoordinatorImportBufferCollectionRequest {
5243        type Owned = Self;
5244
5245        #[inline(always)]
5246        fn inline_align(_context: fidl::encoding::Context) -> usize {
5247            8
5248        }
5249
5250        #[inline(always)]
5251        fn inline_size(_context: fidl::encoding::Context) -> usize {
5252            16
5253        }
5254    }
5255
5256    unsafe impl
5257        fidl::encoding::Encode<
5258            CoordinatorImportBufferCollectionRequest,
5259            fidl::encoding::DefaultFuchsiaResourceDialect,
5260        > for &mut CoordinatorImportBufferCollectionRequest
5261    {
5262        #[inline]
5263        unsafe fn encode(
5264            self,
5265            encoder: &mut fidl::encoding::Encoder<
5266                '_,
5267                fidl::encoding::DefaultFuchsiaResourceDialect,
5268            >,
5269            offset: usize,
5270            _depth: fidl::encoding::Depth,
5271        ) -> fidl::Result<()> {
5272            encoder.debug_check_bounds::<CoordinatorImportBufferCollectionRequest>(offset);
5273            // Delegate to tuple encoding.
5274            fidl::encoding::Encode::<
5275                CoordinatorImportBufferCollectionRequest,
5276                fidl::encoding::DefaultFuchsiaResourceDialect,
5277            >::encode(
5278                (
5279                    <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(
5280                        &self.buffer_collection_id,
5281                    ),
5282                    <fidl::encoding::Endpoint<
5283                        fidl::endpoints::ClientEnd<
5284                            fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5285                        >,
5286                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5287                        &mut self.buffer_collection_token,
5288                    ),
5289                ),
5290                encoder,
5291                offset,
5292                _depth,
5293            )
5294        }
5295    }
5296    unsafe impl<
5297        T0: fidl::encoding::Encode<BufferCollectionId, fidl::encoding::DefaultFuchsiaResourceDialect>,
5298        T1: fidl::encoding::Encode<
5299                fidl::encoding::Endpoint<
5300                    fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5301                >,
5302                fidl::encoding::DefaultFuchsiaResourceDialect,
5303            >,
5304    >
5305        fidl::encoding::Encode<
5306            CoordinatorImportBufferCollectionRequest,
5307            fidl::encoding::DefaultFuchsiaResourceDialect,
5308        > for (T0, T1)
5309    {
5310        #[inline]
5311        unsafe fn encode(
5312            self,
5313            encoder: &mut fidl::encoding::Encoder<
5314                '_,
5315                fidl::encoding::DefaultFuchsiaResourceDialect,
5316            >,
5317            offset: usize,
5318            depth: fidl::encoding::Depth,
5319        ) -> fidl::Result<()> {
5320            encoder.debug_check_bounds::<CoordinatorImportBufferCollectionRequest>(offset);
5321            // Zero out padding regions. There's no need to apply masks
5322            // because the unmasked parts will be overwritten by fields.
5323            unsafe {
5324                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
5325                (ptr as *mut u64).write_unaligned(0);
5326            }
5327            // Write the fields.
5328            self.0.encode(encoder, offset + 0, depth)?;
5329            self.1.encode(encoder, offset + 8, depth)?;
5330            Ok(())
5331        }
5332    }
5333
5334    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5335        for CoordinatorImportBufferCollectionRequest
5336    {
5337        #[inline(always)]
5338        fn new_empty() -> Self {
5339            Self {
5340                buffer_collection_id: fidl::new_empty!(
5341                    BufferCollectionId,
5342                    fidl::encoding::DefaultFuchsiaResourceDialect
5343                ),
5344                buffer_collection_token: fidl::new_empty!(
5345                    fidl::encoding::Endpoint<
5346                        fidl::endpoints::ClientEnd<
5347                            fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5348                        >,
5349                    >,
5350                    fidl::encoding::DefaultFuchsiaResourceDialect
5351                ),
5352            }
5353        }
5354
5355        #[inline]
5356        unsafe fn decode(
5357            &mut self,
5358            decoder: &mut fidl::encoding::Decoder<
5359                '_,
5360                fidl::encoding::DefaultFuchsiaResourceDialect,
5361            >,
5362            offset: usize,
5363            _depth: fidl::encoding::Depth,
5364        ) -> fidl::Result<()> {
5365            decoder.debug_check_bounds::<Self>(offset);
5366            // Verify that padding bytes are zero.
5367            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
5368            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5369            let mask = 0xffffffff00000000u64;
5370            let maskedval = padval & mask;
5371            if maskedval != 0 {
5372                return Err(fidl::Error::NonZeroPadding {
5373                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5374                });
5375            }
5376            fidl::decode!(
5377                BufferCollectionId,
5378                fidl::encoding::DefaultFuchsiaResourceDialect,
5379                &mut self.buffer_collection_id,
5380                decoder,
5381                offset + 0,
5382                _depth
5383            )?;
5384            fidl::decode!(
5385                fidl::encoding::Endpoint<
5386                    fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5387                >,
5388                fidl::encoding::DefaultFuchsiaResourceDialect,
5389                &mut self.buffer_collection_token,
5390                decoder,
5391                offset + 8,
5392                _depth
5393            )?;
5394            Ok(())
5395        }
5396    }
5397
5398    impl fidl::encoding::ResourceTypeMarker for CoordinatorImportEventRequest {
5399        type Borrowed<'a> = &'a mut Self;
5400        fn take_or_borrow<'a>(
5401            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5402        ) -> Self::Borrowed<'a> {
5403            value
5404        }
5405    }
5406
5407    unsafe impl fidl::encoding::TypeMarker for CoordinatorImportEventRequest {
5408        type Owned = Self;
5409
5410        #[inline(always)]
5411        fn inline_align(_context: fidl::encoding::Context) -> usize {
5412            8
5413        }
5414
5415        #[inline(always)]
5416        fn inline_size(_context: fidl::encoding::Context) -> usize {
5417            16
5418        }
5419    }
5420
5421    unsafe impl
5422        fidl::encoding::Encode<
5423            CoordinatorImportEventRequest,
5424            fidl::encoding::DefaultFuchsiaResourceDialect,
5425        > for &mut CoordinatorImportEventRequest
5426    {
5427        #[inline]
5428        unsafe fn encode(
5429            self,
5430            encoder: &mut fidl::encoding::Encoder<
5431                '_,
5432                fidl::encoding::DefaultFuchsiaResourceDialect,
5433            >,
5434            offset: usize,
5435            _depth: fidl::encoding::Depth,
5436        ) -> fidl::Result<()> {
5437            encoder.debug_check_bounds::<CoordinatorImportEventRequest>(offset);
5438            // Delegate to tuple encoding.
5439            fidl::encoding::Encode::<
5440                CoordinatorImportEventRequest,
5441                fidl::encoding::DefaultFuchsiaResourceDialect,
5442            >::encode(
5443                (
5444                    <fidl::encoding::HandleType<
5445                        fidl::Event,
5446                        { fidl::ObjectType::EVENT.into_raw() },
5447                        2147483648,
5448                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5449                        &mut self.event
5450                    ),
5451                    <EventId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
5452                ),
5453                encoder,
5454                offset,
5455                _depth,
5456            )
5457        }
5458    }
5459    unsafe impl<
5460        T0: fidl::encoding::Encode<
5461                fidl::encoding::HandleType<
5462                    fidl::Event,
5463                    { fidl::ObjectType::EVENT.into_raw() },
5464                    2147483648,
5465                >,
5466                fidl::encoding::DefaultFuchsiaResourceDialect,
5467            >,
5468        T1: fidl::encoding::Encode<EventId, fidl::encoding::DefaultFuchsiaResourceDialect>,
5469    >
5470        fidl::encoding::Encode<
5471            CoordinatorImportEventRequest,
5472            fidl::encoding::DefaultFuchsiaResourceDialect,
5473        > for (T0, T1)
5474    {
5475        #[inline]
5476        unsafe fn encode(
5477            self,
5478            encoder: &mut fidl::encoding::Encoder<
5479                '_,
5480                fidl::encoding::DefaultFuchsiaResourceDialect,
5481            >,
5482            offset: usize,
5483            depth: fidl::encoding::Depth,
5484        ) -> fidl::Result<()> {
5485            encoder.debug_check_bounds::<CoordinatorImportEventRequest>(offset);
5486            // Zero out padding regions. There's no need to apply masks
5487            // because the unmasked parts will be overwritten by fields.
5488            unsafe {
5489                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5490                (ptr as *mut u64).write_unaligned(0);
5491            }
5492            // Write the fields.
5493            self.0.encode(encoder, offset + 0, depth)?;
5494            self.1.encode(encoder, offset + 8, depth)?;
5495            Ok(())
5496        }
5497    }
5498
5499    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5500        for CoordinatorImportEventRequest
5501    {
5502        #[inline(always)]
5503        fn new_empty() -> Self {
5504            Self {
5505                event: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5506                id: fidl::new_empty!(EventId, fidl::encoding::DefaultFuchsiaResourceDialect),
5507            }
5508        }
5509
5510        #[inline]
5511        unsafe fn decode(
5512            &mut self,
5513            decoder: &mut fidl::encoding::Decoder<
5514                '_,
5515                fidl::encoding::DefaultFuchsiaResourceDialect,
5516            >,
5517            offset: usize,
5518            _depth: fidl::encoding::Depth,
5519        ) -> fidl::Result<()> {
5520            decoder.debug_check_bounds::<Self>(offset);
5521            // Verify that padding bytes are zero.
5522            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5523            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5524            let mask = 0xffffffff00000000u64;
5525            let maskedval = padval & mask;
5526            if maskedval != 0 {
5527                return Err(fidl::Error::NonZeroPadding {
5528                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5529                });
5530            }
5531            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.event, decoder, offset + 0, _depth)?;
5532            fidl::decode!(
5533                EventId,
5534                fidl::encoding::DefaultFuchsiaResourceDialect,
5535                &mut self.id,
5536                decoder,
5537                offset + 8,
5538                _depth
5539            )?;
5540            Ok(())
5541        }
5542    }
5543
5544    impl CoordinatorApplyConfig3Request {
5545        #[inline(always)]
5546        fn max_ordinal_present(&self) -> u64 {
5547            if let Some(_) = self.stamp {
5548                return 1;
5549            }
5550            0
5551        }
5552    }
5553
5554    impl fidl::encoding::ResourceTypeMarker for CoordinatorApplyConfig3Request {
5555        type Borrowed<'a> = &'a mut Self;
5556        fn take_or_borrow<'a>(
5557            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5558        ) -> Self::Borrowed<'a> {
5559            value
5560        }
5561    }
5562
5563    unsafe impl fidl::encoding::TypeMarker for CoordinatorApplyConfig3Request {
5564        type Owned = Self;
5565
5566        #[inline(always)]
5567        fn inline_align(_context: fidl::encoding::Context) -> usize {
5568            8
5569        }
5570
5571        #[inline(always)]
5572        fn inline_size(_context: fidl::encoding::Context) -> usize {
5573            16
5574        }
5575    }
5576
5577    unsafe impl
5578        fidl::encoding::Encode<
5579            CoordinatorApplyConfig3Request,
5580            fidl::encoding::DefaultFuchsiaResourceDialect,
5581        > for &mut CoordinatorApplyConfig3Request
5582    {
5583        unsafe fn encode(
5584            self,
5585            encoder: &mut fidl::encoding::Encoder<
5586                '_,
5587                fidl::encoding::DefaultFuchsiaResourceDialect,
5588            >,
5589            offset: usize,
5590            mut depth: fidl::encoding::Depth,
5591        ) -> fidl::Result<()> {
5592            encoder.debug_check_bounds::<CoordinatorApplyConfig3Request>(offset);
5593            // Vector header
5594            let max_ordinal: u64 = self.max_ordinal_present();
5595            encoder.write_num(max_ordinal, offset);
5596            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5597            // Calling encoder.out_of_line_offset(0) is not allowed.
5598            if max_ordinal == 0 {
5599                return Ok(());
5600            }
5601            depth.increment()?;
5602            let envelope_size = 8;
5603            let bytes_len = max_ordinal as usize * envelope_size;
5604            #[allow(unused_variables)]
5605            let offset = encoder.out_of_line_offset(bytes_len);
5606            let mut _prev_end_offset: usize = 0;
5607            if 1 > max_ordinal {
5608                return Ok(());
5609            }
5610
5611            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5612            // are envelope_size bytes.
5613            let cur_offset: usize = (1 - 1) * envelope_size;
5614
5615            // Zero reserved fields.
5616            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5617
5618            // Safety:
5619            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5620            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5621            //   envelope_size bytes, there is always sufficient room.
5622            fidl::encoding::encode_in_envelope_optional::<
5623                ConfigStamp,
5624                fidl::encoding::DefaultFuchsiaResourceDialect,
5625            >(
5626                self.stamp.as_ref().map(<ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow),
5627                encoder,
5628                offset + cur_offset,
5629                depth,
5630            )?;
5631
5632            _prev_end_offset = cur_offset + envelope_size;
5633
5634            Ok(())
5635        }
5636    }
5637
5638    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5639        for CoordinatorApplyConfig3Request
5640    {
5641        #[inline(always)]
5642        fn new_empty() -> Self {
5643            Self::default()
5644        }
5645
5646        unsafe fn decode(
5647            &mut self,
5648            decoder: &mut fidl::encoding::Decoder<
5649                '_,
5650                fidl::encoding::DefaultFuchsiaResourceDialect,
5651            >,
5652            offset: usize,
5653            mut depth: fidl::encoding::Depth,
5654        ) -> fidl::Result<()> {
5655            decoder.debug_check_bounds::<Self>(offset);
5656            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5657                None => return Err(fidl::Error::NotNullable),
5658                Some(len) => len,
5659            };
5660            // Calling decoder.out_of_line_offset(0) is not allowed.
5661            if len == 0 {
5662                return Ok(());
5663            };
5664            depth.increment()?;
5665            let envelope_size = 8;
5666            let bytes_len = len * envelope_size;
5667            let offset = decoder.out_of_line_offset(bytes_len)?;
5668            // Decode the envelope for each type.
5669            let mut _next_ordinal_to_read = 0;
5670            let mut next_offset = offset;
5671            let end_offset = offset + bytes_len;
5672            _next_ordinal_to_read += 1;
5673            if next_offset >= end_offset {
5674                return Ok(());
5675            }
5676
5677            // Decode unknown envelopes for gaps in ordinals.
5678            while _next_ordinal_to_read < 1 {
5679                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5680                _next_ordinal_to_read += 1;
5681                next_offset += envelope_size;
5682            }
5683
5684            let next_out_of_line = decoder.next_out_of_line();
5685            let handles_before = decoder.remaining_handles();
5686            if let Some((inlined, num_bytes, num_handles)) =
5687                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5688            {
5689                let member_inline_size =
5690                    <ConfigStamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5691                if inlined != (member_inline_size <= 4) {
5692                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5693                }
5694                let inner_offset;
5695                let mut inner_depth = depth.clone();
5696                if inlined {
5697                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5698                    inner_offset = next_offset;
5699                } else {
5700                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5701                    inner_depth.increment()?;
5702                }
5703                let val_ref = self.stamp.get_or_insert_with(|| {
5704                    fidl::new_empty!(ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect)
5705                });
5706                fidl::decode!(
5707                    ConfigStamp,
5708                    fidl::encoding::DefaultFuchsiaResourceDialect,
5709                    val_ref,
5710                    decoder,
5711                    inner_offset,
5712                    inner_depth
5713                )?;
5714                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5715                {
5716                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5717                }
5718                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5719                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5720                }
5721            }
5722
5723            next_offset += envelope_size;
5724
5725            // Decode the remaining unknown envelopes.
5726            while next_offset < end_offset {
5727                _next_ordinal_to_read += 1;
5728                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5729                next_offset += envelope_size;
5730            }
5731
5732            Ok(())
5733        }
5734    }
5735
5736    impl ProviderOpenCoordinatorWithListenerForPrimaryRequest {
5737        #[inline(always)]
5738        fn max_ordinal_present(&self) -> u64 {
5739            if let Some(_) = self.coordinator_listener {
5740                return 2;
5741            }
5742            if let Some(_) = self.coordinator {
5743                return 1;
5744            }
5745            0
5746        }
5747    }
5748
5749    impl fidl::encoding::ResourceTypeMarker for ProviderOpenCoordinatorWithListenerForPrimaryRequest {
5750        type Borrowed<'a> = &'a mut Self;
5751        fn take_or_borrow<'a>(
5752            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5753        ) -> Self::Borrowed<'a> {
5754            value
5755        }
5756    }
5757
5758    unsafe impl fidl::encoding::TypeMarker for ProviderOpenCoordinatorWithListenerForPrimaryRequest {
5759        type Owned = Self;
5760
5761        #[inline(always)]
5762        fn inline_align(_context: fidl::encoding::Context) -> usize {
5763            8
5764        }
5765
5766        #[inline(always)]
5767        fn inline_size(_context: fidl::encoding::Context) -> usize {
5768            16
5769        }
5770    }
5771
5772    unsafe impl
5773        fidl::encoding::Encode<
5774            ProviderOpenCoordinatorWithListenerForPrimaryRequest,
5775            fidl::encoding::DefaultFuchsiaResourceDialect,
5776        > for &mut ProviderOpenCoordinatorWithListenerForPrimaryRequest
5777    {
5778        unsafe fn encode(
5779            self,
5780            encoder: &mut fidl::encoding::Encoder<
5781                '_,
5782                fidl::encoding::DefaultFuchsiaResourceDialect,
5783            >,
5784            offset: usize,
5785            mut depth: fidl::encoding::Depth,
5786        ) -> fidl::Result<()> {
5787            encoder
5788                .debug_check_bounds::<ProviderOpenCoordinatorWithListenerForPrimaryRequest>(offset);
5789            // Vector header
5790            let max_ordinal: u64 = self.max_ordinal_present();
5791            encoder.write_num(max_ordinal, offset);
5792            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5793            // Calling encoder.out_of_line_offset(0) is not allowed.
5794            if max_ordinal == 0 {
5795                return Ok(());
5796            }
5797            depth.increment()?;
5798            let envelope_size = 8;
5799            let bytes_len = max_ordinal as usize * envelope_size;
5800            #[allow(unused_variables)]
5801            let offset = encoder.out_of_line_offset(bytes_len);
5802            let mut _prev_end_offset: usize = 0;
5803            if 1 > max_ordinal {
5804                return Ok(());
5805            }
5806
5807            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5808            // are envelope_size bytes.
5809            let cur_offset: usize = (1 - 1) * envelope_size;
5810
5811            // Zero reserved fields.
5812            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5813
5814            // Safety:
5815            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5816            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5817            //   envelope_size bytes, there is always sufficient room.
5818            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5819            self.coordinator.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5820            encoder, offset + cur_offset, depth
5821        )?;
5822
5823            _prev_end_offset = cur_offset + envelope_size;
5824            if 2 > max_ordinal {
5825                return Ok(());
5826            }
5827
5828            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5829            // are envelope_size bytes.
5830            let cur_offset: usize = (2 - 1) * envelope_size;
5831
5832            // Zero reserved fields.
5833            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5834
5835            // Safety:
5836            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5837            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5838            //   envelope_size bytes, there is always sufficient room.
5839            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5840            self.coordinator_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5841            encoder, offset + cur_offset, depth
5842        )?;
5843
5844            _prev_end_offset = cur_offset + envelope_size;
5845
5846            Ok(())
5847        }
5848    }
5849
5850    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5851        for ProviderOpenCoordinatorWithListenerForPrimaryRequest
5852    {
5853        #[inline(always)]
5854        fn new_empty() -> Self {
5855            Self::default()
5856        }
5857
5858        unsafe fn decode(
5859            &mut self,
5860            decoder: &mut fidl::encoding::Decoder<
5861                '_,
5862                fidl::encoding::DefaultFuchsiaResourceDialect,
5863            >,
5864            offset: usize,
5865            mut depth: fidl::encoding::Depth,
5866        ) -> fidl::Result<()> {
5867            decoder.debug_check_bounds::<Self>(offset);
5868            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5869                None => return Err(fidl::Error::NotNullable),
5870                Some(len) => len,
5871            };
5872            // Calling decoder.out_of_line_offset(0) is not allowed.
5873            if len == 0 {
5874                return Ok(());
5875            };
5876            depth.increment()?;
5877            let envelope_size = 8;
5878            let bytes_len = len * envelope_size;
5879            let offset = decoder.out_of_line_offset(bytes_len)?;
5880            // Decode the envelope for each type.
5881            let mut _next_ordinal_to_read = 0;
5882            let mut next_offset = offset;
5883            let end_offset = offset + bytes_len;
5884            _next_ordinal_to_read += 1;
5885            if next_offset >= end_offset {
5886                return Ok(());
5887            }
5888
5889            // Decode unknown envelopes for gaps in ordinals.
5890            while _next_ordinal_to_read < 1 {
5891                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5892                _next_ordinal_to_read += 1;
5893                next_offset += envelope_size;
5894            }
5895
5896            let next_out_of_line = decoder.next_out_of_line();
5897            let handles_before = decoder.remaining_handles();
5898            if let Some((inlined, num_bytes, num_handles)) =
5899                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5900            {
5901                let member_inline_size = <fidl::encoding::Endpoint<
5902                    fidl::endpoints::ServerEnd<CoordinatorMarker>,
5903                > as fidl::encoding::TypeMarker>::inline_size(
5904                    decoder.context
5905                );
5906                if inlined != (member_inline_size <= 4) {
5907                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5908                }
5909                let inner_offset;
5910                let mut inner_depth = depth.clone();
5911                if inlined {
5912                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5913                    inner_offset = next_offset;
5914                } else {
5915                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5916                    inner_depth.increment()?;
5917                }
5918                let val_ref = self.coordinator.get_or_insert_with(|| {
5919                    fidl::new_empty!(
5920                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
5921                        fidl::encoding::DefaultFuchsiaResourceDialect
5922                    )
5923                });
5924                fidl::decode!(
5925                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
5926                    fidl::encoding::DefaultFuchsiaResourceDialect,
5927                    val_ref,
5928                    decoder,
5929                    inner_offset,
5930                    inner_depth
5931                )?;
5932                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5933                {
5934                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5935                }
5936                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5937                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5938                }
5939            }
5940
5941            next_offset += envelope_size;
5942            _next_ordinal_to_read += 1;
5943            if next_offset >= end_offset {
5944                return Ok(());
5945            }
5946
5947            // Decode unknown envelopes for gaps in ordinals.
5948            while _next_ordinal_to_read < 2 {
5949                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5950                _next_ordinal_to_read += 1;
5951                next_offset += envelope_size;
5952            }
5953
5954            let next_out_of_line = decoder.next_out_of_line();
5955            let handles_before = decoder.remaining_handles();
5956            if let Some((inlined, num_bytes, num_handles)) =
5957                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5958            {
5959                let member_inline_size = <fidl::encoding::Endpoint<
5960                    fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
5961                > as fidl::encoding::TypeMarker>::inline_size(
5962                    decoder.context
5963                );
5964                if inlined != (member_inline_size <= 4) {
5965                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5966                }
5967                let inner_offset;
5968                let mut inner_depth = depth.clone();
5969                if inlined {
5970                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5971                    inner_offset = next_offset;
5972                } else {
5973                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5974                    inner_depth.increment()?;
5975                }
5976                let val_ref = self.coordinator_listener.get_or_insert_with(|| {
5977                    fidl::new_empty!(
5978                        fidl::encoding::Endpoint<
5979                            fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
5980                        >,
5981                        fidl::encoding::DefaultFuchsiaResourceDialect
5982                    )
5983                });
5984                fidl::decode!(
5985                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
5986                    fidl::encoding::DefaultFuchsiaResourceDialect,
5987                    val_ref,
5988                    decoder,
5989                    inner_offset,
5990                    inner_depth
5991                )?;
5992                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5993                {
5994                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5995                }
5996                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5997                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5998                }
5999            }
6000
6001            next_offset += envelope_size;
6002
6003            // Decode the remaining unknown envelopes.
6004            while next_offset < end_offset {
6005                _next_ordinal_to_read += 1;
6006                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6007                next_offset += envelope_size;
6008            }
6009
6010            Ok(())
6011        }
6012    }
6013
6014    impl ProviderOpenCoordinatorWithListenerForVirtconRequest {
6015        #[inline(always)]
6016        fn max_ordinal_present(&self) -> u64 {
6017            if let Some(_) = self.coordinator_listener {
6018                return 2;
6019            }
6020            if let Some(_) = self.coordinator {
6021                return 1;
6022            }
6023            0
6024        }
6025    }
6026
6027    impl fidl::encoding::ResourceTypeMarker for ProviderOpenCoordinatorWithListenerForVirtconRequest {
6028        type Borrowed<'a> = &'a mut Self;
6029        fn take_or_borrow<'a>(
6030            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6031        ) -> Self::Borrowed<'a> {
6032            value
6033        }
6034    }
6035
6036    unsafe impl fidl::encoding::TypeMarker for ProviderOpenCoordinatorWithListenerForVirtconRequest {
6037        type Owned = Self;
6038
6039        #[inline(always)]
6040        fn inline_align(_context: fidl::encoding::Context) -> usize {
6041            8
6042        }
6043
6044        #[inline(always)]
6045        fn inline_size(_context: fidl::encoding::Context) -> usize {
6046            16
6047        }
6048    }
6049
6050    unsafe impl
6051        fidl::encoding::Encode<
6052            ProviderOpenCoordinatorWithListenerForVirtconRequest,
6053            fidl::encoding::DefaultFuchsiaResourceDialect,
6054        > for &mut ProviderOpenCoordinatorWithListenerForVirtconRequest
6055    {
6056        unsafe fn encode(
6057            self,
6058            encoder: &mut fidl::encoding::Encoder<
6059                '_,
6060                fidl::encoding::DefaultFuchsiaResourceDialect,
6061            >,
6062            offset: usize,
6063            mut depth: fidl::encoding::Depth,
6064        ) -> fidl::Result<()> {
6065            encoder
6066                .debug_check_bounds::<ProviderOpenCoordinatorWithListenerForVirtconRequest>(offset);
6067            // Vector header
6068            let max_ordinal: u64 = self.max_ordinal_present();
6069            encoder.write_num(max_ordinal, offset);
6070            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6071            // Calling encoder.out_of_line_offset(0) is not allowed.
6072            if max_ordinal == 0 {
6073                return Ok(());
6074            }
6075            depth.increment()?;
6076            let envelope_size = 8;
6077            let bytes_len = max_ordinal as usize * envelope_size;
6078            #[allow(unused_variables)]
6079            let offset = encoder.out_of_line_offset(bytes_len);
6080            let mut _prev_end_offset: usize = 0;
6081            if 1 > max_ordinal {
6082                return Ok(());
6083            }
6084
6085            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6086            // are envelope_size bytes.
6087            let cur_offset: usize = (1 - 1) * envelope_size;
6088
6089            // Zero reserved fields.
6090            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6091
6092            // Safety:
6093            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6094            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6095            //   envelope_size bytes, there is always sufficient room.
6096            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6097            self.coordinator.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6098            encoder, offset + cur_offset, depth
6099        )?;
6100
6101            _prev_end_offset = cur_offset + envelope_size;
6102            if 2 > max_ordinal {
6103                return Ok(());
6104            }
6105
6106            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6107            // are envelope_size bytes.
6108            let cur_offset: usize = (2 - 1) * envelope_size;
6109
6110            // Zero reserved fields.
6111            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6112
6113            // Safety:
6114            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6115            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6116            //   envelope_size bytes, there is always sufficient room.
6117            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6118            self.coordinator_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6119            encoder, offset + cur_offset, depth
6120        )?;
6121
6122            _prev_end_offset = cur_offset + envelope_size;
6123
6124            Ok(())
6125        }
6126    }
6127
6128    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6129        for ProviderOpenCoordinatorWithListenerForVirtconRequest
6130    {
6131        #[inline(always)]
6132        fn new_empty() -> Self {
6133            Self::default()
6134        }
6135
6136        unsafe fn decode(
6137            &mut self,
6138            decoder: &mut fidl::encoding::Decoder<
6139                '_,
6140                fidl::encoding::DefaultFuchsiaResourceDialect,
6141            >,
6142            offset: usize,
6143            mut depth: fidl::encoding::Depth,
6144        ) -> fidl::Result<()> {
6145            decoder.debug_check_bounds::<Self>(offset);
6146            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6147                None => return Err(fidl::Error::NotNullable),
6148                Some(len) => len,
6149            };
6150            // Calling decoder.out_of_line_offset(0) is not allowed.
6151            if len == 0 {
6152                return Ok(());
6153            };
6154            depth.increment()?;
6155            let envelope_size = 8;
6156            let bytes_len = len * envelope_size;
6157            let offset = decoder.out_of_line_offset(bytes_len)?;
6158            // Decode the envelope for each type.
6159            let mut _next_ordinal_to_read = 0;
6160            let mut next_offset = offset;
6161            let end_offset = offset + bytes_len;
6162            _next_ordinal_to_read += 1;
6163            if next_offset >= end_offset {
6164                return Ok(());
6165            }
6166
6167            // Decode unknown envelopes for gaps in ordinals.
6168            while _next_ordinal_to_read < 1 {
6169                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6170                _next_ordinal_to_read += 1;
6171                next_offset += envelope_size;
6172            }
6173
6174            let next_out_of_line = decoder.next_out_of_line();
6175            let handles_before = decoder.remaining_handles();
6176            if let Some((inlined, num_bytes, num_handles)) =
6177                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6178            {
6179                let member_inline_size = <fidl::encoding::Endpoint<
6180                    fidl::endpoints::ServerEnd<CoordinatorMarker>,
6181                > as fidl::encoding::TypeMarker>::inline_size(
6182                    decoder.context
6183                );
6184                if inlined != (member_inline_size <= 4) {
6185                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6186                }
6187                let inner_offset;
6188                let mut inner_depth = depth.clone();
6189                if inlined {
6190                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6191                    inner_offset = next_offset;
6192                } else {
6193                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6194                    inner_depth.increment()?;
6195                }
6196                let val_ref = self.coordinator.get_or_insert_with(|| {
6197                    fidl::new_empty!(
6198                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
6199                        fidl::encoding::DefaultFuchsiaResourceDialect
6200                    )
6201                });
6202                fidl::decode!(
6203                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
6204                    fidl::encoding::DefaultFuchsiaResourceDialect,
6205                    val_ref,
6206                    decoder,
6207                    inner_offset,
6208                    inner_depth
6209                )?;
6210                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6211                {
6212                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6213                }
6214                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6215                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6216                }
6217            }
6218
6219            next_offset += envelope_size;
6220            _next_ordinal_to_read += 1;
6221            if next_offset >= end_offset {
6222                return Ok(());
6223            }
6224
6225            // Decode unknown envelopes for gaps in ordinals.
6226            while _next_ordinal_to_read < 2 {
6227                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6228                _next_ordinal_to_read += 1;
6229                next_offset += envelope_size;
6230            }
6231
6232            let next_out_of_line = decoder.next_out_of_line();
6233            let handles_before = decoder.remaining_handles();
6234            if let Some((inlined, num_bytes, num_handles)) =
6235                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6236            {
6237                let member_inline_size = <fidl::encoding::Endpoint<
6238                    fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
6239                > as fidl::encoding::TypeMarker>::inline_size(
6240                    decoder.context
6241                );
6242                if inlined != (member_inline_size <= 4) {
6243                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6244                }
6245                let inner_offset;
6246                let mut inner_depth = depth.clone();
6247                if inlined {
6248                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6249                    inner_offset = next_offset;
6250                } else {
6251                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6252                    inner_depth.increment()?;
6253                }
6254                let val_ref = self.coordinator_listener.get_or_insert_with(|| {
6255                    fidl::new_empty!(
6256                        fidl::encoding::Endpoint<
6257                            fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
6258                        >,
6259                        fidl::encoding::DefaultFuchsiaResourceDialect
6260                    )
6261                });
6262                fidl::decode!(
6263                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
6264                    fidl::encoding::DefaultFuchsiaResourceDialect,
6265                    val_ref,
6266                    decoder,
6267                    inner_offset,
6268                    inner_depth
6269                )?;
6270                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6271                {
6272                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6273                }
6274                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6275                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6276                }
6277            }
6278
6279            next_offset += envelope_size;
6280
6281            // Decode the remaining unknown envelopes.
6282            while next_offset < end_offset {
6283                _next_ordinal_to_read += 1;
6284                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6285                next_offset += envelope_size;
6286            }
6287
6288            Ok(())
6289        }
6290    }
6291}