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